A data extraction method and device
By obtaining data block information and receiving extraction messages in the ETL tool, the status of the data block is determined, and the breakpoint resume transmission of the data exchange task is realized, which solves the problem of low restart efficiency after task interruption and improves the execution efficiency of the data exchange task.
Patent Information
- Application Number
- CN202111466573.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-12-03
AI Technical Summary
In ETL tools, after a network abnormality causes the data exchange task to be interrupted, it is necessary to delete part of the data that has been exchanged and re-execute the task, resulting in a waste of time.
By obtaining the data block information in the ETL tool and receiving the extraction start and end messages of the data block, the extraction result of the data block is determined, breakpoint resume transmission is realized, and the deletion and re-extraction of duplicate data blocks are avoided.
It improves the execution efficiency of data exchange tasks after restarting, realizes the ability to resume transmission at breakpoints, and avoids wasting time.
Smart Images

Figure CN114297273B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data exchange, and in particular to a data extraction method, device, electronic device and machine-readable storage medium. Background Art
[0002] ETL (Extract-Transform-Load) can be used to describe the process of extracting, transforming, and loading data from the data source to the destination. ETL is an important part of BI (Business Intelligence) projects. It can integrate scattered, disorganized, and non-standard data in an enterprise and provide an analytical basis for the enterprise's decision-making.
[0003] In actual applications, ETL tools can be used to create and execute data exchange tasks to achieve data exchange between the data source and the destination. The start time, end time, and execution results of the data exchange tasks can also be obtained through the logs recorded by the ETL tools.
[0004] In the related art, if the data exchange task is interrupted due to network anomalies or other reasons, after restarting the data exchange task, it is necessary to delete part of the exchanged data and re-execute the data exchange task, resulting in a waste of time. Summary of the invention
[0005] The present application provides a data extraction method, which is applied to an ETL tool; the ETL tool is used to perform a data exchange task of extracting, converting, and loading data stored in a data source end to a destination end; wherein the data source end is based on a distributed file system and implements data storage in units of data blocks; the method comprises:
[0006] In response to a start instruction of a data exchange task for the data to be extracted, a data extraction request for the data to be extracted is sent to the data source end, so that the data source end obtains data block information of a plurality of data blocks corresponding to the data to be extracted, and returns the data block information to the ETL tool;
[0007] Receiving and recording data block information of a plurality of data blocks corresponding to the data to be extracted returned by the data source;
[0008] Respectively receiving an extraction start message and an extraction end message corresponding to each of the plurality of data blocks; wherein the extraction start message is used to indicate the start of extracting the data stored in the corresponding data block; and the extraction end message is used to indicate the completion of extracting the data stored in the corresponding data block;
[0009] If an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, it is determined that the data to be extracted has been extracted, thereby determining that the data exchange task has been successfully executed.
[0010] Optionally, if an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, determining that the data to be extracted has been extracted includes:
[0011] If an extraction start message and an extraction end message corresponding to any data block among the plurality of data blocks are received, it is determined that the data block has been extracted;
[0012] If the extraction of the plurality of data blocks has been completed, it is determined that the data to be extracted has been completed.
[0013] Optionally, the method further includes:
[0014] If an extraction start message corresponding to any data block among the plurality of data blocks is received, and an extraction end message corresponding to the data block is not received, it is determined that the extraction of the data block is not completed.
[0015] Optionally, the method further includes:
[0016] In response to receiving an extraction start message corresponding to the data block, determining whether an extraction end message corresponding to the data block is received within a preset time period;
[0017] If an extraction completion message corresponding to the data block is received within a preset time period, it is determined that the data block has been extracted;
[0018] If the extraction end message corresponding to the data block is not received within the preset time period, it is determined that the extraction of the data block is abnormal.
[0019] Optionally, the method further includes:
[0020] If the extraction of some data blocks among the plurality of data blocks is abnormal, it is determined that the extraction of the data to be extracted is abnormal, thereby determining that the execution of the data exchange task is abnormal.
[0021] Optionally, the method further includes:
[0022] If it is determined that the data exchange task is executed abnormally, a recovery extraction request for the data to be extracted is periodically sent to the data source end according to a preset period; wherein the recovery extraction request carries data block information of data blocks that have not been completely extracted from the several data blocks; so that the data source end continues to extract the data to be extracted based on the data block information of the data blocks that have not been completely extracted.
[0023] Optionally, the method further includes:
[0024] If it is determined that the data exchange task is executed abnormally, a recovery extraction request for the data to be extracted is sent to the data source in response to a restart instruction for the data exchange task; wherein the recovery extraction request carries data block information of data blocks that have not been completely extracted from the several data blocks; so that the data source continues to extract the data to be extracted based on the data block information of the data blocks that have not been completely extracted.
[0025] Optionally, the data source includes a big data platform.
[0026] The present application also provides a data extraction device, which is applied to an ETL tool; the ETL tool is used to perform a data exchange task of extracting, cleaning and converting data stored in a data source and loading it to a destination; wherein the data source is based on a distributed file system and implements data storage in units of data blocks; the device includes:
[0027] a sending unit, configured to send a data extraction request for the data to be extracted to the data source end in response to a start instruction of a data exchange task for the data to be extracted, so that the data source end obtains data block information of a plurality of data blocks corresponding to the data to be extracted, and returns the data block information to the ETL tool;
[0028] A receiving unit, used for receiving and recording data block information of a plurality of data blocks corresponding to the data to be extracted returned by the data source;
[0029] The receiving unit is further configured to respectively receive an extraction start message and an extraction end message corresponding to each of the plurality of data blocks; wherein the extraction start message is used to indicate the start of extraction of data stored in the corresponding data block; and the extraction end message is used to indicate the completion of extraction of data stored in the corresponding data block;
[0030] The determination unit is used to determine that the data to be extracted has been extracted if an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, thereby determining that the data exchange task has been successfully executed.
[0031] The present application also provides an electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;
[0032] The memory stores machine-readable instructions, and the processor executes the above method by calling the machine-readable instructions.
[0033] The present application also provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above method is implemented.
[0034] Through the above embodiments, when the ETL tool executes a data exchange task for the data to be extracted, by obtaining the data block information of several data blocks corresponding to the data to be extracted, and respectively receiving the extraction start message and the extraction end message corresponding to each of the several data blocks, the extraction result of each data block can be determined, and the extraction result of the data to be extracted and the execution result of the data exchange task can be further determined; thereby realizing the execution progress of the data exchange task through the ETL tool and enabling the breakpoint resume capability.
[0035] Subsequently, if the data exchange task is executed abnormally, the ETL tool can determine the unextracted data blocks among several data blocks corresponding to the data to be extracted based on the received data block information, extraction start message and extraction end message, and send a recovery extraction request for the data to be extracted to the data source, so that the data source can continue to extract the data to be extracted based on the data block information of the unextracted data blocks carried in the recovery extraction request; thereby taking into account the breakpoint resumption capability, there is no need to delete some of the extracted data blocks, nor is there any need to re-extract the data to be extracted, thereby improving the execution efficiency of the data exchange task after restarting. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic diagram of the architecture of a data exchange system in the related art;
[0037] Figure 2 is a flow chart of a data extraction method shown in an exemplary embodiment;
[0038] Figure 3 is a hardware structure diagram of an electronic device in which a data extraction device is located according to an exemplary embodiment;
[0039] Figure 4 It is a block diagram of a data extraction device shown in an exemplary embodiment. DETAILED DESCRIPTION
[0040] 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.
[0041] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0042] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the relevant technologies for data exchange involved in the embodiments of this specification are briefly described below.
[0043] ETL (Extract-Transform-Load) can be used to describe the process of extracting, transforming, and loading data from the data source to the destination. ETL is an important part of BI (Business Intelligence) projects. It can integrate scattered, disorganized, and non-standard data in an enterprise and provide an analytical basis for the enterprise's decision-making.
[0044] In actual applications, ETL tools can be used to create and execute data exchange tasks to achieve data exchange between the data source and the destination. Figure 1 , Figure 1 This is a schematic diagram of the architecture of a data exchange system in the related technology. Figure 1 As shown, the data exchange system may at least include a data source end 102 , an ETL tool 104 , and a destination end 106 .
[0045] The data source end 102 and the destination end 106 may include different types of databases. For example, the data source end 102 may include different business systems corresponding to an enterprise; the destination end 106 may include, but is not limited to, a data warehouse.
[0046] The ETL tool 104 can be deployed in a cluster to improve the data exchange capability of the ETL tool and support access to more data sources. Figure 1 As shown, the ETL tool 104 may specifically include a control node and several working nodes; wherein the control node may uniformly manage the multiple working nodes, and assign data exchange tasks to one or more working nodes so that the corresponding working nodes perform the ETL process of data exchange.
[0047] In such Figure 1In the system architecture shown, the process of realizing data exchange between the data source end and the destination end may specifically include: the user may create a data exchange task for the target data through the ETL tool 104, and may also configure data extraction rules, data conversion rules, etc. for the data exchange task according to requirements; in response to the created data exchange task being started, the ETL tool 104 may establish a connection between the data source end 102 and the destination end 106, and may extract the target data from the data source end 102 according to the pre-configured data extraction rules; further, the ETL tool 104 may perform conversion on the extracted data according to the pre-configured data conversion rules; further, the ETL tool 104 may load the converted data to the destination end 106, that is, may send the converted data to the destination end 106, so that the destination end 106 may perform a disk write operation on the received data.
[0048] During the above data exchange process, the ETL tool 104 can also generally record the task start time, task end time, and task execution result of the data exchange task through logs.
[0049] It can be seen that in the above-mentioned embodiments, based on the log information recorded by the ETL tool, it is only possible to know whether the data exchange task is being executed and whether the data exchange task is finally executed successfully; if the network environment, data extraction, data conversion, data loading, data transmission, etc. are abnormal, resulting in the interruption of the data exchange task, the data exchange task can only be restarted, that is, it is necessary to delete part of the data that has been extracted, exchanged, and loaded, and re-execute the previous data exchange process. Especially in the scenario where a large amount of data needs to be exchanged, once the data exchange task is interrupted, it is necessary to re-execute the task, which may waste more time.
[0050] In view of this, with respect to data extraction in the ETL process, this specification aims to propose a technical solution in which an ETL tool can determine whether each data block in the data to be extracted has been extracted.
[0051] During implementation, the ETL tool may respond to a start instruction of a data exchange task for the data to be extracted, and send a data extraction request for the data to be extracted to the data source end; wherein the data source end implements data storage based on a distributed file system and in units of data blocks; further, data block information of a plurality of data blocks corresponding to the data to be extracted returned by the data source end may be received and recorded;
[0052] Furthermore, an extraction start message and an extraction end message corresponding to each of the several data blocks can be received respectively; wherein the extraction start message is used to indicate the start of extracting the data stored in the corresponding data block; the extraction end message is used to indicate that the extraction of the data stored in the corresponding data block has been completed; if the extraction start message and the extraction end message corresponding to each of the several data blocks are received, it is determined that the data to be extracted has been extracted, thereby determining that the data exchange task has been successfully executed.
[0053] It can be seen that in the technical solution in this specification, when the ETL tool executes a data exchange task for the data to be extracted, it can determine the extraction result of each data block by obtaining the data block information of several data blocks corresponding to the data to be extracted, and respectively receiving the extraction start message and the extraction end message corresponding to each of the several data blocks. It can further determine the extraction result of the data to be extracted and the execution result of the data exchange task; thereby realizing the execution progress of the data exchange task through the ETL tool and enabling the breakpoint resumption capability.
[0054] Subsequently, if the data exchange task is executed abnormally, the ETL tool can determine the unextracted data blocks among several data blocks corresponding to the data to be extracted based on the received data block information, extraction start message and extraction end message, and send a recovery extraction request for the data to be extracted to the data source, so that the data source can continue to extract the data to be extracted based on the data block information of the unextracted data blocks carried in the recovery extraction request; thereby taking into account the breakpoint resumption capability, there is no need to delete some of the extracted data blocks, nor is there any need to re-extract all the data blocks corresponding to the data to be extracted, thereby improving the execution efficiency of the data exchange task after restarting.
[0055] In addition, those skilled in the art will appreciate that, based on the technical solution of performing data extraction in units of data blocks disclosed in this specification, data conversion and data loading in the ETL process can be further performed in units of data blocks, and the conversion results and loading results of each data block can be recorded, so that the execution progress of each data block in the data exchange task corresponding to each link can be obtained through the ETL tool, thereby enabling the breakpoint resumption capability.
[0056] The present application is described below through specific embodiments and in combination with specific application scenarios.
[0057] See also Figure 2 , Figure 2 The flowchart of a data extraction method shown in an exemplary embodiment is applied to an ETL tool, and the method performs the following steps:
[0058] Step 202: In response to a start instruction of a data exchange task for the data to be extracted, a data extraction request for the data to be extracted is sent to a data source end, so that the data source end obtains data block information of a plurality of data blocks corresponding to the data to be extracted, and returns the data block information to an ETL tool;
[0059] Step 204: receiving and recording data block information of a plurality of data blocks corresponding to the data to be extracted returned by the data source;
[0060] Step 206: receiving an extraction start message and an extraction end message corresponding to each of the plurality of data blocks respectively; wherein the extraction start message is used to indicate the start of extracting the data stored in the corresponding data block; and the extraction end message is used to indicate the completion of extracting the data stored in the corresponding data block;
[0061] Step 208: If an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, it is determined that the data to be extracted has been extracted, thereby determining that the data exchange task has been successfully executed.
[0062] In this specification, the data source end may implement data storage based on a distributed file system (Distributed File System) in units of data blocks (block).
[0063] For example, the data source end may specifically include a database or a big data platform implemented based on Hadoop, Spark, etc.; and the data source end may store and manage data in units of data blocks.
[0064] In order to facilitate those skilled in the art to better understand the technical solutions in the embodiments of this specification, the technical solutions in this specification are described below by taking the data source end as a big data platform implemented based on the Hadoop Distributed File System (HDFS) as an example.
[0065] First, let's briefly describe the system architecture of HDFS. The system architecture of HDFS can usually include HDFS client, name node and data node. Among them, HDFS client can be used to access and manage HDFS. HDFS client can also interact with NameNode to obtain data block information of data to be extracted. HDFS client can also interact with DataNode to read or write data. NameNode can be used to manage the namespace of HDFS, manage data block mapping information, configure replication strategy, NameNode can also process read / write requests initiated by HDFS client. DataNode can be used to store actual data blocks. Specifically, HDFS is a master / slave architecture, which can usually include one NameNode and multiple DataNodes.
[0066] It should be noted that, in one or more embodiments shown in this specification, the data source being a big data platform implemented based on HDFS is merely an exemplary description and does not limit this specification; in actual applications, the technical solutions in this specification can also be applied to scenarios where the data source is based on other distributed file systems and implements storage in units of data blocks.
[0067] In this specification, the destination end may be used to store data obtained after data extraction and data conversion of the data stored in the data source end. For example, the destination end may specifically include but is not limited to a relational database, a non-relational database, a data warehouse, etc., which is not limited in this specification.
[0068] In this specification, the ETL tool can be used to create and execute one or more data exchange tasks, that is, the ETL tool can be used to extract, transform, and load the data stored in the data source to the destination.
[0069] For example, commonly used ETL tools include Kettle, Datastage, Informatica, etc. In practical applications, those skilled in the art can adopt or develop different ETL tools according to needs, and this specification does not limit them.
[0070] In this specification, the ETL tool may send a data extraction request for the data to be extracted to the data source end in response to a start instruction of a data exchange task for the data to be extracted.
[0071] The data to be extracted may include structured data and / or unstructured data stored in the data source, and may also include file data such as txt files, excel files, xml files, etc., which is not limited in this specification.
[0072] Among them, the start instruction of the data exchange task for the data to be extracted can be understood as that the user can create the data exchange task through the ETL tool, and can also configure the data source, destination, data to be extracted, data extraction rules, data cleaning rules, data loading rules, etc. for the data exchange task. Furthermore, when the data exchange task is created or started, the ETL tool can detect the start instruction for the data exchange task and start executing the data exchange task.
[0073] For example, the ETL tool needs to execute a data exchange task to extract, convert, and load the data to be extracted, which is stored in the HDFS file format in the data source, to the destination end; when the data exchange task is started, the ETL tool can detect a start instruction for the data exchange task; in response to the start instruction, the ETL tool can establish a connection with the data source and send a data extraction request for the data to be extracted to the data source; wherein the data extraction request can carry data table information and data extraction rules of the data to be extracted.
[0074] The data extraction request may include a full data extraction request or an incremental data extraction request. In implementation, before the ETL tool sends a data extraction request for the data to be extracted to the data source, it may first determine the data range corresponding to the data to be extracted.
[0075] For example, in the scenario of full data extraction, in response to the start instruction of the data exchange task, the ETL tool can determine the data range corresponding to the data to be extracted based on the relevant configuration information of the data task, such as data table information, etc., and can send a full data extraction request for the data to be extracted to the data source.
[0076] For another example, in the scenario of incremental data extraction, the ETL tool can first determine which incremental data needs to be exchanged through methods such as timestamps, that is, determine the data range corresponding to the data to be extracted, and can send an incremental data extraction request for the incremental data to the data source.
[0077] It should be noted that regarding the specific implementation method for determining the incremental data, those skilled in the art can flexibly select different specific implementation methods according to the different system architectures and functions of the data exchange system, and this specification does not limit this. For example, the data source end can store the generated incremental data in a new data block, and can also provide data information corresponding to the incremental data to the ETL tool. For another example, a timestamp field can be added to the data stored at the data source end to indicate the creation time or update time of the corresponding data. The ETL tool can then determine the incremental data by comparing the current system time with the timestamp field.
[0078] In this specification, in response to receiving a data extraction request for the data to be extracted from the ETL tool, the data source end can obtain data block information of several data blocks corresponding to the data to be extracted, and return the data block information to the ETL tool.
[0079] In practical applications, the data block information may include address information (location) of the data block.
[0080] For example, in response to receiving the data extraction request sent by the ETL tool, the data source can create an HDFS client, call the open method of the DistributedFileSystem object, and open the HDFS file corresponding to the data to be extracted; the DistributedFileSystem can call the NameNode through RPC (remote procedure call) to obtain the address information (location) of several data blocks (blocks) corresponding to the data to be extracted returned by the NameNode; further, the data source can return the obtained data block information to the ETL tool.
[0081] In this specification, the ETL tool may receive and record data block information of a plurality of data blocks corresponding to the data to be extracted and returned by the data source.
[0082] Specifically, the ETL tool may generate a data block information list for recording the received data block information of several data blocks corresponding to the data to be extracted. For the data block information list, please refer to the example shown in Table 1.
[0083] Data block information location 1 location 2 …… location
[0084] Table 1
[0085] For example, as shown in Table 1, the data block information of the n data blocks corresponding to the data to be extracted are respectively location 1, location 2, ..., location n, where n is an integer greater than 1. The ETL tool can receive the data block information of the n data blocks corresponding to the data to be extracted returned by the data source end, and record the acquired data block information in the data block information list shown in Table 1.
[0086] In practical applications, the arrangement order of the data blocks in the data block information recorded by the ETL tool is the same as the arrangement order of the data blocks in the data block information obtained by the data source. It can be understood by those skilled in the art that the arrangement order of the data block information of the data blocks is sorted according to the Hadoop topology, that is, the data blocks closest to the HDFS client are arranged in front, which will not be repeated here.
[0087] It should be noted that, in the related art, after the data source end obtains the data block information of several data blocks corresponding to the data to be extracted from the NameNode, it usually only interacts with the DataNode according to the data block information and reads the corresponding data from the DataNode, that is, the data source end does not return the obtained data block information to the ETL tool; therefore, in the related art, the ETL tool cannot obtain the data block information corresponding to the data to be extracted. In the technical solution of this specification, the ETL tool can request the data source end to obtain the data block information corresponding to the data to be extracted, and use it as the basis for determining the execution progress of the data exchange task in units of data blocks.
[0088] In this specification, after obtaining the data block information of several data blocks corresponding to the data to be extracted, the data source can establish a connection with the data node corresponding to each data block information in turn, and read data from the data node until all the data corresponding to the several data blocks are read, or the data exchange task is executed abnormally.
[0089] Specifically, after obtaining the data block information of several data blocks corresponding to the data to be extracted, the data source end can establish connections with the data nodes corresponding to the data block information of each data block, and send an extraction start message corresponding to the data block to the ETL tool; further, the data source end can read the data stored in the corresponding data block, and send the read data to the ETL tool; further, when the data stored in the data block is read, the data source end can close the connection with the data block, and send an extraction end message corresponding to the data block to the ETL tool.
[0090] Among them, the extraction start message can be used to indicate the start of extracting the data stored in the corresponding data block; the extraction end message can be used to indicate that the data stored in the corresponding data block has been extracted. In practical applications, the extraction start message and the extraction end message can specifically include timestamps corresponding to the extraction start time and the extraction end time, and can also include other identifiers for distinguishing the start state and the end state, such as: "yes" and "no", "1" and "0", etc.; Regarding the specific implementation form of the extraction start message and the extraction end message, those skilled in the art can set it according to needs, and this specification does not limit it.
[0091] For example, after obtaining the data block information of n data blocks corresponding to the data to be extracted, the HDFS client can call the read method to first establish a connection with the DataNode corresponding to the data block information location 1, and send an extraction start message "t 11 "; further, the HDFS client can read the data stored in the DataNode corresponding to location 1, and send the read data to the ETL tool; further, when the data stored in the DataNode corresponding to location 1 is read, the HDFS client can close the connection with the DataNode and send an extraction end message "t 12 "; Then, the HDFS client can establish connections with the DataNodes corresponding to other data block information in turn, and perform the above data reading process, which will not be repeated here.
[0092] In this specification, the ETL tool may respectively receive an extraction start message and an extraction end message corresponding to each of the plurality of data blocks.
[0093] Specifically, the ETL tool can respectively receive an extraction start message and an extraction end message corresponding to each data block, and can also receive the read data corresponding to each data block; further, the ETL tool can record the received extraction start message and the extraction end message in the data block information list, please refer to a data block information list shown in Table 2.
[0094] Data block information Extraction start message Extraction end message Data block extraction results location 1 <![CDATA[t 11 ]]> <![CDATA[t 12 ]]> Completed …… …… …… Completed Location K <![CDATA[t k1 ]]> / Unfinished location k+1 / / Unfinished …… / / Unfinished location / / Unfinished
[0095] Table 2
[0096] Continuing with the above example, the ETL tool can receive the extraction start message "t11 ", and the extraction end message "t 12 ", and records it in the data block information list shown in Table 2; similarly, the ETL tool can receive and record the extraction start message "t k1 ". It can be understood that, in Table 2, the ETL tool has received the extraction start message and the extraction end message corresponding to one or more data block information arranged before location k, has not received the extraction end message corresponding to location k, and has not received the extraction start message and the extraction end message corresponding to one or more data block information arranged after location k.
[0097] It should be noted that in the related art, in the process of reading data from the data node corresponding to the data block information at the data source end, usually only the read data will be returned, that is, the ETL tool will not receive the extraction start message and extraction end message corresponding to each data block; therefore, the ETL tool cannot know the extraction progress of each data block corresponding to the data to be extracted, and can only know the execution result of the entire data exchange task. In the technical solution of this specification, the ETL tool can request the extraction start message and extraction end message corresponding to each data block from the data source end, so that the extraction progress of each data block can be judged according to whether the extraction start message and extraction end message are received.
[0098] In actual applications, after extracting the data corresponding to each data block from the data source, the ETL tool can further perform data conversion on the extracted data in units of data blocks. This specification does not limit the specific implementation of data conversion; for example, the ETL tool can perform one or more data conversion operations such as data filtering, data cleaning, data calculation, data verification, data merging, field mapping, etc. on the extracted data in units of data blocks, and can also record the conversion start message, conversion end message, conversion result, etc. corresponding to each data block.
[0099] In addition, in actual applications, the ETL tool can also send the converted data to the destination end, and load the data in units of data blocks. This specification does not specifically limit the specific implementation method of data loading; for example, the ETL tool can write the data corresponding to one or more data blocks to the destination end after extracting and caching the data corresponding to the one or more data blocks; for another example, the ETL tool can first send the extracted data to the destination end, and after receiving the extraction end message corresponding to any data block, send a commit message corresponding to the data block to the destination end, so that the destination end will write the received data corresponding to the data block to the disk; for another example, the ETL tool can send the extracted data to the destination end, so that the destination end will write the received data corresponding to the data block to the disk, and return the loading start message, loading end message, loading result, etc. corresponding to each data block to the ETL tool.
[0100] In this specification, if the ETL tool receives an extraction start message and an extraction end message corresponding to each of the several data blocks, it can be determined that the data to be extracted has been extracted, and thus it can be determined that the data exchange task has been successfully executed.
[0101] In practical applications, the data exchange task has been successfully executed, which can be broadly understood as that several data blocks corresponding to the data to be extracted have been extracted from the data source, and data conversion and data loading have been completed. Based on this, if we only focus on the data extraction stage in the data exchange task, in this specification, it can be narrowly understood as: if the data to be extracted has been extracted, and the subsequent data conversion and data loading have been completed normally, then the data exchange task has been successfully executed; if the data to be extracted has not been extracted, then the data exchange task is executed abnormally.
[0102] For example, if the ETL tool receives extraction start messages and extraction end messages corresponding to data block information location 1, ..., location n of n data blocks corresponding to the data to be extracted, it can be determined that the n data blocks corresponding to the data to be extracted have all been extracted, that is, the data to be extracted has been extracted. If subsequent data conversion and data loading are implemented normally, it can be determined that the data exchange task has been successfully executed.
[0103] In one embodiment shown, if an extraction start message and an extraction end message corresponding to each of the several data blocks are received, it is determined that the data to be extracted has been completed, including: if an extraction start message and an extraction end message corresponding to any data block among the several data blocks are received, it is determined that the data block has been completed extracted; if the several data blocks have all been extracted, it is determined that the data to be extracted has been completed.
[0104] For example, as shown in Table 2, if the ETL tool receives the extraction start message "t 11 " and the extraction end message "t 12 ", it can be determined that the data block extraction result corresponding to location 1 is "completed"; if the data block extraction results corresponding to the n data blocks corresponding to the data to be extracted are all "completed", it can be determined that the data to be extracted has been extracted.
[0105] In another illustrated embodiment, the method further includes: if an extraction start message corresponding to any data block among the plurality of data blocks is received, and an extraction end message corresponding to the data block is not received, determining that the data block has not been extracted.
[0106] For example, as shown in Table 2, if the ETL tool receives the extraction start message "t k1 ", and no extraction end message corresponding to location k is received, it can be determined that the extraction result of the data block corresponding to location k is "incomplete".
[0107] In addition, if the extraction start message and extraction end message corresponding to a data block are not received, it can be determined that the data block has not been extracted, which can also be called the data block has not started to be extracted, and this is not specifically limited in this specification.
[0108] For example, as shown in Table 2, if the ETL tool does not receive the extraction start message and the extraction end message corresponding to location n, it can be determined that the data block extraction result corresponding to location n is "incomplete".
[0109] In actual applications, the data block extraction result in the data block information list shown in Table 2 may be initially set to "unfinished", and the ETL tool may update it to "completed" in response to receiving an extraction completion message corresponding to a data block. Alternatively, the ETL tool may determine the data block extraction result corresponding to each data block according to the information corresponding to each data block recorded in the data block information list shown in Table 2 in response to determining that the data exchange task fails to execute.
[0110] In the above-described implementation, for any data block, the ETL tool can determine whether the data block is extracted abnormally according to the time interval between the extraction start message and the extraction end message corresponding to the data block.
[0111] When implemented, the method may further include: the ETL tool may determine whether an extraction end message corresponding to the data block is received within a preset time period in response to receiving an extraction start message corresponding to the data block; if an extraction end message corresponding to the data block is received within the preset time period, it is determined that the data block has been extracted; if an extraction end message corresponding to the data block is not received within the preset time period, it is determined that the extraction of the data block is abnormal; if some of the data blocks among the several data blocks are extracted abnormally, it can be determined that the extraction of the data to be extracted is abnormal, and thus it can be determined that the execution of the data exchange task is abnormal.
[0112] For example, upon receiving the extraction start message "t k1 "After that, if the extraction end message "t k2 ", it can be determined that the extraction result of the data block corresponding to location k is "completed"; otherwise, it can be determined that the extraction result of the data block corresponding to location k is "incomplete", and it can be determined that an extraction abnormality occurs in the data block corresponding to location k.
[0113] In this specification, if the ETL tool does not receive the extraction start message and the extraction end message corresponding to each of the several data blocks, it can be determined that the data to be extracted has not been completely extracted, and thus it can be determined that the data exchange task is executed abnormally; if it is determined that the data exchange task is executed abnormally, the ETL tool can send a recovery extraction request for the data to be extracted to the data source end; wherein the recovery extraction request can carry data block information of the data blocks that have not been completely extracted from the several data blocks; so that the data source end can continue to extract the data to be extracted based on the data block information of the data blocks that have not been completely extracted.
[0114] For example, as shown in Table 2, the ETL tool does not receive the extraction start message and the extraction end message corresponding to each of the n data blocks corresponding to the data to be extracted, and it can be determined that the data blocks corresponding to location k, location k+1, ..., location n have not been completely extracted, that is, it can be determined that the data to be extracted have not been completely extracted, and thus it can be determined that the data exchange task for the data to be extracted is abnormally executed. Further, if the data exchange task needs to be re-performed, the ETL tool can send a recovery extraction request for the data to be extracted to the data source end, which can carry the data block information of the above-mentioned data blocks that have not been completely extracted; the data source end can continue to read data from the DataNode corresponding to location k in response to the recovery extraction request.
[0115] Among them, the data block information carried in the recovery extraction request may include the data block information of all unextracted data blocks among the several data blocks corresponding to the data to be extracted, and may also include the data block information of a data block that was extracted abnormally among the several data blocks corresponding to the data to be extracted.
[0116] For example, as shown in Table 2, the recovery extraction request may carry data block information location k, location k+1, ..., and location n. For another example, the recovery extraction request may only carry data block information location k where data extraction is interrupted.
[0117] Accordingly, the data source end can directly continue to extract the data blocks that have not been completely extracted based on the data block information carried in the recovery extraction request; the data source end can also first re-acquire the data block information of several data blocks corresponding to the data to be extracted, and then determine which data block information in the re-acquired data block information to start continuing the extraction based on the data block information carried in the recovery extraction request.
[0118] For example, as shown in Table 2, the recovery extraction request carries data block information location k, location k+1, ..., and location n; then, in response to the recovery extraction request, the data source does not need to re-acquire the data block information of several data blocks corresponding to the data to be extracted, and can directly continue data extraction according to the data block information location k, location k+1, ..., location n carried in the recovery extraction request.
[0119] For another example, as shown in Table 2, the recovery extraction request only carries the data block information location k where the data extraction is interrupted; then, in response to the recovery extraction request, the data source end can first re-acquire the data block information of n data blocks corresponding to the data to be extracted, and then continue the extraction from location k in the re-acquired data block information.
[0120] It should be noted that, in the implementation mode shown above, if the data exchange task is executed abnormally, the ETL tool can determine the unextracted data blocks among the several data blocks corresponding to the data to be extracted based on the received data block information, extraction start message and extraction end message, and send a recovery extraction request for the data to be extracted to the data source, so that the data source can continue to extract the data to be extracted based on the data block information of the unextracted data blocks carried in the recovery extraction request; thereby taking into account the breakpoint resumption capability, there is no need to delete some of the extracted data blocks, and there is no need to re-extract the data to be extracted, thereby improving the execution efficiency of the data exchange task after restarting.
[0121] In one embodiment shown, if the data exchange task is executed abnormally, the breakpoint resume capability can be automatically activated. When implemented, the method further includes: if it is determined that the data exchange task is executed abnormally, periodically sending a recovery extraction request for the data to be extracted to the data source end according to a preset period.
[0122] The preset period, i.e., the automatic restart period of the task in which the ETL tool attempts to re-execute the abnormally executed data exchange task, can be configured by those skilled in the art according to their needs and is not limited in this specification.
[0123] For example, the user pre-configures an automatic task restart period of 2 minutes for the data exchange task for the data to be extracted; if it is determined that the data exchange task is executed abnormally, the ETL tool can send a recovery extraction request for the data to be extracted to the data source every 2 minutes until the data exchange task is successfully restarted or the preset number of automatic restarts is exceeded.
[0124] In another embodiment shown, if the data exchange task is executed abnormally, the breakpoint resume capability can be manually enabled after troubleshooting. When implemented, the method further includes: if it is determined that the data exchange task is executed abnormally, in response to a restart instruction for the data exchange task, sending a recovery extraction request for the data to be extracted to the data source end.
[0125] For example, if the data exchange task for the data to be extracted is executed abnormally, the user can manually restart the data exchange task after network recovery or other troubleshooting; the ETL tool can send a recovery extraction request for the data to be extracted to the data source in response to detecting a restart instruction for the data exchange task.
[0126] It should be noted that in the implementation mode shown above, especially in scenarios where a large amount of data needs to be exchanged, such as: the data source includes a big data platform, or the data extraction request includes a full data extraction request, etc., the data exchange task takes a long time to consume; therefore, by adopting the data extraction method with breakpoint resumption capability, if the data exchange task is executed abnormally, the execution time of the data exchange task can be greatly saved.
[0127] It should be noted that, in one or more of the above-described embodiments, before determining that the data exchange task is abnormally executed, if part of the data in the data block currently being extracted has been extracted and written to the destination, then after the data exchange task is restarted, the ETL tool may re-perform data extraction, data conversion, data loading, etc. on the data block in units of data blocks, which will cause part of the previous data to be repeatedly written to the destination. For example, as shown in Table 2, the ETL tool receives the extraction start message "t k1 ", and part of the data corresponding to location k has been extracted and written to the destination, but the ETL tool has not received the extraction end message "t k2 ", it is determined that the data extraction result of the data block corresponding to location k is "incomplete", and the data exchange task is executed abnormally; further, after restarting the data exchange task, the ETL tool can re-extract all the data corresponding to location k and rewrite it to the destination end. It can be seen that part of the data corresponding to location k is repeatedly written to the destination end, resulting in data duplication in the destination end.
[0128] Based on this, in actual applications, in order to avoid data duplication in the destination after restarting the data exchange task, the ETL tool can also make corresponding improvement measures for the data loading stage in the data exchange task. Several optional improvement measures are described as examples below.
[0129] (1) The ETL tool can write the data corresponding to one or more data blocks to the destination end after the data corresponding to the one or more data blocks are extracted and cached; that is, only the entire data block that has been extracted will continue with the subsequent data loading, and the data block that caused the data exchange task exception has not completed data extraction and caching, and the ETL tool will not send it to the destination end. Therefore, after restarting the data exchange task, there will be no data duplication at the destination end.
[0130] (2) The ETL tool may send the extracted data to the destination end first, and after receiving the extraction completion message corresponding to any data block, may send a commit message corresponding to the data block to the destination end, so that the destination end will write the received data corresponding to the data block to the disk; therefore, the destination end will only write the entire data block that has been extracted to the disk, and the data block that caused the data exchange task exception has not completed the data extraction. The ETL tool has not received the extraction completion message corresponding to the data block, and will not send the commit message corresponding to the data block to the destination end, and the destination end will not write the received data corresponding to the data block to the disk.
[0131] (3) The ETL tool can send the extracted data to the destination end so that the destination end can write the data to the disk, and can return the last row of data of the data block to the ETL tool after the entire data block has completed data loading; further, when restarting the data exchange task, the ETL tool can also send an instruction to the destination end so that the destination end responds to the instruction and deletes the data written to the disk after the last row of data of the last data block successfully written to the disk.
[0132] It can be known from the above technical scheme that when the ETL tool executes the data exchange task for the data to be extracted, by obtaining the data block information of several data blocks corresponding to the data to be extracted, and respectively receiving the extraction start message and the extraction end message corresponding to each of the several data blocks, the extraction result of each data block can be determined, and the extraction result of the data to be extracted and the execution result of the data exchange task can be further determined; thereby realizing the execution progress of the data exchange task through the ETL tool and enabling the breakpoint resumption capability.
[0133] Subsequently, if the data exchange task is executed abnormally, the ETL tool can determine the unextracted data blocks among several data blocks corresponding to the data to be extracted based on the received data block information, extraction start message and extraction end message, and send a recovery extraction request for the data to be extracted to the data source, so that the data source can continue to extract the data to be extracted based on the data block information of the unextracted data blocks carried in the recovery extraction request; thereby taking into account the breakpoint resumption capability, there is no need to delete some of the extracted data blocks, nor is there any need to re-extract all the data blocks corresponding to the data to be extracted, thereby improving the execution efficiency of the data exchange task after restarting.
[0134] Corresponding to the above-mentioned embodiment of the data extraction method, this specification also provides an embodiment of a data extraction device.
[0135] See also Figure 3 , Figure 3 This is a hardware structure diagram of an electronic device in which a web page classification identification device is located, which is shown in an exemplary embodiment. At the hardware level, the device includes a processor 302, an internal bus 304, a network interface 306, a memory 308, and a non-volatile memory 310, and of course may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as the processor 302 reading the corresponding computer program from the non-volatile memory 310 into the memory 308 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0136] See also Figure 4 , Figure 4 is a block diagram of a data extraction device shown in an exemplary embodiment. The data extraction device can be applied to Figure 3 In the electronic device shown in the figure, the technical solution of this specification is implemented. Among them, the above-mentioned data extraction device may include:
[0137] The sending unit 402 is used to send a data extraction request for the data to be extracted to the data source end in response to a start instruction of a data exchange task for the data to be extracted, so that the data source end obtains data block information of a plurality of data blocks corresponding to the data to be extracted, and returns the data block information to the ETL tool;
[0138] A receiving unit 404 is used to receive and record data block information of a plurality of data blocks corresponding to the data to be extracted returned by the data source end;
[0139] The receiving unit 404 is further configured to receive an extraction start message and an extraction end message corresponding to each of the plurality of data blocks, respectively; wherein the extraction start message is used to indicate the start of extracting the data stored in the corresponding data block; and the extraction end message is used to indicate the completion of extracting the data stored in the corresponding data block;
[0140] The determination unit 406 is configured to determine that the data to be extracted has been extracted if an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, thereby determining that the data exchange task has been successfully executed.
[0141] In this embodiment, the determining unit 406 is specifically configured to:
[0142] If an extraction start message and an extraction end message corresponding to any data block among the plurality of data blocks are received, it is determined that the data block has been extracted;
[0143] If the extraction of the plurality of data blocks has been completed, it is determined that the data to be extracted has been completed.
[0144] In this embodiment, the determining unit 406 is further configured to:
[0145] If an extraction start message corresponding to any data block among the plurality of data blocks is received, and an extraction end message corresponding to the data block is not received, it is determined that the extraction of the data block is not completed.
[0146] In this embodiment, the determining unit 406 is further configured to:
[0147] In response to receiving an extraction start message corresponding to the data block, determining whether an extraction end message corresponding to the data block is received within a preset time period;
[0148] If an extraction completion message corresponding to the data block is received within a preset time period, it is determined that the data block has been extracted;
[0149] If the extraction end message corresponding to the data block is not received within the preset time period, it is determined that the extraction of the data block is abnormal.
[0150] In this embodiment, the determining unit 406 is further configured to:
[0151] If the extraction of some data blocks among the plurality of data blocks is abnormal, it is determined that the extraction of the data to be extracted is abnormal, thereby determining that the execution of the data exchange task is abnormal.
[0152] In this embodiment, the sending unit 402 is further configured to:
[0153] If it is determined that the data exchange task is executed abnormally, a recovery extraction request for the data to be extracted is periodically sent to the data source end according to a preset period; wherein the recovery extraction request carries data block information of data blocks that have not been completely extracted from the several data blocks; so that the data source end continues to extract the data to be extracted based on the data block information of the data blocks that have not been completely extracted.
[0154] In this embodiment, the sending unit 402 is further configured to:
[0155] If it is determined that the data exchange task is executed abnormally, a recovery extraction request for the data to be extracted is sent to the data source in response to a restart instruction for the data exchange task; wherein the recovery extraction request carries data block information of data blocks that have not been completely extracted from the several data blocks; so that the data source continues to extract the data to be extracted based on the data block information of the data blocks that have not been completely extracted.
[0156] In this embodiment, the data source includes a big data platform.
[0157] 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.
[0158] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are 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 scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.
[0159] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0160] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0161] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0162] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0163] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0164] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0165] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "one", "said" and "the" used in one or more embodiments of this specification 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.
[0166] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, 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 one or more embodiments of this specification, 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".
[0167] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A data extraction method, characterized in that: Applied to ETL tools; the ETL tools are used to perform data exchange tasks of extracting, converting and loading data stored in a data source end to a destination end; wherein the data source end is based on a distributed file system and implements data storage in units of data blocks; the method comprises: In response to a start instruction of a data exchange task for the data to be extracted, a data extraction request for the data to be extracted is sent to the data source end, so that the data source end obtains data block information of a plurality of data blocks corresponding to the data to be extracted, and returns the data block information to the ETL tool; Receiving and recording data block information of a plurality of data blocks corresponding to the data to be extracted returned by the data source; Respectively receiving an extraction start message and an extraction end message corresponding to each of the plurality of data blocks; wherein the extraction start message is used to indicate the start of extracting the data stored in the corresponding data block; and the extraction end message is used to indicate the completion of extracting the data stored in the corresponding data block; If an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, it is determined that the data to be extracted has been extracted, thereby determining that the data exchange task has been successfully executed.
2. The method according to claim 1, characterized in that If an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, determining that the data to be extracted has been extracted, comprises: If an extraction start message and an extraction end message corresponding to any data block among the plurality of data blocks are received, it is determined that the data block has been extracted; If the extraction of the plurality of data blocks has been completed, it is determined that the data to be extracted has been completed.
3. The method according to claim 2, characterized in that Also includes: If an extraction start message corresponding to any data block among the plurality of data blocks is received, and an extraction end message corresponding to the data block is not received, it is determined that the extraction of the data block is not completed.
4. The method according to claim 3, characterized in that Also includes: In response to receiving an extraction start message corresponding to the data block, determining whether an extraction end message corresponding to the data block is received within a preset time period; If an extraction completion message corresponding to the data block is received within a preset time period, it is determined that the data block has been extracted; If the extraction end message corresponding to the data block is not received within the preset time period, it is determined that the extraction of the data block is abnormal.
5. The method according to claim 4, characterized in that Also includes: If the extraction of some data blocks among the plurality of data blocks is abnormal, it is determined that the extraction of the data to be extracted is abnormal, thereby determining that the execution of the data exchange task is abnormal.
6. The method according to claim 1, characterized in that The method further comprises: If it is determined that the data exchange task is executed abnormally, a recovery extraction request for the data to be extracted is periodically sent to the data source end according to a preset period; wherein the recovery extraction request carries data block information of data blocks that have not been completely extracted from the several data blocks; so that the data source end continues to extract the data to be extracted based on the data block information of the data blocks that have not been completely extracted.
7. The method according to claim 1, characterized in that The method further comprises: If it is determined that the data exchange task is executed abnormally, a recovery extraction request for the data to be extracted is sent to the data source in response to a restart instruction for the data exchange task; wherein the recovery extraction request carries data block information of data blocks that have not been completely extracted from the several data blocks; so that the data source continues to extract the data to be extracted based on the data block information of the data blocks that have not been completely extracted.
8. The method according to claim 1, characterized in that: The data source end includes a big data platform.
9. A data extraction device, characterized in that: Applied to ETL tools; the ETL tool is used to perform a data exchange task of extracting, cleaning and converting data stored in a data source and loading it to a destination; wherein the data source is based on a distributed file system and implements data storage in units of data blocks; the device comprises: a sending unit, configured to send a data extraction request for the data to be extracted to the data source end in response to a start instruction of a data exchange task for the data to be extracted, so that the data source end obtains data block information of a plurality of data blocks corresponding to the data to be extracted, and returns the data block information to the ETL tool; A receiving unit, used for receiving and recording data block information of a plurality of data blocks corresponding to the data to be extracted returned by the data source; The receiving unit is further configured to respectively receive an extraction start message and an extraction end message corresponding to each of the plurality of data blocks; wherein the extraction start message is used to indicate the start of extraction of data stored in the corresponding data block; and the extraction end message is used to indicate the completion of extraction of data stored in the corresponding data block; The determination unit is used to determine that the data to be extracted has been extracted if an extraction start message and an extraction end message corresponding to each of the plurality of data blocks are received, thereby determining that the data exchange task has been successfully executed.
10. An electronic device, characterized in that: It includes a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 8 by calling the machine-readable instructions.
11. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the method according to any one of claims 1 to 8 is implemented.
