A real-time data question and answer training and chart generation system

By using a real-time data question-and-answer training and chart generation system, the problems of private deployment adaptability and resource utilization in industrial internet security protection have been solved. It has achieved domain-adaptive model training, real-time accurate question answering, and intelligent chart generation, thereby improving the system's adaptability, collaboration, real-time performance, and security.

CN122432287APending Publication Date: 2026-07-21GUANGDONG ACAD OF FORESTRY
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG ACAD OF FORESTRY
Filing Date
2026-04-24
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies cannot simultaneously improve the adaptability of private deployments and resource utilization in industrial internet security protection, cannot guarantee the dynamism and data quality of the RAG knowledge base, and cannot enhance system security and operational stability.

Method used

A real-time data question-answering training and chart generation system is adopted, including a data access and preprocessing module, a domain adaptive training module, a real-time question-answering interaction module, an intelligent chart generation module, and a knowledge graph and feedback optimization module. Through multi-source heterogeneous data access, domain adaptive training, real-time question answering and chart generation, and knowledge graph optimization, it realizes domain adaptive model training, real-time accurate question answering, and intelligent chart generation.

Benefits of technology

It enhances domain adaptability, the synergy, real-time performance, and efficiency of question-and-answer and chart generation, possesses continuous optimization capabilities, and provides high security to meet the data protection needs of enterprises and institutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432287A_ABST
    Figure CN122432287A_ABST
Patent Text Reader

Abstract

The application discloses a kind of real-time data question and answer training and chart generation system, including data access and preprocessing module, field self-adaptive training module, real-time question and answer interaction module, intelligent chart generation module and knowledge graph and feedback optimization module;The data access and preprocessing module is used for the access of multi-source heterogeneous real-time data, cleaning, standardization processing and dynamic caching, and outputs structured data and real-time data stream index;The field self-adaptive training module is based on prompt auxiliary self-learning mechanism, and a small amount of labeled field data and a large amount of unlabeled data are used for model fine-tuning, to generate field-specific question and answer model, while constructing field terminology dictionary and updating in real time.The application realizes the integration function of field self-adaptive model training, real-time accurate question and answer, intelligent chart generation and continuous iteration optimization, improves user data query efficiency and data exploration ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and data visualization technology, specifically to a real-time data question-answering training and chart generation system. Background Technology

[0002] Existing technology (invention patent publication number CN120455066A) discloses a method and application for constructing a large-scale security model for industrial internet security protection. This method includes the following steps: loading the base large-scale model GLM4 and constructing a knowledge retrieval module, accessing the MITRE ATT&CK knowledge base; embedding and vectorizing the security knowledge within the MITRE ATT&CK knowledge base using knowledge features; building a vector database storage and retrieval module; activating the retrieval enhancement generation mechanism and loading the test dataset mitrettpmapping; constructing a local model and a comparative model respectively, and conducting model comparison experiments; evaluating the performance of the constructed large-scale security model in network security situation analysis tasks, evaluating the improvement effect of the model after applying the retrieval enhancement generation (RAG) mechanism, and outputting a RAG-based large-scale security model solution. This application is applicable to security situation assessment in multiple scenarios such as enterprises, industry, and mobile, and can improve the accuracy and interpretability of security content generation. Existing technology, however, cannot simultaneously improve the adaptability and resource utilization of private deployments, cannot guarantee the dynamism and data quality of the RAG knowledge base, and cannot enhance system security and operational stability. Summary of the Invention

[0003] This invention aims to solve at least one of the technical problems existing in the prior art; to this end, this invention proposes a real-time data question answering training and chart generation system that integrates domain adaptive model training, real-time accurate question answering, intelligent chart generation and continuous iterative optimization, thereby improving user data query efficiency and data insight capabilities.

[0004] To achieve the above objectives, the first aspect of the present invention provides a real-time data question-answering training and chart generation system, including a data access and preprocessing module, a domain adaptive training module, a real-time question-answering interaction module, an intelligent chart generation module, and a knowledge graph and feedback optimization module. The data access and preprocessing module is used for accessing, cleaning, standardizing, and dynamically caching multi-source heterogeneous real-time data, and outputting structured data and real-time data stream indexes. The domain-adaptive training module, based on the prompt-assisted self-learning mechanism, uses a small amount of labeled domain data and a large amount of unlabeled data to fine-tune the model, generate a domain-specific question-answering model, and simultaneously construct and update a domain terminology dictionary in real time. The real-time question-answering interaction module receives natural language queries from users, performs semantic parsing based on the dialogue context, calls the domain-specific question-answering model to generate candidate answers, verifies the accuracy of the answers by matching structured data through a dynamic retrieval mechanism, and outputs a natural language response. The intelligent chart generation module extracts data dimensions, statistical indicators and user intent during the question-and-answer interaction process, automatically selects chart types based on data characteristics and visualization rule base, generates interactive chart data and completes real-time rendering. The knowledge graph and feedback optimization module constructs a knowledge graph that integrates domain entities, relationships, and indicator systems, records user interaction feedback data, and uses reinforcement learning algorithms to iteratively optimize the domain-specific question-answering model and the intelligent chart generation module.

[0005] Preferably, the data access and preprocessing module includes a multi-source data interface unit, a real-time cleaning unit, a standardization unit, and a dynamic caching unit; The multi-source data interface unit supports access to databases, message queues, API interfaces, and streaming data, and is compatible with the data formats of relational databases, non-relational databases, and time-series databases. The real-time cleaning unit uses a combination of rule engine and AI anomaly detection to remove duplicate data, correct erroneous data, and fill in missing data. The AI ​​anomaly detection is based on the isolated forest algorithm to identify outliers in the data. The standardization unit converts data of different formats into a preset structured format, normalizes the magnitude of numerical data, and performs word segmentation, part-of-speech tagging, and entity recognition on text data. The dynamic caching unit uses Redis caching technology to cache frequently accessed data and real-time data stream indexes, and sets a cache expiration policy to ensure the consistency between cached data and source data.

