Knowledge question-answering method and device integrating data completion and space-time anomaly perception

By introducing spatiotemporal context awareness and data completion mechanisms into the intelligent question-answering system, the problems of uncontrollable user input quality and insufficient credibility of generated content are solved. End-to-end anomaly detection and correction are achieved, improving the robustness and credibility of the question-answering system. It is particularly suitable for high-risk fields such as medicine and law.

CN121809692APending Publication Date: 2026-04-07席萌
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-01
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing intelligent question-answering systems suffer from uncontrollable user input quality, insufficient credibility of generated content, disconnect between prompts and knowledge generation, and superficial utilization of spatiotemporal context, resulting in insufficient robustness and credibility of output content.

Method used

It adopts a closed-loop mechanism of spatiotemporal context extraction, prompt word anomaly detection and correction, knowledge retrieval and generation, and knowledge anomaly detection and correction. It constructs a unified representation through named entity recognition, time parsing, geolocation parsing and semantic context, and combines a neural network model to perform multidimensional anomaly detection and correction, so as to ensure the spatiotemporal consistency and logical self-consistency of input and output.

Benefits of technology

It achieves end-to-end anomaly detection and closed-loop correction from user input to final answer, improving the robustness, factual accuracy, logical consistency and content security of the question-and-answer system, and is suitable for high-risk professional scenarios such as medical and legal consultation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121809692A_ABST
    Figure CN121809692A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge question-answering method and device fusing data completion and space-time anomaly perception, and belongs to the field of intelligent question-answering and credible generation in artificial intelligence, and the method comprises knowledge anomaly detection, retrieval enhancement generation, and question-answering based on artificial intelligence. According to the method, under the complex conditions that grammar errors, information loss, space-time dislocation or sensitive expression exist in user input, a space-time consistency constraint mechanism penetrating through the whole process of input-retrieval-generation-verification is constructed, so that a system actively recognizes and corrects multi-dimensional anomalies, wrong intention analysis and fact distortion propagation are avoided, and the user experience is improved. And the end-to-end question and answer service with high robustness and high credibility is realized. Meanwhile, prompt words and generated contents can be intelligently complemented according to context reasoning and domain knowledge under the condition of lacking a complete user instruction, and meanwhile it is ensured that output is strictly aligned with a real scene in the aspects of time, space and logic. Furthermore, in order to improve the factual accuracy and safety of the generated content, a'detection-correction-verification 'dual-stage closed-loop governance architecture is realized by utilizing an anomaly detection model (NN1 / NN3) and a correction generation model (NN2 / NN4) which are jointly trained, and landing application of a credible intelligent question-answering system in high-risk professional scenes such as medical treatment, law and industrial maintenance is effectively supported.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of intelligent question answering systems in artificial intelligence, and particularly relates to a knowledge question answering method and device fusing data completion and space-time abnormality perception. BACKGROUND

[0002] Intelligent question answering (QA) systems aim to understand user natural language questions and retrieve, reason and generate accurate, reliable and explainable answers from structured or unstructured knowledge sources. As one of the core technologies of human-computer interaction, intelligent question answering has important application value in high-risk and high-reliability scenarios such as intelligent customer service, medical auxiliary diagnosis, legal consultation and automatic driving decision support. With the development of large language models and retrieval-augmented generation (RAG) technology, modern question answering systems have made significant progress in language fluency, but the factual accuracy, logical consistency, space-time context alignment capability and robustness to abnormal inputs of their output content still face serious challenges, and systematic abnormality perception and data completion mechanisms need to be introduced to ensure the credibility and safety of the answers.

[0003] Current intelligent question answering methods can be mainly divided into three categories: (1) rule-based and template-based question answering systems, which rely on manually constructed semantic analysis rules and knowledge base mapping; (2) end-to-end neural question answering models, which use deep learning to directly learn the mapping relationship from question-answer pairs; (3) retrieval-augmented generation (RAG) type question answering systems, which combine external knowledge retrieval and large language model generation, and balance knowledge update and language expression ability. The three methods have their own advantages and disadvantages in explainability, generalization ability and knowledge timeliness.

[0004] The first method is represented by early IBM Watson and expert systems, which match user questions to pre-defined templates through semantic role labeling and dependency syntax analysis, and query answers from structured databases (such as knowledge graphs). Its advantages are clear logic and controllable results, but it is heavily dependent on human rules, difficult to cover complex questions in open domains, and unable to handle ambiguous or incomplete inputs. In recent years, this method has been less used independently, and is mostly embedded as a post-processing verification module in hybrid systems.

[0005] The second type of method is represented by BERT-QA, T5, FLAN-T5, and other end-to-end models. By fine-tuning on large-scale question-answering datasets such as SQuAD and Natural Questions, these methods achieve direct mapping from input questions to output answers. However, they have significant limitations. First, they rely solely on implicit knowledge from training data and cannot dynamically access new knowledge, leading to hallucinations. Second, they lack the ability to perceive grammatical errors, logical inconsistencies, or temporal-spatial mismatches in input prompts, which can amplify errors rather than correct them.

