Agent construction method and system for data mining and data analysis method
By constructing an intelligent data source and generating an adapted dialogue stream, combined with a large language model, the problem of lack of specificity in data analysis is solved. This enables flexible adjustment of the data analysis model and efficient conversion from natural language to SQL, thereby improving the efficiency and accuracy of data analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ULTRAPOWER SOFTWARE
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-16
Smart Images

Figure CN122220394A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, system, and data analysis method for constructing intelligent agents for data mining. Background Technology
[0002] In the digital age, the amount of data across industries is exploding. Effective analysis and mining of this data to extract valuable information is crucial for corporate decision-making, business optimization, and the advancement of scientific research.
[0003] Current data analysis typically relies on analytical models with fixed analytical processes. That is, different data are analyzed using the same and fixed processing steps. This data analysis process lacks specificity, and the analysis results cannot meet user needs. Summary of the Invention
[0004] This application provides a method, system, and data analysis method for constructing intelligent agents for data mining, in order to solve the problems that traditional data analysis processes lack specificity and the analysis results cannot meet user needs.
[0005] In a first aspect, embodiments of this application provide a method for constructing an intelligent agent for data mining. The method includes: constructing an intelligent query data source; wherein the intelligent query data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least field information associated with the database files, and the SQL templates include preset SQL statements corresponding to different user queries; in response to the user's agent orchestration operation, generating a dialogue stream corresponding to the intelligent query data source, so that the intelligent query agent can call the intelligent query data source to converse with the user based on the dialogue stream; wherein the dialogue stream includes at least intelligent query nodes and plugin nodes; the intelligent query nodes are used to generate SQL statements based on the user's query statements, and the plugin nodes are used to execute the SQL statements.
[0006] In one possible implementation, constructing the intelligent data source includes: displaying a card configuration interface in response to user interaction with a first control; wherein the first control is used to add intelligent data cards, and one intelligent data card corresponds to one intelligent data task; forming an intelligent data source in response to user configuration operations on the card configuration interface; wherein the card configuration interface includes information configuration items, which are used to configure name and description information; the card configuration interface also includes data table configuration items and SQL template configuration items, the data table configuration items include a "Add Data Table" button, an "Import Data Table" button, a "Download Import Template" button, and a field configuration button, the "Add Data Table" button is used to generate a data table item by item, the "Import Data Table" button is used to import a data table, the "Download Import Template" button is used to download a data table template file, and the field configuration button is used to configure the field information corresponding to the data table, the field information including field name and associated entity; the SQL template configuration item is used to define the preset SQL statement corresponding to the data table; generating intelligent data cards corresponding to the intelligent data source, and visually displaying the intelligent data cards.
[0007] In one possible implementation, the method further includes: in response to a user's selection of a target smart question card, verifying the user's permissions; if the user has permission to access the target smart question card, loading and displaying the data analysis interface corresponding to the target smart question card; the data analysis interface includes at least historical query records and data table information related to the smart question node; if the user does not have permission to access the target smart question card, a first prompt box is displayed; the first prompt box is used to prompt the user to contact the administrator to obtain permissions; Furthermore, the method also includes: in response to the user's operation of the "Import Data Table" button, performing real-time format validation on the input data; if it is detected that the user's input data does not match the format requirements of the corresponding field in the preset template, a second prompt box pops up; the second prompt box is used to inform the user of the data format error and provide the user with a correct format example for the corresponding field; if it is detected that the user's input data matches the format requirements of the corresponding field in the preset template, the user's input data is mapped to the corresponding field in the preset template to form a data table; and the method also includes: determining the smart question data source corresponding to the smart question data card after importing the data as the smart question data source corresponding to the dialogue flow.
[0008] In one possible implementation, in response to the user's agent orchestration operation, generating a dialogue flow corresponding to the intelligent question data source includes: in response to the user's agent orchestration operation, adding intelligent question nodes and plugin nodes to the canvas; wherein, the intelligent question nodes are configured with a large model, and the plugin nodes are composed of preset plugins; and / or, in response to the user's agent orchestration operation, displaying an entity configuration interface, and configuring the entity type, entity name, and entity members of the entities associated with the dialogue flow through the entity configuration interface.
[0009] In one possible implementation, the dialogue flow further includes one or more of the following: response nodes, start nodes, knowledge retrieval nodes, condition judgment nodes, large language model processing nodes, script execution nodes, parameter extraction nodes, iterative processing nodes, and variable management nodes. In response to the user's agent orchestration operation, the dialogue flow corresponding to the intelligent question data source also includes: adding a response node to the canvas and displaying the response node configuration interface in response to the user's agent orchestration operation; generating response rules for the response node in response to the user's configuration operation on the response node configuration interface, including plain text responses based on the output variables of the preceding nodes, and responses using visual charts based on the execution results of the plugin nodes; the preceding nodes include intelligent question nodes and plugin nodes.
[0010] In one possible implementation, before generating the dialogue flow corresponding to the intelligent query data source in response to the user's intelligent agent orchestration operation, the method further includes: displaying a plugin configuration interface in response to the user's operation on a second control; wherein the second control is used to add a plugin; generating a preset plugin for executing SQL statements in response to the user's configuration operation on the plugin configuration interface; wherein the plugin configuration interface includes interface configuration items, the interface configuration items at least include an API path input box, the API path input box is used to configure the interface address for the preset plugin to access the target database to execute SQL statements.
[0011] Secondly, embodiments of this application provide a data analysis method based on an intelligent agent. The method is applied to the intelligent query agent in the aforementioned first aspect and its various implementations. The method includes: receiving a user's query statement dialogue for a database, and performing semantic retrieval, keyword retrieval, and entity recognition on the query statement dialogue to obtain an intent recognition result; inputting the intent recognition result and a first prompt word into a large model, so that the large model generates an SQL statement corresponding to the query statement dialogue based on the intent recognition result, the first prompt word, and the intelligent query data source; wherein, the intelligent query data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least field information associated with the database files, and the SQL templates include preset SQL statements corresponding to different user queries; executing the SQL statement in the target database to obtain structured business data matching the query statement dialogue, and returning the structured business data to the user.
[0012] In one possible implementation, semantic retrieval, keyword retrieval, and entity recognition are performed on the query statement dialogue to obtain the intent recognition result. This includes: vectorizing the query statement dialogue to obtain a query vector; inputting the query vector into the Milvus vector database for similarity retrieval to recall database table structure information semantically related to the query statement dialogue; wherein the Milvus vector database is generated after vectorizing the database's DDL statements; and further includes: performing word segmentation on the query statement dialogue, retrieving matching keywords in the Elasticsearch search engine based on the word segmentation results, and recalling target data tables and target field information related to the keywords; and further includes: extracting business entities from the query statement dialogue, matching the business entities with the associated entities of the intelligent query agent to obtain entity recognition results; and further includes: summarizing the database table structure information, target data tables, target field information, and entity recognition results to obtain the intent recognition result.
[0013] In one possible implementation, the steps of returning structured business data to the user include: returning SQL statements and / or structured business data to the user as plain text; and / or, inputting structured business data and a second prompt word into a large model, so that the large model determines the visualization type corresponding to the structured business data based on the second prompt word; inputting structured business data, visualization type, and a third prompt word into the large model, so that the large model generates target code based on the third prompt word, the target code being used to generate a visualization chart corresponding to the structured business data, the visualization chart conforming to the visualization type; rendering based on the target code to obtain the visualization chart, and returning the visualization chart to the user.
[0014] Thirdly, embodiments of this application also provide an intelligent agent construction system for data mining. The system includes: a construction module configured to construct an intelligent query data source; wherein the intelligent query data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least field information associated with the database files, and the SQL templates include preset SQL statements corresponding to different user queries; and an orchestration module configured to generate a dialogue stream corresponding to the intelligent query data source in response to the user's intelligent agent orchestration operation, so that the intelligent query agent can call the intelligent query data source to communicate with the user based on the dialogue stream; wherein the dialogue stream includes at least intelligent query nodes and plug-in nodes; the intelligent query nodes are used to generate SQL statements based on the user's query statements, and the plug-in nodes are used to execute the SQL statements.
[0015] Fourthly, embodiments of this application also provide a data analysis system based on intelligent agents. The system includes: an intent recognition module configured to: receive a user's query statement dialogue for a database, and perform semantic retrieval, keyword retrieval, and entity recognition on the query statement dialogue to obtain intent recognition results; a statement generation module configured to: input the intent recognition results and a first prompt word into a large model, so that the large model generates an SQL statement corresponding to the query statement dialogue based on the intent recognition results, the first prompt word, and an intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least field information associated with the database files, and the SQL templates include preset SQL statements corresponding to different user queries; and a result generation module configured to: execute the SQL statement in the target database to obtain structured business data matching the query statement dialogue, and return the structured business data to the user.
[0016] As described above, this application provides a method, system, and data analysis method for constructing intelligent agents for data mining. The construction method includes: constructing an intelligent query data source; wherein the intelligent query data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least field information associated with the database files, and the SQL templates include preset SQL statements corresponding to different user queries; responding to the user's intelligent agent orchestration operation, generating a dialogue stream corresponding to the intelligent query data source, so that the intelligent query agent can call the intelligent query data source to converse with the user based on the dialogue stream; wherein the dialogue stream includes at least intelligent query nodes and plugin nodes; the intelligent query nodes are used to generate SQL statements based on the user's query statements, and the plugin nodes are used to execute the SQL statements. In this way, users can freely select and combine different large language models by dragging and dropping to form a model chain suitable for specific analysis tasks. This flexible orchestration method breaks the limitations of fixed model processes in traditional data analysis systems, and can quickly adjust the analysis model and process according to different business needs and data characteristics. It can achieve accurate conversion and automatic execution of natural language to SQL without writing complex code, thus improving the efficiency and accuracy of data analysis. Attached Figure Description
[0017] Figure 1 A flowchart illustrating the intelligent agent construction method for data mining provided in an embodiment of this application; Figure 2 A schematic diagram of a visual question editor provided in an embodiment of this application; Figure 3 A schematic diagram of a first type of card configuration interface provided in an embodiment of this application; Figure 4 A schematic diagram of a second card configuration interface provided in an embodiment of this application; Figure 5 This is a schematic diagram of a data table template file in an embodiment of this application; Figure 6 A schematic diagram of a third card configuration interface provided in an embodiment of this application; Figure 7 A schematic diagram of a fourth card configuration interface provided in an embodiment of this application; Figure 8 A schematic diagram of the fifth card configuration interface provided in the embodiments of this application; Figure 9 A schematic diagram of the sixth card configuration interface provided in the embodiments of this application; Figure 10 A schematic diagram of the seventh card configuration interface provided in the embodiments of this application; Figure 11 A schematic diagram of a first entity configuration interface provided in an embodiment of this application; Figure 12 A schematic diagram of a second entity configuration interface provided in an embodiment of this application; Figure 13 A schematic diagram of the response node configuration interface provided in an embodiment of this application; Figure 14 A schematic diagram of the plug-in configuration interface provided in an embodiment of this application; Figure 15 A schematic diagram of the plug-in display interface provided in an embodiment of this application; Figure 16 This is a schematic diagram of a first process for a data analysis method based on an intelligent agent provided in an embodiment of this application; Figure 17 This is a second flowchart illustrating the agent-based data analysis method provided in an embodiment of this application. Figure 18 This is an interactive schematic diagram provided for an embodiment of this application; Figure 19 This is a schematic diagram of the structure of an intelligent agent construction system for data mining provided in an embodiment of this application; Figure 20 This is a schematic diagram of the structure of an agent-based data analysis system provided in an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of this application.
[0019] To address the lack of specificity in existing data analysis processes and the inability of analysis results to meet user needs, this application provides a method, system, and data analysis method for constructing intelligent agents for data mining. This method can customize and construct intelligent query data sources, flexibly arrange and adapt dialogue flows, build intelligent query agents that fit different data analysis scenarios, integrate natural language processing and database query technologies, accurately identify the true intent of users' natural language queries and convert them into matching SQL statements, quickly retrieve corresponding structured business data from the target database, improve the specificity and accuracy of data analysis, and ensure that the analysis results efficiently match the actual usage needs of users.
[0020] It is worth noting that Intelligent DataQuery is a technological capability or product function based on artificial intelligence (especially Natural Language Processing (NLP) and Large Language Modeling (LLM)), enabling users to query and analyze data through natural language dialogue without writing SQL or relying on professional technical personnel. Furthermore, Intelligent DataQueryAgent is an independent AI application or digital assistant with intelligent data query capabilities, implemented based on an agent architecture. This application's embodiments, by constructing and applying an Intelligent DataQueryAgent, achieve a combination of model orchestration and data mining, improving the efficiency and accuracy of data analysis and meeting the data analysis needs of different users in different scenarios.
[0021] Figure 1 This is a flowchart illustrating the intelligent agent construction method for data mining provided in an embodiment of this application.
[0022] like Figure 1 As shown, the intelligent agent construction method for data mining provided in this application embodiment includes the following steps S100-S200.
[0023] S100: Construct an intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include the preset SQL statements corresponding to the data tables under different user question types.
[0024] It is understandable that the intelligent question-and-answer data source is the data foundation layer of the intelligent question-and-answer agent. It not only contains raw data but also encapsulates common query logic, providing a data foundation for subsequent intelligent question answering. In this embodiment, the intelligent question-and-answer data source supports access to various types of database files, such as relational databases (MySQL, PostgreSQL), embedded databases (SQLite), data warehouses, Excel files, and comma-separated values (CSV) files.
[0025] Furthermore, for each database file accessed, this embodiment of the application can automatically or with user assistance parse its internal data table structure, such as parsing table names and comments, parsing field information, and finally forming a data table corresponding to the database file.
[0026] Furthermore, the intelligent query data source also includes SQL templates. Specifically, the SQL templates can include executable SQL statements corresponding to different natural language queries and different query requirements, providing template references for subsequent intelligent query generation. For example, typical queries could be: "What was the product with the highest sales volume last month?" or "What was the total order volume for each quarter of 2023?".
[0027] In this embodiment, the preset SQL statement may include variable parts (such as time conditions and filter values), represented by placeholders (such as ${start_date}, ${product_category}). For example, for "querying the sales volume of a certain product over a certain period of time", the preset SQL statement may be: SELECT SUM(sales_quantity) FROM sales_table WHERE product_name = '${product_name}' AND sales_date BETWEEN '${start_date}' AND '${end_date}' The specific interactive process of building the SQL template will be described in detail below, and will not be repeated here.
[0028] As can be seen, the embodiments of this application can establish an index from question features to SQL templates. When a user asks a question, the most similar template can be matched first, and an executable SQL statement can be quickly generated by filling in placeholders, or the template can be fine-tuned using a large language model, thereby avoiding syntax errors or illusions that may result from generating SQL statements from scratch.
[0029] S200: In response to the user's intelligent agent orchestration operation, a dialogue stream corresponding to the intelligent query data source is generated, so that the intelligent query agent can call the intelligent query data source to communicate with the user based on the dialogue stream; wherein, the dialogue stream includes at least intelligent query nodes and plug-in nodes; the intelligent query nodes are used to generate SQL statements based on the user's query statements, and the plug-in nodes are used to execute the SQL statements.
[0030] This stage utilizes a visual agent orchestration interface, allowing developers or business personnel to connect the intelligent query data source built by S100 with AI capabilities, forming an intelligent agent capable of autonomously completing data query tasks (i.e., an intelligent query agent). Agent orchestration refers to users dragging and dropping different nodes from the component library through a low-code or no-code orchestration interface to connect them into a directed graph, defining the agent's workflow.
[0031] In this embodiment of the application, the dialogue flow includes at least the following two types of key nodes: intelligent questioning nodes and plug-in nodes.
[0032] Intelligent Question Number Node: Used for Natural Language Understanding (NLU) and Natural Language to SQL (NL2SQL) conversion. The Intelligent Question Number Node receives user queries as input, then performs intent recognition and template matching on the query, searching the SQL template library to determine if the current question matches a highly similar typical question. If it matches, the template is directly adopted, and placeholder information (such as specific time, product name) is added to the template.
[0033] If no perfectly matching template is available, the intelligent query node can leverage the capabilities of a Large Language Model (LLM), referencing field information from the data source, table relationships, and existing templates as examples (few-shots) to dynamically generate accurate SQL statements. In this embodiment, the large model associated with the intelligent query node can be adjusted based on actual needs.
[0034] Furthermore, the intelligent query node can output executable SQL statements.
[0035] Plugin nodes: These are used to perform specific actions, such as executing the SQL statement generated by the previous smart query node. Specifically, a plugin node can receive an SQL statement as input, run a query on the target database, and return the query results (dataset) to the dialogue stream.
[0036] In some implementations, other plugin nodes can be added to the dialogue flow, such as data visualization plugins (automatically generating charts from the results), report generation plugins (populating data into a fixed template), and alarm plugins (sending notifications when data exceeds a threshold).
[0037] In some implementations, the dialogue flow also includes one or more of the following: response nodes, start nodes, knowledge retrieval nodes, conditional judgment nodes, large language model processing nodes, script execution nodes, parameter extraction nodes, iterative processing nodes, and variable management nodes. Response nodes are responsible for providing feedback to the user in the form of text, charts, etc., summarizing and explaining the results, and providing interactive functions to support further operations. Knowledge retrieval nodes are used to associate knowledge card libraries and perform multi-dimensional searches. Conditional judgment nodes implement flow branch control based on Boolean logic. Large language model processing nodes call the large model API for complex reasoning through prompt word engineering. Script execution nodes provide a JavaScript sandbox environment to execute dynamic scripts. Parameter extraction nodes use NLP technology to extract structured parameters from natural language. Iterative processing nodes support batch processing of traversed collection data. Variable management nodes provide workflow-level variable declaration, assignment, and scope management.
[0038] In this way, when a user asks a question to a deployed agent, the agent engine (which is the runtime infrastructure and execution environment for agents) executes nodes according to the orchestrated dialogue flow. For example, if a user asks, "What was the best-selling product in East China in the fourth quarter of last year?", the dialogue flow first enters the intelligent question node. This node combines data source fields (including "sales volume", "region", "date", and "product name") and possible templates to generate an SQL statement, which can be understood as a SELECT statement. Afterward, the dialogue flow can flow to the plugin node to execute the SQL statement and obtain the result dataset.
[0039] Figure 2 This is a schematic diagram of a visual question editor provided in an embodiment of this application.
[0040] like Figure 2 As shown, embodiments of this application can provide a visual question editor. This visual question editor can be used to arrange dialogue flows. Through a drag-and-drop interactive interface, functional components such as intelligent question nodes, plugin nodes, response nodes, knowledge retrieval nodes, and condition judgment nodes can be visually connected and combined. It supports users to quickly build multi-turn dialogue processes of intelligent question agents in a low-code manner and preview and debug dialogue effects in real time.
[0041] As described above, this application provides a method for constructing an intelligent agent for data mining. The method includes: constructing an intelligent query data source; wherein the intelligent query data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least field information associated with the database files, and the SQL templates include preset SQL statements corresponding to different user queries; responding to the user's agent orchestration operation, generating a dialogue stream corresponding to the intelligent query data source, so that the intelligent query agent can call the intelligent query data source to converse with the user based on the dialogue stream; wherein the dialogue stream includes at least intelligent query nodes and plugin nodes; the intelligent query nodes are used to generate SQL statements based on the user's query statements, and the plugin nodes are used to execute the SQL statements. In this way, users can freely select and combine different large language models by dragging and dropping to form a model chain suitable for specific analysis tasks. This flexible orchestration method breaks the limitations of fixed model processes in traditional data analysis systems, allowing for rapid adjustment of analysis models and processes according to different business needs and data characteristics. It achieves accurate conversion and automatic execution from natural language to SQL without writing complex code, improving the efficiency and accuracy of data analysis.
[0042] Furthermore, step S100 may include the following steps S101-S102.
[0043] S101: In response to the user's operation on the first control, the card configuration interface is displayed; wherein, the first control is used to add smart question cards, and one smart question card corresponds to one smart question task.
[0044] The first control can be called the "Add Scene" control, and it can be located in the data source configuration interface. In response to the user's click on the first control, the first type of card configuration interface is displayed.
[0045] Figure 3 This is a schematic diagram of a first card configuration interface provided in an embodiment of this application.
[0046] like Figure 3 As shown, the first type of card configuration interface can include information configuration items, which are used to configure the name (i.e., the card name, which can also be called the "scene name" in actual applications) and description information (used to briefly introduce the data table, which can be called the "scene description" in actual applications).
[0047] S102: Responds to the user's configuration operation on the card configuration interface to form an intelligent data source.
[0048] See also Figure 3The first type of card configuration interface may also include a third control, which is an "OK" control, used to confirm the configuration of information configuration items. In response to the user's click on the third control, this embodiment of the application can display a second type of card configuration interface.
[0049] Figure 4 This is a schematic diagram of a second card configuration interface provided in an embodiment of this application.
[0050] like Figure 4 As shown, the second type of card configuration interface may include data table configuration items and SQL template configuration items. The data table configuration items include a "Add Data Table" button, an "Import Data Table" button, a "Download Import Template" button, and a "Field Configuration" button. The "Add Data Table" button is used to generate a data table item by item. The "Import Data Table" button is used to import a data table filled in according to the data table template file format requirements. The "Download Import Template" button is used to download the data table template file. The "Field Configuration" button (also known as the "Edit Field" button) is used to configure the field information corresponding to the data table. The field information includes the field name and the associated entity (specifically, it can be "Entity Name" or "Entity Identifier"). The SQL template configuration items are used to define the preset SQL statements corresponding to the data table.
[0051] Figure 5 This is a schematic diagram of a data table template file in an embodiment of this application.
[0052] In this embodiment of the application, in response to the user's click on the "Download and Import Template" button, the user can be redirected to the template download and import interface. For example... Figure 5 As shown in (a) and (b), the import template (i.e., the data table template file) can be a table. This table is used to define the basic attributes and field details of the database file corresponding to the data table, such as the English name of the database table, the Chinese name of the database table, the Chinese description of the database table, the field name, the Chinese name of the field, the field type, the output format, the field description, the field unit, the field synonyms, whether to enable approximate queries, and the error range. In this way, batch data table information can be quickly entered and imported in a structured manner through standardized templates.
[0053] See also Figure 4 In response to a user's click on the "Add Data Table" or "Import Data Table" button, this embodiment of the application can import a data table and display a third type of card configuration interface. The third type of card configuration interface includes a data table display area (or data table configuration area), which can display relevant information of all imported data tables associated with the smart question card.
[0054] It is worth noting that the "Import Data Table" button can be used not only to import data table files generated based on the import template, but also to import user-defined Excel and CSV files. During the data table import process, this embodiment may further include the following steps S1021-S1023.
[0055] S1021: In response to the user's operation of the import data table button, the format of the input data is validated in real time.
[0056] "Input data" can refer to various files imported by the user. Format validation can refer to determining whether the table header is complete, field data types, and required fields meet the preset template requirements.
[0057] S1022: If the data entered by the user does not match the format requirements of the corresponding field in the preset template, a second prompt box will pop up.
[0058] The second prompt box is used to inform the user of data format errors and provide the user with a correct format example for the corresponding field to guide the user in field mapping and adjustment. For example, if the preset template requires a field to be in date format, and the user enters data in a non-date format, this embodiment of the application can pop up a second prompt box to inform the user of the data format error and provide a correct format example.
[0059] S1023: If it is detected that the data input by the user matches the format requirements of the corresponding field in the preset template, the data input by the user is mapped to the corresponding field in the preset template to form a data table.
[0060] See also Figure 4 The data table display area also includes at least a fourth control (edit table control) and a fifth control (edit field control). In response to the user's click operation on the fourth control, this embodiment of the application can display a third type of card configuration interface.
[0061] Figure 6 This is a schematic diagram of a third card configuration interface provided in an embodiment of this application.
[0062] like Figure 6 As shown, the third type of card configuration interface is used to edit the data table information, such as editing the "English name of the database table", "Chinese name of the database table", and "description of the database table".
[0063] In response to a user's click on the fifth control, this embodiment of the application can display a fourth type of card configuration interface.
[0064] Figure 7 This is a schematic diagram of the fourth card configuration interface provided in the embodiments of this application.
[0065] like Figure 7 As shown, the fourth type of card configuration interface is used to edit the field information of the data table, such as editing "Field Name", "Field Chinese Name", "Field Type", "Associated Entity", "Field Description", "Field Unit", and "Field Synonyms". It can be understood that the "Associated Entity" can be associated with the dialog flow; that is, the "entity" configured in the dialog flow can be the "Associated Entity" set when configuring the data table field. There is an association mapping relationship between the two, realizing the association mapping between data table fields and dialog flow entities.
[0066] See also Figure 4 In response to the user's click on the "SQL template configuration item", this embodiment of the application can display a fifth type of card configuration interface.
[0067] Figure 8 This is a schematic diagram of the fifth card configuration interface provided in the embodiments of this application.
[0068] like Figure 8 As shown, the fifth type of card configuration interface includes at least a sixth control (a newly added SQL template control). In response to a user's click on the sixth control, this embodiment of the application can display the sixth type of card configuration interface.
[0069] Figure 9 This is a schematic diagram of the sixth card configuration interface provided in the embodiments of this application.
[0070] like Figure 9 As shown, the sixth card configuration interface can be used to configure the data table associated with the SQL template, the user questions and similar questions corresponding to the SQL template, and also to configure condition fields and preset SQL statements.
[0071] In some implementations, a "condition field" refers to a database field used as a query condition in an SQL template. When configuring a reusable SQL template, the variable part of a user query (such as "query the sales amount of a certain product last month") (e.g., "a certain product") needs to be mapped to a specific database field. Therefore, a "condition field" can be defined and dynamically populated when the user asks a question, generating the final executable SQL statement.
[0072] Furthermore, step S102 may be followed by step S103.
[0073] S103: Generate smart question cards corresponding to the smart question data source and visualize the smart question cards.
[0074] In this embodiment of the application, the aforementioned data source configuration interface is also used to display each smart question card configured in history, and users can access each smart question card through interactive operations in the data source configuration interface.
[0075] Furthermore, embodiments of this application may also include the following steps S104-S106.
[0076] S104: In response to the user's selection of the target smart question card, verify the user's permissions.
[0077] Specifically, users can access a smart question card by clicking the "Edit" or "View Details" control in the historically generated smart question card in the data source configuration interface.
[0078] S105: If the user has permission to access the target smart question card, load and display the data analysis interface corresponding to the target smart question card; the data analysis interface shall include at least the historical query records and data table information related to the smart question node.
[0079] Figure 10 This is a schematic diagram of the seventh card configuration interface provided in the embodiments of this application.
[0080] like Figure 10 As shown, this data analysis interface can also be called the seventh type of card configuration interface. Historical query records, also known as question-and-answer records, can include the user's interaction trajectory with the intelligent question-and-answer card through the intelligent question-and-answer agent, generated based on log files. This includes natural language questions, generated SQL statements, execution results, and feedback evaluations.
[0081] S106: If the user does not have permission to access the target smart question card, a first prompt box will pop up; the first prompt box is used to prompt the user to contact the administrator to obtain permission.
[0082] It should also be noted that step S100 in this application embodiment may include the following step S107: determining the smart question data source corresponding to the smart question card after importing data as the smart question data source corresponding to the dialogue flow.
[0083] In this way, the intelligent question data source can be bound to the dialogue stream, enabling the dialogue stream to perform intelligent questioning on the intelligent question data source.
[0084] Furthermore, in this embodiment of the application, step S200 may include the following step S201.
[0085] S201: In response to the user's intelligent agent orchestration operation, add intelligent question nodes and plug-in nodes to the canvas; among them, intelligent question nodes are configured with large models, and plug-in nodes are composed of preset plug-ins.
[0086] And / or, in the embodiments of this application, step S200 may include the following step S202.
[0087] S202: In response to the user's intelligent agent orchestration operation, display the entity configuration interface, and configure the entity type, entity name and entity members of the entities associated with the dialogue flow through the entity configuration interface.
[0088] Specifically, the "canvas" may include buttons for configuring entities. In response to a user's click on the entity configuration button, the entity configuration interface can be displayed in this embodiment.
[0089] Figure 11 This is a schematic diagram of the first entity configuration interface provided in the embodiments of this application.
[0090] like Figure 11 As shown, the entity configuration interface may include controls such as "Add", "Batch Delete", "Import", and "Export", as well as controls such as "View", "Edit", and "Delete". In response to a user's click on the "Edit" control in the entity configuration interface, this embodiment of the application can display a second entity configuration interface.
[0091] Figure 12 This is a schematic diagram of a second entity configuration interface provided in an embodiment of this application.
[0092] like Figure 12 As shown, the second entity configuration interface can be used to configure information such as "entity type", "entity name", "entity description" and "entity members".
[0093] Entities are used to map business concepts in natural language to structured data. Entity types define the category of an entity, such as "standard entity." Entity members configure the entity's synonym set (e.g., synonyms for "sales amount" include "revenue," "GMV," and "transaction amount"). The value range of entity members corresponds to the enumerated / valid values of the target field in the intelligent question-and-answer data source table (e.g., "sales amount" corresponds to the field "sales_amount," whose values can be "1 million yuan," "2 million yuan," etc.). It is evident that there is a bidirectional mapping relationship between entities and the intelligent question-and-answer data source: entities configured in the dialogue flow (including type, name, and members) are used to parse user queries (e.g., identifying the entity "sales amount" from "check this year's revenue"), and the "associated entities" (i.e., the entity name / code bound to the field) set when configuring the data table fields are used to match the parsed entities to the corresponding database fields. The two can establish a unique association through the entity name. Furthermore, in this embodiment, the target field can be determined based on the parsed entity and the thesaurus, and then SQL query conditions (i.e. SQL statements) can be generated based on the legal values of the target field, ultimately achieving a seamless conversion from natural language to database query.
[0094] Furthermore, in the embodiments of this application, step S200 may include the following steps S203-S204.
[0095] S203: In response to the user's intelligent agent orchestration operation, add a reply node to the canvas and display the reply node configuration interface.
[0096] Figure 13 This is a schematic diagram of the response node configuration interface provided in an embodiment of this application.
[0097] like Figure 13 As shown, the reply node configuration interface can be used to configure items such as "node name", "reply content", "icon visualization", and "conditional reply".
[0098] S204: In response to the user's configuration operation on the reply node configuration interface, generate reply rules for the reply node. The reply rules include plain text replies based on the output variables of the preceding nodes, and also include replies based on the execution results of the plugin nodes using visual charts. The preceding nodes include intelligent question nodes and plugin nodes.
[0099] Specifically, users can construct plain text response content by referencing output variables from preceding nodes (such as intelligent query nodes and plugin nodes), for example, "The sales amount you queried is {{ plugin.output.total_sales}} yuan," thus dynamically filling the query results. This embodiment can guide users to configure response content based on prompt word engineering. The specific prompt words can be adjusted according to actual needs, which will not be elaborated here.
[0100] Furthermore, embodiments of this application also support automatically rendering data into visual charts (such as line charts, bar charts, and pie charts) and embedding them in the response in chart form, thereby enabling users to more intuitively understand data trends and patterns. Through this mechanism, the dialogue flow can not only answer user questions but also present data analysis results in rich formats, significantly improving the efficiency and experience of human-computer interaction.
[0101] In practical applications, the response node has an entry point to receive input parameters and can directly output the processing results to the front-end interface. Its core workflow is as follows: it receives the output variables of the intelligent question node or plugin node (the data source is not limited to the question results, but can also be other business data read from Excel), and performs intent recognition on the input parameter content through built-in closed-source prompt words. At this time, this embodiment can call the large model to determine the visualization type (such as pie chart, bar chart, etc.) corresponding to the output variable. Then, based on the determined type, it calls the large model (the prompt word is, for example: help me generate a graph, my knowledge is: {plugin(x)-data}) to generate code. Finally, the front-end rendering engine executes the code to generate the chart. If visualization is not required, this embodiment supports dynamically presenting the variable content in plain text form, realizing flexible conversion and intuitive display of multi-source data to the user interface.
[0102] Furthermore, in this embodiment of the application, the following steps S301-S302 may be included before step S100.
[0103] S301: In response to the user's operation on the second control, the plugin configuration interface is displayed; wherein, the second control is used to add plugins and can be called the "Add Plugin" control, which can be located in the plugin display interface (or plugin management interface).
[0104] Figure 14 This is a schematic diagram of the plugin configuration interface provided in an embodiment of this application.
[0105] like Figure 14 As shown, the plugin configuration interface is used to configure information such as "interface name", "interface description", and "tool path".
[0106] S302: In response to the user's configuration operation on the plugin configuration interface, a preset plugin for executing SQL statements is generated; wherein, the plugin configuration interface includes interface configuration items, and the interface configuration items include at least an API path input box, which is used to configure the interface address of the preset plugin to access the target database to execute SQL statements.
[0107] Subsequently, the preset plugin can be bound to a plugin node and introduced into the dialogue flow. Furthermore, embodiments of this application can also display the generated preset plugin in the plugin display interface as a card.
[0108] Figure 15 This is a schematic diagram of the plug-in display interface provided in an embodiment of this application.
[0109] like Figure 15 As shown, in response to a user's click on a plugin card, this embodiment of the application can display a plugin display interface, which is used to view information such as "plugin name," "plugin description," "authentication type," and "plugin URL." Furthermore, by operating the plugin display interface, one can navigate to the plugin configuration interface to modify preset plugins.
[0110] As described above, this application provides a method for constructing an intelligent agent for data mining. Based on this method, users can customize and build an intelligent query data source containing database files, data tables, and multi-question adaptable SQL templates. Combined with flexible intelligent agent orchestration operations, personalized dialogue flow construction is achieved, ultimately forming an intelligent query agent. Based on this method, the construction of intelligent query agents is more suited to different data analysis business scenarios, lowering the barrier to entry for agent construction. Its built-in natural language parsing, entity matching, and automatic SQL generation and execution capabilities can accurately identify the user's natural language query intent and quickly retrieve the target structured data, ensuring that the data analysis process closely aligns with the user's actual needs. This improves the efficiency and accuracy of data query and analysis, lowers the data analysis operation threshold for non-professionals, achieves efficient integration of natural language and database queries, and ensures that analysis results are fed back to the user in a more intuitive and adaptable form, enhancing the interactive experience of intelligent querying.
[0111] Figure 16 This is a schematic diagram of the first process of the data analysis method based on intelligent agents provided in the embodiments of this application.
[0112] Figure 17 This is a second flowchart illustrating the agent-based data analysis method provided in an embodiment of this application.
[0113] like Figure 16 and Figure 17As shown, this application provides a data analysis method based on an intelligent agent. This method can be applied to the intelligent data-generating agent in the aforementioned embodiments. The method includes the following steps S400-S600.
[0114] S400: Receives user query statements for the database and performs semantic retrieval, keyword retrieval, and entity recognition on the query statements to obtain intent recognition results.
[0115] Upon receiving a user's query, this embodiment does not directly feed it into a large model. Instead, it first performs multi-dimensional and in-depth intent parsing to build a rich foundation of contextual information. This process specifically includes semantic retrieval, keyword matching, and entity recognition.
[0116] Specifically, step S400 may include the following steps S401-S402 (semantic retrieval, vectorized recall).
[0117] S401: Vectorize the query statement dialogue to obtain the query vector.
[0118] First, in this embodiment of the application, the user's query statement is vectorized into a query vector that can represent its deep semantics.
[0119] S402: Input the query vector into the Milvus vector database for similarity retrieval, and retrieve the database table structure information related to the semantics of the query statement; wherein, the Milvus vector database is generated by vectorizing the DDL statement of the database.
[0120] This application embodiment allows query vectors to be input into a Milvus vector database for efficient similarity retrieval. This vector database is constructed by vectorizing the Data Definition Language (DDL) statements of all table structures within the database, thus enabling the retrieval of table structure information that is semantically most relevant to the current user's question, such as potentially relevant business tables and their core fields.
[0121] In addition, step S400 may also include the following step S403 (keyword retrieval, ES exact match).
[0122] S403: Perform word segmentation on the query statement, retrieve matching keywords in the Elasticsearch search engine based on the word segmentation results, and recall target data tables and target field information related to the keywords.
[0123] This application embodiment can perform word segmentation on the query statement and conduct keyword retrieval in the Elasticsearch search engine based on the word segmentation results. This retrieval process can accurately match the business terms explicitly mentioned in the user's query, thereby recalling target data tables and target field information directly related to the keywords, ensuring that no accurately matched data structures are missed.
[0124] In addition, step S400 may also include the following step S404 (entity recognition and matching).
[0125] S404: Extract the business entities from the query statement dialogue, match the business entities with the associated entities of the intelligent query agent, and obtain the entity recognition results.
[0126] This application embodiment can further extract business entities from the query statement, such as "product name," "region," and "time period." This application embodiment can match the extracted entities with pre-configured associated entities of the intelligent query agent to obtain entity recognition results. For example, the user's question "last month" can be matched with the "time period" entity, and "mobile phone" can be matched with the "product category" entity.
[0127] In addition, step S400 may also include the following step S405 (summarizing intent recognition results).
[0128] S405: Summarize the database structure information, target data table, target field information, and entity recognition results to obtain the intent recognition result.
[0129] As can be seen, the embodiments of this application, through the steps of hybrid retrieval (semantic retrieval, keyword retrieval) and entity extraction, can form a multi-level intent recognition process from surface keywords to deep semantics and business entities.
[0130] In some implementations, before performing intent recognition on the query statement, embodiments of this application may further refine the user question (i.e., the query statement) so that the query statement expressed by the user in natural language, which may have semantic ambiguity, disordered word order, incomplete expression, or colloquial redundancy, is standardized and normalized into structured text that conforms to the intent recognition logic. This eliminates ambiguity and highlights the core query requirements, improves the accuracy and efficiency of subsequent semantic retrieval, keyword retrieval, and entity recognition, and further ensures the accuracy of the intent recognition results.
[0131] S500: Input the intent recognition result and the first prompt word into the large model, so that the large model can generate the SQL statement corresponding to the query statement dialogue based on the intent recognition result, the first prompt word and the intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include the preset SQL statements corresponding to the data tables under different user questions.
[0132] After obtaining the intent recognition result, this embodiment of the application can perform steps such as SQL generation. Specifically, the intent recognition result and the first prompt word constructed based on the prompt word engineering can be input into a large model (e.g., a large language model). After receiving these inputs, the large model can combine its own knowledge with the detailed information in the intelligent question data source to generate accurate SQL statements.
[0133] In this process, the database table field information in the intent recognition results can provide the model with accurate database field names, data types, and business meanings, preventing the model from having "illusions" or using incorrect field names.
[0134] S600: Executes an SQL statement in the target database, obtains structured business data that matches the query statement, and returns the structured business data to the user.
[0135] The structured business data can be in JSON format and can include query result sets, field metadata, and information about the tables and fields that have been retrieved.
[0136] Furthermore, this application embodiment also includes the step of performing plain text reply and visualization display based on recall data (structured business data) on the front end. Specifically, step S600 may include the following step S601.
[0137] S601: Return SQL statements and / or structured business data to the user in plain text.
[0138] And / or, step S600 may also include the following steps S602-S604.
[0139] S602: Input the structured business data and the second prompt word into the large model so that the large model can determine the visualization type corresponding to the structured business data based on the second prompt word.
[0140] The second prompt word is built based on the prompt word engineering and can be a closed-source prompt word (configurable in the "Reply Node" configuration stage). The large model can be a large language model. Visualization types include pie charts, bar charts, line charts, scatter plots, radar charts, etc. The large model can analyze data features based on the second prompt word to determine the most suitable visualization type for displaying the current data.
[0141] S603: Input structured business data, visualization type, and third prompt word into the large model so that the large model can generate target code based on the third prompt word. The target code is used to generate visualization charts corresponding to the structured business data, and the visualization charts conform to the visualization type.
[0142] The third prompt word can be generated based on the prompt word project, and can specifically be a closed-source prompt word (which can be configured in the "Reply Node" configuration stage). The target code is, for example, the configuration code of the front-end chart library or the SVG / Canvas rendering code.
[0143] S604: Render the target code to obtain a visual chart and return the visual chart to the user.
[0144] Figure 18 This is an interactive diagram provided for an embodiment of this application.
[0145] like Figure 18 As shown in the embodiments of this application, structured business data can be returned to the user in the form of a pie chart, which can improve the user's understanding efficiency and user experience.
[0146] As can be seen from the above, this application also provides a data analysis method based on an intelligent agent, which can refer to an intelligent query agent. The method includes: receiving a user's query statement dialogue for a database, and performing semantic retrieval, keyword retrieval, and entity recognition on the query statement dialogue to obtain an intent recognition result; inputting the intent recognition result and a first prompt word into a large model, so that the large model generates an SQL statement corresponding to the query statement dialogue based on the intent recognition result, the first prompt word, and the intelligent query data source; wherein, the intelligent query data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include preset SQL statements corresponding to different user queries; executing the SQL statement in the target database to obtain structured business data matching the query statement dialogue, and returning the structured business data to the user. Thus, through this multi-level intent recognition and hybrid retrieval strategy, this application embodiment can accurately understand the user's natural language query intent, and even when faced with ambiguous or complex business questions, it can accurately recall relevant database table structures and field information. By combining pre-built SQL templates in the intelligent query data source, the SQL statements generated by the large model are significantly improved in terms of accuracy and standardization, effectively reducing the risk of model illusion. Ultimately, users can quickly obtain the structured business data they need through dialogue without needing professional technical skills, thus enhancing the user experience.
[0147] Figure 19 This is a schematic diagram of the structure of an intelligent agent construction system for data mining provided in an embodiment of this application.
[0148] like Figure 19 As shown in the embodiments of this application, an intelligent agent construction system for data mining is also provided. The system includes: Module 1001 is configured to: build an intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include the preset SQL statements corresponding to the data tables under different user question types; The orchestration module 1002 is configured to: generate a dialogue stream corresponding to the intelligent query data source in response to the user's intelligent agent orchestration operation, so that the intelligent query agent can call the intelligent query data source to communicate with the user based on the dialogue stream; wherein, the dialogue stream includes at least intelligent query nodes and plug-in nodes; the intelligent query nodes are used to generate SQL statements based on the user's query statements, and the plug-in nodes are used to execute the SQL statements.
[0149] In one possible implementation, the construction module 1001 is specifically configured to: display a card configuration interface in response to user operation on the first control; wherein the first control is used to add smart question cards, and one smart question card corresponds to one smart question task; form a smart question data source in response to user configuration operation on the card configuration interface; wherein the card configuration interface includes information configuration items, which are used to configure name and description information; the card configuration interface also includes data table configuration items and SQL template configuration items, the data table configuration items include a "Add Data Table" button, an "Import Data Table" button, a "Download Import Template" button, and a field configuration button, the "Add Data Table" button is used to generate a data table item by item, the "Import Data Table" button is used to import a data table, the "Download Import Template" button is used to download a data table template file, and the field configuration button is used to configure the field information corresponding to the data table, the field information including field name and associated entity; the SQL template configuration item is used to define the preset SQL statement corresponding to the data table; generate smart question cards corresponding to the smart question data source, and visualize the smart question cards.
[0150] In one possible implementation, the construction module 1001 is further configured to: verify the user's permissions in response to the user's selection of the target smart question card; if the user has permission to access the target smart question card, load and display the data analysis interface corresponding to the target smart question card; the data analysis interface includes at least historical query records and data table information related to the smart question node; if the user does not have permission to access the target smart question card, pop up a first prompt box; the first prompt box is used to prompt the user to contact the administrator to obtain permissions.
[0151] In one possible implementation, the construction module 1001 is further configured to: in response to the user's operation of the "Import Data Table" button, perform real-time format validation on the input data; if it is detected that the user's input data does not match the format requirements of the corresponding field in the preset template, pop up a second prompt box; the second prompt box is used to inform the user of the data format error and provide the user with a correct format example for the corresponding field; if it is detected that the user's input data matches the format requirements of the corresponding field in the preset template, then the user's input data is mapped to the corresponding field in the preset template to form a data table.
[0152] In one possible implementation, the building module 1001 is further configured to: determine the smart question data source corresponding to the smart question card after importing data as the smart question data source corresponding to the dialogue flow.
[0153] In one possible implementation, the orchestration module 1002 is further configured to: add intelligent question nodes and plug-in nodes to the canvas in response to the user's intelligent agent orchestration operation; wherein the intelligent question nodes are configured with large models and the plug-in nodes are composed of preset plug-ins; and / or, in response to the user's intelligent agent orchestration operation, display an entity configuration interface and configure the entity type, entity name and entity members of the entities associated with the dialogue flow through the entity configuration interface.
[0154] In one possible implementation, the dialogue flow may also include one or more of the following: response node, start node, knowledge retrieval node, condition judgment node, large language model processing node, script execution node, parameter extraction node, iteration processing node, and variable management node.
[0155] In one possible implementation, the orchestration module 1002 is further configured to: in response to the user's intelligent agent orchestration operation, add a reply node to the canvas and display the reply node configuration interface; in response to the user's configuration operation on the reply node configuration interface, generate reply rules for the reply node, the reply rules including plain text reply based on the output variables of the preceding node, and also including reply with a visual chart based on the execution result of the plugin node; the preceding nodes include intelligent questioning nodes and plugin nodes.
[0156] In one possible implementation, the building module 1001 is further configured to: display a plugin configuration interface in response to user operation on the second control; wherein the second control is used to add plugins; and generate a preset plugin for executing SQL statements in response to user configuration operation on the plugin configuration interface; wherein the plugin configuration interface includes interface configuration items, the interface configuration items include at least an API path input box, the API path input box is used to configure the interface address for the preset plugin to access the target database to execute SQL statements.
[0157] Figure 20 This is a schematic diagram of the structure of an agent-based data analysis system provided in an embodiment of this application.
[0158] like Figure 20 As shown, this application provides a data analysis system based on intelligent agents, the system comprising: The intent recognition module 2001 is configured to receive user query statements for the database, and perform semantic retrieval, keyword retrieval and entity recognition on the query statements to obtain intent recognition results. The statement generation module 2002 is configured to: input the intent recognition result and the first prompt word into the large model, so that the large model can generate the SQL statement corresponding to the query statement dialogue based on the intent recognition result, the first prompt word and the intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include the preset SQL statements corresponding to the data tables under different user questioning methods; The result generation module 2003 is configured to: execute SQL statements in the target database, obtain structured business data that matches the query statement, and return the structured business data to the user.
[0159] In one possible implementation, the intent recognition module 2001 is specifically configured to: vectorize the query statement dialogue to obtain a query vector; input the query vector into the Milvus vector database for similarity retrieval to recall database table structure information semantically related to the query statement dialogue; wherein the Milvus vector database is generated after vectorizing the database's DDL statements; and is further configured to: perform word segmentation on the query statement dialogue, retrieve matching keywords in the Elasticsearch search engine based on the word segmentation results, and recall target data tables and target field information related to the keywords; and is further configured to: extract business entities from the query statement dialogue, match the business entities with the associated entities of the intelligent query agent to obtain entity recognition results; and is further configured to: summarize the database table structure information, target data tables, target field information, and entity recognition results to obtain intent recognition results.
[0160] In one possible implementation, the result generation module 2003 is specifically configured to: return SQL statements and / or structured business data to the user in plain text; and / or input structured business data and a second prompt word into a large model, so that the large model determines the visualization type corresponding to the structured business data based on the second prompt word; input structured business data, visualization type, and a third prompt word into the large model, so that the large model generates target code based on the third prompt word, the target code being used to generate a visualization chart corresponding to the structured business data, the visualization chart conforming to the visualization type; render based on the target code to obtain a visualization chart, and return the visualization chart to the user.
[0161] In a specific implementation, the present invention also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, may include some or all of the steps in various embodiments of the intelligent agent construction method for data mining and the intelligent agent-based data analysis method provided by the present invention. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0162] It is readily understood that, based on the several embodiments provided in this application, those skilled in the art can combine, split, or reorganize the embodiments of this application to obtain other embodiments, none of which exceed the protection scope of this application.
[0163] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.
Claims
1. A method for constructing intelligent agents for data mining, characterized in that, The method includes: Construct an intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include the preset SQL statements corresponding to the data tables under different user question types; In response to the user's intelligent agent orchestration operation, a dialogue stream corresponding to the intelligent data source is generated, so that the intelligent data agent can invoke the intelligent data source to converse with the user based on the dialogue stream; wherein, the dialogue stream includes at least an intelligent data node and a plugin node; the intelligent data node is used to generate SQL statements based on the user's query statement, and the plugin node is used to execute the SQL statements.
2. The method for constructing an intelligent agent for data mining according to claim 1, characterized in that, The construction of the intelligent question data source includes: In response to the user's operation on the first control, a card configuration interface is displayed; wherein, the first control is used to add a smart question card, and one smart question card corresponds to one smart question task; In response to user configuration operations on the card configuration interface, the intelligent data source is formed. The card configuration interface includes information configuration items for configuring name and description information. It also includes data table configuration items and SQL template configuration items. The data table configuration items include a "Add Data Table" button, an "Import Data Table" button, a "Download Import Template" button, and a field configuration button. The "Add Data Table" button generates a data table item by item; the "Import Data Table" button imports a data table; the "Download Import Template" button downloads a data table template file; and the field configuration button configures the field information corresponding to the data table, including field names and associated entities. The SQL template configuration items define the preset SQL statements corresponding to the data table. Generate the smart question data source corresponding to the smart question data card, and visualize the smart question data card.
3. The method for constructing an intelligent agent for data mining according to claim 2, characterized in that, The method further includes: In response to the user's selection of the target smart question card, verify the user's permissions; If the user has permission to access the target smart question card, the data analysis interface corresponding to the target smart question card is loaded and displayed; the data analysis interface includes at least the historical query records and data table information related to the smart question node; If the user does not have permission to access the target smart question card, a first prompt box will pop up; the first prompt box is used to prompt the user to contact the administrator to obtain permission; Furthermore, the method further includes: In response to the user's action on the "Import Data Table" button, the system performs real-time format validation on the input data. If the user's input data does not match the format requirements of the corresponding field in the preset template, a second prompt box will pop up; the second prompt box is used to inform the user of the data format error and provide the user with a correct format example for the corresponding field; If it is detected that the data input by the user matches the format requirements of the corresponding field in the preset template, the data input by the user is mapped to the corresponding field in the preset template to form the data table; Furthermore, the method further includes: The smart question data source corresponding to the smart question card after importing the data is determined as the smart question data source corresponding to the dialogue flow.
4. The method for constructing an intelligent agent for data mining according to claim 1, characterized in that, The process of generating the dialogue stream corresponding to the intelligent question data source in response to the user's intelligent agent orchestration operation includes: In response to the user's intelligent agent orchestration operation, the intelligent question node and the plugin node are added to the canvas; wherein, the intelligent question node is configured with a large model, and the plugin node is composed of preset plugins; And / or, in response to the user's intelligent agent orchestration operation, display the entity configuration interface, and configure the entity type, entity name and entity members of the entity associated with the dialogue flow through the entity configuration interface.
5. The method for constructing an intelligent agent for data mining according to claim 1 or 4, characterized in that, The dialogue flow also includes one or more of the following: response node, start node, knowledge retrieval node, condition judgment node, large language model processing node, script execution node, parameter extraction node, iterative processing node, and variable management node; The step of generating the dialogue stream corresponding to the intelligent question data source in response to the user's intelligent agent orchestration operation further includes: In response to the user's intelligent agent orchestration operation, add a reply node to the canvas and display the reply node configuration interface; In response to the user's configuration operation on the reply node configuration interface, a reply rule for the reply node is generated. The reply rule includes a plain text reply based on the output variables of the preceding node, and a reply using a visual chart based on the execution result of the plugin node. The preceding node includes the smart question node and the plugin node.
6. The method for constructing an intelligent agent for data mining according to claim 1, characterized in that, Before the step of generating the dialogue stream corresponding to the intelligent query data source in response to the user's intelligent agent orchestration operation, the method further includes: In response to the user's operation on the second control, the plugin configuration interface is displayed; wherein, the second control is used to add plugins; In response to the user's configuration operation on the plugin configuration interface, a preset plugin for executing the SQL statement is generated; wherein, the plugin configuration interface includes an interface configuration item, the interface configuration item includes at least an API path input box, the API path input box is used to configure the interface address of the preset plugin to access the target database to execute the SQL statement.
7. A data analysis method based on intelligent agents, characterized in that, The method is applied to the intelligent questioning agent according to any one of claims 1-6, and the method includes: Receive user query statements for the database, and perform semantic retrieval, keyword retrieval and entity recognition on the query statements to obtain intent recognition results; The intent recognition result and the first prompt word are input into the large model, so that the large model generates the SQL statement corresponding to the query statement dialogue based on the intent recognition result, the first prompt word and the intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include the preset SQL statements corresponding to the data tables under different user questioning methods; The SQL statement is executed in the target database to obtain structured business data that matches the query statement, and the structured business data is returned to the user.
8. The data analysis method based on intelligent agents according to claim 7, characterized in that, The semantic retrieval, keyword retrieval, and entity recognition performed on the query statement dialogue to obtain intent recognition results include: The query statement is vectorized to obtain a query vector; The query vector is input into the Milvus vector database for similarity retrieval to retrieve the database table structure information related to the dialogue semantics of the query statement; wherein, the Milvus vector database is generated by vectorizing the DDL statements of the database; It also includes: performing word segmentation on the query statement dialogue, retrieving matching keywords in the Elasticsearch search engine based on the word segmentation results, and recalling target data tables and target field information related to the keywords; It also includes: extracting business entities from the query statement dialogue, matching the business entities with the associated entities of the intelligent questioning agent, and obtaining entity recognition results; It also includes: summarizing the database structure information, the target data table, the target field information, and the entity recognition results to obtain the intent recognition result.
9. The data analysis method based on intelligent agents according to claim 7, characterized in that, The step of returning the structured business data to the user includes: Return the SQL statement and / or the structured business data to the user in plain text; And / or, input the structured business data and the second prompt word into the large model, so that the large model determines the visualization type corresponding to the structured business data based on the second prompt word; The structured business data, the visualization type, and the third prompt word are input into the large model, so that the large model generates target code based on the third prompt word. The target code is used to generate a visualization chart corresponding to the structured business data, and the visualization chart conforms to the visualization type. The target code is rendered to obtain the visualization chart, which is then returned to the user.
10. A system for constructing intelligent agents for data mining, characterized in that, The system includes: The construction module is configured to: construct an intelligent question data source; wherein, the intelligent question data source includes at least multiple database files and their corresponding data tables and SQL templates, the data tables include at least the field information associated with the database files, and the SQL templates include the preset SQL statements corresponding to the data tables under different user question types; The orchestration module is configured to: generate a dialogue stream corresponding to the intelligent data source in response to the user's intelligent agent orchestration operation, so that the intelligent data agent can call the intelligent data source to communicate with the user based on the dialogue stream; wherein, the dialogue stream includes at least an intelligent data node and a plugin node; the intelligent data node is used to generate an SQL statement based on the user's query statement, and the plugin node is used to execute the SQL statement.