[0006] Preferably, the domain-adaptive training module includes a training data construction unit, a prompt generation unit, a model fine-tuning unit, and a terminology dictionary management unit; The training data construction unit expands a small amount of labeled domain data through data augmentation technology to generate synonymous sentences, word order adjustment sentences, and scene expansion sentences, while performing pseudo-labeling on unlabeled data. The prompt generation unit generates a prompt template containing domain terminology, task description, and examples based on the characteristics of the domain task, and supports dynamic parameter replacement. The model fine-tuning unit is based on a pre-trained language model and uses low-rank adaptation technology to fine-tune parameters. It freezes the basic parameters of the pre-trained model and trains only the adapter parameters, thereby reducing training costs. The terminology dictionary management unit extracts specialized terms through domain text mining, establishes term-explanation mapping relationships, and updates the dictionary in real time by combining new word discovery results from user interaction data.

[0007] Preferably, the real-time question-and-answer interaction module includes a query receiving unit, a context management unit, a semantic parsing unit, a question-and-answer reasoning unit, and a dynamic retrieval and verification unit; The context management unit adopts a session window mechanism to store historical query and response data of the current session, sets session timeout, and supports parallel management of multiple sessions; The semantic parsing unit combines the domain terminology dictionary and the knowledge graph to perform intent recognition, entity extraction, and relation extraction on user queries. It uses a model that combines a bidirectional long short-term memory network and a conditional random field to complete named entity recognition. The question-answering reasoning unit calls the domain-specific question-answering model to generate candidate answers, and the candidate answers include core data, derivation process and referenced data source information; The dynamic retrieval verification unit, based on the BM25 algorithm and vector retrieval technology, matches the structured data and real-time data stream index to verify the accuracy of the core data in the candidate answers. If there is a deviation, the model is called again to generate the answer.

[0008] Preferably, the intelligent chart generation module includes an intent and data extraction unit, a chart type selection unit, a chart data construction unit, and a real-time rendering unit; The intent and data extraction unit extracts analytical intent from user queries and question-and-answer results, including analytical intent (comparative analysis, trend analysis, distribution analysis, and percentage analysis), data dimensions (including time dimension, spatial dimension, and category dimension), and statistical indicators (including mean, median, extreme values, and growth rate). The chart type selection unit constructs a visualization rule base, which automatically selects the chart type based on the number of data dimensions, data type, and analysis intent. Among them, trend analysis prioritizes line charts, comparison analysis prioritizes bar charts, distribution analysis prioritizes histograms, and percentage analysis prioritizes pie charts or donut charts. The chart data construction unit converts the verified core data into the standard format required for the chart, adds data labels, units and annotation information, and supports the hierarchical data structure required for data drill-down. The real-time rendering unit uses the ECharts or D3.js visualization library to complete the real-time drawing of charts and supports interactive operations such as chart zooming, panning, filtering, and viewing data details.

[0009] Preferably, the knowledge graph and feedback optimization module includes a knowledge graph construction unit, a feedback data acquisition unit, a reinforcement learning optimization unit, and a model storage unit; The knowledge graph construction unit uses a graph database to store domain entities (including indicator entities, dimension entities, and business entities), entity attributes, and relationships between entities, establishing a hierarchical structure for the indicator system and supporting the dynamic addition of entities and relationships. The feedback data collection unit records user satisfaction ratings for question-and-answer results, chart type adjustments, data correction requests, and feedback on newly added terms, generating a feedback data log. The reinforcement learning optimization unit uses user satisfaction and interaction efficiency as reward functions, and uses feedback data as reinforcement signals to adjust the inference parameters of the domain-specific question answering model and the matching weights of the chart generation rule base. The model storage unit adopts a version control mechanism to save domain-specific question-answering models and chart generation rules at different iteration stages, and supports model version backtracking.

[0010] Preferably, it also includes a security protection module, which includes an identity authentication unit, an access control unit, and a data encryption unit; The identity authentication unit supports username and password authentication, SMS verification, and third-party authentication (OAuth2.0 protocol), and performs anomaly detection for login behavior; The permission control unit is based on the role-based access control (RBAC) model, which assigns data access permissions and function operation permissions to different roles, and restricts users from querying and exporting sensitive data. The data encryption unit encrypts data during transmission using the SSL / TLS protocol and encrypts sensitive data stored using the AES-256 encryption algorithm.

[0011] 8. A real-time data question-answering training and chart generation method based on the system of any one of claims 1-7, comprising the following steps: S1: Multi-source heterogeneous real-time data is accessed, cleaned, standardized, and dynamically cached through the data access and preprocessing module, and outputs structured data and real-time data stream indexes; S2: The domain-adaptive training module uses training data to perform prompt-assisted fine-tuning of the self-learning model, generates a domain-specific question-answering model, and builds and updates a domain terminology dictionary. S3: The real-time question-answering interaction module receives users' natural language queries, performs semantic parsing based on the dialogue context, calls a domain-specific question-answering model to generate candidate answers, and outputs natural language responses after dynamic retrieval and verification. S4: The intelligent chart generation module extracts data dimensions, statistical indicators and user intent during the question-and-answer process, automatically selects the chart type and generates interactive charts, and completes real-time rendering. S5: The knowledge graph and feedback optimization module records user interaction feedback data and iteratively optimizes the domain-specific question-answering model and graph generation rules through reinforcement learning algorithms.

[0012] Preferably, the specific process of fine-tuning the prompt-assisted self-learning model in step S2 is as follows: S21: The training data construction unit performs data augmentation on a small amount of labeled domain data and performs pseudo-labeling on unlabeled data to generate a training dataset. S22: The prompt generation unit generates a prompt template based on the characteristics of the domain task, and incorporates samples from the training data into the prompt template to form a fine-tuning input; S23: The model fine-tuning unit uses low-rank adaptation technology to fine-tune the pre-trained language model, freeze the basic parameters, train the adapter parameters, and generate a domain-specific question-answering model. S24: Evaluate the performance of the domain-specific question answering model using the validation dataset. If the accuracy does not reach the preset threshold, return to S21 to rebuild the training data and fine-tune it again until the requirements are met.