[0006] The third type of method is currently the mainstream, represented by architectures such as RAG, REALM, and Atlas. These methods first retrieve relevant documents from external knowledge bases using dense vector retrieval (e.g., DPR, ColBERT), and then generate answers by integrating the retrieval results using large language models (e.g., LLaMA, GPT). This paradigm significantly improves knowledge timeliness and factual coverage. Recent research has introduced self-reflection, verifiers, or tool-augmented generation mechanisms to improve output reliability. However, existing RAG systems typically assume that user input is "reasonable and complete," and focus on factual consistency when validating generated content. They lack proactive detection and correction of prompt abnormalities, and do not consider temporal-spatial context as a core constraint throughout the entire question-answering process.

[0007] In summary, although existing intelligent question-answering technology has made significant progress in language generation and knowledge retrieval, it still faces the following key challenges in practical applications: (1) User input often contains grammatical errors, missing information, temporal-spatial mismatches, or sensitive content, and existing systems lack pre-processing prompt abnormality perception and closed-loop correction mechanisms; (2) Although knowledge generation can retrieve external information, it lacks multi-dimensional, context-aware abnormality detection capabilities for factual errors, logical conflicts, biased expressions, and incomplete information in generated content; (3) The prompt processing and knowledge generation stages are disconnected, and there is no unified temporal-spatial consistency guarantee framework for "input-retrieval-generation-verification-correction"; (4) Existing models mainly rely on surface matching of temporal-spatial context and do not use it as a hard constraint for abnormality judgment and content correction. Therefore, there is an urgent need for an end-to-end knowledge question-answering method that integrates data completion and temporal-spatial abnormality perception to achieve high robustness and high reliability of intelligent question-answering services. SUMMARY

[0008] This invention provides a knowledge-based question-answering method and apparatus that integrates data completion and spatiotemporal anomaly perception. Addressing core issues in existing intelligent question-answering systems, such as uncontrollable user input quality, insufficient credibility of generated content, disconnect between prompts and knowledge generation, and superficial utilization of spatiotemporal context, this invention enables end-to-end anomaly perception, closed-loop correction, and consistency verification from initial user input to final answer within a unified spatiotemporal semantic framework. This effectively improves the robustness, factual accuracy, logical consistency, and content security of the question-answering system.

[0009] A knowledge-based question-answering method and apparatus that integrates data completion and spatiotemporal anomaly perception is characterized by comprising the following steps:

[0010] (1) Spatiotemporal context extraction: Extract spatiotemporal and semantic context information from user input text or task execution scenario to construct a unified context representation. Assume the user input is a text sequence: By employing Named Entity Recognition (NER), Time Parsing, and Geo Parsing, contextual feature vectors are extracted. in:

[0011] Indicates the time context (timestamp, time range, time zone);

[0012] Indicates spatial context (geographic location, regional hierarchy);

[0013] It represents the semantic context (topic, domain label, task type).

[0014] (2) Prompt word anomaly detection, based on the spatiotemporal context of the initial prompt word Anomaly detection is performed to determine if there are any abnormalities such as grammatical errors, logical contradictions, sensitive content, or semantic incompleteness. If any abnormalities are found, the prompt word correction and completion operations are performed repeatedly until optimized prompt words without abnormalities are generated. Based on this, a standard query problem is constructed. ;

[0015] (3) Knowledge retrieval, based on query questions In the knowledge base Search for relevant knowledge fragments in the middle ,in .

[0016] (4) Knowledge generation, without relying on retrieved knowledge and spatiotemporal context In this case, based on the query question Generate relevant knowledge to fully extract, without constraints, the relevant knowledge missing in the knowledge base obtained from large-scale pre-training within the large model: in To generate the model, a pre-trained large language model can be used.

[0017] (5) Knowledge anomaly detection, for the generated knowledge content Anomaly detection is performed. If anomalies are found, knowledge correction and completion operations are repeated to generate anomaly-free knowledge content. Based on the knowledge content without anomalies, a final answer is generated and output. .

[0018] The specific process of step (2) is as follows:

[0019] (2-1) Prompt word anomaly detection: Detects the initial prompt word entered by the user. Perform multidimensional anomaly detection. Construct anomaly determination function: in:

[0020] · This is a prompt word anomaly detection model;

[0021] Output , indicating in The detection results for each type of anomaly.

[0022] Exception types include at least:

[0023] • Grammatical or semantic errors: The prompt word contains spelling errors, grammatical confusion, misuse of parts of speech, or semantic incoherence, making it difficult to interpret the intent;

