Method and system for generating chart through question and answer dialogue and storage medium

By constructing a description language DSL specification library and knowledge vector space, combining the semantic understanding model and the chart engine scheduler, the problem of lack of intelligent semantic understanding and dialogue context coherence in the existing technology is solved, and an efficient and intelligent chart generation process is achieved.

CN119578392AActive Publication Date: 2025-03-07BEIJING YONGHONG SHANGZHI TECH

Patent Information

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

AI Technical Summary

Technical Problem

The prior art lacks intelligent semantic understanding ability in the process of chart generation, cannot directly convert the user's natural language description into accurate chart configuration instructions, and it is difficult to maintain the context coherence of the conversation in multiple rounds of dialogue scenarios, and cannot intelligently understand and handle user's intention changes.

Method used

By constructing a description language DSL specification library, using a semantic unit classifier to classify and annotate the semantic units in the DSL specification library, establish a knowledge vector space, and perform keyword extraction and context correlation analysis of user questions through the semantic understanding model, generate standardized DSL execution scripts, and perform parallel scheduling and resource allocation through the chart engine scheduler.

Benefits of technology

It realizes accurate understanding of user intentions and intelligent chart generation, improves the efficiency and quality of chart generation, and ensures the full utilization of system resources and the consistency and intelligence of the chart generation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119578392A_ABST
    Figure CN119578392A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a method and system for generating a chart through question and answer dialogues and a storage medium. The method comprises the following steps: carrying out semantic understanding on questions of a user, and extracting keywords and context information; then generating a normalized DSL script based on the semantic understanding result and the DSL specification; analyzing the DSL script to obtain a chart configuration task sequence and a dependency relationship; and finally, carrying out parallel scheduling and resource allocation on the task sequence to generate a visual chart meeting user analysis requirements. According to the task features and the system resource conditions, the execution strategy is dynamically optimized, and the efficiency and quality of chart generation are improved.
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] In the existing chart generation technology, most of them use predefined templates or fixed configurations to generate charts. Users need to specify the specific configuration of the chart through interface operations or writing code. This method requires users to have certain professional knowledge of data analysis and visualization, and need to understand the applicable scenarios of various charts and the corresponding configuration parameters. At the same time, the existing chart generation method is usually a one-way configuration process, 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 modify configuration parameters repeatedly to obtain satisfactory visualization effects. In addition, when dealing with multiple rounds of dialogue, the existing technology has difficulty in accurately understanding the changes in user intentions and cannot effectively reuse the context information in historical dialogues, resulting in a lack of coherence and intelligence in the chart generation process.

[0003] The main problems with the existing technology include: first, the chart generation process lacks intelligent semantic understanding capabilities and cannot directly convert the user's natural language description into accurate chart configuration instructions; second, the task scheduling of data processing and chart rendering lacks flexibility, and it is difficult to dynamically adjust the resource allocation strategy according to actual needs; third, in multi-round dialogue scenarios, the existing technology has difficulty maintaining the contextual coherence of the dialogue and cannot intelligently understand and process changes in user intentions; finally, the chart generation process lacks an adaptive optimization mechanism, and it is 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, which are used to accurately capture changes in user intentions through semantic understanding and contextual association analysis of multiple rounds of dialogues, and automatically generate visual charts that meet user needs in combination with professional knowledge in the knowledge base. At the same time, the method also provides a flexible task scheduling and resource allocation mechanism, which can dynamically optimize execution strategies according to task characteristics and system resource conditions, and improve 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 for generating a chart through a question-and-answer dialogue comprising: constructing a description language DSL specification library according to chart configuration elements, data query syntax and calculation operation rules, classifying and annotating semantic units in the DSL specification library through a semantic unit classifier, and obtaining 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 domain knowledge content through a semantic encoder, and obtaining a structured knowledge base containing knowledge vectors and field mapping relationships; and obtaining a structured knowledge base according to the structured knowledge base and user question content. , the question content is subjected to keyword extraction and context association analysis through the semantic understanding model to obtain a semantic understanding result including the current conversation intention and historical association information; based on the semantic understanding result and the semantically annotated DSL specification, the semantic understanding result is subjected to template adaptation and parameter filling through the template matching engine to obtain a standardized DSL execution script; according to the DSL execution script, the script content is parsed and the task is decomposed through the task parser to obtain a task execution plan including a chart configuration task sequence and task dependency; according to the task execution plan, the task sequence is parallel scheduled and resource allocated through 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, wherein the system for generating a chart through a question-and-answer dialogue comprises:

[0007] An annotation module is used to construct a description language DSL specification library according to chart configuration elements, data query syntax and calculation operation rules, and classify and annotate 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;

[0008] A construction module is used to construct a knowledge vector space according to the semantically annotated DSL specification, and to 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 through a semantic understanding model based on the structured knowledge base and the user's question content, so as to obtain a semantic understanding result including 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;

