Open knowledge question-answering method and system based on generative artificial intelligence

By loading educational metadata and dynamically adjusting LoRA weights, the adaptability of the educational question-and-answer system to different textbook versions is solved, ensuring the accuracy and security of the answers, and achieving efficient adaptation to multiple textbook versions and generation that conforms to teaching standards.

CN122021932APending Publication Date: 2026-05-12BEIJING YIJIAO LANTIAN TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610328338.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-18
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing educational question-and-answer systems struggle to cover the diverse local textbooks used across the country, leading to inconsistent responses that affect the continuity and accuracy of learning. Furthermore, general-purpose language models are prone to introducing inappropriate knowledge points, resulting in low rationality of generated content.

Method used

By loading structured educational metadata, including a list of prohibited concepts, a cognitive difficulty mapping table, and a graph element whitelist, dynamically or pre-set LoRA weights are adjusted in the large language model. Combined with security checks and semantic retrieval, answers that conform to specific textbook versions are generated.

Benefits of technology

It improves the professionalism and adaptability of educational responses, ensures that responses conform to teaching standards, enhances adaptability to different textbook versions, improves the accuracy and security of responses, and avoids the generation of unreasonable content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122021932A_ABST
    Figure CN122021932A_ABST
Patent Text Reader

Abstract

The invention provides an open knowledge question answering method and system based on generative artificial intelligence, and relates to the technical field of electric digital data processing. The method comprises the following steps: S1, loading structured education metadata according to a textbook version selected by a user; s2, if the textbook version does not belong to the mainstream textbook version set, dynamically synthesizing a reasoning weight based on the textbook directory vector by using a LoRA router, and injecting the reasoning weight into the large language model, otherwise, directly loading a preset LoRA weight corresponding to the mainstream textbook version, and injecting the preset LoRA weight as the reasoning weight into the large language model; and S3, generating an initial answer input for the user based on the retrieved knowledge fragment by using the large language model with the injected reasoning weight, performing safety verification on the initial answer, and outputting a final answer according to a safety verification result. According to the technology provided by the invention, the problem of low rationality of generated contents caused by misalignment of textbook adaptation in open knowledge questions and answers is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic digital data processing technology, and in particular to an open knowledge question-answering method and system based on generative artificial intelligence. Background Technology

[0002] Large Language Models (LLMs) have demonstrated powerful capabilities in natural language understanding and generation tasks. In educational settings, LLM-based knowledge question answering systems are often combined with Retrieval-Augmented Generation (RAG) technology, which helps the model generate more accurate and traceable answers by retrieving relevant information from structured or unstructured knowledge bases.

[0003] For example, Chinese invention patent CN119848223B discloses a question-answering method and system for structured long documents, including: S1, parsing documents of different formats and constructing structured metadata of the documents based on the parsing results; S2, dividing the document into multiple text segments, vectorizing each text segment, and storing them in a dedicated vector database; S3, constructing multiple text content acquisition tools to extract text content from different parts of the document; designing and implementing a vector-based retrieval tool to search for text segments related to the user's query in the vector database; S4, constructing an Agent containing multiple text content acquisition tools and retrieval tools, intelligently selecting the text content acquisition tool or retrieval tool to obtain the relevant text content required by the LLM to answer the question; S5, after obtaining the relevant text content, generating the final answer through LLM analysis of the relevant text content.

[0004] For example, Chinese invention patent application CN120045688A discloses a knowledge base question-answering method, system, and medium based on intent recognition, comprising: receiving user questions; inputting user questions into a large language model trained on intent recognition for preliminary classification; determining the corresponding search strategy based on the classification results obtained from the preliminary classification; if the search strategy is knowledge base search question-answering, selecting a knowledge base matching the search strategy for knowledge retrieval, inputting the retrieved reference knowledge and prompt word templates into the large language model, and having the large language model answer the user questions; if the search strategy is large model direct question-answering, selecting prompt word templates, inputting them into the large language model, and having the large language model answer the user questions.

[0005] Building upon this foundation, and addressing the specific needs of the education field, existing methods typically employ RAG (Relevant Language Aggregator) technology to improve answer accuracy. This involves retrieving relevant knowledge fragments from structured data such as textbook knowledge bases and curriculum standards, and then combining this with a large language model to generate answers, thereby ensuring that the answers align with the subject's teaching logic. Simultaneously, to address the discrepancies in knowledge representation across different textbook versions using a general model, existing techniques also attempt to employ efficient parameter fine-tuning techniques, such as Low-Rank Adaptation (LoRA), to load specific model weights for particular textbook versions.

[0006] Furthermore, to ensure the adaptability of generated responses, some knowledge-based question-answering systems have begun to incorporate developmental psychology theories, such as Piaget's stages of cognitive development, mapping students' age or grade level to levels of abstract thinking ability and adjusting the complexity and expression of response language accordingly. Knowledge graphs and structured curriculum standard data (such as chapters, knowledge points, and prerequisite dependencies) are also used to construct logical constraints for responses to ensure that they align with the teaching schedule.