[0024] • Spatiotemporal inconsistency: The time, place, event, and other elements mentioned in the prompt conflict with the spatiotemporal context extracted in step (1) (e.g., the user is in "Beijing 2025" but asks "the weather in New York yesterday", while "yesterday" does not specify the time zone or date).

[0025] • Logical contradictions or factual discrepancies: The prompt contains self-contradictory premises, assumptions that clearly violate common sense, or statements that do not conform to known facts (such as "Please explain how to generate electricity using a perpetual motion machine").

[0026] • Sensitive or inappropriate content: Contains discriminatory, offensive, illegal, or content security policy-violating statements involving gender, race, religion, politics, or other related fields;

[0027] • Missing information or ambiguous intent: Key query elements (such as subject, time range, geographical limitation, task objective) are missing, making it impossible to accurately retrieve or generate a valid answer.

[0028] If the following conditions are met: If the prompt word is found to be abnormal, proceed to step (2-2); otherwise, proceed to step (2-3).

[0029] The anomaly detection is achieved by training a neural network NN1, which can be a pre-trained large language model, a recurrent neural network, a multilayer perceptron, or other machine learning classification model or deep learning architecture suitable for text anomaly detection tasks.

[0030] (2-2) Prompt word correction and completion: Targeted corrections are made to detected anomalies, and a new round of prompt words is generated. in: This is a prompt word correction and completion model. Its functions include:

[0031] • Grammatical or semantic error correction: Use language models to automatically correct prompt words, restructure sentences, or clarify semantics to improve parsability;

[0032] • Spatiotemporal inconsistency correction: Based on the spatiotemporal context of step (1), automatically infer and complete the missing timestamps, geographical locations or event backgrounds to align the prompts with the current scene;

[0033] • Correction of logical contradictions or factual deviations: Identify unreasonable premises and make them answerable through gentle guidance or hypothesis modification (such as replacing "perpetual motion machine" with "efficient energy device"), or mark them as unanswerable requests;

[0034] • Correction of sensitive or inappropriate content: Activate content security mechanisms, block or replace prohibited words, and generate compliant and neutral equivalent prompts;

[0035] • Information gap completion: By combining dialogue history, user profiles, domain knowledge bases, or contextual reasoning, missing key query elements are supplemented (such as adding reasonable assumptions such as "current city" or "last week") to clarify user intent.

[0036] The prompt word correction and completion is achieved by fine-tuning the neural network NN2. NN2 can be a pre-trained large language model, a recurrent neural network, a multilayer perceptron, or other machine learning classification model or deep learning architecture suitable for prompt word correction and completion tasks.

[0037] After the correction is completed, return to step (2-1) for closed-loop verification until the generated prompt word passes the anomaly detection or the maximum number of iterations threshold is reached. .

[0038] (2-3) Based on the problem of generating no abnormal prompt words, generate the corrected and completed no abnormal prompt words. According to the input specifications of the target question-answering system, convert the questions into standard query questions in structured or natural language form. This is used for subsequent knowledge retrieval and answer generation. This is a formatted mapping function used to generate natural language or structured queries adapted to the knowledge retrieval module.

[0039] In step (2), the prompt word anomaly detection model NN1 and the prompt word correction model NN2 are jointly trained. Before training, a training sample set needs to be constructed: in:

[0040] · These are the original prompt words;

[0041] · For the corresponding spatiotemporal and semantic context;

[0042] · Manually or automatically labeled vectors for alert word anomaly types;

[0043] · To and The corresponding no abnormal target prompt words.

[0044] NN1 aims to identify anomaly types, and its loss function is defined as multi-label binary classification loss: in:

[0045] · For NN1, the first pair of pairs ... Prediction results for anomalies;

[0046] · The binary cross-entropy loss function is calculated as follows: .

[0047] The prompt word correction and completion model NN2 aims to generate abnormal prompt words. Its generation loss is measured using sequence-level negative log-likelihood loss, which constrains the consistency between the model output and the target abnormal prompt words at the word level. The loss is defined as follows: in:

[0048] · The message indicating that the target has no abnormalities is in the first... The real word element at each position;

[0049] · This indicates the historical generated lexical units preceding this position;

[0050] · This represents the conditional probability distribution output by NN2.

[0051] By minimizing the generation loss, NN2 learns progressively during training to generate outputs that are consistent with the target non-abnormal cue words in terms of grammatical structure, semantic expression, and information completeness, given the original cue words and contextual constraints. This improves the accuracy and stability of cue word correction and completion.

[0052] Furthermore, to ensure that the prompts corrected by NN2 can pass the judgment of the anomaly detection model NN1 at both the semantic and security levels, this invention introduces an anomaly consistency constraint loss to explicitly suppress anomalous features still present in the correction results. This loss is defined as follows: in:

[0053] · Indicates the total number of preset exception types;

[0054] · Indicates the first After the prompt words, corrected by NN2, are re-entered into the anomaly detection model NN1, in the first... Detection results on the anomaly dimension.