[0013] Preferably, the specific process of automatically selecting the chart type in step S4 is as follows: S41: Extract the analytical intent, number of data dimensions, and data types from the user query; S42: Query the visualization rule base to match and analyze candidate chart types corresponding to the data intent, number of data dimensions, and data types; S43: Calculate the suitability score for candidate chart types. The suitability score takes into account the clarity of data display, user cognitive habits, and ease of interaction. S44: Select the chart type with the highest fit score as the target chart type. If there are multiple candidate chart types with the same score, the chart type with the highest frequency of use in the user's historical interactions will be selected by default.

[0014] Compared with the prior art, the beneficial effects of the present invention are: 1. Strong domain adaptability: This invention uses the prompt-assisted self-learning mechanism of the domain adaptive training module to generate a domain-specific question-answering model using a small amount of labeled data and a large amount of unlabeled data, reducing labeling costs. At the same time, it constructs a real-time updated domain terminology dictionary, improving the accuracy of semantic understanding in specific domains and solving the problem of low question-answering accuracy of existing general models in domain scenarios.

[0015] 2. Excellent synergy between Q&A and chart generation: The intelligent chart generation module of this invention can directly extract data dimensions, statistical indicators and user intent from the Q&A interaction process, achieving seamless connection between Q&A and chart generation. Furthermore, it automatically selects the optimal chart type based on the visualization rule base and the suitability score, making the generated charts more targeted. This solves the problems of disconnect between Q&A and chart generation and rigid chart type selection in the prior art.

[0016] 3. High real-time performance and efficiency: This invention improves data access efficiency by caching high-frequency data and indexes through the dynamic caching unit of the data access and preprocessing module; it shortens training time by using low-rank adaptation technology for model fine-tuning; and the dynamic retrieval and verification mechanism of the real-time question-answering interaction module ensures rapid generation of responses, meeting the needs of real-time data query.

[0017] 4. Strong continuous optimization capability: This invention records user interaction feedback data through a knowledge graph and feedback optimization module, and uses reinforcement learning algorithms to iteratively optimize the model and chart generation rules. As user interaction data accumulates, the system performance continuously improves and adapts to the usage habits of different users.

[0018] 5. High security: This invention has a comprehensive security protection module that protects data and system security from three levels: identity authentication, access control and data encryption, meeting the needs of enterprises and institutions for protecting sensitive data. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of the module structure of the real-time data question-answering training and chart generation system in an embodiment of the present invention; Figure 2 This is a schematic diagram of the internal structure of the data access and preprocessing module in an embodiment of the present invention; Figure 3 This is a schematic diagram of the workflow of the domain adaptive training module in an embodiment of the present invention; Figure 4 This is a schematic diagram of the workflow of the real-time question-and-answer interaction module in an embodiment of the present invention; Figure 5 This is a schematic diagram of the workflow of the intelligent chart generation module in an embodiment of the present invention; Figure 6 This is a schematic diagram of the workflow of the knowledge graph and feedback optimization module in an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the application process of the system in the financial field in this embodiment of the invention. Detailed Implementation

