Dlf-based ai trusted number inquiry device for production system
By using DLF electronic voucher sets and digital signature technology, the problems of low accuracy and data security risks in AI-generated SQL are solved. It realizes trusted traceability throughout the entire lifecycle from the data source to the query result, ensuring the accuracy and security of SQL generation, and providing trusted data reports and a traceable verification chain.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU ZHONGWEI TECH SOFTWARE SYST
- Filing Date
- 2026-05-26
- Publication Date
- 2026-06-26
AI Technical Summary
Existing AI-generated SQL suffers from low accuracy, high data security risks, unauditable reports, poor interactivity, and weak data source adaptability. It also lacks a structured semantic model, resulting in inaccurate, unreliable, and difficult-to-verify SQL statements.
The DLF-based AI trusted data query device generates OFD electronic certificates through data configuration, table parsing, semantic enhancement, interactive SQL generation, syntax pre-validation, and data execution modules. It then combines the DLF electronic certificate set for overall digital signature to form an interactively verifiable DLF dynamic format file.
It achieves full lifecycle trusted traceability from natural language query to trusted SQL generation and verifiable results, ensuring the accuracy and security of SQL generation, and providing trusted data reports and a traceable verification chain.
Abstract
Description
Technical Field
[0001] This invention belongs to the field of document technology, specifically an AI-based trusted data query device for production systems based on DLF. Background Technology
[0002] In existing technologies, AI-generated SQL suffers from several drawbacks: Low accuracy: Existing AI-generated data tools have limited understanding of database structures and lack semantic enhancement and business constraint knowledge, leading to inaccurate or illogical SQL statements. High data security risks: AI tools may generate SQL statements containing dangerous operations (such as DROP and DELETE), lacking effective syntax and security verification mechanisms, easily causing data leaks or damage. Unauditable and unreliable reports: Most existing AI-generated reports are static documents, lacking data signatures, structured metadata, and traceable verification links, failing to ensure data integrity and credibility. Poor interactivity and verification difficulties: Users struggle to understand the SQL logic generated by AI and cannot perform real-time, multi-level verification of the data in the reports, resulting in low report efficiency and questionable credibility. Weak data source adaptability: Most tools only support traditional databases, with insufficient support for semi-structured data sources (such as XML, JSON, Excel, etc.), and complex data access processes. Lack of structured semantic models: Existing technologies have not built semantically rich data model snapshots, and AI lacks sufficient contextual information when generating SQL, affecting generation quality and efficiency. Summary of the Invention
[0003] The purpose of this invention is to provide an AI trusted data query device based on DLF for production systems, so as to solve the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: an AI-based trusted data query device for production systems based on DLF, comprising a data configuration module, a data table parsing module, a semantic enhancement module, a pre-set analysis dimension metadata module, a knowledge injection module, an interactive SQL generation module, an SQL description generation module, a syntax pre-validation module, a data execution module, a DLF report generation module, and a verification module; wherein, each module, when performing its function, synchronously generates a corresponding OFD electronic certificate, and solidifies the module's input, output, metadata, snapshot, and operation behavior information; The data configuration module is used for managing interface configuration, data source selection, and synchronously generating "credential-data source configuration.OFD", which records the data source type, connection parameters (de-identified), read-only permission proof, connection pool status, configuration time, and operator. The data table parsing module is used to automatically scan the selected data table, obtain the data table's metadata, and synchronously generate "voucher-table structure snapshot.OFD", which records the table name, fields, types, comments, primary and foreign key relationships, business semantics, and relationship topology; The semantic enhancement module performs semantic expansion based on the aforementioned metadata, and simultaneously generates "Voucher-Semantic Model Expansion.OFD", which records the semantic expansion results of fields, dictionary item explanations, constraints, inter-table relationships, and common analysis dimensions. The pre-set analysis dimension metadata module refers to the centralized management of the business semantics and calculation logic of statistical dimensions in all pre-set SQL query templates, and provides real-time explanations when users query, realizing automatic mapping between technical code and business understanding, and synchronously generating "voucher-analysis dimension and business rule.OFD", which records the mapping relationship between technical fields and business terms, calculation logic and real-time explanation information; The interactive SQL generation module is used to generate corresponding SQL query statements based on the understanding of user intent and data structure, and simultaneously generate "voucher-SQL generation process.OFD", which records the original natural language question, the statement after intent analysis, the prompt input to LLM, the SQL generated by LLM, and the user modification record; The SQL description generation module generates a natural language description based on the generated SQL, and simultaneously generates "Voucher-SQL Natural Language Explanation.OFD", which records the human-readable description of the SQL and its generation method. The syntax pre-validation module is used to perform security verification and interpretation on SQL statements, and synchronously generate "credential-SQL security and syntax verification.OFD" to record syntax check results, dangerous operation detection, unauthorized access verification results and verification rule versions. The data execution module is used to execute the verified SQL statements in the data configuration module and generate a result set. It also generates "voucher-data execution and result set.OFD" synchronously, which records the executed SQL, execution time, number of rows affected, result set hash value and data snapshot time.
[0005] The DLF electronic certificate set aggregates all the above OFD electronic certificates according to the order and logical relationship of the operation behavior chain to form a DLF trusted electronic certificate set, and performs overall digital signature on the certificate set to generate an interactively verifiable DLF dynamic version file. The verification module is based on the DLF electronic certificate set, constructs an interactive hierarchical verification link, and performs click verification.
[0006] Preferably, the data configuration module supports data types including MySQL, Oracle, PostgreSQL, host address, port, tablespace / database name, username and password, xml, json, moogdb, and excel. During the configuration process, the data is escaped and imported into the database by parsing the file format, and the configuration information and content are saved in the configuration data table. The system connects to the database periodically and maintains a data connection pool. If a connection error occurs, it will provide early warning, monitor and repair it. During the configuration process, a "credential-data source configuration.OFD" is generated synchronously, recording the data source type, connection parameters, read-only permission proof, connection pool status, configuration time and operator, and this credential is used as the first component of the DLF credential set.
[0007] Preferably, the content obtained in the data table parsing module includes physical structure, business semantics, and relational topology. The physical structure includes field data types, lengths, precision, and whether they are nullable. The business semantics are understood by reading table comments and field comments, constraints, and query examples in the database. The relational topology refers to automatically detecting and obtaining primary key and foreign key relationships, constructing a preliminary inter-table relationship graph, and automatically organizing the mutual relationships, indexes, business rules, and associations between tables into automatic DLF extended structure information. At the same time, the DLF file automatically connects to the database, monitors the field, description, and meaning content for dynamic updates, and saves the concept of version. It synchronously generates "credential-table structure snapshot.OFD", saving the table name, fields, types, comments, primary and foreign key relationships, business semantics, and relational topology to the OFD metadata layer and attachment layer, and supports version evolution records as a reliable credential for subsequent SQL generation.
[0008] Preferably, the semantic expansion is based on the dynamic structure of the DFL table, further enhancing the table's descriptive information. Enhancement methods include: table description content, field semantic expansion, constraint condition description (identifying and displaying business constraints), and dictionary item constraints (AI or manual expansion for each dictionary value). Table-level relationships and business logic hints: clearly describing the association between tables, injecting common analysis dimensions, setting up connections and mappings between different tables, and saving the corresponding expanded information to a DLF format file. Simultaneously generating "voucher-semantic model expansion.OFD", recording field semantic expansion results, dictionary item explanations, constraints, table relationships, and common analysis dimensions, forming a structured semantic model snapshot, ensuring that the semantic information upon which AI-generated SQL depends is solidified and traceable.
[0009] Preferably, the system centrally manages the business semantics and computational logic of the statistical dimensions in the table query settings. It integrates and organizes the basic information of the data tables and the enhanced Roche information stored in the DLF, and infers the logical prompt information of the current table by combining SQL syntax and business scenarios. It also supports online testing and some interactive online adjustments and verifications, and provides real-time explanations when users query, realizing automatic mapping between natural language and business terminology. It synchronously generates "credential-analysis dimension and business rule.OFD", which records the mapping relationship between technical fields and business terms, computational logic and real-time explanation information, realizing a trusted credential mapping between business semantics and technical code.
[0010] Preferably, in the interactive SQL generation module, after presenting data questions in natural language and pre-defined analysis structures, the corresponding data semantic models are combined to construct prompt words, which are then sent to the integrated large language model. During question-and-answer sessions, the DLF stores process information data, recording the original question, the content of the extracted data, the organized model exploration statements, the converted SQL statements, the analysis and verification results of the statements, the returned original data, and the processed return result information. In the SQL generation description module, the description generation is mainly achieved automatically by the device or by calling the LLM to generate a human-readable natural language description for the generated SQL, and simultaneously generating "credential-SQL generation process.OFD", which records the original natural language question, the statement after intent analysis, the Prompt input to the LLM, the SQL generated by the LLM, the user modification records, and the relationship between the intermediate OFD documents. The SQL description generation module simultaneously generates "credential-SQL natural language interpretation.OFD", which records the human-readable description corresponding to the SQL and its generation method, realizing the reliable retention of the AI reasoning process.
[0011] Preferably, the syntax pre-validation module performs syntax checks and security verifications on the SQL by building in or calling the SQL parser. The verification includes checking whether the SQL contains DROP, DELETE, or UPDATE statements, or whether it involves unauthorized table access. If an error is detected, a clear error message is given and recorded in the DLF execution result. The module also refines the rules, optimizes the SQL question-and-answer rules, improves the result information, and synchronously generates a "credential-SQL security and syntax verification.OFD". This credential records the syntax check results, dangerous operation detection (DROP / DELETE / UPDATE), unauthorized access verification results, verification rule version, and error message. This credential serves as a key proof of security and trustworthiness in the DLF credential set.
[0012] Preferably, the data execution module executes the verified SQL statements through a read-only data connection and monitors the execution status of the queries, triggering circuit breakers for queries that time out or consume excessive resources. Upon successful execution, the module retrieves the query result set in JSON or Parquet format and records key execution metadata, including execution time, number of affected rows, and data snapshot time. Based on the query process, optimization suggestions are provided for the SQL execution, including creating an index on the sorting field and recording this in the DLF dynamic file for effect comparison. Simultaneously, a "credential-data execution and result set.OFD" is generated, recording the executed SQL, execution time, number of affected rows, result set hash value, data snapshot time, and execution metadata. A result set summary is saved to the OFD attachment layer as a trustworthy and tamper-proof credential for the data results.
[0013] The DLF electronic certificate set is a trusted DLF electronic certificate set, which includes report metadata OFD certificate, data source information OFD certificate, semantic model snapshot OFD certificate, SQL generation and verification record OFD certificate, execution context OFD certificate, data signature certificate, and result data digest certificate. The trusted DLF electronic certificate set is digitally signed as a whole to generate a dynamic DLF format file, wherein the DLF file itself and each OFD certificate within it can be independently verified.
[0014] Preferably, the hierarchical verification link in the verification module refers to using the DLF electronic voucher set as the verification file carrier and setting key elements in the report as clickable links or buttons. This allows for mind-map-based drilling down of the dynamic logical structure of the DLF, tracing the source of the data report and the reasoning process. Key elements include tables, SQL statements, and data verification. In click verification, for the DLF report file, active verification is performed at various dimensions by clicking links in the report, including: clicking "Table Structure": viewing a snapshot of the table definitions used when generating the report; clicking "SQL Statement": copying it to the database client for manual verification; clicking the "Verify" button next to "Data Signature": under the same conditions, the device reconnects to the database; runs the SQL again, calculates the hash value of the new result, and compares it with the historical data fingerprint fixed in the report; clicking "Result Preview": expanding to view the data sample captured when the report was generated; simultaneously supporting overall verification of the voucher set and independent verification of a single OFD voucher, achieving full-process reliable traceability from the data source to the query result.
[0015] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention creatively combines AI data queries with trusted electronic credentials. For each natural language query, SQL statement and reasoning answer generated by the large language model, system behavior scheduling, process orchestration and Skill ability call during data query, etc., corresponding OFD electronic credentials are generated synchronously. Each reasoning query is assigned an independent identity record containing key information such as generation time, call source, processing process, snapshot of the semantic model of the database table structure on which it is based, and reasoning confidence.
[0016] (2) This invention spans multiple modalities of data and text. It aligns and binds the OFD credentials generated by modules such as data configuration, table structure parsing, semantic enhancement, SQL generation, syntax verification, and data execution in the AI data query device with the inference credentials for data queries through a DLF credential set, according to the sequence of multiple interactions, logical dependencies, and operational behavior chains. This forms a traceable and reproducible AI data query chain, solidifying each technical step from "natural language questioning" to "trustworthy SQL generation" and then to "verifiable result return" into a set of immutable credential units. This ensures that the output of AI data queries is no longer an untraceable "black box result," but a verifiable, verifiable, and auditable trusted output, constructing a trusted traceability chain throughout the entire lifecycle from the data source to the query result.
[0017] (3) This invention utilizes SQL dual security verification and syntax checking to perform syntax and security checks, blocking dangerous operations and unauthorized access. It eliminates data security risks and ensures that only safe and compliant SQL enters the execution phase. Detailed Implementation
[0018] The technical solutions of the present invention will be clearly and completely described below with reference to 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 of ordinary skill in the art without creative effort are within the scope of protection of the present invention. Example
[0019] This invention relates to an AI-based trusted data query device for production systems based on DLF (Data Flow Query), which includes a data configuration module, a data table parsing module, a semantic enhancement module, a pre-set analysis dimension metadata module, a knowledge injection module, an interactive SQL generation module, an SQL description generation module, a syntax pre-validation module, a data execution module, and a verification module. Each module generates a corresponding OFD electronic certificate while performing its function, thus solidifying the module's input, output, metadata, snapshot, and operational behavior information.
[0020] This invention allows for configuration via a data configuration module management interface, enabling the selection and setting of data sources. It supports traditional data types including domestic databases such as MySQL, Oracle, PostgreSQL, and Kingbase. Configuration includes host address, port, tablespace / database name, username, and password. A dedicated account is configured, granting query permissions only to specific tables or views to prevent accidental write operations. It also supports semi-structured files such as XML, JSON, MoogDB, and Excel. During configuration, the file format is parsed, data is escaped, and imported into the database. Data queries are performed, and the configured information and content are added to the DLF file. Based on the dynamic nature of DLF, it periodically connects to the database and maintains a data connection pool according to the configured parameters. In case of connection errors, it monitors, alerts, and repairs. During configuration via the data configuration module management interface, a "credential-data source configuration.OFD" is simultaneously generated, recording the data source type, connection parameters, read-only permission proof, connection pool status, configuration time, and operator. This credential serves as the first component of the DLF credential set.
[0021] Once the data configuration is complete and the database connection is successful, the data table parsing module automatically scans the selected data tables and obtains their metadata, including physical structure, business semantics, and relational topology. Physical structure includes field data types (e.g., INT, VARCHAR), length, precision, and nullability). Business semantics is derived by reading table and field comments, constraints, and query examples to gain a preliminary understanding of the business implications. Relational topology involves automatically detecting and obtaining primary and foreign key relationships, constructing a preliminary inter-table relationship graph, and automatically organizing the inter-table relationships, indexes, business rules, and associations into an automatic DLF extended structure. The DLF file automatically connects to the database, monitors field, description, and meaning content for dynamic updates, and maintains version information. A semantically rich, structured data model snapshot is created to provide crucial context for AI to understand and generate correct SQL. A "credential-table structure snapshot.OFD" is generated simultaneously, saving the table name, fields, types, comments, primary and foreign key relationships, business semantics, and relational topology to the OFD metadata and attachment layers, and supporting version evolution records as a reliable credential for subsequent SQL generation.
[0022] To improve the accuracy of AI-generated SQL, this invention, based on the aforementioned basic metadata, utilizes a semantic enhancement module for intelligent semantic expansion and business rule addition. Semantic expansion further enhances the table's descriptive information based on the dynamic structure of the DFL table. Enhancement methods include table description content and field semantic expansion. For example, the field name `cust_status` and its comment "Customer Status" are expanded to "Customer Status, enumerated values include: 'A' - Active, 'I' - Inactive, 'S' - Dormant" by combining the data dictionary or preset rules. This provides a richer description for the conversion from natural language to SQL. Constraint description refers to identifying and displaying business constraints. For example, adding the description "The value range should be greater than 0" to the "Order Amount (order_amount)" field; adding the business rule "Usually only query valid records where is_deleted=0" to the "Logical Deletion Flag (is_deleted)" field, setting the conditions and requirements for each field. The system provides multi-dimensional explanations of fields; clearly describes the relationships between tables, such as "the order table is associated with the customer table through 'customer ID'", and injects common analysis dimensions, such as "the time field 'create_time' is often used for statistical analysis by day or month". It also sets up the connections and mappings between different tables. If there are dictionary constraints, each dictionary value can be expanded using AI or manually. Table-level relationships and business logic hints are provided: clearly describing the relationships between tables, injecting common analysis dimensions, and setting up the connections and mappings between different tables. The corresponding extended information is saved to a DLF format file, and a "voucher-semantic model expansion.OFD" file is generated synchronously. This file records the field semantic expansion results, dictionary explanations, constraints, table relationships, and common analysis dimensions, forming a structured semantic model snapshot to ensure that the semantic information upon which the AI-generated SQL depends is solidified and traceable.
[0023] The pre-built analysis dimension metadata module centrally manages the business semantics and calculation logic of statistical dimensions in all pre-built SQL query templates, and provides real-time explanations when users query, realizing automatic mapping between technical code and business understanding; synchronously generates "credential-analysis dimension and business rule.OFD" to record the mapping relationship between technical fields and business terms, calculation logic and real-time explanation information, realizing a trusted credential mapping between business semantics and technical code.
[0024] The interactive SQL generation module generates corresponding SQL query statements based on its understanding of user intent and data structure. Users submit data queries in natural language, such as "Query the workload for December 2026." The device combines the user query with the enhanced data semantic model generated in step 3 to construct a high-quality prompt, which is then sent to the integrated Large Language Model (LLM). The LLM generates the corresponding SQL query statement based on its understanding of user intent and data structure. This process can be designed to be interactive, meaning the device can request the LLM to explain its generation logic, or the user can request fine-tuning of the SQL, such as changing the sorting or adding filtering conditions, forming a "human-machine collaborative" SQL construction mode. Simultaneously, a "Document-SQL Generation Process.OFD" is generated, recording the relationships between the original natural language query, the statement after intent analysis, the prompt input to the LLM, the SQL generated by the LLM, the user's modification records, and the intermediate OFD document.
[0025] The SQL description generation module generates a natural language description based on the generated SQL. The device automatically or by calling an LLM (Local Language Manager) generates a human-readable natural language description for the generated SQL, such as: "This query will return the results from tables A and B, filtered by condition X, and grouped and summarized by Y." This allows users to quickly understand the intent of the SQL to be executed. Simultaneously, a "credential-SQL natural language explanation.OFD" is generated, recording the human-readable description corresponding to the SQL and its generation method, achieving reliable retention of the AI reasoning process.
[0026] The syntax pre-validation module performs security verification and interpretation of SQL statements. The device has a built-in or invoked lightweight SQL parser to perform rigorous syntax checks on the SQL. More importantly, it performs security checks, such as detecting whether the SQL contains dangerous write operations like DROP, DELETE, and UPDATE, or whether it involves unauthorized table access. Any syntax errors or security violations will be intercepted at this step, with clear error messages provided, ensuring that only safe and syntactically correct queries can proceed to execution. Simultaneously, a "credential-SQL security and syntax verification.OFD" is generated, recording the syntax check results, dangerous operation checks (DROP / DELETE / UPDATE), unauthorized access verification results, verification rule versions, and error messages. This credential serves as crucial proof of security and trustworthiness within the DLF credential set.
[0027] The data execution module executes validated SQL statements within the data configuration module and generates result sets. Validated SQL statements are executed via the read-only data connection configured in step 1 (e.g., a read-only slave database). The device monitors the execution status of queries and circuit breakers for queries that time out or consume excessive resources. Upon successful execution, the query result set is retrieved in a secure, structured format such as JSON or Parquet. Simultaneously, key execution metadata, such as execution time, number of rows affected, and data snapshot time, is recorded. A "credential - data execution and result set.OFD" is generated, recording the executed SQL, execution time, number of rows affected, result set hash value, data snapshot time, and execution metadata. A result set summary is saved to the OFD attachment layer as a trustworthy and tamper-proof credential for the data results.
[0028] Therefore, each of the above modules generates a corresponding OFD electronic certificate simultaneously when performing its function, thus solidifying the module's input, output, metadata, snapshot, and operational behavior information. The DLF electronic certificate set is a DLF trusted electronic certificate set, which includes report metadata OFD certificates, data source information OFD certificates, semantic model snapshot OFD certificates, SQL generation and verification record OFD certificates, execution context OFD certificates, data signature certificates, and result data digest certificates. Furthermore, the DLF trusted electronic certificate set is digitally signed as a whole, generating a DLF dynamic format file, in which the DLF file itself and each OFD certificate within it can be independently verified.
[0029] In this invention, data source information refers to the database connection alias used, which is used to anonymize the database and specify table names; semantic model snapshot refers to the table structure, field comments, and extended information used when generating SQL; SQL generation and verification record refers to the final executed SQL statement, its natural language description, and syntax verification results; execution context refers to the query execution time, execution time, and the number of rows and columns in the data result set; data signature refers to calculating a cryptographic hash value (such as SHA-256) on the query result set, serving as a unique digital fingerprint of the data at the time of generation. Any tampering with the result data will invalidate this fingerprint. Results data summary refers to the option to include a preview of the first N rows of results data or a key statistical summary such as sum or average.
[0030] Finally, an interactive hierarchical verification chain is constructed, and click-based verification is implemented. In the verification module, the hierarchical verification chain uses the DLF electronic voucher set as the verification file carrier and sets key elements in the report as clickable links or buttons. This allows for a mind map-based drilling down of the dynamic logical structure of the DLF, tracing the source of the data report and the reasoning process. Key elements include tables, SQL statements, and data verification. In click-based verification, for the DLF report file, active verification is performed across various dimensions by clicking links in the report, including: clicking "Table Structure": viewing a snapshot of the table definitions used when generating the report; clicking "SQL Statement": copying it to the database client for manual verification; clicking the "Verify" button next to "Data Signature": under the same conditions, the device reconnects to the database; the SQL is run again, the hash value of the new result is calculated, and compared with the historical data fingerprint embedded in the report; clicking "Result Preview": expanding to view the data sample captured during report generation. Simultaneously, it supports overall verification of the voucher set and independent verification of individual OFD vouchers, achieving end-to-end trusted traceability from the data source to the query result.
[0031] This invention achieves integrity verification and tamper-proofing of data conclusions through DLF report structure generation and digital signature. It also supports overall verification of the credential set and independent verification of individual OFD credentials, enabling trusted traceability of the entire process from data source to query results. The OFD credentials generated by modules such as data configuration, table structure parsing, semantic enhancement, SQL generation, syntax verification, and data execution in the AI data query device, along with the inference credentials for data querying, are aligned and causally bound through the DLF credential set according to the sequence of multiple interactions, logical dependencies, and operational behavior chains. This forms a traceable and reproducible AI data query chain, ensuring that each technical step from "natural language querying" to "trusted SQL generation" to "verifiable result return" is solidified into a set of tamper-proof credential units. This transforms the output of AI data queries from an untraceable "black box result" into a reliable output that is verifiable, verifiable, and auditable. It constructs a reliable traceability chain throughout the entire lifecycle from the data source to the query result, thereby converting the database table pages at the time of the query into OFD format files. This freezes the data source at that moment, thus solidifying the actual database scenario at that time. The OFD file, along with the operable actions and dynamic content of the database, is packaged into a DLF dynamic format file to solidify the scenario at that time, improving the credibility and auditability of the report.
[0032] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments are to be regarded in all respects as exemplary and not restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, it is intended that all variations falling within the meaning and scope of equivalents of the claims be included within the present invention.
Claims
1. A DLF-based AI trusted data query device for production systems, characterized in that: It includes a data configuration module, a data table parsing module, a semantic enhancement module, a pre-defined analysis dimension metadata module, an interactive SQL generation module, an SQL description generation module, a syntax pre-validation module, a data execution module, and a validation module. Each module generates a corresponding OFD electronic certificate while performing its function, thus solidifying the module's input, output, metadata, snapshot, and operation behavior information. The data configuration module is used for managing interface configuration, data source selection, and synchronously generating "credential-data source configuration.OFD", which records the data source type, connection parameters, read-only permission proof, connection pool status, configuration time, and operator. The data table parsing module is used to automatically scan the selected data table, obtain the data table's metadata, and synchronously generate "voucher-table structure snapshot.OFD", which records the table name, fields, types, comments, primary and foreign key relationships, business semantics, and relationship topology; The semantic enhancement module performs semantic expansion based on the aforementioned metadata, and synchronously generates "Voucher-Semantic Model Expansion.OFD", which records the semantic expansion results of fields, dictionary item explanations, constraints, inter-table relationships, and common analysis dimensions. The pre-set analysis dimension metadata module refers to the centralized management of the business semantics and calculation logic of statistical dimensions in all pre-set SQL query templates, and provides real-time explanations when users query, realizing automatic mapping between technical code and business understanding, and synchronously generating "voucher-analysis dimension and business rule.OFD", which records the mapping relationship between technical fields and business terms, calculation logic and real-time explanation information; The interactive SQL generation module is used to generate corresponding SQL query statements based on the understanding of user intent and data structure, and simultaneously generate "voucher-SQL generation process.OFD", which records the original natural language question, the statement after intent analysis, the prompt input to LLM, the SQL generated by LLM, and the user modification record; The SQL description generation module generates a natural language description based on the generated SQL, and simultaneously generates "Voucher-SQL Natural Language Explanation.OFD", which records the human-readable description of the SQL and its generation method. The syntax pre-validation module is used to perform security verification and interpretation on SQL statements, and synchronously generate "credential-SQL security and syntax verification.OFD" to record syntax check results, dangerous operation detection, unauthorized access verification results and verification rule versions. The data execution module is used to execute the verified SQL statements in the data configuration module and generate a result set. It also synchronously generates a "voucher-data execution and result set.OFD" file, recording the executed SQL, execution time, number of rows affected, result set hash value, and data snapshot time. The DLF electronic certificate set aggregates all the above OFD electronic certificates according to the order and logical relationship of the operation behavior chain to form a DLF trusted electronic certificate set, and performs overall digital signature on the certificate set to generate an interactively verifiable DLF dynamic version file. The verification module is based on the DLF electronic certificate set, constructs an interactive hierarchical verification link, and performs click verification.
2. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The data configuration module supports data types including MySQL, Oracle, PostgreSQL, host address, port, tablespace / database name, username and password, xml, json, moogdb, and excel; During the configuration process, the data is escaped and imported into the database by parsing the file format, and the configuration information and content are saved in the configuration data table. The system connects to the database periodically and maintains a data connection pool. If a connection error occurs, it will provide early warning, monitor and repair it. During the configuration process, "credential-data source configuration.OFD" is generated synchronously, which records the data source type, connection parameters, read-only permission proof, connection pool status, configuration time and operator, and uses this credential as the first component of the DLF credential set.
3. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The data table parsing module acquires physical structure, business semantics, and relational topology. The physical structure includes field data types, lengths, precision, and whether they are nullable. The business semantics are understood by reading table and field comments and constraints in the database, combined with query examples. The relational topology refers to automatically detecting and acquiring primary and foreign key relationships, constructing a preliminary inter-table relationship graph, and automatically saving the inter-table relationships, indexes, business rules, and associations to the table structure knowledge base. It supports automatic database connection, continuous monitoring of changes in field, description, and meaning content, dynamic updates, and retains version evolution records to ensure the real-time nature and traceability of the knowledge base. It synchronously generates a "credential-table structure snapshot.OFD," saving the table name, fields, types, comments, primary and foreign key relationships, business semantics, and relational topology to the OFD metadata layer and attachment layer, and supports version evolution records as a reliable credential for subsequent SQL generation.
4. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The semantic expansion further enhances the descriptive information of the tables based on the basic table structure. Enhancement methods include: table description content, field semantic expansion, and constraint description (identifying and displaying business constraints; for dictionary constraints, AI or manual expansion of each dictionary value); table-level relationship and business logic hints (clearly describing the association between tables, injecting common analysis dimensions, setting up connections and mappings between different tables, saving the corresponding expanded information to the configuration information table, and synchronously generating "credential-semantic model expansion.OFD" to record field semantic expansion results, dictionary explanations, constraints, table relationships, and common analysis dimensions, forming a structured semantic model snapshot to ensure that the semantic information upon which AI-generated SQL depends is solidified and traceable).
5. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The system centrally manages the business semantics and computational logic information of statistical dimensions in table query settings. It integrates and organizes the basic information and enhanced logic information of stored data tables, and infers the logical prompts for the current table by combining SQL syntax and business scenarios. It also supports online testing and some interactive online adjustments and verifications. For different business semantics, it pre-sets different templates and different types of metadata content, saves the process and data to subsequent OFD files and corresponding metadata, and provides real-time explanations when users query, realizing automatic mapping between natural language and business terminology. It synchronously generates "credential-analysis dimension and business rule.OFD", which records the mapping relationship between technical fields and business terms, computational logic and real-time explanation information, realizing a trusted credential mapping between business semantics and technical code.
6. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: In the interactive SQL generation module, data questions posed in natural language are processed by a pre-defined analysis structure, and prompts are constructed using the corresponding data semantic model before being sent to the integrated large language model. During the question-and-answer process, the system analyzes the entire process of converting natural language into SQL and converts it into an OFD (Object Documentation) document. This document includes: the original natural language statement, the statement after intent analysis, the text after business-related semantic interpretation, the SQL statement extracted by the model, the actually executed SQL statement, and the execution result. In this process, the execution steps, logs, and data information are converted into multiple OFD documents, and the relationships between different OFD documents are recorded. Simultaneously, a "Voucher-SQL Generation Process.OFD" is generated, recording the relationships between the original natural language question, the statement after intent analysis, the Prompt input to the LLM, the SQL generated by the LLM, user modification records, and intermediate OFD documents. The SQL description generation module simultaneously generates a "Voucher-SQL Natural Language Explanation.OFD," recording the human-readable description of the SQL and its generation method, achieving reliable retention of the AI reasoning process.
7. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The syntax pre-validation module performs syntax checks and security verifications on the SQL by either building in or calling the SQL parser. Verification includes checking for DROP, DELETE, UPDATE statements, and unauthorized table access. If errors are detected, a clear error message is provided. In the verification module, verification items are set for the SQL. The SQL execution statement obtained from the model is used to check each verification item individually. The results are written to the SQL rule description module of the OFD (Official Document Format) file as part of the OFD's metadata. Simultaneously, a "credential-SQL security and syntax verification.OFD" is generated, recording the syntax check results, dangerous operation detection, unauthorized access verification results, verification rule version, and error messages. This credential serves as a crucial proof of security and trustworthiness within the DLF credential set.
8. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The data execution module executes verified SQL statements in a read-only data connection and monitors the execution status in real time. It performs circuit breaking for queries that time out or consume excessive resources. After successful execution, the result set is output in JSON and Parquet formats. Simultaneously, the data execution module records key execution metadata, including execution time, number of rows affected, and data snapshot time. The execution results are saved as OFD files, containing data logic relationships and operation processes. Finally, the OFD files generated at each stage are integrated into a single DLF dynamic format file, synchronously generating "credential-data execution and result set.OFD", recording the executed SQL, execution time, number of rows affected, result set hash value, data snapshot time, and execution metadata. A result set summary is saved to the OFD attachment layer as a trustworthy, tamper-proof credential of the data results.
9. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The DLF electronic certificate set is a trusted DLF electronic certificate set, which includes report metadata OFD certificate, data source information OFD certificate, semantic model snapshot OFD certificate, SQL generation and verification record OFD certificate, execution context OFD certificate, data signature certificate, and result data digest certificate. The trusted DLF electronic certificate set is digitally signed as a whole to generate a dynamic DLF format file, wherein the DLF file itself and each OFD certificate within it can be independently verified.
10. The AI trusted data query device for production systems based on DLF according to claim 1, characterized in that: The hierarchical verification link in the verification module refers to using the DLF electronic voucher set as the verification file carrier and setting the key elements in the report as clickable links or buttons. It can drill down layer by layer according to the dynamic logical structure of the DLF, trace the source of the data report and the reasoning process, where the key elements include tables, SQL statements and data verification. In the click verification process, for DLF report files, active verification can be performed across various dimensions by clicking links within the report, including: clicking "Table Structure" to view a snapshot of the table definitions used when generating the report; clicking "SQL Statement" to copy it to the database client for manual verification; clicking the "Verify" button next to "Data Signature" to reconnect the device to the database under the same conditions; running the SQL again to calculate the hash value of the new result and comparing it with the historical data fingerprint embedded in the report; and clicking "Result Preview" to expand and view the data sample captured during report generation. Simultaneously, it supports overall signature verification of the entire credential set and independent signature verification of a single OFD credential, achieving end-to-end trusted traceability from the data source to the query results.