[0055] By minimizing the anomaly consistency constraint loss, the model penalizes correction results that are still judged as anomalous during parameter updates, thereby guiding NN2 to prioritize generating prompt words that can be judged as "no anomaly" by the anomaly detection model, thus achieving collaborative consistency optimization between prompt word anomaly detection and correction.

[0056] The joint optimization objective function of NN1 and NN2 is defined as: in This is a weighting coefficient used to balance the accuracy of anomaly detection with the quality of the corrected generation.

[0057] The specific process of step (5) is as follows: (5-1) Knowledge anomaly detection,

[0058] The generated knowledge content Perform anomaly detection: in:

[0059] · For knowledge anomaly detection model;

[0060] · Indicates in The detection results for knowledge anomalies.

[0061] Exception types include:

[0062] • Factual error: The knowledge content contains statements that contradict the authoritative knowledge sources, common sense, or retrieval evidence output in step (3);

[0063] • Spatiotemporal inconsistency: The time, location, events, and other elements in the knowledge content conflict with the spatiotemporal context extracted in step (1) (e.g., “historical events that occurred in 2025” are described as “occurred in 2020”).

[0064] • Logical conflict or internal inconsistency: There are contradictory inferences, conclusions or attribute descriptions within the same knowledge content;

[0065] • Biased or inappropriate statements: Content that is discriminatory, inflammatory, or violates compliance requirements, including content that is sensitive in areas such as gender, race, region, or politics;

[0066] • Missing or incomplete information: Key facts, causal chains, or necessary conditions are not covered, resulting in incomplete answers or misleading users.

[0067] like: If the condition is met, proceed to step (5-2); otherwise, proceed to step (5-3).

[0068] The anomaly detection is achieved through a trained neural network model NN3, which is a machine learning model or deep learning architecture suitable for the task of assessing the credibility and consistency of knowledge content, including but not limited to pre-trained large language models, discriminative Transformers, graph neural networks, multi-task classification networks, or combinations thereof.

[0069] (5-2) For the detected anomaly types, perform corresponding correction and completion operations: , in A knowledge correction and completion model.

[0070] The specific calculations include:

[0071] • Factual error correction: Use authoritative external knowledge sources (such as Wikipedia, professional databases or knowledge graphs) to perform fact-checking and replace erroneous statements with verified correct information;

[0072] • Spatiotemporal inconsistency correction: Based on the spatiotemporal context constraints of step (1), the timestamps, geographical locations or event sequences in the knowledge content are automatically corrected to ensure spatiotemporal alignment;

[0073] • Logical conflict correction: Reconstruct the knowledge representation using logical reasoning modules or consistency constraint solvers to eliminate internal contradictions;

[0074] • Correction of biased or inappropriate expressions: Activate the content security filtering mechanism to replace sensitive or illegal expressions with neutral, objective, and compliant equivalent expressions;

[0075] • Information gap completion: Based on search results and contextual intent, the generative model fills in missing key facts, background information, or limiting conditions to improve the completeness of the answer.

[0076] The knowledge correction and completion process is executed by the fine-tuned neural network model NN4. NN4 is a generative model suitable for knowledge editing, controllable text generation, or retrieval enhancement and correction tasks, including but not limited to large language models with instruction fine-tuning, sequence-to-sequence architectures, retrieval-generation joint models, or correction agents based on reinforcement learning. NN4 can dynamically access external tools (such as APIs and knowledge graph query interfaces) to achieve fact anchoring.

[0077] After the correction is completed, return to step (5-1) for closed-loop verification until the generated knowledge content passes the anomaly detection or reaches the maximum number of iterations threshold.

[0078] (5-3) Generate answers based on knowledge without anomalies, including knowledge content that has passed anomaly detection. Input the answer to the answer generation module to get the final answer: .

[0079] In step (5), the knowledge anomaly detection model NN3 and the knowledge correction model NN4 are jointly trained. Before training, a training sample set needs to be constructed:

[0080] in:

[0081] · This refers to the initially generated knowledge content;

[0082] · For the corresponding search knowledge fragments;

[0083] · Label knowledge anomaly types;

[0084] · This refers to target knowledge content that has been manually or by rules verified and found to be free of anomalies.

[0085] The training objective of NN3 is to judge the credibility and consistency of generated knowledge, and its loss function is defined as:

[0086] NN4 aims to generate non-anomaly-free knowledge content, and its generation loss is defined as: .in,

[0087] · This indicates that the target has no abnormal knowledge content in the first place. The real word element at each position;

[0088] · This indicates a historical knowledge term preceding this position.

[0089] · This represents the conditional probability distribution output by the knowledge correction and completion model NN4.

[0090] To ensure that the corrected knowledge content passes anomaly detection and remains consistent with the retrieved evidence, anomaly consistency constraint loss is introduced: And the loss of fact alignment: ,in This is a semantic similarity function used to measure the degree of consistency between generated knowledge and retrieved evidence.

