Automatic data operation flow generation method and system based on predefined operator

Generating data operation flows through semantic extraction models and large language models solves the problem that machine learning cannot directly complete data preprocessing and programs are limited by function libraries, achieving efficient data preprocessing and automated operation flow generation.

CN118708607AActive Publication Date: 2024-09-27SHENZHEN UNIV

Patent Information

Application Number
CN202411023952.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-09-27
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

In the existing technology, machine learning cannot complete data preprocessing tasks directly through natural language, and the generated data preprocessing program is limited to predefined function libraries, resulting in low preprocessing efficiency.

Method used

By obtaining the data table to be processed and user query requirements, use the semantic extraction model to generate semantic vectors, and input them into the operator vector database to generate tuples and candidate operators, generate key forms based on the semantic vectors and form information, and combine the large The language model generates a sequence of operators, and the parser converts it into execution code, performs data table processing, and generates an automated data operation flow.

Benefits of technology

It realizes the direct completion of data preprocessing tasks by natural language, improves the efficiency and flexibility of data preprocessing, automatically generates data operation flows, enriches the operator library, and improves the efficiency of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708607A
    Figure CN118708607A
Patent Text Reader

Abstract

The invention discloses an automatic data operation flow generation method and system based on a predefined operator, and the method comprises the steps: obtaining a to-be-processed data table and a user query demand, and obtaining form information according to the to-be-processed data table; inputting a user query demand into a semantic extraction model, generating a semantic vector, inputting the semantic vector into an operator vector database, generating tuples and candidate operators, and generating a key form of the to-be-processed data table according to the semantic vector and form information; according to the tuple, the candidate operator and the key form, generating a cue word, and inputting the cue word into a large language model to generate an operator sequence; and based on an operator sequence analyzer, analyzing the operator sequence to obtain an execution code, processing the to-be-processed data table according to the execution code to obtain a processed data table and a data operation stream, and sending the processed data table and the data operation stream to a user. According to the method and the device, the data can be processed more efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data science, and in particular to a method and system for generating an automated data operation flow based on predefined operators. Background Art

[0002] Data preprocessing usually covers multiple aspects: data cleaning, data conversion, data integration and data reduction. The current traditional data preprocessing methods usually include removing duplicates, correcting errors, filling missing values, etc. In some cases, it involves converting non-numeric data into numerical data and performing normalization or standardization.

[0003] At present, machine learning methods can be used for data preprocessing. However, current machine learning can only obtain some features of the data set, but it is not possible to completely complete the data preprocessing task directly by natural language. At the same time, the generated data preprocessing program will also be limited to the predefined function library, resulting in low preprocessing efficiency.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] The main purpose of the present invention is to provide a method, system, terminal and computer-readable storage medium for generating an automated data operation flow based on predefined operators, aiming to solve the problem in the prior art that machine learning cannot completely complete data preprocessing tasks directly by natural language, and the generated data preprocessing program will also be limited to the predefined function library, resulting in low preprocessing efficiency.

[0006] To achieve the above object, the present invention provides a method for generating an automatic data operation flow based on a predefined operator, the method comprising the following steps: Obtaining a data table to be processed and a user query requirement, and obtaining form information according to the data table to be processed; Inputting the user query requirement into a semantic extraction model to generate a semantic vector, inputting the semantic vector into an operator vector database to generate a tuple and a candidate operator, and generating a key form of the data table to be processed according to the semantic vector and the form information; Generate a prompt word according to the tuple, the candidate operator and the key form, and input the prompt word into a large language model to generate an operator sequence; Based on the operator sequence parser, the operator sequence is parsed to obtain the execution code, the data table to be processed is processed according to the execution code, the processed data table and data operation flow are obtained, and sent to the user.

[0007] Optionally, the step of inputting the semantic vector into an operator vector database to generate a tuple and a candidate operator further includes: Storing the pre-acquired data processing algorithm in the operator knowledge base; Each data processing algorithm in the operator knowledge base is converted into a corresponding feature vector according to the text blocks, and all the feature vectors are stored in the operator vector database.

[0008] Optionally, the step of inputting the semantic vector into an operator vector database, generating tuples and candidate operators, and generating a key form of the data table to be processed according to the semantic vector and the form information specifically includes: Inputting the semantic vector into the operator vector database, querying the vector database, and generating a vector feature whose similarity with the semantic vector meets a first preset requirement and a second preset requirement; and forming a tuple according to the vector features whose similarity with the semantic vector meets the first preset requirement, and forming a candidate operator according to the vector features whose similarity with the semantic vector meets the second preset requirement; Based on a table structure vector database, the semantic vector is matched with the form information to generate a key form of the data table to be processed.

[0009] Optionally, generating a prompt word according to the tuple, the candidate operator and the key form, and inputting the prompt word into a large language model to generate an operator sequence specifically includes: According to a predefined prompt word template, the tuple, the candidate operator and the key form are added to the prompt word template to generate the prompt word; The prompt word is input into the large language model, and the large language model generates a corresponding operator sequence for the requirements in the prompt word, wherein the operator sequence is a directed acyclic graph structure.