[0021] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Example 1 Please see Figure 1-6 The first aspect of this application provides a real-time data question-answering training and chart generation system, including a data access and preprocessing module, a domain adaptive training module, a real-time question-answering interaction module, an intelligent chart generation module, and a knowledge graph and feedback optimization module; The data access and preprocessing module is used for accessing, cleaning, standardizing, and dynamically caching multi-source heterogeneous real-time data, and outputting structured data and real-time data stream indexes. Furthermore, the data access and preprocessing module includes a multi-source data interface unit, a real-time cleaning unit, a standardization unit, and a dynamic caching unit; The multi-source data interface unit supports access to databases, message queues, API interfaces, and streaming data, and is compatible with the data formats of relational databases, non-relational databases, and time-series databases. The real-time cleaning unit uses a combination of rule engine and AI anomaly detection to remove duplicate data, correct erroneous data, and fill in missing data. The AI ​​anomaly detection is based on the isolated forest algorithm to identify outliers in the data. The standardization unit converts data of different formats into a preset structured format, normalizes the magnitude of numerical data, and performs word segmentation, part-of-speech tagging, and entity recognition on text data. The dynamic caching unit uses Redis caching technology to cache frequently accessed data and real-time data stream indexes, and sets a cache expiration policy to ensure the consistency between cached data and source data. The domain-adaptive training module, based on the prompt-assisted self-learning mechanism, uses a small amount of labeled domain data and a large amount of unlabeled data to fine-tune the model, generate a domain-specific question-answering model, and simultaneously construct and update a domain terminology dictionary in real time. Furthermore, the domain-adaptive training module includes a training data construction unit, a prompt generation unit, a model fine-tuning unit, and a terminology dictionary management unit; The training data construction unit expands a small amount of labeled domain data through data augmentation technology to generate synonymous sentences, word order adjustment sentences, and scene expansion sentences, while performing pseudo-labeling on unlabeled data. The prompt generation unit generates a prompt template containing domain terminology, task description, and examples based on the characteristics of the domain task, and supports dynamic parameter replacement. The model fine-tuning unit is based on a pre-trained language model and uses low-rank adaptation technology to fine-tune parameters. It freezes the basic parameters of the pre-trained model and trains only the adapter parameters, thereby reducing training costs. The terminology dictionary management unit extracts professional terms through domain text mining, establishes term-explanation mapping relationships, and updates the dictionary in real time by combining the new word discovery results in user interaction data. The real-time question-answering interaction module receives natural language queries from users, performs semantic parsing based on the dialogue context, calls the domain-specific question-answering model to generate candidate answers, verifies the accuracy of the answers by matching structured data through a dynamic retrieval mechanism, and outputs a natural language response. Furthermore, the real-time question-and-answer interaction module includes a query receiving unit, a context management unit, a semantic parsing unit, a question-and-answer reasoning unit, and a dynamic retrieval and verification unit; The context management unit adopts a session window mechanism to store historical query and response data of the current session, sets session timeout, and supports parallel management of multiple sessions; The semantic parsing unit combines the domain terminology dictionary and the knowledge graph to perform intent recognition, entity extraction, and relation extraction on user queries. It uses a model that combines a bidirectional long short-term memory network and a conditional random field to complete named entity recognition. The question-answering reasoning unit calls the domain-specific question-answering model to generate candidate answers, and the candidate answers include core data, derivation process and referenced data source information; The dynamic retrieval verification unit, based on the BM25 algorithm and vector retrieval technology, matches the structured data and real-time data stream index to verify the accuracy of the core data in the candidate answers. If there is a deviation, the model is called again to generate the answer. The intelligent chart generation module extracts data dimensions, statistical indicators and user intent during the question-and-answer interaction process, automatically selects chart types based on data characteristics and visualization rule base, generates interactive chart data and completes real-time rendering. Furthermore, the intelligent chart generation module includes an intent and data extraction unit, a chart type selection unit, a chart data construction unit, and a real-time rendering unit; The intent and data extraction unit extracts analytical intent from user queries and question-and-answer results, including analytical intent (comparative analysis, trend analysis, distribution analysis, and percentage analysis), data dimensions (including time dimension, spatial dimension, and category dimension), and statistical indicators (including mean, median, extreme values, and growth rate). The chart type selection unit constructs a visualization rule base, which automatically selects the chart type based on the number of data dimensions, data type, and analysis intent. Among them, trend analysis prioritizes line charts, comparison analysis prioritizes bar charts, distribution analysis prioritizes histograms, and percentage analysis prioritizes pie charts or donut charts. The chart data construction unit converts the verified core data into the standard format required for the chart, adds data labels, units and annotation information, and supports the hierarchical data structure required for data drill-down. The real-time rendering unit uses the ECharts or D3.js visualization library to complete the real-time drawing of charts and supports interactive operations such as chart zooming, panning, filtering, and viewing data details. The knowledge graph and feedback optimization module constructs a knowledge graph that integrates domain entities, relationships, and indicator systems, records user interaction feedback data, and uses reinforcement learning algorithms to iteratively optimize the domain-specific question-answering model and the intelligent chart generation module. Furthermore, the knowledge graph and feedback optimization module includes a knowledge graph construction unit, a feedback data acquisition unit, a reinforcement learning optimization unit, and a model storage unit; The knowledge graph construction unit uses a graph database to store domain entities (including indicator entities, dimension entities, and business entities), entity attributes, and relationships between entities, establishing a hierarchical structure for the indicator system and supporting the dynamic addition of entities and relationships. The feedback data collection unit records user satisfaction ratings for question-and-answer results, chart type adjustments, data correction requests, and feedback on newly added terms, generating a feedback data log. The reinforcement learning optimization unit uses user satisfaction and interaction efficiency as reward functions, and uses feedback data as reinforcement signals to adjust the inference parameters of the domain-specific question answering model and the matching weights of the chart generation rule base. The model storage unit adopts a version control mechanism to save domain-specific question-answering models and chart generation rules at different iteration stages, and supports model version backtracking. Furthermore, it also includes a security protection module, which includes an identity authentication unit, an access control unit, and a data encryption unit; The identity authentication unit supports username and password authentication, SMS verification, and third-party authentication (OAuth2.0 protocol), and performs anomaly detection for login behavior; The permission control unit is based on the role-based access control (RBAC) model, which assigns data access permissions and function operation permissions to different roles, and restricts users from querying and exporting sensitive data. The data encryption unit encrypts data during transmission using the SSL / TLS protocol and encrypts sensitive data stored using the AES-256 encryption algorithm.

[0023] A real-time data question-answering training and chart generation method based on the system described in any one of claims 1-6 includes the following steps: S1: Multi-source heterogeneous real-time data is accessed, cleaned, standardized, and dynamically cached through the data access and preprocessing module, and outputs structured data and real-time data stream indexes; S2: The domain-adaptive training module uses training data to perform prompt-assisted fine-tuning of the self-learning model, generates a domain-specific question-answering model, and builds and updates a domain terminology dictionary. S3: The real-time question-answering interaction module receives users' natural language queries, performs semantic parsing based on the dialogue context, calls a domain-specific question-answering model to generate candidate answers, and outputs natural language responses after dynamic retrieval and verification. S4: The intelligent chart generation module extracts data dimensions, statistical indicators and user intent during the question-and-answer process, automatically selects the chart type and generates interactive charts, and completes real-time rendering. S5: The knowledge graph and feedback optimization module records user interaction feedback data and iteratively optimizes the domain-specific question-answering model and graph generation rules through reinforcement learning algorithms.

[0024] Furthermore, the specific process of fine-tuning the prompt-assisted self-learning model in step S2 is as follows: S21: The training data construction unit performs data augmentation on a small amount of labeled domain data and performs pseudo-labeling on unlabeled data to generate a training dataset. S22: The prompt generation unit generates a prompt template based on the characteristics of the domain task, and incorporates samples from the training data into the prompt template to form a fine-tuning input; S23: The model fine-tuning unit uses low-rank adaptation technology to fine-tune the pre-trained language model, freeze the basic parameters, train the adapter parameters, and generate a domain-specific question-answering model. S24: Evaluate the performance of the domain-specific question answering model using the validation dataset. If the accuracy does not reach the preset threshold, return to S21 to rebuild the training data and fine-tune it again until the requirements are met.

