Method, system and storage medium for generating charts through question-answer dialogue

By constructing a description language DSL specification library and knowledge vector space, combining semantic understanding model and task scheduler, the intelligence and efficiency problems of chart generation in the existing technology are solved, and the accurate understanding of user intentions and efficient chart generation are achieved.

CN119578392BActive Publication Date: 2025-08-26BEIJING YONGHONG SHANGZHI TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510134656.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-07
Publication Date
2025-08-26
Estimated Expiration
2045-02-07

AI Technical Summary

Technical Problem

Existing chart generation technologies lack intelligent semantic understanding capabilities, cannot directly convert user natural language descriptions into chart configuration instructions, it is difficult to maintain context coherence in multiple rounds of conversations, and lack of flexible task scheduling and resource allocation, resulting in the chart generation process being not intelligent and efficient enough.

Method used

By building a description language DSL specification library, using semantic unit classifiers for annotation, establishing a knowledge vector space, combining semantic understanding models and template matching engines, it realizes accurate understanding of user intentions and chart configuration, and uses task parser and chart engine scheduler to decompose and resource allocation to generate efficient visual charts.

Benefits of technology

It realizes accurate capture of user intentions and efficient chart generation, improves the intelligence and coherence of chart generation, optimizes resource utilization, and improves the efficiency and quality of chart generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119578392B_ABST
    Figure CN119578392B_ABST
Patent Text Reader

Abstract

This application relates to the field of data processing technology and discloses a method, system, and storage medium for generating charts through question-and-answer dialogues. The method includes: semantically understanding user questions to extract keywords and contextual information; then, based on the semantic understanding results and the DSL specification, generating a standardized DSL script; then, parsing the DSL script to obtain a chart configuration task sequence and dependency relationships; and finally, parallel scheduling and resource allocation of the task sequence to generate a visual chart that meets the user's analysis needs. This application dynamically optimizes execution strategies based on task characteristics and system resource availability, improving the efficiency and quality of chart generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method, system, and storage medium for generating a chart through a question-and-answer dialogue. Background Art

[0002] Among existing chart generation technologies, most use predefined templates or fixed configurations to generate charts. Users need to specify the specific configuration of the chart through interface operations or by writing code. This method requires users to have certain data analysis and visualization expertise, and to understand the applicable scenarios of various charts and the corresponding configuration parameters. At the same time, existing chart generation methods are usually one-way configuration processes, lacking the ability to interact with users in natural language, and it is difficult for users to flexibly adjust the presentation of charts through dialogue. Especially when dealing with complex data analysis needs, users often need to repeatedly modify configuration parameters to obtain satisfactory visualization effects. In addition, when processing multiple rounds of dialogue, existing technologies have difficulty in accurately understanding changes in user intent and are unable to effectively reuse contextual information in historical dialogues, resulting in a lack of coherence and intelligence in the chart generation process.

[0003] The main problems with existing technologies include: first, the chart generation process lacks intelligent semantic understanding capabilities and cannot directly convert users' natural language descriptions into accurate chart configuration instructions; second, the task scheduling of data processing and chart rendering lacks flexibility, making it difficult to dynamically adjust resource allocation strategies according to actual needs; third, in multi-round dialogue scenarios, existing technologies have difficulty maintaining the contextual coherence of dialogues and cannot intelligently understand and process changes in user intentions; finally, the chart generation process lacks an adaptive optimization mechanism, making it difficult to automatically select the best visualization solution based on data characteristics and user needs. Summary of the Invention

[0004] This application provides a method, system, and storage medium for generating charts through question-and-answer dialogues. These methods accurately capture changes in user intent through semantic understanding and contextual analysis of multiple rounds of dialogue, and automatically generate visual charts that meet user needs by integrating expertise from a knowledge base. This method also provides a flexible task scheduling and resource allocation mechanism that dynamically optimizes execution strategies based on task characteristics and system resource availability, improving the efficiency and quality of chart generation.

[0005] In a first aspect, the present application provides a method for generating a chart through a question-and-answer dialogue, the method comprising: constructing a description language DSL specification library according to chart configuration elements, data query syntax, and calculation operation rules, classifying and annotating the semantic units in the DSL specification library through a semantic unit classifier to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics, and calculation analysis semantics; constructing a knowledge vector space based on the semantically annotated DSL specification, vectorizing the domain knowledge content through a semantic encoder, and obtaining a structured knowledge base containing knowledge vectors and field mapping relationships; and , keyword extraction and context association analysis are performed on the question content through the semantic understanding model to obtain a semantic understanding result containing the current dialogue intention and historical association information; based on the semantic understanding result and the semantically annotated DSL specification, the template matching engine is used to adapt the semantic understanding result to a template and fill in parameters to obtain a standardized DSL execution script; according to the DSL execution script, the script content is parsed and the task is decomposed by the task parser to obtain a task execution plan containing a chart configuration task sequence and task dependency; according to the task execution plan, the task sequence is parallel scheduled and resources are allocated by the chart engine scheduler to obtain a visual chart that meets the user's analysis needs.

[0006] In a second aspect, the present application provides a system for generating a chart through a question-and-answer dialogue, the system comprising:

[0007] An annotation module is used to construct a description language DSL specification library based on chart configuration elements, data query syntax, and calculation operation rules, and classify and annotate the semantic units in the DSL specification library using a semantic unit classifier to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics, and calculation analysis semantics;

[0008] A construction module is used to construct a knowledge vector space according to the semantically annotated DSL specification, and vectorize the domain knowledge content through a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships;

[0009] An association module is used to extract keywords and perform context association analysis on the question content based on the structured knowledge base and the user's question content through a semantic understanding model to obtain a semantic understanding result that includes the current conversation intention and historical association information;

[0010] A filling module is used to perform template adaptation and parameter filling on the semantic understanding result through a template matching engine based on the semantic understanding result and the semantically annotated DSL specification to obtain a standardized DSL execution script;

[0011] A decomposition module is used to execute the script according to the DSL, parse the script content and decompose the tasks through the task parser, and obtain a task execution plan including a chart configuration task sequence and task dependency relationship;

[0012] The allocation module is used to perform parallel scheduling and resource allocation on the task sequence through the chart engine scheduler according to the task execution plan, so as to obtain a visual chart that meets the user's analysis needs.

[0013] A third aspect of the present application provides a computer-readable storage medium having instructions stored therein, which, when executed on a computer, enables the computer to execute the above-mentioned method of generating a chart through a question-and-answer dialogue.

[0014] In the technical solution provided by this application, by constructing a specific domain description language DSL specification library and establishing a semantic unit classifier to classify and annotate the semantic units in the DSL specification library, unified and standardized management of chart type description semantics, data operation semantics and computational analysis semantics is achieved, providing a standardized semantic basis for subsequent semantic understanding and chart generation; secondly, a knowledge vector space is constructed according to the semantically annotated DSL specification, and the domain knowledge content is vectorized by a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships, which effectively improves the accuracy of knowledge representation and retrieval efficiency; thirdly, based on the structured knowledge base and user question content, the semantic understanding model is used to achieve accurate interpretation of the question content. It accurately understands the situation, organically combines keyword extraction and contextual association analysis, and accurately captures the user's analysis intention and historical association information; in addition, the template matching engine performs intelligent template adaptation and parameter filling on the semantic understanding results to generate a standardized DSL execution script, ensuring the accurate conversion from user intention to specific configuration; moreover, the task parser systematically parses and decomposes the DSL execution script to obtain a task execution plan containing a chart configuration task sequence and task dependency relationships, achieving reasonable organization and efficient execution of tasks; finally, the chart engine scheduler performs intelligent parallel scheduling and resource allocation on the task sequence, ensuring the full utilization of system resources and a significant improvement in chart generation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0016] Figure 1This is a schematic diagram of an embodiment of a method for generating a chart through a question-and-answer dialogue in an embodiment of the present application;