[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, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable 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 the present application, by constructing a domain-specific description language DSL specification library, a semantic unit classifier is established to classify and annotate the semantic units in the DSL specification library, thereby realizing unified and standardized management of chart type description semantics, data operation semantics, and computational analysis semantics, and 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 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 the user's question content, the semantic understanding model is used to accurately understand the question content. It can accurately understand the situation, organically combine keyword extraction and context association analysis, and 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 performs systematic parsing and task decomposition on the DSL execution script to obtain a task execution plan including chart configuration task sequence and task dependency, 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 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 accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0016] Figure 1A 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 a chart through a question-and-answer dialogue in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The present application embodiment provides 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 the present 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 here can be implemented in an order other than the content illustrated or described here. 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 , an embodiment of the method for generating a chart through a question-and-answer dialogue in an embodiment of the present application includes:

[0020] Step S101: construct a description language DSL specification library according to chart configuration elements, data query syntax and calculation operation rules, classify and annotate the semantic units in the DSL specification library through a semantic unit classifier, and 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 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;

[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 analyze context associations on the question content to obtain a semantic understanding result including 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, 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;

[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 the present 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 present application embodiment is described by taking a 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, and includes three core components: chart configuration elements, data query syntax, and calculation operation rules. Chart configuration elements define the basic composition of charts, including chart types (such as line charts, bar charts, pie charts), axis settings (such as titles, scales, units), data series configurations (such as names, colors, styles), and interactive behaviors (such as zooming, filtering, and drilling). Data query syntax specifies the rules for data operations, covering operations such as data filtering (where conditions), group aggregation (group by), sorting (order by), and associative query (join). Calculation operation rules include the definition of mathematical operators, statistical functions, and logical expressions. The semantic unit classifier classifies and annotates these specifications, dividing the semantic units into chart type description semantics (used to identify the chart type that the user wants), data operation semantics (used to understand data processing requirements), and calculation analysis semantics (used to parse calculation logic), thereby forming semantically annotated DSL specifications. Based on the semantically annotated DSL specifications, the semantic encoder begins to build a knowledge vector space. The semantic encoder performs word segmentation and semantic feature extraction on the domain knowledge content, and converts each knowledge fragment into a high-dimensional vector representation. These vectors contain the semantic information of knowledge, and the distance between vectors reflects the semantic similarity between knowledge. In the vector space, knowledge points with similar semantics will be clustered together to form knowledge clusters. At the same time, the semantic encoder establishes a field mapping relationship to associate the data field with the corresponding knowledge vector, which is convenient for subsequent accurate semantic matching. In this way, a structured knowledge base containing knowledge vectors and field mapping relationships is obtained. When a user asks a question, the semantic understanding model first performs semantic understanding based on the structured knowledge base and the content of the user's question. The keyword extractor identifies the core vocabulary in the question and searches for related knowledge content in the knowledge vector space. At the same time, the context association analyzer tracks the conversation history and understands the association between the current question and the previous conversation. For example, when a user asks "help me change it to a bar chart", the context analysis can know that "it" refers to the line chart generated last time. In this way, a semantic understanding result containing the current conversation intention and historical association information is obtained.

[0028] The template matching engine receives the semantic understanding results and matches them with the templates in the semantically annotated DSL specification. It first finds the most matching DSL template based on semantic similarity, and then fills the specific parameters in the semantic understanding results into the template. For example, when the user says "show the sales comparison of each department in the past three months", the template matching engine will select the bar chart template and fill in parameters such as time range (the past three months), grouping dimension (department) and measure value (sales) to generate a standardized DSL execution script. The task parser parses the DSL execution script and decomposes it into a series of specific chart configuration tasks. These tasks include setting the chart type, configuring the coordinate axis, adding data series, setting the style, etc. At the same time, the task parser analyzes the dependencies between tasks to determine which tasks need to be executed in sequence and which tasks can be processed in parallel. For example, loading data must be completed before drawing the data series, while setting the chart title and configuring the legend can be executed in parallel. In this way, a task execution scheme containing the chart configuration task sequence and task dependencies is obtained.

[0029] The chart engine scheduler schedules and allocates resources to the task sequence in a reasonable manner according to the task execution plan. It first evaluates the resource requirements (CPU, memory, IO, etc.) of each task, and then formulates a parallel execution strategy based on the system resource status. For tasks that can be run in parallel, the scheduler allocates resources and starts execution at the same time; for tasks that have dependencies, it ensures that they are executed serially in the correct order. Finally, the chart renderer generates a visual chart that meets the user's analysis needs based on the task execution results.

[0030] For example, when a user wants to analyze a company's sales data, he or she first asks "Help me analyze the sales trends of different product lines in each quarter in the past two years." The semantic understanding model extracts key information such as time range (the past two years), time granularity (quarter), grouping dimension (product line), and analysis indicator (sales) from this question. Then the template matching engine selects the line chart template because it is suitable for showing trend changes and generates the corresponding DSL script. The task parser decomposes the script into: data query tasks (aggregating sales data by quarter and product line), coordinate axis configuration tasks (X-axis shows quarter, Y-axis shows sales), data series configuration tasks (one line for each product line), etc. After these tasks are processed in parallel by the scheduler, a line chart that clearly shows the sales trends of each product line is generated. The data series in the chart is calculated by aggregating the original transaction data by quarter and grouping by product line, showing the sales change rules of different product lines.

[0031] In the embodiment of the present application, by constructing a domain-specific description language DSL specification library, a semantic unit classifier is established to classify and annotate the semantic units in the DSL specification library, thereby realizing unified and standardized management of chart type description semantics, data operation semantics, and computational analysis semantics, and 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 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 the user's question content, the semantic understanding model is used to realize accurate understanding of the question content. It combines keyword extraction and context 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 performs systematic parsing and task decomposition on the DSL execution script to obtain a task execution plan including chart configuration task sequence and task dependency, 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 full utilization of system resources and 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 sorted 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, the chart configuration elements are semantically decomposed. Chart configuration elements are the basic configuration units in the chart generation process. Through semantic decomposition, a set of configuration elements including chart dimensions, indicators, styles, and interactions can be obtained. Chart dimensions refer to the classification axes in the chart, such as time dimension, geographic dimension, product dimension, etc.; indicators represent the numerical data that needs to be measured, such as sales, profit margin, growth rate, etc.; styles include the visual representation of the chart, such as color, font, border, etc.; interactions define the user's interaction with the chart, such as floating prompts, click drilling, area selection, etc. The type analysis module splits each configuration element into basic semantic units through semantic tree parsing and establishes a hierarchical relationship between semantic units. As an important part of the DSL specification library, data query syntax needs to be systematically divided according to the data operation type. Filter conditions define data filtering rules, including equal value filtering, range filtering, fuzzy matching, etc.; grouping rules specify the dimensions of data aggregation and determine how data is grouped according to specific fields; aggregation methods describe the statistical methods for grouped data, such as sum, average, maximum value, etc.; sorting methods specify the order of data arrangement, 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] Calculation operation rules are the core part of data operation processing in DSL specifications. The rule extractor classifies and organizes the calculation operation rules into three categories: arithmetic operators (such as addition, subtraction, multiplication and division), statistical functions (such as average, standard deviation, correlation coefficient) and logical relations (such as greater than, less than, equal to). The rule extractor converts each operation rule into a formal expression through syntax analysis and semantic understanding, and builds a unified calculation expression library. This expression library is organized in a tree structure, which is convenient for the combination and nesting of complex calculations and forms a standardized calculation syntax structure.

[0041] The semantic mapper establishes the association between DSL semantic units based on the obtained configuration element set, standardized query syntax template and normalized calculation syntax structure. The semantic mapper first constructs a semantic association network, maps the semantic units of the three parts into the same semantic space, and determines the association strength between the units by calculating the semantic similarity. Connections are established between semantic units with strong correlation to form a semantic association graph, which reflects the combination mode and usage rules of different semantic units in practical applications, thereby obtaining the initialized DSL specification library. As a core component, the semantic unit classifier contains three functional units: the chart type recognition unit is responsible for identifying and classifying different types of chart semantics; the data operation recognition unit processes data query and processing related semantics; and the calculation analysis recognition unit focuses on the semantic understanding of mathematical calculation and statistical analysis. The classifier extracts features from each semantic unit in the initialized DSL specification library, considering multiple dimensions such as semantic content, usage scenarios, and combination rules, and represents each semantic unit as a high-dimensional feature vector.

[0042] Based on the obtained semantic feature vectors, the hierarchical clustering algorithm begins to group and classify semantic units. The hierarchical clustering algorithm calculates the distance between feature vectors and merges semantically similar units from bottom to top to form a hierarchical clustering structure. During the clustering process, a semantic category index is established at the same time, and an index entry is created for each semantic category to facilitate subsequent rapid retrieval and matching. The resulting semantically annotated DSL specification contains chart type description semantics, data operation semantics, and computational analysis semantics, providing a semantic basis for subsequent chart generation.

[0043] For example, when it is necessary to analyze the sales data of a certain enterprise, the type analysis module is first used to semantically decompose the requirement of "statisticing monthly sales by product category". The configuration element set will include: dimensions (time-month, product category), indicators (sales), styles (bar chart style) and interactions (data point floating to display details). The data query syntax will generate a query template containing product category and month, with sales as the aggregation method. The calculation operation rules will include expressions for sum operation and year-on-year calculation. These semantic units are analyzed by the semantic mapper to establish the connection between chart configuration, data query and calculation processing, forming a semantic network. The semantic unit classifier will classify these units into categories such as chart type (bar chart), data operation (group aggregation) and calculation analysis (sum statistics). Finally, these semantic units are organized into a hierarchical semantic structure through hierarchical clustering to facilitate 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 including 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 a 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) 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 the field mapping table;

[0050] (6) Based on the knowledge vector sequence and the 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, the semantically annotated DSL specification is a specification system that contains multi-dimensional semantic information such as chart types, data operations, and computational analysis. The semantic mapper identifies the semantic nodes and hierarchical relationships between nodes in the DSL specification through the syntax tree analysis method. Each semantic node contains specific semantic type information (such as chart type, data operation instructions, computational expressions, etc.) and the association relationship with other nodes (such as parent-child relationship, parallel relationship, dependency relationship, etc.). The semantic mapper extracts features from these semantic nodes and generates feature description data containing semantic types and semantic relationships. The feature description data is a multidimensional matrix, in which each row represents a semantic node, each column represents a feature dimension, and the value of the matrix element reflects the strength or attribute of the feature. The knowledge vector builder receives the feature description data as input and maps the feature data into a high-dimensional vector space through the vector space projection algorithm. The vector space projection algorithm uses word embedding technology to represent each semantic node as a vector of fixed dimension. In this process, nodes with similar semantics are closer in the vector space, and nodes with large semantic differences are farther away. Vector space projection not only retains the information of the original features, but also encodes the semantic similarity through the distance relationship between vectors. In this way, the initial knowledge vector space is obtained, which contains the vector representations of all semantic nodes.

[0052] The initial knowledge vector space usually has a high dimension. In order to improve the efficiency of subsequent processing, dimension optimization is required. The principal component analysis method calculates the covariance matrix of the eigenvector to identify the principal component direction that contributes most to the data change. By retaining the main feature dimensions and discarding the dimensions with smaller contributions, the dimensionality reduction of the vector space is achieved. This process not only reduces the storage and computing overhead of the data, but also removes the noise in the data, making the semantic representation purer and more efficient. Based on the compressed vector space structure, the semantic encoder begins to process the domain knowledge content. The domain knowledge content includes information such as professional knowledge, business rules, and best practices related to chart generation. The semantic encoder segments the knowledge content and divides it into semantic knowledge fragments. Each knowledge fragment undergoes preprocessing steps such as word segmentation and part-of-speech tagging, and then is converted into a vector representation through a word embedding model. These vectors constitute a sequence of knowledge vectors. Each vector in the sequence corresponds to a specific knowledge fragment, and the relationship between the vectors reflects the semantic connection between the knowledge fragments.

[0053] The knowledge vector sequence needs to establish a mapping relationship with the actual data field. The similarity calculator determines the strength of the association between the knowledge vector and the field semantic vector by calculating the cosine similarity between them. When the similarity exceeds the preset threshold, a mapping relationship between the field and the knowledge fragment is established. These mapping relationships are recorded in the field mapping table, which contains information such as the field name, the corresponding knowledge fragment identifier, and the mapping confidence. 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 association relationship between them. The topological structure of the network reflects the overall organization of the knowledge system, including the hierarchical relationship, association strength, and semantic distance of knowledge. This forms a structured knowledge base that not only contains the vector representation of knowledge, but also maintains the field mapping relationship.

[0055] For example, in the enterprise data analysis scenario, it is necessary to build a knowledge base that supports sales data visualization. First, the semantic mapper extracts semantic nodes related to sales analysis from the DSL specification, such as "sales", "year-on-year growth", "product classification", etc., and analyzes the relationship between them. After these nodes are projected in the vector space, the initial knowledge vector distribution is formed in the high-dimensional space. The principal component analysis compresses the original 100-dimensional vector space to 20 dimensions by identifying the main change direction, while maintaining the key semantic information. The semantic encoder processes the professional knowledge in the field of sales analysis, such as "sales calculation rules", "year-on-year analysis method", etc., and converts them into vector sequences. Then, these knowledge vectors are matched with the actual database fields (such as "order_amount", "product_category", etc.) for similarity to establish a mapping relationship at the semantic level. Finally, the relationship organizer organizes these elements into a structured knowledge network to support the subsequent chart generation process. Through this knowledge base, when the user puts forward a requirement such as "show the year-on-year sales change of each product category by quarter", it can accurately understand the user's intention and find the corresponding data fields and calculation methods, so as to generate accurate visualization charts.

[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 a set of question keywords;

[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 that includes 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 the subject-predicate-object relationship, modification relationship and logical association in the sentence. Dependency syntactic analysis regards each word in the sentence as a node, and uses arc lines to mark the grammatical relationship between words to construct a tree structure. In this syntactic structure tree, the dependency relationship between words is clearly visible: the subject and predicate are in a subject-predicate relationship, the predicate and object are in a verb-object relationship, and the attributive and central word are in a modification relationship.

[0064] The knowledge vectors stored in the structured knowledge base contain a large amount of pre-encoded domain knowledge. The word nodes in the syntactic structure tree are matched with the knowledge vectors through cosine similarity calculation. Cosine similarity calculation considers the direction of the vector rather than the size, and can effectively measure the degree of semantic similarity. In the matching process, not only single words are matched, but also the semantic association of word combinations is considered. By setting the similarity threshold, the knowledge fragments most relevant to the user's question are screened out to form a question keyword set. After receiving the question keyword set, the knowledge association analyzer performs semantic expansion processing. The expansion process is based on the association propagation mechanism of the knowledge graph, taking each keyword as the starting point and exploring related concepts along the knowledge association edge. 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 too much irrelevant information. In this way, a semantic association graph centered on the core keyword and containing various related concepts is constructed.

[0065] Based on the constructed semantic association graph, the context associator starts to retrieve historical conversation records. It first maps each round of conversation in the conversation history to the semantic space, and then calculates the semantic similarity between the current semantic association graph and the historical conversation. Through the graph matching algorithm, the evolution path and association mode of the conversation topic are identified, and the coherent conversation topic links are extracted. These links are organized in time sequence to form a conversation context sequence, which reflects the continuity and change trend of the conversation topic. The semantic fusion device deeply fuses the conversation context sequence with the current question content. The fusion process uses the attention mechanism to assign different weights to historical information according to the semantic relevance. Historical information with high relevance is given a larger weight, so it plays a greater role in the fusion process. The result of the fusion is a multi-dimensional feature vector, which not only contains the semantic information of the current question, but also encodes the relevant historical context information.

[0066] The multi-layer semantic analyzer analyzes the fused feature vectors. It uses a hierarchical analysis strategy to gradually extract semantic features from the word meaning layer, sentence meaning layer to the text layer. At each level, the correlation between the current conversation intention and historical information is calculated to form a multi-dimensional semantic understanding result. This result includes the specific intention of the current conversation (such as query trends, comparison of values, analysis of distribution, etc.) and the correlation with historical conversations (such as continuity analysis, comparative analysis, supplementary analysis, etc.).

[0067] For example, in the enterprise data analysis scenario, users have the following conversations: the first round of questions is "analyze the sales distribution of each department last year", the second round of questions is "show the quarterly trends of the three departments with the best performance", and the third round of questions is "how are their per capita sales". In the face of the third round of questions, the syntactic analyzer first builds a syntactic tree to identify "they" as a pronoun and "per capita sales" as a key analysis indicator. Through knowledge vector matching, it is confirmed that "they" refers to the three departments with the best performance in the previous round. In the semantic expansion stage, related concepts such as "number of people in a department", "total sales" and calculation rules are expanded based on "per capita sales". Context association analysis shows that the current question and the previous two rounds form an analysis link of "overall distribution-focus-analysis". Semantic fusion integrates this information to form a complete semantic expression including "object scope (three key departments)", "time scope (by quarter)", and "analysis indicator (per capita sales)". The final multi-layer semantic analysis determines that this is an intention to analyze a new indicator on a subset of target departments, and it is necessary to calculate the new indicator value based on the department scope of 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 the combination of 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 grammatical rules of the optimized DSL script, the script format is standardized through a 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. The semantic understanding results contain user conversation intentions and historical association information. The feature extractor extracts core semantic attributes through semantic analysis technology. The core semantic attributes include chart type preferences (such as line charts, bar charts, scatter plots), data analysis requirements (such as trend analysis, comparative analysis, distribution analysis), time granularity (such as year, quarter, month), dimension selection (such as product, region, department) and metrics (such as sales, profit margin, growth rate). These semantic attributes are vectorized to form a set of multidimensional semantic feature vectors, each of which represents a specific aspect of the conversation intention. The template library in the semantically annotated DSL specification stores various predefined chart generation templates. Each template is annotated with its applicable semantic scenario, including chart type, data processing logic and visualization configuration. The vector distance calculator calculates the distance between the semantic feature vector set and the template semantic annotation to identify the best matching DSL template. The vector distance calculation uses measurement methods such as Euclidean distance or cosine similarity to comprehensively consider the matching degree of 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 chart generation.

[0076] The parameter parser receives the semantic understanding results and extracts specific parameter information from them. Parameter information includes data screening conditions (such as time range, geographical range), aggregation calculation rules (such as sum, average, maximum value), display configuration (such as color scheme, label style), etc. The parameter parser fills these parameter values ​​into the corresponding placeholder positions of the basic DSL template according to the predefined mapping rules. Placeholders are identified by specific tags, and the parameter filling process will perform type checking and format conversion at the same time to ensure that the parameter values ​​meet the template requirements.

[0077] The syntax checker performs a comprehensive check on the DSL script after the parameters are filled. The check includes the integrity of the syntax structure (such as bracket matching, statement integrity), the legality of the parameter type (such as value range, string format), and the logic of the instruction sequence (such as dependencies, execution order). The syntax checker adopts a bottom-up analysis strategy to verify each component of the script layer by layer, discover and mark problems that need to be corrected. Scripts that pass the syntax check are marked as valid and enter the next step of optimization processing.

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

[0079] For example, a user needs to analyze the sales data of a certain company and puts forward the requirement of "displaying the sales and year-on-year growth of each region in the past six months, and highlighting the regions with a growth rate of more than 20%". The feature extractor extracts key attributes from the semantic understanding result: chart type (trend comparison), time range (the past six months), dimension (region), indicator (sales, year-on-year growth rate), and filter condition (growth rate>20%). These attributes are converted into semantic feature vectors, matched with DSL templates in the template library, and a combined chart template that supports multi-series comparison and conditional highlighting is selected. The parameter parser extracts specific parameters: the time range is set to "LAST_6_MONTH", the dimension field is set to "region_name", the measure 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 filled in the corresponding positions of the template to form 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 contains processing logic such as data query, year-on-year calculation, conditional screening, and chart rendering, and can accurately generate visual 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 plan that includes a graph-configured task sequence and task dependencies.

[0087] Specifically, the parser performs lexical and syntactic analysis on the DSL execution script. Lexical analysis decomposes the script text into a sequence of tokens and identifies keywords, operators, identifiers, and parameter values. Syntactic analysis builds 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 extracts the instruction sequence and parameter set by traversing the syntax tree. 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 the instruction sequence, the instruction classifier groups and classifies it according to the type of configuration object. Configuration objects include data source configuration (such as data table selection, field mapping), data processing configuration (such as filtering conditions, aggregation rules), chart attribute configuration (such as axis settings, legend style) and interactive behavior configuration (such as event response, animation effect). The instruction classifier combines 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, in which each task has a clear functional positioning and boundary. The dependency analyzer performs data flow analysis on the task units in the basic task set. Data flow analysis tracks the data transmission path between tasks and identifies the input and output associations between tasks. For example, the output of the data filtering task is the input of the data aggregation task, and the aggregation result is the input data of the 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 edges indicates the direction of data flow.

[0089] The task dependency graph needs to be topologically sorted to determine the execution order of the tasks. The topological sorting algorithm selects a node with zero in-degree (i.e., a task without input dependencies) from the graph as the starting point, adds it to the execution sequence, then deletes the node and its related edges, and continues to process the next node with zero in-degree. This process continues until all nodes are processed and an initial task sequence that satisfies the dependencies is obtained. This sequence ensures that the input data required by each task is ready when it is executed. The task scheduling analyzer performs parallelism analysis on the initial task sequence. The core of parallelism analysis is to identify independent tasks that do not have direct or indirect data dependencies between them. The scheduling analyzer divides the tasks in the initial sequence into multiple task groups, and the tasks in each task group can be executed in parallel. For example, data aggregation tasks of different dimensions, or style configuration tasks of different chart elements, can be processed in parallel. In this way, a task parallel scheme is obtained, which clearly specifies which tasks can be started simultaneously and which tasks need to wait for the completion of the predecessor tasks.

[0090] The task scheduler optimizes and reorganizes the task dependency graph according to the task parallelization plan. The optimization process mainly considers two aspects: one is to ensure the load balance of parallel tasks to avoid the situation where some processing units are overloaded while others are idle; the other is to minimize the task switching overhead and try to make related tasks execute continuously on the same processing unit. The task scheduler combines these considerations and generates a task execution plan. This plan contains a detailed task sequence and the dependencies between tasks, providing an execution blueprint for graph generation.

[0091] For example, a user needs to generate a sales analysis dashboard that contains multiple chart components. The DSL script contains configurations for creating trend charts, distribution charts, and comparison charts. The parser first identifies all operation instructions from the script, such as data query instructions, data processing instructions, and chart configuration instructions. The instruction classifier organizes these instructions into different 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 chart property settings). 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. The task execution order is determined by topological sorting: data preparation is performed first, then indicator calculation, and finally chart properties are configured. Parallelism analysis finds that data processing in different regions can be parallelized, and configuration of different chart components can also be parallelized. The execution scheme distributes data processing tasks to multiple processing units for parallel execution, while chart configuration tasks are processed in order according to the layout relationship 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 rendering processor completes the layout and style setting of the chart elements to obtain a visualization chart that meets the user's analysis needs.

[0099] Specifically, in the final stage of graph generation, task execution and resource scheduling play a key role. The resource evaluator performs a comprehensive resource requirement analysis on the task execution plan. It calculates specific resource consumption indicators by evaluating the computing characteristics of each task, including data processing volume, algorithm complexity, and memory usage pattern. These indicators cover CPU computing power requirements, memory space requirements, and IO bandwidth requirements. The resource requirements of each task are recorded in detail in the task resource requirement list to provide a basis for subsequent resource allocation. The resource allocator receives the task resource requirement list and groups the tasks according to their parallel execution characteristics. The grouping process takes into account the dependencies and resource competition between tasks. For tasks that can be executed in parallel, the resource allocator will divide them into the same group while ensuring that the total resource requirements of each group of tasks do not exceed the upper limit of available resources. The resource allocation process adopts a load balancing strategy to ensure that each computing resource is reasonably utilized. The allocation result forms a resource allocation plan, which clearly specifies the computing resource quota that each task group can use.

[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 available 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, expected execution time, and completion deadline of the task. This detailed task scheduling plan ensures the orderly execution of tasks. The data loader converts the task scheduling plan into specific execution actions. It extracts relevant data sets from the data source according to the task requirements, 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 the chart rendering data packet and processes the data according to the chart configuration requirements. The processing process 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, group aggregation needs to be performed; 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 last link 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. Then set the style of each chart element, including color scheme, font style, and interactive effects. Finally, all elements are combined into a visual chart that accurately shows the data characteristics that users need 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 original transaction data by month, calculates indicators such as monthly total sales and year-on-year growth rate, 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 estimated resource consumption after scale correction, 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 list of task resource requirements.

[0110] Specifically, the complexity evaluation of a task 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 the execution of the task. Different types of tasks have different complexity characteristics: the complexity of data query tasks depends on the amount of data 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 algorithm structure of the task to obtain the complexity index of each task and form a list of task complexity indexes. The resource consumption calculator receives the list of task complexity indexes and converts the theoretical complexity into specific resource consumption estimates. This conversion process takes into account the characteristics of the hardware environment and maps the abstract complexity index to the actual resource usage. The CPU usage estimate is based on the computational intensity of the task, the memory usage estimate takes into account the space requirements of the data structure, and the IO bandwidth requirement is calculated based on the frequency and scale of data read and write operations.

[0111] The data volume analyzer is responsible for compensating the basic resource consumption data for scale factors. The scale of data processing has a significant impact on resource consumption: when the data volume increases, not only will the processing time increase, but the memory usage and IO pressure will also increase 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 degree of impact of data volume changes on resource demand and is used to adjust the basic resource consumption estimate to obtain a more accurate resource consumption estimate. The concurrency calculator analyzes the resource contention when tasks are executed concurrently based on the scale-corrected resource consumption estimate. When multiple tasks run simultaneously, they compete for resources such as CPU, memory, and IO. The concurrency calculator evaluates resource consumption under different concurrencies by building a resource competition model. This evaluation process generates a concurrency resource consumption matrix, in which each element represents the resource consumption level under a specific concurrency.

[0112] The resource capacity analyzer matches and analyzes 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. The utilization reflects the degree of resource use, and the saturation indicates whether the resources are close to a bottleneck. Based on these analysis results, the resource capacity analyzer generates a resource allocation proposal and recommends appropriate resource quotas for each task. The resource allocator prioritizes the tasks according to the resource allocation proposal and generates a resource allocation strategy. Priority sorting takes into account the importance, timeliness, and resource demand characteristics of the tasks. For tasks on the critical path, higher resource priorities are assigned; for tasks with large fluctuations in resource demand, appropriate resource buffers are reserved. This forms a task resource requirement list to provide resource guarantees for the actual execution of the tasks.

[0113] For example, when generating a sales analysis dashboard, multiple data processing and visualization tasks are involved. The data query task needs to process sales records for the past year, which contains millions of transaction data. Computational complexity analysis shows that the time complexity of the aggregate calculation summarized by month is O(n) and the space complexity is O(m), where n is the number of records and m is the number of months. Resource consumption calculation shows that the task requires 2 CPU cores and 4GB of memory for data processing. Considering the data scale factor, when the data volume doubles, the memory requirement increases to 6GB. Concurrency analysis found that when processing aggregation tasks of multiple dimensions at the same time, there is overlap in memory usage, and the actual demand is less than the sum of the single task requirements. Resource capacity analysis determined that in an 8-core 16GB environment, up to 4 aggregation tasks can be executed in parallel. The resource allocation strategy divides the aggregation tasks into two batches, with 4 CPU cores and 8GB of memory allocated to each batch to ensure that the tasks can be completed efficiently.

[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] The annotation module 201 is used to construct a description language DSL specification library according to the chart configuration elements, data query syntax and calculation operation rules, and classify and annotate the semantic units in the DSL specification library through a semantic unit classifier to obtain a semantically annotated DSL specification including chart type description semantics, data operation semantics and calculation analysis semantics;

[0116] A 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 including knowledge vectors and field mapping relationships;

[0117] The association module 203 is used to extract keywords and perform context association analysis on the question content through the semantic understanding model according to the structured knowledge base and the user's question content, so as to obtain a semantic understanding result including the current conversation intention and historical association information;

[0118] A filling module 204 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;

[0119] A decomposition module 205 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;

[0120] The allocation module 206 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 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 basis 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 query content It can accurately understand the user's intention and historical association information, organically combine keyword extraction and context association analysis, and 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 performs systematic parsing and task decomposition on the DSL execution script to obtain a task execution plan containing chart configuration task sequences and task dependencies, 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 full utilization of system resources and 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, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes the steps of the method for generating a chart through a question-and-answer dialogue.

[0123] Those skilled in the art can 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 is essentially 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, including several instructions to enable 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 codes.

[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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned 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 comprises: A description language DSL specification library is constructed according to the chart configuration elements, data query syntax and calculation operation rules, and the semantic units in the DSL specification library are classified and annotated by a semantic unit classifier to obtain a semantically annotated DSL specification including 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, and obtaining a structured knowledge base including knowledge vectors and field mapping relationships; Based on the structured knowledge base and the user's question content, the question content is subjected to keyword extraction and context association analysis through a semantic understanding model to obtain a semantic understanding result including current conversation intention and historical association information; 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; 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; 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, characterized in that: The description language DSL specification library is constructed according to the chart configuration elements, data query syntax and calculation operation rules, and the semantic units in the DSL specification library are classified and annotated by a semantic unit classifier to obtain a semantically annotated DSL specification containing chart type description semantics, data operation semantics and calculation analysis semantics, including: The chart configuration elements are semantically decomposed by a type analysis module to obtain a configuration element set including chart dimensions, indicators, styles, and interactions; The data query syntax is divided into filtering conditions, grouping rules, aggregation methods and sorting methods according to the data operation type, and a corresponding syntax tree structure is generated by a syntax parser to obtain a standardized query syntax template; The calculation operation rules are classified and sorted into arithmetic operators, statistical functions, and logical relations, 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, an association relationship between DSL semantic units is established through a semantic mapper 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 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, characterized in that: 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 multi-dimensional vector representation through a vector space projection algorithm, and obtaining an initial knowledge vector space; Optimizing the dimension of the initial knowledge vector space, reducing the dimension of the vector space by a principal component analysis method, and obtaining 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 through 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 knowledge vectors and field mapping relationships.

4. The method for generating a chart through a question-and-answer dialogue according to claim 1, characterized in that: According to the structured knowledge base and the user's question content, the question content is subjected to keyword extraction and context association analysis 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; Semantically matching the knowledge vectors in the structured knowledge base with the syntactic structure tree, identifying key information fragments through cosine similarity calculation, and obtaining a question keyword set; Performing semantic expansion on the question keyword set, establishing a 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; The dialogue context sequence is fused with the current question content, and the associated information is merged through a semantic fuser to obtain a dialogue intention feature vector; According to the distribution of semantic features 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, characterized in that: 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, including: Performing semantic feature analysis on the semantic understanding result, obtaining core semantic attributes of the dialogue intent through 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 through vector distance calculation, and obtaining a basic DSL template; Extract key parameter information from the semantic understanding result, map the parameter value to the placeholder position of the basic DSL template through a parameter parser, and obtain a parameterized DSL script; Performing syntax checking on the parameterized DSL script, analyzing the integrity and legality of the script structure through a syntax checker, and obtaining a checked DSL script; Optimizing and combining the data operation instructions and the calculation analysis instructions in the verified DSL script, generating an optimal execution sequence through an instruction optimizer, and obtaining an optimized DSL script; Based on the grammatical rules of the optimized DSL script, the script format is uniformly standardized by a standardization processor to obtain the standardized DSL execution script.

6. The method for generating a chart through a question-and-answer dialogue according to claim 1, characterized in that: The script is executed according to the DSL, and the script content is parsed and the task is decomposed by the task parser to obtain a task execution plan including a chart configuration task sequence and task dependency, including: Parsing the grammatical structure of the DSL execution script, identifying the operation instructions and configuration parameters in the script through a grammar analyzer, and obtaining an instruction sequence and a parameter set; The instruction sequence is grouped and classified according to the configuration object, and the related configuration operations are organized into task units through an instruction classifier to obtain a basic task set; Performing data flow analysis on the task units in the basic task set, identifying input-output associations between tasks through a dependency analyzer, and obtaining a task dependency graph; Topologically sorting the task nodes in the task dependency graph according to the dependency relationship, constructing the task execution order through a sorting algorithm, and obtaining an initial task sequence; Performing parallelism analysis on the tasks in the initial task sequence, identifying task groups that can be executed in parallel through a task scheduling analyzer, and obtaining a task parallelization plan; The task dependency graph is optimized and reorganized according to the task parallel scheme, and an execution plan is generated through a task scheduler to obtain the task execution scheme including the task sequence and task dependency relationship configured in the graph.

7. The method for generating a chart through a question-and-answer dialogue according to claim 1, characterized in that: 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, 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; The tasks in the task resource requirement list are grouped according to the degree of parallelism, and computing resources are matched to each group of tasks by a resource allocator to obtain 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 packet; Performing data conversion on the chart rendering data packet according to the chart configuration requirements, adjusting the data format and calculating the statistical value through a data converter to obtain a chart data structure; According to the chart data structure and visualization configuration information, the layout and style setting of the chart elements are completed by a rendering processor to obtain the visualization chart that meets the user's analysis needs.

8. The method for generating a chart through a question-answering dialogue according to claim 7, characterized in that: The resource requirement analysis is performed on the task execution plan, and the computing resource consumption of each task is calculated by a resource evaluator to obtain a task resource requirement list, including: Performing 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 resource consumption estimate after scale correction; Perform task concurrency analysis based on the estimated resource consumption after the scale correction, evaluate resource competition of simultaneously running tasks through a concurrency calculator, and obtain 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 suggestion plan; The task resource requirements are prioritized according to the resource allocation proposal, and a resource allocation strategy is generated through a resource allocator to obtain the task resource requirement list.

9. A system for generating a chart through a question-answering dialogue, used to implement the method for generating a chart through a question-answering dialogue as claimed in any one of claims 1 to 8, characterized in that: The system for generating a chart through a question-answering dialogue comprises: An annotation module is used to construct a description language DSL specification library according to chart configuration elements, data query syntax and calculation operation rules, and classify and annotate 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; A construction module is used to construct a knowledge vector space according to the semantically annotated DSL specification, and to 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 through a semantic understanding model based on the structured knowledge base and the user's question content, so as to obtain a semantic understanding result including 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; 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.

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

Citation Information

Patent Citations

  • Automatic visual chart code generation method based on machine learning

    CN113553055A

  • Visual component interaction method and system based on retail industry template knowledge base

    CN117216243A

  • LLM model-based natural language chart generation method and system, and medium

    CN118733612A

  • Intelligent report generation method and system based on large model

    CN119026580A

  • Construction method and device of knowledge base question-answering system, equipment and storage medium

    CN119293164A

Cited By

  • Multi-agent task arrangement method and system

    CN121455636A

  • A Multi-Agent Task Orchestration Method and System

    CN121455636B