[0025] Furthermore, the specific process of automatically selecting the chart type in step S4 is as follows: S41: Extract the analytical intent, number of data dimensions, and data types from the user query; S42: Query the visualization rule base to match and analyze candidate chart types corresponding to the data intent, number of data dimensions, and data types; S43: Calculate the suitability score for candidate chart types. The suitability score takes into account the clarity of data display, user cognitive habits, and ease of interaction. S44: Select the chart type with the highest fit score as the target chart type. If there are multiple candidate chart types with the same score, the chart type with the highest frequency of use in the user's historical interactions will be selected by default.

[0026] Example 2 Please see Figure 1-6 The first aspect of this application provides a real-time data question-answering training and chart generation system, including a data access and preprocessing module, a domain-adaptive training module, a real-time question-answering interaction module, an intelligent chart generation module, and a knowledge graph and feedback optimization module. These modules work collaboratively to complete the entire process from multi-source real-time data access to user natural language query response and intelligent chart generation, and continuously optimize system performance through a feedback mechanism.

[0027] 1. Data Access and Preprocessing Module This module is responsible for the access, cleaning, standardization, and dynamic caching of multi-source heterogeneous real-time data, providing high-quality data support for subsequent question-and-answer and chart generation. Specifically, the multi-source data interface unit supports access to databases (MySQL, PostgreSQL, MongoDB, InfluxDB, etc.), message queues (Kafka, RabbitMQ), API interfaces, and streaming data, adapting to different data formats; the real-time cleaning unit combines a rule engine and AI anomaly detection technology. The rule engine presets data validation rules (such as data format rules and value range rules), and AI anomaly detection uses the isolated forest algorithm to identify outliers, ensuring data quality; the standardization unit uniformly converts data of different formats into a preset structured format, normalizes the magnitude of numerical data (e.g., converting tens of thousands and hundreds of millions of yuan into yuan), and processes textual data using jieba word segmentation, part-of-speech tagging, and the BERT entity recognition model; the dynamic caching unit uses Redis caching technology to cache frequently accessed data and real-time data stream indexes, sets a cache expiration policy based on data update time, and ensures consistency between cached data and source data through a timed synchronization mechanism, improving data access efficiency.

[0028] 2. Domain Adaptive Training Module This module is based on the prompt-assisted self-learning mechanism to enable the rapid generation of domain-specific question-answering models and reduce the dependence on labeled data. The training data construction unit expands a small amount of labeled domain data through data augmentation techniques such as synonym replacement, word order adjustment, and scene expansion. Simultaneously, it generates a large amount of training data using a pseudo-labeling method (predicting unlabeled data based on the initial model and selecting high-confidence results as pseudo-labels). The prompt generation unit generates prompt templates containing domain terminology, task descriptions, and examples based on domain task characteristics (e.g., performance analysis in finance, case statistics in medicine), supporting dynamic parameter replacement to adapt to different training samples. The model fine-tuning unit uses pre-trained language models (e.g., BERT, GPT series models) as a foundation, employing low-rank adaptation (LoRA) technology for parameter fine-tuning. It trains only the adapter parameters, freezing the basic parameters of the pre-trained model, thus reducing training costs and time while ensuring model performance. The terminology dictionary management unit extracts professional terms through domain text mining (based on TF-IDF and mutual information algorithms), establishes terminology-explanation mapping relationships, and updates the dictionary in real time based on new word discovery results during user interaction (based on new word recognition algorithms), improving the accuracy of semantic parsing.

[0029] 3. Real-time Q&A interaction module This module is responsible for processing user natural language queries and generating accurate natural language responses. The query receiving unit supports both text and voice input (converted to text via a speech-to-text interface); the context management unit uses a session window mechanism to store historical query and response data for the current session, sets a session timeout (default 30 minutes), and supports parallel management of multiple sessions to ensure the continuity of multi-turn dialogues; the semantic parsing unit combines a domain-specific terminology dictionary and knowledge graph, using a Bi-LSTM and CRF model to complete named entity recognition, and uses an intent recognition model (based on classification algorithms) to determine the user's query intent (such as data query, trend analysis, comparative analysis), extracting data dimensions and statistical indicators from the query; the question-answering reasoning unit calls a domain-specific question-answering model to generate candidate answers, which include core data, the derivation process, and referenced data source information; the dynamic retrieval verification unit uses the BM25 algorithm (for text matching) and vector retrieval technology (based on similarity matching of data vector representations) to match structured data and real-time data stream indexes, verifying the accuracy of the core data in the candidate answers. If deviations are found, the model parameters are adjusted and the answer is regenerated to ensure response accuracy.

[0030] 4. Intelligent Chart Generation Module This module achieves a seamless transition from Q&A interaction to chart generation, automatically generating optimal visualization charts based on user intent and data characteristics. The intent and data extraction unit extracts analytical intent (comparative analysis, trend analysis, distribution analysis, percentage analysis, etc.), data dimensions (time dimension, spatial dimension, category dimension, etc.), and statistical indicators (mean, median, extreme values, growth rate, etc.) from user queries and Q&A results. The chart type selection unit constructs a visualization rule base, which contains matching rules for different analytical intents, the number of data dimensions, and data types with chart types. For example, time-dimensional trend analysis prioritizes line charts, multi-category comparative analysis prioritizes bar charts, and percentage analysis prioritizes pie charts or donut charts. It also calculates the suitability of candidate chart types. The scoring system (considering data display clarity, user cognitive habits, and ease of interaction) selects the chart type with the highest score. The chart data construction unit converts the verified core data into the standard format required for the chart (such as the JSON format supported by ECharts), adds data labels, units, and annotation information, and constructs the hierarchical data structure required for data drill-down (such as drilling down from national data to provincial and municipal data). The real-time rendering unit uses the ECharts or D3.js visualization library to complete the real-time drawing of the chart, supporting interactive operations such as chart zooming, panning, filtering, and viewing data details, thereby improving the user experience.