[0017] Figure 2 This is a schematic diagram of an embodiment of a system for generating charts through question-and-answer dialogues in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The embodiments of the present application provide a method, system and storage medium for generating a chart through a question-and-answer dialogue. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0019] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In one embodiment of the present application, a method for generating a chart through a question-and-answer dialogue includes:

[0020] Step S101: Construct a description language DSL specification library based on chart configuration elements, data query syntax, and calculation operation rules. Use a semantic unit classifier to classify and annotate the semantic units in the DSL specification library to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics, and calculation analysis semantics.

[0021] Step S102: construct a knowledge vector space according to the semantic annotation DSL specification, and vectorize the domain knowledge content through a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships;

[0022] Step S103: Based on the structured knowledge base and the user's question content, the semantic understanding model is used to extract keywords and perform contextual analysis on the question content to obtain a semantic understanding result that includes the current conversation intention and historical association information;

[0023] Step S104: Based on the semantic understanding result and the semantically annotated DSL specification, the template matching engine is used to perform template adaptation and parameter filling on the semantic understanding result to obtain a standardized DSL execution script;

[0024] Step S105: Execute the script according to the DSL, parse the script content and decompose the tasks through the task parser, and obtain a task execution plan including the chart configuration task sequence and task dependency relationship;

[0025] Step S106: According to the task execution plan, the task sequence is scheduled in parallel and resources are allocated through the chart engine scheduler to obtain a visual chart that meets the user's analysis needs.

[0026] It is understandable that the execution subject of this application can be a system for generating a chart through a question-and-answer dialogue, or a terminal or a server, which is not limited here. The embodiment of this application is described by taking the server as the execution subject as an example.

[0027] Specifically, the DSL specification library serves as a bridge between the user's natural language and the chart generation system. It consists of three core components: chart configuration elements, data query syntax, and calculation operation rules. Chart configuration elements define the basic structure of a chart, including chart types (e.g., line charts, bar charts, pie charts), axis settings (e.g., title, scale, and units), data series configuration (e.g., name, color, and style), and interactive behaviors (e.g., zooming, filtering, and drilling). The data query syntax specifies the rules for data operations, covering operations such as data filtering (where conditions), grouping and aggregation (group by), sorting (order by), and join queries (join). Calculation operation rules include the definitions of mathematical operators, statistical functions, and logical expressions. A semantic unit classifier categorizes and annotates these specifications, dividing the semantic units into chart type description semantics (used to identify the user's desired chart type), data operation semantics (used to understand data processing requirements), and calculation analysis semantics (used to parse calculation logic), thus forming a semantically annotated DSL specification. Based on the semantically annotated DSL specification, the semantic encoder begins to construct a knowledge vector space. The semantic encoder performs word segmentation and semantic feature extraction on the domain knowledge content, converting each knowledge fragment into a high-dimensional vector representation. These vectors contain semantic information about the knowledge, and the distance between vectors reflects the semantic similarity between the pieces of knowledge. In the vector space, semantically similar knowledge points are clustered together to form knowledge clusters. Simultaneously, the semantic encoder establishes field mappings, associating data fields with corresponding knowledge vectors to facilitate subsequent accurate semantic matching. This results in a structured knowledge base containing knowledge vectors and field mappings. When a user asks a question, the semantic understanding model first performs semantic understanding based on the structured knowledge base and the user's question. The keyword extractor identifies the core vocabulary in the question and searches for relevant knowledge content in the knowledge vector space. Simultaneously, the contextual association analyzer tracks the conversation history to understand the connection between the current question and previous conversations. For example, when a user asks, "Please help me change this into a bar chart," the contextual analysis determines that "it" refers to a previously generated line chart. This results in a semantic understanding result that incorporates both the current conversation intent and historical association information.

[0028] The template matching engine receives the semantic understanding results and matches them with templates in the semantically annotated DSL specification. It first finds the most suitable DSL template based on semantic similarity and then populates the template with the specific parameters from the semantic understanding results. For example, when a user asks, "Show sales comparison of each department over the past three months," the template matching engine selects a bar chart template and enters parameters such as the time range (the past three months), grouping dimension (department), and metric value (sales), generating a standardized DSL execution script. The task parser parses the DSL execution script and breaks it down into a series of specific chart configuration tasks. These tasks include setting the chart type, configuring axes, adding data series, and setting styles. Furthermore, the task parser analyzes dependencies between tasks to determine which tasks must be executed sequentially and which can be processed in parallel. For example, loading data must be completed before plotting the data series, while setting the chart title and configuring the legend can be performed in parallel. This results in a task execution plan that includes a chart configuration task sequence and task dependencies.

[0029] The chart engine scheduler rationally schedules and allocates resources for task sequences based on the task execution plan. It first assesses each task's resource requirements (CPU, memory, I / O, etc.) and then develops a parallel execution strategy based on system resource availability. For tasks that can be run in parallel, the scheduler allocates resources and initiates execution simultaneously; for dependent tasks, it ensures they are executed serially in the correct order. Finally, the chart renderer generates visual charts based on the task execution results to meet user analysis needs.

[0030] For example, when a user wants to analyze a company's sales data, they first ask, "Help me analyze the sales trends of different product lines by quarter over the past two years." The semantic understanding model extracts key information from this question, including the time range (the past two years), time granularity (quarter), grouping dimension (product line), and analysis metric (sales). The template matching engine then selects the line chart template because it is suitable for demonstrating trend changes and generates the corresponding DSL script. The task parser breaks the script into tasks such as data query (aggregating sales data by quarter and product line), axis configuration (quarter on the X-axis and sales on the Y-axis), and data series configuration (one line for each product line). These tasks are processed in parallel by the scheduler to generate a line chart that clearly displays the sales trends of each product line. The data series in the chart are calculated by aggregating the raw transaction data by quarter and grouping them by product line, demonstrating the sales trends of different product lines.

[0031] In the embodiment of the present application, by constructing a domain-specific description language DSL specification library and establishing a semantic unit classifier to classify and annotate the semantic units in the DSL specification library, unified and standardized management of chart type description semantics, data operation semantics and computational analysis semantics is achieved, providing a standardized semantic basis for subsequent semantic understanding and chart generation; secondly, a knowledge vector space is constructed according to the semantically annotated DSL specification, and the domain knowledge content is vectorized by a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships, which effectively improves the accuracy of knowledge representation and retrieval efficiency; thirdly, based on the structured knowledge base and user question content, the semantic understanding model is used to achieve accurate understanding of the question content. It organically combines keyword extraction and contextual association analysis to accurately capture the user's analysis intention and historical association information. In addition, the template matching engine performs intelligent template adaptation and parameter filling on the semantic understanding results to generate a standardized DSL execution script, ensuring the accurate conversion from user intention to specific configuration. Moreover, the task parser systematically parses and decomposes the DSL execution script to obtain a task execution plan that includes a chart configuration task sequence and task dependency relationships, achieving reasonable organization and efficient execution of tasks. Finally, the chart engine scheduler performs intelligent parallel scheduling and resource allocation on the task sequence, ensuring the full utilization of system resources and a significant improvement in chart generation efficiency.

[0032] In a specific embodiment, the process of executing step S101 may specifically include the following steps:

[0033] (1) The chart configuration elements are semantically decomposed through the type analysis module to obtain a configuration element set including chart dimensions, indicators, styles, and interactions;

[0034] (2) Divide the data query syntax into filtering conditions, grouping rules, aggregation methods, and sorting methods according to the data operation type, generate the corresponding syntax tree structure through the syntax parser, and obtain a standardized query syntax template;

[0035] (3) The calculation operation rules are classified and organized into arithmetic operators, statistical functions, and logical relationships. The rule extractor constructs a calculation expression library to obtain a standardized calculation grammar structure.

[0036] (4) Based on the configuration element set, standardized query syntax template and normalized calculation syntax structure, the semantic mapper is used to establish the association relationship between DSL semantic units to obtain the initialized DSL specification library;