[0091] The joint optimization objective function of NN3 and NN4 is defined as follows: in These are the weighting coefficients.

[0092] Compared with the prior art, the present invention has the following beneficial effects:

[0093] 1. An end-to-end spatiotemporal context-aware anomaly prevention mechanism has been implemented. This invention uses time, space, and semantic context as core constraints throughout the entire process of prompt word processing and knowledge generation. It not only detects and corrects spatiotemporal misalignment issues in user prompt words during the input stage (such as "querying events that did not occur in 2020 in 2025"), but also performs spatiotemporal consistency verification on the output content during the knowledge generation stage. This effectively avoids answer distortion caused by spatiotemporal logic confusion, and significantly improves the reliability and timeliness adaptability of the question-answering system in dynamic real-world scenarios.

[0094] 2. A two-stage anomaly governance architecture with a closed-loop "detection-correction-verification" process is constructed. Unlike existing methods that only focus on post-generation fact-checking or ignore input quality, this invention deploys anomaly detection (NN1 / NN3) and correction models (NN2 / NN4) at the prompt word layer and knowledge content layer respectively, and ensures that the correction results meet preset standards through an iterative closed-loop verification mechanism. This architecture can not only proactively correct various anomalies such as syntax errors, sensitive content, and logical contradictions, but also prevent errors from propagating from input to output, fundamentally improving the system's robustness and security.

[0095] 3. Deep integration of data completion and contextual reasoning significantly enhances intent understanding and response completeness. Addressing the common issues of missing information or ambiguous expressions in user input, this invention utilizes dialogue history, domain knowledge base, and spatiotemporal context for intelligent completion. Simultaneously, during the knowledge generation phase, if key facts or causal chains are missing, the system can dynamically supplement necessary information based on retrieved evidence. This two-way completion mechanism enables the system to accurately reconstruct the user's true intent while generating comprehensive, logically sound, high-quality responses, making it particularly suitable for high-risk professional scenarios such as medicine and law.

[0096] 4. Supports flexible and scalable model architecture and integration with external tools, balancing versatility and domain adaptability. This invention adopts a higher-level definition for core modules such as NN1–NN4, compatible with various AI technologies such as pre-trained large language models, graph neural networks, and sequence generation architectures. It also allows NN4 to dynamically call external tools such as knowledge graph APIs and authoritative databases to achieve fact anchoring. This design ensures broad patent protection while facilitating customized deployment in different application scenarios, providing a general technical framework for building a trustworthy, controllable, and auditable next-generation intelligent question-answering system. Attached Figure Description

[0097] Figure 1 This is a flowchart illustrating a knowledge question-answering method and apparatus that integrates data completion and spatiotemporal anomaly perception according to the present invention. Detailed Implementation

[0098] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be noted that the embodiments described below are intended to facilitate understanding of the present invention and are not intended to limit it in any way. Operating methods not specifically specified in the following embodiments are generally performed under conventional conditions or as recommended by the manufacturer.

[0099] This example uses an industrial equipment maintenance Q&A system, where users ask questions about maintenance suggestions for a specific piece of equipment using natural language. Assume the user is currently located in Zhangjiang High-Tech Park, Pudong New Area, Shanghai, China, at 10:30 AM (UTC+8) on Monday, December 22, 2025.

[0100] Step (1): Spatiotemporal context extraction

[0101] • User input text sequence:

[0102]

[0103] • Utilize Named Entity Recognition (NER), temporal expression parsing, and geolocation parsing to extract contextual feature vectors:

[0104] oTime Context "Yesterday" → Combined with the current time 2025-12-22 → it can be inferred to be 2025-12-21 (UTC+8)

[0105] ospace context The user equipment is deployed in Zhangjiang Science Park, Pudong New Area, Shanghai (latitude and longitude: 31.2°N, 121.6°E), at the regional level of "School > Plant A > Equipment No. PUMP-2024".

[0106] o Semantic context Subject: Industrial Equipment Maintenance; Domain: Fluid Machinery; Task Type: Fault Diagnosis and Repair Recommendations

[0107] Therefore, the unified context is represented as:

[0108]

[0109] Step (2): Detection and correction of abnormal prompt words

[0110] (2-1) Detection of abnormal prompt words

[0111] Will and Input Prompt Anomaly Detection Model Output anomaly vector:

[0112]

[0113] Corresponding exception type:

[0114] Syntax / semantic errors: 0 (None)

[0115] Spatiotemporal inconsistency: 1 (The time zone of "yesterday" is not explicitly stated, but the context has inferred that it is UTC+8, which is acceptable here, but the model conservatively judges it as potentially ambiguous)

[0116] Logical contradiction: 0

[0117] Sensitive content: 0

