Question and answer mode data model automatic generation and intelligent execution method and device
By combining NL2SQL and RPA technologies in the insurance industry, a customized natural language to SQL conversion model and ETL flowchart were established, solving the problems of accuracy and efficiency in data processing in the insurance industry. This enabled intelligent automatic generation and execution of data models, improving the accuracy of data processing and the reliability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PICC INFORMATION TECH CO LTD
- Filing Date
- 2025-12-16
- Publication Date
- 2026-05-15
AI Technical Summary
In the insurance industry, existing question-and-answer data processing methods lack semantic mapping specific to the industry's unique business logic. This leads to biases in the parsing of technical terms and mismatches in SQL statements, affecting the accuracy and compliance of data processing. Furthermore, traditional RPA is inefficient in integrating multi-source data and lacks intelligent decision-making mechanisms, resulting in execution delays.
By combining NL2SQL and RPA technologies, a customized natural language to SQL conversion model is established to perform semantic mapping between business terms and database fields. This model is then used in conjunction with domain knowledge graphs and business rule engines for multiple rounds of iterative optimization to generate ETL flowcharts. Finally, RPA tools are used for intelligent scheduling and email notification.
It improves the accuracy and flexibility of data processing, reduces human intervention and errors, enhances the work efficiency and decision-making speed of business personnel, strengthens the security and reliability of the system, and supports continuous optimization to adapt to changes in business needs.
Smart Images