[0037] (5) The semantic unit classifier is configured as a chart type recognition unit, a data operation recognition unit, and a computational analysis recognition unit, and multi-dimensional feature extraction is performed on the semantic units in the initialized DSL specification library to obtain a semantic feature vector;

[0038] (6) According to the semantic feature vectors, the semantic units are grouped and classified through a hierarchical clustering algorithm, and a semantic category index is established to obtain a semantically annotated DSL specification that includes chart type description semantics, data operation semantics, and computational analysis semantics.

[0039] Specifically, chart configuration elements undergo semantic decomposition. Chart configuration elements are the basic configuration units in the chart generation process. This semantic decomposition yields a set of configuration elements, including chart dimensions, indicators, styles, and interactions. Chart dimensions refer to the categorical axes within a chart, such as time, geography, and product. Indicators represent the numerical data to be measured, such as sales, profit margin, and growth rate. Styles encompass the visual presentation of the chart, such as color, font, and borders. Interactions define how users interact with the chart, such as hover tooltips, click-to-drill, and region selection. The type analysis module uses semantic tree parsing to break each configuration element into basic semantic units and establish hierarchical relationships between them. As a crucial component of the DSL specification library, data query syntax requires systematic categorization based on data operation types. Filter conditions define data filtering rules, including equal value filtering, range filtering, and fuzzy matching. Grouping rules specify the dimensions for data aggregation, determining how data is grouped by specific fields. Aggregation methods describe the statistical methods used to apply to grouped data, such as sum, average, and maximum. Sorting methods specify the order in which data is sorted, which can be ascending or descending. The syntax parser adopts a bottom-up parsing strategy to parse the query statement into a syntax tree structure. The leaf nodes of the tree are specific operators and operands, and the non-leaf nodes represent the combination relationship of operations, forming a standardized query syntax template.

[0040] Computational operation rules are the core component of data operations within the DSL specification. The rule extractor categorizes and organizes these rules into three main types: arithmetic operators (such as addition, subtraction, multiplication, and division), statistical functions (such as average, standard deviation, and correlation coefficient), and logical relations (such as greater than, less than, and equal to). Through syntax analysis and semantic understanding, the rule extractor converts each operation rule into a formal expression, building a unified computation expression library. This expression library is organized in a tree structure, facilitating the combination and nesting of complex computations and forming a standardized computational syntax structure.

[0041] The semantic mapper establishes relationships between DSL semantic units based on the acquired configuration element set, standardized query syntax templates, and normalized computational syntax structures. It first constructs a semantic association network, mapping the semantic units from the three components into the same semantic space. It then determines the strength of association between the units through semantic similarity calculations. Semantic units with strong correlations are then connected to form a semantic association graph. This graph reflects the combination and usage patterns of different semantic units in real applications, thereby generating an initialized DSL specification library. The semantic unit classifier, as a core component, comprises three functional units: a diagram type recognition unit responsible for identifying and classifying different types of diagram semantics; a data operation recognition unit handling semantics related to data query and processing; and a computational analysis recognition unit focusing on semantic understanding of mathematical computations and statistical analysis. The classifier extracts features from each semantic unit in the initialized DSL specification library, taking into account multiple dimensions such as semantic content, usage scenarios, and combination rules, representing each semantic unit as a high-dimensional feature vector.

[0042] Based on the obtained semantic feature vectors, a hierarchical clustering algorithm begins grouping and categorizing semantic units. By calculating the distance between feature vectors, the algorithm merges semantically similar units from the bottom up, forming a hierarchical clustering structure. During the clustering process, a semantic category index is simultaneously established, with index entries created for each semantic category to facilitate subsequent rapid retrieval and matching. The resulting semantically annotated DSL specification encompasses diagram type description semantics, data manipulation semantics, and computational analysis semantics, providing a semantic foundation for subsequent diagram generation.

[0043] For example, when analyzing a company's sales data, the type analysis module first performs semantic decomposition on a request like "compute monthly sales by product category." The configuration element set includes dimensions (time-month, product category), metrics (sales), styles (bar chart styles), and interactions (displaying details on hovering over data points). The data query syntax generates query templates that include product category and month, with sales as the aggregation method. Calculation rules include expressions for summation and year-over-year calculations. These semantic units undergo association analysis in the semantic mapper, establishing connections between chart configuration, data query, and calculation processing, forming a semantic network. The semantic unit classifier categorizes these units into categories such as chart type (bar chart), data operation (group aggregation), and calculation analysis (sum statistics). Finally, hierarchical clustering is used to organize these semantic units into a hierarchical semantic structure, facilitating semantic matching and chart generation.

[0044] In a specific embodiment, the process of executing step S102 may specifically include the following steps:

[0045] (1) Parse the semantically annotated DSL specification, extract the semantic structure features through the semantic mapper, and obtain feature description data containing semantic types and semantic relationships;

[0046] (2) Input the feature description data into the knowledge vector builder, generate a multi-dimensional vector representation through the vector space projection algorithm, and obtain the initial knowledge vector space;

[0047] (3) Optimize the dimension of the initial knowledge vector space and reduce the dimension of the vector space through principal component analysis to obtain the compressed vector space structure;

[0048] (4) Based on the compressed vector space structure, the domain knowledge content is segmented and each knowledge segment is converted into a vector representation through a semantic encoder to obtain a knowledge vector sequence;

[0049] (5) Associate and match the knowledge vector sequence with the data field, determine the mapping relationship between the field and the knowledge fragment through similarity calculation, and obtain the field mapping table;

[0050] (6) Based on the knowledge vector sequence and field mapping table, an association network between knowledge units is established through a relational organizer to obtain a structured knowledge base containing knowledge vectors and field mapping relationships.

[0051] Specifically, a semantically annotated DSL specification is a specification system that includes multi-dimensional semantic information, including diagram types, data operations, and computational analysis. The semantic mapper uses syntax tree analysis to identify semantic nodes and the hierarchical relationships between them within the DSL specification. Each semantic node contains specific semantic type information (such as diagram type, data operation instructions, and computational expressions), as well as relationships with other nodes (such as parent-child, parallel, and dependency relationships). The semantic mapper extracts features from these semantic nodes, generating feature description data that includes semantic types and relationships. This feature description data is a multidimensional matrix, where each row represents a semantic node and each column represents a feature dimension. The values ​​of the matrix elements reflect the strength or properties of the features. The knowledge vector builder receives the feature description data as input and maps it into a high-dimensional vector space using a vector space projection algorithm. The vector space projection algorithm uses word embedding technology to represent each semantic node as a fixed-dimensional vector. This process places semantically similar nodes closer together in the vector space, while semantically divergent nodes are further apart. Vector space projection not only preserves the original feature information but also encodes semantic similarity through distance relationships between vectors. This results in an initial knowledge vector space, which contains vector representations of all semantic nodes.

[0052] The initial knowledge vector space typically has a high dimensionality, requiring dimensionality optimization to improve the efficiency of subsequent processing. Principal component analysis (PCA) calculates the covariance matrix of the eigenvectors to identify the principal component directions that contribute most to data variation. By retaining the primary eigenvalues ​​while discarding dimensions with smaller contributions, dimensionality reduction is achieved in the vector space. This process not only reduces data storage and computational overhead but also removes noise from the data, resulting in a purer and more efficient semantic representation. Based on the compressed vector space structure, the semantic encoder begins processing the domain knowledge content. This domain knowledge content includes information such as specialized knowledge, business rules, and best practices related to chart generation. The semantic encoder segments the knowledge content into semantic knowledge fragments. Each knowledge fragment undergoes preprocessing steps such as word segmentation and part-of-speech tagging before being converted into a vector representation using a word embedding model. These vectors form a sequence of knowledge vectors, each corresponding to a specific knowledge fragment. The relationships between the vectors reflect the semantic connections between the knowledge fragments.