[0007] The above-mentioned technology has at least the following technical problems: Existing educational question-and-answer systems typically only support mainstream textbook versions (such as the People's Education Press version), making it difficult to cover dozens of locally approved textbooks widely used across the country (such as the Hunan Education Press version, the Shandong Education Press version, etc.). This results in users using locally approved textbooks receiving answers that are inconsistent with the textbooks in terms of knowledge sequence, terminology, or teaching style, affecting the continuity and accuracy of learning.

[0008] Furthermore, when answering basic questions, the general language model tends to introduce knowledge points that exceed the national curriculum standards or use professional terms that are not present in the current teaching progress, causing confusion among students. In open-ended knowledge questions, the generated content has low rationality due to inaccurate textbook adaptation. Summary of the Invention

[0009] In view of this, embodiments of the present invention provide an open knowledge question answering method and system based on generative artificial intelligence, which can improve the rationality of generated content in open knowledge question answering.

[0010] The technical solution of this invention is implemented as follows: This invention provides an open knowledge question answering method based on generative artificial intelligence. The method includes: S1, obtaining the original user question input, and loading structured educational metadata according to the textbook version selected by the user. The educational metadata includes a list of prohibited concepts, a cognitive difficulty mapping table, and a graph element whitelist. The list of prohibited concepts includes prohibited concept keywords, applicable textbook identifiers, and applicable grade ranges. The cognitive difficulty mapping table includes a predefined correspondence between textbook versions, grades, and cognitive difficulty levels. S2, determining a model adaptation strategy based on the textbook version. If the textbook version does not belong to the mainstream textbook version set, the LoRA router is used to dynamically synthesize the inference weights of the large language model based on the textbook directory vector, and the inference weights are injected into the large language model. If the textbook version belongs to the mainstream textbook version set, the preset LoRA weights corresponding to the mainstream textbook version are directly loaded, and the preset LoRA weights are injected into the large language model as inference weights. S3, using the large language model with injected inference weights, generating an initial answer for the user input based on the retrieved knowledge fragments, performing security verification on the initial answer, and outputting the final answer based on the security verification result. The security verification includes scanning the list of prohibited concepts using an AC automaton and performing whitelist verification on the drawing instructions contained in the initial answer.

[0011] This application also provides an open knowledge question answering system based on generative artificial intelligence. This system applies methods such as those based on generative artificial intelligence. The system includes: an input processing module for acquiring the original user question and loading structured educational metadata based on the user-selected textbook version. The educational metadata includes a list of prohibited concepts, a cognitive difficulty mapping table, and a primitive whitelist. The list of prohibited concepts includes prohibited concept keywords, applicable textbook identifiers, and applicable grade ranges. The cognitive difficulty mapping table includes a predefined correspondence between textbook versions, grades, and cognitive difficulty levels. A textbook dynamic adaptation module is used to determine a model adaptation strategy based on the textbook version. If the textbook version is not a mainstream textbook... The version set utilizes LoRA routers to dynamically synthesize inference weights for the large language model based on textbook directory vectors, and injects these inference weights into the large language model. If the textbook version belongs to the mainstream textbook version set, the preset LoRA weights corresponding to the mainstream textbook version are directly loaded and injected into the large language model as inference weights. The answer generation and review module uses the large language model with injected inference weights to generate an initial answer for the user input based on the retrieved knowledge fragments, performs security verification on the initial answer, and outputs the final answer based on the security verification results. The security verification includes scanning with an AC automaton to prohibit the introduction of concept lists and performing whitelist verification on the drawing instructions contained in the initial answer.

[0012] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: 1. By loading structured educational metadata, this invention provides rich constraints and normative information for subsequent large language model-generated answers. Existing technologies do not comprehensively consider specific metadata in the education field, such as prohibiting the introduction of concept lists, cognitive difficulty mapping tables, and graph element whitelists. This invention can precisely control the content difficulty and security of the answers, avoiding the generation of content that does not conform to teaching norms, and improving the professionalism and relevance of educational answers. Then, it flexibly selects model adaptation strategies according to textbook versions. For textbook versions not in the mainstream textbook version set, dynamically synthesizing inference weights allows the model to better adapt to its unique content and structure. For textbook versions in the mainstream textbook version set, directly loading preset weights improves the efficiency of model adaptation and enhances the model's adaptability to different textbook versions, providing more accurate answers that fit the textbook content. Compared with existing technologies, it has wider applicability and better performance. Finally, the large language model with injected inference weights generates initial answers, and the retrieved knowledge fragments ensure the accuracy and richness of the answers. The security verification process uses AC automata to scan the prohibited concept and drawing instruction whitelist, effectively filtering unreasonable content, improving the quality and security of the answers, and ensuring that the final output answers conform to teaching norms.

[0013] 2. By transforming unstructured textbook catalog text into structured vector representations, the knowledge structure style of textbook versions is quantified, enabling the model to understand the differences and characteristics between different textbook versions. Then, by calculating the similarity between the catalog description vector and the target description vector of mainstream textbook versions, the similarity between textbook versions not belonging to the mainstream textbook version set and each mainstream textbook version can be accurately measured. Next, the LoRA weights corresponding to the mainstream textbook version set are weighted and summed according to the similarity. The resulting synthetic weights can integrate the advantages of multiple mainstream textbook versions and adapt to the knowledge structure style of textbook versions not belonging to the mainstream textbook version set. Finally, the synthetic weights are injected into the attention layer of the large language model as inference weights to adjust the output distribution of the model, making the model generate text more in line with the requirements of specific textbook versions, enhancing the relevance and accuracy of the generated text, and improving the quality and practicality of the generated text. Compared with the prior art, this invention can better adapt to various non-mainstream textbook versions.

[0014] 3. By comparing the difficulty level index and its upper limit, unsuitable knowledge fragments are filtered out. The semantic relevance of candidate knowledge fragments to the user's question is determined, and knowledge fragments irrelevant to the original user question are further filtered out. Compared with existing technologies that only select knowledge fragments from a semantic relevance perspective, this method can select knowledge fragments that are both closely related to the user's question and in line with the user's comprehension level. Then, by setting a quantity limit, retrieval deadlock situations are detected in a timely manner, and a retrieval retry process is initiated to avoid directly generating low-quality answers, ensuring the reliability and effectiveness of the answers. Finally, the original user question is rewritten using a large language model to solve the problem that it is difficult to find matching knowledge in the knowledge base due to the user's question being too academic or complex, thereby improving the retrieval success rate and obtaining more suitable knowledge fragments. If the retrieval deadlock is not resolved after re-retrieval and filtering, a dependency missing degradation mode is entered, using a general knowledge base to provide answers, avoiding situations where the user's question cannot be answered. At the same time, the source of the answer is informed to the user through prompts. Compared with existing technologies that directly return no results or simple prompts when the retrieval fails, this method improves the ability to cope with retrieval difficulties and knowledge missing situations. Attached Figure Description

[0015] Figure 1 This is a flowchart of an open knowledge question answering method based on generative artificial intelligence provided in an embodiment of the present invention; Figure 2 This is a flowchart of determining the model adaptation strategy based on the textbook version provided in an embodiment of the present invention; Figure 3 This is a flowchart of the two-layer screening of candidate knowledge fragments provided in the embodiments of the present invention; Figure 4 This is a flowchart of the retrieval retry process provided in the embodiments of the present invention; Figure 5 This is a comparison chart of the correct trigger rates of different pre-trained models provided in the embodiments of the present invention; Figure 6 This is a comparison chart of inference times for different pre-trained models provided in this embodiment of the invention. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0018] This invention provides an open-ended knowledge question-answering method based on generative artificial intelligence. For example... Figure 1 The flowchart shown is for an open-ended knowledge question answering method based on generative artificial intelligence. The processing flow of this method may include the following steps: S1: Obtain the original user question, which is the initial text directly entered into the question-and-answer system by the user without any modification or processing, such as "Please explain what a molecule is?". Based on the textbook version selected by the user, load the corresponding structured educational metadata from the database. The educational metadata includes a list of prohibited concepts, a cognitive difficulty mapping table, and a whitelist of graphical elements. The list of prohibited concepts includes prohibited concept keywords, applicable textbook identifiers, and applicable grade ranges. For example, {"keyword":"isotope","textbook_id":"renjiao_edu","grade_range":"7-9"} indicates that isotopes are prohibited in the People's Education Press junior high school textbook. Prohibited concept keywords are words that are predefined as prohibited and should not appear in answers in specific educational scenarios. Keywords or phrases are usually related to knowledge points beyond the current teaching syllabus; for example, isotopes are prohibited keywords. Applicable textbook identifiers are used to uniquely identify and distinguish different textbook versions; for example, renjiao_edu indicates the People's Education Press version. The cognitive difficulty mapping table is a predefined list containing a series of keywords that are not allowed to appear in the answer, including the predefined correspondence between textbook version, grade, and cognitive difficulty level, used to control the difficulty of the answer. The graph element whitelist is a set of graphing instructions that define the types of graphs allowed to be called in the large language model answer and their corresponding parameter constraints, including but not limited to line graphs, bar graphs, triangles, and leaf graphs. The parameter constraints specify the data type of the parameter (such as integers, strings, etc.), the value range (such as color values ​​0-255), and the list of enumerated values ​​(such as colors can only be specific values ​​such as red, green, and blue). By loading educational metadata corresponding to the textbook version, it is possible to ensure that the answers generated by the large language model conform to the teaching norms and requirements of the specific textbook, avoiding information that conflicts with or is irrelevant to the textbook content; the cognitive difficulty mapping table can set appropriate cognitive difficulty levels for the answers according to the textbook version and grade, making the answers more in line with the students' cognitive level and improving learning outcomes; the graph element whitelist clarifies the allowed drawing types and parameter constraints, preventing the generation of illegal or unexecutable drawing instructions, and ensuring that the drawing content in the answers is accurate and usable.