[0031] 5. Knowledge Graph and Feedback Optimization Module This module provides knowledge support for the system and enables continuous iterative optimization. The knowledge graph construction unit uses the Neo4j graph database to store domain entities (including indicator entities, dimension entities, and business entities), entity attributes, and relationships between entities, establishing a hierarchical structure for the indicator system (e.g., financial indicators include sub-indicators such as revenue, profit, and cost), and supporting the dynamic addition of entities and relationships. The feedback data collection unit records user satisfaction ratings (1-5 points) for question-and-answer results, chart type adjustments (e.g., changing a bar chart to a line chart), data correction requests, and feedback on newly added terms, generating feedback data logs. The reinforcement learning optimization unit uses user satisfaction and interaction efficiency (e.g., question-and-answer response time, chart generation time) as reward functions, and uses feedback data as reinforcement signals to adjust the inference parameters of the domain-specific question-and-answer model and the matching weights of the chart generation rule base. The model storage unit adopts a version control mechanism to save domain-specific question-and-answer models and chart generation rules at different iteration stages, supporting model version backtracking for easy subsequent analysis and problem investigation.

[0032] In addition, the system includes a security protection module to ensure data and system security. The identity authentication unit supports username and password authentication, SMS verification, and third-party authentication (based on the OAuth2.0 protocol), and performs anomaly detection on login behavior (such as login from different locations, multiple incorrect passwords); the access control unit is based on the RBAC model to assign data access permissions and function operation permissions to different roles (such as administrators, ordinary users, and guests), restricting users' querying and exporting of sensitive data (such as personal privacy data and trade secret data); the data encryption unit uses the SSL / TLS protocol to encrypt data during transmission and uses the AES-256 encryption algorithm to encrypt stored sensitive data to prevent data leakage.

[0033] Example 3 (I) System Deployment This system is deployed on a cloud server cluster, employing a microservice architecture. Each module is deployed independently and communicates via RESTful APIs and message queues. The data access and preprocessing module is deployed on edge nodes, close to the data source, reducing data transmission latency. The domain-adaptive training module is deployed on GPU servers to improve model training efficiency. The real-time question-answering interaction module, intelligent chart generation module, and knowledge graph and feedback optimization module are deployed on application servers, distributing user requests through a load balancer.

[0034] (ii) Data access and preprocessing 1. Multi-source data access: Access revenue data, profit data, and customer data from the financial institution's business database (MySQL), real-time transaction data streams from the message queue (Kafka), and industry benchmark data provided by third-party API interfaces through the multi-source data interface unit.

[0035] 2. Real-time cleaning: The rule engine presets data verification rules, such as revenue data values ​​being positive and date format being YYYY-MM-DD; AI anomaly detection uses the isolated forest algorithm to identify outliers in transaction data (such as transaction records with amounts far exceeding the normal amount), removes duplicate transaction records, and completes missing customer region data (based on customer ID and association with other data tables).

[0036] 3. Standardization Processing: Revenue and profit data are uniformly converted into values ​​in "yuan". Text information in customer data (such as customer name and industry) is segmented by jieba and labeled with part of speech. The BERT entity recognition model is used to extract entities such as customer ID and industry type.

[0037] 4. Dynamic caching: A Redis caching server is used to cache the revenue data, profit data, and real-time transaction data stream indexes for the past 3 months. The cache expiration time is set to 1 hour, and the source data is synchronized once every hour to ensure the timeliness of the cached data.

[0038] (III) Domain Adaptive Training 1. Training Data Construction: A small amount of labeled data (1000 records, including natural language queries, corresponding data dimensions, statistical indicators, and answers) related to financial performance analysis was collected. Through data augmentation techniques such as synonym replacement (e.g., replacing "revenue" with "operating income"), word order adjustment (e.g., changing "how much revenue in Q3 2025" to "how much revenue in the third quarter of 2025"), and scenario expansion (e.g., expanding to performance query scenarios for different quarters and different business lines), the labeled data was expanded to 5000 records. For 10000 unlabeled financial performance-related text data, pseudo-labels were generated using the initial BERT model. Results with a confidence level higher than 0.9 were selected as pseudo-label data, ultimately forming a training dataset of 15000 records.

[0039] 2. Prompt Generation: Based on the characteristics of financial performance analysis tasks, a prompt template is generated, such as "Given the data of {Indicator 1} and {Indicator 2} for {Business Line} in {Time Period}, answer the question: {User Query}? Example: Given the revenue and profit data of the retail business in Q3 2025, answer the question: What was the revenue of the retail business in Q3 2025? Answer: The revenue of the retail business in Q3 2025 was XX yuan." Samples from the training data are integrated into the prompt template to form a fine-tuned input.

[0040] 3. Model fine-tuning: Based on the BERT-base model, LoRA technology is used to fine-tune the parameters. The adapter rank is set to 8, the learning rate is 2e-5, the training epochs are 10, the basic parameters of the BERT-base model are frozen, and only the adapter parameters are trained to generate a question-answering model specifically for the financial field.

[0041] 4. Terminology dictionary construction: Using TF-IDF and mutual information algorithms, professional terms such as "revenue", "net profit", "non-performing loan ratio" and "provision coverage ratio" are extracted from text data in the financial field. A term-explanation mapping relationship is established to generate a terminology dictionary for the financial field.

[0042] (iv) Real-time question and answer interaction 1. User query reception: Users can input a natural language query through the system interface, such as "What is the year-on-year growth rate of the company's retail business revenue in Q3 2025?", and the system will receive the query text.

[0043] 2. Context Management: Since this is the first query of the current session, the context management unit initializes the session window and stores the current query text.

[0044] 3. Semantic parsing: Combining a financial terminology dictionary and knowledge graph, the semantic parsing unit identifies the entities "company", "retail business" and "Q3 2025", extracts the data dimensions as "business line (retail business)" and "time dimension (Q3 2025)", and the statistical indicator as "revenue year-on-year growth rate", determining that the user's intent is a trend analysis data query.