[0118] Missing information: 1 (No "which pump" is specified; equipment identification is missing)

[0119] because An anomaly was detected, and the correction process was initiated.

[0120] (2-2) Prompt word correction and completion

[0121] Call prompt word correction model ,implement:

[0122] Complete the equipment label: "This pump" → "PUMP-2024 pump located in Plant A, Zhangjiang Industrial Park"

[0123] Specify the date: "Yesterday" → "December 21, 2025"

[0124] Generate new suggestion words:

[0125]

[0126] Enter again Test, obtained No abnormalities were found.

[0127] (2-3) Generating standard queries

[0128] Through format mapping functions Generate structured queries:

[0129]

[0130] Step (3): Knowledge Retrieval

[0131] In the enterprise maintenance knowledge base Search in Chinese:

[0132]

[0133] in:

[0134] Excerpt from "Common Troubleshooting Manual for Centrifugal Pumps_V3.pdf" (including corresponding measures for "abnormal noise and flow rate reduction")

[0135] Device file for PUMP-2024 (Model: Grundfos CRN32-3, Last maintenance: 2025-11-15)

[0136] Step (4): Knowledge generation (unconstrained internal knowledge extraction)

[0137] Calling the large language model to generate internal knowledge:

[0138] "If the PUMP-2024 experiences starting difficulties in winter, it may be due to aging seals or moisture in the motor. We recommend disconnecting the power and checking first..."

[0139] Step (5): Knowledge Anomaly Detection and Correction

[0140] (5-1) Knowledge Anomaly Detection

[0141] Will , , enter ,have to:

[0142]

[0143] Factual error: 1. "Difficulty in starting up in winter" was not included. The text mentions that Shanghai's average temperature in December is above 5°C, which is not a typical "winter malfunction."

[0144] Missing information: 1 (Specific manual steps were not cited, such as "check if the impeller is blocked")

[0145] (5-2) Knowledge Correction and Completion

[0146] Call ,implement:

[0147] From a factual perspective, based on Replace with: "According to the Centrifugal Pump Manual, if abnormal noise and a decrease in flow occur during pump operation, the first thing to check is whether the inlet filter is clogged..."

[0148] Add missing step: "Referring to section 4.2 of the PUMP-2024 standard procedure, the coupling must be disassembled using a torque wrench after power is off..."

[0149] Generate corrected knowledge:

[0150] "According to the 'Handbook for Troubleshooting Common Centrifugal Pumps,' PUMP-2024 experienced a decrease in flow rate on December 21, 2025. The first thing to check is..."

[0151] Retest ,pass.

[0152] (5-3) Generate the final answer

[0153] Call the answer generation module:

[0154] "Hello! Regarding the PUMP-2024 pump you have located in Zhangjiang Park, which experienced a problem on December 21, 2025..."

[0155] This embodiment fully demonstrates the process from fuzzy user input. Starting from the initial step, the entire process—from spatiotemporal context extraction → prompt word anomaly detection and closed-loop correction → standard question generation → retrieval enhancement + internal knowledge generation → knowledge anomaly detection and correction → finally outputting a safe and reliable answer—demonstrates the technical advantages of this invention in improving the accuracy, robustness, and security of question answering.

Claims

1. A knowledge-based question-answering method and apparatus that integrates data completion and spatiotemporal anomaly perception, characterized in that, Includes the following steps: (1) Spatiotemporal context extraction: Extract spatiotemporal and semantic context information from user input text or task execution scenario to construct a unified context representation. Assume the user input is a text sequence: By employing Named Entity Recognition (NER), Time Parsing, and Geo Parsing, contextual feature vectors are extracted. in: Indicates the time context (timestamp, time range, time zone); Indicates spatial context (geographic location, regional hierarchy); Represents semantic context (topic, domain label, task type); (2) Prompt word anomaly detection, based on the spatiotemporal context of the initial prompt word Anomaly detection is performed to determine if there are any abnormalities such as grammatical errors, logical contradictions, sensitive content, or semantic incompleteness. If any abnormalities are found, the prompt word correction and completion operations are performed repeatedly until optimized prompt words without abnormalities are generated. Based on this, a standard query problem is constructed. ; (3) Knowledge retrieval, based on query questions In the knowledge base Search for relevant knowledge fragments in the middle ,in ; (4) Knowledge generation, without relying on retrieved knowledge and spatiotemporal context In this case, based on the query question Generate relevant knowledge to fully extract, without constraints, the relevant knowledge missing in the knowledge base obtained from large-scale pre-training within the large model: in To generate the model, a pre-trained large language model can be used; (5) Knowledge anomaly detection, for the generated knowledge content Anomaly detection is performed. If anomalies are found, knowledge correction and completion operations are repeated to generate anomaly-free knowledge content. Based on the knowledge content without anomalies, a final answer is generated and output. .

