Structured and unstructured data intelligent collaborative question and answer method and system
Patent Information
- Application Number
- CN202611175494.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-27
AI Technical Summary
例如,当SQL查询结果行数极少或数值出现异常波动时,现有系统无法自动触发非结构化检索来补充业务背景或原因分析;当文档中提及“参照下表”等数据指引时,现有系统也无法自动解析并执行对应的结构化查询
1.本发明通过构建统一的数据接入层,同时接入企业数据中台中的结构化分层数据模型和非结构化知识文档,为结构化数据查询与非结构化知识检索提供了统一的数据底座。在此基础上,本发明建立了意图识别驱动的多通道查询调度机制,通过意图识别模型输出问题分类标签及对应的分类置信度,并根据置信度的高低自适应地执行单一通道查询或强制混合通道查询—高置信度时调用与分类标签对应的单一通道以保证响应效率,低置信度时强制同时调用结构化查询通道和非结构化检索通道以保证召回率。该机制克服了现有技术中因意图识别错误导致检索完全失败的技术缺陷,使问答系统在面对表述模糊或领域交叉的用户问题时仍能通过混合通道兜底提供有效答案,显著提高了系统的容错性和鲁棒性。同时,本发明在结构化查询通道中引入基于数据资产目录的语义增强SQL生成机制,使大模型在生成SQL时能够充分利用字段业务含义、指标口径和表关系信息,减少了自然语言转SQL过程中的字段误匹配问题;并通过语法校验、元数据校验、权限校验、安全校验和性能校验五级校验机制,确保生成的SQL在语法正确性、对象存在性、权限合规性、操作安全性和执行性能方面均满足企业级数据查询的要求;
Smart Images