[0045] 4. Question-and-answer reasoning: Using a financial-specific question-and-answer model, candidate answers are generated such that "The company's retail business revenue growth rate in Q3 2025 was 12.5%, Q3 2025 revenue was XX yuan, and Q3 2024 revenue was XX yuan."

[0046] 5. Dynamic Retrieval and Verification: Based on the BM25 algorithm and vector retrieval technology, the revenue data of retail business in Q3 2025 and Q3 2024 in structured data are matched to verify the accuracy of the growth rate calculation in the candidate answers. After confirming that there are no errors, a natural language response is output.

[0047] (v) Intelligent chart generation 1. Intent and Data Extraction: The intent to be analyzed is to extract data from user queries and Q&A results. The data dimensions are time dimension (Q3 2024, Q3 2025) and business line dimension (retail business). The statistical indicators are revenue amount and year-on-year growth rate.

[0048] 2. Chart type selection: Query the visualization rule base. The candidate chart types for trend analysis are line chart and bar chart. Calculate the suitability score. The line chart scores higher in trend display clarity (85 points vs. 75 points). Therefore, the line chart is selected as the target chart type.

[0049] 3. Chart Data Construction: Convert the verified retail revenue data for Q3 2024 and Q3 2025 into JSON format supported by ECharts, add data labels (revenue amount, year-on-year growth rate), units (yuan), and annotation information (data source: company business database), and build a data drill-down hierarchy (supporting drill-down from retail business to specific product line revenue data).

[0050] 4. Real-time rendering: Using the ECharts visualization library, line charts are drawn in real time to display the retail revenue trend from Q3 2024 to Q3 2025. Users can zoom in and out of the chart to view details, filter the time range, and drill down to product line data.

[0051] (vi) Knowledge Graph and Feedback Optimization 1. Knowledge Graph Application: In the process of semantic parsing, knowledge graphs provide relationship information between "retail business" and "revenue" and "year-on-year growth rate" to assist in the accurate extraction of entities and indicators.

[0052] 2. Feedback Data Collection: Users give a satisfaction rating of 4 points (out of 5) for the Q&A results. The chart type is not adjusted, and the system records this feedback data.

[0053] 3. Reinforcement Learning Optimization: The reinforcement learning optimization unit uses user satisfaction scores as reward signals to adjust the inference parameters of the financial domain-specific question-answering model, thereby improving the accuracy of similar queries; at the same time, it updates the matching weights of trend analysis corresponding to line charts in the chart generation rule base.

[0054] 4. Model Storage: Saves optimized financial domain-specific question-answering models and chart generation rules, generates version number V2.0, and supports version rollback.

[0055] Through the above implementation process, this system has achieved natural language question answering and intelligent chart generation for real-time performance data in the financial field. The question answering accuracy rate is over 92%, and the chart generation response time is less than 2 seconds, meeting users' needs for real-time data query and visualization.

[0056] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A real-time data question-answering training and chart generation system, characterized in that, It includes a data access and preprocessing module, a domain-adaptive training module, a real-time question-answering interaction module, an intelligent chart generation module, and a knowledge graph and feedback optimization module; The data access and preprocessing module is used for accessing, cleaning, standardizing, and dynamically caching multi-source heterogeneous real-time data, and outputting structured data and real-time data stream indexes. The domain-adaptive training module, based on the prompt-assisted self-learning mechanism, uses a small amount of labeled domain data and a large amount of unlabeled data to fine-tune the model, generate a domain-specific question-answering model, and simultaneously construct and update a domain terminology dictionary in real time. The real-time question-answering interaction module receives natural language queries from users, performs semantic parsing based on the dialogue context, calls the domain-specific question-answering model to generate candidate answers, verifies the accuracy of the answers by matching structured data through a dynamic retrieval mechanism, and outputs a natural language response. The intelligent chart generation module extracts data dimensions, statistical indicators and user intent during the question-and-answer interaction process, automatically selects chart types based on data characteristics and visualization rule base, generates interactive chart data and completes real-time rendering. The knowledge graph and feedback optimization module constructs a knowledge graph that integrates domain entities, relationships, and indicator systems, records user interaction feedback data, and uses reinforcement learning algorithms to iteratively optimize the domain-specific question-answering model and the intelligent chart generation module.

2. The real-time data question-answering training and chart generation system according to claim 1, characterized in that, The data access and preprocessing module includes a multi-source data interface unit, a real-time cleaning unit, a standardization unit, and a dynamic caching unit; The multi-source data interface unit supports access to databases, message queues, API interfaces, and streaming data, and is compatible with the data formats of relational databases, non-relational databases, and time-series databases. The real-time cleaning unit uses a combination of rule engine and AI anomaly detection to remove duplicate data, correct erroneous data, and fill in missing data. The AI ​​anomaly detection is based on the isolated forest algorithm to identify outliers in the data. The standardization unit converts data of different formats into a preset structured format, normalizes the magnitude of numerical data, and performs word segmentation, part-of-speech tagging, and entity recognition on text data. The dynamic caching unit uses Redis caching technology to cache frequently accessed data and real-time data stream indexes, and sets a cache expiration policy to ensure the consistency between cached data and source data.

3. The real-time data question-answering training and chart generation system according to claim 1, characterized in that, The domain-adaptive training module includes a training data construction unit, a prompt generation unit, a model fine-tuning unit, and a terminology dictionary management unit. The training data construction unit expands a small amount of labeled domain data through data augmentation technology to generate synonymous sentences, word order adjustment sentences, and scene expansion sentences, while performing pseudo-labeling on unlabeled data. The prompt generation unit generates a prompt template containing domain terminology, task description, and examples based on the characteristics of the domain task, and supports dynamic parameter replacement. The model fine-tuning unit is based on a pre-trained language model and uses low-rank adaptation technology to fine-tune parameters. It freezes the basic parameters of the pre-trained model and trains only the adapter parameters, thereby reducing training costs. The terminology dictionary management unit extracts specialized terms through domain text mining, establishes term-explanation mapping relationships, and updates the dictionary in real time by combining new word discovery results from user interaction data.