[0010] Optionally, the operator sequence parser is used to parse the operator sequence to obtain an execution code, and the to-be-processed data table is processed according to the execution code to obtain a processed data table and a data operation flow, and send the processed data table and a data operation flow to the user, specifically including: The operator sequence parser parses the operator sequence, represents the operator sequence as a graph data structure, and generates execution code according to the corresponding graph data structure, wherein the nodes in the graph data structure are replaced with nodes of a directed acyclic graph, and the nodes in the graph data structure after replacement include a processing flow of the data table to be processed; According to the execution code, the corresponding data processing algorithm is called to process the data table to be processed, and the processed data table and data operation flow are obtained and sent to the user.

[0011] Optionally, the nodes in the graph data structure include data import nodes, data conversion nodes, data table connection nodes and data export nodes; Wherein, the data import node is used to load the to-be-processed data table into the operation flow; The data conversion node is used to fill each parameter of the operator in the operator sequence with the variable required by the user query, so as to form a series of executable operator chains; The data table connection node predefines a multi-table connection query solution, which is used to connect multiple tables in the user's query requirements to obtain a set; The data export node is used to export the processed data to a temporary table of the data lake.

[0012] Optionally, the step of generating a prompt word according to the tuple, the candidate operator and the key form, and inputting the prompt word into a large language model to generate an operator sequence, further comprising: Inputting the execution code into an operator knowledge base, parsing the execution code, and obtaining an operator document, wherein the operator document includes a user query requirement and a corresponding data processing algorithm; Determining in the operator knowledge base whether a similarity threshold of the operator document exceeds a preset threshold, and if not, saving the operator document in the operator knowledge base; The operator documents in the operator knowledge base are converted into corresponding feature vectors by using text segmentation, and stored in the operator vector database.

[0013] In addition, to achieve the above-mentioned purpose, the present invention further provides a system for generating an automatic data operation flow based on a predefined operator, wherein the system for generating an automatic data operation flow based on a predefined operator comprises: A data acquisition module is used to acquire a data table to be processed and user query requirements, and to acquire form information according to the data table to be processed; A data generation module, used to input the user query requirements into a semantic extraction model, generate a semantic vector, input the semantic vector into an operator vector database, generate tuples and candidate operators, and generate a key form of the data table to be processed according to the semantic vector and the form information; An operator sequence generation module, used to generate a prompt word according to the tuple, the candidate operator and the key form, and input the prompt word into a large language model to generate an operator sequence; The result generation module is used to parse the operator sequence based on the operator sequence parser to obtain the execution code, process the data table to be processed according to the execution code, obtain the processed data table and data operation flow, and send them to the user.

[0014] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a generation program for automatic data operation flows based on predefined operators stored in the memory and executable on the processor, wherein the generation program for automatic data operation flows based on predefined operators implements the steps of the generation method for automatic data operation flows based on predefined operators as described above when the generation program for automatic data operation flows based on predefined operators is executed by the processor.

[0015] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program for generating an automated data operation flow based on a predefined operator, and when the program for generating an automated data operation flow based on a predefined operator is executed by a processor, the steps of the method for generating an automated data operation flow based on a predefined operator as described above are implemented.

[0016] In the present invention, a data table to be processed and a user query requirement are obtained, and form information is obtained according to the data table to be processed; the user query requirement is input into a semantic extraction model to generate a semantic vector, the semantic vector is input into an operator vector database to generate a tuple and a candidate operator, and a key form of the data table to be processed is generated according to the semantic vector and the form information; a prompt word is generated according to the tuple, the candidate operator and the key form, and the prompt word is input into a large language model to generate an operator sequence; based on an operator sequence parser, the operator sequence is parsed to obtain an execution code, the data table to be processed is processed according to the execution code, the processed data table and data operation flow are obtained, and are sent to a user. In the present invention, when data governance begins, data flow generation is performed based on the operator library, and the operator vector database is used to obtain corresponding operators during continuous operation to process the data table, and an automated data operation flow is generated accordingly, so that users can understand the entire processing process; in addition, the operator database in the present invention is self-enriched to form an operator library with richer functions, which is used for more efficient reasoning in the subsequent operator-based data operation flow generation process. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flow chart of a preferred embodiment of a method for generating an automated data operation flow based on predefined operators of the present invention; Figure 2It is a flowchart of an implementation method of a method for generating an automatic data operation flow based on a predefined operator of the present invention; Figure 3 It is a schematic diagram of an automatic supplement process of an operator vector database in a method for generating an automatic data operation flow based on a predefined operator of the present invention; Figure 4 It is a structural diagram of a preferred embodiment of a system for generating an automated data operation flow based on predefined operators of the present invention; Figure 5 It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0019] Data preprocessing usually covers multiple aspects: data cleaning, data conversion, data integration and data reduction. Traditional data preprocessing methods usually include removing duplicates, correcting errors, filling missing values, etc. In some cases, it involves converting non-numeric data into numerical data, and performing normalization or standardization. Among them, data integration will merge data from different sources to ensure data consistency and integrity. In the reduction process, feature selection or dimensionality reduction technology will be used to reduce the dimension of the data to improve computing efficiency and model performance.

