A data export method and device, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINZHUAN INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2022-11-29
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]本申请实施例的目的在于提供一种数据导出方法及装置、电子设备及存储介质,解决了现有技术中存在的分布式数据导出后一致性差、导出过程复杂且导出速率慢的技术问题
[0013] The data export method, apparatus, electronic device, and storage medium provided in this application embodiment send export information to a computing node; after the computing node forwards the export information to a data node, it receives interval information forwarded by the computing node; and sends an export statement to the computing node based on the interval information. The computing node forwards the export statement to the data node and receives the data stored on the leaf nodes within the interval exported by the data node based on the export statement. It also receives the export result forwarded by the computing node and determines the export file based on the export result. In other words, based on the location of the data to be exported in the distributed database and the interval of nodes that have not yet undergone write operations, the export statement is determined and the data to be exported is exported. Nodes undergoing write operations will be exported after the operations are completed. This solves the technical problems of poor consistency, complex export process, and slow export rate after distributed data export in the prior art.
Smart Images

Figure CN115757424B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data export method and apparatus, electronic device and storage medium. Background Technology
[0002] Data export is a crucial step in the data migration process of a distributed database system, and the speed of data export directly determines the migration time. Existing data export methods involve exporting data from each data node in the distributed database and then merging it into a single file. This method exports the data of a single data node as a whole, guaranteeing consistency only for that individual node, and does not support cross-shard joint export. Furthermore, each data node requires an additional monitoring module to handle its export, resulting in a slow export rate. Therefore, existing data export methods suffer from poor consistency after distributed data export, complex export processes, and slow export speeds. Summary of the Invention
[0003] The purpose of this application is to provide a data export method, apparatus, electronic device, and storage medium, solving the technical problems of poor consistency, complex export process, and slow export speed after distributed data export in the prior art. The specific technical solution is as follows:
[0004] In a first aspect of this application, a data export method is provided, the method being applied to an export tool, comprising: sending export information to a computing node; receiving interval information forwarded by the computing node after the computing node forwards the export information to a data node; sending an export statement to the computing node based on the interval information; wherein the computing node forwards the export statement to the data node and receives data stored on leaf nodes within the interval exported by the data node based on the export statement; receiving the export result forwarded by the computing node, and determining an export file based on the export result.
[0005] In a second aspect of this application, a data export method is provided, the method being applied to a computing node, comprising: receiving export information sent by an export tool and forwarding the export information to a data node, wherein the export information is used to characterize the storage location of the data to be exported in the data node;
[0006] The system receives interval information sent by the data node in response to the export information, wherein the interval information includes information used to characterize leaf nodes within the interval that have not been written to; forwards the interval information to the export tool; receives the export statement generated by the export tool in response to the interval information and forwards the export statement to the data node, wherein the export statement is used to export the data stored on the leaf nodes within the interval; receives the export result fed back by the data node and forwards the export result to the export tool, wherein the export result includes the data stored on the leaf nodes within the interval.
[0007] In a third aspect of this application, a data export method is provided, the method being applied to a data node, comprising: receiving export information sent by a computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node; scanning the tree structure under the data node based on the export information to determine the interval where free data is located; sending interval information to the computing node, wherein the interval information includes information characterizing leaf nodes within the interval that have not been written to; receiving an export statement forwarded by the computing node, wherein the export statement is generated by an export tool based on the interval information and sent to the computing node; and sending an export result to the computing node based on the export statement, wherein the export result includes the data stored on the leaf nodes within the interval.
[0008] In a fourth aspect of this application, a data export apparatus is also provided. The apparatus is applied to an export tool and includes: a first sending module for sending export information to a computing node, wherein the export information characterizes the storage location of the data to be exported on the data node; a first receiving module for receiving interval information forwarded by the computing node after the computing node forwards the export information to the data node, wherein the interval information includes information characterizing leaf nodes within the interval that have not been written to; a second sending module for sending an export statement to the computing node based on the interval information; wherein the computing node forwards the export statement to the data node and receives the data stored on the leaf nodes within the interval exported by the data node based on the export statement; and a second receiving module for receiving the export result forwarded by the computing node and determining an export file based on the export result, wherein the export result includes the data stored on the leaf nodes within the interval.
[0009] In a fifth aspect of this application, a data export apparatus is also provided, the apparatus being applied to a computing node, comprising: a first processing module, configured to receive export information sent by an export tool and forward the export information to a data node, wherein the export information is used to characterize the storage location of the data to be exported in the data node; a third receiving module, configured to receive interval information from the data node in response to the export information, wherein the interval information includes information characterizing leaf nodes within the interval that have not been written to; a forwarding module, configured to forward the interval information to the export tool; a second processing module, configured to receive an export statement generated by the export tool in response to the interval information and forward the export statement to the data node, wherein the export statement is used to export the data stored on the leaf nodes within the interval; and a third processing module, configured to receive the export result fed back by the data node and forward the export result to the export tool, wherein the export result includes the data stored on the leaf nodes within the interval.
[0010] In a sixth aspect of this application, a data export apparatus is also provided, the apparatus being applied to a data node, comprising: a fourth receiving module for receiving export information sent by a computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node; a fourth processing module for scanning the tree structure under the data node based on the export information to determine the interval where free data is located; a third sending module for sending interval information to the computing node, wherein the interval information includes information characterizing leaf nodes within the interval that have not been written to; a fifth receiving module for receiving an export statement forwarded by the computing node, wherein the export statement is generated by an export tool based on the interval information and sent to the computing node; and a fourth sending module for sending an export result to the computing node based on the export statement, wherein the export result includes the data stored on the leaf nodes within the interval.
[0011] In a seventh aspect of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor, when executing the program stored in the memory, implements the data export method described in the first, second, or third aspect.
[0012] In a fourth aspect of this application, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the data export method described in the first, second, or third aspect above.
[0013] The data export method, apparatus, electronic device, and storage medium provided in this application embodiment send export information to a computing node; after the computing node forwards the export information to a data node, it receives interval information forwarded by the computing node; and sends an export statement to the computing node based on the interval information. The computing node forwards the export statement to the data node and receives the data stored on the leaf nodes within the interval exported by the data node based on the export statement. It also receives the export result forwarded by the computing node and determines the export file based on the export result. In other words, based on the location of the data to be exported in the distributed database and the interval of nodes that have not yet undergone write operations, the export statement is determined and the data to be exported is exported. Nodes undergoing write operations will be exported after the operations are completed. This solves the technical problems of poor consistency, complex export process, and slow export rate after distributed data export in the prior art. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0015] Figure 1 This is one of the flowcharts for the data export method in the embodiments of this application;
[0016] Figure 2 This is a schematic diagram of the network model for the data export method in the embodiments of this application;
[0017] Figure 3 This is the second flowchart of the data export method in the embodiments of this application;
[0018] Figure 4 This is the third flowchart of the data export method in the embodiments of this application;
[0019] Figure 5 This is a schematic diagram of the data node structure of the data export method in the embodiments of this application;
[0020] Figure 6 This is one of the flowcharts of the second exemplary example of the data export method in the embodiments of this application;
[0021] Figure 7 This is the second exemplary flowchart of the data export method in the embodiments of this application;
[0022] Figure 8 This is one of the schematic diagrams of the data export device in the embodiments of this application;
[0023] Figure 9 This is the second schematic diagram of the data export device structure in the embodiments of this application;
[0024] Figure 10 This is the third schematic diagram of the data export device structure in the embodiments of this application;
[0025] Figure 11 This is a schematic diagram of the structure of the electronic device in the embodiments of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] In the following description, suffixes such as "module" and "unit" used to denote elements are used only for the purposes of this application and have no specific meaning in themselves. Therefore, "module" and "component" can be used interchangeably.
[0028] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. The embodiments of this application provide a data export method, applied to an export tool, such as... Figure 1 As shown, the method includes the following steps:
[0029] Step 102: Send export information to the compute node, wherein the export information is used to characterize the storage location of the data to be exported on the data node;
[0030] It should be noted that the export tool establishes a link with the corresponding compute node based on the export information; the compute node is used to provide database instance access services, optimize Structured Query Language (SQL) routing, and balance the load of data nodes; the export information includes the exported database tables, and the database table structure includes the data node information where the data to be exported is located and the storage location information on the data node; the compute node establishes a link with the corresponding data node based on the database table structure.
[0031] Step 104: After the compute node forwards the exported information to the data node, receive the interval information forwarded by the compute node, wherein the interval information includes information used to characterize the leaf nodes within the interval that have not been written to.
[0032] It should be noted that the interval information is determined by the data node based on whether the leaf node is in a state where a write operation is being performed.
[0033] Step 106: Send an export statement to the compute node based on the interval information; wherein, the compute node forwards the export statement to the data node and receives the data stored on the leaf nodes within the interval exported by the data node based on the export statement;
[0034] It should be noted that the exported statements include Structured Query Language (SQL), such as SELECT statements.
[0035] Step 108: Receive the exported results forwarded by the computing node, and determine the exported file based on the exported results. The exported results include the data stored on the leaf nodes within the interval.
[0036] It should be noted that the export tool executes export statements to export data; determining the export file based on the export results means that the export tool merges the export results into a complete export file; the data export method provided in this application embodiment has the following network model diagram: Figure 2 As shown, it involves three components: export tool, computing node, and data node. The data node includes data node 1 to data node N, where N is a positive integer.
[0037] Through steps 102 to 108 of this application embodiment, export information is sent to the computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node; after the computing node forwards the export information to the data node, the interval information forwarded by the computing node is received, wherein the interval information includes information used to characterize the leaf nodes within the interval that have not been written to; an export statement is sent to the computing node based on the interval information; wherein the computing node forwards the export statement to the data node and receives the data stored on the leaf nodes within the interval exported by the data node based on the export statement; the export result forwarded by the computing node is received, and the export file is determined based on the export result, wherein the export result includes the data stored on the leaf nodes within the interval; that is, based on the location of the data to be exported in the distributed database and the interval of the nodes that have not been written to, the export statement is determined and the data to be exported is exported, and the nodes that are being written to are exported after the operation is completed. The data export method provided by this application embodiment can export distributed data in parallel, and can also export data efficiently in high-concurrency scenarios, thereby solving the technical problems of poor consistency after exporting distributed data, complex export process and slow export rate in the prior art.
[0038] In an optional embodiment of this application, step 102, which involves sending export information to the computing node, includes:
[0039] Step 12: Generate export information and establish links with computing nodes based on the export information;
[0040] It should be noted that the export information refers to the export task; the export information includes the exported database tables, and the database table structure includes the data node information where the data to be exported is located and the storage location information on the data node.
[0041] Step 14: Send export information to the compute node.
[0042] As can be seen, the data export method and export tool provided in this application embodiment can establish a link with the computing node based on the export information and send the export information. The computing node and the corresponding data node are linked to realize the export of distributed data.
[0043] In an optional embodiment of this application, the data export method provided in this application includes identification information in the interval information, which is used to identify whether all the data to be exported has been exported.
[0044] It should be noted that when not all data to be exported has been exported, the interval information includes an indicator indicating that the export is incomplete; when all data to be exported has been exported, the interval information includes an indicator indicating that the export is complete.
[0045] This application provides a data export method applied to computing nodes, such as... Figure 3 As shown, the method includes the following steps:
[0046] Step 202: Receive the export information sent by the export tool and forward the export information to the data node. The export information is used to indicate the storage location of the data to be exported in the data node.
[0047] It should be noted that compute nodes are used to provide database instance access services, optimize SQL routing, and balance the load on data nodes; the exported information includes the exported database tables, and the database table structure includes the data node information where the data to be exported is located and the storage location information on the data node; compute nodes establish links with the corresponding data nodes based on the database table structure.
[0048] Step 204: Receive interval information from the data node in response to the exported information, wherein the interval information includes information for characterizing leaf nodes within the interval that have not been written to.
[0049] It should be noted that the interval information is determined by the data node based on whether the leaf node is in a state where a write operation is being performed.
[0050] Step 206: Forward the interval information to the export tool;
[0051] Step 208: Receive the export statement generated by the export tool in response to the interval information, and forward the export statement to the data node. The export statement is used to export the data stored on the leaf nodes within the interval.
[0052] It should be noted that the exported statements include Structured Query Language (SQL), such as SELECT statements.
[0053] Step 210: Receive the export results from the data nodes and forward them to the export tool. The export results include the data stored on the leaf nodes within the interval.
[0054] Through steps 202 to 210 of this embodiment, export information sent by the export tool is received and forwarded to the data node, wherein the export information is used to characterize the storage location of the data to be exported in the data node; interval information is received from the data node in response to the export information, wherein the interval information includes information used to characterize the leaf nodes within the interval that have not been written to; the interval information is forwarded to the export tool; the export statement generated by the export tool in response to the interval information is received and forwarded to the data node, wherein the export statement is used to export the data stored on the leaf nodes within the interval; the export result is received from the data node and forwarded to the export tool, wherein the export result includes the data stored on the leaf nodes within the interval; that is, based on the location of the data to be exported in the distributed database and the interval of the nodes that have not been written to, the export statement is determined and the data to be exported is exported, and the nodes that are being written to are exported after the operation is completed. The data export method provided by this embodiment can export distributed data in parallel and can also export data efficiently in high-concurrency scenarios, thereby solving the technical problems of poor consistency after exporting distributed data, complex export process and slow export rate in the prior art.
[0055] In an optional embodiment of this application, step 202, which involves forwarding the exported information to the data node, includes:
[0056] Step 22: Establish links between data nodes based on the exported information;
[0057] It should be noted that the export information refers to the export task; the export information includes the exported database tables, and the database table structure includes the data node information where the data to be exported is located and the storage location information on the data node.
[0058] Step 24: Forward the exported information to the data nodes.
[0059] This application provides a data export method, applied to data nodes, such as... Figure 4 As shown, the method includes the following steps:
[0060] Step 302: Receive export information sent by the computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node;
[0061] It should be noted that data nodes are components used to manage data storage and actual data storage; exported information includes exported database tables, the database table structure of which includes information about the data nodes where the data to be exported resides and their storage location information on the data nodes; compute nodes establish links with the corresponding data nodes based on the database table structure.
[0062] Step 304: Scan the tree structure under the data nodes based on the exported information to determine the range where the free data is located;
[0063] It should be noted that the data node storage model includes tree structures; in the first example, the data node adopts a B+ tree structure, such as... Figure 5 As shown, node 0 is the root node, nodes 1 and 2 are internal nodes, and nodes 3 to 8 are leaf nodes. Data is stored in the leaf nodes. The child node 6 of internal node 2 is in a state where a write operation is being performed, while the child nodes of internal node 1 are not in a state where a write operation is being performed. Therefore, the interval where the free data is located is (3,5).
[0064] Step 306: Send interval information to the computing node, wherein the interval information includes information for characterizing the leaf nodes within the interval that have not been written to;
[0065] It should be noted that the interval information is determined by the data node based on whether the leaf node is in the state of being written. The interval information includes the interval where the free data is located and the identification information used to indicate whether all the data to be exported has been exported. In the first example above, the interval information includes the interval (3,5) where the free data is located and the identification information indicating that the export is not completed.
[0066] Step 308: Receive the export statement forwarded by the computing node, wherein the export statement is generated by the export tool based on the interval information and sent to the computing node;
[0067] It should be noted that the exported statements include Structured Query Language (SQL), such as SELECT statements.
[0068] Step 310: Send the export results to the computing nodes based on the export statement, wherein the export results include the data stored on the leaf nodes within the interval.
[0069] Through steps 302 to 310 of the embodiments of this application, export information sent by the computing node is received, wherein the export information is used to characterize the storage location of the data to be exported on the data node; the tree structure under the data node is scanned based on the export information to determine the interval where the free data is located; interval information is sent to the computing node, wherein the interval information includes information used to characterize the leaf nodes within the interval that have not been written to; export statements forwarded by the computing node are received, wherein the export statements are generated by the export tool based on the interval information and sent to the computing node; export results are sent to the computing node based on the export statements, wherein the export results include the data stored on the leaf nodes within the interval; that is, based on the location of the data to be exported in the distributed database and the interval of the nodes that have not been written to, the export statement is determined and the data to be exported is exported, and the nodes that are being written to are exported after the operation is completed. The data export method provided by the embodiments of this application can export distributed data in parallel, and can also export data efficiently in high-concurrency scenarios, thereby solving the technical problems of poor consistency after exporting distributed data, complex export process and slow export rate in the prior art.
[0070] In an optional embodiment of this application, step 306, which involves sending interval information to the computing node, includes:
[0071] Step 32: Determine the parent node of the leaf node within the interval that has not undergone a write operation;
[0072] It should be noted that in the first example above, the parent node of leaf nodes 3 to 5 is internal node 1, and the parent node of leaf nodes 6 to 8 is internal node 2.
[0073] Step 34: If no write operation has been performed on the leaf nodes corresponding to the parent node, lock the parent node to put the parent node and its corresponding leaf nodes into read-only mode.
[0074] It should be noted that after locking the parent node, the parent node and its descendants are prohibited from being written to. In the first example above, when the root node 0 is locked, nodes 0 to 8 are all prohibited from being written to. When the internal node 1 is locked, nodes 1 and 3 to 5 are prohibited from being written to.
[0075] Step 36: Send interval information to the computing node.
[0076] As can be seen, the data export method provided in this application locks the parent nodes of the corresponding leaf nodes that have not been written to after determining the range where the idle data is located. In the case of transaction concurrency in a distributed database, the leaf nodes where the idle data is located can be exported, resulting in high processing efficiency.
[0077] In an optional embodiment of this application, the data export method provided in this application includes identification information in the interval information, which is used to identify whether all the data to be exported has been exported.
[0078] It should be noted that, when not all the data to be exported has been exported, the interval information includes an indicator that the export is incomplete; when all the data to be exported has been exported, the interval information includes an indicator that the export is complete; in the first example above, the interval information includes the interval (3,5) where the idle data is located and the indicator that the export is incomplete.
[0079] As can be seen, the data export method provided in this application embodiment can return identification information indicating whether all the data to be exported has been exported, which helps to confirm the data export process.
[0080] In an optional embodiment of this application, the data export method provided in this application sends the interval information to the computing node again after the write operation of the leaf node to which the write operation was performed stops.
[0081] It should be noted that after the write operation on the leaf node that was being written to stops, the export tool sends the interval information to the compute node again. Based on the resent interval information, the export tool sends an export statement to the compute node, receives the export result forwarded by the compute node, determines the export file based on the export result, and continues until the identification information indicates that all data to be exported has been exported.
[0082] As can be seen, the data export method provided in this application embodiment can prioritize exporting data from leaf nodes that have not been written to, and then export the data after the write operation of the leaf nodes that have been written to has stopped, resulting in high export efficiency.
[0083] In an optional embodiment of this application, the data export method provided in this application, in a second exemplary example, has one of the flowcharts as shown below. Figure 6 As shown in the flowchart, the second one is as follows: Figure 7 As shown, it includes:
[0084] Step 401: The export tool generates export information, establishes a link with the computing node based on the export information, and sends the export information to the computing node;
[0085] Step 402: The compute node receives the exported information and forwards it to the data node;
[0086] Step 403: The data node receives the exported information and scans the tree nodes under the data node based on the exported information to determine the range where the free data is located;
[0087] Step 404: The data node sends the interval information to the computing node;
[0088] Step 405: The compute node receives the interval information sent by the data node in response to the exported information and forwards the interval information to the export tool;
[0089] Step 406: The export tool receives the interval information forwarded by the computing node and sends an export statement to the computing node based on the interval information;
[0090] Step 407: The compute node receives the export statement generated by the export tool in response to the interval information and forwards the export statement to the data node;
[0091] Step 408: The data node receives the export statement forwarded by the compute node and sends the export result to the compute node based on the export statement;
[0092] Step 409: The compute node receives the export results from the data node and forwards the export results to the export tool;
[0093] Step 410: The export tool receives the export results forwarded by the compute node, merges the export results into a complete file, and identifies this file as the export file.
[0094] As can be seen, the data export method provided in this application embodiment can determine the export statement and export the data based on the location of the data to be exported in the distributed database and the range of nodes that have not been written to. The data to be exported is exported after the nodes that are being written to have completed the operation. This solves the technical problems of poor consistency, complex export process and slow export speed of distributed data in the prior art.
[0095] This application provides a data export device for use with export tools, such as... Figure 8 As shown, the device includes:
[0096] The first sending module 42 is used to send export information to the computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node;
[0097] The first receiving module 44 is used to receive the interval information forwarded by the computing node after the computing node forwards the exported information to the data node. The interval information includes information used to characterize the leaf nodes within the interval that have not been written to.
[0098] The second sending module 46 is used to send an export statement to the computing node based on the interval information; wherein, the computing node forwards the export statement to the data node and receives the data stored on the leaf nodes within the interval exported by the data node based on the export statement.
[0099] The second receiving module 48 is used to receive the exported results forwarded by the computing node and determine the exported file based on the exported results. The exported results include the data stored on the leaf nodes within the interval.
[0100] The data export apparatus provided in this application embodiment is applied to an export tool. A first sending module sends export information to a computing node, where the export information represents the storage location of the data to be exported on the data node. A first receiving module receives interval information forwarded by the computing node after the computing node forwards the export information to the data node. The interval information includes information representing leaf nodes within the interval that have not undergone write operations. A second sending module sends an export statement to the computing node based on the interval information. The computing node forwards the export statement to the data node and receives the data stored on the leaf nodes within the interval exported by the data node based on the export statement. The second receiving module receives the export result forwarded by the computing node and determines the export file based on the export result. The export result includes the data stored on the leaf nodes within the interval. In other words, based on the location of the data to be exported in the distributed database and the interval of nodes that have not undergone write operations, an export statement is determined and the data to be exported is exported. Nodes undergoing write operations are exported after the operations are completed. This solves the technical problems of poor consistency, complex export process, and slow export rate in the prior art after distributed data export.
[0101] This application provides a data export device applied to a computing node, such as... Figure 9 As shown, the device includes:
[0102] The first processing module 52 is used to receive export information sent by the export tool and forward the export information to the data node, wherein the export information is used to characterize the storage location of the data to be exported in the data node.
[0103] The third receiving module 54 is used to receive interval information sent by the data node in response to the export information, wherein the interval information includes information for characterizing leaf nodes within the interval that have not been written to.
[0104] Forwarding module 56 is used to forward range information to the export tool;
[0105] The second processing module 58 is used to receive the export statement generated by the export tool in response to the interval information and forward the export statement to the data node. The export statement is used to export the data stored on the leaf nodes within the interval.
[0106] The third processing module 510 is used to receive the export results fed back by the data nodes and forward the export results to the export tool. The export results include the data stored on the leaf nodes within the interval.
[0107] The data export device provided in this application embodiment is applied to a computing node. A first processing module receives export information sent by an export tool and forwards it to a data node. The export information represents the storage location of the data to be exported on the data node. A third receiving module receives interval information from the data node in response to the export information. The interval information includes information representing leaf nodes within the interval that have not undergone write operations. A forwarding module forwards the interval information to the export tool. A second processing module receives an export statement generated by the export tool in response to the interval information and forwards it to the data node. The export statement is used to export the data stored on the leaf nodes within the interval. A third processing module receives the export result fed back by the data node and forwards it to the export tool. The export result includes the data stored on the leaf nodes within the interval. In other words, based on the location of the data to be exported in the distributed database and the interval of nodes that have not undergone write operations, an export statement is determined and the data to be exported is exported. Nodes undergoing write operations are exported after the operations are completed. This solves the technical problems of poor consistency, complex export process, and slow export rate in the prior art after distributed data export.
[0108] This application provides a data export device applied to a data node, such as... Figure 10 As shown, the device includes:
[0109] The fourth receiving module 62 is used to receive export information sent by the computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node;
[0110] The fourth processing module 64 is used to scan the tree structure under the data node based on the exported information to determine the range where the free data is located.
[0111] The third sending module 66 is used to send interval information to the computing node, wherein the interval information includes information for characterizing leaf nodes within the interval that have not been written to.
[0112] The fifth receiving module 68 is used to receive the export statement forwarded by the computing node, wherein the export statement is generated by the export tool based on the interval information and sent to the computing node;
[0113] The fourth sending module 610 is used to send the export result to the computing node based on the export statement, wherein the export result includes the data stored on the leaf nodes within the interval.
[0114] The data export device provided in this application embodiment is applied to a data node. A fourth receiving module receives export information sent by a computing node, where the export information represents the storage location of the data to be exported on the data node. A fourth processing module scans the tree structure under the data node based on the export information to determine the interval where free data is located. A third sending module sends interval information to the computing node, where the interval information includes information representing leaf nodes within the interval that have not undergone write operations. A fifth receiving module receives an export statement forwarded by the computing node, where the export statement is generated by an export tool based on the interval information and sent to the computing node. The fourth sending module sends an export result to the computing node based on the export statement, where the export result includes the data stored on the leaf nodes within the interval. In other words, based on the location of the data to be exported in the distributed database and the interval of nodes that have not undergone write operations, an export statement is determined and the data to be exported is exported. Nodes undergoing write operations are exported after the operations are completed, thereby solving the technical problems of poor consistency, complex export process, and slow export rate in the prior art after distributed data export.
[0115] This application also provides an electronic device, such as... Figure 11 As shown, it includes a processor 71, a communication interface 72, a memory 73, and a communication bus 74. The processor 71, the communication interface 72, and the memory 73 communicate with each other through the communication bus 74.
[0116] Memory 73 is used to store computer programs;
[0117] When processor 71 executes the program stored in memory 73, it implements... Figure 1 or Figure 3 or Figure 4 The methods and steps described, and their functions and effects Figure 1 or Figure 3 or Figure 4 The methods and steps are the same as those in the previous section, so I will not repeat them here.
[0118] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0119] The communication interface is used for communication between the aforementioned terminal and other devices.
[0120] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0121] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0122] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the data export methods described in the above embodiments.
[0123] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the data export methods described in the above embodiments.
[0124] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0125] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0126] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0127] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A data export method, applied to data nodes, characterized in that, include: Receive export information sent by the computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node; Based on the exported information, scan the tree structure under the data node to determine the interval where the free data is located; Send interval information to the computing node, wherein the interval information includes information for characterizing leaf nodes within the interval that have not been written to; The computing node receives an export statement forwarded by the computing node, wherein the export statement is generated by the export tool based on the interval information and sent to the computing node. The export result is sent to the computing node based on the export statement, wherein the export result includes the data stored on the leaf nodes within the interval; Sending interval information to the computing node includes: Determine the parent node of the leaf node within the specified interval that has not been written to. If no write operation is performed on the leaf nodes corresponding to the parent node, the parent node is locked to put the parent node and its corresponding leaf nodes into read-only mode. Send interval information to the computing node.
2. The method according to claim 1, characterized in that, The interval information also includes identification information, which is used to identify whether all the data to be exported has been exported.
3. The method according to claim 2, characterized in that, The method further includes: After the write operation on the leaf node that was being written to stops, the interval information is sent to the compute node again.
4. A data export device, applied to a data node, characterized in that, include: The fourth receiving module is used to receive export information sent by the computing node, wherein the export information is used to characterize the storage location of the data to be exported on the data node; The fourth processing module is used to scan the tree structure under the data node based on the exported information to determine the interval where the free data is located; The third sending module is used to send interval information to the computing node, wherein the interval information includes information for characterizing leaf nodes within the interval that have not been written to. The fifth receiving module is used to receive the export statement forwarded by the computing node, wherein the export statement is generated by the export tool based on the interval information and sent to the computing node; The fourth sending module is used to send the export result to the computing node based on the export statement, wherein the export result includes the data stored on the leaf nodes within the interval; The third sending module is further configured to perform the following steps: Determine the parent node of the leaf node within the specified interval that has not been written to. If no write operation is performed on the leaf nodes corresponding to the parent node, the parent node is locked to put the parent node and its corresponding leaf nodes into read-only mode. Send interval information to the computing node.
5. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-3.
Citation Information
Patent Citations
Data exporting method, device, exporting node, medium and system
CN114942955A