A visual data cleaning script cleaning process analysis system
By extracting and visualizing intermediate table information and data conversion operations in the data cleaning script, and using directed acyclic graphs to display the data conversion process, it solves the problem of data workers understanding complex data cleaning scripts and improves the visualization and understanding of the data cleaning process. efficiency.
Patent Information
- Application Number
- CN202210066324.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-20
AI Technical Summary
It is difficult for data workers to understand and visualize the data conversion process in complex data cleaning scripts, especially changes in multiple tables and complex operations such as table structure conversion, resulting in a cumbersome and error-prone understanding and debugging process.
A visual data cleaning script cleaning process analysis system is designed, including a program adapter and a visual generator. It extracts and generates intermediate table information and data transformation operation information through a program executor, a code parser and a data transformation inferencer, and uses directed Acyclic graphs are used for visual display, showing the causal relationships and data transformation operations between intermediate tables.
It realizes the visualization of complex data conversion operations and multi-table changes, helps data workers understand the derivative relationships and dependencies between data tables in scripts, improves the efficiency of code debugging and reuse, and reduces the difficulty of learning new programming languages. .
Smart Images

Figure CN114546464B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of program visualization and relates to a visualization data cleaning script cleaning process analysis system. Background Art
[0002] Data wrangling is a process of organizing complex and messy data into an ideal data format through cleaning and conversion operations. It is an important prerequisite for tasks such as data access, data modeling, and data visual analysis. Two-dimensional data tables are an effective means of organizing and arranging data. People widely use various tables in communication, scientific research, and data analysis activities. Since the original table often contains "dirty" data, or the data format and content do not meet the expected goals, data workers must clean the table.
[0003] Data cleaning involves a variety of data transformation operations, such as deleting duplicate rows, filling missing values, splitting composite columns, etc. Using programming languages such as R and Python to write specific cleaning scripts is a common method to complete data cleaning work. In actual work, data workers often need to understand the specific data cleaning process performed in the cleaning script to understand how the data changes. For example, in program reuse, data workers need to learn the ideas of data cleaning in other scripts to modify and apply them to their own data; in double verification, data workers need to verify the process of data cleaning performed by others to ensure the accuracy of the cleaning results; in code maintenance, data workers need to organize codes that are not well documented to avoid errors in maintenance tasks. However, it is not easy for data workers to understand the specific data cleaning process of data cleaning scripts, which includes two difficulties:
[0004] One is that there are many programming methods to implement data conversion operations, and it is difficult for data workers to master all of them. Currently, there are many programming languages and their related packages (libraries) that can complete data cleaning tasks, such as the Pandas package in Python, the tidyr and dplyr packages in R, etc. However, for data workers who are not proficient in these programming languages, learning a new programming language or toolkit for data cleaning tasks will take a lot of time and effort.
[0005] The second is that data workers cannot learn the status of the data table and its changes from the code. Even if data workers have understood the data cleaning operations performed by the code, since the table data may be very complex, data workers will find it difficult to understand the current table status without combining it with the real table data, such as the number of rows and columns in the current table, whether there is other messy data, etc. Viewing the table status often requires modifying the source code to output the current table content, which undoubtedly increases the workload of data workers.
[0006] In short, understanding the specific cleaning process of complex cleaning scripts requires data workers to have certain programming skills, and this process is often boring, time-consuming and error-prone. Therefore, how to help data workers efficiently understand the cleaning process in data cleaning scripts is a challenging research problem.
[0007] At present, there are many research works on program visualization that aim to visualize the execution logic or data structure of actual program codes. These works can be divided into two categories according to their design purposes: code debugging and learning and education. Program visualization technologies used for code debugging, such as Anteater and Visuflow, aim to reveal the runtime behavior of programs, such as displaying code-related information such as object status and function calls, to facilitate program testing and bug fixing. However, these technologies can only display the status of common data types, such as strings and numeric data, but cannot reveal the status change information of two-dimensional data tables. Due to the complexity of two-dimensional data tables, their visualization is often more challenging than general data types. Program visualization tools used for learning and education, such as online Python tutors, aim to improve learners' understanding of the execution logic (process) of programs. Such tools have been widely studied and applied in the field of algorithm visualization. They can visualize the behavior of programs at each step to promote understanding of algorithms. Some of these method tools, such as Autoflowchart, code2flow, and Vizme, can also automatically convert source code into flow charts to visually display the execution logic of the code. However, none of these technologies can visualize the cleaning process of tabular data.
[0008] Data lineage refers to the process of data changes during analysis and processing, so revealing the process of changes in tabular data during the cleaning process actually belongs to the field of data lineage. There are many works aimed at visualizing data lineage. For example, TACO is a visual comparison tool that can show the differences in tabular data changes over time, but the tool cannot visualize the cleaning process of data cleaning scripts completed in programming languages; Datamations can explain the steps in the data cleaning process through animation, but the tool can only reveal the data changes of one table, and cannot show the changes of multiple tables at the same time. In addition, the above tools can only visualize a small part of data transformation operations, and cannot support complex operations such as transformations involving table structures (such as Pivot, Unpivot, etc.). Summary of the invention
[0009] The present invention provides a visual data cleaning script cleaning process analysis system, which can display changes in multiple tables and visualize complex data conversion operations.
[0010] A visual data cleaning script cleaning process analysis system, comprising:
[0011] A program adapter and a visualization generator, wherein the program adapter includes a program executor, a code parser, and a data conversion inferencer;
[0012] The program executor includes a program processor and a program interpreter, wherein the program processor is used to mark the table information data with intermediate table information in the original table data cleaning script, and the program interpreter is used to detect and save the intermediate table information and the column status information in each intermediate table;
[0013] The code parser is used to extract operation information for performing data conversion operations on the intermediate table based on the source code of the intermediate table information generated in the data cleaning script, wherein the operation information includes input table information, output table information, and functions of the table information data;
[0014] The data conversion inferring device is used to determine a data conversion operation type set of the table information data based on the correspondence between the function name and the data conversion operation type, determine a final data conversion operation type of the table information data from the data conversion operation type set based on the input table information and the output table information, determine parameters of the final data conversion operation based on the function parameters, generate a data conversion operation text description based on the type and parameters of the final data conversion operation, and construct data conversion operation description information with the type and parameters of the final data conversion operation and the data conversion operation text description;
[0015] The visualization generator includes a cleaning layout constructor and a graphic icon drawer, wherein the cleaning layout constructor is used to use a directed acyclic graph to generate a directed acyclic graph framework based on the causal relationship of the intermediate table in the data conversion operation description information during the cleaning process, and use the Eclipse Layout Kernel layout algorithm to match the intermediate table information to each node in the directed acyclic graph framework to obtain an intermediate table directed acyclic graph;
[0016] The graphic icon drawer is used to generate a data conversion operation graph visualized in the form of a graphic icon for the data conversion operation based on the data conversion operation description information, and based on the causal relationship of each node in the directed acyclic graph of the intermediate table, the data conversion operation graph is assigned to the edges of the directed acyclic graph formed between each node to obtain a visualization diagram of the data cleaning process.
[0017] The table information data is located from the original table data cleaning script based on the intermediate table information, wherein the intermediate table information includes the name of the intermediate table, the number of rows and the number of columns, and the name of the intermediate table is composed of the row number of the table information data in the original table data cleaning script and the variable name of the intermediate table in the table information data.
[0018] The grouping operation performed on the table information data before the data conversion operation is obtained based on the column status information, the column status information includes the data type of the column and the grouping operation category of the column, and the grouping operation category includes group averaging, cumulative sum, and group splitting.
[0019] The data types of the columns include string type, integer type, floating point type, and time type, which are used to more accurately and quickly infer the type of data conversion operations.
[0020] The data conversion operation is performed by the function, which includes a function name and function parameters.
[0021] The method of determining a data conversion operation type set for table information data based on the correspondence between function names and data conversion operation types includes: constructing a correspondence between function names and data conversion operation types based on at least one function that performs a data conversion operation, and inputting the function name of the table information data into the correspondence to obtain multiple data conversion operation types for the table information data.
[0022] The method of generating a data conversion operation text description based on the type and parameters of the final data conversion operation includes: obtaining a data conversion operation text description template based on the type of the final data conversion operation, and filling the data conversion operation template with the parameters of the final data conversion operation to obtain a data conversion operation text description. The data conversion operation graph visually represents the data conversion operation from one intermediate table, i.e., the input table, to another intermediate table, i.e., the output table. The data conversion operation graph includes an input table, an output table, and the data conversion operation text description.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] (1) The present invention extracts the operation information of the data conversion operation of the intermediate table information in the saved original table cleaning script, and obtains the data conversion operation type and parameters based on the operation information to obtain the data conversion operation description information, visualizes the data conversion operation description information, and displays the data conversion operations between the intermediate tables through a directed acyclic graph through a data conversion operation graph to complete the visualization of complex data conversion operations and the causal relationship of changes in multiple tables.
[0025] (2) The present invention uses the visualization form of a directed acyclic graph to connect all the intermediate tables (nodes of the graph) in the cleaning process through data conversion operations (edges of the graph), which promotes data workers' understanding of the entire cleaning process in the script, and helps data workers to efficiently understand the derivative relationships and dependencies between the data tables in the script, making it convenient for data workers to debug codes, correct errors, reuse scripts, etc. At the same time, since the present invention is universal in programming languages, the present invention can also help data workers learn how to use new programming languages in performing data cleaning tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A flowchart of a cleaning process analysis system for a visual data cleaning script provided for a specific implementation method;
[0027] Figure 2 A visual data cleaning script cleaning process analysis system diagram provided for a specific implementation method;
[0028] Figure 3 A system diagram integrated into the Morpheus tool provided for a specific implementation. DETAILED DESCRIPTION
[0029] The present invention provides a visual data cleaning script cleaning process analysis system, such as Figure 1 As shown, including:
[0030] A program adapter and a visualization generator, wherein the program adapter includes a program executor, a code parser and a data conversion inferencer; wherein the program executor includes a program processor and a program interpreter, wherein the program processor is used to mark the table information data with intermediate table information in the original table data cleaning script, and the program interpreter is used to detect and save the intermediate table information, as well as the column status information in each intermediate table; the intermediate table information includes the name of the intermediate table, the number of rows and the number of columns, and the name of the intermediate table is composed of the row number of the table information data in the original table data cleaning script and the variable name of the intermediate table in the table information data. The naming format of the intermediate table name is such as "L7(TBL_3).csv", wherein L7 means that the row number of the intermediate table generated in the source code is 7, and TBL_3 means the variable name of the intermediate table in the source code. The row number is added to uniquely identify the intermediate table and facilitate the correspondence between the intermediate table and the source code. The column status information includes the data type of the column and the grouping operation category of the column, and the grouping operation category includes grouping average, cumulative sum, and group splitting. Since the grouping operation does not actually change the table data, it is necessary to detect the status of the column at runtime.
[0031] The code parser is used to generate the source code of the intermediate table information in the data cleaning script, extract the operation information of the data conversion operation on the intermediate table, the operation information includes the input table information of the table information data, the output table information, and the function that performs the data conversion operation. The function includes the function name and function parameters. The function name is used to infer which specific data conversion operation is performed by this line of code.
[0032] The data conversion inferer will traverse each set of operation information generated by the code parser, and infer the specific set of data conversion operation types through the function name and the correspondence between the pre-constructed function and the data conversion operation. Since the same function may support multiple data conversion operations, it is also necessary to use the input table information and the output table information to determine the final data conversion operation type. For example, for the "select(tb1,column3,column1,column2)" code in the R language, if the original column and position arrangement information of the input table tb1 is "column1,column2,colum3", then the data conversion operation performed by the select function is the "rearrange in the specified column order" operation; if it is "column3,column1,column2,column4", then the function performs the "retain the specified column and delete other columns" operation. The parameters of the final data conversion operation are determined based on the function parameters, and a data conversion operation text description template is obtained based on the type of the final data conversion operation. The parameters of the final data conversion operation are filled into the data conversion operation template to obtain a data conversion operation text description. The type and parameters of the final data conversion operation, as well as the data conversion operation text description, construct the data conversion operation description information. Finally, the data conversion inferer generates a series of standardized and unified data conversion operation description information in json data format.
[0033] The visualization generator includes a cleaning layout constructor and a graphic icon drawer, wherein the cleaning layout constructor is used to use a directed acyclic graph to generate a directed acyclic graph framework based on the causal relationship of the intermediate table in the data conversion operation description information during the cleaning process, and uses the Eclipse Layout Kernel layout algorithm to match the intermediate table information to each node in the directed acyclic graph framework to obtain an intermediate table directed acyclic graph; there are three types of edges connecting each node: (1) direct connection edges, that is, the number of input and output tables does not exceed one table, which is used to represent the creation, deletion or conversion of the table. For the operation of creating a table / deleting a table, the node of the input table / output table of the direct connection edge is empty; (2) split edge, that is, the number of input tables is one table, and the number of output tables is multiple tables, which is used to represent the data conversion operation of splitting one table into multiple tables, such as Subset, Decompose and other operations; (3) merge edge, that is, the number of input tables is multiple tables, and the number of output tables is one table, which is used to represent the data conversion operation of merging multiple tables into one table, such as various Join operations. The nodes of the directed acyclic graph are represented by rectangles, and the interior of the rectangles contains table information of the intermediate result table, including the table name, the code line number of the table created in the cleaning script, and the number of rows and columns of the table.
[0034] The graphic symbol drawer is used to generate a data conversion operation graph in the form of a graphic symbol for the data conversion operation based on the data conversion operation description information. Based on the causal relationship of each node in the directed acyclic graph of the intermediate table, the data conversion operation graph is assigned to the edges of the directed acyclic graph formed between each node to obtain a visualization diagram of the data cleaning process, such as Figure 2 The visualization panel is shown in the figure.
[0035] The system of the present invention is a client-server application system based on Web, named Somnus. Figure 2 As shown. The server side of the system is used to implement the "program adapter" function in the above analysis method, while the client side implements the "visualization generator" function. The interface of the system includes the following four panels: (1) Data panel, which is used to upload the original table data to be cleaned; (2) Script panel, which is used to write the corresponding data cleaning code. In this panel, data workers need to specify the programming language of the script code. After writing the cleaning script, click the "Run" button; (3) Visualization panel, the system automatically parses the uploaded original table and cleaning script into data conversion operation description information in json format on the server side and returns it to the client. After receiving the description information, the client uses the D3.js visualization drawing tool to generate specific data conversion graphic symbols and insert them into the directed acyclic graph visualization. In order to better display the data cleaning process of long links, the visualization in this panel supports zooming and panning interactions; (4) Table panel, which is used to display the actual intermediate result table in the data cleaning process.
[0036] To facilitate data workers' exploration between script code, data tables, and data cleaning visualization, the system also supports cross-panel interactions. For example, (1) clicking a node in the visualization panel will display the actual intermediate result table representing the node in the table panel; (2) clicking an edge in the visualization panel (including specific graphic icons) will highlight the code corresponding to the operation in the script panel; similarly, (3) clicking a row of data conversion code in the script panel will highlight the corresponding edge and connected nodes in the visualization panel.
[0037] The present invention can also be applied to automatic synthesis tools for cleaning codes to explain the cleaning process of the codes automatically generated by these tools. Morpheus is a tool that automatically generates corresponding cleaning codes based on the original table and the final table before and after data cleaning. By combining the design method of the present invention with Morpheus technology, the data cleaning process from the original table to the final table can be visualized. The integrated system is as follows: Figure 3As shown in the figure, the interface is basically the same as Somnus, except that in the data panel, data workers need to upload the original table and the final table. After clicking "Upload table and run", the system will automatically generate the corresponding cleaning script and display it in the script panel. At the same time, the corresponding data cleaning visualization will also be automatically generated in the visualization panel. The interaction of this integrated system is consistent with Somnus.
Claims
1. A visual data cleaning script cleaning process analysis system, characterized in that: include: A program adapter and a visualization generator, wherein the program adapter includes a program executor, a code parser, and a data conversion inferencer; The program executor includes a program processor and a program interpreter, wherein the program processor is used to mark the table information data with intermediate table information in the original table data cleaning script, and the program interpreter is used to detect and save the intermediate table information and the column status information in each intermediate table; The code parser is used to extract operation information for performing data conversion operations on the intermediate table based on the source code of the intermediate table information generated in the data cleaning script, wherein the operation information includes input table information of the table information data, output table information, and a function, wherein the function includes a function name and function parameters; The data conversion inference device is used to determine a data conversion operation type set of the table information data based on the correspondence between the function name and the data conversion operation type, determine the final data conversion operation type of the table information data from the data conversion operation type set based on the input table information and the output table information, determine the parameters of the final data conversion operation based on the function parameters, generate a data conversion operation text description based on the type and parameters of the final data conversion operation, and construct data conversion operation description information from the type and parameters of the final data conversion operation and the data conversion operation text description; execute the data conversion operation through the function; The visualization generator includes a cleaning layout constructor and a graphic icon drawer, wherein the cleaning layout constructor is used to use a directed acyclic graph to generate a directed acyclic graph framework based on the causal relationship of the intermediate table in the data conversion operation description information during the cleaning process, and use the Eclipse Layout Kernel layout algorithm to match the intermediate table information to each node in the directed acyclic graph framework to obtain an intermediate table directed acyclic graph; The graphic icon drawer is used to generate a data conversion operation graph visualized in the form of a graphic icon for the data conversion operation based on the data conversion operation description information, and based on the causal relationship of each node in the directed acyclic graph of the intermediate table, the data conversion operation graph is assigned to the edges of the directed acyclic graph formed between each node to obtain a visualization diagram of the data cleaning process.
2. The visual data cleaning script cleaning process analysis system according to claim 1 is characterized in that: The table information data is located from the original table data cleaning script based on the intermediate table information, wherein the intermediate table information includes the name of the intermediate table, the number of rows and the number of columns, and the name of the intermediate table is composed of the row number of the table information data in the original table data cleaning script and the variable name of the intermediate table in the table information data.
3. The visual data cleaning script cleaning process analysis system according to claim 1 is characterized in that: The grouping operation performed on the table information data before the data conversion operation is obtained based on the column status information, the column status information includes the data type of the column and the grouping operation category of the column, and the grouping operation category includes group averaging, cumulative sum, and group splitting.
4. The visual data cleaning script cleaning process analysis system according to claim 3 is characterized in that: The data type of the column includes a string type, an integer type, a floating point type, and a time type, and the data type of the column is used to preliminarily determine a data conversion operation type.
5. The visual data cleaning script cleaning process analysis system according to claim 1 is characterized in that: The method of determining a data conversion operation type set for table information data based on the correspondence between function names and data conversion operation types includes: constructing a correspondence between function names and data conversion operation types based on at least one function that performs a data conversion operation, and inputting the function name of the table information data into the correspondence to obtain multiple data conversion operation types for the table information data.
6. The visual data cleaning script cleaning process analysis system according to claim 1 is characterized in that: The method of generating a data conversion operation text description based on the type and parameters of the final data conversion operation includes: obtaining a data conversion operation text description template based on the type of the final data conversion operation, and filling the data conversion operation text description template with the parameters of the final data conversion operation to obtain a data conversion operation text description.
7. The visual data cleaning script cleaning process analysis system according to claim 1 is characterized in that: The data conversion operation graphic visually represents a data conversion operation from a first intermediate table to a second intermediate table, wherein the first intermediate table is an input table and the second intermediate table is an output table. The data conversion operation graphic includes an input table, an output table, and a text description of the data conversion operation.
Citation Information
Cited By
Batch chart automatic generation method and system based on data fusion and cleaning, electronic equipment and computer readable storage medium
CN121503445A