[0019] like Figure 2The flowchart shown illustrates the process of determining the model adaptation strategy based on textbook versions. S2 involves determining the model adaptation strategy based on textbook versions. A pre-defined list of mainstream textbook versions is used; for example, the top 5 textbook versions by annual student usage can be defined as mainstream textbook versions. This list includes the textbook version and its corresponding identifier. The identifier corresponding to the textbook version input by the user is matched against the identifier in the pre-stored list of mainstream textbook versions. If a match is found, the textbook version belongs to the mainstream textbook version set; otherwise, it is determined not to belong to the mainstream textbook version set. If the textbook version does not belong to the mainstream textbook version set, the LoRA router dynamically synthesizes inference weights suitable for that textbook version based on the textbook directory vector and injects the synthesized inference weights into the large language model. If the textbook version belongs to the mainstream textbook version set, the pre-set LoRA weights corresponding to the mainstream textbook version are directly loaded and injected into the large language model as inference weights. LoRA adapts to new tasks by adding a low-rank matrix to the original model weights, eliminating the need to retrain the entire model. This significantly reduces the number of training parameters and computational cost while maintaining better performance. The LoRA router is an intelligent decision-making module that determines and selects the synthesized weights based on the textbook directory vector. For non-mainstream textbook versions, dynamic synthetic inference weights enable the large language model to quickly adapt to its unique knowledge structure and expression. For mainstream textbook versions, directly loading preset weights improves the efficiency of the large language model's adaptation, ensuring that the large language model can provide high-quality answers under different textbook versions. The application of LoRA technology avoids retraining the entire large language model, reduces the consumption of computing resources and time, and enables the model to adapt to multiple textbook versions more efficiently.