[0053] Knowledge vector sequences must be mapped to actual data fields. A similarity calculator determines the strength of the association between knowledge vectors and field semantic vectors by calculating the cosine similarity between them. When the similarity exceeds a preset threshold, a mapping relationship is established between the field and the knowledge fragment. These mapping relationships are recorded in a field mapping table, which contains information such as the field name, the corresponding knowledge fragment identifier, and the mapping confidence level. The field mapping table provides semantic support for subsequent data processing and chart generation.

[0054] Based on the knowledge vector sequence and field mapping table, the relational organizer constructs a complex knowledge association network. In this network, nodes are knowledge vectors or data fields, and edges represent the semantic associations between them. The network's topology reflects the overall organization of the knowledge system, including the knowledge hierarchy, association strength, and semantic distance. This creates a structured knowledge base that not only contains knowledge vector representations but also maintains field mapping relationships.

[0055] For example, in an enterprise data analysis scenario, a knowledge base supporting sales data visualization needs to be built. First, the semantic mapper extracts semantic nodes related to sales analysis from the DSL specification, such as "sales," "year-on-year growth," and "product category," and analyzes the relationships between them. After vector space projection, these nodes form an initial knowledge vector distribution in a high-dimensional space. Principal component analysis compresses the original 100-dimensional vector space to 20 dimensions by identifying the main directions of change, while preserving key semantic information. The semantic encoder processes domain expertise in sales analysis, such as "sales calculation rules" and "year-on-year analysis methods," converting them into vector sequences. These knowledge vectors are then matched against actual database fields (such as "order_amount" and "product_category") for similarity, establishing semantic mapping relationships. Finally, the relationship organizer organizes these elements into a structured knowledge network to support subsequent chart generation. Using this knowledge base, when a user requests, for example, "display the year-on-year sales growth for each product category by quarter," the system accurately understands the user's intent and finds the corresponding data fields and calculation methods, generating accurate visualizations.

[0056] In a specific embodiment, the process of executing step S103 may specifically include the following steps:

[0057] (1) Perform syntactic analysis on the user's question content, extract the dependency relationship between sentence components through the syntactic tree builder, and obtain the syntactic structure tree of the question content;

[0058] (2) Semantically match the knowledge vectors in the structured knowledge base with the syntactic structure tree, identify key information fragments through cosine similarity calculation, and obtain the question keyword set;

[0059] (3) Perform semantic expansion on the question keyword set, establish a word relationship network through knowledge association analysis, and obtain a semantic association graph;

[0060] (4) Retrieve historical conversation records based on the semantic association graph, extract conversation topic link relationships through the context associator, and obtain the conversation context sequence;

[0061] (5) Fuse the conversation context sequence with the current question content, merge the related information through the semantic fuser, and obtain the conversation intention feature vector;

[0062] (6) Based on the distribution of semantic features in the dialogue intention feature vector, the correlation between the current dialogue intention and historical information is determined through multi-layer semantic analysis, and a semantic understanding result containing the current dialogue intention and historical correlation information is obtained.

[0063] Specifically, the syntactic analyzer analyzes the content of the user's question. The syntactic tree builder uses dependency syntactic analysis technology to identify subject-verb-object relationships, modification relationships, and logical associations in sentences. Dependency syntactic analysis treats each word in a sentence as a node, annotating the grammatical relationships between words with arcs to construct a tree structure. In this syntactic structure tree, the dependency relationships between words are clearly visible: the subject and predicate have a subject-verb relationship, the predicate and object have a verb-object relationship, and the attributive and central word have a modification relationship.

[0064] The knowledge vectors stored in a structured knowledge base contain a large amount of pre-encoded domain knowledge. Word nodes in the syntactic structure tree are matched to knowledge vectors using cosine similarity calculations. Cosine similarity calculations consider the direction of vectors rather than their magnitude, effectively measuring semantic similarity. The matching process not only matches individual words but also considers the semantic associations of word combinations. By setting a similarity threshold, the most relevant knowledge fragments to the user's question are selected to form a set of question keywords. After receiving the set of question keywords, the knowledge association analyzer performs semantic expansion. This expansion process is based on the association propagation mechanism of the knowledge graph. Taking each keyword as a starting point, it explores related concepts along the knowledge association edges. The weight of the association edge reflects the strength of the semantic association between concepts. By setting the propagation depth and weight threshold, the scope of semantic expansion is controlled to avoid introducing excessive irrelevant information. This constructs a semantic association graph centered around the core keyword and encompassing various related concepts.

[0065] Based on the constructed semantic association graph, the context associator begins searching historical conversation records. It first maps each turn in the conversation history into a semantic space and then calculates the semantic similarity between the current semantic association graph and the historical conversations. Using a graph matching algorithm, it identifies the evolutionary paths and associations of conversation topics, extracting coherent conversation topic links. These links are organized in chronological order to form a conversation context sequence, reflecting the continuity and changing trends of the conversation topic. The semantic fusion unit deeply fuses the conversation context sequence with the current question. This fusion process employs an attention mechanism, assigning different weights to historical information based on semantic relevance. Highly relevant historical information is given a higher weight, allowing it to play a greater role in the fusion process. The fusion result is a multidimensional feature vector that not only contains the semantic information of the current question but also encodes relevant historical context information.

[0066] The multi-layer semantic analyzer analyzes the fused feature vectors. It employs a hierarchical analysis strategy, extracting semantic features step by step from the word meaning level, sentence meaning level, and paragraph level. At each level, the correlation between the current conversation intent and historical information is calculated, resulting in a multi-dimensional semantic understanding result. This result includes the specific intent of the current conversation (such as query trends, numerical comparisons, and distribution analysis), as well as its correlation with historical conversations (such as continuity analysis, comparative analysis, and supplementary analysis).

[0067] For example, in an enterprise data analysis scenario, a user engages in the following conversation: the first question asks, "Analyze the sales distribution of each department last year," the second asks, "Display the quarterly trends of the three best-performing departments," and the third asks, "What are their per capita sales?" For this third question, the parser first builds a syntax tree, identifying "they" as a pronoun and "per capita sales" as a key analysis metric. Knowledge vector matching confirms that "they" refers to the three best-performing departments from the previous round. In the semantic expansion phase, "per capita sales" is expanded to include related concepts such as "department headcount," "total sales," and calculation rules. Contextual analysis reveals that the current question, along with the previous two rounds, forms an analytical chain: "overall distribution - key focus - analysis." Semantic fusion integrates this information to form a complete semantic representation encompassing "object scope (three key departments)," "timeframe (by quarter)," and "analysis metric (per capita sales)." Finally, multi-layer semantic analysis confirms that this is an intention to analyze a new metric on a subset of target departments. The new metric value needs to be calculated based on the department scope from the previous conversation and combined with personnel data.

[0068] In a specific embodiment, the process of executing step S104 may specifically include the following steps:

[0069] (1) Perform semantic feature analysis on the semantic understanding results, obtain the core semantic attributes of the conversation intent through the feature extractor, and obtain a semantic feature vector set;

[0070] (2) Perform similarity matching between the template library in the semantically annotated DSL specification and the semantic feature vector set, identify the best matching template through vector distance calculation, and obtain the basic DSL template;

[0071] (3) Extract key parameter information from the semantic understanding results, map the parameter values ​​to the placeholder positions of the basic DSL template through the parameter parser, and obtain the parameterized DSL script;

[0072] (4) Perform syntax check on the parameterized DSL script, analyze the integrity and legality of the script structure through the syntax checker, and obtain the verified DSL script;

[0073] (5) Optimize and combine the data operation instructions and calculation analysis instructions in the verified DSL script, generate the optimal execution sequence through the instruction optimizer, and obtain the optimized DSL script;

[0074] (6) Based on the optimized DSL script syntax rules, the script format is standardized through the normalization processor to obtain a standardized DSL execution script.