2. The method according to claim 1, characterized in that, The specific process of step (2) is as follows: (2-1) Prompt word anomaly detection: Detects the initial prompt word entered by the user. Perform multidimensional anomaly detection. Construct anomaly determination function: in: This is a prompt word anomaly detection model; output , indicating in The detection results for various anomaly types. Anomaly types include at least: grammatical or semantic errors: the prompt words contain spelling errors, syntactic confusion, misuse of parts of speech, or semantic incoherence, making it difficult to interpret the intent; spatiotemporal inconsistency: the time, place, event, and other elements mentioned in the prompt words conflict with the spatiotemporal context extracted in step (1) (e.g., the user is in "Beijing 2025" but asks "the weather in New York yesterday", and "yesterday" does not specify the time zone or date); logical contradictions or factual deviations: the prompt words contain self-contradictory premises, assumptions that obviously violate common sense, or statements that are inconsistent with known facts (e.g., "please explain how to generate electricity with a perpetual motion machine"); sensitive or inappropriate content: the prompt words contain discriminatory, offensive, illegal, or content security policy-violating statements involving gender, race, religion, politics, etc.; missing information or ambiguous intent: key query elements (e.g., subject, time range, geographical limitation, task objective) are missing, making it impossible to accurately retrieve or generate a valid answer. If the following conditions are met: If the error message is found to be abnormal, proceed to step (2-2); otherwise, proceed to step (2-3). The anomaly detection is achieved by training a neural network NN1. NN1 can be a pre-trained large language model, recurrent neural network, multilayer perceptron, or other machine learning classification model or deep learning architecture suitable for text anomaly detection tasks. (2-2) Prompt word correction and completion: Targeted corrections are made to detected anomalies, and a new round of prompt words is generated. in: This is a prompt word correction and completion model. Its functions include: grammatical or semantic error correction: using a language model to automatically correct prompt words, reconstruct sentences, or clarify semantics to improve parsability; spatiotemporal inconsistency correction: based on the spatiotemporal context of step (1), automatically infer and complete missing timestamps, geographical locations, or event backgrounds to align prompt words with the current scene; logical contradiction or factual deviation correction: identifying unreasonable premises and making them responsive through gentle guidance or hypothesis correction (such as replacing "perpetual motion machine" with "high-efficiency energy device"), or marking them as unresponsive requests; sensitive or inappropriate content correction: activating content security mechanisms to block or replace illegal words and generate compliant, neutral, equivalent prompts; information gap completion: combining dialogue history, user profiles, domain knowledge bases, or contextual reasoning to supplement missing key query elements (such as adding reasonable assumptions such as "current city" or "last week") to clarify user intent. The prompt word correction and completion is implemented through fine-tuning the neural network NN2, which can be a pre-trained large language model, recurrent neural network, multilayer perceptron, or other machine learning classification model or deep learning architecture suitable for prompt word correction and completion tasks. After the correction is completed, return to step (2-1) for closed-loop verification until the generated prompt word passes the anomaly detection or the maximum number of iterations threshold is reached. ; (2-3) Based on the problem of generating no abnormal prompt words, generate the corrected and completed no abnormal prompt words. According to the input specifications of the target question-answering system, convert the questions into standard query questions in structured or natural language form. This is used for subsequent knowledge retrieval and answer generation. This is a formatted mapping function used to generate natural language or structured queries adapted to the knowledge retrieval module.

3. The method according to claim 2, characterized in that, In step (2), the prompt word anomaly detection model NN1 and the prompt word correction model NN2 are jointly trained. Before training, a training sample set needs to be constructed: in: These are the original prompt words; For the corresponding spatiotemporal and semantic context; Manually or automatically labeled vectors for alert word anomaly types; To and Corresponding no abnormal target prompt words; NN1 aims to identify anomaly types, and its loss function is defined as multi-label binary classification loss: in: For NN1, the first pair of pairs ... Prediction results for anomalies; The binary cross-entropy loss function is calculated as follows: ; The prompt word correction and completion model NN2 aims to generate abnormal prompt words. Its generation loss is measured using sequence-level negative log-likelihood loss, which constrains the consistency between the model output and the target abnormal prompt words at the word level. The loss is defined as follows: in: The message indicating that the target has no abnormalities is in the first... The real word element at each position; This indicates the historical generated lexical units preceding this position; This represents the conditional probability distribution output by NN2; by minimizing the generation loss, NN2 learns gradually during training to generate outputs consistent with the target non-abnormal prompts in terms of grammatical structure, semantic expression, and information completeness, given the original prompts and contextual constraints, thereby improving the accuracy and stability of prompt correction and completion. Furthermore, to ensure that the prompts corrected by NN2 can pass the judgment of the anomaly detection model NN1 at both the semantic and security levels, this invention introduces an anomaly consistency constraint loss to explicitly suppress anomalous features still present in the correction results. This loss is defined as follows: in: Indicates the total number of preset exception types; Indicates the first After the prompt words, corrected by NN2, are re-entered into the anomaly detection model NN1, in the first... The detection results are based on the anomaly dimension. By minimizing the anomaly consistency constraint loss, the model penalizes correction results that are still judged as anomalies during parameter updates, thereby guiding NN2 to prioritize generating cue word outputs that can be judged as "no anomaly" by the anomaly detection model, achieving collaborative consistency optimization between cue word anomaly detection and correction. The joint optimization objective function of NN1 and NN2 is defined as: in This is a weighting coefficient used to balance the accuracy of anomaly detection with the quality of the corrected generation.

