Intelligent decision analysis system and method based on relational database modeling and large model fusion
By constructing a structured relational database and integrating it with a large model, the problems of global data perspective, data consistency, and security in existing intelligent question-answering systems are solved, achieving highly accurate and self-optimizing intelligent decision analysis, which is suitable for complex business scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN STAR NET WISDOM TECH CO LTD
- Filing Date
- 2025-11-11
- Publication Date
- 2026-04-10
AI Technical Summary
Existing intelligent question answering and decision-making systems have limitations in terms of global data perspective, data consistency, complex computation, and security. Traditional Text-to-SQL technology performs poorly in terms of accuracy and security, and cannot meet the decision support needs of complex business scenarios.
By constructing a structured relational database and combining it with large-scale model fusion technology, we can achieve metadata management, natural language parsing and SQL generation, intelligent verification and rewriting, data query and feedback verification, forming a closed-loop system with multiple rounds of iteration. This ensures that decision-making recommendations are based on a complete and consistent data foundation and have self-optimization capabilities.
It enables global data insight and analysis, improves the intelligent conversion capability and security of natural language to data query, has self-verification and adaptive result presentation capabilities, and is suitable for complex decision support scenarios.
Smart Images

Figure CN121833650A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence and database fusion technology, and in particular to an intelligent decision analysis system and method based on relational database modeling and large model fusion. Background Technology
[0002] Existing intelligent question answering and decision-making systems mostly rely on Retrieval-Augmented Generation (RAG) technology to replace traditional Text-to-SQL techniques. RAG technology assists a large model in generating answers by retrieving fragmented information from a local knowledge base. However, this type of system has the following limitations: Lack of a global and relational perspective: The information retrieved by the RAG system is isolated and fragmented. Unlike relational databases, it cannot perform operations such as table joins (JOIN) to associate, aggregate, and deeply analyze information scattered across different documents. This makes it difficult for the system to complete complex reasoning and decision-making tasks that require comprehensive global data.
[0003] Data consistency is difficult to guarantee: Documents in the knowledge base may have information conflicts or be outdated, and the fragments retrieved by the RAG system may not be the latest or most accurate data, affecting the reliability of decision-making.
[0004] Unable to perform complex calculations: RAG technology is inherently incapable of performing analytical problems that require real-time numerical calculations (such as summation, averaging, and percentage), multi-dimensional drill-down, or trend prediction.
[0005] Traditional Text-to-SQL technology also has many limitations, such as: High technical threshold and weak generalization ability: It is extremely difficult to directly convert natural language into accurate SQL, especially when facing complex database structures (multiple tables, deep relationships) and complex business logic. The accuracy of traditional models or rule-based methods drops significantly and SQL with syntactic or semantic errors is easily generated.
[0006] There is a serious security risk: if the generated SQL statements are not rigorously validated, they are very likely to contain SQL injection vulnerabilities or be maliciously induced to generate destructive statements (such as DROP TABLE, DELETE), directly threatening database security.
[0007] The "one-off deal" lacks verification: traditional solutions end the process after generating and executing SQL, and cannot self-evaluate and correct the validity and completeness of the query results. If the results are not ideal or empty, it will directly lead to query failure and poor user experience.
[0008] Therefore, existing technologies are insufficient to meet the needs for a global data perspective and intelligent decision support in complex business scenarios. Summary of the Invention
[0009] The technical problem to be solved by this invention is to provide an intelligent decision analysis system and method based on relational database modeling and large model fusion. By constructing and utilizing a structured relational database, it is possible to access, associate and analyze data across the entire domain, ensuring that the generated decision recommendations are based on a complete and consistent data foundation, and providing deeper business insights.
[0010] In a first aspect, the present invention provides an intelligent decision analysis system based on relational database modeling and large-scale model fusion, comprising: Relational Database Modeling Module: This module defines a structured relational database based on the business needs of the target domain, defining entities, attributes, and relationships. Metadata Management Module: This module consists of one or more dedicated metadata tables used to store and manage the data asset catalog, including the names, functional descriptions, field names, field semantic explanations, and inter-table relationships of all data tables. Large Model Hints and Knowledge Embedding Module: This module is used to transform the structured knowledge in the metadata management module into hints that the large model can understand or to embed knowledge, enabling the large model to have a deep understanding of the database structure. Natural Language Parsing and SQL Generation Module: This module receives and parses users' natural language queries and generates SQL query statements based on their understanding of the database structure. The SQL intelligent validation and rewriting module is used to perform syntax and security checks on the generated SQL query statements. If the statements fail, it drives the natural language parsing and SQL generation module to perform iterative rewriting. If the statements pass, it inputs data query and feedback validation modules. Data Query and Feedback Validation Module: This module executes validated SQL queries, retrieves query results from the relational database, and returns the results to the large model for content validation. It determines whether the results accurately and completely answer the user's question. If so, the query results are output; otherwise, the target table or target field is redefined, and the result is returned to the Natural Language Parsing and SQL Generation Module.
[0011] Furthermore, the core modeling elements of the relational database modeling module include "entity" and "attribute". Each "entity" and "attribute" is defined as a metadata object that includes multiple public attributes, such as description, tag, inheritance, relationship, and masking.
[0012] Furthermore, the public attribute also includes self-organization. When the self-organization field is activated, the authorized metadata management module can automatically create new and derived modeling relationships based on the data's usage patterns, content characteristics, or interaction results with the large model.
[0013] Furthermore, the public attribute also includes a relational sourcing identifier (PIDS). When the object is an "attribute", its PIDS field is used to record and associate the parent entity to which this attribute belongs; when the object is an "entity", its PIDS field is used to record which one or more parent entities the entity is derived from during the self-organization process.
[0014] Furthermore, it also includes a results analysis and visualization module, which is used to intelligently analyze the query results data and automatically select and generate the most suitable visualization chart format to present the query results based on the data type and analysis intent.
[0015] Secondly, the present invention provides an intelligent decision analysis method based on relational database modeling and large-scale model fusion, requiring the provision of the system described in the first aspect, the method comprising: Initial modeling process: The business database is built through the relational database modeling module, and the detailed description information of all database tables is entered through the metadata management module to form the system knowledge base; Intent parsing and query planning process: The question input by the user through the natural language interface is obtained. The natural language parsing and SQL generation module deeply analyzes the user intent based on the database knowledge obtained from the prompt words of the large model and the knowledge embedding module, and plans the target data tables, fields and their relationships to be accessed, and then generates SQL query statements. SQL security verification process: The generated SQL query statement is checked for syntax validity and security by the SQL intelligent verification and rewriting module; if it fails, the natural language parsing and SQL generation module is driven to rewrite it iteratively until a fully valid and secure SQL query statement is produced. The query execution and result verification process: The data query and feedback verification module sends the validated SQL query statement to the underlying relational database for execution, obtains the query results, and returns the query results to the large model for content verification to determine whether it accurately and completely answers the user's question. If so, the query results are output; otherwise, the target table or target field is redefined, and then the intent parsing and query planning process is returned.
[0016] Furthermore, during the execution of the query and result verification process, the method for redetermining the target table or target field is as follows: using the current query result and the original question as context, re-analyze the question, and deduce the target table or target field that needs to be adjusted.
[0017] Furthermore, the metadata management module is used to provide intelligent data matching function, calculate the corresponding comprehensive matching score between the data object and each candidate entity in the system, and select the entity with the highest score for data insertion.
[0018] Furthermore, when the overall matching score of all candidate entities is lower than the preset confidence threshold, a self-organizing process is triggered to create new entities or relationships to expand the knowledge boundary of the system.
[0019] Furthermore, it also includes: the result analysis and visualization process: intelligent analysis of query result data, and automatic selection and generation of the most suitable visualization chart format to present the query results based on the data type and analysis intent.
[0020] The technical solutions provided in the embodiments of the present invention have at least the following technical effects: 1. Achieved true global data insight and analysis: Overcame the limitations of traditional RAG systems that could only retrieve local and fragmented knowledge. By building and utilizing a structured relational database, this system can access, correlate, and analyze data across the entire domain, ensuring that the generated decision recommendations are based on a complete and consistent data foundation, and providing deeper business insights.
[0021] 2. Enhanced intelligent conversion capabilities and reliability of natural language to data queries: By deeply embedding database metadata (table structure, field semantics, and relationships) into the cognitive framework of a large model, it can not only understand user intent but also accurately map that intent to complex database operations. Combined with a unique intelligent SQL statement validation and multi-round iterative rewriting mechanism, it greatly improves the accuracy, security (effectively defending against SQL injection attacks), and execution efficiency of automatically generated SQL, while reducing the risks and error rates of directly using the original text2sql technology.
[0022] 3. Enhanced system cognitive and reasoning capabilities: Going beyond simple question-and-answer and retrieval, the system possesses multi-round, closed-loop intelligent verification and optimization capabilities. The system can self-evaluate initial query results; if the results do not meet requirements, it can automatically initiate a new round of more in-depth analysis and querying. This process simulates the human analytical reasoning path, giving the system preliminary cognitive intelligence, making it suitable for complex decision support scenarios.
[0023] 4. It has the ability to intelligently present results adaptively: It integrates data perception and visualization adaptation functions, which can automatically determine the data type and analysis purpose of the query results, and dynamically select the most appropriate chart (such as tables, line charts, etc.) for presentation, thereby improving user experience and data interpretation efficiency, and realizing the leap from "getting data" to "gaining insights".
[0024] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0026] Figure 1 This is a schematic diagram of the system framework in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the relational database modeling module in Embodiment 1 of the present invention; Figure 3 This is a flowchart of the method in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the matching degree of each dimension in Embodiment 2 of the present invention; Figure 5 This is a flowchart of the query analysis process in Embodiment 2 of the present invention. Detailed Implementation
[0027] This invention provides an intelligent decision analysis system and method based on relational database modeling and large-scale model fusion. By constructing and utilizing a structured relational database, it can access, associate, and analyze data across the entire domain, ensuring that the generated decision recommendations are based on a complete and consistent data foundation, and providing deeper business insights.
[0028] The overall concept of the technical solutions in the embodiments of the present invention is as follows: In view of the shortcomings of the prior art, the present invention aims to solve the following technical problems: How can we overcome the limitations of traditional RAG systems that can only process fragmented information and build an intelligent system that can perform analysis and decision-making based on global, structured, and correlated data?
[0029] How to overcome the problems of low accuracy and poor security of traditional Text-to-SQL technology, and provide a high-precision automatic SQL generation method that can reliably generate SQL and perform multiple rounds of security verification and self-optimization.
[0030] How can the system be made capable of self-verification and continuous improvement, automatically starting an analysis loop and replanning the query path when the initial query results do not meet the requirements, until the user obtains the high-quality global data results they want, thereby solving the problem of "one-off" query failures?
[0031] How can we integrate these capabilities into a universal technical framework that can quickly adapt to business databases across different industries and provide end-to-end solutions, from natural language questioning to intelligent decision support?
[0032] We construct a three-pronged technical framework: a global relational data model, large-scale model cognitive capabilities, and closed-loop verification and iteration. Its core is: 1. Use metadata management tables to semantically represent the database structure, serving as a "knowledge manual" for large models to understand the database.
[0033] 2. Utilize a large model as the "brain" to uniformly undertake multiple roles such as natural language parsing, SQL generation, SQL security verification, and result verification.
[0034] 3. A multi-round iterative feedback loop mechanism (SQL verification loop, result verification loop) was designed to ensure the accuracy, security and reliability of the system output.
[0035] The technical framework designed in this invention mainly consists of seven modules, which work together to complete the entire process from natural language to intelligent decision-making: Relational database modeling module: It adopts a standardized modeling method based on business entities and relationships to ensure that the data model can accurately and unambiguously reflect the whole picture of the business.
[0036] Metadata Management Module: A metadata table was designed containing key fields such as Table Name, Table Description, Field Name, Field Description, and Relation ID. The Relation ID is used to uniquely identify and link tables with relationships, forming a global data relationship network, which is the foundation for the large model to understand database semantics.
[0037] Large Model Hints and Knowledge Embedding Module: This module is used to dynamically or statically construct hint context from metadata information, or to embed database table structure knowledge into the large model through fine-tuning, pre-training, etc., so that the large model can "understand" the database schema.
[0038] Natural Language Parsing and SQL Generation Module: Utilizing a large model with database knowledge, it accurately maps unstructured natural language query intents to structured database elements (tables, fields, join conditions, aggregate functions, etc.) and generates grammatically correct SQL code.
[0039] The SQL intelligent validation and rewriting module introduces a large model as a "security and analysis officer" to perform a double check on the SQL: first, it checks the syntax correctness and execution feasibility; second, it checks for the presence of malicious code patterns (such as DROP, UNIONSELECT injection, etc.). This validation process is iterative until a safe and legal SQL is generated.
[0040] The data query and feedback verification module constructs a closed-loop feedback mechanism. The large model not only generates SQL but also evaluates the quality and relevance of the query results. If the results are empty, mismatched, or incomplete, a re-analysis process is triggered, demonstrating the system's cognitive intelligence.
[0041] Results Analysis and Visualization Module: Integrates a rule engine or lightweight model to quickly analyze the results dataset (such as determining whether it is time-series data, comparative data, etc.), and automatically calls the corresponding visualization component library for rendering based on the analysis conclusions, realizing the automation of "data-insight-presentation". Example
[0042] This embodiment provides an intelligent decision analysis system based on relational database modeling and large-scale model fusion, as provided by the present invention. Figure 1 As shown, it includes: Relational Database Modeling Module 101: Defines a structured relational database schema based on the business needs of the target domain, defining entities, attributes, and relationships.
[0043] Metadata Management Module 102: This module contains one or more dedicated metadata tables used to store and manage the data asset catalog, including the names, functional descriptions, field names, field semantic explanations, and inter-table relationships of all data tables.
[0044] Large Model Prompt and Knowledge Embedding Module 103: This module is used to convert the structured knowledge (database table structure, field meaning, and relationships) in the metadata management module into prompts that the large model can understand or to embed knowledge, enabling the large model to have a deep understanding of the database structure.
[0045] Natural Language Parsing and SQL Generation Module 104: Integrated Large Language Model (LLM) is used to receive and parse the user's natural language query and generate SQL query statements based on the user's understanding of the database structure; this module usually integrates or calls a dedicated text2sql model.
[0046] SQL Intelligent Validation and Rewriting Module 105: This module performs syntax and security checks on the generated SQL query statements (such as preventing SQL injection attacks) and can also perform preliminary performance evaluations. If the query fails, it drives the natural language parsing and SQL generation module to iteratively rewrite the query. If the query passes, it inputs the data query and feedback verification module.
[0047] Data Query and Feedback Verification Module 106: This module executes validated SQL queries, retrieves query results from the relational database, and returns the results to the large model for content verification. It determines whether the results accurately and completely answer the user's question. If so, the query results are output; otherwise, the target table or target field is redefined, and the results are returned to the Natural Language Parsing and SQL Generation Module.
[0048] Preferably, it also includes: a result analysis and visualization module 107, which is used to perform intelligent analysis on the query result data, and automatically select and generate the most suitable visualization chart format (such as table, line chart, bar chart, pie chart, etc.) according to the data type (such as time series, classification, numerical comparison, etc.) and analysis intent, and present the query results to the user.
[0049] The relational database modeling module 101 is the data foundation of the system of this invention. Its core function is to transform the business requirements of the target domain into a structured data model that can be recognized and operated by a computer. Unlike traditional database modeling methods, the modeling module of this invention introduces an innovative, semantically rich meta-model structure. This structure not only defines the static structure of the data, but also aims to enhance the deep understanding of data relationships by the large language model, and provides the possibility for the system's self-organization and self-evolution.
[0050] In one specific embodiment, such as Figure 2 As shown, the relational database modeling module is implemented as follows: 1. Core Modeling Elements: Entities and Attributes The core modeling elements are entities (such as "customer" and "product") and attributes (such as "customer name" and "product price"), which is consistent with the traditional ER model.
[0051] The innovation of this invention lies in the fact that each "entity" and "attribute" is defined as a metadata object with rich public attributes. These public attributes together constitute an enhanced data model oriented towards semantic understanding and relationship discovery.
[0052] 2. Definition of common attributes for semantic understanding The public attribute set may include the following key fields: Description: This field is used to describe in natural language the specific role and meaning of the current entity or attribute within the business scenario. For example, add the description to the "Customer ID" attribute: "A unique customer identifier for this system, used to associate all order records of the customer." This field is directly used as high-quality corpus input into the large model's prompt words and knowledge embedding module, enabling it to accurately understand the business context of each data element.
[0053] Tags: Used to assign one or more category identifiers to entities or attributes. For example, tagging attributes such as "sales revenue" and "cost" with "financial indicators". This design enables the metadata management module to go beyond the limitations of physical foreign keys, allowing for flexible, tag-based cross-entity and cross-table join queries and aggregations, thereby discovering and organizing hierarchical, multi-dimensional data views.
[0054] Inheritance: Used to declare the parent entity or attribute that the current entity or attribute inherits from. Child objects will automatically possess all fields and public attributes of the parent object. This not only simplifies the modeling process, but more importantly, it enables the metadata management module to automatically infer the semantic relationship network of "is". For example, defining a "VIP Customer" entity that inherits from the "Customer" entity allows the system to understand that all attributes and relationships of "Customer" also apply to "VIP Customer".
[0055] Relationship: Used to explicitly and declaratively describe the relationship between the current entity or attribute and another entity. Relationship types include, but are not limited to, Composition, Aggregation, and traditional one-to-many relationships. This provides a richer semantic description than physical foreign keys.
[0056] Mask: A Boolean control flag that determines whether the current entity or attribute is exposed in global join queries. When set to "Mask", the data element may be used only by its directly related entity in a specific context. This provides fine-grained control over data visibility and privacy protection, ensuring security and compliance during the data join discovery process.
[0057] Self-organization: This is a key innovation control attribute. When the "self-organization" flag of an attribute is activated, it authorizes the metadata management module to automatically create new, derived modeling relationships based on data usage patterns, content characteristics, or interactions with the larger model.
[0058] PIDS: This is a core relational traceability identifier.
[0059] When the object is an "attribute", its PIDS field is used to explicitly record and associate the parent entity to which this attribute belongs. This establishes a clear and traceable "attribute-entity" attribution chain, ensuring that each attribute can be accurately located to its respective business entity.
[0060] When the object is an "entity", its PIDS field is used to record which parent entities the entity is derived from during the "self-organization" process. For example, when a new entity named "High-Value Customer Product Preference" is generated through the self-organization mechanism, its PIDS will point to the "Customer" entity and the "Product" entity.
[0061] The PIDS field provides a precise lineage tracking mechanism for the entire metadata system. It enables the metadata management module 102 to efficiently manage and query complex data-derived relationships, and provides crucial lineage evidence when performing association recommendations or relationship inferences.
[0062] Attribute Layer: This is a list structure that allows for multiple interpretations of a single attribute from different domains or perspectives. For example, an "amount" attribute could have the following interpretations in its attribute layer: 1. (Financial perspective) "Refers to the book value excluding tax"; 2. (Sales perspective) "Refers to the final transaction amount after negotiation with the customer." This design solves the problem of ambiguity in the meaning of a single business term in different business scenarios, enabling the large model to select the most appropriate semantic layer for understanding based on the specific query context, greatly improving the accuracy of natural language parsing.
[0063] 3. Supporting innovation mechanisms for system self-organization For example, a "product origin" attribute is marked as allowing "self-organization." When the system detects a large number of queries involving both "product origin" and "logistics warehouse," the metadata management module can automatically create a new "origin-warehouse" relationship without manual intervention and record it in the metadata. This allows the entire system's data model to be continuously enriched and evolved with use, providing the large model with increasingly enhanced and dynamically growing contextual knowledge, significantly improving its understanding and reasoning capabilities.
[0064] By introducing the aforementioned innovative meta-model structure, the relational database modeling module of this invention outputs no longer a static schema solely for the database engine, but a dynamic, semantically rich, and growable "knowledge graph-based" data model. The significant benefits include: 1. Greatly enhances the depth of understanding of the database by large models: Through "description", "label", "attribute layer" and other means, the data is given a rich business context, so that LLM is no longer "the blind men and the elephant".
[0065] 2. Enables flexible and multi-dimensional data association: By using "tag" and "relationship" attributes, it breaks the limitations of physical foreign keys and supports more complex business logic queries.
[0066] 3. It endows the system with the ability to self-evolve: Through the "self-organizing" attribute, the system can learn and expand data relationships from actual use, making the system more and more "intelligent" the more it is used.
[0067] 4. Improved model accuracy and robustness: The "attribute layer" solved the problem of terminology ambiguity, and the "masking" ensured data security. Example
[0068] This embodiment provides an intelligent decision analysis method based on relational database modeling and large model fusion, requiring a system as described in Embodiment 1, such as... Figure 3 As shown, the method includes: S1. Initial modeling process: The business database is constructed through the relational database modeling module 101, and the detailed description information of all database tables is entered through the metadata management module 102 to form the system knowledge base; S2. Intent parsing and query planning process: The question input by the user through the natural language interface is obtained. The natural language parsing and SQL generation module 104 deeply analyzes the user's intent based on the database knowledge obtained from the large model prompt words and knowledge embedding module 103, and plans the target data table, fields and their relationships to be accessed, and then generates SQL query statements. S3, SQL security verification process: The SQL intelligent verification and rewriting module 105 performs syntax validity and security checks on the generated SQL query statement; if it fails, the natural language parsing and SQL generation module 104 is driven to perform iterative rewriting until a fully valid and secure SQL query statement is produced. S4. Execution of query and result verification process: The data query and feedback verification module 106 sends the verified SQL query statement to the underlying relational database for execution, obtains the query result, and returns the query result to the large model for content verification to determine whether it accurately and completely answers the user's question. If so, the query result is output; otherwise, the target table or target field is redefined, and then the intent parsing and query planning process is returned.
[0069] S5. Results Analysis and Visualization Process: The results analysis and visualization module 107 performs intelligent analysis on the query results data, and automatically selects and generates the most suitable visualization chart format to present the query results based on the data type and analysis intent.
[0070] Preferably, during the execution of the query and result verification process, the method for redetermining the target table or target field is as follows: using the current query result and the original question as context, re-analyze the question, and deduce the target table or target field that needs to be adjusted.
[0071] In one specific implementation, the metadata management module provides intelligent data matching functionality. It is responsible for intelligently matching and inserting data structures extracted from unstructured / semi-structured data sources via a large model, conforming to the unique modeling specifications of this invention, into the most suitable existing database entity tables. Its core innovation lies in a multi-dimensional, weighted, and fused semantic matching decision model. The specific steps are as follows: Suppose the large model has extracted the following data structure (called data object O) from a document: Data object O { Entity Name: "Quarterly Sales Report for Project XX" Note: This section records the sales performance of sales personnel in each region during the fourth quarter of 2023. Tags: ["Sales", "Performance", "Quarterly Report"], Inheritance: null, Relationship: [{"Type": "Set", "Target": "Salesperson"}], Block: false, Attribute layer: [{"Perspective": "Financial", "Description": "..."}], PIDS: null, / / New data, no parent source Attribute fields: [ {Field name: "Region", Description: "Geographical area covered by sales operations", ...}, {Field name: "Salesperson's name", Description: "Employee responsible for sales in this region", ...}, {Field name: "Sales amount", Description: "Total sales amount completed in this quarter", ...}, {Field name: "Achievement rate", Description: "Percentage of sales achieved relative to the target", ...} ] } The module will calculate a comprehensive matching score Score(O, E_i) for each candidate entity E_i ∈ {all entities} in the system, based on the data object O. Finally, the entity with the highest score is selected for data insertion. For example... Figure 4 As shown, the calculation process involves a weighted evaluation of the following eight dimensions: Dimension 1: Entity Name Matching Degree (S_name) - Objective: To evaluate the similarity of the core themes between the data object to be inserted and the candidate entities.
[0072] - Calculation process: 1. Get a list of names of all candidate entities.
[0073] 2. Use a large model for semantic similarity evaluation. Example prompt: "Based solely on entity names, determine the semantic relevance between '[O.entityName]' and '[E_i.entityName]', and give an integer score from 1 to 10." 3. If the PIDS of O or E_i is not empty, then recursively obtain the names of all its ancestor entities, perform the above similarity calculation with the names of the other party respectively, and take the highest score as S_pids.
[0074] 4. If the inheritance field of O or E_i is not empty, obtain the name of the parent entity in its inheritance chain, calculate the similarity, and take the highest score as S_inherit.
[0075] - Weight calculation formula: S_name(O, E_i) = (S_direct + S_pids + S_inherit) / 3 (Where, S_pids and S_inherit are 0 if they do not exist.) Dimension Two: Description of Match (S_description) - Objective: To assess the semantic consistency between the two at the level of detailed business description.
[0076] - Calculation process: 1. Retrieve the "Description" field for all candidate entities.
[0077] 2. Use a large model for evaluation. Example prompt: "Please compare the core meaning of the following two business descriptions..." Figure 1 Consistency, give a score from 1 to 10. Description A: [O. Explanation]. Description B: [E_i. Explanation]. - Weight calculation formula: S_description(O, E_i) = LLM_Score(O.description, E_i.description) Dimension 3: Tag Matching Degree (S_tag) - Objective: To assess the overlap between the two in their classification systems.
[0078] - Calculation process: 1. Obtain the set of "tags" for all candidate entities.
[0079] 2. Use a large model for evaluation. Example prompt: "Please determine the classification similarity between label set A [O.label] and label set B [E_i.label]. Consider label overlap and semantic relevance, and give a score from 1 to 10." - Weight calculation formula: S_tag(O, E_i) = LLM_Score(O.label, E_i.label) Dimension 4: Relation Matching Degree (S_relation) - Objective: To evaluate the structural compatibility of the relationship network declared by the data object to be inserted with the candidate entity in the existing knowledge graph.
[0080] - Calculation process: 1. Using candidate entity E_i as the center, extract its local subgraph (e.g., first-degree or second-degree neighbors) in the knowledge graph G.
[0081] 2. For each relation r_o declared in relation O, find the semantically most similar relation r_e in the local subgraph of E_i.
[0082] 3. Using the aforementioned dual-channel weight calculation model, calculate the matching score between r_o and r_e. This process not only compares the relation types but also evaluates the degree of fit between their structural importance and contextual relevance using GNN and LLM.
[0083] 4. Take the average of the matching scores for all O. relations.
[0084] - Weight calculation formula: S_relation(O, E_i) = Average( W_final(r_o, r_e) for each r_o in O.relation) (If the O. relation is empty, then this dimension scores a neutral value of 5.) Dimension 5: Compatibility Blocking (S_block) - Purpose: A veto or penalty dimension to ensure that data is not inserted into entities that are hidden or have incompatible visibility.
[0085] - Calculation process: 1. If the "mask" field of candidate entity E_i is true, it will be given a very low score (e.g., 0), unless there is a special overriding strategy.
[0086] 2. If O.masking is true and E_i.masking is false, give a moderate penalty (score 3), because this may expose data that should be hidden.
[0087] 3. If neither is masked or matched, full marks (10) are awarded.
[0088] - Weight calculation formula: S_block(O, E_i) = the score obtained by looking up the table according to the above rules. Dimension Six: Attribute Layer Matching Degree (S_attribute_layer) - Purpose: To address the ambiguity of business terminology and ensure that data is understood from the correct business perspective.
[0089] - Calculation process: 1. Treat the O. attribute layer and the E_i. attribute layer as two sets of perspectives.
[0090] 2. Use a large model to determine the compatibility of two view sets. Example prompt: "Do view set A [O.attribute layer] and view set B [E_i.attribute layer] describe the same or compatible business domains? Please give a compatibility score from 1 to 10." - Weight calculation formula: S_attribute_layer(O, E_i) = LLM_Score(O.attribute_layer, E_i.attribute_layer) Dimension 7: Attribute Field Matching Degree (S_field) - Purpose: To evaluate the semantic and structural similarity between the fields of the data object and the fields of the candidate entity, which is one of the most critical dimensions.
[0091] - Calculation process: 1. For each attribute field f_o of O, find the one f_e that is most semantically similar among all attribute fields of E_i.
[0092] 2. Use a large model to perform a comprehensive semantic matching score for (f_o.field_name, f_o.description) and (f_e.field_name, f_e.description).
[0093] 3. Calculate the weighted average of the matching scores for all f_o fields. The weights can be determined by the importance of the field in the business context, or simply by using an arithmetic average.
[0094] - Weight calculation formula: S_field(O, E_i) = Average( LLM_Score(f_o, f_e) for each f_o in O.attribute field) Dimension 8: PIDS Source Matching Degree (S_pids_trace) - Objective: To use kinship information to find the source of data and improve matching accuracy.
[0095] - Calculation process: 1. If O.PIDS is not empty, then parse out all its source entities P_list.
[0096] 2. Calculate the entity name matching degree (S_name) between the candidate entity E_i and each source entity in P_list.
[0097] 3. Take the highest score among them as the score for this dimension.
[0098] 4. If O.PIDS is empty (e.g., new data), then this dimension is scored as a neutral value of 5.
[0099] - Weight calculation formula: S_pids_trace(O, E_i) = max( S_name(E_i, P) for P in O.PIDS ) or 5 After calculating the scores for the eight dimensions, a weighted linear model is used to obtain the final overall matching score: Final_Score(O, E_i) = Σ (w_j * S_j(O, E_i)) for j in [name,description, tag, relation, block, attribute_layer, field, pids_trace] in, - w_j are the predefined weights for each dimension or the weights learned through machine learning, satisfying Σ w_j = 1. In the initial stage, these weights can be set manually, for example, giving higher weights to S_field and S_description.
[0100] - The system selects the candidate entity E_target of ArgMax(Final_Score(O, E_i)) as the target for data insertion.
[0101] - A minimum score threshold can be set. If the highest score is lower than this threshold, an alarm will be triggered or a self-organizing process will be started to create a new entity to accommodate the data.
[0102] In a preferred embodiment, the metadata management module is also used to provide a self-organizing modeling function. When the overall matching score of all candidate entities is lower than a preset confidence threshold, a self-organizing process is triggered to create new entities or relationships to expand the knowledge boundary of the system.
[0103] When the final matching score (Final_Score) of all candidate entities is lower than the preset confidence threshold (e.g., 0.7), it indicates that the current knowledge model cannot accommodate the newly extracted data object O. At this point, the system will automatically trigger a self-organizing process to create new entities or relationships to expand the system's knowledge boundary.
[0104] Step 1: Triggering and Initialization - Triggering conditions: 1. Main condition: Intelligent data matching fails, i.e. Max(Final_Score(O, E_i)) < θ_confidence (θ_confidence is a configurable threshold).
[0105] 2. Auxiliary condition: The system detected that within a specific time window, multiple highly similar data objects O_1, O_2, ... failed to match, which reinforced the necessity of creating a new entity.
[0106] - Initialization Action: The system creates a self-organizing task log, recording the triggering data object O, the trigger time, and the failure scores of all candidate entities for auditing and model optimization.
[0107] Step 2: Defining the New Entity Semantic Kernel The goal of this step is to extract the core semantic information needed to create a new entity based on the data object O.
[0108] 1. Large-model-driven semantic induction: - Input all information of data object O (entity name, description, labels, attribute fields, etc.) into the large language model.
[0109] - Use specific prompts to guide the large model in induction: The existing database cannot properly store the following data object. Please design a new database table (entity) based on this object. Please strictly adhere to the following JSON format and output only the JSON content: > { > "proposed_entity_name": "Suggested new entity name", > "proposed_entity_description": "Clearly describes the business meaning and boundaries of the new entity", > "proposed_tags": ["tag1", "tag2", ...], > "proposed_attributes": [ {"attribute_name": "Field name 1", "description": "Field business description", "data_type": "Suggested data type"}, > ... > >}” - The system parses the output of the large model to obtain the semantic kernel of the new entity proposal E_new.
[0110] 2. Conflict Detection and Negotiation: - The system will perform semantic similarity calculation again between E_new.proposed_entity_name and the existing list of entity names.
[0111] If a highly similar existing entity is found, it indicates a potential duplicate creation. In this case, the system can feed this conflict, along with detailed information about O, back to the larger model, requesting it to reconsider the entity definition or explain why the existing entity cannot be used. This closed-loop verification ensures the uniqueness and necessity of the new entity.
[0112] Step 3: Relationship Network Integration A new entity cannot be isolated; it must be integrated into the existing knowledge graph. This step determines the relationship between E_new and existing entities E_existing.
[0113] 1. Discovering Potential Relationships: - Perform multiple rounds of comparison between the semantic kernel of E_new (especially name, description, and label) and all existing entities in the knowledge graph.
[0114] - Use large models for relational reasoning: "New entity: [Explanation of E_new]. Existing entity: [Explanation of E_existing]. Please determine the most likely type of business relationship between them: A) Containment B) Set C) One-to-one D) One-to-many E) No direct strong relationship. Please only output the option letters." - At the same time, based on the "relationship" field declared in O, the known relationship pointers are extracted.
[0115] 2. Relationship confirmation and PIDS assignment: - The system synthesizes the inference results of the large model and the original statement of O to generate a set of relational hypotheses to be established, R_proposed = {(E_new, r, E_target), ...}.
[0116] For each relationship to be established, the system automatically assigns a value to the PIDS field of E_new, pointing to its source entity E_target, thus recording the lineage of this derivation. Simultaneously, the system adds a reverse relationship to the E_target entity, pointing back to E_new, forming a bidirectional link.
[0117] Step 4: Structured Schema Generation and Deployment This step transforms the semantically new entity into a technically executable database operation.
[0118] 1. DDL script generation: - The function of the self-organizing control center to call the relational database modeling module 101.
[0119] - Automatically generate standard SQL CREATE TABLE statements based on the semantic core and attribute list of E_new.
[0120] - The statement includes: - Table name (derived from proposed_entity_name).
[0121] - For each attribute field, use the suggested data type or the default type inferred from the description.
[0122] - Define a primary key (e.g., an auto-incrementing id field).
[0123] - Based on the results of step three, create foreign key constraints for the parent entity associated through the relationship (if the relationship strength is sufficient).
[0124] 2. Metadata Registration: - After the new entity table is successfully created, the system immediately registers it with the metadata management module 102.
[0125] - Write all public attributes of E_new (name, description, label, PIDS, etc.) and metadata of all attribute fields into the metadata table.
[0126] This signifies that the new entity E_new has officially become a member of the system's knowledge base and can be immediately used for subsequent data matching, querying, and understanding.
[0127] Step 5: Data Injection and Loop Closure Verification 1. Data Insertion: Insert the data from the original data object O that triggered this process into the newly created table E_new.
[0128] 2. Validation Query: The system automatically generates a test query for the new entity and the newly established relationship. Execute the query and verify whether the result meets expectations.
[0129] 3. Feedback Learning: The entire process of this self-organizing event (including triggering data, new entity definitions, and established relationships) is saved as a high-quality training sample in the model training dataset for subsequent optimization of model parameters and decision weights. This forms a complete intelligent closed loop from perception to decision-making to action to learning.
[0130] In this embodiment, the complete query analysis process is a multi-stage, feedback-loop-based intelligent processing pipeline, and the execution flow is as follows: Figure 5 As shown: 1. Initial Modeling: The business database schema is constructed through the relational database modeling module, and detailed descriptions of all database tables are entered through the metadata management module to form the system knowledge base.
[0131] 2. User query input: Users input a complex analysis or decision-making question through a natural language interface.
[0132] 3. Intent parsing and query planning: The large model in the natural language parsing and SQL generation module deeply analyzes the user's intent based on the database knowledge obtained from the prompt words and knowledge embedding module, and plans the target data tables, fields and their relationships to be accessed.
[0133] 4. Initial SQL generation and security verification: a. This module generates the initial SQL query statement.
[0134] b. The SQL intelligent validation and rewriting module immediately performs a legality (syntax) and security (attack prevention) check on the SQL.
[0135] c. If the check fails, the error message or risk point is fed back to the SQL generation module, requesting it to rewrite and generate a new SQL statement. This cycle continues until a fully valid and safe SQL statement is generated.
[0136] 5. Execute queries and retrieve data: The validated SQL statements are sent to the underlying relational database for execution, and the data query and feedback verification module retrieves the query result set.
[0137] 6. Result verification and feedback loop: a. The result set is returned to the larger model (usually the same model as the parsing and generation modules) for validation. The larger model, based on the original user question, determines whether the data is what the user wants and whether it is complete.
[0138] b. If the judgment is negative (e.g., data is empty, key dimensions are missing, or the answer is irrelevant), the system will use the current result and the original question as context to re-analyze the problem and deduce the query targets that may need to be adjusted (e.g., missing table joins, incorrect field selection, etc.), thereby re-determining the tables and fields that need to be accessed.
[0139] c. Subsequently, the process jumps to step 4, where the SQL is regenerated based on the latest analyzed table and field planning, and the subsequent validation and query steps continue. This feedback loop can be repeated multiple times to ensure that a high-quality result is obtained.
[0140] 7. Global Data Presentation: a. After the above iterative process, the dataset finally retrieved from the database is an accurate result based on a global data model and after multiple rounds of intelligent verification, which is fundamentally different from the fragmented retrieval of traditional RAG.
[0141] b. Finally, the results analysis and visualization module analyzes the data, intelligently determines the most suitable presentation method (e.g., select line chart for trend chart, pie chart for percentage analysis), and displays the final results to the user in a visual form.
[0142] The technical solutions provided in the embodiments of the present invention have at least the following technical effects: 1. Achieved true global data insight and analysis: Overcame the limitations of traditional RAG systems that could only retrieve local and fragmented knowledge. By building and utilizing a structured relational database, this system can access, correlate, and analyze data across the entire domain, ensuring that the generated decision recommendations are based on a complete and consistent data foundation, and providing deeper business insights.
[0143] 2. Enhanced intelligent conversion capabilities and reliability of natural language to data queries: By deeply embedding database metadata (table structure, field semantics, and relationships) into the cognitive framework of a large model, it can not only understand user intent but also accurately map that intent to complex database operations. Combined with a unique intelligent SQL statement validation and multi-round iterative rewriting mechanism, it greatly improves the accuracy, security (effectively defending against SQL injection attacks), and execution efficiency of automatically generated SQL, while reducing the risks and error rates of directly using the original text2sql technology.
[0144] 3. Enhanced system cognitive and reasoning capabilities: Going beyond simple question-and-answer and retrieval, the system possesses multi-round, closed-loop intelligent verification and optimization capabilities. The system can self-evaluate initial query results; if the results do not meet requirements, it can automatically initiate a new round of more in-depth analysis and querying. This process simulates the human analytical reasoning path, giving the system preliminary cognitive intelligence, making it suitable for complex decision support scenarios.
[0145] 4. It has the ability to intelligently present results adaptively: It integrates data perception and visualization adaptation functions, which can automatically determine the data type and analysis purpose of the query results, and dynamically select the most appropriate chart (such as tables, line charts, etc.) for presentation, thereby improving user experience and data interpretation efficiency, and realizing the leap from "getting data" to "gaining insights".
[0146] 5. Excellent versatility and scalability: The system architecture is decoupled from specific business domains. By changing the underlying database model and metadata description, it can be quickly adapted to different industries such as finance, healthcare, government affairs, and manufacturing, providing a universal method for building intelligent data analysis and decision support systems, reducing development barriers and implementation costs.
[0147] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0148] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0149] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0150] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0151] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An intelligent decision analysis system based on relational database modeling and large-scale model fusion, characterized in that, include: Relational Database Modeling Module: This module defines a structured relational database based on the business needs of the target domain, defining entities, attributes, and relationships. Metadata Management Module: This module consists of one or more dedicated metadata tables used to store and manage the data asset catalog, including the names, functional descriptions, field names, field semantic explanations, and inter-table relationships of all data tables. Large Model Hints and Knowledge Embedding Module: This module is used to transform the structured knowledge in the metadata management module into hints that the large model can understand or to embed knowledge, enabling the large model to have a deep understanding of the database structure. Natural Language Parsing and SQL Generation Module: This module receives and parses users' natural language queries and generates SQL query statements based on their understanding of the database structure. The SQL intelligent validation and rewriting module is used to perform syntax and security checks on the generated SQL query statements. If the statements fail, it drives the natural language parsing and SQL generation module to perform iterative rewriting. If the statements pass, it inputs data query and feedback validation modules. Data Query and Feedback Validation Module: This module executes validated SQL queries, retrieves query results from the relational database, and returns the results to the large model for content validation. It determines whether the results accurately and completely answer the user's question. If so, the query results are output; otherwise, the target table or target field is redefined, and the result is returned to the Natural Language Parsing and SQL Generation Module.
2. The system according to claim 1, characterized in that: The core modeling elements of the relational database modeling module include "entities" and "attributes". Each "entity" and "attribute" is defined as a metadata object that includes multiple public attributes, such as description, tag, inheritance, relationship, and masking.
3. The system according to claim 2, characterized in that: The public attributes also include self-organization. When the self-organization field is activated, the authorized metadata management module can automatically create new and derived modeling relationships based on the data's usage patterns, content characteristics, or interaction results with the large model.
4. The system according to claim 3, characterized in that: The public attributes also include a relational origin identifier (PIDS). When the object is an "attribute", its PIDS field is used to record and associate the parent entity to which this attribute belongs. When the object is an "entity", its PIDS field is used to record which one or more parent entities the entity is derived from during the self-organization process.
5. The system according to claim 1, characterized in that, Also includes: The results analysis and visualization module is used to intelligently analyze query results data and automatically select and generate the most suitable visualization charts based on the data type and analysis intent to present the query results.
6. An intelligent decision analysis method based on relational database modeling and large-scale model fusion, characterized in that, The system as described in any one of claims 1-5 must be provided, and the method comprises: Initial modeling process: The business database is built through the relational database modeling module, and the detailed description information of all database tables is entered through the metadata management module to form the system knowledge base; Intent parsing and query planning process: The question input by the user through the natural language interface is obtained. The natural language parsing and SQL generation module deeply analyzes the user intent based on the database knowledge obtained from the prompt words of the large model and the knowledge embedding module, and plans the target data tables, fields and their relationships to be accessed, and then generates SQL query statements. SQL security verification process: The generated SQL query statement is checked for syntax validity and security by the SQL intelligent verification and rewriting module; if it fails, the natural language parsing and SQL generation module is driven to rewrite it iteratively until a fully valid and secure SQL query statement is produced. The query execution and result verification process: The data query and feedback verification module sends the validated SQL query statement to the underlying relational database for execution, obtains the query results, and returns the query results to the large model for content verification to determine whether it accurately and completely answers the user's question. If so, the query results are output; otherwise, the target table or target field is redefined, and then the intent parsing and query planning process is returned.
7. The method according to claim 6, characterized in that: During the execution of queries and result verification, the method to redetermine the target table or target field is as follows: take the current query results and the original question as context, re-analyze the question, and deduce the target table or target field that needs to be adjusted.
8. The method according to claim 6, characterized in that: The metadata management module is used to provide intelligent data matching function, calculate the corresponding comprehensive matching score between the data object and each candidate entity in the system, and select the entity with the highest score for data insertion.
9. The method according to claim 8, characterized in that: When the overall matching score of all candidate entities is lower than the preset confidence threshold, a self-organizing process is triggered to create new entities or relationships to expand the knowledge boundary of the system.
10. The method according to claim 6, characterized in that, Also includes: Results analysis and visualization process: The query results data are intelligently analyzed, and the most appropriate visualization chart format is automatically selected and generated based on the data type and analysis intent to present the query results.