[0075] Specifically, during the DSL script generation process, the feature extractor analyzes the semantic understanding results. These results contain user conversational intent and historical association information. The feature extractor uses semantic analysis techniques to extract core semantic attributes. Core semantic attributes include chart type preferences (e.g., line chart, bar chart, scatter plot), data analysis requirements (e.g., trend analysis, comparative analysis, distribution analysis), time granularity (e.g., year, quarter, month), dimension selection (e.g., product, region, department), and metrics (e.g., sales, profit margin, growth rate). These semantic attributes are vectorized to form a set of multidimensional semantic feature vectors, each representing a specific aspect of the conversational intent. The template library in the semantically annotated DSL specification stores a variety of predefined chart generation templates. Each template is annotated with its applicable semantic scenario, including chart type, data processing logic, and visualization configuration. A vector distance calculator calculates the distance between the semantic feature vector set and the template's semantic annotation to identify the most matching DSL template. This vector distance calculation uses metrics such as Euclidean distance or cosine similarity, comprehensively considering the degree of match across multiple semantic dimensions. The template with the smallest distance or the highest similarity is selected as the basic DSL template, which provides the basic framework for graph generation.

[0076] The parameter parser receives the semantic understanding results and extracts specific parameter information from them. This parameter information includes data filtering conditions (such as time range and region range), aggregation calculation rules (such as sum, average, and maximum), and display configuration (such as color scheme and label style). The parameter parser then populates these parameter values ​​into the corresponding placeholders in the base DSL template according to predefined mapping rules. Placeholders are identified by specific tags, and the parameter filling process performs type checking and format conversion to ensure that the parameter values ​​meet the template requirements.

[0077] The syntax checker performs a comprehensive check on the DSL script after parameterization. This check includes the integrity of the grammatical structure (e.g., bracket matching, statement integrity), the validity of parameter types (e.g., value range, string format), and the logic of the instruction sequence (e.g., dependencies, execution order). The syntax checker employs a bottom-up analysis strategy, verifying each component of the script layer by layer, identifying and flagging issues that require correction. Scripts that pass the syntax check are marked as valid and proceed to the next optimization step.

[0078] The instruction optimizer is responsible for optimizing the combination of operation instructions in the DSL script. Data operation instructions (such as filtering, grouping, and aggregation) and computational analysis instructions (such as ratio and percentage calculations) often have room for optimization. The instruction optimizer analyzes the data dependencies between instructions, identifies operation steps that can be combined, adjusts the instruction execution sequence, and reduces the generation and storage of intermediate results. The optimized execution sequence improves execution efficiency while ensuring computational correctness. The normalization processor converts the optimized DSL script into a standard format. The standard format includes unified instruction syntax, consistent parameter naming, and standardized code indentation and commenting rules. Normalization does not change the functional semantics of the script, but makes it easier to parse and execute. The normalized DSL execution script is the output result, which will be used in the subsequent chart generation process.

[0079] For example, a user needs to analyze a company's sales data and request "display sales and year-on-year growth for each region over the past six months, highlighting regions with growth rates exceeding 20%." The feature extractor extracts key attributes from this semantic understanding: chart type (trend comparison), time range (previous six months), dimension (region), metric (sales, year-on-year growth rate), and filter condition (growth rate > 20%). These attributes are converted into semantic feature vectors and matched against DSL templates in the template library, selecting a combination chart template that supports multi-series comparison and conditional highlighting. The parameter parser extracts specific parameters: the time range is set to "LAST_6_MONTH," the dimension field is set to "region_name," the metric field is set to "sales_amount," the year-on-year calculation expression is set to "(current_value - last_value) / last_value," and the highlight condition is set to "growth_rate > 0.2." These parameters are then populated into the corresponding positions in the template, forming a DSL script. The syntax checker verifies the validity of the time range expression, the correctness of the calculation formula, and the legitimacy of the filter condition. The instruction optimizer combines the sales query and year-on-year calculation operations to generate an efficient execution sequence. Finally, the normalization processor formats the script and generates a DSL execution script. This script includes processing logic such as data query, year-on-year calculation, conditional filtering, and chart rendering, and can accurately generate visualization charts that meet user needs.

[0080] In a specific embodiment, the process of executing step S105 may specifically include the following steps:

[0081] (1) Parse the syntax structure of the DSL execution script, identify the operation instructions and configuration parameters in the script through the syntax analyzer, and obtain the instruction sequence and parameter set;

[0082] (2) Group and classify the instruction sequences according to the configuration objects, organize the related configuration operations into task units through the instruction classifier, and obtain the basic task set;

[0083] (3) Perform data flow analysis on the task units in the basic task set, identify the input and output associations between tasks through the dependency analyzer, and obtain the task dependency graph;

[0084] (4) Topologically sort the task nodes in the task dependency graph according to the dependency relationship, construct the task execution order through the sorting algorithm, and obtain the initial task sequence;

[0085] (5) Perform parallelism analysis on the tasks in the initial task sequence, identify the task groups that can be executed in parallel through the task scheduling analyzer, and obtain the task parallelization plan;

[0086] (6) The task dependency graph is optimized and reorganized according to the task parallel scheme, and an execution plan is generated through the task scheduler to obtain a task execution scheme that includes a graph-configured task sequence and task dependency relationships.

[0087] Specifically, the parser performs lexical and syntactic analysis on the DSL execution script. Lexical analysis breaks the script text into a sequence of tokens, identifying keywords, operators, identifiers, and parameter values. Syntactic analysis constructs an abstract syntax tree based on predefined grammar rules. In the syntax tree, each node corresponds to an operation instruction or configuration parameter, and the hierarchical relationship between nodes reflects the organizational structure of the instructions. The parser traverses the syntax tree and extracts the instruction sequence and parameter set. The instruction sequence records all the operation steps that need to be executed, while the parameter set contains the specific configuration information required for each operation.

[0088] After receiving a sequence of commands, the command classifier groups and categorizes them according to the type of configuration object. Configuration objects include data source configuration (such as data table selection and field mapping), data processing configuration (such as filtering conditions and aggregation rules), chart property configuration (such as axis settings and legend styles), and interactive behavior configuration (such as event responses and animation effects). The command classifier groups related configuration operations into logical task units. Each task unit is an independent functional module responsible for achieving a specific configuration goal. This forms a basic task set, within which each task has a clear functional definition and boundaries. The dependency analyzer performs data flow analysis on the task units in the basic task set. Data flow analysis traces the data transfer path between tasks and identifies input-output relationships between tasks. For example, the output of a data filtering task is the input of a data aggregation task, and the aggregation result is the input data of a chart rendering task. By analyzing these data dependencies, the dependency analyzer constructs a task dependency graph. In this directed graph, nodes represent tasks, edges represent data dependencies, and the direction of the edge indicates the direction of data flow.

[0089] The task dependency graph requires a topological sort to determine the execution order of the tasks. The topological sort algorithm selects a node with zero in-degree (i.e., a task with no input dependencies) from the graph as the starting point, adds it to the execution sequence, then removes the node and its associated edges and proceeds to the next node with zero in-degree. This process continues until all nodes have been processed, resulting in an initial task sequence that satisfies the dependencies. This sequence ensures that the required input data for each task is readily available when it is executed. The task schedule analyzer performs parallelism analysis on the initial task sequence. The core of parallelism analysis is to identify independent tasks that lack direct or indirect data dependencies. The schedule analyzer divides the tasks in the initial sequence into multiple task groups, each of which can be executed in parallel. For example, tasks aggregating data of different dimensions or configuring the styles of different chart elements can be processed in parallel. This results in a task parallelism plan that clearly specifies which tasks can be started simultaneously and which tasks must wait for their predecessors to complete.

[0090] The task scheduler optimizes and reorganizes the task dependency graph based on the task parallelization plan. This optimization process primarily considers two aspects: first, ensuring load balancing among parallel tasks to avoid overloading some processing units while leaving others idle; and second, minimizing task switching overhead to ensure that related tasks execute consecutively on the same processing unit. The task scheduler integrates these considerations to generate a task execution plan. This plan includes a detailed task sequence and inter-task dependencies, providing an execution blueprint for graph generation.