[0020] The process involves directly loading preset LoRA weights corresponding to mainstream textbook versions and injecting them as inference weights into the large language model. The specific steps are as follows: First, pre-train and save the corresponding LoRA weight files (usually binary files) for each mainstream textbook version. Then, associate and store the LoRA weight files for each mainstream textbook version with the textbook version identifier. For example, establish a mapping relationship in the database. Finally, based on the textbook version identifier input by the user, find the corresponding LoRA weight file path in the database, call the loading function of the model framework (such as Hugging Face's Peft library or a native framework API), load the found LoRA weight file into memory, and inject the preset LoRA weights as inference weights into the large language model.

[0021] Specifically, the LoRA router is used to dynamically synthesize inference weights for a large language model based on the textbook catalog vector, including: This study collects the table of contents texts of textbook versions not belonging to the mainstream textbook version set. Feature extraction methods, such as word embedding and the BERT model, are used to process the table of contents text, converting words or sub-words into numerical vectors. Through encoding operations, such as average pooling, max pooling, or using recurrent neural networks and convolutional neural networks, the extracted features are integrated and compressed to obtain table of contents description vectors that quantify the knowledge structure style of the textbook version. This transforms the knowledge structure, topic distribution, and other information contained in the table of contents text into numerical form, used to quantify the knowledge structure style of textbook versions not belonging to the mainstream textbook version set. Converting unstructured textbook table of contents text into structured vector representations facilitates subsequent computer processing and analysis. Quantifying the knowledge structure style of textbook versions provides foundational data for subsequent similarity calculations and weight synthesis, enabling large language models to understand the differences and characteristics between different textbook versions.

[0022] The directory description vector is input into a pre-trained LoRA router. The LoRA router internally stores the target description vector corresponding to each version in the set of mainstream textbook versions. The cosine similarity between the directory description vector of the textbook version input by the user and the corresponding target description vector in the pre-set set of mainstream textbook versions is calculated, thereby accurately measuring the similarity between non-mainstream textbook versions and each mainstream textbook version. The target description vector is a representative vector pre-calculated for each version in the set of mainstream textbook versions, which summarizes the core features and knowledge structure of the mainstream textbook version and serves as the benchmark for similarity calculation with the directory description vector.

[0023] The LoRA router is trained using a large number of table of contents description vectors from mainstream textbook versions as input. These vectors are obtained by feature extraction from the table of contents text of mainstream textbooks (e.g., encoding using models such as BERT). The labels of the training data are the corresponding pre-trained LoRA weights for each mainstream textbook version. A lightweight neural network, such as a multilayer perceptron, is selected as the LoRA router. The mean squared error is usually used as the loss function, and the goal is to make the synthetic weights predicted by the router as close as possible to the true target LoRA weights.

[0024] The obtained similarity scores are input into the Softmax function to obtain normalized weights. The Softmax function transforms the similarity scores into a probability distribution; versions with higher similarity scores have higher weights. The normalized weights are then weighted and summed with the LoRA weights corresponding to the set of mainstream textbook versions to generate composite weights. For example, for three mainstream textbook versions, their LoRA weights are W... A W B W CThe similarity scores of the table of contents description vectors for non-mainstream textbooks are 0.8, 0.5, and 0.2, respectively. Therefore, the normalized weights are 0.437, 0.324, and 0.240, and the composite weight is... The LoRA weight set is a set of LoRA weights pre-trained for each mainstream textbook version, reflecting the influence of the knowledge structure of the mainstream textbook version on the large language model. The synthetic weight represents the weight obtained by weighting and summing the LoRA weights of the mainstream textbook versions based on the similarity between the table of contents description vector of the textbook version input by the user and the target description vector of the mainstream textbook version. It integrates the LoRA weight information of multiple mainstream textbook versions to adapt to the knowledge structure style of non-mainstream textbook versions.

[0025] Synthetic weights are injected into the attention layer of the large language model as inference weights. These inference weights adjust the output distribution of the large language model to determine its tendency when generating text. The inference weights represent the synthetic weights injected into the attention layer of the large language model, used to adjust the calculation method of the attention mechanism during model inference. When the large language model generates text through inference, the attention layer calculates attention scores for different positional information based on these inference weights, thereby adjusting the large language model's attention level to the input information. This enhances the relevance and accuracy of the generated text, improves the quality and usability of the generated text, and achieves efficient adaptation to the knowledge structure styles of different textbook versions.

[0026] like Figure 3 The flowchart shown illustrates a two-layer screening process for candidate knowledge fragments. The main process begins with a "question," retrieves candidate knowledge fragments from resources such as textbook knowledge bases and curriculum standards via a "retrieval tool," and then inputs them into a "two-layer screening module" for specific quality control. First, a difficulty prediction layer pre-trained using a large language model quantifies the cognitive complexity (i.e., difficulty level index) of each candidate fragment. If the difficulty level index exceeds a preset upper limit, the fragment is discarded; otherwise, it is temporarily retained. Next, the cosine similarity between the temporarily retained fragment and the original user question is calculated. If the cosine similarity is less than a preset similarity threshold, the fragment is discarded; otherwise, it is ultimately retained. The resulting fragment is the "effective knowledge fragment," which is then fed into an "LLM" module to generate an "answer" that matches educational needs. The candidate knowledge fragment screening status module records the trajectory of each candidate fragment in the two-step screening process ("√ (passed)") and "× (discarded)." The effective knowledge fragment judgment result module outputs the final judgment result. This process adapts to students' cognitive levels in educational scenarios through difficulty screening and matches the knowledge requirements of the question through similarity screening, making it a crucial step in ensuring the suitability and accuracy of the answer.

[0027] S3 utilizes a large language model with injected inference weights to generate initial answers to user inputs based on knowledge fragments retrieved from the knowledge base that are relevant to the user's question. This generates more accurate and richer initial answers. The initial answers undergo security verification, and a final answer that meets the requirements is output based on the verification results. For example, the final answer to "Please explain what a molecule is?" is: "A molecule is the smallest particle that retains the chemical properties of a substance. For example, water is composed of water molecules. There are spaces between molecules, and they are constantly in motion." This improves the quality and security of the answer. Security verification includes scanning the prohibited concept list using an AC automaton and performing whitelist verification on the drawing instructions contained in the initial answer to ensure that the drawing instructions conform to the parameter constraints defined in the primitive whitelist. The AC automaton is a multi-pattern string matching algorithm that combines the ideas of a trie and the KMP algorithm. It can efficiently search for multiple keywords simultaneously in a text and is used in this application to quickly scan whether the initial answer contains keywords from the prohibited concept list.

[0028] Specifically, it generates an initial response to the user's input based on the retrieved knowledge fragments, and then includes: Using word embedding techniques, such as the BERT model, the original user question is concatenated with curriculum standard identifiers to generate a retrieval query vector. This query vector is then used for semantic matching in the knowledge base. Curriculum standard identifiers are symbolic systems that encode or specifically identify core elements such as curriculum objectives, content frameworks, and teaching requirements for a particular subject or educational stage. They can accurately pinpoint relevant content under a specific curriculum standard. For example, the curriculum standard for the second semester of third-grade elementary school mathematics clearly defines the search scope as revolving around the teaching requirements and knowledge points of that stage of mathematics. The inclusion of curriculum standard identifiers allows for more precise targeting of knowledge related to a specific curriculum, avoiding the retrieval of a large amount of irrelevant information and improving search efficiency and accuracy. The generated retrieval query vector carries semantic information from both the user question and the curriculum standard, providing a foundation for subsequent semantic matching in the knowledge base and making the search more aligned with the user's true intent.

[0029] Semantic retrieval using RAG technology in textbook and external knowledge bases yields candidate knowledge fragments. Unlike traditional keyword-based exact matching, semantic retrieval considers the semantics of words, context, and relationships between concepts. It understands the true intent of the user's question and identifies semantically relevant knowledge fragments within the knowledge base, rather than simply matching keywords. Candidate knowledge fragments represent text segments initially selected from textbook and external knowledge bases during the semantic retrieval process that have a cosine similarity greater than a preset cosine similarity to the query vector. By comprehensively utilizing textbook and external knowledge bases, the scope of knowledge acquisition is expanded, enabling the acquisition of more comprehensive and diverse knowledge and improving the effectiveness of answering user questions. Semantic retrieval understands the semantics of user questions, improving the accuracy and relevance of the retrieval.

[0030] Candidate knowledge fragments are analyzed, and based on the characteristics (i.e., difficulty level indicators) of the analyzed candidate knowledge fragments, it is determined whether to discard the corresponding candidate knowledge fragments, and the number of valid knowledge fragments is counted. By analyzing the characteristics of candidate knowledge fragments, unsuitable knowledge fragments can be filtered out to ensure the quality of the knowledge used to generate the final answer. Counting the number of valid knowledge fragments provides a basis for subsequent judgment on whether retrieval deadlock has occurred.

[0031] If the number of valid knowledge fragments is less than the preset limit, it is considered a retrieval deadlock, and a retrieval retry process is triggered; otherwise, the final answer continues to be generated. The limit for the number of valid knowledge fragments is set by the preset personnel based on experience. The retrieval situation is judged based on the number of valid knowledge fragments. When a retrieval deadlock occurs, a retry process is triggered in a timely manner to avoid directly giving inaccurate answers, thereby improving the reliability and stability of the answers generated in open-ended knowledge questions. When the number of valid knowledge fragments is sufficient, the final answer is generated directly, ensuring the efficiency of answer generation.

[0032] Specifically, the process of determining whether to discard a candidate knowledge fragment based on its features obtained from the analysis is as follows: A pre-trained difficulty prediction layer in a large language model is used to predict the difficulty level index of each candidate knowledge segment. The difficulty level index is used to quantify the cognitive complexity of the text segment. Specifically, the difficulty prediction layer outputs the probability distribution of candidate knowledge segments belonging to each preset difficulty level. The sum of the products of the index of each difficulty level and the probability distribution value corresponding to each preset difficulty level is recorded as the difficulty level index of the candidate knowledge segment. The cognitive difficulty mapping table represents a pre-established table or set of rules used to match user attribute information with the corresponding difficulty level. The candidate knowledge segments are input into the difficulty prediction layer, which uses its internal learning mechanism to analyze and process the knowledge segments, and finally outputs a vector. Each element of the vector corresponds to a probability value of a preset difficulty level. These probability values ​​constitute the probability distribution value. The difficulty level index comprehensively reflects the probability distribution of knowledge segments at different difficulty levels and the relative importance of each difficulty level. By using probability distributions, the likelihood of knowledge fragments at different difficulty levels can be comprehensively displayed, providing basic data for subsequent calculation of difficulty level indicators. By introducing the ordinal number of the difficulty level, not only is the probability of a knowledge fragment belonging to each difficulty level considered, but also the relative order and importance between different difficulty levels, which can more accurately reflect the overall difficulty level of the knowledge fragments and facilitate the comparison and ranking of the difficulty of different knowledge fragments.

[0033] The difficulty prediction layer is a new module added on top of the basic large language model. It's an additional output module added after the large language model processes the text, used to predict the difficulty level of the answer. The input to the difficulty prediction layer's training data consists of vector representations of knowledge fragments, obtained by encoding the knowledge fragment text (e.g., using the Transformer layer of an LLM). The labels on the training data for the difficulty prediction layer are the true difficulty level corresponding to each knowledge fragment, such as "easy," "medium," and "hard," which need to be manually labeled. During training, the core parameters of the LLM (such as the weights of the Transformer layer) are frozen, and only the newly added difficulty prediction layer is trained. Specifically, a knowledge fragment is input into the LLM, passing through Embedding and the Transformer layer. Then, the final vector representation of the segment is obtained. This vector representation is input into the fully connected layer of the difficulty prediction layer. The fully connected layer outputs a logits vector (e.g., for 3 levels, output 3 values). The logits vector is converted into a probability distribution through the Softmax activation function, and the sum of the probability values ​​is 1. For example, the output vector [0.2, 0.5, 0.3] represents a probability of 20% for "easy", 50% for "medium", and 30% for "hard". Cross-entropy loss is used to measure the difference between the predicted probability distribution and the true label. Based on the loss value, the weights and biases of the fully connected layer in the difficulty prediction layer are updated only through the backpropagation algorithm.

[0034] Difficulty levels are determined by: acquiring user attribute information from relevant data sources (such as user registration information and learning records); and using a pre-defined cognitive difficulty mapping table to determine a difficulty level that matches the user's attribute information. User attribute information includes basic identity characteristics (such as grade level and textbook version) and cognitive ability characteristics (such as knowledge mastery maps). Users of different grades, using different textbook versions, and with varying levels of knowledge mastery may perceive the same knowledge segment as different levels of difficulty. By acquiring user attribute information and using the cognitive difficulty mapping table to determine a suitable difficulty level for each user, personalized difficulty matching can be achieved, providing users with knowledge content that better suits their learning abilities and needs.

[0035] If the difficulty level index of each candidate knowledge segment exceeds the preset upper limit of the difficulty level index, the candidate knowledge segment is discarded; if the difficulty level index of each candidate knowledge segment does not exceed the preset upper limit of the difficulty level index, the candidate knowledge segment is retained. The upper limit of the difficulty level index is set by the preset personnel based on practical experience, for example, it can be set as the average value of the difficulty level index over a historical period. Filtering based on the preset upper limit of the difficulty level index can ensure that the retained knowledge segments meet the user's needs and ability level in terms of difficulty, making the answers more relevant to the user's actual situation and improving the user's acceptance of the answers.

[0036] For the candidate knowledge fragments retained after difficulty screening, the cosine similarity between the original user question and the retained candidate knowledge fragments is calculated. This can accurately measure the semantic similarity between the candidate knowledge fragments and the original user question. If the cosine similarity of each candidate knowledge fragment is less than the preset similarity threshold, the candidate knowledge fragment is discarded. If the cosine similarity is not less than the preset similarity threshold, the candidate knowledge fragment is retained. This can retain the knowledge most relevant to the user question, improve the accuracy and relevance of the answer, and avoid providing irrelevant or weakly relevant information.

[0037] After the above two rounds of screening, the final candidate knowledge fragments that can effectively answer user questions are marked as valid knowledge fragments.

[0038] like Figure 4 The flowchart shown illustrates the retrieval retry process, specifically explaining that triggering the retrieval retry process includes: The system uses a large language model to rewrite the original user questions, identifying overly academic, complex, or unsuitable expressions for the current search difficulty level. These are then rewritten into more accessible and understandable questions that match the current system's difficulty level. This process resolves the issue of search failures caused by overly academic original question expressions, thereby improving the targeting and effectiveness of information retrieval.

[0039] By re-performing semantic retrieval based on user questions that match the current difficulty level, the intent of the question can be understood more accurately. Furthermore, based on the characteristics of the analyzed candidate knowledge fragments, it can be determined whether to discard the corresponding candidate knowledge fragments, thereby further filtering and optimizing the retrieval results and improving the quality of the answers.

[0040] If the retrieval deadlock persists after a re-performation of semantic search and judgment, the system enters a dependency missing degradation mode; otherwise, it continues generating the final answer. The dependency missing degradation mode is a backup mode activated during the normal retrieval process when an accurate answer based on a specific knowledge base cannot be generated due to missing content in the textbook knowledge base. By identifying the retrieval deadlock state, different processing modes can be selected based on the actual situation. When the retrieval process cannot resolve the issue, it promptly enters the dependency missing degradation mode to ensure that the system does not fall into an infinite retrieval loop.

[0041] The dependency-deficit degradation mode works as follows: it calls a large language model to generate the final answer based on a pre-trained general knowledge base, and avoids confusion caused by the answer differing from the expected answer based on the textbook knowledge base. It generates prompts indicating that the final answer originates from general knowledge, thus resolving unanswerable questions due to missing content in the textbook knowledge base. This significantly improves the success rate and accuracy of question answering. Specifically, the drawing instructions contained in the initial response are whitelisted. The specific process includes: The system receives the initial response generated by a large language model and uses preset regular expressions to extract plotting instructions from the response. For example, it identifies Markdown's SVG or Mermaid characters and matches `draw:` or `plot[]`, accurately locating plotting instructions and avoiding misinterpretations of text content. Plotting instructions include plotting type and parameters. For instance, if the initial response is "To demonstrate area calculation, we can use `draw_circle[r=5,color=red]` to represent a circle with a radius of 5," the system can use regular expressions to extract these instructions. Perform a scan to extract "draw_circle[r=5,color=red]", and parse the key-value pairs of the extracted result to obtain the parsed result. The drawing type is circle, and the parameter strings are r=5 and color=red.

[0042] The system checks whether the drawing type and parameters are included in a pre-defined primitive whitelist. If so, it calls the front-end drawing engine (such as a self-developed EduDraw.js or a wrapper around an existing library) to render and output the image according to the drawing instructions. If not, it converts the drawing instructions into corresponding natural language text descriptions. For example, if the original instruction is [DIAGRAM: type="triangle", params={"type": "scalene", "angle": "120°"}], and "scalene" (unequal sides) is not in the whitelist enumeration, the conversion result is "Illustration unavailable. This is a schematic diagram of a normal triangle with an angle of 120°." The text description is then presented to the user through the standard interactive interface of the educational application, and structured content is returned through the standard API. By strictly limiting the executable primitive types and parameter range through the whitelist mechanism, the system effectively prevents the front-end rendering engine from crashing due to abnormal parameters.

[0043] Specifically, the AC automaton is used to scan the prohibited concept list, and the specific process is as follows: If the initial answer contains keywords from the prohibited concept list, it is considered a violation and a regeneration mechanism is triggered. This mechanism promptly identifies non-compliant answers and provides the large language model with an opportunity to correct them, increasing the likelihood of obtaining compliant answers. Otherwise, the answer is considered valid and continues to generate new answers. For compliant answers, the answer is directly approved, avoiding unnecessary regeneration operations.

[0044] The regeneration mechanism is triggered by controlling the large language model to regenerate the answer, and then using the AC automaton to scan and verify the regenerated answer again until the verification passes or the maximum number of retries is reached. The maximum number of retries is a value set by preset personnel based on experience to prevent the regeneration mechanism from looping indefinitely. Through multiple regenerations and verifications, the probability of the answer meeting the requirements is gradually increased.

[0045] If the initial answer still contains keywords from the prohibited concept list after the maximum number of retries has been reached, a preset security message will be output directly, such as "Sorry, I cannot answer this question," and the whitelist verification of drawing instructions contained in the initial answer will be terminated. Drawing instructions refer to commands contained in the answer that are used to instruct drawing operations. By setting the maximum number of retries, the regeneration mechanism is prevented from looping indefinitely, ensuring that the regeneration process can be terminated under certain conditions.

[0046] Specifically, based on the security verification results, the final answer is output, which also includes: The system monitors abnormal events during the question-and-answer process, such as non-compliant user input, response timeouts, and incorrect search results, and categorizes and attributes these abnormal events. It can promptly identify various problems in the question-and-answer system and provide accurate basis for subsequent problem handling by classifying and attributing abnormal events, thereby improving the stability of the open knowledge question-and-answer system.

[0047] The system tracks instances where the same keyword from the prohibited concept list is flagged as a violation in different conversations within a preset number of dialogues. If the same keyword is flagged as a violation in different conversations within a preset number of dialogues, the semantic cluster center vector of the prohibited concept is updated. The update method can employ incremental learning, integrating the vector information of newly appearing violating keywords into the original center vector to better represent the semantic features of the currently prohibited concept. Otherwise, the violation is recorded in a log, and the semantic cluster center vector is not updated. The log can record the keyword, the number of violating conversations, and the content of the violating conversations for subsequent analysis and problem investigation. The semantic cluster center vector of the prohibited concept refers to the core feature vector representing the prohibited concept in a high-dimensional vector space. It is used to expand the scope of semantic interception to intercept semantically similar variant words. For example, if the word "cheating" is prohibited, then variant words with similar semantics, such as "plagiarism" and "fraud," may also be covered by this center vector, thus achieving more comprehensive semantic interception. By continuously updating the center vector, it can adapt to changes in prohibited concepts and the emergence of new variant words, improving the accuracy and comprehensiveness of semantic interception.

[0048] If a retrieval deadlock occurs, it is typically caused by logical issues such as problems with the association of knowledge points or index settings in the textbook. This is categorized as a logical defect in the textbook, and a manual verification work order is generated and pushed to the teacher's end. For example, if the association of knowledge points in the textbook is set incorrectly, the retrieval algorithm may get stuck in an infinite loop or be unable to find a valid retrieval path when searching according to the established logic, thus failing to provide correct search results. The manual verification work order contains relevant information about the retrieval deadlock, such as the search keywords, the specific location where the deadlock occurred, and the current state of the system. The work order is then pushed to the teacher's end, allowing the teacher to verify and modify the knowledge base based on the information in the manual verification work order to resolve the retrieval deadlock problem.

[0049] like Figure 5The comparison chart showing the correct trigger rates of different pre-trained models demonstrates the performance of the Large Language Model (LLM), the lightweight model miniLM, and the ultra-lightweight model tinyBERT on educational resources (People's Education Press junior high school physics textbook, past exam physics questions, and Hunan Education Press junior high school chemistry textbook) and dialogue relationship extraction datasets. The experiment focused on the candidate knowledge fragment selection needs in educational scenarios for subject-specific question answering. The results show that the Large Language Model's correct trigger rate is significantly higher than the two lightweight models across various educational resources. It can more accurately match the difficulty level of subject-specific knowledge fragments and calculate semantic similarity, effectively ensuring the subject-specific adaptability and content accuracy of knowledge selection in educational question answering. Figure 6 The comparison chart showing the inference time of different pre-trained models illustrates the differences in inference time between the Large Language Model (LLM), the lightweight model miniLM, and the ultra-lightweight model tinyBERT on educational resource and dialogue relationship extraction datasets. The experimental results indicate that the inference time of the Large Language Model is slightly longer than that of the two lightweight models, but the difference is within an acceptable range for educational knowledge question-answering scenarios. Considering the priority requirement of accuracy in knowledge selection in educational scenarios, this increased time cost can be compensated for by more accurate knowledge matching. Therefore, the Large Language Model remains the optimal pre-trained model choice for educational knowledge question-answering scenarios.

[0050] This invention provides an open knowledge question-answering system based on generative artificial intelligence, the system comprising: The input processing module is used to obtain the original user questions, ensuring that the system can receive user queries. Based on the textbook version selected by the user, it loads structured educational metadata, enabling the system to process user questions in a targeted manner according to the characteristics and requirements of different textbook versions, thereby improving the accuracy and standardization of the answers. The educational metadata includes a list of prohibited concepts, a cognitive difficulty mapping table, and a whitelist of graphic elements. The list of prohibited concepts includes prohibited concept keywords, applicable textbook identifiers, and applicable grade ranges. The cognitive difficulty mapping table includes a predefined correspondence between textbook versions, grades, and cognitive difficulty levels.

[0051] The textbook dynamic adaptation module determines the model adaptation strategy based on the textbook version, flexibly responding to the needs of different textbook versions and improving the versatility and adaptability of the open knowledge question-answering system. If the textbook version is not part of the mainstream textbook version set, the LoRA router dynamically synthesizes the inference weights of the large language model based on the textbook directory vector and injects the inference weights into the large language model. By dynamically synthesizing the inference weights, the large language model can quickly adapt to the characteristics of non-mainstream textbook versions. If the textbook version belongs to the mainstream textbook version set, the preset LoRA weights corresponding to the mainstream textbook version are directly loaded and injected into the large language model as inference weights. Directly loading the preset LoRA weights improves the efficiency of the large language model adaptation.

[0052] The answer generation and review module utilizes a large language model with injected inference weights to generate initial answers to user input based on retrieved knowledge fragments, improving the relevance and accuracy of the answers. It performs security checks on the initial answers to ensure the security and standardization of the content, and outputs the final answer based on the security check results. Security checks include using an AC automaton to scan for prohibited concept lists and performing whitelist checks on drawing instructions included in the initial answers, achieving accurate, standardized, and secure answers to user questions from different textbook versions.

[0053] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0054] It should be understood that determining B based on A does not mean determining B solely based on A; it also means determining B based on A and / or other information.

[0055] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0056] The above description is only an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An open-ended knowledge question-answering method based on generative artificial intelligence, characterized in that: The method includes: S1, Obtain the original user question input, and load structured educational metadata according to the textbook version selected by the user. The educational metadata includes a list of prohibited concepts, a cognitive difficulty mapping table, and a whitelist of graphic elements. The list of prohibited concepts includes prohibited concept keywords, applicable textbook identifiers, and applicable grade ranges. The cognitive difficulty mapping table includes a predefined correspondence between textbook versions, grades, and cognitive difficulty levels. S2. Determine the model adaptation strategy based on the textbook version. If the textbook version does not belong to the mainstream textbook version set, use the LoRA router to dynamically synthesize the inference weights of the large language model based on the textbook directory vector, and inject the inference weights into the large language model. If the textbook version belongs to the mainstream textbook version set, directly load the preset LoRA weights corresponding to the mainstream textbook version, and inject the preset LoRA weights as inference weights into the large language model. S3 utilizes a large language model with injected inference weights to generate an initial response to the user input based on the retrieved knowledge fragments. The initial response undergoes security verification, and the final response is output based on the security verification results. The security verification includes scanning a list of prohibited concepts using an AC automaton and performing whitelist verification on the drawing instructions contained in the initial response.

