An AI-Agent based data visualization system
By using the AI-Agent module and a custom structured parsing language (CSPL), natural language is converted into structured data queries, generating the most suitable visualization charts. This solves the problem of low data analysis efficiency in existing technologies and enables complex data analysis and intelligent interaction for non-technical users.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU JINGZHUN DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2026-02-12
- Publication Date
- 2026-06-02
AI Technical Summary
Existing data analysis platforms cannot quickly and flexibly customize combinations of core indicators, traditional BI tools are complex to operate, and question-and-answer chatbot interaction modes lack intelligent interaction capabilities, resulting in low data analysis efficiency and poor user experience.
The AI-Agent module is used for natural language understanding. Combined with a visualization chart knowledge base and a custom structured parsing language (CSPL), it realizes intelligent conversion from natural language to data visualization. It generates the most suitable visualization charts through semantic understanding and multi-level verification mechanisms.
It enables non-technical users to perform complex data analysis using natural language, lowering the technical threshold, improving data analysis efficiency and user experience, and supporting automated adaptation of multi-dimensional data expression.
Smart Images

Figure CN122132475A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and more specifically, to a data visualization system based on AI-Agent. Background Technology
[0002] In current enterprise operations, data is a crucial factor driving management decisions. However, data extraction, analysis, and result presentation are independent processes and require experienced personnel. This manifests in several ways: 1) Existing data analysis platforms or reporting systems often use static dashboards, where indicator content, chart types, and page layouts are typically fixed during the development phase through hard-coding. When business priorities change or managers need to investigate specific issues, they cannot quickly and flexibly customize core indicator combinations. This "human-to-system" model leads to a lack of focus on key information and low analysis efficiency. From a technical perspective, every dashboard change requires developers to modify front-end components and back-end interface code and redeploy, resulting in high maintenance costs and slow response times. 2) While traditional business intelligence (BI) tools offer interactive functions such as data drill-down and filtering, they are complex to operate and require users to have some data analysis knowledge. Even after seeing data anomalies (such as declining sales), managers still need to manually perform multiple clicks, filters, and chart linking operations, and cross-compare data from different dimensions to deduce the root cause. This process failed to achieve an automated leap from "data display" to "intelligent insight," with the depth and efficiency of data analysis heavily reliant on the user's personal experience and analytical capabilities. 3) Some systems attempted to introduce question-and-answer chatbots as query entry points, but their technical implementations were mostly based on rule-based template matching or simple keyword retrieval. Significant flaws existed in the interaction model: for example, responses were limited to text or pre-set static charts, failing to dynamically generate new, context-appropriate visualizations based on the complexity of the user's questions; the backend architecture lacked the end-to-end capability to seamlessly convert natural language intent into structured queries (such as SQL), execute queries, and bind the results to visualization components for rendering. This interaction model could not support deep, exploratory data dialogue, resulting in a fragmented user experience. From a technical architecture perspective, existing solutions suffered from tight front-end and back-end coupling, poor scalability, and a lack of truly intelligent interaction pipelines.
[0003] Therefore, there is an urgent need for a technological solution that can deeply integrate data visualization, intelligent analysis, and natural language interaction to lower the technical threshold for data application and improve decision-making efficiency. Summary of the Invention
[0004] To achieve the above objectives, this application provides an AI-Agent-based data visualization system. The data visualization system obtains data analysis requirements from the user terminal and generates visualized data to display to the user terminal; wherein, the data analysis requirements are expressed in natural language. The data visualization system includes: an AI-Agent module, a visualization chart knowledge base, a data module, a composite message assembly module, and a data visualization module; The visualization knowledge base stores data visualization metadata in a structured manner. The metadata includes: chart type, applicable scenarios, data dimensions, and scenario keywords; the data module is used to receive and execute structured query statements and return result sets. AI-Agent is used to perform semantic understanding of natural language, identify user intent and key entities to generate structured semantic information, parse semantic elements to generate and execute structured query statements, obtain result sets, obtain query results, determine the most suitable visualization chart type for the query, and generate text summaries. Specifically, AI-Agent includes a natural language processing unit, a visualization decision engine, a CSPL parsing engine, an SQL query generator, and a text summarization generator. The composite message assembly module is used to combine query results, visualization chart types, and text summaries into a composite message; The data visualization module is used to dynamically generate charts by calling the API of the visualization component service, taking query results and visualization chart types as parameters.
[0005] The matching rules for the visual chart knowledge base include: The matching rules for line charts are as follows: applicable scenarios are trend analysis, the required data dimensions are one time dimension and one or more numerical indicators, and the scenario keywords are trend, change, trend, and over time. The matching rules for bar charts are as follows: applicable scenarios are comparative analysis, the required data dimensions are one category dimension and one or more numerical indicators, and the scenario keywords are comparison, ranking, and high / low. The matching rules for pie charts are as follows: applicable scenarios are percentage analysis, the required data dimensions are 1 category dimension and 1 numerical indicator, and the scenario keywords are percentage, share, composition, and distribution.
[0006] Furthermore, the data module includes a business database and a data warehouse; The business database is used to store metadata of the business system; the data warehouse is used to store the cleaned and aggregated result sets from the business system.
[0007] Furthermore, the natural language processing unit uses a pre-trained model, combined with professional prompt word engineering, to perform intent recognition and entity extraction on natural language, and output structured semantic information; the structured semantic information consists of intent and entities; the intent corresponds to the applicable scenario; the entities correspond to data dimensions and scenario keywords.
[0008] The visualization decision engine is combined with the visualization chart knowledge base to match the semantic elements in the structured semantic information with the metadata in the visualization chart knowledge base to determine the most suitable visualization chart type for this query. The matching is based on matching rules and includes the following steps: Identify the semantic elements in structured semantic information, which include intent and entity; The semantic elements are combined with the visual chart knowledge base to construct prompt words; the content of the prompt words includes: role, source of demand, target, matching rules, output format, and prompt word generation requirements; The decision result of LLM is obtained based on the prompt words, and the decision result is the most suitable visualization chart type for this query.
[0009] Furthermore, the CSPL parsing engine is used to construct structured query statements; Implementing the CSPL parsing engine includes the following: Define elements for constructing structured query statements, including: standard query fields, reserved FILTER clauses, and the legal value range of the fields; A two-layer conversion mode of "Natural Language-CSPL-SQL" is set up. The first layer is converted into a CSPL statement by an AI-Agent. The second layer is converted into a CSPL parsing engine that converts the CSPL statement into a structured query statement.
[0010] The validation process includes: syntax compliance validation, semantic validity validation, and permission boundary validation.
[0011] The standard fields for querying include: The indicator field INDICATOR and the dimension field DIMENSION are used to pre-adapt database field mappings and reduce parsing ambiguity. The TIME_RANGE field is used to adapt to multi-period queries; The ANALYSIS_TYPE field is used to specify the query target; The AGGREGATION field of the aggregation rule is used to specify the aggregation type and target metric to standardize the data statistical logic.
[0012] Furthermore, the CSPL parsing engine constructs structured query statements through the following steps: Acquire structured semantic information and visualize chart types; CSPL intermediate statements are generated based on the structured semantic information; Construct a prompt word template based on the CSPL intermediate statements and structured semantic information, and then populate the prompt word template; Based on the aforementioned prompt word template, the LLM API is invoked to generate a structured query statement; The structured query statement is validated.
[0013] Furthermore, the SQL query generator is used to execute the structured query statement, obtain and return query results from the data module; The text summarization generator is used to intelligently analyze the query results and generate natural language text summaries. Furthermore, the charts and text summaries are encapsulated into structured data objects and returned to the user terminal. The user terminal parses the data objects using the Vue framework and renders the final composite message for display.
[0014] This invention achieves end-to-end intelligent conversion from natural language to data visualization through an AI-Agent architecture. By analyzing natural language and combining it with a visualization chart knowledge base to obtain the optimal chart type, it eliminates the reliance on human experience in traditional data analysis methods and overcomes the limitations of single-chart displays, enabling automated adaptation of multi-dimensional data representation. During data acquisition, a custom Structured Parsing Language (CSPL) is used as an intermediate conversion layer from natural language to SQL. Through structured semantic parsing and multi-level validation mechanisms, the accuracy, security, and maintainability of complex query statements are significantly improved, achieving reliable decoupling between the semantic and execution layers. This invention allows non-technical users to complete complex data analysis tasks through natural language interaction, lowering the technical threshold for data analysis. It integrates the entire process of semantic understanding, query generation, and chart rendering into a single system, improving data analysis efficiency and user experience. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the structure of an AI-Agent-based data visualization system provided in an embodiment of the present invention. Detailed Implementation
[0016] The data visualization system provided by this invention processes unstructured natural language data analysis requests from users: it converts them into structured data query instructions through an AI-Agent-based intelligent decision-making process, matches the optimal visualization charts, and assembles the query results into visualized data to be returned to the user.
[0017] The specific implementation of the present invention will now be described in detail with reference to the accompanying drawings.
[0018] like Figure 1 As shown, the data visualization system interacts with the P100 user terminal to obtain data analysis requirements expressed in natural language. The P100 user terminal uses Vue components to capture the content input by the user and encapsulates it into a data packet. The data packet is then sent to the server via an API gateway for interactive control. The format of the interactive data can be agreed upon, such as a custom specification or JSON specification.
[0019] This invention provides a specific embodiment in which the data visualization system obtains the user's natural language query content, "Compare the sales and profits of each product line in the first half of the year," through the front-end Vue component, and constructs an interactive data request conforming to the JSON specification, represented as follows: { "query":"Compare sales and profits of each product line in the first half of the year", "session_id":"sess_20240115123456", "user_id":"user_12345", "timestamp":"2024-01-15T10:30:00Z"} The query content is natural language expressing the user's needs, session_id is the session ID of this interaction, user_id is the user identifier, and timestamp is the query time.
[0020] The server side of the data visualization system includes: P110 AI-Agent module, P120 visualization chart knowledge base, P130 data module, P140 composite message assembly module, and P150 data visualization module; among them, the P120 visualization chart knowledge base predefines data visualization rules, and the P130 data module provides data sources and is the foundation for the operation of the data visualization system.
[0021] The P120 Visualization Chart Knowledge Base stores data visualization metadata in a structured manner. The metadata includes: chart type, applicable scenarios, data dimensions, scenario keywords, and example descriptions. The visualization knowledge base was built through a combination of manual definition and machine learning, ensuring the accuracy and usability of the mapping relationship between chart types and data features and intents.
[0022] As a structured rule base, the matching rules of the visual chart knowledge base are shown in Table 1: Table 1: Matching Rules for Visualized Chart Knowledge Base
[0023] Once the visual chart knowledge base is built, it can be used by AI-Agent to match the optimal data visualization method.
[0024] The P130 data module is used to implement data query services, including receiving structured query statements, executing queries in the business database, and retrieving result sets from the data warehouse.
[0025] Specifically, the data module includes a business database and a data warehouse. The business database stores metadata of the business system, such as user information and dashboard configurations. The data warehouse stores cleaned and aggregated result sets from the business system. The result sets include various data dimensions and their values, providing high-performance support for analysis and queries.
[0026] P110AI-Agent is the core of the data visualization system of this invention. It is used to perform semantic understanding of natural language requirements, identify user intent and key entities, parse semantic elements, extract result sets, and match visualization rules to generate composite messages. After acquiring interaction data from the user's terminal, the AI-Agent first performs semantic understanding on the natural language, identifying user intent and key entities. Then, it calls upon the P120 visualization chart knowledge base, leveraging the reasoning capabilities of the large language model to match the parsed semantic elements with the chart type rules in the knowledge base, determining the most suitable visualization chart type for the current query. This achieves the best visualization method for matching the natural language content. After determining the visualization method, the AI-Agent, based on the determined chart type and the entities in the user query, uses a custom structured parsing language (CSPL) as an intermediate layer, dynamically constructing a precise structured query statement through prompt word engineering technology. Executing this structured query statement retrieves the required dataset, thus realizing an intelligent pipeline that automatically converts natural language into structured data queries.
[0027] The P111 Natural Language Processing Unit employs a pre-trained model, combined with specialized prompt word engineering, to perform intent recognition and entity extraction on natural language, outputting structured semantic information. This structured semantic information consists of intent and entities. Generally, intent includes demand types such as comparative analysis, trend analysis, and percentage analysis; key entities include conditions for analyzing data such as time, indicators, and dimensions, such as information like the first half of the year, product lines, and sales figures.
[0028] Among them, the intent corresponds to the applicable scenarios in the visualization chart knowledge base; the entity corresponds to the data dimensions and scenario keywords in the visualization chart knowledge base.
[0029] In the embodiments provided by this invention, the natural language processing unit performs deep semantic analysis on the content of natural language expressing data analysis needs, and generates structured semantic information as follows: { "intent":"Comparative Analysis", "entities":{ "metrics":["sales revenue","profit"], "dimensions":["product lines","time"],"filters":{ "time":"first half of the year", "time_granularity":"monthly"} }, "confidence":0.93} P112 Visualization Decision Engine: Combined with a visualization chart knowledge base, it leverages the reasoning capabilities of a large language model to match semantic elements in structured semantic information with metadata in the visualization chart knowledge base, determining the most suitable visualization chart type for this query.
[0030] The matching process is based on matching rules and implemented through LLM inference, including the following steps: 1) Identify the semantic elements in the structured semantic information. The semantic elements include intent and entities; for example: intent = comparative analysis, entities include: metrics = sales, dimensions = product category, time = this month.
[0031] 2) Combine semantic elements with a visual chart knowledge base to construct prompt words; the content of prompt words includes: role, source of demand, target, matching rules, output format and prompt word generation requirements.
[0032] For example: The role is a data analysis expert; the source of the requirement is the user's query intent and data characteristics; the goal is a visualization chart knowledge base; the matching rules include: intent is comparative analysis, indicator is sales revenue, and dimensions are product type and time; the output format is JSON:{"chart_type":["type1","type2"],"reason":"..."}; the prompt word generation requirement is: match the chart type according to the applicable scenarios, indicators, and dimensions of the visualization chart knowledge base, and provide a reason.
[0033] 3) Obtain the LLM decision results based on the prompt words. The decision results are the most suitable visualization chart type for this query.
[0034] The selection of charts is achieved through the above matching process. This selection process is intelligent, based on semantic understanding and structured decision-making, ensuring the best performance of data visualization results and is a core part of realizing intelligent interaction.
[0035] According to the embodiments provided by the present invention, when the visualization decision engine queries the visualization chart knowledge base and matches the most suitable analysis scenario, the information input to the visualization decision engine is as follows: Element Intent: Comparative Analysis Indicators: Sales revenue and profit (two numerical indicators). Dimensions: Product line, time (2 categories). Expected data volume: 6 months × N product lines; The most suitable visualization chart type for this query, obtained from the visualization chart knowledge base, is a grouped bar chart. The decision results obtained from LLM are as follows: {"recommended_charts":["grouped_bar_chart","line_chart"],"primary_chart":"grouped_bar_chart", "reasoning": "Grouped bar charts can clearly compare the sales and profit of different product lines in each month." P113CSPL Parsing Engine: In this invention, a custom structured parsing language (CSPL) is used as an intermediate layer. Combined with context-aware prompt word engineering, accurate structured query statements (such as SQL) are dynamically constructed. The structured query statements include query fields and grouping conditions, which can provide data preparation for subsequent chart rendering.
[0036] The implementation of the CSPL parsing engine includes the following parts: 1. Define the elements used to construct structured query statements in the CSPL parsing engine, including: 1) Query standard fields, including: The indicator field INDICATOR and the dimension field DIMENSION support binding aliases (ALIAS), allowing for pre-adaptation to database field mappings and reducing parsing ambiguity. The time range field TIME_RANGE can be defined based on the start time, end time, and time format, and supports a unified time function (such as CURRENT_TIME-MONTH) to adapt to multi-period queries; The ANALYSIS_TYPE field is analyzed and defined as an enumeration value (such as TREND, COMPARISON, or PROPORTION) to clarify the query target; The aggregation rule field AGGREGATION is used to specify the aggregation type (such as SUM, COUNT, etc.) and target metric to standardize the data statistical logic; 2) Reserve the FILTER clause to support legal operators, for example, reserve the CALCULATED_INDICATOR clause to support the calculation of derived index formulas; 3) Each field has a defined range of valid values, and there is no redundant extended syntax, ensuring the standardization of statements.
[0037] 2. Set up a two-tier conversion mode of "Natural Language - CSPL - SQL", including: First-level transformation: The AI-Agent converts the natural language parsing results into CSPL statements; The second layer of transformation: The CSPL parsing engine transforms CSPL statements into precise and compliant SQL statements (i.e., structured query statements).
[0038] 3. Built-in security verification mechanism to implement verification, including: Syntax compliance check: Checks the completeness of elements and the correctness of field formats; Semantic rationality verification: Verify the matching of indicators and dimensions, the validity of time ranges, etc. Permission boundary verification: Controls data access permissions, filters illegal operations, and eliminates SQL injection at its source.
[0039] Specifically, when constructing a structured query statement, the CSPL parsing engine obtains multiple contextual information contained in the natural language parsing results and constructs dynamic suggestion words; then, based on the elements of the structured query statement and the data tables, field names, and field types involved in the current query, it determines the database schema information, and determines the query structure (including sorting, field selection, etc.) based on the optimal chart type; this includes the following steps: 1) Obtain structured semantic information and visualization chart types; 2) Generate CSPL intermediate statements based on structured semantic information; 3) Construct prompt word templates based on CSPL intermediate statements and structured semantic information, and fill the prompt word templates with real context; 4) The prompt word template calls the LLM API to generate SQL statements; 5) Validate the SQL statements.
[0040] According to an embodiment of the present invention, the code (using Python) for constructing a prompt word template based on CSPL and context is as follows: prompt_template = """ You are an SQL expert. Please generate a standardized SQL query based on the following CSPL query and context information.
[0041] CSPL query statement: {{ cspl_statement}} Database table structure (table name: sales_data): {{ db_schema}} Visualization requirement: The query results will be used to generate a chart of type {{chart_type}}.
[0042] SQL writing requirements: 1. The conversion is strictly based on the metrics, dimensions, time range, and filtering conditions specified in the CSPL statement.
[0043] 2. Select appropriate aggregation functions (such as SUM, AVG) and sorting rules (such as ORDER BY) according to the chart type.
[0044] 3. Ensure that the WHERE clause contains all filtering criteria and is grammatically correct.
[0045] 4. Please only output the final SQL statement, without any other explanation.
[0046] """ Wherein, cspl_statement is the CSPL intermediate statement; Code that populates the template using the real context includes: filled_prompt = prompt_template.replace("{{ cspl_statement}}", str(cspl_statement)) filled_prompt = filled_prompt.replace("{{ db_schema}}", db_schema) filled_prompt = filled_prompt.replace("{{ chart_type}}", chart_type) The CSPL intermediate statement generated based on the parsing results of "comparing the sales revenue and profit of each product line in the first half of the year" is as follows: QUERY{ INDICATOR:[ {NAME:"Sales Amount",ALIAS:"sales_amount"}, {NAME:"Profit",ALIAS:"profit_amount"} ], DIMENSION:[ {NAME:"Product Line",ALIAS:"product_line"}, {NAME:"Month",ALIAS:"month"} ], TIME_RANGE:{ START:"CURRENT_YEAR-01-01", END:"CURRENT_YEAR-06-30", FORMAT:"YYYY-MM-DD"}, ANALYSIS_TYPE:["COMPARISON"], AGGREGATION:{TYPE:"SUM",TARGET:["Sales Revenue","Profit"]},FILTER:[] } Based on the CSPL statement and the output of the visualization decision engine regarding visualization chart types, the generated SQL statement is as follows: SELECT product_line,month,SUM(sales_amount) as total_sales, SUM(profit_amount) as total_profit FROM sales_data WHERE month BETWEEN '2024-01-01' AND '2024-06-30' GROUP BY product_line, month ORDER BY month, product_line; P114SQL Query Generator: Used to execute structured query statements generated by the CSPL parsing engine and to retrieve and return query results from the data module.
[0047] The combination of the CSPL parsing engine and the SQL query generator enables an intelligent pipeline that automatically converts natural language into structured data queries.
[0048] P115 Text Summarizer: Used for intelligent analysis of query results returned by the SQL query generator to generate concise and easy-to-understand natural language text summaries.
[0049] According to an embodiment of the present invention, the generated text summary is as follows: "Sales comparison analysis of various product lines in the first half of the year shows that the electronics product line performed best, with sales reaching 185,000 yuan in June and cumulative profits of 55,500 yuan. The home furnishings line showed stable growth, with a 15% increase in the second quarter compared to the first quarter. It is recommended to focus on inventory management of the electronics product line and market promotion of the home furnishings line."
[0050] The P140 composite message assembly module generates visualization metadata from the query results, text summary, and the most suitable visualization chart type for this query, forming a composite message; the visualization method is determined by the value of the key visualization.
[0051] According to the embodiments provided by the present invention, the generated composite message is: { "message_id":"msg_202401151030001", "type":"composite_analysis", "timestamp":"2024-01-15T10:30:15Z", "components":{ "text_summary":"A comparative analysis of sales across product lines in the first half of the year shows..." "visualization":{ "chart_type":"grouped_bar_chart", "chart_data":"{...echarts configuration}", "render_type":"config_object"}, "underlying_data":{ "data_sample":[...], "total_records":42, "data_columns":["product_line","month","total_sales","total_profit"] }, "interaction_actions":[ { "type":"drill_down", "label":"View Electronic Product Details", "action": "Analyze the sales performance of each SKU in the electronic product line" }, { "type":"time_compare", "label":"Compared to the same period last year", "action": "Compare sales of each product line in the first half of 2023" } ] }, "response_time":"1.8s"} The P150 data visualization module is used to dynamically generate charts by calling the API of visualization component services (such as ECharts) with the obtained query results and visualization chart type as parameters.
[0052] According to the embodiments provided by the present invention, the code for dynamically generating charts based on the visualization value is as follows: ECharts configuration option={ title:{text:'Comparison of Sales Revenue and Profit of Each Product Line in the First Half of the Year'},tooltip:{trigger:'axis'}, legend:{data:['Electronic Product Sales Revenue','Electronic Product Profit','Home Furnishings Sales Revenue',...]}, xAxis:{type:'category',data:['January','February','March','April','May','June']}, yAxis:{type:'value'}, series:[{ name:'Sales Revenue of Electronic Products' type:'bar', data:[150000,165000,142000,158000,172000,185000]}, { name:'Profit from Electronic Products' type:'bar', data:[45000,49500,42600,47400,51600,55500]} / / ...Other series ] }; Furthermore, the text summary and charts are encapsulated into a structured data object (such as JSON) and returned to the user terminal. The user terminal parses this data object using the Vue framework and renders the final composite message for display. This ultimately achieves the goal of "dynamically generating and integrating text summaries and visual charts," providing an interactive experience that goes beyond plain text.
[0053] The user terminal uses Vue components to parse compound messages, dynamically render text and charts, and achieve data visualization.
[0054] This invention constructs a complete path from semantic understanding, visual decision-making, query generation, and chart rendering through AI-Agent, realizing the intelligent transformation from natural language to data visualization. Specifically, by introducing a visualization chart knowledge base matching mechanism based on a large language model, it solves the problem of the dependence on human experience for chart type selection in traditional systems and overcomes the single limitation of traditional data display methods. In the process of generating query statements, a custom structured parsing language (CSPL) is used as an intermediate layer from natural language to SQL, and a verification mechanism is designed to improve the quality of SQL generation, thereby improving the accuracy, security, and maintainability of the query process.
[0055] This invention provides AI-Agent-based data query and result visualization, lowering the technical threshold for data analysis. Users without a technical background can complete complex data analysis tasks through natural language interaction, realizing an experience that goes from dialogue to analysis. During the experience, this invention organically combines text interpretation with visual charts, allowing users to complete the entire process within a single interface without switching between different tools.
[0056] The above-disclosed embodiments are merely a few specific examples of the present invention. However, the present invention is not limited thereto, and any variations that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A data visualization system based on AI-Agent, characterized in that, The data visualization system obtains data analysis requirements from user terminals, generates visualized data, and displays it to the user terminals; wherein, the data analysis requirements are expressed in natural language; The data visualization system includes: an AI-Agent module, a visualization chart knowledge base, a data module, a composite message assembly module, and a data visualization module; The visualization chart knowledge base stores data visualization metadata in a structured manner. The metadata includes: chart type, applicable scenarios, data dimensions, and scenario keywords. The data module is used to receive and execute structured query statements and return result sets. The AI-Agent is used to perform semantic understanding of natural language, identify user intent and key entities to generate structured semantic information, parse semantic elements to generate and execute structured query statements, obtain result sets, obtain query results from the result sets, determine the most suitable visualization chart type for this query, and generate text summaries; the AI-Agent includes a natural language processing unit, a visualization decision engine, a CSPL parsing engine, an SQL query generator, and a text summarization generator; The composite message assembly module is used to combine the query results, the visualization chart type, and the text summary to form a composite message; The data visualization module is used to dynamically generate charts by calling the API of the visualization component service, taking the query results and the visualization chart type as parameters.
2. The AI-Agent-based data visualization system according to claim 1, characterized in that, The matching rules for the visual chart knowledge base include: The matching rules for the chart type being line chart are as follows: the applicable scenario is trend analysis, the required data dimensions are one time dimension and one or more numerical indicators, and the scenario keywords are trend, change, trend, and over time. The matching rules for the chart type of bar chart are as follows: the applicable scenario is comparative analysis, the required data dimension is one category dimension, one or more numerical indicators, and the scenario keywords are comparison, ranking, and high and low. The matching rules for the chart type pie chart are as follows: applicable scenario is percentage analysis, required data dimensions are 1 category dimension and 1 numerical indicator, and scenario keywords are percentage, share, composition and distribution.
3. The AI-Agent-based data visualization system according to claim 1, characterized in that, The data module includes a business database and a data warehouse; The business database is used to store metadata of the business system; the data warehouse is used to store result sets from the business system that have been cleaned and aggregated.
4. The AI-Agent-based data visualization system according to claim 1, characterized in that, The natural language processing unit uses a pre-trained model, combined with professional prompt word engineering, to perform intent recognition and entity extraction on natural language, and output structured semantic information. The structured semantic information consists of intent and entities. The intent corresponds to the applicable scenario. The entities correspond to data dimensions and scenario keywords.
5. The AI-Agent-based data visualization system according to claim 1, characterized in that, The visualization decision engine is combined with the visualization chart knowledge base to match the semantic elements in the structured semantic information with the metadata in the visualization chart knowledge base to determine the most suitable visualization chart type for this query. The matching is based on matching rules and includes the following steps: Identify the semantic elements in structured semantic information, which include intent and entity; The semantic elements are combined with the visual chart knowledge base to construct prompt words; the content of the prompt words includes: role, source of demand, target, matching rules, output format, and prompt word generation requirements; The decision result of LLM is obtained based on the prompt words, and the decision result is the most suitable visualization chart type for this query.
6. The AI-Agent-based data visualization system according to claim 1, characterized in that, The CSPL parsing engine is used to construct structured query statements; The implementation of the CSPL parsing engine includes: Define elements for constructing structured query statements, including: standard query fields, reserved FILTER clauses, and the legal value range of the fields; A two-layer conversion mode of "Natural Language-CSPL-SQL" is set up. The first layer is converted into a CSPL statement by an AI-Agent. The second layer is converted into a CSPL parsing engine that converts the CSPL statement into a structured query statement. The validation process includes: syntax compliance validation, semantic validity validation, and permission boundary validation.
7. The AI-Agent-based data visualization system according to claim 1, characterized in that, The CSPL parsing engine constructs structured query statements through the following steps: Acquire structured semantic information and visualize chart types; CSPL intermediate statements are generated based on the structured semantic information; Construct a prompt word template based on the CSPL intermediate statements and structured semantic information, and then populate the prompt word template; Based on the aforementioned prompt word template, the LLM API is invoked to generate a structured query statement; The structured query statement is validated.
8. The AI-Agent-based data visualization system according to claim 1, characterized in that, The SQL query generator is used to execute the structured query statement and obtain and return query results from the data module; The text summarization generator is used to intelligently analyze the query results and generate natural language text summaries.
9. The AI-Agent-based data visualization system according to claim 1, characterized in that, The chart and text summary are encapsulated into a structured data object and returned to the user terminal. The user terminal parses the data object using the Vue framework and renders the final composite message for display.
10. The AI-Agent-based data visualization system according to claim 6, characterized in that, The query criteria fields include: The indicator field INDICATOR and the dimension field DIMENSION are used to pre-adapt database field mappings and reduce parsing ambiguity. The TIME_RANGE field is used to adapt to multi-period queries; The ANALYSIS_TYPE field is used to specify the query target; The AGGREGATION field of the aggregation rule is used to specify the aggregation type and target metric to standardize the data statistical logic.