[0091] For example, a user needs to generate a sales analysis dashboard containing multiple chart components. The DSL script contains configurations for creating trend charts, distribution charts, and comparison charts. The parser first identifies all operational instructions from the script, such as data query instructions, data processing instructions, and chart configuration instructions. The instruction classifier organizes these instructions into distinct task units: data preparation tasks (responsible for data query and filtering), indicator calculation tasks (responsible for growth rate calculation), and chart configuration tasks (responsible for setting chart properties). Dependency analysis shows that the data preparation task must be executed first before its output data can be used for indicator calculation, while chart configuration depends on the calculation results. Topological sorting determines the execution order of the tasks: data preparation first, indicator calculation second, and chart property configuration last. Parallelism analysis reveals that data processing in different areas can be performed in parallel, as can the configuration of different chart components. The execution scheme distributes data processing tasks to multiple processing units for parallel execution, while chart configuration tasks are processed sequentially according to the layout relationships between components, ensuring efficient generation of the entire dashboard.

[0092] In a specific embodiment, the process of executing step S106 may specifically include the following steps:

[0093] (1) Perform resource requirement analysis on the task execution plan, calculate the computing resource consumption of each task through the resource estimator, and obtain the task resource requirement list;

[0094] (2) Group the tasks in the task resource requirement list according to the degree of parallelism, match computing resources for each group of tasks through the resource allocator, and obtain a resource allocation plan;

[0095] (3) Schedule the task groups in the resource allocation plan, formulate the task execution schedule through the scheduling strategy generator, and obtain the task scheduling plan;

[0096] (4) Import the task scheduling plan into the chart engine, obtain the data set and configuration parameters required for the task through the data loader, and obtain the chart rendering data package;

[0097] (5) Convert the chart rendering data package according to the chart configuration requirements, adjust the data format and calculate the statistical value through the data converter to obtain the chart data structure;

[0098] (6) Based on the chart data structure and visualization configuration information, the layout and style settings of the chart elements are completed through the rendering processor to obtain a visualization chart that meets the user's analysis needs.

[0099] Specifically, task execution and resource scheduling play a key role in the final stage of graph generation. The resource estimator performs a comprehensive resource requirement analysis of the task execution plan. It evaluates each task's computational characteristics, including data processing volume, algorithmic complexity, and memory usage patterns, and calculates specific resource consumption metrics. These metrics cover CPU power requirements, memory space requirements, and I / O bandwidth requirements. Each task's resource requirements are recorded in detail in a task resource requirement list, providing a basis for subsequent resource allocation. The resource allocator receives the task resource requirement list and groups the tasks based on their parallel execution characteristics. This grouping process takes into account inter-task dependencies and resource contention. For tasks that can be executed in parallel, the resource allocator groups them into the same group, ensuring that the total resource requirements of each group do not exceed the upper limit of available resources. The resource allocation process employs a load balancing strategy to ensure the optimal utilization of all computing resources. The resulting allocation results in a resource allocation plan that clearly specifies the computing resource quota available to each task group.

[0100] The scheduling strategy generator is responsible for developing an execution schedule for the task groups in the resource allocation plan. It needs to consider multiple factors: the priority of the task, the expected execution time, the resource availability time window, and the dependencies between tasks. The scheduling strategy uses a time slice allocation mechanism to allocate an appropriate execution time period for each task group. The schedule contains information such as the start time of the task, the expected execution time, and the completion deadline. This detailed task scheduling plan ensures the orderly execution of tasks. The data loader converts the task scheduling plan into specific execution actions. Based on the task requirements, it extracts the relevant data sets from the data source and loads the configuration parameters required for the task. The data loading process uses streaming processing to avoid memory pressure caused by loading a large amount of data at one time. The loaded data and parameters are packaged into a chart rendering data package, which contains all the information required to generate the chart.

[0101] The data converter receives chart rendering data packets and processes the data according to the chart configuration requirements. This processing includes data format conversion, statistical value calculation, and data structure reorganization. For example, for time series data, the time granularity needs to be adjusted; for categorical data, grouping and aggregation are required; and for numerical data, statistical indicators need to be calculated. The converted data is organized into a chart data structure that fully matches the rendering requirements of the chart engine. The rendering processor is the final step in chart generation. It completes the specific drawing of the chart based on the chart data structure and visualization configuration information. The rendering process first determines the overall layout of the chart, including the axis position, legend position, and data area division. It then sets the style of each chart element, including the color scheme, font style, and interactive effects. Finally, all elements are combined into a visual chart that accurately displays the data characteristics that the user needs to analyze.

[0102] For example, a company needs to generate a sales analysis dashboard. The resource evaluator analyzes the task requirements and determines that the data processing task requires a 4-core CPU and 8GB of memory, and the chart rendering task requires a 2-core CPU and 4GB of memory. The resource allocator divides these tasks into two groups: the data processing group and the chart rendering group, and allocates corresponding resource quotas to each. The scheduling strategy arranges the data processing task to be executed in the first 5 minutes and the chart rendering task to be executed in the last 2 minutes. The data loader extracts the transaction records of the past 12 months from the sales database and loads the chart configuration parameters at the same time. The data converter aggregates the raw transaction data by month, calculates indicators such as monthly sales totals and year-on-year growth rates, and forms a standardized data structure. Finally, the rendering processor generates a combined chart containing sales trends, regional distribution, and product proportions based on the configuration, meeting the user's analysis needs.

[0103] In a specific embodiment, the process of performing the resource requirement analysis step on the task execution plan may specifically include the following steps:

[0104] (1) Perform complexity evaluation on each task in the task execution plan, determine the time complexity and space complexity of the task by using the computational complexity analyzer, and obtain a list of task complexity indicators;

[0105] (2) Convert the complexity data in the task complexity index list into resource consumption estimates, quantify the CPU occupancy, memory usage, and IO bandwidth requirements through the resource consumption calculator, and obtain basic resource consumption data;

[0106] (3) Compensate the basic resource consumption data with the data scale factor, calculate the coefficient of influence of data processing scale on resource consumption through the data volume analyzer, and obtain the estimated value of resource consumption after scale correction;

[0107] (4) Perform task concurrency analysis based on the scale-corrected resource consumption estimate, evaluate the resource competition of simultaneously running tasks through the concurrency calculator, and obtain the concurrency resource consumption matrix;

[0108] (5) Match the concurrent resource consumption matrix with the system resource capacity, calculate the resource utilization and saturation through the resource capacity analyzer, and obtain the resource allocation recommendation plan;

[0109] (6) Prioritize the task resource requirements according to the resource allocation proposal, generate a resource allocation strategy through the resource allocator, and obtain a task resource requirement list.

[0110] Specifically, task complexity assessment includes two key dimensions: time complexity and space complexity. For data processing tasks, time complexity reflects the number of computational steps required to execute the task, while space complexity indicates the memory space required during task execution. Different types of tasks have different complexity characteristics: the complexity of data query tasks depends on the data volume and index structure, the complexity of data aggregation tasks is related to the number of groups and aggregation functions, and the complexity of chart rendering tasks is related to the chart type and the number of data points. The computational complexity analyzer analyzes the algorithmic structure of each task to derive a complexity metric for each task, creating a list of task complexity metrics. The resource consumption calculator receives this list of task complexity metrics and converts the theoretical complexity into specific resource consumption estimates. This conversion process takes into account the characteristics of the hardware environment, mapping abstract complexity metrics to actual resource usage. CPU utilization estimates are based on the computational intensity of the task, memory usage estimates take into account the space requirements of the data structure, and I / O bandwidth requirements are calculated based on the frequency and scale of data read and write operations.