2. The open-ended knowledge question-answering method based on generative artificial intelligence as described in claim 1, characterized in that, The method of using LoRA routers to dynamically synthesize inference weights for a large language model based on textbook catalog vectors specifically includes: Feature extraction and encoding are performed on the table of contents text of textbook versions that do not belong to the mainstream textbook version set to obtain the table of contents description vector; The directory description vector is input into a pre-trained LoRA router, and the similarity between the directory description vector of the textbook version input by the user and the corresponding target description vector in the preset set of mainstream textbook versions is calculated. Based on the obtained similarity, the weights in the LoRA weight set corresponding to the set of mainstream textbook versions are weighted and summed to generate composite weights; Synthetic weights are injected into the attention layer of the large language model as inference weights, which are used to adjust the output distribution of the large language model.

3. The open-ended knowledge question-answering method based on generative artificial intelligence as described in claim 1, characterized in that, The process of generating an initial response to user input based on retrieved knowledge fragments further includes: The original user question is concatenated with the curriculum standard identifier to generate a retrieval query vector; Semantic retrieval is performed in the textbook knowledge base and external knowledge bases to obtain candidate knowledge fragments; The candidate knowledge fragments are analyzed, and based on the characteristics of the candidate knowledge fragments obtained from the analysis, it is determined whether to discard the corresponding candidate knowledge fragments, and the number of valid knowledge fragments is counted. If the number of valid knowledge fragments is less than the preset limit, it is determined to be a retrieval deadlock and the retrieval retry process is triggered; otherwise, the final answer is generated.