Figure CN122045216A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing technology, specifically relating to a method and apparatus for automatic generation and intelligent execution of question-and-answer data models. Background Technology
[0002] As a core component of the financial sector, the insurance industry's performance data processing system plays a crucial role in supporting business decision-making. With the deep integration of big data and artificial intelligence technologies, traditional ETL processes based on manually written SQL are no longer sufficient to meet the dual demands of real-time performance and flexibility in insurance operations. Within the existing technological framework, the collaborative application of Natural Language Processing (NLP) and Robotic Process Automation (RPA) has constructed a new data interaction paradigm. Specifically, this system covers the entire process from natural language input to SQL statement generation, ETL process automation, and task scheduling and execution, including key aspects such as NL2SQL model training, data caching via Kafka message queues, distributed processing using Gaussian databases, and intelligent scheduling of XXLJOBs. NL2SQL technology maps business language to database operations through semantic parsing, while RPA simulates manual operations to complete automated process configuration. Together, they constitute the technological evolution direction of data processing in the insurance industry.
[0003] However, existing question-and-answer data processing methods directly use general NL2SQL models for business terminology conversion without establishing a semantic mapping system specific to the insurance industry's business logic. This can lead to parsing errors in professional terms such as "first quarter peak" and "sales collaboration," or mismatches between generated SQL statements and insurance business rules, thus affecting the accuracy and compliance of data processing. Specifically, existing technologies typically use static ETL process configurations, lacking the ability to respond to dynamic business needs, resulting in the need for manual intervention to adjust periodic task scheduling. Meanwhile, while traditional RPA can automate processes, it suffers from limitations such as low efficiency in integrating multi-source data and insufficient fault tolerance in task execution. Particularly when processing multi-dimensional performance indicators in the insurance industry, it often experiences execution delays due to the lack of intelligent decision-making mechanisms. These technical deficiencies not only waste IT development resources but also result in response times for business personnel to obtain key performance data exceeding 72 hours, severely restricting the improvement of insurance companies' real-time decision-making capabilities. How can we leverage this self-supervised learning representation to construct a general latent space that simultaneously supports generation and perceptual understanding tasks? Summary of the Invention
[0004] The present invention aims to at least partially solve one of the technical problems in the related art.
[0005] Therefore, the first objective of this invention is to propose a method for the automatic generation and intelligent execution of question-and-answer data models.
[0006] This invention combines NL2SQL with RPA technology to achieve efficient automatic generation and intelligent automated scheduling of question-and-answer data models, providing a new, more efficient, and flexible solution for data processing and business process execution.
[0007] The second objective of this invention is to provide an automatic generation and intelligent execution device for question-and-answer data models.
[0008] The third objective of this invention is to provide a computer device.
[0009] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium.
[0010] To achieve the above objectives, a first aspect of the present invention proposes a method for automatic generation and intelligent execution of a question-and-answer data model, comprising: S1. Based on the performance data characteristics of the insurance industry, a natural language to SQL conversion model is customized and trained to establish a semantic mapping relationship between business terms and database fields. S2, Receive natural language query requests input by business personnel, use the customized model to parse the query requests into structured query statements, and generate corresponding ETL flowcharts; S3, The model manager performs permission verification and legality checks on the structured query statement, and determines the execution path as immediate query or periodic task scheduling based on the verification results; S4. When it is determined to be a periodic task scheduling, call the Robotic Process Automation tool to configure the periodic execution of the task on the distributed task scheduling platform and associate the email notification parameters. S5. Based on the scheduling instructions of the distributed task scheduling platform, the ETL process is executed, and after generating a data report, the results are periodically sent to the preset receiving end through the email notification parameters.
[0011] In one embodiment of the present invention, S1 includes: S11 uses a domain knowledge graph to semantically enhance insurance business terms in natural language queries, and achieves accurate mapping between professional terms such as "first quarter peak" and "sales collaboration" and database fields through graph node association; S12 introduces a business rules engine to perform multiple rounds of iterative optimization on the training data and dynamically adjusts the model parameters based on the error correction records in the historical query logs, thereby improving the semantic mapping accuracy to over 92%.
[0012] In one embodiment of the present invention, S2 includes: S21, preprocesses natural language queries using word segmentation algorithms to extract query elements that include time dimension, business dimension and data range; S22, Based on the query elements, construct an ETL flowchart, and dynamically connect the data source node, transformation logic node and target node through directed edges to form an executable process topology.
[0013] In one embodiment of the present invention, S3 includes: S31, When performing permission verification, check the access permissions of business personnel to the target data table based on their role attributes. If the permissions are insufficient, trigger the data range restriction policy. S32, during the validity check, uses the SQL syntax tree analysis algorithm to perform structured verification on the generated query statement to ensure that it conforms to the execution specifications of Gaussian database.
[0014] In one embodiment of the present invention, S4 includes: S41, create task instances in the XXLJOB scheduling system by simulating manual operation through RPA, and configure scheduling parameters including execution time, retry policy and failure alarm; S42, when dynamically generating email notification parameters, automatically matches the recipient list, email subject template, and attachment format conversion rules based on the subscription configuration of business personnel.
[0015] To achieve the above objectives, a second aspect of the present invention provides a question-and-answer data model automatic generation and intelligent execution device, comprising: The model customization training module is used to customize the natural language to SQL conversion model based on the characteristics of insurance industry performance data, and establish the semantic mapping relationship between business terms and database fields. The Natural Language Parsing and Flowchart Generation Module is used to receive natural language query requests input by business personnel, parse the query requests into structured query statements using the customized model, and generate corresponding ETL flowcharts. The permission and legality verification module is used to perform permission verification and legality verification on the structured query statement through the model manager, and determine the execution path as immediate query or periodic task scheduling based on the verification results. The periodic task configuration module is used to call the robotic process automation tool to configure the periodic execution of tasks on the distributed task scheduling platform when it is determined to be a periodic task scheduling, and to associate email notification parameters. The ETL execution and result sending module is used to execute the ETL process based on the scheduling instructions of the distributed task scheduling platform, generate data reports, and periodically send the results to a preset receiving end through the email notification parameters.
[0016] This invention discloses a method and apparatus for automatically generating and intelligently executing a question-and-answer data model. Through customized training, the NL2SQL model can significantly improve query efficiency and accuracy, while reducing the learning cost for business personnel. Simultaneously, the model can be flexibly adjusted and optimized according to the specific needs of the insurance industry, meeting diverse query requirements. The automated process design of intelligent scheduling and email notification enables automated processing and periodic reporting of performance data, significantly improving the work efficiency and decision-making speed of business personnel. This process also reduces human intervention and errors, improving the accuracy and reliability of data processing. The integrated solution of natural language parsing and model management not only improves query efficiency but also enhances system security and reliability. The model manager ensures the accuracy and legality of query statements, avoiding potential security risks. Furthermore, this solution supports continuous optimization and improvement of the model to adapt to constantly changing business needs and technological environments.
[0017] To achieve the above objectives, a third aspect of this application provides a computer device, including a processor and a memory; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement a question-and-answer data model automatic generation and intelligent execution method as described in the first aspect embodiment.
[0018] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements a question-and-answer data model automatic generation and intelligent execution method as described in the first aspect embodiment.
[0019] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0020] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a question-and-answer data model automatic generation and intelligent execution method according to an embodiment of the present invention; Figure 2 This is an architecture diagram of a question-and-answer data model automatic generation and intelligent execution method according to an embodiment of the present invention; Figure 3 This is a structural diagram of a question-and-answer data model automatic generation and intelligent execution device according to an embodiment of the present invention; Figure 4 It is a computer device according to an embodiment of the present invention. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.
[0023] The following description, with reference to the accompanying drawings, describes an embodiment of the present invention that provides an automatic generation and intelligent execution method and apparatus for question-and-answer data models.
[0024] Example 1 Figure 1 This is a flowchart of a question-and-answer data model automatic generation and intelligent execution method according to an embodiment of the present invention, such as... Figure 1 As shown, it includes: S1, based on the performance data characteristics of the insurance industry, performs customized training on the natural language to SQL conversion model to establish a semantic mapping relationship between business terms and database fields.
[0025] In some implementations, the first step is to construct a high-quality training dataset consisting of historical natural language queries and corresponding SQL statements from insurance industry professionals. Each natural language query needs to be manually annotated to clearly identify the relevant business terms (such as "first quarter peak," "battle report," "policy details," etc.) and their corresponding fields in the database (such as `policy_number`, `sales_period`, `performance_indicator`, etc.). By constructing this "natural language-SQL statement-database field" triple structure, the model can learn the semantic relationships between business language and database structure.
[0026] Furthermore, a domain dictionary and entity recognition module are introduced during model training to enhance the understanding of insurance industry-specific terminology. For example, key business entities in the query are identified using an entity recognition model (such as BERT-BiLSTM-CRF) and aligned with fields in the database. Simultaneously, the model employs an attention mechanism and a sequence-to-sequence (Seq2Seq) structure during the decoding phase to improve the structured accuracy of the generated SQL. During training, the cross-entropy loss function is used for optimization, and its expression is:
[0027] in, This represents the first line of the actual SQL statement. One-hot encoding of each token The model predicts the first The probability distribution of each token. This represents the total number of tokens used in the SQL statement.
[0028] Specifically, model training is typically performed on a GPU cluster, using the Adam optimizer, with a learning rate set to... The batch size is 32, and the maximum sequence length (max_seq_length) is 256. The number of training iterations (epochs) is generally set to 10-20 to avoid overfitting. Model evaluation metrics include SQL generation accuracy, execution accuracy, and semantic match score.
[0029] Furthermore, S1 includes: S11 uses a domain knowledge graph to semantically enhance insurance business terms in natural language queries, and achieves accurate mapping between professional terms such as "first quarter peak" and "sales collaboration" and database fields through graph node association.
[0030] In some implementations, this knowledge graph consists of multiple entity nodes and relation edges. Entity nodes include business terms (such as "first quarter peak"), business metrics (such as "premium income"), data tables (such as "performance statistics table"), and fields (such as "channel code" and "product type"). Relation edges represent the semantic association between terms and fields; for example, the fields "first quarter peak" and "quarterly premium peak" are connected by a "representation" relationship. The construction of knowledge graphs is typically based on structured and unstructured data sources such as insurance industry business rules, historical query logs, and data dictionaries, and is accomplished through technologies such as Entity Recognition (NER), Relation Extraction (RE), and graph storage (such as Neo4j and Apache Jena).
[0031] Specifically, the key parameters involved in this step include: Term Matching Accuracy, Field Mapping Recall, Semantic Similarity Threshold (typically set to 0.7~0.9), and Query Response Time (targeted to be within 200ms). During the model training phase, pre-trained language models such as BERT or RoBERTa can optionally be introduced for semantic embedding, and the cosine similarity formula can be used. Natural language query With database fields Perform a matching score.
[0032] S12 introduces a business rules engine to perform multiple rounds of iterative optimization on the training data and dynamically adjusts the model parameters based on the error correction records in the historical query logs, thereby improving the semantic mapping accuracy to over 92%.
[0033] In some implementations, the business rule engine identifies model deviations in semantic understanding, syntax generation, or context processing by analyzing the semantic differences between the user's input natural language query and the system-generated SQL statement. Error correction records typically include the user-corrected SQL statement, the original natural language input, and the system-generated erroneous SQL statement. In each iteration, the system uses these corrected samples as incremental training data, re-inputting them into the NL2SQL model for fine-tuning. This process can optionally combine supervised learning and reinforcement learning strategies, optimizing the model output through a loss function (such as cross-entropy loss) to make the model more closely reflect the business context in subsequent predictions.
[0034] Specifically, model optimization involves several key parameters, such as the learning rate, batch size, number of epochs, and regularization coefficient. In actual deployment, the learning rate is typically set to... to The batch size ranges from 32 to 128, and the number of iterations is controlled between 10 and 30 to balance training efficiency and model convergence. Furthermore, the model's semantic mapping accuracy is used as a core evaluation metric, calculated by comparing the matching degree between the generated SQL and standard SQL, with a target value set at [value missing]. .
[0035] S2, receive natural language query requests input by business personnel, use the customized model to parse the query requests into structured query statements, and generate corresponding ETL flowcharts.
[0036] In some implementations, this step first receives natural language query requests from business personnel via a front-end interface. The input is typically business terminology or a description of a business scenario, such as "Query the ranking of premium income by channel in Q1 2024". The system then calls a pre-trained NL2SQL model, which is customized based on the insurance industry's unique business semantics and historical SQL statements, possessing a high-precision semantic understanding of business language. Internally, the model employs a sequence-to-sequence (seq2seq) structure based on the Transformer architecture, using an attention mechanism to identify and map key business entities (such as time, channel, and metrics) in the natural language, ultimately outputting a query statement conforming to SQL syntax, such as `SELECT channel, SUM(premium) AS total_premium FROM sales_data WHERE period ='2024Q1' GROUP BY channel ORDER BY total_premium DESC`.
[0037] Furthermore, the system matches the generated SQL statements with the predefined data model to determine if they belong to a periodic task. If it is a periodic task, the model manager will trigger the automatic generation module of the ETL flowchart. This module constructs a graphical flowchart containing data extraction, transformation, and loading based on the structure of the SQL statement and the data sources involved (such as Gaussian Database, Kafka message queue, etc.). The flowchart nodes include data source connectors, SQL execution nodes, data cleaning nodes, result output nodes, etc., supporting user-visual configuration and adjustment.
[0038] Specifically, the NL2SQL model has an input length limit of 512 tokens and a maximum output SQL statement length of 256 tokens. The model employs a Top-k sampling strategy during inference. To enhance the diversity and accuracy of generated statements, ETL flowchart generation relies on a predefined template library containing over 200 standard ETL node configurations. This library supports automatic SQL statement decomposition and process mapping, with a maximum of 50 nodes per flowchart to ensure readability and execution efficiency.
[0039] Furthermore, S2 includes: S21 uses a word segmentation algorithm to preprocess natural language queries and extract query elements that include time dimension, business dimension and data range.
[0040] In some implementations, this step typically employs rule-based or deep learning-based word segmentation algorithms. In the insurance industry, due to the highly specialized nature of business terminology, pre-trained language models based on BERT or RoBERTa are preferred for word segmentation and entity recognition. Specifically, the system first standardizes and cleanses the user-input natural language, removing irrelevant punctuation and stop words. Then, it segments the sentence into semantic units using a word segmentation model. Furthermore, by combining Named Entity Recognition (NER) technology, the system can identify key entities such as "first quarter of 2024," "auto insurance business," and "Shandong branch," categorizing them into three elements: time dimension, business dimension, and data scope.
[0041] Specifically, the performance of a word segmentation model is typically measured by metrics such as accuracy, recall, and F1 score. In this system, the F1 score of the word segmentation model needs to reach above 0.9 to ensure the accuracy of identifying key business entities. Furthermore, the system supports loading custom dictionaries to enhance the recognition capability of insurance industry-specific terms (such as "first quarter peak," "battle report," and "policy details"). The word segmentation granularity can be configured at the word level or sub-word level to adapt to query needs in different contexts.
[0042] S22, Based on the query elements, construct an ETL flowchart, and dynamically connect the data source node, transformation logic node and target node through directed edges to form an executable process topology.
[0043] Specifically, this step first uses an NL2SQL model to semantically parse the natural language input by the user, identifying the data source table, target table, field mapping relationships, and required transformation logic involved in the query. For example, if a user inputs "query premium income for each channel in the first quarter of 2024," the system will identify the data source node as "premium details table," the target node as "quarterly performance summary table," and extract key elements such as the time dimension "first quarter of 2024" and the channel dimension "channel field." The transformation logic nodes may include formatting the time field, mapping the channel field, and aggregating the income field.
[0044] When constructing the ETL flowchart, the system adopts a directed graph structure, where each node represents a data processing stage, including a source node, a transformation node, and a target node. Nodes are connected by directed edges, representing the direction of data flow and the processing order. For example, a source node is connected to a transformation node via a directed edge, and then connected to the target node via another directed edge, forming a complete data processing path.
[0045] Furthermore, the flowchart construction process supports dynamic adjustments. When a user enters new query elements or modifies existing query conditions, the system can automatically identify the changed parts and regenerate or update the corresponding ETL flowchart. This dynamic connection mechanism is implemented based on a rules engine and a process orchestration framework, ensuring the real-time performance and accuracy of the flowchart.
[0046] Specifically, the construction of flowcharts needs to meet certain performance requirements, such as a node identification accuracy of over 95% and a flowchart generation latency of less than 500ms, to ensure the system's real-time responsiveness. Furthermore, the flowchart structure must conform to ETL standards and specifications, supporting common operations such as field mapping, data cleaning, aggregation calculations, and data loading, and being compatible with the execution interfaces of mainstream ETL tools.
[0047] S3, the model manager performs permission verification and legality checks on the structured query statement, and determines the execution path as immediate query or periodic task scheduling based on the verification results.
[0048] In some implementations, the model manager first performs validity checks on the received SQL statements, including syntax and semantic checks. Syntax checks use an SQL parser (such as ANTLR or JSQLParser) to verify the statement structure, ensuring it conforms to standard SQL syntax, such as the validity of field names, table names, and function calls. Semantic checks further examine whether the SQL statement conforms to business logic, such as whether fields exist in the target database, whether the table structure matches, and whether the query conditions are reasonable. In some implementations, this process can be combined with real-time validation of database metadata to ensure the executability of the query statement.
[0049] Furthermore, the model manager performs permission verification to determine whether the current user has access rights to the target table or field. This process is typically based on the RBAC (Role-Based Access Control) model, which verifies the user's read, write, or execute permissions to the data source by querying the user role and permission mapping table. In the insurance industry, access control is particularly important, and access to sensitive business data must strictly adhere to the group's data security specifications.
[0050] Specifically, the response time for validity verification should be controlled within [timeframe]. Within this range, real-time user interaction must be ensured. Permission verification, on the other hand, must ensure accuracy. This prevents data leaks or access failures due to misjudgment of permissions. When verification fails, the system will return an error code and error description, such as `403 Forbidden` or `500 Internal Server Error`, and log it for subsequent auditing.
[0051] Furthermore, S3 includes: S31, when performing permission verification, check the access permissions of business personnel to the target data table based on their role attributes. If the permissions are insufficient, trigger the data range restriction policy.
[0052] In some implementations, the system first obtains the user identity information of the current business personnel through a unified identity authentication module (such as LDAP or OAuth2.0), including metadata such as their department, job role, and permission level. Subsequently, the model manager matches this role information with a pre-defined permission configuration table, which is typically stored in a relational database table or permission management middleware (such as the RBAC model) and contains fields such as `user_id`, `role`, `table_name`, and `access_level`. Through SQL statements or API calls, the system queries whether the user has permissions to perform operations such as `SELECT`, `INSERT`, `UPDATE`, or `DELETE` on the target data table.
[0053] If permissions are insufficient, the system will trigger a data scope restriction policy. This policy is typically based on the Principle of Least Privilege, using dynamic SQL rewriting or view isolation to restrict users to accessing only data within their designated business scope. For example, for users in the sales department, the system might only allow them to access records in the `sales_performance` table related to their region or team, achieving data isolation by adding conditions such as `WHERE region = 'xxx'` or `WHERE team_id IN (xxx, yyy)`.
[0054] Furthermore, the implementation of this step needs to meet certain performance indicators, such as the permission verification response time should be controlled within a certain timeframe. Within this range, to ensure smooth user interaction. At the same time, the update frequency of the permission configuration table should be synchronized with business changes, typically set to daily or hourly updates to ensure the timeliness of permission information.
[0055] S32, during the validity check, uses the SQL syntax tree analysis algorithm to perform structured verification on the generated query statement to ensure that it conforms to the execution specifications of Gaussian database.
[0056] In some implementations, the SQL syntax tree analysis algorithm first converts the user-input natural language into an SQL statement using the NL2SQL model, and then inputs this SQL statement into a syntax parser. The parser, based on Gaussian Database's SQL syntax specifications (such as an extended implementation of the SQL-2011 standard), parses the SQL statement into an AST structure. The AST structure clearly represents the syntactic components of the SQL statement, including nested relationships between clauses such as SELECT, FROM, WHERE, and JOIN, table structure references, field name validity, and function call formats. By traversing the AST nodes, the system can perform layer-by-layer validation of the SQL statement's syntactic structure to ensure it conforms to Gaussian Database's execution requirements.
[0057] Furthermore, validity checks include not only syntactic checks but also semantic verification. For example, the system verifies whether table names and field names exist in the Gaussian database's metadata, ensuring that the tables and columns referenced in the query statement actually exist in the database. Additionally, it checks whether the fields in the JOIN operation have matching data types and index support, and whether the conditional expressions in the WHERE clause conform to the Gaussian database's optimizer rules to avoid inefficient execution or execution failures.
[0058] Optionally, the system can also introduce an SQL semantic validation rule base, which includes execution restrictions specific to Gaussian Database, such as maximum nesting level, maximum number of query fields, and maximum number of tables joined. For example, Gaussian Database limits the number of tables joined in a single SQL statement to [limit this limit]. The number of fields is limited to The system dynamically checks these metrics when parsing the AST. If the limits are exceeded, the verification will fail and an error message will be returned.
[0059] S4. When it is determined to be a periodic task scheduling, call the Robotic Process Automation tool to configure the periodic execution of the task on the distributed task scheduling platform and associate the email notification parameters.
[0060] In some implementations, RPA tools first receive scheduling instructions from the model manager. These instructions include the task's execution frequency (e.g., daily, weekly, monthly), execution time (e.g., HH:mm format), task type (e.g., data extraction, report generation), and email notification parameters (e.g., recipient list, email subject, email body template). RPA then encapsulates these parameters into a JSON request body by calling the XXLJOB REST API and sends it to the scheduling center for task registration. Within XXLJOB, a task is defined as a JobHandler, and its execution logic is handled by RPA simulating user actions or calling predefined scripts.
[0061] Specifically, the periodic configuration of task scheduling typically includes time intervals (e.g., the `cron` expression `0 0 8 * *?` indicates execution at 8:00 AM daily), task timeout thresholds (e.g., `timeout = 3600s`), retry policies (e.g., `retryCount = 3`), email sending methods (e.g., SMTP protocol, mail server address `smtp.example.com`, port `465` or `587`), and email sending frequency (e.g., sending immediately after task execution success or failure). Email notification parameters also include email template variables, such as `{taskName}`, `{execTime}`, and `{status}`, used to dynamically populate task execution information.
[0062] Furthermore, S4 includes: S41, create task instances in the XXLJOB scheduling system by simulating manual operation through RPA, and configure scheduling parameters including execution time, retry policy and failure alarm.
[0063] In some implementations, RPA tools simulate user task creation operations on the front-end interface of the XXLJOB scheduling platform through pre-defined scripts or flowchart logic. Specifically, the RPA robot first accesses the XXLJOB scheduling management interface, locates the task creation entry point using element recognition technologies (such as XPath, image recognition, or OCR), fills in the task name, selects the executor, sets the execution time (e.g., the `cron` expression `0 0 2 * * ?` means execution at 2 AM every day), and configures the retry policy (e.g., maximum number of retries `maxRetryTimes = 3`, retry interval `retryInterval = 60s`). In addition, RPA is responsible for setting up a failure alarm mechanism, including alarm methods (e.g., email, SMS), alarm recipient list (e.g., `alertEmailList = ["user1@picc.com", "user2@picc.com"]`), and alarm trigger conditions (e.g., triggered when the task status is failed).
[0064] Furthermore, in this step, the RPA execution logic can be based on a preset rule engine or decision tree model. It automatically determines whether a periodic task needs to be created based on the user's natural language query and maps relevant parameters (such as execution frequency and failure handling methods) to the XXLJOB configuration fields. For example, if the user enters "generate sales reports and send emails every Friday," RPA will parse the periodic task's cron expression as `0 0 17 ? * FRI` and automatically configure email alerts and report generation logic.
[0065] S42, when dynamically generating email notification parameters, automatically matches the recipient list, email subject template, and attachment format conversion rules based on the subscription configuration of business personnel.
[0066] In some implementations, the system first receives subscription information input by business personnel through the subscription configuration module. This includes recipient email addresses, email sending frequency (e.g., daily, weekly, monthly), email subject template identifiers, and attachment format requirements (e.g., Excel, PDF, CSV). Subscription information is typically stored in a structured configuration file, such as JSON or XML, for easy system parsing and processing. Recipient list matching is based on the association between user identity information and organizational structure data. The system queries user permission tables (e.g., `user_permission_table`) and organizational relationship tables (e.g., `org_relation_table`) to filter out email addresses of users with access permissions, ensuring the compliance and security of email notifications.
[0067] Furthermore, email subject template matching relies on preset rules in the template library. The template library stores various subject templates, each corresponding to a specific business scenario and data model type. The system determines the most suitable email subject template through template matching algorithms (such as rule-based matching or keyword-based matching). For example, if a business user subscribes to a "sales report" type model, the system will match a template such as "`{date} Performance Report - {branch}`, where `{date}` and `{branch}` are dynamic variables representing the generation date and the branch office, respectively.
[0068] Optionally, the matching of attachment format conversion rules is based on the output format of the data model and the format preferences specified by the user during subscription. After the system extracts the SQL query results from the database through the ETL process, it calls the corresponding data format conversion engine (such as Apache POI, JasperReports, etc.) according to the preset conversion rules (such as `output_format = 'excel'` or `output_format = 'pdf'`) to convert the raw data into a user-readable format. During the conversion process, the system also supports operations such as field mapping, data aggregation, and format validation to ensure the accuracy and consistency of the output results.
[0069] S5. Based on the scheduling instructions of the distributed task scheduling platform, the ETL process is executed, and after generating a data report, the results are periodically sent to the preset receiving end through the email notification parameters.
[0070] In some implementations, at the technical level, the XXLJOB scheduling platform serves as the core component of distributed task scheduling, managing and triggering ETL tasks uniformly through its scheduling center. The scheduling center sends scheduling instructions to the executor based on preset scheduling strategies (such as scheduled tasks, dependent tasks, and failure retry mechanisms). Upon receiving the instructions, the executor invokes pre-defined ETL process modules, sequentially executing data extraction, data transformation, and data loading operations. In the ETL process, data extraction typically reads raw business data from GaussDB; the transformation phase includes data cleaning, aggregation, and format standardization; and the loading phase writes the processed data to the target database or reporting system for subsequent use.
[0071] Specifically, the execution frequency, timeout threshold, and number of retries for scheduled tasks are all configured through the XXLJOB configuration interface. For example, a scheduled task can be set to execute daily at 2:00 AM, with a timeout threshold of 300 seconds, and a maximum of 3 retries after failure. Email notification parameters include the list of recipient email addresses, email subject template, body content format, attachment generation method (e.g., PDF, Excel), and email sending protocol (e.g., SMTP, IMAP). The email sending frequency is consistent with the ETL task execution cycle to ensure data timeliness and consistency.
[0072] This invention discloses a method for automatically generating and intelligently executing question-and-answer data models, which enables business personnel to automatically generate ETL data models through natural language queries and intelligently schedule their execution. This significantly improves data processing efficiency and system response speed, while reducing the usage threshold and maintenance costs for non-technical personnel.
[0073] Example 2 The following describes in detail, with reference to the accompanying drawings, a method for automatically generating and intelligently executing a question-and-answer data model according to an embodiment of the present invention.
[0074] This invention, based on NL2SQL (Natural Language to SQL) technology, Kafka message queue, Gaussian database, RPA (Robotic Process Automation), and XXLJOB scheduling tool, provides a method, device, and system for the automatic generation and intelligent execution of question-and-answer data models for integrated performance systems of insurance groups. For example... Figure 2 As shown, the specific implementation process is as follows: I. Model Training and Configuration.
[0075] NL2SQL Model Training: First, historical script data of the group's integrated performance was collected and organized as a training dataset. Then, this data was used to train the NL2SQL model, enabling it to accurately identify and understand the natural language expressions of the integrated performance-related tables, thereby generating corresponding SQL query statements.
[0076] RPA Configuration and Integration: Configure the RPA (Robotic Process Automation) tool and seamlessly integrate it with the XXLJOB scheduling tool and the group's integrated performance management server. This allows RPA to receive instructions from the management server and automatically execute the corresponding process operations.
[0077] II. Data Processing and Manipulation.
[0078] Data integration and loading: Data transmitted from upstream is cached and queued in real time using Kafka message queues. Then, a data import tool is used to batch load the cached data into the Gaussian database for subsequent data processing.
[0079] Performance Module Processing: Multiple performance service modules were designed and implemented in the Gaussian database based on business needs, such as first-quarter peak performance, homepage sales report, sales collaboration, model query, performance assessment, policy details query, performance query, performance analysis, personnel query, and related configurations. These modules generate data reports and analysis results that meet business requirements through periodic data processing and analysis.
[0080] III. Natural Language Parsing and Model Management.
[0081] Natural Language Parsing: When business personnel access the group's integrated performance management platform through the front-end page, they can enter their business language in the Q&A window to query relevant performance reports. At this time, the platform will call the NL2SQL model to parse the input natural language and generate the corresponding SQL query statement.
[0082] Model Management: After receiving the SQL query statement from NL2SQL, the model manager of the group's integrated performance management platform will verify and validate it. If the query statement corresponds to a periodic email reporting model, the model manager will verify its permissions and register it, and trigger RPA for scheduling and configuration. If the query statement corresponds to an immediate query request, the model manager will only verify permissions and directly execute the query operation.
[0083] IV. Intelligent scheduling and email notification.
[0084] Intelligent Scheduling: When RPA receives model management instructions from the group's integrated performance management platform, it configures corresponding scheduling tasks on the XXLJOB scheduling system based on the information in the instructions. These tasks include periodic data processing, report generation, and email notifications. XXLJOB's intelligent scheduling function ensures that these tasks are executed on time and accurately.
[0085] Email Notifications: When the data model generates result data triggered by the XXLJOB scheduling system, the email notification function will periodically send the generated data reports and analysis results to business personnel and relevant departments via email, based on the user-configured email account and data model information. This allows business personnel to view and analyze performance data anytime, anywhere, providing support for business decision-making.
[0086] Through the above technical solutions, this invention provides an efficient, accurate, and intelligent method for automatically generating and executing question-and-answer data models for integrated performance systems in the insurance industry. This method not only improves the efficiency of data processing and manipulation but also lowers the barrier for business personnel to query and analyze performance data, providing strong support for the digital transformation and intelligent upgrading of the insurance industry.
[0087] Example 3 To achieve the above embodiments, such as Figure 3 As shown, this embodiment also provides a question-and-answer data model automatic generation and intelligent execution device 10, which includes a model customization training module 100, a natural language parsing and flowchart generation module 200, an authorization and legality verification module 300, a periodic task configuration module 400, and an ETL execution and result sending module 500.
[0088] The model customization training module 100 is used to customize the natural language to SQL conversion model based on the characteristics of insurance industry performance data, and to establish the semantic mapping relationship between business terms and database fields. The Natural Language Parsing and Flowchart Generation Module 200 is used to receive natural language query requests input by business personnel, parse the query requests into structured query statements using the customized model, and generate corresponding ETL flowcharts. The permission and legality verification module 300 is used to perform permission verification and legality verification on the structured query statement through the model manager, and determine the execution path as immediate query or periodic task scheduling based on the verification results. The periodic task configuration module 400 is used to call the robotic process automation tool to configure the periodic execution task on the distributed task scheduling platform when it is determined to be a periodic task scheduling, and to associate email notification parameters. The ETL execution and result sending module 500 is used to execute the ETL process based on the scheduling instructions of the distributed task scheduling platform, generate data reports, and periodically send the results to a preset receiving end through the email notification parameters.
[0089] Furthermore, the aforementioned model customization training module 100 is also used for: Domain knowledge graphs are used to semantically enhance insurance business terms in natural language queries. By associating graph nodes, precise mapping between professional terms such as "first quarter peak" and "sales collaboration" and database fields is achieved. By introducing a business rules engine to perform multiple rounds of iterative optimization on the training data and dynamically adjusting the model parameters based on the error correction records in the historical query logs, the semantic mapping accuracy has been improved to over 92%.
[0090] Furthermore, the aforementioned natural language parsing and flowchart generation module 200 is also used for: Natural language queries are preprocessed using word segmentation algorithms to extract query elements that include time, business, and data scope dimensions. Based on the query elements, an ETL flowchart is constructed, and the data source node, transformation logic node, and target node are dynamically connected through directed edges to form an executable process topology.
[0091] Furthermore, the aforementioned permission and validity verification module 300 is also used for: When performing permission verification, check the access permissions of business personnel to the target data table based on their role attributes. If the permissions are insufficient, trigger the data range restriction policy. During the validity check, the SQL syntax tree analysis algorithm is used to perform structured validation on the generated query statement to ensure that it conforms to the execution specifications of Gaussian database.
[0092] Furthermore, the aforementioned periodic task configuration module 400 is also used for: Create task instances in the XXLJOB scheduling system by simulating manual operation using RPA, and configure scheduling parameters including execution time, retry policy and failure alarm; When dynamically generating email notification parameters, the system automatically matches the recipient list, email subject template, and attachment format conversion rules based on the subscription configuration of business personnel.
[0093] This invention discloses a question-and-answer data model automatic generation and intelligent execution device, which enables business personnel to automatically generate ETL data models through natural language queries and intelligently schedule their execution. This significantly improves data processing efficiency and system response speed, and reduces the usage threshold and maintenance costs for non-technical personnel.
[0094] To implement the methods of the above embodiments, the present invention also provides a computer device, such as... Figure 4 As shown, the computer device 600 includes a memory 601 and a processor 602; wherein, the processor 602 reads executable program code stored in the memory 601 to run a program corresponding to the executable program code, so as to implement the various steps of the method described above.
[0095] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing embodiments.
[0096] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0097] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
Claims
1. A method for automatically generating and intelligently executing question-and-answer data models, characterized in that, include: S1. Based on the performance data characteristics of the insurance industry, a natural language to SQL conversion model is customized and trained to establish a semantic mapping relationship between business terms and database fields. S2, Receive natural language query requests input by business personnel, use the customized model to parse the query requests into structured query statements, and generate corresponding ETL flowcharts; S3, The model manager performs permission verification and legality checks on the structured query statement, and determines the execution path as immediate query or periodic task scheduling based on the verification results; S4. When it is determined to be a periodic task scheduling, call the Robotic Process Automation tool to configure the periodic execution of the task on the distributed task scheduling platform and associate the email notification parameters. S5. Based on the scheduling instructions of the distributed task scheduling platform, the ETL process is executed, and after generating a data report, the results are periodically sent to the preset receiving end through the email notification parameters.
2. The method as described in claim 1, characterized in that, S1 includes: S11 uses a domain knowledge graph to semantically enhance insurance business terms in natural language queries, and achieves accurate mapping between professional terms such as "first quarter peak" and "sales collaboration" and database fields through graph node association; S12 introduces a business rules engine to perform multiple rounds of iterative optimization on the training data and dynamically adjusts the model parameters based on the error correction records in the historical query logs, thereby improving the semantic mapping accuracy to over 92%.
3. The method as described in claim 1, characterized in that, S2 includes: S21, preprocesses natural language queries using word segmentation algorithms to extract query elements that include time dimension, business dimension and data range; S22, Based on the query elements, construct an ETL flowchart, and dynamically connect the data source node, transformation logic node and target node through directed edges to form an executable process topology.
4. The method as described in claim 1, characterized in that, The S3 further includes: S31, When performing permission verification, check the access permissions of business personnel to the target data table based on their role attributes. If the permissions are insufficient, trigger the data range restriction policy. S32, during the validity check, uses the SQL syntax tree analysis algorithm to perform structured verification on the generated query statement to ensure that it conforms to the execution specifications of Gaussian database.
5. The method as described in claim 1, characterized in that, The S4 includes: S41, create task instances in the XXLJOB scheduling system by simulating manual operation through RPA, and configure scheduling parameters including execution time, retry policy and failure alarm; S42, when dynamically generating email notification parameters, automatically matches the recipient list, email subject template, and attachment format conversion rules based on the subscription configuration of business personnel.
6. A question-and-answer data model automatic generation and intelligent execution device, characterized in that, include: The model customization training module is used to customize the natural language to SQL conversion model based on the characteristics of insurance industry performance data, and establish the semantic mapping relationship between business terms and database fields. The Natural Language Parsing and Flowchart Generation Module is used to receive natural language query requests input by business personnel, parse the query requests into structured query statements using the customized model, and generate corresponding ETL flowcharts. The permission and legality verification module is used to perform permission verification and legality verification on the structured query statement through the model manager, and determine the execution path as immediate query or periodic task scheduling based on the verification results. The periodic task configuration module is used to call the robotic process automation tool to configure the periodic execution of tasks on the distributed task scheduling platform when it is determined to be a periodic task scheduling, and to associate email notification parameters. The ETL execution and result sending module is used to execute the ETL process based on the scheduling instructions of the distributed task scheduling platform, generate data reports, and periodically send the results to a preset receiving end through the email notification parameters.
7. The apparatus as claimed in claim 6, characterized in that, The model customization training module is also used for: Domain knowledge graphs are used to semantically enhance insurance business terms in natural language queries. By associating graph nodes, the professional terms "first quarter peak" and "sales collaboration" are accurately mapped to database fields. By introducing a business rules engine to perform multiple rounds of iterative optimization on the training data and dynamically adjusting the model parameters based on the error correction records in the historical query logs, the semantic mapping accuracy has been improved to over 92%.
8. The apparatus as claimed in claim 6, characterized in that, The natural language parsing and flowchart generation module is also used for: Natural language queries are preprocessed using word segmentation algorithms to extract query elements that include time, business, and data scope dimensions. Based on the query elements, an ETL flowchart is constructed, and the data source node, transformation logic node, and target node are dynamically connected through directed edges to form an executable process topology.
9. A computer device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the question-and-answer data model automatic generation and intelligent execution method as described in any one of claims 1-5.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements a method for automatic generation and intelligent execution of a question-and-answer data model as described in any one of claims 1-5.