[0111] The data volume analyzer is responsible for applying scale factor compensation to basic resource consumption data. Data processing scale significantly impacts resource consumption: as data volume increases, not only does processing time increase, but memory usage and I / O pressure also rise accordingly. The data volume analyzer calculates the scale impact coefficient by establishing a correlation model between data scale and resource consumption. This coefficient reflects the extent to which changes in data volume affect resource demand and is used to adjust basic resource consumption estimates for more accurate resource consumption estimates. The concurrency calculator uses scale-corrected resource consumption estimates to analyze resource contention during concurrent task execution. When multiple tasks run simultaneously, they compete for resources such as CPU, memory, and I / O. The concurrency calculator constructs a resource contention model to evaluate resource consumption at different concurrency levels. This evaluation process generates a concurrency resource consumption matrix, in which each element represents the level of resource consumption at a specific concurrency level.

[0112] The resource capacity analyzer matches the concurrent resource consumption matrix with the system's resource capacity. By calculating the utilization and saturation of various resources, it determines whether the system can support the expected concurrent tasks. Utilization reflects the extent of resource usage, while saturation indicates whether resources are approaching a bottleneck. Based on these analysis results, the resource capacity analyzer generates a resource allocation proposal, recommending appropriate resource quotas for each task. The resource allocator prioritizes tasks based on the resource allocation proposal and generates a resource allocation strategy. Prioritization takes into account task importance, timeliness, and resource requirements. Tasks on the critical path are assigned higher resource priority; for tasks with fluctuating resource requirements, appropriate resource buffers are reserved. This creates a task resource requirement list, providing resource guarantees for actual task execution.

[0113] For example, generating a sales analytics dashboard involves multiple data processing and visualization tasks. Data query tasks require processing sales records from the past year, encompassing millions of transactions. Computational complexity analysis shows that the monthly aggregation calculation has a time complexity of O(n) and a space complexity of O(m), where n is the number of records and m is the number of months. Resource consumption calculations indicate that this task requires two CPU cores and 4GB of memory for data processing. Taking into account the data scale factor, memory requirements increase to 6GB when the data volume doubles. Concurrency analysis reveals that when processing aggregation tasks across multiple dimensions simultaneously, memory usage overlaps, and the actual demand is less than the sum of the requirements for each task. Resource capacity analysis confirms that, in an 8-core 16GB environment, a maximum of four aggregation tasks can be executed in parallel. The resource allocation strategy divides the aggregation tasks into two batches, allocating four CPU cores and 8GB of memory to each batch to ensure efficient task completion.

[0114] The above describes the method for generating a chart through a question-and-answer dialogue in the embodiment of the present application. The following describes the system for generating a chart through a question-and-answer dialogue in the embodiment of the present application. Figure 2 In one embodiment of the present application, a system for generating a chart through a question-and-answer dialogue includes:

[0115] Annotation module 201 is configured to construct a description language (DSL) specification library based on chart configuration elements, data query syntax, and calculation operation rules, and classify and annotate semantic units in the DSL specification library using a semantic unit classifier to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics, and calculation analysis semantics.

[0116] Construction module 202 is used to construct a knowledge vector space according to the semantically annotated DSL specification, and vectorize the domain knowledge content through a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships;

[0117] The association module 203 is configured to extract keywords and perform contextual association analysis on the question content based on the structured knowledge base and the user's question content using a semantic understanding model to obtain a semantic understanding result that includes the current conversation intention and historical association information;

[0118] A filling module 204 is configured to perform template adaptation and parameter filling on the semantic understanding result through a template matching engine based on the semantic understanding result and the semantically annotated DSL specification to obtain a standardized DSL execution script;

[0119] Decomposition module 205, for executing the script according to the DSL, parsing the script content and decomposing the tasks through the task parser, and obtaining a task execution plan including a chart configuration task sequence and task dependency relationships;

[0120] The allocation module 206 is configured to perform parallel scheduling and resource allocation on the task sequence through a chart engine scheduler according to the task execution plan, so as to obtain a visual chart that meets the user's analysis requirements.

[0121] Through the collaborative cooperation of the above components, by building a specific domain description language DSL specification library, establishing a semantic unit classifier to classify and annotate the semantic units in the DSL specification library, unified and standardized management of chart type description semantics, data operation semantics and computational analysis semantics is achieved, providing a standardized semantic foundation for subsequent semantic understanding and chart generation; secondly, based on the semantically annotated DSL specification, a knowledge vector space is constructed, and the domain knowledge content is vectorized through a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships, which effectively improves the accuracy of knowledge representation and retrieval efficiency; thirdly, based on the structured knowledge base and user question content, the semantic understanding model is used to realize the question content It accurately understands the user's intention and historical association information, organically combines keyword extraction and contextual association analysis, and accurately captures the user's analysis intention and historical association information; in addition, the template matching engine performs intelligent template adaptation and parameter filling on the semantic understanding results to generate a standardized DSL execution script, ensuring the accurate conversion from user intention to specific configuration; moreover, the task parser systematically parses and decomposes the DSL execution script to obtain a task execution plan containing a chart configuration task sequence and task dependency relationships, thus achieving reasonable organization and efficient execution of tasks; finally, the chart engine scheduler performs intelligent parallel scheduling and resource allocation on the task sequence, ensuring the full utilization of system resources and a significant improvement in chart generation efficiency.

[0122] The present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions, which, when executed on a computer, cause the computer to execute the steps of the method for generating a chart through a question-and-answer dialogue.

[0123] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0124] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0125] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating a chart through a question-answering dialogue, characterized in that: The method for generating a chart through a question-and-answer dialogue includes: A description language DSL specification library is constructed based on chart configuration elements, data query syntax, and calculation operation rules. The semantic units in the DSL specification library are classified and annotated using a semantic unit classifier to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics, and calculation analysis semantics. Constructing a knowledge vector space according to the semantically annotated DSL specification, vectorizing the domain knowledge content through a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships; Based on the structured knowledge base and the user's question content, the semantic understanding model is used to extract keywords and analyze context associations of the question content to obtain a semantic understanding result that includes the current conversation intention and historical association information; Based on the semantic understanding result and the semantically annotated DSL specification, template adaptation and parameter filling are performed on the semantic understanding result by a template matching engine to obtain a standardized DSL execution script, including: performing semantic feature analysis on the semantic understanding result, obtaining core semantic attributes of the dialogue intent by a feature extractor, and obtaining a semantic feature vector set; performing similarity matching between the template library in the semantically annotated DSL specification and the semantic feature vector set, identifying the best matching template by vector distance calculation, and obtaining a basic DSL template; extracting key parameter information from the semantic understanding result, mapping the parameter values ​​to the placeholder positions of the basic DSL template by a parameter parser, and obtaining a parameterized DSL script; performing syntax verification on the parameterized DSL script, analyzing the integrity and legality of the script structure by a syntax checker, and obtaining a verified DSL script; optimizing and combining data operation instructions and calculation analysis instructions in the verified DSL script, generating an optimal execution sequence by an instruction optimizer, and obtaining an optimized DSL script; and performing unified and standardized processing on the script format by a standardization processor based on the syntax rules of the optimized DSL script, and obtaining the standardized DSL execution script; According to the DSL execution script, the script content is parsed and the tasks are decomposed by a task parser to obtain a task execution plan including a graph configuration task sequence and task dependency relationships, including: performing grammatical structure parsing on the DSL execution script, identifying the operation instructions and configuration parameters in the script by a grammatical analyzer, and obtaining an instruction sequence and a parameter set; grouping and classifying the instruction sequence according to the configuration objects, organizing the related configuration operations into task units by an instruction classifier, and obtaining a basic task set; performing data flow analysis on the task units in the basic task set, identifying the input and output associations between tasks by a dependency analyzer, and obtaining a task dependency graph; topologically sorting the task nodes in the task dependency graph according to the dependency relationships, constructing a task execution order by a sorting algorithm, and obtaining an initial task sequence; performing parallelism analysis on the tasks in the initial task sequence, identifying the task groups that can be executed in parallel by a task scheduling analyzer, and obtaining a task parallelization plan; optimizing and reorganizing the task dependency graph according to the task parallelization plan, and generating an execution plan by a task scheduler to obtain the task execution plan including the graph configuration task sequence and task dependency relationships; According to the task execution plan, the task sequence is scheduled in parallel and resources are allocated through the chart engine scheduler to obtain a visual chart that meets the user's analysis needs.