[0020] At present, machine learning methods can be used for data preprocessing. However, current machine learning can only obtain some features of the data set, but it is not possible to completely complete the data preprocessing task directly by natural language. At the same time, the generated data preprocessing program will also be limited to the predefined function library, resulting in low preprocessing efficiency.

[0021] In response to one or more of the above problems, the present invention obtains a data table to be processed and a user query requirement, and obtains form information based on the data table to be processed; inputs the user query requirement into a semantic extraction model to generate a semantic vector, inputs the semantic vector into an operator vector database to generate a tuple and a candidate operator, and generates a key form of the data table to be processed based on the semantic vector and the form information; generates a prompt word based on the tuple, the candidate operator and the key form, and inputs the prompt word into a large language model to generate an operator sequence; based on an operator sequence parser, the operator sequence is parsed to obtain an execution code, the data table to be processed is processed according to the execution code, and a processed data table and data operation flow are obtained, and sent to a user.

[0022] The method for generating an automated data operation flow based on a predefined operator according to a preferred embodiment of the present invention is as follows: Figure 1 and Figure 2 As shown, the method for generating an automated data operation flow based on a predefined operator comprises the following steps: Step S10: Obtain a data table to be processed and a user query requirement, and obtain form information according to the data table to be processed.

[0023] It should be noted that in the application, the processing data table and user query requirements are the data tables that the user needs to process accordingly, and the processing requirements corresponding to the data tables. For example, in the data table of the bank account, the corresponding user query requirement is to analyze the user accounts with large transfers in and out under the premise of repairing some erroneous entries and exits. The corresponding data table is shown in Table 1 below:

[0024] Table 1. Bank account data table In Table 1, the corresponding fields are shown in Table 2 below:

[0025] Table 2, Field representation In this application, when the user needs to find some data with obviously too high total transaction amounts, the following user query requirement is proposed: Please find all data with obviously abnormal total transaction amounts in the account table, which may contain data far above the mean and variance thresholds, and then extract the corresponding form information from Table 1.

[0026] Furthermore, the step of inputting the semantic vector into an operator vector database to generate a tuple and a candidate operator also includes: Storing the pre-acquired data processing algorithm in the operator knowledge base; Each data processing algorithm in the operator knowledge base is converted into a corresponding feature vector according to the text blocks, and all the feature vectors are stored in the operator vector database.

[0027] In this application, before implementing the present invention, it is necessary to construct an operator vector database, wherein the operator vector database contains a variety of general data processing algorithms, such as algorithms for data preparation, such as standardization StandardScaler, MinMaxScaler, missing value filling algorithm SimpleImputer, mean filling algorithm MeanImputer, etc.; SQL-like query algorithms, such as conditional statements, projection operations, and function operations, to find the required data from a two-dimensional data table; data table connection operations, merging the data of two or more tables into a target table according to certain conditions; nested query operations, decomposing the logic of complex queries into simple small queries; code templates, for reference to building large language model prompt words. In this application, these algorithms for data processing are collectively referred to as "operators", forming a relatively complete operator vector database with documentation and calling methods, an example of which is shown in Table 3 below.

[0028] Operator Name Function Name Parameter List document Missing value filling SimpleImputer df: data frame missing_value: missing placeholder strategy: filling strategy fill_value: filling value Fill missing values ​​according to the given filling rules (mean, median, constant, most_frequent). If a fixed value is used for filling, fill missing_value with fill_value Standard normalization StandardScaler Df: data frame columns[]: columns to be normalized Normalize the specified data column in the data frame to [-1,1] Conditional filtering Filter Df: data frame condition: SQL-like conditional statement Given a SQL-like conditional statement, query the data in the data frame Deleting a column DropColumns Df: data frame columns[]: column names to be deleted Delete the data column with the specified column name Rename columns RenameColumn Df: data frame src: original column name dst: target column name Change the specified column name to a new column name Mean MeanColumn Df: data frame column: the name of the column to be calculated dstCol: the name of the column where the calculated result is stored Find the mean of a given column and append it to a new column Standard Deviation StdColumn Df: data frame column: the name of the column to be calculated dstCol: the name of the column where the calculated result is stored Find the standard deviation of a given column and append it to a new column Sin value Sin Df: data frame column: the name of the column to be calculated dstCol: the name of the column where the calculated result is stored Find the sine of a given column and append it to a new column Base64 value Base64 Df: data frame column: the name of the column to be calculated dstCol: the name of the column where the calculated result is stored Find the base64 value of a given column and append it to a new column Unbase64 Unbase64 Df: data frame column: the name of the column to be calculated dstCol: the name of the column where the calculated result is stored Decode the given column into base64 and append it to the new column OneHot Encoding OneHot Df: data frame column: the column to be onehot encoded dstCol: the prefix of the encoded column name Calculates the onehot encoding of a given column and appends it to a new series of table columns Split Column SplitColumn Df: data frame column: the column to be split delim: separator dstCol: the prefix of the column name after splitting Split a column into multiple sub-columns according to the given delimiter Contains regular Rlike Df: data frame column: the column to be searched regex: regular expression dstCol: whether it contains the given regular expression Determines whether a given column contains a regular expression ... ... ... ...

