Artificial intelligence-based chart generation method, apparatus, device, and storage medium
By using artificial intelligence-based methods to generate structured query language from natural language, executing queries and evaluating data quality, generating data feature vectors, and selecting the optimal chart, this approach solves the problems of high technical barriers, low efficiency, and insufficient data feature recognition in existing database query and visualization analysis technologies, and achieves end-to-end automated closed-loop visualization analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2026-03-16
- Publication Date
- 2026-07-21
Smart Images

Figure CN122432234A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to the fields of database management and artificial intelligence technology, and in particular to methods, apparatus, devices and storage media for generating charts based on artificial intelligence. Background Technology
[0002] In modern data-driven applications, database querying and visualization analysis are core components supporting business decision-making. However, existing technical solutions generally suffer from the following limitations: traditional BI (Business Intelligence) tools rely on users manually configuring data sources and chart types, which is technically challenging and inefficient; while natural language query tools can automatically generate SQL (Structured Query Language), the returned results still require users to manually select the visualization format, creating a disconnect between the query and visualization processes; preset chart templates have limited flexibility and are difficult to adapt to diverse data characteristics and business scenarios. More importantly, existing solutions lack systematic data feature recognition capabilities, cannot automatically identify complex features, and fail to incorporate data quality assessment into the visualization decision-making process, leading to frequent problems such as chart selection relying on human experience and the generation of distorted visualizations from low-quality data. Summary of the Invention
[0003] This disclosure provides a chart generation method, apparatus, device, and storage medium based on artificial intelligence.
[0004] According to one aspect of this disclosure, an artificial intelligence-based chart generation method is provided, the method comprising: The system parses the natural language input by the user and generates a structured query language corresponding to the natural language based on the parsing results. The structured query language is executed to obtain the corresponding query result set from the database; Traverse the query result set, statistically analyze the basic attributes of each field in the query result set and the relationships between fields, and perform data quality assessment on the data of each field in the query result set to generate a data feature vector containing quality scores; The feature identifiers in the data feature vector are matched with the rule conditions in the preset decision rule base to obtain a candidate chart set. The optimal chart is selected from the candidate chart set using a multi-objective weighted scoring mechanism.
[0005] According to another aspect of this disclosure, an artificial intelligence-based chart generation apparatus is provided, the apparatus comprising: The input module is used to parse the natural language input by the user and generate a structured query language corresponding to the natural language based on the parsing results. The execution module is used to execute the structured query language to obtain the corresponding query result set from the database; The traversal module is used to traverse the query result set, count the basic attributes of each field in the query result set and analyze the relationship between fields, and perform data quality assessment on the data of each field in the query result set to generate a data feature vector containing quality scores. The matching module is used to match the feature identifiers in the data feature vector with the rule conditions in the preset decision rule base to obtain a candidate chart set, and to select the optimal chart from the candidate chart set using a multi-objective weighted scoring mechanism.
[0006] According to a third aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described in any of the above technical solutions.
[0007] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any one of the methods described above.
[0008] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the above technical solutions.
[0009] This disclosure provides an artificial intelligence-based chart generation method, apparatus, device, and storage medium. Through the deep integration of natural language parsing and structured query language generation, this disclosure achieves end-to-end automated conversion from unstructured input to structured data query, breaking through the technical barrier of traditional database interaction relying on manually written query statements. This allows non-technical users to complete data queries without needing to master structured query language syntax. Based on this, by traversing the query result set to perform basic attribute statistics, inter-field relationship analysis, and data quality assessment, a data feature vector covering multi-dimensional features such as time series, proportion, sorting, and comparison is constructed. The data quality assessment is quantified as a quality score and incorporated into the feature vector, forming a fusion representation of data features and quality assessment. This fills the gap in existing technologies where data feature recognition and quality assessment are separate, enabling subsequent chart selection to simultaneously respond to the dual constraints of data structure and data quality, effectively avoiding visualization distortion caused by data quality issues. Finally, by performing pattern matching between feature vectors and a pre-defined decision rule base, a candidate chart set is obtained. The optimal chart is selected from this set using a multi-objective weighted scoring mechanism. This achieves a leap from single-rule matching to multi-dimensional intelligent decision-making, solving the dual dilemmas of insufficient flexibility in traditional rule engines and poor interpretability of pure machine learning models. It enables chart selection to adapt to data features and data quality, significantly improving the accuracy, robustness, and interpretability of visualization recommendations. Ultimately, it achieves an end-to-end automated closed loop for querying, analysis, and visualization.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a schematic diagram illustrating the steps of the AI-based chart generation method in this embodiment of the present disclosure; Figure 2 This is a schematic diagram of a graph generated based on natural language in an embodiment of this disclosure; Figure 3 This is a schematic diagram of the process for generating a data feature vector containing a quality score in an embodiment of this disclosure; Figure 4 This is a flowchart illustrating the process of determining the optimal chart in an embodiment of this disclosure; Figure 5 This is a schematic diagram of the overall process of AI-based database query and automatic generation of dynamic charts in this embodiment of the disclosure; Figure 6This is a schematic diagram of the chart generation device based on artificial intelligence in the embodiments of this disclosure; Figure 7 This is a block diagram of an electronic device used to implement the AI-based chart generation method of the present disclosure embodiments. Detailed Implementation
[0012] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0013] Existing technologies mainly employ the following four types of solutions: The first type is traditional BI (Business Intelligence) tools such as Tableau, Power BI, and FineBI. These tools allow users to manually configure data sources, fields, and chart types through drag-and-drop visual editing interfaces, but require users to have some data analysis knowledge. The second type is a combination of SQL (Structured Query Language) query editors and visualization libraries. In this type, developers or advanced users write SQL queries and then manually configure chart parameters using open-source libraries such as Plotly, ECharts, and D3.js, requiring frequent tool switching. The third type is natural language query tools such as Microsoft Power BI's Q&A (Question and Answer). These tools allow users to ask questions in natural language, which are automatically converted into SQL and executed on the backend, but the returned results still require users to manually select chart types for visualization. The fourth type is preset chart template solutions. These solutions provide predefined chart templates for users to choose from, but their flexibility is limited and they are difficult to adapt to diverse data characteristics.
[0014] However, the above-mentioned technical methods have significant technical drawbacks: traditional BI tools and SQL query editors rely on manual operation by users, which has a high technical threshold and low interaction efficiency; although natural language query tools have realized the intelligence of the query process, the query and visualization processes are separated and fail to form an end-to-end automated closed loop; preset chart templates lack dynamic adaptability and are difficult to respond to changes in data characteristics. The more fundamental technical problems lie in the following: Existing solutions generally lack systematic automatic data feature recognition capabilities, failing to provide scientific chart recommendations based on data features such as time series, proportion relationships, and ranking comparisons. This forces users to rely solely on experience or intuition to choose chart types. Existing solutions do not incorporate data quality assessment into the visualization decision-making process, failing to dynamically adjust chart strategies based on quality indicators such as data completeness, timeliness, and anomalies, easily leading to low-quality data and distorted visualizations. Existing solutions lack query optimization and dynamic visualization adaptation capabilities in multi-turn dialogue scenarios, requiring manual reconfiguration when data structure or scale changes, resulting in delayed responses and a fragmented user experience. Furthermore, existing solutions fail to organically integrate natural language querying, data analysis, and visualization generation into a unified AI (Artificial Intelligence) dialogue interface, failing to fully utilize the deep understanding of data semantics and business meanings provided by large language models. Therefore, existing technologies exhibit significant shortcomings in end-to-end intelligence, data feature recognition, quality-aware decision-making, and dynamic interaction optimization, resulting in high overall usage barriers, low efficiency, and poor interpretability.
[0015] To address the aforementioned issues, this disclosure provides a novel AI-based chart generation method, see [link to relevant documentation]. Figure 1 As shown, Figure 1 This is a schematic diagram illustrating the steps of an artificial intelligence-based chart generation method according to an embodiment of this disclosure. The method includes: Step S101: Parse the natural language input by the user and generate a structured query language corresponding to the natural language based on the parsing results.
[0016] Specifically, this solution primarily uses a large language model to convert natural language into a structured query language. After obtaining the natural language input from the user, the large language model performs deep semantic understanding on the user's natural language query, identifying key elements such as the query target, time range, aggregation dimensions, and filtering conditions. Then, combined with metadata information from the data dictionary, business terms are mapped to physical objects in the database, thereby generating a structured query language (i.e., SQL) that conforms to grammatical rules.
[0017] The specific implementation process of this solution includes: First, capturing the natural language query entered by the user in the AI (Artificial Intelligence) assistant interface, such as "sales trends in the last 30 days" or "sales ranking by region". Then, using a large language model, intent recognition is performed to extract information such as the query target (sales amount), time range (last 30 days), and aggregation dimension (grouped by region). Next, the maintained data dictionary is queried. This data dictionary contains metadata such as database table names, field names, field types, and field business meanings, mapping "sales amount" to the `orders.amount` field, "region" to the `customers.region` field, and "last 30 days" to a date filter condition. Based on the above mapping results, an SQL statement containing clauses such as `SELECT`, `FROM`, `WHERE`, and `GROUP BY` is automatically generated. Optionally, after obtaining the SQL statement, the generated statement undergoes security verification to prevent SQL injection attacks, and the execution plan is optimized to improve query performance.
[0018] Step S102: Execute the Structured Query Language to obtain the corresponding query result set from the database.
[0019] Specifically, executing a structured query language to retrieve query result sets from a database refers to managing heterogeneous database connections through a multi-data source connection pool, sending optimized structured query language statements to the target database for execution, obtaining the original data results, and performing caching and performance optimization.
[0020] The specific implementation process of this solution includes: First, establishing and maintaining a multi-data source connection pool. This connection pool supports unified management and concurrent access to heterogeneous databases such as MySQL, PostgreSQL, and MongoDB. Connection reuse avoids the performance overhead caused by frequent creation and destruction. Simultaneously, governance strategies such as connection limit, timeout recycling, and circuit breaking are implemented to ensure system stability. Here, the connection pool refers to a set of reusable database connection channels that are pre-created and maintained; heterogeneous databases refer to different types of database management systems. Then, a Structured Query Language (SQL) statement, after security verification and execution plan optimization, is sent to the corresponding data source for execution. SQL is a standard programming language used to manage and manipulate relational databases. For extremely large result sets (more than 10,000 records), streaming processing or pagination strategies are used to avoid front-end lag and memory overflow risks. Streaming processing refers to reading data line by line instead of loading all results at once, while pagination strategies involve dividing the large dataset into multiple smaller chunks and returning them in batches. After the query is executed, the results are stored in the LRU (Least Recently Used) result cache pool. LRU is a cache eviction policy that prioritizes the eviction of the least recently accessed data when the cache space is insufficient. The cache key consists of the data table name, the basic WHERE condition, and the time range, without any subsequent appended filtering conditions.
[0021] Step S103: Traverse the query result set, statistically analyze the basic attributes of each field in the query result set and the relationship between fields, and conduct data quality assessment on the data of each field in the query result set to generate a data feature vector containing quality scores.
[0022] Specifically, the process begins by traversing the query result set and statistically analyzing the basic attributes of each field. These attributes may include data type and non-null rate. Data type refers to the type of data stored in the field, such as numeric, string, or date types. The non-null rate is the proportion of non-null values in a field out of the total number of records. These basic statistics provide a quantitative basis for subsequent feature identification. Next, the relationships between fields are analyzed. For example, it identifies whether the data includes date and time fields and is arranged in chronological order; whether the data contains a component-to-whole composition relationship, such as sales revenue percentage; whether the data has a clear ranking meaning according to a certain dimension, such as Top 10 sales; and whether comparative analysis is needed between multiple dimension values. These relationship identifications are determined by comprehensively examining field types, data distribution, and business semantics. Based on feature identification, the query results are then assessed for data quality, including null value detection, sparsity detection, and outlier detection. Finally, the above analysis results are combined to generate a data feature vector. This vector includes Boolean features such as time series identifier, proportion identifier, sorting identifier, and comparison identifier; count features such as number of fields and number of records; and a quality score calculated by weighting the comprehensive null value rate, sparsity, and outlier indicators. The quality score ranges from 0 to 1, with a value closer to 1 indicating higher data quality. The resulting data feature vector is passed as standardized input to the intelligent chart selection module to support subsequent rule matching and multi-objective optimization decisions, realizing the automated transformation from raw data to feature representation.
[0023] Step S104: Match the feature identifiers in the data feature vector with the rule conditions in the preset decision rule base to obtain a candidate chart set, and use a multi-objective weighted scoring mechanism to select the optimal chart from the candidate chart set.
[0024] Specifically, firstly, various feature identifiers are extracted from the data feature vector, such as time series identifiers, percentage identifiers, and sorting identifiers. Then, these feature identifiers are compared one by one with the rule conditions in a pre-set decision rule base. The rule base pre-sets multiple matching rules; for example, when the time series identifier is true and the indicator quantity is a single indicator, a line chart or area chart rule is triggered; when the sorting identifier is true, a horizontal bar chart or vertical bar chart rule is triggered. After summing and deduplicating the chart types corresponding to all triggered rules, a candidate chart set is formed. After obtaining the candidate chart set, a multi-objective weighted scoring mechanism is used to comprehensively evaluate each candidate chart. This mechanism includes three scoring dimensions: rule matching score (a quantitative score of the degree of fit between the data feature vector and the triggered rule), quality fit score (a chart fit score determined based on the quality score), and user history preference score (a personalized score based on historical behavior statistics in the user profile). Each of the three dimensions is multiplied by a pre-set weight coefficient and then summed to obtain a comprehensive score. Finally, the candidate chart with the highest comprehensive score is selected as the optimal chart. See also... Figure 2 , Figure 2 This is a schematic diagram illustrating the generation of charts based on natural language in an embodiment of this disclosure. For example, if the user inputs "daily sales trend over the last 30 days" in natural language, the technical solution of this application can be used to process the natural language, thereby obtaining the corresponding chart display.
[0025] This disclosure provides an AI-based chart generation method, apparatus, device, and storage medium. The deep integration of natural language parsing and structured query language generation enables end-to-end automated conversion from unstructured input to structured data querying. This overcomes the technical barrier of traditional database interaction relying on manually written query statements, allowing non-technical users to complete data queries without needing to master structured query language syntax. Furthermore, by traversing the query result set to perform basic attribute statistics, inter-field relationship analysis, and data quality assessment, a data feature vector covering multi-dimensional features such as time series, proportion, sorting, and comparison is constructed. The data quality assessment is quantified as a quality score and incorporated into the feature vector, forming a fusion representation of data features and quality assessment. This fills the gap in existing technologies where data feature recognition and quality assessment are separate, enabling subsequent chart selection to simultaneously respond to the dual constraints of data structure and data quality, effectively avoiding visualization distortion caused by data quality issues. Finally, by performing pattern matching between feature vectors and a pre-defined decision rule base, a candidate chart set is obtained. The optimal chart is selected from this set using a multi-objective weighted scoring mechanism. This achieves a leap from single-rule matching to multi-dimensional intelligent decision-making, solving the dual dilemmas of insufficient flexibility in traditional rule engines and poor interpretability of pure machine learning models. It enables chart selection to adapt to data features and data quality, significantly improving the accuracy, robustness, and interpretability of visualization recommendations. Ultimately, it achieves an end-to-end automated closed loop for querying, analysis, and visualization.
[0026] In some optional embodiments, the query result set is traversed, the basic attributes of each field in the query result set are statistically analyzed, and the relationships between fields are analyzed. Data quality is then assessed for each field in the query result set, generating a data feature vector containing quality scores, including: Traverse the query result set, count the basic attributes of each field, analyze the relationship between fields, and generate basic feature identifiers. The basic attributes of each field include data type, non-empty rate, number of duplicates, and numerical range. The relationships between fields include time sorting relationship, proportion relationship, and classification dimension relationship. The empty value rate detection index, sparsity detection index, and outlier detection index are calculated based on basic feature identifiers. A quality score is obtained based on the null value rate detection index, sparsity detection index, and outlier detection index. The quality score is fused with the basic feature identifier as an additional dimension to form a data feature vector containing the quality score.
[0027] Specifically, traversing the query result set to generate basic feature identifiers and performing quality assessment and fusion to form a data feature vector refers to performing hierarchical and progressive feature extraction and quality quantification on the dataset returned by the query, and constructing a complete feature representation covering structural features, distribution features and quality scores.
[0028] The specific implementation process of this scheme includes: first, traversing the query result set to count the basic attributes of each field. Data type refers to the types of data stored in the field, including numeric, string, date, etc. Non-null rate refers to the proportion of non-null values in the field to the total number of records, which is used to measure data integrity. Deduplication count refers to the number of unique values in the field, which is used to judge the field's distinguishability. Numeric range refers to the minimum and maximum value range of numeric fields, which is used to understand the scale of data distribution. These basic statistics provide a quantitative basis for subsequent feature recognition.
[0029] After obtaining the basic attributes of each field through statistics, the relationships between the fields are then analyzed. The time sorting relationship refers to whether the data contains date or time type fields and is arranged in ascending or descending order of time. The proportion relationship refers to whether the data contains the composition relationship between the part and the whole, such as the proportion of each category's sales to the total sales. The classification dimension relationship refers to the number and distribution of deduplicated values of text or enumeration fields, which are used to identify classification attributes. Based on the above analysis, a basic feature identifier is generated, which is a preliminary feature set containing information such as whether each relationship exists, the number of fields, and the number of records.
[0030] Building upon the basic feature identifiers, further quality assessment metrics are calculated. The null value rate metric is the ratio of the number of missing values in each field to the total number of records, used to identify the degree of data loss. The sparsity metric, for time series data, is the ratio of the number of non-empty rows to the total number of rows, representing temporal continuity density, used to identify large time gaps. The outlier detection metric uses the IQR (interquartile range) method to identify outliers in numerical fields. IQR is the difference between the first and third quartiles. The outlier detection interval is determined by subtracting 1.5 times the IQR from the first quartile and adding 1.5 times the IQR to the third quartile. The outlier detection metric is then calculated as the ratio of the number of outliers outside this interval to the total number of records. Finally, a quality score is calculated by weighting these three quality assessment metrics. Finally, the quality score is fused with the basic feature identifier as an additional dimension to form a complete data feature vector containing Boolean features such as time series identifier, percentage identifier, sorting identifier, and comparison identifier, count features such as field number and record number, and the quality score. This vector is passed as a standardized input to the subsequent intelligent chart selection module, realizing the automatic transformation from raw data to high-quality feature representation.
[0031] In this way, by traversing the query result set, statistically analyzing the basic attributes of the fields, and generating basic feature identifiers through the analysis of the relationships between the fields, a systematic extraction of data structure features is achieved. This breaks through the limitations of traditional visualization tools that rely solely on simple data type judgments, enabling data feature identification to cover multi-dimensional relationships such as time sorting, proportion composition, and classification dimensions, significantly improving the completeness and accuracy of feature description. Based on this, by calculating null value rate detection indicators, sparsity detection indicators, and outlier detection indicators based on the basic feature identifiers, and comprehensively obtaining a quality score, data quality assessment is quantified into a computable scoring dimension, filling the gap in existing technologies where data feature identification and quality assessment are separated. Finally, the quality score is fused with the basic feature identifiers as an additional dimension to form a data feature vector, enabling subsequent chart selection to simultaneously respond to the dual constraints of data structure and data quality. This effectively avoids visualization distortion caused by missing data, time gaps, or outliers, significantly improving the robustness and reliability of visualization recommendations, and achieving a paradigm upgrade from single feature description to a fusion of feature and quality representation.
[0032] See Figure 3 , Figure 3This is a flowchart illustrating the process of generating a data feature vector containing quality scores in this embodiment of the disclosure. The flowchart starts with a query result set as input, progressively deepening the analysis layer by layer to ultimately generate a standardized feature vector output. Specifically, after obtaining the query result set, the first layer of basic attribute analysis is performed. This layer traverses all fields in the query result set, statistically analyzes the data type (i.e., the type of data stored in the field, such as numeric, string, or date types), calculates the non-empty rate (the proportion of non-empty values to the total number of records) and the deduplication count (the number of unique values) for each field, and simultaneously identifies the business meaning of the field (i.e., the semantic reference of the field in the business context), laying the foundation for subsequent feature analysis. The second layer of feature relationship analysis (also known as analyzing relationships between fields) then proceeds to the third layer. This layer performs in-depth mining based on the basic attributes of the first layer. It detects time-series features (e.g., whether it contains date or datetime type fields and the data is arranged in ascending or descending order of time), proportion features (e.g., whether there are aggregation calculations such as sum or count and the sum has business meaning, such as sales revenue percentage), ranking features (e.g., whether there are ranking functions such as rank or row_number and the data has magnitude differences, such as Top 10 ranking), and comparison features (e.g., whether there are multiple time periods or classification dimensions that require comparative analysis). This process identifies multidimensional relationship patterns in the data. Finally, the third layer, comprehensive scoring, encapsulates the analysis results of the first two layers into a structured feature vector. This vector includes Boolean features such as has_time_series (time series identifier), has_ratio (proportion identifier), has_rank (rank identifier), and has_comparison (comparison identifier), as well as counting features such as field_count (number of fields) and record_count (number of records), forming a standardized data feature representation. After feature identification, this feature vector is returned to the chart selection module for subsequent rule matching and multi-objective optimization decisions, achieving automated conversion from raw data to structured feature vectors.
[0033] In some optional embodiments, null value rate detection metrics, sparsity detection metrics, and outlier detection metrics are calculated based on basic feature identifiers, including: Extract the number of records from the basic feature identifiers, traverse the query result set to count the number of missing values in each field, calculate the ratio between the number of missing values and the number of records, and obtain the null value rate detection index. Extract date / time type fields from the query result set, traverse the data records in chronological order, and calculate the ratio of non-empty rows to the total number of rows to obtain the sparsity detection index; Numerical fields are extracted from the query results set, the interquartile range is used to determine the outlier detection interval, the data records are traversed to identify outliers that exceed the detection interval, and the ratio of the number of outliers to the total number of records is calculated to obtain the outlier detection index.
[0034] Specifically, calculating multidimensional quality detection indicators based on basic feature identifiers and query result sets refers to the system quantitatively evaluating data integrity, timeliness continuity, and numerical anomalies in a hierarchical and progressive manner, thereby constructing a comprehensive data quality measurement system.
[0035] The specific implementation process of this scheme includes: First, extracting the record count, i.e., the total number of rows in the query result set, from the basic feature identifiers, as the normalization benchmark for subsequent calculations. Then, traversing the query result set to count the number of missing values for each field, i.e., the number of records with null or empty values in that field. Calculating the ratio of the number of missing values to the number of records yields the null value rate detection index. This index ranges from 0 to 1; the closer to 1, the more severe the data missingness, used to identify field integrity defects. Second, extracting date or time type fields from the query result set, i.e., fields with data types datetime, date, or timestamp. Traversing the data records in chronological order to count the number of non-empty rows, i.e., the number of records with non-empty values in that time field. Calculating the ratio of the number of non-empty rows to the total number of rows yields the sparsity detection index, i.e., the time continuity density. This index ranges from 0 to 1; the closer to 1, the better the time continuity, used to identify large blank spaces or sampling gaps in time series data. Finally, numeric fields (integers or floating-point numbers) are extracted from the query results. The interquartile range (IMR) is used to determine the outlier detection interval. IMR is a statistical method based on data distribution. First, the first quartile (25th percentile) and the third quartile (75th percentile) are calculated; the difference between them is the IMR. The first quartile minus 1.5 times the IMR is used as the lower limit, and the third quartile plus 1.5 times the IMR is used as the upper limit to form the outlier detection interval. Data records are traversed to identify outliers exceeding this interval (excessively large or small extreme values). The ratio of the number of outliers to the total number of records is used to obtain the outlier detection index. This index ranges from 0 to 1; a value closer to 1 indicates a higher proportion of outliers, used to identify data pollution or collection errors in numeric fields. Through the calculation of these three quality detection indicators, a comprehensive quantitative assessment of data quality is achieved, providing data support for subsequent quality scoring calculations and chart degradation strategies.
[0036] In this way, by extracting the number of records from the basic feature identifiers and traversing the query result set to count the number of missing values in each field, a null value rate detection index is calculated, achieving a quantitative assessment of data integrity and enabling accurate identification of the degree of missing values at the field level. Secondly, by extracting date or time type fields from the query result set and traversing them chronologically to count the ratio of non-empty rows to the total number of rows, a sparsity detection index is obtained, achieving a measurement of the continuity of time-series data and effectively identifying timeliness issues such as large gaps in time or sampling discontinuities. Finally, by extracting numerical fields from the query result set and using the interquartile range method to determine the outlier judgment interval, and traversing to identify outliers exceeding the judgment interval, an outlier detection index is calculated, achieving statistical detection of extreme values in the numerical distribution and thus identifying numerical anomalies caused by data contamination or collection errors. These three dimensions of quality detection indicators comprehensively quantify data quality from the perspectives of completeness, timeliness, and accuracy, providing refined data support for subsequent quality score calculations and chart degradation strategies based on quality scores, significantly improving the adaptability and robustness of visual recommendations to data quality fluctuations.
[0037] In some optional embodiments, a quality score is obtained based on a null value rate detection metric, a sparsity detection metric, and an outlier detection metric, including: Calculate the first difference between the preset value and the null value rate detection index, and multiply the first difference by the first preset weight coefficient to obtain the first calculation result; The product of the sparsity detection index and the second preset weighting coefficient is calculated to obtain the second calculation result; Calculate the second difference between the preset value and the outlier detection index, and multiply the second difference by the third preset weight coefficient to obtain the third calculation result; The quality score is obtained by summing the first, second, and third calculation results.
[0038] Specifically, the quality score calculation based on multi-dimensional quality detection indicators in this technical solution refers to the differentiated weighting and fusion of detection indicators of three dimensions—null value rate, sparsity, and outliers—through preset weight coefficients to generate a comprehensive quantitative score for data quality.
[0039] The specific implementation process of this scheme includes: First, calculating the first difference between a preset value and the null value detection index. The preset value is usually 1. The first difference represents the non-null rate of the data, i.e., the degree of data integrity. Then, multiplying the first difference by a first preset weight coefficient yields the first calculation result. The first preset weight coefficient is used to adjust the importance ratio of data integrity in the overall quality score. Second, directly calculating the product of the sparsity detection index and the second preset weight coefficient yields the second calculation result. Since the sparsity detection index is already a positive indicator, i.e., the closer the value is to 1, the better the temporal continuity, so no difference conversion is needed. The second preset weight coefficient is used to adjust the importance ratio of temporal continuity in the overall quality score. Third, calculating the second difference between the preset value and the outlier detection index. The second difference represents the proportion of normal values in the data, i.e., the purity. Then, multiplying the second difference by a third preset weight coefficient yields the third calculation result. The third preset weight coefficient is used to adjust the importance ratio of data purity in the overall quality score. Finally, the first, second, and third calculation results are summed to obtain a quality score ranging from 0 to 1. The closer the score is to 1, the higher the overall quality of the data. The closer the score is to 0, the more serious the missing, gap, or anomaly problems in the data. This achieves the fusion and quantification of quality detection from multiple dimensions to a single quality score, providing a simple and comprehensive decision-making basis for subsequent chart degradation strategies.
[0040] In this way, by calculating the first difference between the preset value and the missing value rate detection index and multiplying it by the first preset weighting coefficient, the first calculation result is obtained. This achieves the positive vectorization of data missingness into integrity score, so that the lower the missing value rate, the higher the contribution score. Secondly, by directly multiplying the sparsity detection index by the second preset weighting coefficient, the second calculation result is obtained. This achieves the direct weighting of time continuity score, so that the continuity of time series data can be linearly reflected in the quality score. Finally, by calculating the second difference between the preset value and the outlier detection index and multiplying it by the third preset weighting coefficient, the third calculation result is obtained. This achieves the positive vectorization of outlier ratio into data purity score, so that the fewer outliers, the higher the contribution score. Finally, the three calculation results are summed to obtain the quality score. This achieves differentiated weighted integration of the three dimensions of integrity, continuity, and purity. The importance of each dimension can be flexibly adjusted through preset weighting coefficients. This avoids the one-sidedness of single-indicator evaluation and solves the complexity of multi-indicator decision-making. It provides a simple, interpretable, and configurable single quantitative standard for subsequent chart degradation strategies based on quality scores.
[0041] In some optional embodiments, a candidate chart set is obtained by matching the feature identifiers in the data feature vector with the rule conditions in a preset decision rule base, including: Feature identifiers are extracted from the data feature vectors. These feature identifiers include time series feature identifiers, percentage feature identifiers, sorting feature identifiers, comparison feature identifiers, geographic location feature identifiers, relationship network feature identifiers, numerical distribution feature identifiers, number of fields, and number of indicators. The feature identifier is compared with the corresponding rule conditions in the preset decision rule base. When the feature identifier meets the rule triggering conditions, the corresponding chart type is included in the candidate chart set.
[0042] Specifically, firstly, various feature identifiers are extracted from the data feature vector. Time series feature identifiers refer to Boolean identifiers indicating whether the data contains date and time fields and is arranged in chronological order. Proportion feature identifiers refer to Boolean identifiers indicating whether the data presents a part-to-whole composition relationship. Ranking feature identifiers refer to Boolean identifiers indicating whether the data has a clear ranking meaning according to a certain dimension. Comparison feature identifiers refer to Boolean identifiers indicating whether the data requires multi-dimensional comparative analysis. Geographic location feature identifiers refer to Boolean identifiers indicating whether the data contains geospatial information. Relationship network feature identifiers refer to Boolean identifiers indicating whether the data presents a relationship between nodes. Numerical distribution feature identifiers refer to Boolean identifiers indicating whether the data is a continuous numerical distribution. Field quantity refers to the total number of fields contained in the query result set. Indicator quantity refers to the number of numerical measurement fields in the query result set. These feature identifiers together constitute a multi-dimensional feature description of the data. Subsequently, the aforementioned feature identifiers are compared one by one with the corresponding rule conditions in the preset decision rule base. The preset decision rule base refers to a predefined knowledge base containing multiple rules and their triggering conditions. Each rule specifies the recommended chart type corresponding to a specific combination of features. The rule triggering condition refers to the combination of feature identifiers and limiting conditions that the rule must meet to take effect. When a feature identifier meets the rule triggering condition, the corresponding chart type is included in the candidate chart set. For example, when the time series feature identifier is true and the number of indicators is a single indicator, the triggering condition of the line chart rule is met, and the line chart and area chart are included in the candidate chart set. Finally, all chart types corresponding to rules that meet the triggering conditions are summarized and deduplicated to form a candidate chart set for subsequent multi-objective optimization selection, realizing the rule-based mapping from abstract data features to specific chart types.
[0043] In this way, by extracting multi-dimensional feature identifiers covering time series, proportion, ranking, comparison, geographic location, relationship network, and numerical distribution, as well as scale indicators such as the number of fields and indicators, from the data feature vector, a comprehensive and structured description of data features is achieved, breaking through the limitation of traditional visualization tools that rely solely on single data type judgments. By comparing the above feature identifiers one by one with the corresponding rule conditions in the preset decision rule base, a precise mapping from data features to chart types is achieved, ensuring that the triggering of each rule is based on a clear combination of features, thus ensuring the interpretability of the business logic of chart recommendation. When a feature identifier meets the rule triggering condition, the corresponding chart type is included in the candidate chart set, realizing the automated transformation from abstract data features to specific visualization solutions. This avoids the subjectivity and experience dependence of manual chart selection, significantly improving the targeting and efficiency of chart recommendation, while providing a candidate space under rule constraints for subsequent multi-objective weighted optimization, achieving an organic balance between interpretability and flexibility.
[0044] In some optional embodiments, the feature identifier is compared with the corresponding rule conditions in a preset decision rule base. When the feature identifier meets the rule triggering condition, the corresponding chart type is included in the candidate chart set, including: When the time series feature is true and the number of indicators is a single indicator, the line chart and area chart are included in the candidate chart set; when the time series feature is true and the number of indicators is multiple, the multi-line chart and stacked area chart are included in the candidate chart set. When the percentage feature is true, pie charts and donut charts are included in the candidate chart set; When the ranking feature is true, both the horizontal and vertical bar charts are included in the candidate chart set. When the comparison feature is true and the number of dimensions is within the preset range, the grouped bar chart and heat map will be included in the candidate chart set. When the geographic location feature is true, the map visualization is included in the candidate chart set; When the relation network feature is true, the relation graph and Sankey diagram are included in the candidate graph set; When the numerical distribution characteristic is true, histograms and box plots are included in the candidate chart set; When the number of fields exceeds the preset threshold or the dimensional complexity exceeds the limit, the table display will be included in the candidate chart set. Summarize all chart types corresponding to matching rules, remove duplicates, and form a candidate chart set.
[0045] Specifically, constructing a candidate chart set based on multi-dimensional feature identification and rule-based condition matching refers to achieving a precise many-to-many mapping between data features and chart types through refined rule-triggered logic. The specific implementation process of this scheme includes: for cases where the time series feature identification is true (i.e., the data contains a time dimension), further subdivision is made based on the number of indicators. When the number of indicators is single (i.e., only one numerical metric field), line charts and area charts are included in the candidate chart set. Line charts display trend changes by connecting data values at various time points, while area charts fill the area between the line and the coordinate axis to emphasize the cumulative effect. When the number of indicators is multi-indicator (i.e., multiple numerical metric fields exist), multi-line charts and stacked area charts are included in the candidate chart set. Multi-line charts display the trend comparison of multiple indicators through multiple lines of different colors or line types, while stacked area charts display the composition and cumulative changes of multiple indicators through layered filling. For cases where the proportion feature is true, indicating a relationship between parts and the whole, pie charts and donut charts are included in the candidate chart set. Pie charts use sector areas to represent the proportion of each part, while donut charts are created by hollowing out the center of a pie chart to support center labeling or nested display. For cases where the ranking feature is true, indicating that the data has a clear ranking meaning according to a certain dimension, horizontal bar charts and vertical bar charts are included in the candidate chart set. Horizontal bar charts are suitable for scenarios with long category labels, while vertical bar charts are suitable for scenarios emphasizing numerical values. For cases where the comparison feature is true and the number of dimensions is within a preset range, meaning there are 2 to 3 classification dimensions that need to be compared and analyzed, grouped bar charts and heatmaps are included in the candidate chart set. Grouped bar charts use parallel or stacked groups of bars to show multi-dimensional comparisons, while heatmaps use a color depth matrix to show the numerical distribution of two-dimensional cross dimensions. For cases where the geographic location feature is true, indicating that the data contains geospatial information, map visualization is included in the candidate chart set, displaying regional distribution or heatmaps through geographic coordinate mapping. For cases where the relationship network feature is true, indicating relationships between nodes, relationship graphs and Sankey diagrams are included in the candidate chart set. Relationship graphs show connections between entities through node connections, while Sankey diagrams show the transfer paths of energy or flow through flow width. For cases where the numerical distribution feature is true, indicating continuous numerical distribution, histograms and box plots are included in the candidate chart set. Histograms show the central tendency of values through frequency distribution, while box plots show the numerical distribution and anomalies through quartiles. For cases where the number of fields exceeds a preset threshold or the dimensional complexity exceeds the limit, indicating overly complex data structures, tabular displays are included in the candidate chart set to retain fine-grained information. Finally, all chart types corresponding to matching rules are summarized, and duplicates are removed to form a candidate chart set covering multiple visualization formats, providing a rich decision-making space for subsequent multi-objective optimization.
[0046] See Figure 4 , Figure 4This is a flowchart illustrating the process of determining the optimal chart in this embodiment. The process starts with a data feature vector input, generates a candidate chart set through multi-level conditional judgments, and then selects the optimal chart. The process includes: determining whether the `has_time_series` time series feature identifier is true; if true, further determining whether the `field_count` field count is equal to 1; if true, recommending line charts and area charts; if false, recommending multi-line charts and stacked area charts; if the time series feature identifier is false, proceeding to the `has_ratio` proportion feature identifier judgment; if true, recommending pie charts and donut charts; if the proportion feature identifier is false, proceeding to the `has_rank` sorting feature identifier judgment; if true, recommending horizontal bar charts; if the sorting feature identifier is false, proceeding to the judgment that `field_count` is greater than 5; if true, recommending table display; if false, recommending grouped bar charts. The recommendation results from the above branches are aggregated to form multiple candidate chart sets. Then, a multi-objective optimization and ranking process is entered. The candidate charts are scored and ranked by comprehensively considering the data volume, user historical preferences, and industry best practices. The TOP1 with the highest comprehensive score is selected as the optimal chart, and the recommended chart result is finally returned, realizing a complete closed loop from feature recognition to intelligent decision-making.
[0047] In this way, by including line charts and area charts in the candidate chart set when the time series feature identifier is true and the number of indicators is single, and by including multi-line charts and stacked area charts in the candidate chart set when the time series feature identifier is true and the number of indicators is multiple, a refined distinction is achieved in the display format of time-dimensional data, enabling differentiated visualization solutions to match single-indicator trends and multi-indicator comparisons. By including pie charts and donut charts in the candidate chart set when the percentage feature identifier is true, including horizontal bar charts and vertical bar charts in the candidate chart set when the ranking feature identifier is true, and including grouped bar charts and heatmaps in the candidate chart set when the comparison feature identifier is true and the number of dimensions is within a preset range, precise chart mapping for different analytical intentions such as percentage composition, ranking comparison, and multi-dimensional comparison is achieved. By including map visualizations in the candidate chart set when geographic location features are true, relationship graphs and Sankey diagrams in the candidate chart set when relationship network features are true, and histograms and box plots in the candidate chart set when numerical distribution features are true, specialized display support for special data types such as geospatial data, network relationships, and numerical distributions is achieved. By including table displays in the candidate chart set when the number of fields exceeds a preset threshold or the dimensional complexity exceeds the limit, a fallback display guarantee for complex data structures is provided. Finally, all chart types corresponding to matching rules are aggregated and deduplicated to form the candidate chart set, expanding from single-feature to multiple chart candidates. This ensures both the diversity and relevance of the recommendation results and provides ample decision space for subsequent multi-objective weighted optimization, significantly improving the coverage and flexibility of chart recommendations.
[0048] In some optional embodiments, a multi-objective weighted scoring mechanism is used to select the optimal chart from the candidate chart set, including: For each candidate chart in the candidate chart set, a rule matching score is calculated based on the degree of matching between the data feature vector and the corresponding triggering rule; The quality fit score is determined based on the preset range in which the quality score falls. Determine the user's historical preference score based on the user's historical acceptance frequency of each chart type; The rule matching score, quality adaptation score, and user historical preference score are multiplied by preset weight coefficients and then summed to obtain the comprehensive score; The candidate chart with the highest overall score is selected as the optimal chart.
[0049] Specifically, selecting the optimal chart from the candidate chart set using a multi-objective weighted scoring mechanism means making a scientific decision on chart selection through a comprehensive evaluation of three dimensions: rule fit, quality suitability, and user preference.
[0050] The specific implementation process of this scheme includes: First, calculating a rule matching score for each candidate chart in the candidate chart set. The rule matching score is a quantitative score of the degree of matching between the data feature vector and the corresponding triggering rule of the candidate chart. When the feature identifier fully meets the rule triggering conditions, a base score is assigned; when it partially meets the conditions, the score is adjusted according to the matching ratio; and when it does not meet the conditions, a score of zero is assigned. This score ensures that the recommendation results conform to the business logic of the data features. Second, determining the quality adaptation score based on the preset range of the quality score. The quality score refers to the comprehensive data quality score calculated above, ranging from 0 to 1. The preset range refers to the pre-defined quality level threshold range. When the quality score is in the high-level range, a full score is assigned, indicating that no downgrading is required; when it is in the medium-level range, a discounted score is assigned, indicating that a downgrading strategy needs to be triggered; and when it is in the low-level range, a low score or the lowest score is assigned, indicating that a forced downgrading is required. This score ensures the adaptive matching between chart selection and data quality status. The system further determines the user's historical preference score based on the user's historical acceptance frequency for each chart type. Historical acceptance frequency refers to the user's past behavior regarding the selection, acceptance, and export of specific chart types, obtained by querying the preference weight matrix in the user profile. Bonus points are awarded when the historical acceptance rate exceeds a preset threshold, and deduction points are awarded when there is frequent switching to other chart types. This scoring ensures personalized adaptation of the recommendation results. Subsequently, the system multiplies the rule matching score, quality adaptation score, and user historical preference score by the fourth, fifth, and sixth preset weight coefficients, respectively, and then sums them to obtain a comprehensive score. The preset weight coefficients are pre-defined parameters indicating the importance ratio of each scoring dimension, which can be flexibly adjusted according to business scenarios. A higher comprehensive score indicates that the candidate chart performs better in terms of rule matching, quality adaptation, and user preference. Finally, the candidate chart with the highest comprehensive score is selected as the optimal chart, while several candidate charts with the second-highest scores are retained as alternatives for users to switch between. This achieves a fusion of multi-dimensional evaluation and single optimal decision-making, significantly improving the accuracy, robustness, and personalization of chart recommendations.
[0051] In this way, by calculating the rule matching score for each candidate chart in the candidate chart set based on the degree of matching between the data feature vector and the corresponding triggering rule, a deep fit between chart recommendation and data feature business logic is achieved, ensuring the interpretability and rationality of the recommendation results. Secondly, by determining the quality adaptation score based on the preset interval of the quality score, dynamic adaptation between chart selection and data quality status is achieved, enabling low-quality data to automatically trigger degradation strategies to avoid generating distorted visualizations. Finally, by determining the user's historical preference score based on the user's historical acceptance frequency for each chart type, personalized matching between recommendation results and user habits is achieved, improving user acceptance and satisfaction. By multiplying the rule matching score, quality adaptation score, and user historical preference score by preset weight coefficients and then summing them to obtain a comprehensive score, differentiated weighted fusion of the three dimensions is achieved, allowing the importance of each dimension to be flexibly adjusted according to business scenarios. Finally, the candidate chart with the highest comprehensive score is selected as the optimal chart, achieving a scientific convergence from multi-dimensional evaluation to a single optimal decision, significantly improving the accuracy, robustness, and personalization level of chart recommendation.
[0052] In some optional embodiments, the natural language input by the user is parsed, and a structured query language corresponding to the natural language is generated based on the parsing results, including: It receives natural language input from users, performs intent parsing through a large language model, identifies query targets, time ranges, aggregation dimensions, and filtering conditions, and obtains a set of business terms. Based on the set of business terms, query the metadata information in the data dictionary, map the business terms to database physical objects, and obtain the mapping results; Structured Query Language statements are generated based on the mapping results.
[0053] Specifically, receiving natural language and generating structured query language by parsing intent through a large language model refers to achieving end-to-end automated conversion from unstructured input to structured database queries through the deep integration of semantic understanding and metadata mapping.
[0054] The specific implementation process of this solution includes: first, receiving natural language input from the user, where natural language refers to unstructured text expressions used by humans in daily life, such as "sales rankings of various regions in the last 30 days"; then, performing intent parsing through a large language model, where a large language model refers to an artificial intelligence model with deep semantic understanding capabilities, such as the GPT series; intent parsing refers to the process of converting natural language into structured semantic elements, identifying the query target, i.e., the data indicators that the user wants to obtain, such as sales figures; the time range, i.e., the time-limited conditions of the data, such as the last 30 days; the aggregation dimension, i.e. the grouping and statistical dimensions of the data, such as grouping by region; and the filtering conditions, i.e., the data filtering restrictions, such as only viewing valid orders; and obtaining a set of business terms, i.e., a set of business-level expressions containing the above elements. Then, based on the set of business terms, the metadata information in the data dictionary is queried. The data dictionary is a structured knowledge base maintained by the system that contains metadata such as database table names, field names, field types, and field business meanings. Metadata information refers to the mapping relationship between the physical structure of the database and business semantics, describing the data. This mapping of business terms to physical database objects establishes correspondences such as "sales amount" with the "orders.amount" field, "region" with the "customers.region" field, and "last 30 days" with the condition "date>= CURDATE()-30". The resulting mapping is a structured mapping set containing physical table names, field names, and filtering conditions. Finally, a Structured Query Language (SQL) statement is generated based on the mapping result. SQL is a standard programming language used to manage and manipulate relational databases. The generated statement includes clauses such as SELECT (select fields), FROM (source table), WHERE (filter conditions), GROUP BY (grouping fields), and ORDER BY (sorting method). This achieves automated translation from natural language to database query language, allowing non-technical users to complete data queries without needing to master SQL syntax.
[0055] In this way, by receiving natural language input from users and parsing the intent through a large language model, a set of business terms is obtained by identifying the query target, time range, aggregation dimension, and filtering conditions. This achieves deep semantic understanding of unstructured user input, breaking through the technical barrier of traditional database interaction that relies on manually written query statements. Secondly, by querying metadata information in the data dictionary based on the business term set, the business terms are mapped to physical objects in the database, establishing a precise bridge between business semantics and physical storage, eliminating the semantic gap between natural language expression and database structure. By generating structured query language statements based on the mapping results, the automatic conversion from business intent to executable database queries is achieved. This allows non-technical users to complete complex data queries without needing to master structured query language syntax, significantly lowering the technical threshold for data analysis, improving the efficiency and convenience of data acquisition, and achieving seamless integration between natural language and database systems.
[0056] In some optional embodiments, after obtaining the corresponding query result set from the database using Structured Query Language, the method further includes: Obtain the new conditions added by the user, compare the new conditions with the historical structured query language, and identify the change type; When the change type is conditional append, retrieve the historical query results from the cached result set, perform memory filtering on the historical query results, and obtain the updated query results; When the change type is a dimension change or indicator change, the structured query language is re-executed to query the database, obtain the updated query results, and update the cache database with the updated query results.
[0057] Specifically, this solution, based on multi-turn dialogue differential analysis and caching optimization, refers to achieving differentiated optimization of query efficiency by identifying the types of changes in user-added conditions. The specific implementation process includes: first, obtaining the new conditions added by the user, which refers to query limitations added by the user in the multi-turn dialogue, such as "only view Beijing area" or "add comparison with the same period last year"; comparing the new conditions with historical structured query language, which refers to the SQL statements generated in the previous round of dialogue; identifying the change type, i.e., determining the nature of the impact of the added conditions on the query statement; change types include condition addition type (only the WHERE clause adds filtering conditions), dimension change type (the GROUP BY grouping field changes), and indicator change type (the SELECT selected field changes). When the change type is conditional appending, historical query results are retrieved from the cached result set. The cached result set refers to the data results stored in the LRU cache pool from the previous round of queries. LRU, or Least Recently Used, is a cache eviction strategy. In-memory filtering is performed on the historical query results, meaning the data is filtered directly in memory for the new conditions without accessing the database, resulting in updated query results. This method compresses the response time from seconds for database queries to milliseconds for in-memory computation. When the change type is dimension or metric changing, the Structured Query Language (SCL) query is re-executed to query the database, generating a new SQL statement and sending it to the data source for execution, resulting in updated query results. These updated results are then updated in the cache database, replacing or supplementing the corresponding entries in the LRU cache pool, ensuring that subsequent queries can reuse the latest results. This optimizes query efficiency in multi-turn dialogue scenarios. Conditional appending changes avoid duplicate database queries through in-memory filtering, while dimension or metric changes ensure result accuracy by re-querying and updating the cache, significantly improving the response speed and user experience of interactive data analysis.
[0058] In this way, by acquiring new conditions added by the user and comparing them with historical structured query language data to identify the change type, accurate perception and classification of changes in user intent are achieved. When the change type is condition appending, the updated query result is obtained by retrieving historical query results from the cached result set and performing memory filtering on the historical query results. This avoids the performance overhead of repeatedly querying the database, compressing the response time of multi-turn follow-up queries from seconds to milliseconds, significantly improving the real-time performance of interactive data analysis. When the change type is dimension change or indicator change, the database is queried again using structured query language, and the updated query result is updated to the cached database. This ensures the accuracy of results when the granularity of data aggregation or indicator selection changes, while the cache update mechanism ensures the reuse efficiency of subsequent queries. This technical solution achieves a balance between query efficiency and result accuracy through differentiated change handling strategies. It not only meets the interactive habits of users who need to gradually refine their analysis needs, but also significantly reduces system load through cache optimization, improving the overall performance and user experience in multi-turn dialogue scenarios.
[0059] In some optional embodiments, the method further includes: Return data results, optimal chart type and chart configuration parameters to the front end. The front end uses a structure layer / data layer separation architecture to dynamically render the chart and automatically configures the visualization parameters according to the data characteristics. When a user adds conditions that trigger a chart update and the chart type remains unchanged, only the data layer is refreshed while the structure layer is preserved.
[0060] Specifically, the system first returns the data results to the front end, namely the structured dataset obtained from the query, the optimal chart type (the optimal chart selected through multi-objective weighted scoring), and chart configuration parameters (visual attribute settings such as axis range, color scheme, and legend position). The front end refers to the web or app interface through which users directly interact. Then, the front end uses a structure / data layer separation architecture to dynamically render the chart. This architecture divides chart elements into static and dynamic layers. The structure layer refers to static visual elements that do not change with the data, such as axes, legends, and titles. The data layer refers to dynamic visual elements that change with the data, such as data points, bars, and lines. Dynamic rendering refers to the process of generating a visual chart based on real-time data. Simultaneously, the system automatically configures visualization parameters based on data characteristics. Data characteristics refer to information such as the number of fields, the number of records, and the numerical range contained in the data feature vector. Visualization parameters refer to visual attributes automatically calculated based on data characteristics, such as adjusting bar width according to the data volume, adjusting the pie chart center radius according to the number of categories, and adjusting the axis range according to the numerical range. When a user adds conditions that trigger a chart update, and the chart type remains unchanged, only the data layer is refreshed while the structure layer is preserved. This means only dynamic elements such as data points, bars, and lines are updated, while static elements such as axes, legends, and titles remain unchanged. A smooth animation transition presents the data change trajectory, allowing users to intuitively perceive which data has changed due to the added conditions. This technical solution avoids the performance overhead of a full redraw by separating the structure layer and data layer, and improves the continuity of the visual experience through partial refresh and animation transitions. It achieves an experience upgrade in multi-turn dialogue scenarios, moving from a full redraw to partial gradual changes in chart response.
[0061] In this way, by returning data results, optimal chart type, and chart configuration parameters to the front end, efficient collaboration between backend intelligent decision-making and frontend rendering is achieved, enabling the front end to quickly generate visualizations based on structured data and optimized configurations. By using a structure / data layer separation architecture for dynamic chart rendering on the front end, static structure layer elements are decoupled from dynamic data layer elements, avoiding the performance overhead and visual flickering caused by traditional full redraws. By automatically configuring visualization parameters based on data characteristics, dynamic adaptation of chart visual attributes to data scale and distribution characteristics is achieved, ensuring clear readability at any data volume. When a user adds conditions to trigger a chart update without changing the chart type, only the data layer is refreshed while the structure layer is preserved. Data changes are presented through partial updates and smooth animation transitions, allowing users to intuitively perceive the dynamic evolution of data caused by added conditions. This significantly improves the smoothness of interaction and visual coherence in multi-turn dialogue scenarios, achieving an experience upgrade from full redraws to partial gradients in chart responses.
[0062] In some optional embodiments, the method further includes: when it is identified that a user's natural language query implies multiple independent analysis dimensions, automatically decomposing the query intent into multiple sub-analysis objectives; determining the chart type of each sub-view according to the dimension type: time dimension corresponds to line chart, geographic dimension corresponds to map, category dimension corresponds to pie chart, and sorting dimension corresponds to horizontal bar chart; generating a multi-view grid layout configuration and returning it to the front end, with all sub-views sharing the same basic dataset and performing aggregation calculations on different dimensions; establishing a shared filter state object filter_state, with the back end listening for state changes through a publish-subscribe mechanism: when receiving a user click data point event or natural language linkage command, parsing the dimension constraint conditions and updating filter_state, driving all views to refresh synchronously; the linkage refresh process is completed by the back end reusing cached results in memory, and the front end receives the updated data and renders it.
[0063] For a better overall understanding of the technical solution of this application, please refer to [link / reference]. Figure 5 , Figure 5This is a schematic diagram of the overall process of AI-based database query and automatic dynamic chart generation in this embodiment. The flowchart is divided into three parts: AI assistant backend service, third-party service, and frontend interface. First, the user enters a natural language query in the input box of the Web or App frontend interface. The frontend sends the request to the natural language understanding module of the AI assistant backend service. This module parses the user's request through intent recognition and calls the LLM API (Large Language Model Application Programming Interface) of the third-party service to perform text understanding and SQL (Structured Query Language) generation, generating the corresponding SQL query statement. Subsequently, the database query execution module receives the SQL query, establishes a connection with the database (such as MySQL, PostgreSQL, etc.) in the third-party service through connection management, executes the SQL, and stores the query results in the result cache. The query results are sent to the data feature recognition module for core processing. This module sequentially performs structural feature recognition, distribution feature recognition, and quality assessment to generate feature analysis results. Next, the chart selection module performs rule base matching, multi-objective optimization, and candidate ranking based on the feature analysis results to determine the optimal chart configuration. The visualization rendering module dynamically configures parameters and enhances interactivity based on the chart configuration, generating rendering commands that are sent to the chart rendering component on the front-end interface. The front-end interface continuously interacts with the user through dialogue, allowing users to trigger multiple rounds of dialogue. Differential analysis is used to determine the type of change; for conditional appending changes, memory filtering is performed directly on the cached results; for changes in dimensions or metrics, the cache is re-queried and updated, ultimately forming an end-to-end closed loop from natural language input to dynamic chart output.
[0064] The following describes an apparatus embodiment of this application, which can be used to execute the AI-based chart generation method in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the AI-based chart generation method described above.
[0065] This disclosure also provides an artificial intelligence-based chart generation device 600, such as... Figure 6 As shown, it includes: The input module 601 is used to parse the natural language input by the user and generate a structured query language corresponding to the natural language based on the parsing results; Execution module 602 is used to execute Structured Query Language to obtain the corresponding query result set from the database; The traversal module 603 is used to traverse the query result set, count the basic attributes of each field in the query result set and analyze the relationship between fields, and perform data quality assessment on the data of each field in the query result set to generate a data feature vector containing quality scores. The matching module 604 is used to match the feature identifiers in the data feature vector with the rule conditions in the preset decision rule base to obtain a set of candidate charts, and to select the optimal chart from the set of candidate charts using a multi-objective weighted scoring mechanism.
[0066] In some optional embodiments, the traversal module 603 traverses the query result set, statistically analyzes the basic attributes of each field in the query result set and the relationships between fields, and performs data quality assessment on the data of each field in the query result set, generating a data feature vector containing quality scores, including: Traverse the query result set, count the basic attributes of each field, analyze the relationship between fields, and generate basic feature identifiers. The basic attributes of each field include data type, non-empty rate, number of duplicates, and numerical range. The relationships between fields include time sorting relationship, proportion relationship, and classification dimension relationship. The empty value rate detection index, sparsity detection index, and outlier detection index are calculated based on basic feature identifiers. A quality score is obtained based on the null value rate detection index, sparsity detection index, and outlier detection index. The quality score is fused with the basic feature identifier as an additional dimension to form a data feature vector containing the quality score.
[0067] In some optional embodiments, the traversal module 603 calculates null value rate detection metrics, sparsity detection metrics, and outlier detection metrics based on basic feature identifiers, including: Extract the number of records from the basic feature identifiers, traverse the query result set to count the number of missing values in each field, calculate the ratio between the number of missing values and the number of records, and obtain the null value rate detection index. Extract date / time type fields from the query result set, traverse the data records in chronological order, and calculate the ratio of non-empty rows to the total number of rows to obtain the sparsity detection index; Numerical fields are extracted from the query results set, the interquartile range is used to determine the outlier detection interval, the data records are traversed to identify outliers that exceed the detection interval, and the ratio of the number of outliers to the total number of records is calculated to obtain the outlier detection index.
[0068] In some optional embodiments, the traversal module 603 obtains a quality score based on the null value detection index, the sparsity detection index, and the outlier detection index, including: Calculate the first difference between the preset value and the null value rate detection index, and multiply the first difference by the first preset weight coefficient to obtain the first calculation result; The product of the sparsity detection index and the second preset weighting coefficient is calculated to obtain the second calculation result; Calculate the second difference between the preset value and the outlier detection index, and multiply the second difference by the third preset weight coefficient to obtain the third calculation result; The quality score is obtained by summing the first, second, and third calculation results.
[0069] In some optional embodiments, the matching module 604 matches the feature identifiers in the data feature vector with the rule conditions in the preset decision rule base to obtain a candidate chart set, including: Feature identifiers are extracted from the data feature vectors. These feature identifiers include time series feature identifiers, percentage feature identifiers, sorting feature identifiers, comparison feature identifiers, geographic location feature identifiers, relationship network feature identifiers, numerical distribution feature identifiers, number of fields, and number of indicators. The feature identifier is compared with the corresponding rule conditions in the preset decision rule base. When the feature identifier meets the rule triggering conditions, the corresponding chart type is included in the candidate chart set.
[0070] In some optional embodiments, the matching module 604 compares the feature identifier with the corresponding rule conditions in the preset decision rule base. When the feature identifier meets the rule triggering condition, the corresponding chart type is included in the candidate chart set, including: When the time series feature is true and the number of indicators is a single indicator, the line chart and area chart are included in the candidate chart set; when the time series feature is true and the number of indicators is multiple, the multi-line chart and stacked area chart are included in the candidate chart set. When the percentage feature is true, pie charts and donut charts are included in the candidate chart set; When the ranking feature is true, both the horizontal and vertical bar charts are included in the candidate chart set. When the comparison feature is true and the number of dimensions is within the preset range, the grouped bar chart and heat map will be included in the candidate chart set. When the geographic location feature is true, the map visualization is included in the candidate chart set; When the relation network feature is true, the relation graph and Sankey diagram are included in the candidate graph set; When the numerical distribution characteristic is true, histograms and box plots are included in the candidate chart set; When the number of fields exceeds the preset threshold or the dimensional complexity exceeds the limit, the table display will be included in the candidate chart set. Summarize all chart types corresponding to matching rules, remove duplicates, and form a candidate chart set.
[0071] In some optional embodiments, the matching module 604 employs a multi-objective weighted scoring mechanism to select the optimal chart from the candidate chart set, including: For each candidate chart in the candidate chart set, a rule matching score is calculated based on the degree of matching between the data feature vector and the corresponding triggering rule; The quality fit score is determined based on the preset range in which the quality score falls. Determine the user's historical preference score based on the user's historical acceptance frequency of each chart type; The rule matching score, quality adaptation score, and user historical preference score are multiplied by preset weight coefficients and then summed to obtain the comprehensive score; The candidate chart with the highest overall score is selected as the optimal chart.
[0072] In some optional embodiments, the input module 601 parses the natural language input by the user and generates a structured query language corresponding to the natural language based on the parsing result, including: It receives natural language input from users, performs intent parsing through a large language model, identifies query targets, time ranges, aggregation dimensions, and filtering conditions, and obtains a set of business terms. Based on the set of business terms, query the metadata information in the data dictionary, map the business terms to database physical objects, and obtain the mapping results; Structured Query Language statements are generated based on the mapping results.
[0073] In some optional embodiments, after the execution module 602 obtains the corresponding query result set from the database using the structured query language, it is further configured to: Obtain the new conditions added by the user, compare the new conditions with the historical structured query language, and identify the change type; When the change type is conditional append, retrieve the historical query results from the cached result set, perform memory filtering on the historical query results, and obtain the updated query results; When the change type is a dimension change or indicator change, the structured query language is re-executed to query the database, obtain the updated query results, and update the cache database with the updated query results.
[0074] In some alternative embodiments, the device further includes a return module for: Return data results, optimal chart type and chart configuration parameters to the front end. The front end uses a structure layer / data layer separation architecture to dynamically render the chart and automatically configures the visualization parameters according to the data characteristics. When a user adds conditions that trigger a chart update and the chart type remains unchanged, only the data layer is refreshed while the structure layer is preserved.
[0075] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0076] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0077] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0078] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0079] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 708, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0080] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as an AI-based graph generation method. For example, in some embodiments, the AI-based graph generation method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the applet distribution described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the AI-based graph generation method by any other suitable means (e.g., by means of firmware).
[0081] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0082] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable artificial intelligence-based diagram generation device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0083] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0084] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0085] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0086] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0087] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0088] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. An artificial intelligence-based chart generation method, wherein, The method includes: The system parses the natural language input by the user and generates a structured query language corresponding to the natural language based on the parsing results. The structured query language is executed to obtain the corresponding query result set from the database; Traverse the query result set, statistically analyze the basic attributes of each field in the query result set and the relationships between fields, and perform data quality assessment on the data of each field in the query result set to generate a data feature vector containing quality scores; The feature identifiers in the data feature vector are matched with the rule conditions in the preset decision rule base to obtain a candidate chart set. The optimal chart is selected from the candidate chart set using a multi-objective weighted scoring mechanism.
2. The method according to claim 1, wherein, The process involves traversing the query result set, statistically analyzing the basic attributes of each field in the query result set and examining the relationships between fields, and then performing a data quality assessment on the data in each field of the query result set to generate a data feature vector containing quality scores, including: Traverse the query result set, count the basic attributes of each field, analyze the relationship between fields, and generate basic feature identifiers. The basic attributes of each field include data type, non-empty rate, number of duplicates, and numerical range. The relationship between fields includes time sorting relationship, proportion relationship, and classification dimension relationship. Based on the aforementioned basic feature identifiers, calculate the null value rate detection index, sparsity detection index, and outlier detection index; A quality score is obtained based on the aforementioned null value rate detection index, sparsity detection index, and outlier detection index; The quality score is fused with the basic feature identifier as an additional dimension to form a data feature vector containing the quality score.
3. The method according to claim 2, wherein, The calculation of the null value rate detection index, sparsity detection index, and outlier detection index based on the basic feature identifiers includes: The number of records is extracted from the basic feature identifiers, the number of missing values in each field is counted by traversing the query result set, and the ratio between the number of missing values and the number of records is calculated to obtain the null value rate detection index. Extract date / time type fields from the query result set, traverse the data records in chronological order, and calculate the ratio of non-empty rows to the total number of rows to obtain the sparsity detection index; Numerical fields are extracted from the query result set, and the interquartile range is used to determine the outlier detection interval. The data records are traversed to identify outliers that exceed the detection interval, and the ratio of the number of outliers to the total number of records is calculated to obtain the outlier detection index.
4. The method according to claim 3, wherein, The quality score obtained based on the null value rate detection index, sparsity detection index, and outlier detection index includes: Calculate the first difference between the preset value and the null value detection index, and multiply the first difference by the first preset weight coefficient to obtain the first calculation result; The product of the sparsity detection index and the second preset weighting coefficient is calculated to obtain the second calculation result; Calculate the second difference between the preset value and the outlier detection index, and multiply the second difference by the third preset weighting coefficient to obtain the third calculation result; The first calculation result, the second calculation result, and the third calculation result are summed to obtain the quality score.
5. The method according to claim 1, wherein, The step of matching the feature identifiers in the data feature vector with the rule conditions in the preset decision rule base to obtain a candidate chart set includes: Feature identifiers are extracted from the data feature vector, including time series feature identifiers, percentage feature identifiers, sorting feature identifiers, comparison feature identifiers, geographic location feature identifiers, relationship network feature identifiers, numerical distribution feature identifiers, number of fields, and number of indicators. The feature identifier is compared with the corresponding rule conditions in the preset decision rule base. When the feature identifier meets the rule triggering conditions, the corresponding chart type is included in the candidate chart set.
6. The method according to claim 5, wherein, The step of comparing the feature identifier with the corresponding rule conditions in the preset decision rule base, and including the corresponding chart type in the candidate chart set when the feature identifier meets the rule triggering condition, includes: When the time series feature identifier is true and the number of indicators is a single indicator, the line chart and area chart are included in the candidate chart set; when the time series feature identifier is true and the number of indicators is multiple indicators, the multi-line chart and stacked area chart are included in the candidate chart set. When the percentage feature is true, pie charts and donut charts are included in the candidate chart set; When the sorting feature is true, the horizontal bar chart and the vertical bar chart are included in the candidate chart set; When the comparison feature is true and the number of dimensions is within a preset range, the grouped bar chart and heatmap are included in the candidate chart set. When the geographic location feature is true, the map visualization is included in the candidate chart set; When the relationship network feature identifier is true, the relationship graph and Sankey diagram are included in the candidate graph set; When the numerical distribution feature is true, the histogram and box plot are included in the candidate chart set; When the number of fields exceeds a preset threshold or the dimensional complexity exceeds the limit, the table display will be included in the candidate chart set. Summarize all chart types corresponding to matching rules, remove duplicates, and form a candidate chart set.
7. The method according to claim 1, wherein, The step of selecting the optimal chart from the candidate chart set using a multi-objective weighted scoring mechanism includes: For each candidate chart in the candidate chart set, a rule matching score is calculated based on the degree of matching between the data feature vector and the corresponding triggering rule; The quality fit score is determined based on the preset range in which the quality score falls. Determine the user's historical preference score based on the user's historical acceptance frequency of each chart type; The comprehensive score is obtained by multiplying the rule matching score, the quality adaptation score, and the user historical preference score by preset weight coefficients and then summing them. The candidate chart with the highest overall score is selected as the optimal chart.
8. The method according to claim 1, wherein, The step of parsing the natural language input by the user and generating a structured query language corresponding to the natural language based on the parsing results includes: It receives natural language input from users, performs intent parsing through a large language model, identifies query targets, time ranges, aggregation dimensions, and filtering conditions, and obtains a set of business terms. Based on the set of business terms, the metadata information in the data dictionary is queried, and the business terms are mapped to database physical objects to obtain the mapping results; A structured query language statement is generated based on the mapping result.
9. The method according to claim 1, wherein, After obtaining the corresponding query result set from the database by executing the structured query language, the method further includes: Obtain the new conditions added by the user, compare the new conditions with the historical structured query language, and identify the change type; When the change type is condition appending, historical query results are obtained from the cached result set, and memory filtering is performed on the historical query results to obtain the updated query results. When the change type is a dimension change or an indicator change, the structured query language is re-executed to query the database to obtain the updated query results, and the updated query results are then updated to the cache database.
10. The method according to any one of claims 1 to 9, wherein, The method further includes: The system returns data results, optimal chart type, and chart configuration parameters to the front end. The front end uses a structure layer / data layer separation architecture to dynamically render the chart and automatically configures visualization parameters based on data characteristics. When a user adds conditions that trigger a chart update and the chart type remains unchanged, only the data layer is refreshed while the structure layer is preserved.
11. An artificial intelligence-based chart generation device, wherein, The device includes: The input module is used to parse the natural language input by the user and generate a structured query language corresponding to the natural language based on the parsing results. The execution module is used to execute the structured query language to obtain the corresponding query result set from the database; The traversal module is used to traverse the query result set, count the basic attributes of each field in the query result set and analyze the relationship between fields, and perform data quality assessment on the data of each field in the query result set to generate a data feature vector containing quality scores. The matching module is used to match the feature identifiers in the data feature vector with the rule conditions in the preset decision rule base to obtain a candidate chart set, and to select the optimal chart from the candidate chart set using a multi-objective weighted scoring mechanism.
12. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-10.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-10.
14. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-10.