4. The open-ended knowledge question-answering method based on generative artificial intelligence as described in claim 3, characterized in that, The triggering of the retrieval retry process specifically includes: The original user question is rewritten by calling the large language model to obtain a user question that matches the current difficulty level; Semantic retrieval is performed again based on user questions that match the current difficulty level, and the corresponding candidate knowledge fragments are discarded based on the features of the analyzed candidate knowledge fragments. If the deadlock is not resolved, the system enters the dependency missing degradation mode; otherwise, it continues to generate the final answer. The dependency missing degradation mode specifically involves: calling a large language model to generate a final answer based on a pre-trained general knowledge base, and generating prompt information to indicate that the final answer originates from general knowledge.

5. The open-ended knowledge question answering method based on generative artificial intelligence as described in claim 3, characterized in that, The specific process for determining whether to discard a candidate knowledge fragment based on its features obtained from the analysis is as follows: The difficulty level index of each candidate knowledge segment is predicted by using the pre-trained difficulty prediction layer in the large language model. If the difficulty level index of each candidate knowledge segment is greater than the preset upper limit of the difficulty level index, then the candidate knowledge segment is discarded. If the difficulty level index of each candidate knowledge segment is not greater than the preset upper limit of the difficulty level index, then the candidate knowledge segment is retained. Calculate the cosine similarity between the original user question and the retained candidate knowledge fragments. If the cosine similarity of each candidate knowledge fragment is less than the preset similarity threshold, the candidate knowledge fragment is discarded. If the cosine similarity is not less than the preset similarity threshold, the candidate knowledge fragment is retained. The candidate knowledge fragments that are ultimately retained are recorded as valid knowledge fragments.