[0029] Table 3. Operator representation In addition, in the present application, the operator vector database adopts Faiss or pgvector to construct the operator vector database, and uses models such as BERT and BGE to extract the semantic vector of the corresponding query, add it to the operator vector database, and use the natural language extracted as feature vector to query the most relevant part of the objects in the library.

[0030] Step S20: input the user query requirement into the semantic extraction model to generate a semantic vector, input the semantic vector into the operator vector database to generate tuples and candidate operators, and generate a key form of the data table to be processed based on the semantic vector and the form information.

[0031] Specifically, in the present application, user queries are processed through a language extraction model to obtain corresponding semantic vectors, so that the corresponding operator composition elements and candidate operators can be obtained from the operator vector database, and the key tickets in the form information can be obtained through the semantic vectors.

[0032] It should be noted that in this application, in the operator vector database inventory, according to the basic functions of large-scale computing in the data lake, the current basic algorithm operations are extracted into a series of operators, such as string processing and replacement operators, mathematical calculation operators, mean variance statistical information operators, etc.; at the same time, according to the existing algorithms and commonly used data processing flow operations, a series of special extended operators are constructed, such as data standardization operators, missing value filling operators, data encoding operators, etc.; through the encapsulation mechanism of this series of operators in the system, the function documents and templates of each operator will be generated and added to the operator vector database as a plug-in knowledge base.

[0033] Furthermore, the step of inputting the semantic vector into an operator vector database, generating tuples and candidate operators, and generating a key form of the data table to be processed according to the semantic vector and the form information specifically includes: Inputting the semantic vector into the operator vector database, querying the vector database, and generating a vector feature whose similarity with the semantic vector meets a first preset requirement and a second preset requirement; and forming a tuple according to the vector features whose similarity with the semantic vector meets the first preset requirement, and forming a candidate operator according to the vector features whose similarity with the semantic vector meets the second preset requirement; Based on a table structure vector database, the semantic vector is matched with the form information to generate a key form of the data table to be processed.

[0034] Specifically, in this application, a corresponding first preset requirement and a second preset requirement are set in this application, which are respectively similarity values ​​set by the user. When the vector features in the semantic vector and the operator vector database meet the corresponding preset requirements, the corresponding vector features are used as the corresponding ancestor and candidate operator. At the same time, for the data form, the semantic vector obtained in this application is matched with the expression information to obtain the corresponding key form.

[0035] That is, according to the data table and user needs, the table schema and data form information are analyzed from the data table to be processed, and the information is associated with the semantic vector of the user needs to construct the meta information of the pruned table, that is, the key form. And the semantic vector generated by the user needs is subjected to similarity query in the operator vector database to obtain the top-k operators with the strongest correlation with the needs as the ancestor, and the operators that meet the second preset requirements are added as candidate operators to the prompt word template, eliminating the process of users gradually adjusting the prompt words and automatically constructing complete prompt words.

[0036] Specifically, for the data table to be processed described in Table 1, for the user query demand to find out all the data with obvious abnormalities in the total transaction amount in the account table, which may contain data far above the mean and variance thresholds, when the request and the corresponding data table are provided to the system corresponding to this method, the user query demand requested by the user will be obtained through the semantic extraction model to obtain the corresponding semantic vector, and matched with the relevant features in the features of the form information to obtain the (total transaction amount, trans_total_amt) key form and the key Schema of the table. At the same time, the semantic vector of the user query demand is queried in the operator vector database to obtain the (mean operator, standard deviation operator, filter operator) tuple, and the one with higher semantic similarity to the user demand is used as a candidate data processing operator. Through the above processing, the process obtains the algorithm that can meet the user's needs and the key Schema of the table, which can be used to construct the prompt word template.

[0037] Step S30: Generate prompt words according to the tuple, the candidate operator and the key form, and input the prompt words into the large language model to generate an operator sequence.

[0038] It should be noted that in the process of constructing the prompt words of the large language model, a predefined prompt word template will be used, the table schema and related operators will be added to the prompt words, and the large language model will be required to generate answers according to the specified template.

[0039] Further, the generating of prompt words according to the tuple, the candidate operator and the key form, and inputting the prompt words into the large language model to generate an operator sequence specifically includes: According to a predefined prompt word template, the tuple, the candidate operator and the key form are added to the prompt word template to generate the prompt word; The prompt word is input into the large language model, and the large language model generates a corresponding operator sequence for the requirements in the prompt word, wherein the operator sequence is a directed acyclic graph structure.

