Data processing method and device
Through the combination of Flink SQL script and task monitoring module, the automation and real-time monitoring of data cleaning are realized, which solves the problems of low data cleaning efficiency and poor user experience in the existing technology, and improves the efficiency of data processing and the quality of cleaning results.
Patent Information
- Application Number
- CN202210445104.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-04-26
AI Technical Summary
In the existing technology, the data cleaning process requires user participation, which results in low efficiency and affects the user experience. It is also difficult to monitor the cleaning process of the data stream in real time, leading to problems such as task backlog and cleaning results not meeting preset conditions.
Automated data cleaning is implemented through Flink SQL scripts, and the task monitoring module is enabled to monitor the data cleaning process in real time, determine the task backlog, and output and store the cleaning results according to preset conditions to reduce manual participation.
It improves data processing efficiency and user experience, reduces manual participation, ensures automation and real-time monitoring of the data cleaning process, and ensures the quality of cleaning results.
Smart Images

Figure CN114780529B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data processing method and device. Background Art
[0002] Real-time data cleaning is an indispensable part of the entire data analysis process. The quality of the cleaning results is directly related to the effectiveness of the data model and the final effect of decision-making. The data cleaning process often takes up 50% or even more of the entire data analysis time.
[0003] In the prior art, the process of cleaning data involves real-time data stream cleaning, and the cleaning of data streams requires attention to the efficiency and accuracy of the data cleaning process. However, the real-time cleaning of data streams in the prior art requires users to participate in the entire operation, resulting in low efficiency of data cleaning and affecting the user's operating experience. Summary of the invention
[0004] In view of this, the present invention provides a data processing method, through which Flink SQL scripts can be applied to realize automatic cleaning, and the cleaning process can be monitored, thereby reducing manual participation and improving data processing efficiency and user experience.
[0005] The present invention also provides a data processing device to ensure the implementation and application of the above method in practice.
[0006] A data processing method, comprising:
[0007] Receive data cleaning tasks sent by users through the data center;
[0008] Obtain data source information and data output information corresponding to the data cleaning task, wherein the data source information and data output information are data storage information, and the data storage information is data table information of a database or topic information of Kafka;
[0009] Based on a preset table creation syntax, the data stream corresponding to the data source information and the data stream corresponding to the data output information are processed to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information;
[0010] Obtaining a data cleaning FLink SQL script pre-submitted by the user, and applying the FLink SQL script to perform data cleaning on the first data stream and the second data stream;
[0011] Activate a preset task monitoring module to monitor the data cleaning process in real time to determine whether there is a backlog of the data cleaning task;
[0012] When there is no backlog of the data cleaning task, obtaining a cleaning result after data cleaning, and determining whether the cleaning result meets a preset cleaning condition;
[0013] When the cleaning result meets the cleaning condition, the cleaning result is sent to a preset Flink cluster, and the cleaning result is stored and outputted through the Flink cluster.
[0014] In the above method, optionally, the step of obtaining data source information and data output information corresponding to the data cleaning task includes:
[0015] Connecting to a database of the data center;
[0016] Obtaining a task identification code corresponding to the data cleaning task in the database;
[0017] Extracting a task package corresponding to the data cleaning task in the database based on the task identification code;
[0018] The task package is parsed to obtain data source information and data output information corresponding to the data cleaning task in the task package.
[0019] The above method may optionally include enabling a preset task monitoring module to monitor the data cleaning process in real time to determine whether there is a backlog of the data cleaning task, including:
[0020] Start the pre-set Kafka consumer group water level logic module;
[0021] Apply the Kafka consumer group water level logic module to record in real time the consumption delay information of each consumption of the first data stream and the second data stream by the FLink SQL script for data cleaning;
[0022] Determine whether the currently recorded consumption delay information exceeds the preset threshold;
[0023] If the consumption delay information of the current record does not exceed the threshold, it is determined that there is no task backlog for the data cleaning task;
[0024] If the consumption delay time of the current record exceeds the threshold, it is determined that there is a task backlog in the data cleaning task.
[0025] The above method may optionally further include:
[0026] When there is a backlog of tasks in the data cleaning tasks, the early warning communication module preset by the user is started, and the early warning communication module is used to perform early warning notification.
[0027] The above method may optionally further include:
[0028] When the cleaning result does not meet the cleaning condition, stopping the data cleaning process of the first data stream and the second data stream, and feeding back the cleaning result to the user;
[0029] When a new FLink SQL script is uploaded by the user based on the cleaning result, the FLink SQL script is applied to clean the first data stream and the second data stream again.
[0030] A data processing device, comprising:
[0031] A receiving unit, used for receiving data cleaning tasks sent by users via a data center;
[0032] A first acquisition unit is used to acquire data source information and data output information corresponding to the data cleaning task, wherein the data source information and data output information are data storage information, and the data storage information is data table information of a database or topic information of Kafka;
[0033] A processing unit, configured to process the data stream corresponding to the data source information and the data stream corresponding to the data output information based on a preset table creation syntax, to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information;
[0034] A data cleaning unit, configured to obtain a data cleaning FLink SQL script pre-submitted by the user, and apply the FLink SQL script to perform data cleaning on the first data stream and the second data stream;
[0035] A monitoring unit is used to enable a preset task monitoring module to monitor the data cleaning process in real time and determine whether there is a task backlog in the data cleaning task;
[0036] A second acquisition unit is used to acquire a cleaning result after data cleaning when there is no task backlog of the data cleaning task, and determine whether the cleaning result meets a preset cleaning condition;
[0037] The processing end unit is used to send the cleaning result to a preset Flink cluster when the cleaning result meets the cleaning condition, and store and output the cleaning result through the Flink cluster.
[0038] In the above device, optionally, the first acquisition unit includes:
[0039] A connection subunit, used for connecting to a database of the data center;
[0040] A first acquisition subunit is used to acquire a task identification code corresponding to the data cleaning task in the database;
[0041] A second acquisition subunit is used to extract a task package corresponding to the data cleaning task in the database based on the task identification code;
[0042] The parsing subunit is used to parse the task package and obtain data source information and data output information corresponding to the data cleaning task in the task package.
[0043] In the above device, optionally, the monitoring unit includes:
[0044] The startup subunit is used to start the pre-set Kafka consumer group water level logic module;
[0045] A recording subunit, used for applying the Kafka consumer group water level logic module to record in real time the consumption delay information of each consumption of the first data stream and the second data stream by the FLink SQL script for data cleaning;
[0046] A judgment subunit, used to judge whether the consumption delay information currently recorded exceeds a preset threshold;
[0047] A first determining subunit is configured to determine that there is no task backlog for the data cleaning task if the consumption delay information of the current record does not exceed the threshold;
[0048] The second determining subunit is used to determine that there is a backlog of the data cleaning task if the renewal fee delay time of the current record exceeds the threshold.
[0049] The above device may optionally further include:
[0050] The early warning unit is used to start the early warning communication module preset by the user when there is a backlog of tasks in the data cleaning tasks, and use the early warning communication module to make early warning notifications.
[0051] The above device may optionally further include:
[0052] a feedback unit, configured to stop the data cleaning process of the first data stream and the second data stream when the cleaning result does not meet the cleaning condition, and to feed back the cleaning result to the user;
[0053] A restart unit is used to apply the FLink SQL script to re-clean the first data stream and the second data stream when receiving a new FLink SQL script uploaded by the user based on the cleaning result.
[0054] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned data processing method.
[0055] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the above data processing method.
[0056] Compared with the prior art, the present invention has the following advantages:
[0057] The present invention provides a data processing method, including: receiving a data cleaning task issued by a user via a data center; obtaining data source information and data output information corresponding to the data cleaning task based on table creation syntax, processing the data stream corresponding to the data source information and the data stream corresponding to the data output information, and obtaining a first data stream corresponding to the data source information and a second data stream corresponding to the data output information; obtaining a data cleaning FLink SQL script pre-submitted by the user, and applying the FLink SQL script to clean the first data stream corresponding to the data source information and the second data stream corresponding to the data output information; enabling a preset task monitoring module to monitor the data cleaning process in real time to determine whether there is a task backlog for the data cleaning task; when there is no task backlog for the data cleaning task, obtaining the cleaning result after data cleaning, and determining whether the cleaning result meets the preset cleaning condition; when the cleaning result meets the cleaning condition, sending the cleaning result to a pre-set Flink cluster, and storing and outputting the cleaning result through the Flink cluster. Applying the method provided by the present invention, the Flink SQL script can be applied to realize automatic cleaning, and the cleaning process can be monitored, reducing manual participation, and improving the efficiency of data processing and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0059] Figure 1 A method flow chart of a data processing method provided by an embodiment of the present invention;
[0060] Figure 2 A flowchart of another method of a data processing method provided by an embodiment of the present invention;
[0061] Figure 3 A flowchart of another method of a data processing method provided by an embodiment of the present invention;
[0062] Figure 4 A device structure diagram of a data processing device provided by an embodiment of the present invention;
[0063] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0066] The present invention can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or equipment, etc.
[0067] The embodiment of the present invention provides a data processing method, which can be applied to various system platforms, and the execution subject can be a processor of a computer terminal or various mobile devices. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0068] S101: receiving a data cleaning task sent by a user via a data center.
[0069] It should be noted that before performing data cleaning, the user needs to obtain the corresponding data cleaning task from the data center.
[0070] The data center includes at least one data source module and a data output module. The data source module contains at least one data, and the data output module contains at least one table data or subject data.
[0071] S102: Obtain data source information and data output information corresponding to the data cleaning task.
[0072] The data source information and data output information are data storage information, and the data storage information is data table information of the database or topic information of Kafka. For example, the data of the data source information corresponds to the data of one or several topics in Kafka, and the data of the data output information corresponds to the table data in the database (MySQL) or the data in a topic in Kafka.
[0073] It should be noted that the user obtains the data source and data output through the data center to generate the corresponding data cleaning task, and then saves the data cleaning task to the database of the data center. The Flink cluster or processor obtains the data cleaning task from the database and obtains the data source information and data output information from it.
[0074] S103: Based on a preset table creation syntax, the data stream corresponding to the data source information and the data stream corresponding to the data output information are processed to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information.
[0075] It should be noted that the table creation syntax (CREATE TABLE) is used to map streaming records to data row records of a table. Therefore, through the table creation syntax, the data streams corresponding to the data source information and the data output information are abstracted into streaming table data, that is, the first data stream and the second data stream.
[0076] S104: Obtain the data cleansing FLink SQL script submitted in advance by the user, and apply the FLink SQL script to perform data cleansing on the first data stream and the second data stream.
[0077] It should be noted that the Flink SQL script can be a data cleaning script formulated by the user according to the data cleaning task, or it can be a preset fixed script for data cleaning.
[0078] S105: Activate a preset task monitoring module to monitor the data cleaning process in real time to determine whether there is a backlog of the data cleaning tasks.
[0079] Among them, task backlog refers to the fact that the Flink SQL script in the data cleaning process does not clean the streaming data in a timely manner, resulting in data backlog.
[0080] Optionally, when there is no backlog in the data cleaning tasks, S105 is executed, and when there is a backlog in the data cleaning tasks, the warning communication module preset by the user is started, and the warning communication module is used to perform a warning notification.
[0081] S106: When there is no backlog of the data cleaning task, obtain a cleaning result after the data cleaning, and determine whether the cleaning result meets a preset cleaning condition.
[0082] It should be noted that the cleaning conditions can be formulated by the business party corresponding to the data cleaning task, or the user can set fixed standards for data cleaning. The cleaning conditions are met if the standards formulated by the business party or the fixed standards set by the user are met.
[0083] Optionally, when the cleaning result meets the cleaning condition, S106 is executed; when the cleaning result does not meet the cleaning condition, the data cleaning process of the first data stream and the second data stream is stopped, and the cleaning result is fed back to the user; when the user re-uploads a new FLink SQL script based on the cleaning result, the FLinkSQL script is applied to re-clean the first data stream and the second data stream.
[0084] S107: When the cleaning result meets the cleaning condition, the cleaning result is sent to a preset Flink cluster, and the Flink cluster is used to store and output the cleaning result.
[0085] It should be noted that the Flink cluster is set up in the resource management system, which is used to manage the reception of tasks and the storage of cleaned data.
[0086] In the method provided in the embodiment of the present invention, a data cleaning task issued by a user via a data center is received, data source information and data output information are obtained, and the data streams corresponding to the data source information and the data output information are processed based on the table creation syntax to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information. The Flink SQL script is applied to perform data cleaning on the first data stream and the second data stream, and the cleaning process is monitored in real time to determine whether there is a task backlog. If there is no task backlog, the cleaning result is obtained after the data cleaning is completed, and it is determined whether the cleaning result meets the cleaning condition. If it meets the condition, the data cleaning result is output to the Flink cluster for storage.
[0087] By applying the method provided in the embodiment of the present invention, Flink SQL scripts can be used to implement automated cleaning, and the cleaning process can be monitored to reduce manual participation, thereby improving data processing efficiency and user experience.
[0088] In the method provided in the embodiment of the present invention, the user can pre-process the Flink SQL script before sending the data cleaning task, mainly by extending the semantics of Flink SQL so that the table creation (CREATE TABLE) syntax directly supports the data source and data serialization format of the specified Kafka topic. In the method provided in this article, the data serialization format supports text, csv format and json format data.
[0089] Furthermore, the table view (CREATE TEMP TABLE) syntax can be extended based on the CREATE TABLE syntax to support the concept of putting pre-processed data into a view similar to that in a database to provide intermediate results for the next step of cleaning. The INSERT INTO semantics can be extended to support the direct landing of processed data into data storage, landing into MySQL as the cleaning result, and forwarding to other topics of Kafka as the data input source for the next cleaning. Among them, CREATETEMP TABLE represents a view, CREATE TABLE represents the real data records, and CREATE TEMPTABLE is equivalent to performing some operations such as screening and statistics on the records in the table to form a temporary table.
[0090] In the method provided in the embodiment of the present invention, the process of obtaining the data source information and data output information corresponding to the data cleaning task is as follows: Figure 2 As shown, it may specifically include:
[0091] S201: Connecting to the database of the data center.
[0092] It should be noted that before sending a data cleaning task, the user obtains the data source authority of the data center after the user authority management verification is carried out by the data center. The data center returns the relevant data source information and data output information to the user, and sends the data cleaning task to the data center based on the data source information and data output information. The data center generates the corresponding task identification code based on the data cleaning task sent by the user, and packages the data source information and data output information corresponding to the data cleaning task and saves them to the database, and forwards the data cleaning task to the Flink cluster for operation. Among them, user authority management mainly manages the data source authority owned by the user.
[0093] S202: Obtain a task identification code corresponding to the data cleaning task in the database.
[0094] Based on the execution process of the above S201 data center, a task identification code is obtained after receiving the data cleaning task.
[0095] S203: Extracting a task package corresponding to the data cleaning task in the database based on the task identification code.
[0096] It can be understood that the task package matching the task identification code is searched in the database and the task package is extracted.
[0097] S204: Parse the task package to obtain data source information and data output information corresponding to the data cleaning task in the task package.
[0098] Furthermore, the storage information of the streaming data to be cleaned can be determined through the data source information and the data output information, and the data stream corresponding to the data source information and the data stream corresponding to the data output information can be obtained according to the storage information.
[0099] In the method provided by the embodiment of the present invention, after receiving the data cleaning task sent by the user via the data center, the data center is connected to obtain the task identification code; the task package corresponding to the task identification code in the database of the data center is searched, and the data source information and data output information are obtained by parsing the task package.
[0100] Specifically, a data center corresponds to one or more data sources and data outputs. The data source corresponds to the data of one or more topics in Kafka, and the data output corresponds to the table data in MySQL or the data in a topic in Kafka. In the invention, the user is assigned the authority of the corresponding data center, and the user can use the data source information and data output information in the data center to perform the corresponding data cleaning task.
[0101] In the method provided by the embodiment of the present invention, the process of enabling the preset task monitoring module to monitor the data cleaning process in real time and determining whether there is a task backlog in the data cleaning task is as follows: Figure 3 As shown, it may specifically include:
[0102] S301: Start the pre-set Kafka consumer group water level logic module.
[0103] It should be noted that the Kafka consumer group water level logic (Kafka Consumer Offset) module can be used to monitor the consumption of data streams in real time, such as monitoring the progress of data streams for data cleaning.
[0104] S302: Apply the Kafka consumer group water level logic module to record in real time the consumption delay information of each time the FLink SQL script consumes the first data stream and the second data stream for data cleaning.
[0105] It should be noted that the process of the Flink SQL script performing data cleaning on the first data stream and the second data stream may be to input the data of the first data stream and / or the second data stream into the Flink SQL script in real time. In the process of cleaning the streaming data, there may be consumption delays, and when there are consumption delays, the data will be backlogged.
[0106] Among them, consumption delay refers to the inconsistency between the rate of message production and message consumption during the process of streaming data cleaning. If the production speed is faster than the consumption speed, there will be a backlog. That is, the rate of inputting data into the Flink SQL script and the rate of outputting data after the Flink SQL script performs data cleaning are inconsistent, resulting in the output rate not being able to match the input rate. The consumption delay information can be the delay time or the delay rate.
[0107] S303: Determine whether the currently recorded consumption delay information exceeds a preset threshold.
[0108] If the currently recorded consumption delay information does not exceed the threshold, S304 is executed; if the currently recorded consumption delay information exceeds the threshold, S305 is executed.
[0109] S304: Determine that there is no backlog of the data cleaning task;
[0110] S305: Determine that there is a backlog of the data cleaning tasks.
[0111] Specifically, the present invention expands the logic of obtaining Kafka Consumer Offset (water level of Kafka consumer group), and obtains the lag record (consumption delay) of the topic according to the water level of the consumer group and the number of records of Kakfa topic. The consumption delay of the topic is also the delay of the task that uses the topic as the data source. According to the business needs, an alarm for task consumption delay can be set. When the lag is greater than a certain threshold, a text message alarm notifies the responding data analyst to avoid excessive consumption delays that may cause server or system abnormalities.
[0112] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.
[0113] and Figure 1 Corresponding to the method described above, the embodiment of the present invention further provides a data processing device for Figure 1 In order to implement the method in the embodiment of the present invention, the data processing device provided in the embodiment of the present invention can be applied to a computer terminal or various mobile devices, and its structural diagram is as follows: Figure 4 As shown, specifically including:
[0114] A receiving unit 401 is used to receive a data cleaning task sent by a user via a data center;
[0115] A first acquisition unit 402 is used to acquire data source information and data output information corresponding to the data cleaning task, wherein the data source information and data output information are data storage information, and the data storage information is data table information of a database or topic information of Kafka;
[0116] The processing unit 403 is used to process the data stream corresponding to the data source information and the data stream corresponding to the data output information based on a preset table creation syntax to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information;
[0117] A data cleaning unit 404 is used to obtain a data cleaning FLink SQL script pre-submitted by the user, and apply the FLink SQL script to perform data cleaning on the first data stream and the second data stream;
[0118] A monitoring unit 405 is used to enable a preset task monitoring module to monitor the data cleaning process in real time and determine whether there is a task backlog in the data cleaning task;
[0119] A second acquisition unit 406 is used to acquire a cleaning result after data cleaning when there is no backlog of the data cleaning task, and determine whether the cleaning result meets a preset cleaning condition;
[0120] The processing end unit 407 is configured to send the cleaning result to a preset Flink cluster when the cleaning result satisfies the cleaning condition, and store and output the cleaning result through the Flink cluster.
[0121] In the device provided by the embodiment of the present invention, a data cleaning task issued by a user via a data center is received, data source information and data output information are obtained, and the data streams corresponding to the data source information and the data output information are processed based on the table creation syntax to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information. The Flink SQL script is applied to clean the first data stream and the second data stream, and the cleaning process is monitored in real time to determine whether there is a backlog of tasks. If there is no backlog of tasks, the cleaning results are obtained after the data cleaning is completed, and it is determined whether the cleaning results meet the cleaning conditions. If satisfied, the data cleaning results are output to the Flink cluster for storage.
[0122] By using the device provided in the embodiment of the present invention, Flink SQL scripts can be used to implement automatic cleaning, and the cleaning process can be monitored to reduce manual participation and improve data processing efficiency and user experience.
[0123] In the device provided by the embodiment of the present invention, the first acquisition unit 402 includes:
[0124] A connection subunit, used for connecting to a database of the data center;
[0125] A first acquisition subunit is used to acquire a task identification code corresponding to the data cleaning task currently updated in the database;
[0126] A second acquisition subunit is used to extract a task package corresponding to the data cleaning task in the database based on the task identification code;
[0127] The parsing subunit is used to parse the task package and obtain data source information and data output information corresponding to the data cleaning task in the task package.
[0128] In the device provided in the embodiment of the present invention, the monitoring unit 405 includes:
[0129] The startup subunit is used to start the pre-set Kafka consumer group water level logic module;
[0130] A recording subunit, used for applying the Kafka consumer group water level logic module to record in real time the consumption delay information of each consumption of the first data stream and the second data stream by the FLink SQL script for data cleaning;
[0131] A judgment subunit, used to judge whether the consumption delay information currently recorded exceeds a preset threshold;
[0132] A first determining subunit is configured to determine that there is no task backlog for the data cleaning task if the consumption delay information of the current record does not exceed the threshold;
[0133] The second determining subunit is used to determine that there is a backlog of the data cleaning task if the renewal fee delay time of the current record exceeds the threshold.
[0134] The device provided in the embodiment of the present invention further includes:
[0135] The early warning unit is used to start the early warning communication module preset by the user when there is a backlog of tasks in the data cleaning tasks, and use the early warning communication module to make early warning notifications.
[0136] The device provided in the embodiment of the present invention further includes:
[0137] a feedback unit, configured to stop the data cleaning process of the first data stream and the second data stream when the cleaning result does not meet the cleaning condition, and to feed back the cleaning result to the user;
[0138] A restart unit is used to apply the FLink SQL script to re-clean the first data stream and the second data stream when receiving a new FLink SQL script uploaded by the user based on the cleaning result.
[0139] For the specific working process of each unit and sub-unit in the data processing device disclosed in the above embodiment of the present invention, reference may be made to the corresponding content in the data processing method disclosed in the above embodiment of the present invention, and will not be repeated here.
[0140] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned data processing method.
[0141] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 5 As shown, it specifically includes a memory 501 and one or more instructions 502, wherein the one or more instructions 502 are stored in the memory 501 and are configured to be executed by one or more processors 503 to perform the following operations:
[0142] Receive data cleaning tasks sent by users through the data center;
[0143] Obtain data source information and data output information corresponding to the data cleaning task, wherein the data source information and data output information are data storage information, and the data storage information is data table information of a database or topic information of Kafka;
[0144] Based on a preset table creation syntax, the data stream corresponding to the data source information and the data stream corresponding to the data output information are processed to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information;
[0145] Obtaining a data cleaning FLink SQL script pre-submitted by the user, and applying the FLink SQL script to perform data cleaning on the first data stream and the second data stream;
[0146] Activate a preset task monitoring module to monitor the data cleaning process in real time to determine whether there is a backlog of the data cleaning task;
[0147] When there is no backlog of the data cleaning task, obtaining a cleaning result after data cleaning, and determining whether the cleaning result meets a preset cleaning condition;
[0148] When the cleaning result meets the cleaning condition, the cleaning result is sent to a preset Flink cluster, and the cleaning result is stored and outputted through the Flink cluster.
[0149] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely 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 embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0150] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, computer software, or a combination of both.
[0151] In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0152] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data processing method, It is characterized in that include: Receive data cleaning tasks sent by users through the data center; Obtain data source information and data output information corresponding to the data cleaning task, wherein the data source information and data output information are data storage information, and the data storage information is data table information of a database or topic information of Kafka; Based on a preset table creation syntax, the data stream corresponding to the data source information and the data stream corresponding to the data output information are processed to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information; Obtaining a data cleaning FLink SQL script pre-submitted by the user, and applying the FLink SQL script to perform data cleaning on the first data stream and the second data stream; Activate the preset task monitoring module to monitor the data cleaning process in real time to determine whether there is a backlog of the data cleaning task; When there is no backlog of the data cleaning task, obtaining a cleaning result after data cleaning, and determining whether the cleaning result meets a preset cleaning condition; When the cleaning result meets the cleaning condition, the cleaning result is sent to a preset Flink cluster, and the cleaning result is stored and outputted through the Flink cluster.
2. The method according to claim 1, It is characterized in that The obtaining of data source information and data output information corresponding to the data cleaning task includes: Connecting to a database of the data center; Obtaining a task identification code corresponding to the data cleaning task in the database; Extracting a task package corresponding to the data cleaning task in the database based on the task identification code; The task package is parsed to obtain data source information and data output information corresponding to the data cleaning task in the task package.
3. The method according to claim 1, It is characterized in that The enabling of a preset task monitoring module to monitor the data cleaning process in real time and determine whether there is a task backlog in the data cleaning task includes: Start the pre-set Kafka consumer group water level logic module; Apply the Kafka consumer group water level logic module to record in real time the consumption delay information of each consumption of the first data stream and the second data stream by the FLink SQL script for data cleaning; Determine whether the currently recorded consumption delay information exceeds the preset threshold; If the consumption delay information of the current record does not exceed the threshold, it is determined that there is no task backlog for the data cleaning task; If the consumption delay time of the current record exceeds the threshold, it is determined that there is a task backlog in the data cleaning task.
4. The method according to claim 1 or 3, It is characterized in that Also includes: When there is a backlog of tasks in the data cleaning tasks, the early warning communication module preset by the user is started, and the early warning communication module is used to perform early warning notification.
5. The method according to claim 1, It is characterized in that Also includes: When the cleaning result does not meet the cleaning condition, stopping the data cleaning process of the first data stream and the second data stream, and feeding back the cleaning result to the user; When a new FLink SQL script is uploaded by the user based on the cleaning result, the FLink SQL script is applied to clean the first data stream and the second data stream again.
6. A data processing device, It is characterized in that include: A receiving unit, used for receiving a data cleaning task sent by a user via a data center; A first acquisition unit is used to acquire data source information and data output information corresponding to the data cleaning task, wherein the data source information and data output information are data storage information, and the data storage information is data table information of a database or topic information of Kafka; A processing unit, configured to process the data stream corresponding to the data source information and the data stream corresponding to the data output information based on a preset table creation syntax, to obtain a first data stream corresponding to the data source information and a second data stream corresponding to the data output information; A data cleaning unit, used for obtaining a data cleaning FLink SQL script pre-submitted by the user, and applying the FLink SQL script to perform data cleaning on the first data stream and the second data stream; A monitoring unit is used to enable a preset task monitoring module to monitor the data cleaning process in real time and determine whether there is a task backlog in the data cleaning task; A second acquisition unit is used to acquire a cleaning result after data cleaning when there is no task backlog of the data cleaning task, and determine whether the cleaning result meets a preset cleaning condition; The processing end unit is used to send the cleaning result to a preset Flink cluster when the cleaning result meets the cleaning condition, and store and output the cleaning result through the Flink cluster.
7. The device according to claim 6, It is characterized in that The first acquisition unit includes: A connection subunit, used for connecting to a database of the data center; A first acquisition subunit is used to acquire a task identification code corresponding to the data cleaning task in the database; A second acquisition subunit is used to extract a task package corresponding to the data cleaning task in the database based on the task identification code; The parsing subunit is used to parse the task package and obtain data source information and data output information corresponding to the data cleaning task in the task package.
8. The device according to claim 6, It is characterized in that The monitoring unit comprises: The startup subunit is used to start the pre-set Kafka consumer group water level logic module; A recording subunit, used for applying the Kafka consumer group water level logic module to record in real time the consumption delay information of each consumption of the first data stream and the second data stream by the FLink SQL script for data cleaning; A judgment subunit, used to judge whether the consumption delay information currently recorded exceeds a preset threshold; A first determining subunit is configured to determine that there is no task backlog for the data cleaning task if the consumption delay information of the current record does not exceed the threshold; The second determining subunit is used to determine that there is a task backlog in the data cleaning task if the consumption delay time of the current record exceeds the threshold.
9. The device according to claim 6 or 8, It is characterized in that Also includes: The early warning unit is used to start the early warning communication module preset by the user when there is a backlog of tasks in the data cleaning tasks, and use the early warning communication module to make early warning notifications.
10. The device according to claim 6, It is characterized in that Also includes: a feedback unit, configured to stop the data cleaning process of the first data stream and the second data stream when the cleaning result does not meet the cleaning condition, and to feed back the cleaning result to the user; A restart unit is used to apply the FLink SQL script to re-clean the first data stream and the second data stream when receiving a new FLink SQL script uploaded by the user based on the cleaning result.
Citation Information
Patent Citations
Data cleaning method and device
CN107239581A
Intelligent data cleaning method and device based on metadata
CN112000656A
Method for generating and executing dynamic spark task
CN113448657A
Method and apparatus for processing multi-cluster job record, and device and storage medium
WO2021051531A1