4. The real-time data question-answering training and chart generation system according to claim 1, characterized in that, The real-time question-and-answer interaction module includes a query receiving unit, a context management unit, a semantic parsing unit, a question-and-answer reasoning unit, and a dynamic retrieval and verification unit; The context management unit adopts a session window mechanism to store historical query and response data of the current session, sets session timeout, and supports parallel management of multiple sessions; The semantic parsing unit combines the domain terminology dictionary and the knowledge graph to perform intent recognition, entity extraction, and relation extraction on user queries. It uses a model that combines a bidirectional long short-term memory network and a conditional random field to complete named entity recognition. The question-answering reasoning unit calls the domain-specific question-answering model to generate candidate answers, and the candidate answers include core data, derivation process and referenced data source information; The dynamic retrieval verification unit, based on the BM25 algorithm and vector retrieval technology, matches the structured data and real-time data stream index to verify the accuracy of the core data in the candidate answers. If there is a deviation, the model is called again to generate the answer.

5. The real-time data question-answering training and chart generation system according to claim 1, characterized in that, The intelligent chart generation module includes an intent and data extraction unit, a chart type selection unit, a chart data construction unit, and a real-time rendering unit; The intent and data extraction unit extracts analytical intent, data dimensions, and statistical indicators from user queries and question-and-answer results; The chart type selection unit constructs a visualization rule base, which automatically selects the chart type based on the number of data dimensions, data type, and analysis intent. Among them, trend analysis prioritizes line charts, comparison analysis prioritizes bar charts, distribution analysis prioritizes histograms, and percentage analysis prioritizes pie charts or donut charts. The chart data construction unit converts the verified core data into the standard format required for the chart, adds data labels, units and annotation information, and supports the hierarchical data structure required for data drill-down. The real-time rendering unit uses the ECharts or D3.js visualization library to complete the real-time drawing of charts and supports interactive operations such as chart zooming, panning, filtering, and viewing data details.

6. The real-time data question-answering training and chart generation system according to claim 1, characterized in that, The knowledge graph and feedback optimization module includes a knowledge graph construction unit, a feedback data acquisition unit, a reinforcement learning optimization unit, and a model storage unit; The knowledge graph construction unit uses a graph database to store domain entities, entity attributes, and relationships between entities, establishes a hierarchical structure of the indicator system, and supports the dynamic addition of entities and relationships; The feedback data collection unit records user satisfaction ratings for question-and-answer results, chart type adjustments, data correction requests, and feedback on newly added terms, generating a feedback data log. The reinforcement learning optimization unit uses user satisfaction and interaction efficiency as reward functions, and uses feedback data as reinforcement signals to adjust the inference parameters of the domain-specific question answering model and the matching weights of the chart generation rule base. The model storage unit adopts a version control mechanism to save domain-specific question-answering models and chart generation rules at different iteration stages, and supports model version backtracking.

7. The real-time data question-answering training and chart generation system according to claim 1, characterized in that, It also includes a security protection module, which comprises an identity authentication unit, an access control unit, and a data encryption unit; The identity authentication unit supports username and password authentication, SMS verification, and third-party authentication, and performs anomaly detection on login behavior. The permission control unit is based on a role-based access control model, which assigns data access permissions and function operation permissions to different roles, and restricts users from querying and exporting sensitive data. The data encryption unit encrypts data during transmission using the SSL / TLS protocol and encrypts sensitive data stored using the AES-256 encryption algorithm.

8. A real-time data question-answering training and chart generation method based on the system described in any one of claims 1-7, characterized in that, Includes the following steps: S1: Multi-source heterogeneous real-time data is accessed, cleaned, standardized, and dynamically cached through the data access and preprocessing module, and outputs structured data and real-time data stream indexes; S2: The domain-adaptive training module uses training data to perform prompt-assisted fine-tuning of the self-learning model, generates a domain-specific question-answering model, and builds and updates a domain terminology dictionary. S3: The real-time question-answering interaction module receives users' natural language queries, performs semantic parsing based on the dialogue context, calls a domain-specific question-answering model to generate candidate answers, and outputs natural language responses after dynamic retrieval and verification. S4: The intelligent chart generation module extracts data dimensions, statistical indicators and user intent during the question-and-answer process, automatically selects the chart type and generates interactive charts, and completes real-time rendering. S5: The knowledge graph and feedback optimization module records user interaction feedback data and iteratively optimizes the domain-specific question-answering model and graph generation rules through reinforcement learning algorithms.

9. The method according to claim 8, characterized in that, The specific process of fine-tuning the prompt-assisted self-learning model mentioned in step S2 is as follows: S21: The training data construction unit performs data augmentation on a small amount of labeled domain data and performs pseudo-labeling on unlabeled data to generate a training dataset. S22: The prompt generation unit generates a prompt template based on the characteristics of the domain task, and incorporates samples from the training data into the prompt template to form a fine-tuning input; S23: The model fine-tuning unit uses low-rank adaptation technology to fine-tune the pre-trained language model, freeze the basic parameters, train the adapter parameters, and generate a domain-specific question-answering model. S24: Evaluate the performance of the domain-specific question answering model using the validation dataset. If the accuracy does not reach the preset threshold, return to S21 to rebuild the training data and fine-tune it again until the requirements are met.

10. The method according to claim 8, characterized in that, The specific process of automatic chart type selection in step S4 is as follows: S41: Extract the analytical intent, number of data dimensions, and data types from the user query; S42: Query the visualization rule base to match and analyze candidate chart types corresponding to the data intent, number of data dimensions, and data types; S43: Calculate the suitability score for candidate chart types. The suitability score takes into account the clarity of data display, user cognitive habits, and ease of interaction. S44: Select the chart type with the highest fit score as the target chart type. If there are multiple candidate chart types with the same score, the chart type with the highest frequency of use in the user's historical interactions will be selected by default.