[0040] Specifically, the corresponding prompt word template is pre-defined. After obtaining the tuple, candidate operator and key form, the prompt word is composed according to the template and then input into the large language model to generate an operator sequence. That is, in this process, the machine learning model, i.e., the large language model, takes the above automatically constructed prompt words as input, and generates an operator sequence, i.e., a directed acyclic graph-like structure, according to the meta-information of the table given in the prompt words, the user's needs, and a series of operators that can be used to achieve the needs. The directed acyclic graph is the main body of the data operation flow, which describes which operators and algorithms will be used under the user's query requirements, and the data is processed according to the operation flow.

[0041] Step S40: Based on the operator sequence parser, the operator sequence is parsed to obtain an execution code, the data table to be processed is processed according to the execution code, a processed data table and a data operation flow are obtained, and the processed data table and a data operation flow are sent to the user.

[0042] It should be noted that in the present application, the operator sequence will be parsed by the domain-specific language parser, i.e., the operator sequence parser, into operators that can be directly called using functions in the library containing operators, and correspondingly constructed as an executable program, i.e., the execution code, to process the uploaded data table to be processed, and finally provide the processed data and the flowchart nodes corresponding to the data processing program to the user.

[0043] Furthermore, the operator sequence parser is based on which the operator sequence is parsed to obtain an execution code, the data table to be processed is processed according to the execution code, a processed data table and a data operation flow are obtained, and the processed data table and a data operation flow are sent to the user, specifically including: The operator sequence parser parses the operator sequence, represents the operator sequence as a graph data structure, and generates execution code according to the corresponding graph data structure, wherein the nodes in the graph data structure are replaced with nodes of a directed acyclic graph, and the nodes in the graph data structure after replacement include a processing flow of the data table to be processed; According to the execution code, the corresponding data processing algorithm is called to process the data table to be processed, and the processed data table and data operation flow are obtained and sent to the user.

[0044] Specifically, in this application, the operator sequence parser parses the operator sequence, and the directed acyclic graph structure will be represented as a general graph data structure. After the parser, each data node is automatically converted into a node representing a directed acyclic graph. The node types include data import nodes, data conversion nodes, data table connection nodes, and data export nodes; wherein, the data import node loads the data uploaded by the user into the operation flow so that subsequent nodes can perform operations on the data, the data conversion node contains the operator sequence extracted from the vector knowledge base, and the various parameters of the operator are filled with the variables required by the user to form a series of executable operator chains, the data connection node predefines the multi-table connection query solution, and connects multiple tables in the requirements to obtain a set, and the data export node defines the temporary table that exports the processed data to the data lake to meet the subsequent requirements for post-processing data queries; after the module completes the operation flow parsing and constructs the executable code module, the data uploaded by the user will be processed to obtain the governed data so that it can be output to the user interface.

[0045] The nodes in the graph data structure include data import nodes, data conversion nodes, data table connection nodes and data export nodes; Wherein, the data import node is used to load the to-be-processed data table into the operation flow; The data conversion node is used to fill each parameter of the operator in the operator sequence with the variable required by the user query, so as to form a series of executable operator chains; The data table connection node predefines a multi-table connection query solution, which is used to connect multiple tables in the user's query requirements to obtain a set; The data export node is used to export the processed data to a temporary table of the data lake.

[0046] Specifically, in one embodiment of the present application, for the data table to be processed in Table 1 above and the corresponding user query requirements, in the corresponding graph data structure, each node is represented as an object, including id, type, and body attributes, which respectively represent the unique identifier of the node, the type of the node (one of the import node, conversion node, connection node, and export node), and the data content of the node. In addition, there are prev and adjTo attributes, which indicate the identifiers of the direct predecessor node and the direct successor node of the node. For example, the conversion node (identified as 2) reads data from the import node (identified as 1) for processing, and outputs the processing results to the export node (identified as 3). In the data import node, there is a src attribute indicating where the data table is imported from and read in a certain file format; in the data conversion node, the operators attribute contains a simple representation of all operators, including the function name and various parameters; in the data export node, the attribute dst indicates the final storage and output location of the data, and the final data will be stored in a file or database in this way.

[0047] In this process, the data import node reads the data in the original format as a two-dimensional table; in the data conversion node, first, a column tr_mean is appended to the data table, and its value is the mean of the total transaction amount, for example, the specific value may be 21600, and then a column tr_std is appended, and its value is the variance of the total transaction amount, and the specific value may be 5400. Then, through the expression, only the data with transaction amounts within the range of the mean plus three times the variance, that is, the data less than 37800, is retained, and finally the redundant columns are deleted; and in the data export node, the data processed by the previous conversion node is saved to the target table, so that the processed data table can be output, as shown in Table 4 below.