2. The method for generating a chart through a question-and-answer dialogue according to claim 1, wherein: The description language DSL specification library is constructed based on the chart configuration elements, data query syntax, and calculation operation rules, and the semantic units in the DSL specification library are classified and annotated using a semantic unit classifier to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics, and calculation analysis semantics, including: Perform semantic decomposition of the chart configuration elements through a type analysis module to obtain a configuration element set including chart dimensions, indicators, styles, and interactions; The data query grammar is divided into filtering conditions, grouping rules, aggregation methods and sorting methods according to the data operation type, and the corresponding syntax tree structure is generated by the syntax parser to obtain a standardized query grammar template; the filtering conditions define the data screening rules, including equal value filtering, range filtering, and fuzzy matching; The calculation operation rules are classified and sorted into arithmetic operators, statistical functions, and logical relationships, and a calculation expression library is constructed by a rule extractor to obtain a standardized calculation grammar structure; Based on the configuration element set, the standardized query syntax template and the normalized calculation syntax structure, a semantic mapper is used to establish associations between DSL semantic units to obtain an initialized DSL specification library; The semantic unit classifier is configured as a chart type identification unit, a data operation identification unit, and a calculation analysis identification unit, and multi-dimensional feature extraction is performed on the semantic units in the initialized DSL specification library to obtain a semantic feature vector; According to the semantic feature vector, the semantic units are grouped and classified by a hierarchical clustering algorithm, and a semantic category index is established to obtain the semantically annotated DSL specification including the chart type description semantics, data operation semantics and computational analysis semantics.

3. The method for generating a chart through a question-and-answer dialogue according to claim 1, wherein: The knowledge vector space is constructed according to the semantically annotated DSL specification, and the domain knowledge content is vectorized by a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships, including: Parsing the semantically annotated DSL specification, extracting semantic structural features through a semantic mapper, and obtaining feature description data including semantic types and semantic relationships; Inputting the feature description data into a knowledge vector builder, generating a multidimensional vector representation through a vector space projection algorithm, and obtaining an initial knowledge vector space; Optimizing the dimension of the initial knowledge vector space, and performing dimensionality reduction processing on the vector space by a principal component analysis method to obtain a compressed vector space structure; Based on the compressed vector space structure, the domain knowledge content is segmented and each knowledge segment is converted into a vector representation by a semantic encoder to obtain a knowledge vector sequence; Associating and matching the knowledge vector sequence with the data field, determining the mapping relationship between the field and the knowledge fragment through similarity calculation, and obtaining a field mapping table; Based on the knowledge vector sequence and the field mapping table, an association network between knowledge units is established through a relationship organizer to obtain the structured knowledge base containing the knowledge vector and field mapping relationship.

4. The method for generating a chart through a question-and-answer dialogue according to claim 1, wherein: The structured knowledge base and the user's question content are used to extract keywords and perform contextual association analysis on the question content through the semantic understanding model to obtain a semantic understanding result containing the current conversation intention and historical association information, including: Performing syntactic analysis on the user's question content, extracting dependency relationships between sentence components through a syntactic tree builder, and obtaining a syntactic structure tree of the question content; Performing semantic matching between the knowledge vectors in the structured knowledge base and the syntactic structure tree, identifying key information segments through cosine similarity calculation, and obtaining a question keyword set; Performing semantic expansion on the question keyword set, establishing an inter-word relationship network through knowledge association analysis, and obtaining a semantic association graph; Retrieving historical conversation records based on the semantic association graph, extracting conversation topic link relationships through a context associator, and obtaining a conversation context sequence; Fusing the conversation context sequence with the current question content, combining related information through a semantic fuser, and obtaining a conversation intention feature vector; According to the semantic feature distribution in the dialogue intention feature vector, the correlation between the current dialogue intention and the historical information is determined through multi-layer semantic analysis to obtain the semantic understanding result including the current dialogue intention and the historical correlation information.

5. The method for generating a chart through a question-and-answer dialogue according to claim 1, wherein: According to the task execution plan, the task sequence is parallel scheduled and resources are allocated through the chart engine scheduler to obtain a visual chart that meets the user's analysis needs, including: Performing resource requirement analysis on the task execution plan, calculating the computing resource consumption of each task through a resource evaluator, and obtaining a task resource requirement list; Grouping the tasks in the task resource requirement list according to the degree of parallelism, matching computing resources for each group of tasks through a resource allocator, and obtaining a resource allocation plan; Scheduling the task groups in the resource allocation scheme, formulating a task execution schedule through a scheduling strategy generator, and obtaining a task scheduling plan; Import the task scheduling plan into the chart engine, obtain the data set and configuration parameters required for the task through the data loader, and obtain the chart rendering data package; Performing data conversion on the chart rendering data packet according to the chart configuration requirements, adjusting the data format and calculating statistical values ​​through a data converter to obtain a chart data structure; According to the chart data structure and visualization configuration information, the layout and style settings of the chart elements are completed by a rendering processor to obtain the visualization chart that meets the user's analysis needs.

6. The method for generating a chart through a question-and-answer dialogue according to claim 5, characterized in that: The resource requirement analysis of the task execution plan is performed, and the computing resource consumption of each task is calculated by a resource evaluator to obtain a task resource requirement list, including: Performing a complexity evaluation on each task in the task execution plan, determining the time complexity and space complexity of the task by using a computational complexity analyzer, and obtaining a task complexity index list; Convert the complexity data in the task complexity index list into resource consumption estimates, quantify CPU occupancy, memory usage, and IO bandwidth requirements through a resource consumption calculator, and obtain basic resource consumption data; Performing data scale factor compensation on the basic resource consumption data, calculating the influence coefficient of data processing scale on resource consumption through a data volume analyzer, and obtaining a scale-corrected resource consumption estimate; Performing task concurrency analysis based on the resource consumption estimate after the scale correction, evaluating resource contention of simultaneously running tasks using a concurrency calculator, and obtaining a concurrency resource consumption matrix; Matching and analyzing the concurrent resource consumption matrix with the system resource capacity, calculating resource utilization and saturation through a resource capacity analyzer, and obtaining a resource allocation recommendation; The task resource requirements are prioritized according to the resource allocation proposal, and a resource allocation strategy is generated by a resource allocator to obtain the task resource requirement list.

7. A system for generating a chart through a question-answering dialogue, for implementing the method for generating a chart through a question-answering dialogue according to any one of claims 1 to 6, characterized in that: The system for generating a chart through a question-answering dialogue includes: An annotation module is used to construct a description language DSL specification library based on chart configuration elements, data query syntax, and calculation operation rules, and classify and annotate the semantic units in the DSL specification library using a semantic unit classifier to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics, and calculation analysis semantics; A construction module is used to construct a knowledge vector space according to the semantically annotated DSL specification, and vectorize the domain knowledge content through a semantic encoder to obtain a structured knowledge base containing knowledge vectors and field mapping relationships; An association module is used to extract keywords and perform context association analysis on the question content based on the structured knowledge base and the user's question content through a semantic understanding model to obtain a semantic understanding result that includes the current conversation intention and historical association information; A filling module is used to perform template adaptation and parameter filling on the semantic understanding result through a template matching engine based on the semantic understanding result and the semantically annotated DSL specification to obtain a standardized DSL execution script; A decomposition module is used to execute the script according to the DSL, parse the script content and decompose the tasks through the task parser, and obtain a task execution plan including a chart configuration task sequence and task dependency relationship; The allocation module is used to perform parallel scheduling and resource allocation on the task sequence through the chart engine scheduler according to the task execution plan, so as to obtain a visual chart that meets the user's analysis needs.

8. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the method for generating a chart through a question-and-answer dialogue according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Intelligent report generation method and system based on large model

    CN119026580A