4. The method according to claim 1, characterized in that, The specific process of step (5) is as follows: (5-1) Knowledge anomaly detection: For the generated knowledge content Perform anomaly detection: in: For knowledge anomaly detection model; Indicates in The detection results for knowledge anomalies. Anomaly types include: factual errors: the knowledge content contains statements that contradict the authoritative knowledge sources, common sense, or retrieval evidence output in step (3); spatiotemporal inconsistencies: the time, place, events, and other elements in the knowledge content conflict with the spatiotemporal context extracted in step (1) (e.g., "historical events that occurred in 2025" are described as "occurred in 2020"); logical conflicts or internal inconsistencies: there are contradictory inferences, conclusions, or attribute descriptions in the same knowledge content; bias or inappropriate expressions: the content contains discriminatory, inflammatory, or compliance-violating content in sensitive areas such as gender, race, region, and politics; missing or incomplete information: key facts, causal chains, or necessary conditions are not covered, resulting in incomplete answers or misleading users. If: Then proceed to step (5-2); otherwise proceed to step (5-3). The anomaly detection is achieved through a trained neural network model NN3, which is a machine learning model or deep learning architecture suitable for the task of assessing the credibility and consistency of knowledge content, including but not limited to pre-trained large language models, discriminative Transformers, graph neural networks, multi-task classification networks or combinations thereof. (5-2) For the detected anomaly types, perform corresponding correction and completion operations: , in This is a knowledge correction and completion model. Specific calculations include: factual error correction: calling external authoritative knowledge sources (such as Wikipedia, professional databases, or knowledge graphs) to perform fact verification and replacing erroneous statements with verified correct information; spatiotemporal inconsistency correction: based on the spatiotemporal context constraints of step (1), automatically correcting timestamps, geographical locations, or event sequences in the knowledge content to ensure spatiotemporal alignment; logical conflict correction: using logical reasoning modules or consistency constraint solvers to reconstruct knowledge representations and eliminate internal contradictions; bias or inappropriate expression correction: activating a content security filtering mechanism to replace sensitive or illegal expressions with neutral, objective, and compliant equivalent expressions; information gap completion: based on search results and contextual intent, the generation model supplements missing key facts, background information, or limiting conditions to improve the completeness of the answer. The knowledge correction and completion process is executed by a fine-tuned neural network model NN4. NN4 is a generative model suitable for knowledge editing, controllable text generation, or retrieval enhancement and correction tasks, including but not limited to large language models with fine-tuned instructions, sequence-to-sequence architectures, retrieval-generation joint models, or reinforcement learning-based correction agents. NN4 can dynamically access external tools (such as APIs and knowledge graph query interfaces) to achieve fact anchoring. After the correction is completed, the process returns to step (5-1) for closed-loop verification until the generated knowledge content passes anomaly detection or reaches the maximum iteration threshold. (5-3) Generate answers based on knowledge without anomalies, including knowledge content that has passed anomaly detection. Input the answer to the answer generation module to get the final answer: .

5. The method according to claim 4, characterized in that, In step (5), the knowledge anomaly detection model NN3 and the knowledge correction model NN4 are jointly trained. Before training, a training sample set needs to be constructed: in: This refers to the initially generated knowledge content; For the corresponding search knowledge fragments; Label knowledge anomaly types; This refers to target knowledge content that has been manually or rule-based verified and is free of anomalies. The training objective of NN3 is to judge the credibility and consistency of the generated knowledge, and its loss function is defined as: NN4 aims to generate non-anomaly-free knowledge content, and its generation loss is defined as: .in, This indicates that the target has no abnormal knowledge content in the first place. The real word element at each position; This indicates a historical knowledge term preceding this position. This represents the conditional probability distribution output by the knowledge revision and completion model NN4. To ensure that the revised knowledge content passes anomaly detection and remains consistent with the retrieved evidence, anomaly consistency constraint loss is introduced: And the loss of fact alignment: ,in Here, is a semantic similarity function used to measure the consistency between generated knowledge and retrieved evidence. The joint optimization objective function of NN3 and NN4 is defined as: in These are the weighting coefficients.

Citation Information

Cited By

  • Method for financial text generation error correction based on MRAG and ACD

    CN122242781A