6. The open-ended knowledge question-answering method based on generative artificial intelligence as described in claim 5, characterized in that, The difficulty level index of each candidate knowledge fragment is obtained using the following method: The difficulty prediction layer outputs the probability distribution of candidate knowledge fragments belonging to each preset difficulty level; The sum of the products of the serial number of each difficulty level and the probability distribution value corresponding to each preset difficulty level is recorded as the difficulty level index of the candidate knowledge segment. The difficulty level is specifically defined as follows: obtaining user attribute information and determining a difficulty level that matches the user attribute information based on a preset cognitive difficulty mapping table.

7. The open-ended knowledge question answering method based on generative artificial intelligence as described in claim 1, characterized in that, The process of whitelisting the drawing instructions contained in the initial response includes: The drawing instructions in the initial response are extracted using regular expressions. These drawing instructions include the drawing type and parameters. Determine whether both the drawing type and parameters are included in the primitive whitelist; If so, the front-end drawing engine is invoked to render the image according to the drawing instructions; If not, the drawing instructions will be converted into corresponding text descriptions and output.

8. The open-ended knowledge question answering method based on generative artificial intelligence as described in claim 1, characterized in that, The process of using the AC automaton to scan the prohibited concept list is as follows: If the initial answer contains keywords from the prohibited concept list, it is considered a violation and a regeneration mechanism is triggered; otherwise, the verification is considered successful. The triggering regeneration mechanism specifically involves controlling the large language model to regenerate the answer until the verification passes or the maximum number of retries is reached. If the initial response still contains keywords from the prohibited concept list after the maximum number of retries has been reached, a preset security warning will be output directly, and the whitelist verification of the drawing instructions contained in the initial response will be terminated.