[0048] city_id account_id card_age cash_amt id_verify ol_tr_amt pub_tr_amt tr_total_amt 1001 10816789 3 80000.0 true 3000.0 1000.0 4000.0 1001 12013421 2 20000.0 true 2000.0 3000.0 5000.0 2003 20327801 8 100000.0 false null 4000.0 6000.0 ... ... ... ... ... ... ... ... Table 4. Processed data table Furthermore, the method further comprises generating a prompt word according to the tuple, the candidate operator and the key form, and inputting the prompt word into a large language model to generate an operator sequence, and then further comprising: Inputting the execution code into an operator knowledge base, parsing the execution code, and obtaining an operator document, wherein the operator document includes a user query requirement and a corresponding data processing algorithm; Determining in the operator knowledge base whether a similarity threshold of the operator document exceeds a preset threshold, and if not, saving the operator document in the operator knowledge base; The operator documents in the operator knowledge base are converted into corresponding feature vectors by using text segmentation, and stored in the operator vector database.

[0049] Specifically, Figure 3 As shown, in the present application, the execution code generated by the user query demand includes an import node, a conversion node, and an export node, and the operation sequence in the data conversion node is the operator sequence extracted from the vector knowledge base. After the code is executed after the complete data operation flow is generated, the operator sequence composed of the conversion node will be parsed as a "large operator" corresponding to the demand at the same time. The present application replaces the part related to the table meta-information with a wildcard, and combines it with the user query demand and the meta-information of the table to form a new operator document based on the user demand, and selectively inserts it into the constructed operator vector database according to the similarity algorithm. In this operation, the user demand and the generated algorithm are combined into the format of a pre-built operator document, converted into a vector through a pre-trained semantic feature extraction model, and a similarity search is performed in the vector knowledge base. If the similarity in the result obtained by the operator search exceeds a preset threshold (for example, 95%), it is considered that the operator already exists in the knowledge base, so there is no need to supplement the knowledge base with the redundant operator.

[0050] The present invention obtains a data table to be processed and a user query requirement, and obtains form information according to the data table to be processed; inputs the user query requirement into a semantic extraction model to generate a semantic vector, inputs the semantic vector into an operator vector database to generate a tuple and a candidate operator, and generates a key form of the data table to be processed according to the semantic vector and the form information; generates a prompt word according to the tuple, the candidate operator and the key form, and inputs the prompt word into a large language model to generate an operator sequence; based on an operator sequence parser, the operator sequence is parsed to obtain an execution code, the data table to be processed is processed according to the execution code, the processed data table and data operation flow are obtained, and sent to a user. In the present invention, when data governance begins, data flow generation is performed based on the operator library, and the operator vector database is used to obtain corresponding operators during continuous operation to process the data table, and an automated data operation flow is generated accordingly, so that users can understand the entire processing process; in addition, the operator database in the present invention is self-enriched to form an operator library with richer functions, which is used for more efficient reasoning in the subsequent operator-based data operation flow generation process.

[0051] In the present invention, the user needs to provide a data table and a requirement for processing the current data table, and submit these contents to the corresponding system of the present invention, and process the data table and the requirement provided by the user into a visual operation flow pipeline, and output the processed data as the result of the user's requirement. The data processing process of the system is transparent to the user. The user only needs to provide the requirement for data processing, and does not need to care about the process of data being processed in the system. Finally, the flow direction of the data in the operation flow can be previewed, and the processed data can be downloaded.

[0052] At the same time, this application uses the data operation flow composed of runtime user requests to construct new data processing operators, and selectively adds them to the existing vector knowledge base according to semantic similarity as a supplement to the original static knowledge base, thereby continuously enriching the content of the operator vector database and ensuring efficient processing.

[0053] Furthermore, if Figure 4 As shown, based on the above-mentioned method for generating an automatic data operation flow based on a predefined operator, the present invention also provides a system for generating an automatic data operation flow based on a predefined operator, wherein the system for generating an automatic data operation flow based on a predefined operator comprises: The data acquisition module 41 is used to acquire the data table to be processed and the user's query requirements, and acquire the form information according to the data table to be processed; A data generation module 42 is used to input the user query requirements into a semantic extraction model, generate a semantic vector, input the semantic vector into an operator vector database, generate tuples and candidate operators, and generate a key form of the data table to be processed according to the semantic vector and the form information; An operator sequence generation module 43, used to generate a prompt word according to the tuple, the candidate operator and the key form, and input the prompt word into a large language model to generate an operator sequence; The result generation module 44 is used to parse the operator sequence based on the operator sequence parser to obtain the execution code, process the data table to be processed according to the execution code, obtain the processed data table and data operation flow, and send them to the user.

[0054] Furthermore, if Figure 5 As shown, based on the above-mentioned method and system for generating an automatic data operation flow based on predefined operators, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 5 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0055] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a program 40 for generating an automated data operation flow based on a predefined operator is stored on the memory 20, and the program 40 for generating an automated data operation flow based on a predefined operator can be executed by the processor 10, thereby realizing the method for generating an automated data operation flow based on a predefined operator in the present application.

[0056] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code stored in the memory 20 or process data, such as executing the method for generating the automated data operation flow based on the predefined operator.

[0057] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.

[0058] In one embodiment, when the processor 10 executes the program 40 for generating an automatic data operation flow based on a predefined operator in the memory 20 , the steps in the method for generating an automatic data operation flow based on a predefined operator are implemented.