Figure CN122986143A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing, data platform, and artificial intelligence question answering technology, specifically to a method and system for intelligent collaborative question answering of structured and unstructured data. Background Technology
[0002] Enterprises typically possess two types of data assets during their production and operation: one is structured data stored in business systems such as ERP, MES, PHM, financial systems, procurement systems, and inventory systems; the other is unstructured knowledge documents such as product manuals, process specifications, policy documents, meeting minutes, equipment manuals, and quality inspection reports.
[0003] Traditional data querying primarily relies on business personnel submitting requests to the information center, followed by technical staff writing SQL, exporting reports, or developing BI dashboards. This approach suffers from long response times, high barriers to entry for business personnel, and low data consumption efficiency. Furthermore, many existing enterprise documents are stored as static files, which, while rich in content, are difficult for business personnel to quickly retrieve and utilize using natural language.
[0004] Existing intelligent question-answering systems typically only target document knowledge bases, capable of answering questions about policies, processes, and manuals, but unable to directly query real-time operational data. Traditional BI systems, while capable of displaying structured indicators, cannot understand natural language questions or interpret them in conjunction with document knowledge. Most solutions on the market treat structured and unstructured data separately, lacking a unified collaborative question-answering mechanism. Regarding heterogeneous data fusion, while existing solutions attempt to establish bidirectional connections between documents and business objects by enhancing unstructured documents with structured tags, the disconnect between structured queries and document retrieval, and the inability to conduct joint analysis, remains a prominent issue.
[0005] While recent NL2SQL and RAG integration solutions encompass both structured and unstructured search capabilities, their interaction is typically unidirectional: documents retrieved from the knowledge base serve as context for SQL generation. This lacks bidirectional information exchange and cross-validation between structured and unstructured search results. For example, when the number of rows in the SQL query is extremely small or the values fluctuate abnormally, existing systems cannot automatically trigger unstructured searches to supplement business background or cause analysis. Similarly, when documents mention data guidance such as "refer to the table below," existing systems cannot automatically parse and execute the corresponding structured query.
[0006] Therefore, enterprises need an intelligent question-answering method that can simultaneously access structured data and unstructured knowledge, complete data queries and knowledge Q&A through unified natural language interaction, and possess cross-channel collaborative interaction and self-optimization capabilities. Summary of the Invention
[0007] To address the problems of existing technologies, this invention provides a method and system for intelligent collaborative question answering using both structured and unstructured data.
[0008] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: Firstly, a method for intelligent collaborative question answering of structured and unstructured data, comprising: The data access steps involve accessing both structured and unstructured data sources. The structured data sources include a hierarchical data model within the enterprise data platform, comprising at least an operational data storage layer, a detailed data layer, a summary data layer, and an application data layer. The unstructured data sources include enterprise knowledge documents, which are parsed, segmented, vectorized, and then written into a vector database. The intent recognition step involves receiving a natural language question input by the user, performing intent recognition on the natural language question, and outputting a question classification label and a corresponding classification confidence score. The question classification label includes structured data query, unstructured knowledge question answering, or a hybrid category. The classification confidence score is used to characterize the reliability of the intent recognition result. The query scheduling step involves executing query scheduling based on the problem classification label and the classification confidence level. When the classification confidence level is higher than the first confidence level threshold, a single query channel corresponding to the problem classification label is invoked. The single query channel is either a structured query channel or an unstructured retrieval channel. When the classification confidence level is lower than or equal to the first confidence level threshold, the structured query channel and the unstructured retrieval channel are invoked simultaneously. The structured query channel converts the natural language question into a structured query statement based on the data asset catalog and queries data from the aggregated data layer or the application data layer; the unstructured retrieval channel vectorizes the natural language question and performs similarity retrieval in the vector database to recall relevant document fragments. The cross-channel interaction step obtains the first result features of the query results returned by the structured query channel and the document features of the document fragments recalled by the unstructured retrieval channel; When the first result feature meets the first preset condition, the unstructured retrieval channel is invoked to supplement the retrieval of business scope description documents or change log documents related to the current query topic, and the supplemented document fragments and the query results are used together as the basis for answer generation; When a preset data guidance keyword is detected in the document features, the structured query channel is invoked to perform a query operation corresponding to the data guidance keyword, and the numerical result obtained from the query and the document fragment are used together as the basis for generating the answer; The answer generation step involves inputting the query results and / or document fragments obtained from the query scheduling step and the cross-channel interaction step as a limited context into the large language model. The large language model then generates an answer based on the limited context and displays the citation source in the answer. The citation source includes at least one of the following: data table source, field source, document name, document page number, and chapter information. The access control steps control the range of data that can be queried by the structured query channel and the range of documents that can be retrieved by the unstructured retrieval channel based on the user's role permissions and field-level permissions. In the strategy optimization step, after obtaining the answer output by the answer generation step, the user's feedback behavior on the answer is received, positive or negative samples are generated based on the feedback behavior and added to the sample dataset, and the classification model in the intent recognition step is updated using the sample dataset.
[0009] In one specific implementation of the first aspect, the first result feature includes at least one of the following: the number of rows in the query result, the null value rate of the query result, and the fluctuation range of the numerical indicator; The first preset condition includes at least one of the following: When the number of rows in the query results is less than a preset row count threshold, it is determined that the current query results are insufficient in terms of information. The unstructured retrieval channel is then invoked to retrieve business background knowledge related to the query topic, and an answer containing supplementary explanations of the business background is generated. When the fluctuation range of the numerical indicator exceeds the preset fluctuation range, it is determined that the current value has an abnormal change. The unstructured retrieval channel is called to retrieve the business change log, meeting minutes or caliber adjustment document corresponding to the numerical indicator, and an answer containing an analysis of the reasons for the change is generated.
[0010] In one specific implementation of the first aspect, in the intent recognition step, the hybrid problem is a problem that simultaneously includes structured data query requirements and unstructured knowledge query requirements; When the natural language question is classified as a mixed-type question, the query scheduling step simultaneously invokes the structured query channel and the unstructured retrieval channel, and organizes the indicator data in the query results returned by the structured query channel, the document fragments recalled by the unstructured retrieval channel, and the natural language question into a comprehensive context, which is then used by the large language model to generate a comprehensive answer.
[0011] In one specific implementation of the first aspect, the invocation process of the structured query channel includes: Based on the business entities, indicators, time ranges, organizational ranges, and filtering conditions parsed from the natural language problem, candidate data tables and candidate fields are recalled in the data asset catalog. The data asset catalog includes the business meaning of each field, indicator definition, primary and foreign key relationships, data source, update frequency, data quality score, and responsible person information; The natural language question, the candidate data table, the candidate fields, the business meaning of the fields, the table relationships, the statistical definitions, and the permission range are combined to form prompt words, which are then input into the large language model to generate the structured query statement.
[0012] In one specific implementation of the first aspect, after the structured query statement is generated, it undergoes multi-level validation before execution, the multi-level validation including: Syntax validation checks whether the structured query statement conforms to the database syntax. Metadata validation checks whether the table names and field names referenced in the structured query statement exist in the data asset catalog. Permission verification checks whether the current user has permission to access the tables and fields referenced in the structured query statement; Security checks are implemented to block data deletion, data update, and data clearing operations. Performance verification checks whether the structured query statement contains full table scans, Cartesian products, or unnecessary joins; The structured query statement is executed and the query results are returned only after all the multi-level validations have passed.
[0013] In one specific implementation of the first aspect, the invocation process of the unstructured retrieval channel includes: The knowledge document is parsed to extract the title, body text, tables, chapter structure, page numbers, file source, update time, and business domain information. The knowledge document is segmented into blocks based on paragraph boundaries, heading levels, semantic integrity, and a preset token quantity threshold to generate text blocks. Each text block is bound to source metadata, which includes document name, document type, department, business domain, page number, chapter, update time, and permission scope. The text block is vectorized using an embedding model, and the vector of the text block and the source metadata are written into the vector database. The natural language problem is vectorized using the same embedding model, and similarity retrieval is performed in the vector database. Combined with keyword matching, business domain filtering, document type filtering, time filtering and user permission filtering, a hybrid retrieval is performed to recall relevant text blocks. The recalled relevant text blocks are reordered, and the reordering is based on at least one of the following: vector similarity, keyword matching degree, document authority, document update time, user permissions, and business domain relevance. The context of the large language model is constructed by selecting the top-ranked text blocks after reordering.
[0014] In one specific implementation of the first aspect, in the answer generation step, when the similarity between the recalled text block and the natural language question is lower than a preset similarity threshold, an insufficient evidence prompt or a refusal prompt is output, rather than forcibly generating an answer; In the answer generation step, the answer also includes at least one of the following: The structured query statement; The structured query results are displayed in tables or charts; The cited source excerpt; Data update time; Results export entry.
[0015] In one specific implementation of the first aspect, the strategy optimization step includes: When the feedback behavior is an unsatisfactory evaluation or a user follow-up question, the current natural language question, the question classification label and classification confidence score output by the intent recognition step, the channel type invoked by the query scheduling step, and the answer output by the answer generation step are recorded as negative samples. When the feedback behavior is a satisfaction evaluation or an export operation, the current natural language question, the question classification label and classification confidence level output by the intent recognition step, the channel type called by the query scheduling step, and the answer output by the answer generation step are recorded as positive samples. The classification model in the intent recognition step is fine-tuned periodically using the sample dataset, and the first confidence threshold is updated.
[0016] Secondly, a structured and unstructured data intelligent collaborative question-answering system includes: The data access module is used to access structured data sources and unstructured data sources. The structured data sources include the hierarchical data model in the enterprise data platform, and the unstructured data sources include enterprise knowledge documents that have been parsed, segmented, and vectorized before being written into a vector database. The intent recognition module is used to receive natural language questions input by users, perform intent recognition on the natural language questions, and output question classification labels and corresponding classification confidence scores. The question classification labels include structured data query type, unstructured knowledge question answer type, or hybrid type. The query scheduling module is used to invoke the structured query channel and / or the unstructured retrieval channel based on the question classification label and the classification confidence level; The structured query channel is used to convert the natural language question into a structured query statement according to the data asset catalog, and to query data from the aggregated data layer or the application data layer. The unstructured retrieval channel is used to vectorize the natural language question and then perform similarity retrieval in the vector database to recall relevant document fragments; The cross-channel interaction module is used to obtain the first result feature of the query result returned by the structured query channel and the document feature of the document fragment recalled by the unstructured retrieval channel; when the first result feature meets the first preset condition, the unstructured retrieval channel is invoked to supplement the retrieval; when a preset data guidance keyword is detected in the document feature, the structured query channel is invoked to execute the corresponding query operation. The answer generation module is used to input the query results and / or document fragments obtained by the query scheduling module and the cross-channel interaction module as a limited context into the large language model, and the large language model generates an answer based on the limited context, and displays the source of the citation in the answer; The access control module is used to control the scope of data query and document retrieval based on user role permissions and field-level permissions; The strategy optimization module is used to receive user feedback on the answer after obtaining the answer output by the answer generation module, generate positive or negative samples based on the feedback and add them to the sample dataset, and update the classification model in the intent recognition module using the sample dataset.
[0017] Thirdly, a structured and unstructured data intelligent collaborative question-answering device includes: One or more processors; Storage device for storing one or more programs, as well as a data asset catalog and vector database; When the one or more programs are executed by the one or more processors, the one or more processors implement an intelligent collaborative question-answering method for structured and unstructured data.
[0018] The beneficial effects of this invention are as follows: 1. This invention constructs a unified data access layer, simultaneously integrating structured hierarchical data models and unstructured knowledge documents from the enterprise data platform, providing a unified data foundation for structured data querying and unstructured knowledge retrieval. Based on this, the invention establishes an intent-recognition-driven multi-channel query scheduling mechanism. The intent recognition model outputs question classification labels and corresponding classification confidence levels, and adaptively executes single-channel queries or forces mixed-channel queries based on the confidence level—high confidence levels trigger the single channel corresponding to the classification label to ensure response efficiency, while low confidence levels force simultaneous invocation of both structured query channels and unstructured retrieval channels to ensure recall. This mechanism overcomes the technical deficiency in existing technologies where retrieval fails completely due to intent recognition errors, enabling the question-answering system to provide effective answers even when faced with ambiguous or cross-domain user questions, significantly improving the system's fault tolerance and robustness. Meanwhile, this invention introduces a semantically enhanced SQL generation mechanism based on the data asset catalog into the structured query channel, enabling large models to fully utilize field business meanings, indicator definitions, and table relationship information when generating SQL, reducing field mismatch issues in the natural language to SQL conversion process; and through a five-level verification mechanism of syntax verification, metadata verification, permission verification, security verification, and performance verification, it ensures that the generated SQL meets the requirements of enterprise-level data query in terms of syntax correctness, object existence, permission compliance, operational security, and execution performance. 2. This invention establishes a bidirectional interaction mechanism between the structured query channel and the unstructured retrieval channel, overcoming the limitations of existing solutions where the two types of retrieval are "executed separately and simply concatenated" or only have a one-way enhancement relationship. Specifically, this invention obtains the numerical characteristics of the structured query results—such as the number of rows in the query results and the fluctuation range of numerical indicators—and automatically triggers the unstructured retrieval channel to supplement business background knowledge when the number of rows in the query results is lower than a threshold. When the numerical fluctuation exceeds the threshold, it automatically triggers the unstructured retrieval channel to retrieve business change logs or meeting minutes to generate cause analysis. Simultaneously, this invention obtains the semantic characteristics of the document fragments recalled in the unstructured retrieval results. When a preset keyword pointing to structured data is detected in the document, it automatically triggers the structured query channel to execute the corresponding numerical query. This bidirectional interaction imbues the "cold values" of structured data with business meaning through the "hot context" of unstructured knowledge, and dynamically activates the statically referenced data in unstructured documents through the real-time results of structured queries, thereby improving the completeness, timeliness, and interpretability of the question-and-answer answers. Furthermore, this invention also automatically identifies and alerts to numerical conflicts between structured data and unstructured documents by detecting consistency across channel results, thereby driving a closed loop in data governance. 3. This invention incorporates continuous optimization of the intent recognition model into the system architecture. By collecting user feedback behavior—satisfaction ratings, export operations, dissatisfaction ratings, and follow-up questions—positive and negative training samples are automatically generated. The accumulated sample dataset is then used periodically to incrementally fine-tune the intent recognition classification model, simultaneously updating the classification confidence threshold. This optimization mechanism allows the intent recognition model to continuously adapt to the enterprise's language habits, query patterns, and domain terminology distribution during actual use. The intent recognition accuracy steadily improves with the extension of system runtime, thereby driving simultaneous improvements in query scheduling accuracy, the timing of cross-channel interactions, and the quality of answer generation. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the cross-channel bidirectional interaction mechanism of the present invention.
[0020] Figure 2 This is a schematic diagram of the intent recognition and confidence-driven query scheduling process of the present invention.
[0021] Figure 3 This is a schematic diagram of the user feedback-driven strategy optimization process of the present invention. Detailed Implementation
[0022] 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.
[0023] like Figures 1 to 3 This paper presents an intelligent collaborative question-answering method and system for structured and unstructured data.
[0024] (I) System Architecture The system of this invention adopts a layered architecture design, which consists of, from bottom to top, a data access layer, a knowledge processing layer, an intent understanding layer, a query scheduling layer, a cross-channel interaction layer, an answer generation layer, and a strategy optimization layer.
[0025] The data access layer is responsible for accessing both structured and unstructured data sources. Structured data sources include the layered data model in the enterprise data platform, comprising at least the Operational Data Store (ODS), Detailed Data Layer (DWD), Summary Data Layer (DWS), and Application Data Layer (ADS). Unstructured data sources include enterprise knowledge documents such as product manuals, process specifications, policy documents, meeting minutes, equipment manuals, quality documents, and training materials.
[0026] The knowledge processing layer is responsible for parsing, segmenting, vectorizing, and writing unstructured documents into a vector database. The intent understanding layer receives natural language questions input by the user, performs intent recognition, and outputs question classification labels and classification confidence scores. The query scheduling layer invokes structured query channels and / or unstructured retrieval channels based on the classification labels and confidence scores. The cross-channel interaction layer enables bidirectional information exchange between the two channels. The answer generation layer uses the query and retrieval results as contextual input to the large language model to generate answers. The strategy optimization layer continuously optimizes the intent recognition model based on user feedback.
[0027] In terms of physical deployment, the system can be deployed in an enterprise intranet environment. The structured data source is connected to the system through JDBC, API or data pipeline. The vector database can be a database that supports vector retrieval, such as Milvus, Pinecone or Elasticsearch. The large language model can be a domestic large model such as Qwen or ChatGLM or a commercial large model service can be called through API.
[0028] (ii) Data access The system accesses structured data from the enterprise's data platform and existing unstructured documents.
[0029] 1. Structured data access Structured data includes data from business systems such as ERP, MES, PHM, finance, procurement, and inventory. After data governance, it is stored in layered models such as ODS, DWD, DWS, and ADS in the data platform. The system accesses the above-mentioned layered data models through JDBC connections or API interfaces provided by the data platform.
[0030] During the integration process, the system synchronously acquires data asset catalog information. The data asset catalog includes information such as table name, field name, field type, field business meaning, field value examples, primary and foreign key relationships, data source, update frequency, data quality score, data owner, and commonly used indicator definitions for each table. This information is organized into a data asset semantic index to assist in matching natural language questions with database objects.
[0031] 2. Unstructured document access Unstructured documents include PDF, Word, Excel, TXT, meeting minutes, policy documents, equipment manuals, process documents, etc. The system parses documents of different formats and extracts information such as titles, body text, tables, chapter structure, page numbers, document source, update time, and business domain.
[0032] Input: Enterprise knowledge document files (PDF, Word, Excel, TXT, etc.) and the document's metadata (document name, document type, department, business domain, update time, permission scope, etc.).
[0033] Processing flow: Use document parsing tools (such as PyPDF2, python-docx, pandas, etc.) to extract the text content and structural information of the document; Identify the chapter heading levels of a document and construct a hierarchical structure tree for the document; Extract the table content from the document, preserving the correspondence between table headers and cells.
[0034] Output: Parsed document structure information, including main text, table data, chapter structure, metadata, etc.
[0035] (III) Intelligent document segmentation and vectorization For unstructured documents, the system needs to perform intelligent segmentation and vectorization to facilitate subsequent similarity retrieval.
[0036] 1. Intelligent segmentation of long documents The system segments the document into blocks based on paragraph boundaries, heading levels, semantic integrity, and a preset token quantity threshold.
[0037] The preferred range for the preset token quantity threshold is 400-600 tokens. When a single text block exceeds this threshold, the system splits it according to the heading level or paragraph boundaries; when a single text block is below this threshold but is closely related to the context semantics, the system merges it with adjacent paragraphs.
[0038] Follow these principles when cutting: A single text block shall not exceed a preset token quantity threshold (preferably 500 tokens); Try to maintain the semantic integrity of paragraphs and avoid cutting them in the middle of sentences; Retain metadata such as chapter titles, document names, page numbers, and paragraph numbers; Perform a structured transformation on the table content, preserving the relationship between the table header and cells; Merge paragraphs that span multiple pages to avoid semantic breaks.
[0039] Each text block is bound to source metadata for subsequent citation tracing. Source metadata includes: document name, document type, department, business domain, page number, chapter, update time, and permission scope.
[0040] 2. Text Vectorization and Knowledge Base Construction The system uses a unified embedding model to vectorize text blocks. Embedding models such as BGE and M3E, which offer good performance in Chinese semantic retrieval, can be employed. The vector and metadata of each text block are written to a vector database.
[0041] Input: A list of text blocks generated after dicing, each text block containing text content and source metadata.
[0042] Processing flow: Call the API interface of the embedded model to convert the text block content into a fixed-dimensional vector representation (such as 768-dimensional or 1024-dimensional). The text block vector, text content, and source metadata are assembled into a single vector database record. Batch writes to the vector database and creates vector indexes to support efficient similarity retrieval.
[0043] Output: A collection of document records in a vector database, where each record contains a vector, text content, and metadata.
[0044] (iv) Intent recognition and confidence output After the user enters a question in natural language, the system first performs intent recognition on the question.
[0045] 1. Problem Classification The system categorizes natural language problems into the following types: Structured data query problems mainly involve querying, statistically analyzing, and sorting indicator data in a database, such as "What was the output of the main engine plant last month?" Unstructured knowledge-based question-and-answer questions: These mainly involve retrieving and answering questions about document knowledge, such as "What are the requirements for lubrication inspection in the equipment inspection system?" Hybrid questions: These questions include both structured data query requirements and unstructured knowledge query requirements, such as "What were the reasons for the increase in equipment failure rate last month? Explain in conjunction with the equipment maintenance policy."
[0046] 2. Classification confidence output The intent recognition model outputs both a question classification label and a corresponding classification confidence score. The classification confidence score characterizes the reliability of the intent recognition results.
[0047] Input: Natural language question text entered by the user.
[0048] Processing flow: Use pre-trained classification models (such as BERT-based fine-tuned classifiers or small-shot classifiers based on large models) to reason about the problem; The model outputs the probability distribution of each category label; The category label with the highest probability is taken as the problem category label, and the corresponding probability value is taken as the classification confidence level.
[0049] The preferred range for the first confidence threshold is 60% to 90%. When the classification confidence is higher than this threshold, it indicates that the intent recognition result is relatively reliable; when the classification confidence is lower than or equal to this threshold, it indicates that the intent recognition result has a large degree of uncertainty.
[0050] Output: Question category label (structured data query, unstructured knowledge question and answer, or mixed category) and corresponding category confidence (probability value between 0 and 1).
[0051] (v) Confidence-driven query scheduling The system performs query scheduling based on the problem category label and category confidence level.
[0052] 1. High-confidence scenarios—single-channel queries When the classification confidence score is higher than the first confidence threshold (preferably 70%), the system invokes the single query channel corresponding to the problem classification label: If the category is structured data query, the structured query channel will be invoked; If the category is unstructured knowledge question and answer, the unstructured retrieval channel will be invoked; If the category is mixed, both channels will be invoked simultaneously.
[0053] 2. Low-confidence scenarios—mixed-channel queries When the classification confidence is lower than or equal to the first confidence threshold (preferably 70%), the system does not execute a single-channel query, but instead forces the simultaneous invocation of the structured query channel and the unstructured retrieval channel, using both types of results as the basis for answer generation.
[0054] Technical effect: Ensures response efficiency in high-confidence scenarios and avoids completely irrelevant answers due to classification errors in low-confidence scenarios.
[0055] Input: Problem category label, category confidence level, original user question.
[0056] Processing flow: Determine whether the classification confidence score is higher than the first confidence threshold; If so, call the corresponding single channel based on the category label; If not, both the structured query channel and the unstructured retrieval channel will be invoked.
[0057] Output: Structured query results and / or unstructured search results.
[0058] (vi) Structured query channel The structured query channel is responsible for converting natural language questions into structured query statements (SQL) and querying data from the DWS layer or ADS layer of the data platform.
[0059] 1. Natural Language Processing The system parses the following elements in the natural language problem: Business entities: such as "products", "orders", "equipment", etc.; Indicators such as "output", "sales revenue", and "failure rate"; Time range: such as "last month", "this quarter", "the last three months", etc.; Organizational scope: such as "Main engine plant", "Supplier A", etc.; Filtering criteria: such as "Status is completed" or "Amount is greater than 10,000". Sorting requirements: such as "in descending order of amount" or "top 10"; Output formats include "text answers", "tables", and "charts".
[0060] 2. Candidate Tables and Field Recall Based on the parsing results, the system recalls candidate data tables and candidate fields from the data asset catalog. The recall criteria include: Business domain matching: Prioritize recalling tables and fields related to the problematic business domain; Field name matching: Field names match keywords in the question; Field business meaning matching: Matching the description of the business meaning of a field with the semantic meaning of the problem; Indicator definition matching: The indicator definition corresponding to the field matches the indicator in the question; Table relationship matching: Connecting related tables through primary and foreign key relationships; Historical query similarity matching: Performs similarity matching with tables and fields used in historical queries.
[0061] For example, candidate fields related to "output" may include "completed quantity", "reported quantity", "inbound quantity", etc. The system will further determine which field to use based on the business criteria.
[0062] 3. SQL generation The system uses prompts such as user questions, candidate table fields, field descriptions, table relationships, statistical definitions, and permission ranges to generate SQL statements from the input model.
[0063] The following constraints must be followed when generating SQL: Prioritize querying data in the DWS or ADS layer, and do not directly access raw data in the unprocessed ODS layer; Do not query data that the user does not have permission to access; To avoid full table scans, add necessary WHERE conditions; Limit the number of rows returned (default 1000 rows); Explicitly filter by time range and organizational scope.
[0064] 4. SQL multi-level validation After the SQL is generated, the system performs multi-level validation before execution: (1) Syntax check: Use the database's syntax parser to check whether the SQL conforms to the database syntax.
[0065] (2) Metadata verification: Check whether the table name and field name referenced in the SQL exist in the data asset catalog.
[0066] (3) Permission verification: Check whether the current user has the right to access the tables and fields referenced in the SQL.
[0067] (4) Security verification: intercept dangerous operations such as DELETE, UPDATE, DROP.
[0068] (5) Performance verification: Check if the SQL has problems such as full table scan, large Cartesian product, or unreasonable JOIN. If there is a performance risk, the system will attempt to automatically optimize the SQL or prompt the user to adjust the query conditions.
[0069] The SQL will only be executed after all multi-level validations have passed.
[0070] 5. Results returned After the SQL is executed, the system returns the query results, including the result data, the number of rows affected, and the execution time.
[0071] Input: User's natural language questions, data asset catalog, user permission information.
[0072] Processing flow: Problem analysis, candidate table field retrieval, SQL generation, multi-level validation, SQL execution, and result return.
[0073] Output: Structured query results (data table), information on the data table and fields used, and data update time.
[0074] (vii) Unstructured retrieval channel The unstructured retrieval channel is responsible for vectorizing user questions and then performing similarity searches in the vector database to retrieve relevant document fragments.
[0075] 1. Problem Vectorization The system uses the same embedding model as document vectorization to convert users' natural language questions into vector representations.
[0076] 2. Hybrid Search The system performs similarity searches in the vector database, and also combines these searches with the following filtering conditions: Keyword matching: Extract keywords from the question and match them with the document content; Business domain filtering: Retrieves only documents related to the problem business domain; Document type filtering: Filter document types based on question type (e.g., search only for policy documents or only for technical manuals). Time filtering: Prioritizes the retrieval of most recently updated documents; User permission filtering: Only retrieve documents that the user has permission to access.
[0077] 3. Reordering The system reorders the initially recalled TopK text blocks. The reordering criteria include: Vector similarity: cosine similarity between the text block vector and the question vector; Keyword matching degree: The density of the problem keyword contained in a text block; Document authority: The authority rating of the document's source (e.g., official policy documents are rated higher than personal notes); Document update time: Newer documents receive higher weight; User permissions: Documents with higher user permissions receive higher weight; Business domain relevance: Documents that are more closely matched to the problem business domain receive higher weight.
[0078] Select the top-ranked text blocks after reordering (default Top 5) to construct the limited context of the large language model.
[0079] 4. Handling Insufficient Search Results When the similarity between the recalled text block and the user's question is lower than the preset similarity threshold (preferably 0.7~0.85), the system outputs a message indicating insufficient evidence or a refusal to answer, instead of forcibly generating an answer.
[0080] Input: User's natural language question, vector database, user permission information.
[0081] Processing flow: Question vectorization, hybrid retrieval, reordering, and context construction.
[0082] Output: A list of recalled document fragments (including similarity scores and source metadata), and a determination of whether the evidence is sufficient.
[0083] (viii) Cross-channel two-way interaction This invention establishes a bidirectional interaction mechanism between structured query channels and unstructured retrieval channels. The output results of the two channels serve as trigger conditions for each other, forming a closed loop of information flow.
[0084] 1. Structured query results trigger unstructured supplementary searches The system obtains the first result characteristics of the query results returned by the structured query channel, including at least one of the following: the number of rows in the query results, the null value rate of the query results, and the fluctuation range of numerical indicators.
[0085] When the first result feature meets the following first preset condition, the system automatically calls the unstructured retrieval channel for supplementary retrieval: (1) Insufficient number of result rows: When the number of result rows is less than the preset threshold (preferably 3-5 rows), the current query result is deemed to have insufficient information. The system calls the unstructured retrieval channel to retrieve business background knowledge, indicator definition documents, or business caliber descriptions related to the query topic. The retrieved document fragments are then input into the answer generation step along with the query results to generate an answer that includes supplementary explanations of the business background.
[0086] For example, if a user asks, "What was the number of special orders at the mainframe plant last month?", the SQL query will return 0 records (there were no special orders that month). The system will automatically search the definition document and business rules for "special orders" and generate an answer that might be: "The number of special orders at the mainframe plant last month was 0. According to the 'Special Order Management Measures,' special orders refer to orders with a value exceeding 1 million yuan or involving customized requirements. There are no matching order records this month." (2) Abnormal fluctuations in numerical indicators: When the fluctuation range of the numerical indicator in the query results exceeds the preset fluctuation range (preferably ±30%~±50%), it is determined that the current value has an abnormal change. The system calls the unstructured retrieval channel to retrieve the business change log, meeting minutes or caliber adjustment document corresponding to the numerical indicator, and inputs the retrieved document fragments and query results into the answer generation step to generate an answer containing an analysis of the reasons for the change.
[0087] For example, if a user asks "What is the year-on-year change in production this quarter?", the SQL query result will show a 45% year-on-year decrease in production. The system will automatically retrieve the production scheduling meeting minutes, equipment maintenance records, and raw material supply records for that quarter, and the generated answer might be: "The main reasons for the 45% year-on-year decrease in production this quarter are: ① A 15-day shutdown for major equipment maintenance in February (see the 'February 2026 Equipment Maintenance Plan'); ② Delayed delivery by raw material supplier A in March (see the minutes of the Purchasing Department's meeting on March 5th)." 2. Unstructured search results trigger structured queries The system acquires document features from document fragments retrieved through the unstructured search channel. When a preset data-guiding keyword is detected in the document features, the system automatically invokes the structured query channel to execute the query operation corresponding to the data-guiding keyword.
[0088] Preset data guidance keywords include, but are not limited to: "Refer to the table below", "See data for details", "See specific values", "Related statistics", "Data shows", "As shown in the figure below", "See attached data for details", etc.
[0089] When the above keywords are detected, the system performs the following operations: Parse the indicator name, table name, or field name pointed to in the document fragment; Automatically construct structured query statements based on the parsing results; The steps involve executing a query and inputting the retrieved numerical results along with a document fragment to generate the answer.
[0090] For example, a certain equipment maintenance policy document states: "According to the equipment management regulations, the equipment availability rate should be maintained above 95%. For specific figures, please refer to the monthly equipment statistics report." After detecting the data guidance keyword "see monthly equipment statistics report," the system automatically parses the "equipment availability rate" indicator, calls the structured query channel to retrieve the actual equipment availability rate for the current month, and inputs the query result along with the policy document fragment into the large model. The generated answer might be: "According to the 'Equipment Management Regulations,' the equipment availability rate should be maintained above 95%. This month's equipment availability rate is 97.2%, which meets the policy requirements." 3. Data and document conflict detection When the difference between the numerical indicators returned by the structured query channel and the numerical indicators recorded in the document fragments recalled by the unstructured retrieval channel exceeds the preset deviation threshold (preferably ±10%), the system will mark the data source conflict in the answer and display the numerical indicators in the structured query results, the numerical indicators recorded in the document fragments, and the conflict warning information together, which will be verified and confirmed or updated by the user or administrator.
[0091] For example, a policy document states that "daily production capacity is 1000 units," while an SQL query shows an average daily output of 800 units, a difference of 20%. The system-generated answer will present both sets of data and indicate: "The policy document states that daily production capacity is 1000 units, but the production system data shows an average daily output of 800 units this month. There is a discrepancy between the two. It is recommended to verify the production capacity data." Input: Structured query results and first result features, unstructured search results and document features, preset trigger conditions.
[0092] Processing flow: Extract the features of the first result, determine whether the first preset condition is met, and if so, trigger unstructured supplementary retrieval; Extract document features and detect whether they contain preset data guidance keywords; if so, trigger a structured supplementary query. Compare structured numerical values with document numerical values; if the difference exceeds a threshold, a conflict message will be displayed.
[0093] Output: A collection of query results and / or document fragments enhanced with cross-channel interaction.
[0094] (ix) Answer generation and source tracing The system uses the query results and / or document fragments obtained from the query scheduling step and the cross-channel interaction step as the input of the limited context into the large language model, and the large language model generates the answer based on the limited context.
[0095] 1. Context-bound construction The system constructs a limiting context based on the question type and the results of cross-channel interactions: For structured data query problems: the context includes the SQL query result data, the name of the data table and field names used, and the data update time; For unstructured knowledge-based question-and-answer questions: the context includes the recalled document fragments and their source metadata (document name, page number, chapter); For mixed-type questions and questions triggered by cross-channel interactions: the context contains both types of information mentioned above, as well as supplementary search results or supplementary query results generated by cross-channel interactions.
[0096] 2. Answer generation constraints The system explicitly requires the large model to generate answers solely based on the provided context, without incorporating external knowledge or allowing for arbitrary interpretation. Specific constraints include: "Please answer the user question based only on the following document fragments and data query results"; "If the search results are insufficient to answer the question, please enter 'Insufficient evidence found'. Do not fabricate an answer." "When citing sources, please indicate the corresponding document name and page number."
[0097] 3. Source Citation Display The system displays the cited sources in the answer, including: Data table source: The name of the data table corresponding to the query results; Field source: The field name corresponding to the query result; Document Name: The document name of the recalled document fragment; Document page number: The page number where the recalled document fragment is located; Chapter information: The chapter in which the recalled document fragment is located; Original excerpt: The original content of the recalled document excerpt.
[0098] 4. Additional Answer Content The answer should also include at least one of the following: The generated structured query statement (for easy verification by technical personnel); The results of structured queries are displayed in tables or charts. Cited excerpts from the original source; Data update time; Results export entry.
[0099] 5. Handling of Insufficient Evidence When the similarity between the recalled document fragments and the user's question is lower than the preset similarity threshold (preferably 0.7~0.85), the system outputs a message indicating insufficient evidence or a refusal to answer. For example: "No sufficient evidence related to your question was found in the knowledge base. We suggest you: ① confirm whether the question is accurately stated; ② contact the data governance team to confirm whether the relevant data has been accessed." Input: Structured query results, unstructured search results, cross-channel interactive supplementary results, and the user's original question.
[0100] Processing flow: Contextual construction, prompt word assembly, large model reasoning, answer post-processing (citation annotation, format enhancement), and result output.
[0101] Output: Natural language answer with cited sources, structured query statement (optional), data table or chart (optional).
[0102] (x) Access Control The system combines user permissions, role permissions, and field-level permissions from the data platform to control the scope of questions and answers.
[0103] 1. Data query permission control In the structured query channel, the system controls the range of data and fields that can be queried based on the user's role permissions and field-level permissions: Table-level permissions: Users can only query data tables that they have permission to access; Field-level permissions: Users can only query fields they have permission to access (e.g., the salary field is only visible to the HR role). Row-level permissions: Users can only query data rows that they have permission to access (e.g., sales staff can only view the data of the customers they are responsible for).
[0104] When generating SQL, the system injects permission constraints into the prompt; during SQL verification, the system verifies again whether the generated SQL exceeds the user's permission scope.
[0105] 2. Document search permission control In the unstructured search channel, the system controls the scope of documents that can be searched based on the user's role and permissions: Users can only retrieve documents they have permission to access; Different users may get different search results for the same question (e.g., ordinary employees cannot search for classified documents).
[0106] Input: User identity information (user ID, role, department, permission level), query request.
[0107] Processing flow: Obtaining permission information, injecting permission filtering for query / retrieval conditions, and performing secondary verification of result permissions.
[0108] Output: Query results and search results after permission filtering.
[0109] (xi) Audit trail The system records logs such as user questions, intent recognition results, query scheduling decisions, SQL statements, retrieval sources, returned results, user feedback behavior, and export behavior for subsequent auditing.
[0110] The audit log includes the following information items: Log ID: Uniquely identifies an audit record; User ID: The identifier of the user who initiated the query; Query time: The timestamp of when the user initiated the query; Natural language problem: The original question input by the user; Intent recognition results: Question classification labels and classification confidence scores; Query scheduling decisions: the type of channel invoked and the basis for the decision; Structured query statement: The generated SQL statement (if any); Query result summary: Number of rows returned and key indicator values; List of documents retrieved: document names and excerpts recalled; The generated answer: The answer content output by the large model; User feedback behaviors include: satisfaction / dissatisfaction ratings, follow-up inquiries, exporting, etc. Response time: The total time from receiving the question to outputting the answer.
[0111] Input: Execution logs and user behavior data from each stage of the system.
[0112] Processing flow: Logs from each stage are collected, formatted uniformly, and written to the audit database.
[0113] Output: Structured audit log records.
[0114] (xii) User feedback-driven strategy optimization The system continuously optimizes the intent recognition model based on user feedback on answers.
[0115] 1. User feedback behavior collection The system provides a feedback entry point on the answer display interface and collects the following user feedback behaviors: Satisfaction rating: The user clicked the "Helpful" button; Dissatisfaction rating: The user clicked the "No Help" button; User follow-up question function: Users can ask follow-up questions based on the answer; Export operation: Users export answers or data.
[0116] 2. Generation of positive and negative samples The system generates training samples based on feedback behavior: When the feedback behavior is an unsatisfactory evaluation or a user's follow-up question, the current natural language question, the question classification label and classification confidence of the intent recognition step, the channel type called by the query scheduling step, and the answer output by the answer generation step are recorded as negative samples; When the feedback behavior is a satisfaction evaluation or an export operation, the above information is recorded as a positive sample.
[0117] 3. Model fine-tuning and threshold update The system periodically (e.g., weekly or monthly) fine-tunes the classification model in the intent recognition step using the accumulated sample dataset: Add positive and negative samples to the training dataset; Perform incremental training or full fine-tuning on the classification model; The first confidence threshold is dynamically updated based on the performance of the fine-tuned model on the validation set.
[0118] Input: User feedback behavior data, current classification model, current confidence threshold.
[0119] Processing flow: feedback behavior collection, positive and negative sample generation, sample accumulation, periodic model fine-tuning, and confidence threshold update.
[0120] Output: Updated classification model, updated first confidence threshold. VI. Specific Implementation Methods Example 1: Collaborative Q&A between production data and policy documents in an equipment manufacturing enterprise Scene description: A certain equipment manufacturing company has built a data platform, integrating data from ERP, MES, PHM, and other systems and completing layered modeling. Simultaneously, the company has parsed, segmented, and vectorized unstructured documents such as product manuals, process specifications, policy documents, and meeting minutes, storing them in a vector database. The company wants business personnel to be able to query production data and policy documents through a unified natural language interface.
[0122] User issue: Production planner Xiao Zhang entered the following question: "What was the output of the main unit plant last month? What is the statistical method for output?" Implementation steps: Step 1: Intent Recognition and Confidence Output After receiving a user's question, the system invokes the intent recognition model for inference. Model output: Problem category tag: Mixed (combines structured query requirements for "what is the output" and knowledge-based question-and-answer requirements for "what are the statistical standards"). Classification confidence level: 0.92 (above the first confidence threshold of 70%) Step 2: Query the schedule Since the classification confidence (0.92) is higher than the first confidence threshold (70%), and the question is classified as a mixed category, the system simultaneously calls the structured query channel and the unstructured retrieval channel.
[0123] Step 3: Execute the structured query channel (1) Problem Analysis: The system analyzes the business entity as "main plant", the indicator as "output", the time range as "last month", and the output format as "text answer".
[0124] (2) Candidate table field recall: The system recalls candidate fields related to "output" in the data asset catalog, including "Completed Quantity" (from the MES production completion table), "Reported Quantity" (from the MES reporting table), and "Inbound Quantity" (from the WMS inbound table). Based on the business definition, the system determines that "Completed Quantity" is the standard definition for output statistics.
[0125] (3) SQL generation: The system generates SQL statements: SELECTSUM(completion_qty)AS total_output FROM dws_production_summary WHERE workshop='OEM Plant' AND stat_month = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH),'%Y-%m') AND data_status = 'verified' (4) SQL verification: The system performs syntax verification, metadata verification, permission verification, security verification and performance verification. After all verifications are passed, the SQL is executed.
[0126] (5) Query result: The result returned "The output of the main unit branch plant last month was 12,847 pieces".
[0127] Step 4: Execute the unstructured retrieval channel (1) Problem vectorization: The system vectorizes the question "What is the statistical caliber of production output?".
[0128] (2) Hybrid retrieval: Similarity retrieval is performed in the vector database, and relevant document fragments are retrieved by combining business domain filtering (production management) and document type filtering (institutional documents).
[0129] (3) Reordering: The top 10 recalled document fragments are reordered, and the top 3 are selected to construct the context. The recalled document fragments include: Excerpt 1 (from Article 3.2 of the "Production Statistics Management Measures"): "Production statistics shall be based on the quantity of finished products that have been put into storage, that is, the quantity of products that have completed all processes and passed quality inspection and have completed the procedures for being put into storage." Excerpt 2 (from Chapter 5 of the MES System Operation Manual): "The Quantity Completed field records the number of products that have completed all processes, excluding in-process and rework products." Step 5: Cross-channel interaction The system detected that the structured query results (12,847 items) were consistent with the statement "production statistics are based on the number of completed and put into storage" in the unstructured search results, so there was no need to trigger a conflict warning.
[0130] Step 6: Answer Generation The system uses structured query results and unstructured search results as contextual input to the large language model. The generated answer is as follows: "Last month, the main unit production plant produced 12,847 units."
[0131] Statistical Scope Explanation: According to Article 3.2 of the "Production Statistics Management Measures," production statistics are based on the quantity of completed and warehoused products, that is, the quantity of products that have completed all processes, passed quality inspection, and have completed the completion and warehousing procedures. The above data comes from the MES Production Completion Summary Table (dws_production_summary), and the statistical period is from May 1 to May 31, 2026.
[0132] Step 7: Access Control and Auditing The system verifies Zhang's role permissions (production planner) to grant him access to the main plant's production data and the "Production Statistics Management Regulations" document. The system records a complete audit log.
[0133] Step 8: User Feedback Xiao Zhang clicked the "Helpful" button on the answer. The system recorded the question-answer pair as a positive sample for subsequent model optimization.
[0134] In this embodiment, intent recognition accurately categorizes questions into mixed types, simultaneously invoking both structured query and unstructured retrieval channels. The structured query channel retrieves production data (12,847 items) from the Data Management System (DWS) layer of the data platform, while the unstructured retrieval channel recalls statistical caliber explanations from the document library. The results from both channels are merged during the answer generation stage, allowing users to obtain both data-driven answers and business explanations within a single question. Cross-channel interaction detected consistency between the data and document calibers, without triggering any conflict warnings. The entire question-and-answer process takes approximately 2.3 seconds, representing a significant efficiency improvement compared to the traditional method (first checking reports and then flipping through policy documents).
[0135] This invention can be widely applied to the construction of data platforms, intelligent question-and-answer systems, and knowledge management projects in various enterprises. It is particularly suitable for the following scenarios: Manufacturing: Collaborative Q&A between production data queries and process specifications / equipment manuals helps frontline staff quickly access production data and operating procedures.
[0136] Financial Industry: The system provides collaborative Q&A for operational data queries and policy documents and compliance documents, helping business personnel quickly understand business data and compliance requirements.
[0137] Energy industry: Equipment operation data query and maintenance manual, safety procedure collaborative Q&A, to help operation and maintenance personnel quickly obtain equipment status and safety specifications.
[0138] This invention can be integrated and deployed with existing data middleware products (such as Alibaba Cloud DataWorks and Huawei Cloud DGC), vector databases (such as Milvus and Pinecone), and large language models (such as Qwen and ChatGLM), and has broad industrial applicability.
[0139] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for intelligent collaborative question answering using structured and unstructured data, characterized in that, include: The data access steps involve accessing both structured and unstructured data sources. The structured data sources include a hierarchical data model within the enterprise data platform, comprising at least an operational data storage layer, a detailed data layer, a summary data layer, and an application data layer. The unstructured data sources include enterprise knowledge documents, which are parsed, segmented, vectorized, and then written into a vector database. The intent recognition step involves receiving a natural language question input by the user, performing intent recognition on the natural language question, and outputting a question classification label and a corresponding classification confidence score. The question classification label includes structured data query, unstructured knowledge question answering, or a hybrid category. The classification confidence score is used to characterize the reliability of the intent recognition result. The query scheduling step involves executing query scheduling based on the problem classification label and the classification confidence level. When the classification confidence level is higher than the first confidence level threshold, a single query channel corresponding to the problem classification label is invoked. The single query channel is either a structured query channel or an unstructured retrieval channel. When the classification confidence level is lower than or equal to the first confidence level threshold, the structured query channel and the unstructured retrieval channel are invoked simultaneously. The structured query channel converts the natural language question into a structured query statement based on the data asset catalog and queries data from the aggregated data layer or the application data layer; the unstructured retrieval channel vectorizes the natural language question and performs similarity retrieval in the vector database to recall relevant document fragments. The cross-channel interaction step involves obtaining the first result features of the query results returned by the structured query channel and the document features of the document fragments recalled by the unstructured retrieval channel. When the first result feature meets the first preset condition, the unstructured retrieval channel is invoked to supplement the retrieval of business scope description documents or change log documents related to the current query topic, and the supplemented document fragments and the query results are used together as the basis for answer generation; When a preset data guidance keyword is detected in the document features, the structured query channel is invoked to perform a query operation corresponding to the data guidance keyword, and the numerical result obtained from the query and the document fragment are used together as the basis for generating the answer; The answer generation step involves inputting the query results and / or document fragments obtained from the query scheduling step and the cross-channel interaction step as a limited context into the large language model. The large language model then generates an answer based on the limited context and displays the citation source in the answer. The citation source includes at least one of the following: data table source, field source, document name, document page number, and chapter information. The access control steps control the range of data that can be queried by the structured query channel and the range of documents that can be retrieved by the unstructured retrieval channel based on the user's role permissions and field-level permissions. In the strategy optimization step, after obtaining the answer output by the answer generation step, the user's feedback behavior on the answer is received, positive or negative samples are generated based on the feedback behavior and added to the sample dataset, and the classification model in the intent recognition step is updated using the sample dataset.
2. The method according to claim 1, characterized in that, The first result feature includes at least one of the following: the number of rows in the query result, the null value rate of the query result, and the fluctuation range of the numerical indicator; The first preset condition includes at least one of the following: When the number of rows in the query results is less than a preset row count threshold, it is determined that the current query results are insufficient in terms of information. The unstructured retrieval channel is then invoked to retrieve business background knowledge related to the query topic, and an answer containing supplementary explanations of the business background is generated. When the fluctuation range of the numerical indicator exceeds the preset fluctuation range, it is determined that the current value has an abnormal change. The unstructured retrieval channel is called to retrieve the business change log, meeting minutes or caliber adjustment document corresponding to the numerical indicator, and an answer containing an analysis of the reasons for the change is generated.
3. The method according to claim 1, characterized in that, In the intent recognition step, the hybrid question is one that simultaneously includes structured data query requirements and unstructured knowledge query requirements; When the natural language question is classified as a mixed-type question, the query scheduling step simultaneously invokes the structured query channel and the unstructured retrieval channel, and organizes the indicator data in the query results returned by the structured query channel, the document fragments recalled by the unstructured retrieval channel, and the natural language question into a comprehensive context, which is then used by the large language model to generate a comprehensive answer.
4. The method according to claim 1, characterized in that, The process of invoking the structured query channel includes: Based on the business entities, indicators, time ranges, organizational ranges, and filtering conditions parsed from the natural language problem, candidate data tables and candidate fields are recalled in the data asset catalog. The data asset catalog includes the business meaning of each field, indicator definition, primary and foreign key relationships, data source, update frequency, data quality score, and responsible person information; The natural language question, the candidate data table, the candidate fields, the business meaning of the fields, the table relationships, the statistical definitions, and the permission range are combined to form prompt words, which are then input into the large language model to generate the structured query statement.
5. The method according to claim 4, characterized in that, After the structured query statement is generated, it undergoes multi-level validation before execution. The multi-level validation includes: Syntax validation checks whether the structured query statement conforms to the database syntax. Metadata validation checks whether the table names and field names referenced in the structured query statement exist in the data asset catalog. Permission verification checks whether the current user has permission to access the tables and fields referenced in the structured query statement; Security checks are implemented to block data deletion, data update, and data clearing operations. Performance verification checks whether the structured query statement contains full table scans, Cartesian products, or unnecessary joins; The structured query statement is executed and the query results are returned only after all the multi-level validations have passed.
6. The method according to claim 1, characterized in that, The process of invoking the unstructured retrieval channel includes: The knowledge document is parsed to extract the title, body text, tables, chapter structure, page numbers, file source, update time, and business domain information. The knowledge document is segmented into blocks based on paragraph boundaries, heading levels, semantic integrity, and a preset token quantity threshold to generate text blocks. Each text block is bound to source metadata, which includes document name, document type, department, business domain, page number, chapter, update time, and permission scope. The text block is vectorized using an embedding model, and the vector of the text block and the source metadata are written into the vector database. The natural language problem is vectorized using the same embedding model, and similarity retrieval is performed in the vector database. Combined with keyword matching, business domain filtering, document type filtering, time filtering and user permission filtering, a hybrid retrieval is performed to recall relevant text blocks. The recalled relevant text blocks are reordered, and the reordering is based on at least one of the following: vector similarity, keyword matching degree, document authority, document update time, user permissions, and business domain relevance. The context of the large language model is constructed by selecting the top-ranked text blocks after reordering.
7. The method according to claim 6, characterized in that, In the answer generation step, when the similarity between the recalled text block and the natural language question is lower than a preset similarity threshold, an insufficient evidence prompt or a refusal prompt is output, rather than forcibly generating an answer; In the answer generation step, the answer also includes at least one of the following: The structured query statement; The structured query results are displayed in tables or charts; The cited source excerpt; Data update time; Results export entry.
8. The method according to claim 1, characterized in that, In the strategy optimization step: When the feedback behavior is an unsatisfactory evaluation or a user follow-up question, the current natural language question, the question classification label and classification confidence score output by the intent recognition step, the channel type invoked by the query scheduling step, and the answer output by the answer generation step are recorded as negative samples. When the feedback behavior is a satisfaction evaluation or an export operation, the current natural language question, the question classification label and classification confidence score output by the intent recognition step, the channel type called by the query scheduling step, and the answer output by the answer generation step are recorded as positive samples. The classification model in the intent recognition step is fine-tuned periodically using the sample dataset, and the first confidence threshold is updated.
9. A structured and unstructured data intelligent collaborative question-answering system, characterized in that, include: The data access module is used to access structured data sources and unstructured data sources. The structured data sources include the hierarchical data model in the enterprise data platform, and the unstructured data sources include enterprise knowledge documents that have been parsed, segmented, and vectorized before being written into a vector database. The intent recognition module is used to receive natural language questions input by users, perform intent recognition on the natural language questions, and output question classification labels and corresponding classification confidence scores. The question classification labels include structured data query type, unstructured knowledge question answer type, or hybrid type. The query scheduling module is used to invoke the structured query channel and / or the unstructured retrieval channel based on the question classification label and the classification confidence level; The structured query channel is used to convert the natural language question into a structured query statement according to the data asset catalog, and to query data from the aggregated data layer or the application data layer. The unstructured retrieval channel is used to vectorize the natural language question and then perform similarity retrieval in the vector database to recall relevant document fragments; The cross-channel interaction module is used to obtain the first result feature of the query result returned by the structured query channel and the document feature of the document fragment recalled by the unstructured retrieval channel; when the first result feature meets the first preset condition, the unstructured retrieval channel is invoked to supplement the retrieval; when a preset data guidance keyword is detected in the document feature, the structured query channel is invoked to execute the corresponding query operation. The answer generation module is used to input the query results and / or document fragments obtained by the query scheduling module and the cross-channel interaction module as a limited context into the large language model, and the large language model generates an answer based on the limited context, and displays the source of the citation in the answer; The access control module is used to control the scope of data query and document retrieval based on user role permissions and field-level permissions; The strategy optimization module is used to receive user feedback on the answer after obtaining the answer output by the answer generation module, generate positive or negative samples based on the feedback and add them to the sample dataset, and update the classification model in the intent recognition module using the sample dataset.
10. A structured and unstructured data intelligent collaborative question-answering device, characterized in that, include: One or more processors; Storage device for storing one or more programs, as well as a data asset catalog and vector database; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 8.