9. The open-ended knowledge question-answering method based on generative artificial intelligence as described in claim 1, characterized in that, The process of outputting the final answer based on the security verification result also includes: Monitor abnormal events during the question-and-answer process and classify and attribute these events. If the same keyword in the prohibited concept list is marked as a violation in different conversations a preset number of times, the prohibited concept semantic cluster center vector is updated; otherwise, it is recorded in the log and the prohibited concept semantic cluster center vector is not updated. The prohibited concept semantic cluster center vector is used to expand the scope of semantic interception to intercept semantically similar variant words. If a retrieval deadlock occurs, it will be classified as a logical defect in the teaching materials, and a manual verification work order will be generated and pushed to the teacher's end.

10. An open knowledge question-answering system based on generative artificial intelligence, characterized in that: The system includes: The input processing module is used to obtain the original user question and load structured educational metadata according to the textbook version selected by the user. The educational metadata includes a list of prohibited concepts, a cognitive difficulty mapping table, and a whitelist of graphic elements. The list of prohibited concepts includes prohibited concept keywords, applicable textbook identifiers, and applicable grade ranges. The cognitive difficulty mapping table includes a predefined correspondence between textbook versions, grades, and cognitive difficulty levels. The textbook dynamic adaptation module is used to determine the model adaptation strategy based on the textbook version. If the textbook version does not belong to the mainstream textbook version set, the LoRA router is used to dynamically synthesize the inference weights of the large language model based on the textbook directory vector, and the inference weights are injected into the large language model. If the textbook version belongs to the mainstream textbook version set, the preset LoRA weights corresponding to the mainstream textbook version are directly loaded, and the preset LoRA weights are injected into the large language model as inference weights. The answer generation and review module is used to generate an initial answer to the user input based on the retrieved knowledge fragments using a large language model with injected inference weights, perform security verification on the initial answer, and output the final answer based on the security verification result. The security verification includes scanning the list of prohibited concepts using an AC automaton and performing whitelist verification on the drawing instructions contained in the initial answer.