[0059] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program for generating an automated data operation flow based on a predefined operator, and when the program for generating an automated data operation flow based on a predefined operator is executed by a processor, the following steps of a method for generating an automated data operation flow based on a predefined operator are implemented: Obtaining a data table to be processed and a user query requirement, and obtaining form information according to the data table to be processed; Inputting the user query requirement into a semantic extraction model to generate a semantic vector, inputting the semantic vector into an operator vector database to generate a tuple and a candidate operator, and generating a key form of the data table to be processed according to the semantic vector and the form information; Generate a prompt word according to the tuple, the candidate operator and the key form, and input the prompt word into a large language model to generate an operator sequence; Based on the operator sequence parser, the operator sequence is parsed to obtain the execution code, the data table to be processed is processed according to the execution code, the processed data table and data operation flow are obtained, and sent to the user.

[0060] The step of inputting the semantic vector into an operator vector database to generate a tuple and a candidate operator also includes: Storing the pre-acquired data processing algorithm in the operator knowledge base; Each data processing algorithm in the operator knowledge base is converted into a corresponding feature vector according to the text blocks, and all the feature vectors are stored in the operator vector database.

[0061] The step of inputting the semantic vector into an operator vector database, generating tuples and candidate operators, and generating a key form of the data table to be processed according to the semantic vector and the form information specifically includes: Inputting the semantic vector into the operator vector database, querying the vector database, and generating a vector feature whose similarity with the semantic vector meets a first preset requirement and a second preset requirement; and forming a tuple according to the vector features whose similarity with the semantic vector meets the first preset requirement, and forming a candidate operator according to the vector features whose similarity with the semantic vector meets the second preset requirement; Based on a table structure vector database, the semantic vector is matched with the form information to generate a key form of the data table to be processed.

[0062] The step of generating a prompt word according to the tuple, the candidate operator and the key form, and inputting the prompt word into a large language model to generate an operator sequence specifically includes: According to a predefined prompt word template, the tuple, the candidate operator and the key form are added to the prompt word template to generate the prompt word; The prompt word is input into the large language model, and the large language model generates a corresponding operator sequence for the requirements in the prompt word, wherein the operator sequence is a directed acyclic graph structure.

[0063] The operator sequence parser is based on the operator sequence, the operator sequence is parsed to obtain the execution code, the data table to be processed is processed according to the execution code, the processed data table and data operation flow are obtained, and sent to the user, specifically including: The operator sequence parser parses the operator sequence, represents the operator sequence as a graph data structure, and generates execution code according to the corresponding graph data structure, wherein the nodes in the graph data structure are replaced with nodes of a directed acyclic graph, and the nodes in the graph data structure after replacement include a processing flow of the data table to be processed; According to the execution code, the corresponding data processing algorithm is called to process the data table to be processed, and the processed data table and data operation flow are obtained and sent to the user.

[0064] The nodes in the graph data structure include data import nodes, data conversion nodes, data table connection nodes and data export nodes; Wherein, the data import node is used to load the to-be-processed data table into the operation flow; The data conversion node is used to fill each parameter of the operator in the operator sequence with the variable required by the user query, so as to form a series of executable operator chains; The data table connection node predefines a multi-table connection query solution, which is used to connect multiple tables in the user's query requirements to obtain a set; The data export node is used to export the processed data to a temporary table of the data lake.

[0065] The method further comprises generating a prompt word according to the tuple, the candidate operator and the key form, and inputting the prompt word into a large language model to generate an operator sequence, and then: Inputting the execution code into an operator knowledge base, parsing the execution code, and obtaining an operator document, wherein the operator document includes a user query requirement and a corresponding data processing algorithm; Determining in the operator knowledge base whether a similarity threshold of the operator document exceeds a preset threshold, and if not, saving the operator document in the operator knowledge base; The operator documents in the operator knowledge base are converted into corresponding feature vectors by using text segmentation, and stored in the operator vector database.

[0066] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal 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 terminal. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or terminal including the element.

[0067] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.

[0068] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for generating an automated data operation flow based on a predefined operator, characterized in that: The method for generating an automated data operation flow based on a predefined operator includes: Obtaining a data table to be processed and a user query requirement, and obtaining form information according to the data table to be processed; Inputting the user query requirement into a semantic extraction model to generate a semantic vector, inputting the semantic vector into an operator vector database to generate a tuple and a candidate operator, and generating a key form of the data table to be processed according to the semantic vector and the form information; Generate a prompt word according to the tuple, the candidate operator and the key form, and input the prompt word into a large language model to generate an operator sequence; Based on the operator sequence parser, the operator sequence is parsed to obtain the execution code, the data table to be processed is processed according to the execution code, the processed data table and data operation flow are obtained, and sent to the user.

2. The method for generating an automated data operation flow based on a predefined operator according to claim 1, characterized in that: The step of inputting the semantic vector into an operator vector database to generate a tuple and a candidate operator also includes: Storing the pre-acquired data processing algorithm in the operator knowledge base; Each data processing algorithm in the operator knowledge base is converted into a corresponding feature vector according to the text blocks, and all the feature vectors are stored in the operator vector database.

3. The method for generating an automated data operation flow based on a predefined operator according to claim 1, characterized in that: The step of inputting the semantic vector into an operator vector database, generating tuples and candidate operators, and generating a key form of the data table to be processed according to the semantic vector and the form information specifically includes: Inputting the semantic vector into the operator vector database, querying the vector database, and generating a vector feature whose similarity with the semantic vector meets a first preset requirement and a second preset requirement; and forming a tuple according to the vector features whose similarity with the semantic vector meets the first preset requirement, and forming a candidate operator according to the vector features whose similarity with the semantic vector meets the second preset requirement; Based on a table structure vector database, the semantic vector is matched with the form information to generate a key form of the data table to be processed.

4. The method for generating an automated data operation flow based on a predefined operator according to claim 2, characterized in that: The step of generating a prompt word according to the tuple, the candidate operator and the key form, and inputting the prompt word into a large language model to generate an operator sequence specifically includes: According to a predefined prompt word template, the tuple, the candidate operator and the key form are added to the prompt word template to generate the prompt word; The prompt word is input into the large language model, and the large language model generates a corresponding operator sequence for the requirements in the prompt word, wherein the operator sequence is a directed acyclic graph structure.

5. The method for generating an automated data operation flow based on a predefined operator according to claim 4, characterized in that: The operator sequence parser is based on the operator sequence, the operator sequence is parsed to obtain the execution code, the to-be-processed data table is processed according to the execution code, the processed data table and data operation flow are obtained, and sent to the user, specifically including: The operator sequence parser parses the operator sequence, represents the operator sequence as a graph data structure, and generates execution code according to the corresponding graph data structure, wherein the nodes in the graph data structure are replaced with nodes of a directed acyclic graph, and the nodes in the graph data structure after replacement include a processing flow of the data table to be processed; According to the execution code, the corresponding data processing algorithm is called to process the data table to be processed, and the processed data table and data operation flow are obtained and sent to the user.

6. The method for generating an automated data operation flow based on a predefined operator according to claim 5, characterized in that: The nodes in the graph data structure include data import nodes, data conversion nodes, data table connection nodes and data export nodes; Wherein, the data import node is used to load the to-be-processed data table into the operation flow; The data conversion node is used to fill each parameter of the operator in the operator sequence with the variable required by the user query, so as to form a series of executable operator chains; The data table connection node predefines a multi-table connection query solution, which is used to connect multiple tables in the user's query requirements to obtain a set; The data export node is used to export the processed data to a temporary table of the data lake.

7. The method for generating an automated data operation flow based on a predefined operator according to claim 1, characterized in that: The method further comprises: generating a prompt word according to the tuple, the candidate operator and the key form, and inputting the prompt word into a large language model to generate an operator sequence, and then further comprising: Inputting the execution code into an operator knowledge base, parsing the execution code, and obtaining an operator document, wherein the operator document includes a user query requirement and a corresponding data processing algorithm; Determining in the operator knowledge base whether a similarity threshold of the operator document exceeds a preset threshold, and if not, saving the operator document in the operator knowledge base; The operator documents in the operator knowledge base are converted into corresponding feature vectors by using text segmentation, and stored in the operator vector database.

8. A system for generating automatic data operation flows based on predefined operators, characterized in that: The system for generating an automated data operation flow based on predefined operators includes: A data acquisition module is used to acquire a data table to be processed and user query requirements, and to acquire form information according to the data table to be processed; A data generation module, used to input the user query requirements into a semantic extraction model, generate a semantic vector, input the semantic vector into an operator vector database, generate tuples and candidate operators, and generate a key form of the data table to be processed according to the semantic vector and the form information; An operator sequence generation module, used to generate a prompt word according to the tuple, the candidate operator and the key form, and input the prompt word into a large language model to generate an operator sequence; The result generation module is used to parse the operator sequence based on the operator sequence parser to obtain the execution code, process the data table to be processed according to the execution code, obtain the processed data table and data operation flow, and send them to the user.

9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a program for generating an automated data operation flow based on a predefined operator, which is stored in the memory and can be run on the processor. When the program for generating an automated data operation flow based on a predefined operator is executed by the processor, the steps of the method for generating an automated data operation flow based on a predefined operator as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for generating an automated data operation flow based on a predefined operator. When the program for generating an automated data operation flow based on a predefined operator is executed by a processor, the steps of the method for generating an automated data operation flow based on a predefined operator as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Large language model task processing method and device, equipment and medium

    CN117744754A

  • Streamlining tuple processing by delivering tuple attributes to associated operators

    US20170351736A1

Cited By

  • Abnormal transaction detection method based on continuous learning and knowledge base playback strategy

    CN118940200A

  • End-side large model intelligent task optimization method and device based on graph attention network

    CN119250113A

  • Machine vision solution automatic generation method based on large language model

    CN119690504A

  • Database query optimization method and system based on cue word guidance and application

    CN119782351A

  • Method and system for checking and evaluating total production value of ecological system based on large model

    CN121457896A