Question and answer method and system and storage medium
By dynamically combining intelligent components to construct the question-and-answer process, the problem that traditional question-and-answer systems cannot adapt to differentiated needs is solved, a flexible question-and-answer architecture is achieved, and adaptability and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN202511683590.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-17
AI Technical Summary
Traditional question-and-answer systems use fixed functional templates, which cannot dynamically adjust the processing logic according to different query requests, making it difficult to adapt to the differentiated needs of different users.
By receiving user query requests, generating process configuration instructions, dynamically selecting and combining multiple intelligent components, and building customizable workflows, including retrieval, context expansion, and generation components, a flexible question-and-answer architecture can be achieved.
It enhances the adaptability to different business scenarios and complex query requirements, improves the scalability, maintainability and resource utilization efficiency of queries, and ensures the accuracy and completeness of question and answer.
Smart Images

Figure CN121542379A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a question-and-answer method, system, and storage medium. Background Technology
[0002] As enterprises deepen their digital transformation, various industries have accumulated massive amounts of professional domain documents, knowledge bases, and data resources. Search-enhanced generation technology has emerged to meet this need. By combining the advantages of information retrieval and large language models, it constructs a dual-engine architecture of retrieval and generation, aiming to provide users with accurate and reliable knowledge-based question-and-answer services.
[0003] Traditional question-and-answer systems can only provide a few predefined, fixed function templates. The processing flow using fixed function templates cannot dynamically adjust the processing logic according to different query requests, making it difficult to adapt to the differentiated needs of different users for question-and-answer. Summary of the Invention
[0004] The main purpose of this application is to provide a question-and-answer method, system, and storage medium, which aims to solve the technical problem that the processing flow using a fixed functional template cannot dynamically adjust the processing logic according to different query requests and is difficult to adapt to the differentiated needs of different users for question-and-answer.
[0005] To achieve the above objectives, this application proposes a question-and-answer method, which includes: Receive user query requests and generate process configuration instructions based on the query requests; In response to the process configuration instruction, a target component is dynamically selected from a plurality of pre-set intelligent components, and the target components are combined to generate a workflow, wherein the workflow includes the target components in series; The workflow is executed to process the query request, and the question-and-answer results corresponding to the query request are obtained from the workflow.
[0006] In one embodiment, the workflow includes at least a retrieval component, a context expansion component, and a generation component. The step of executing the workflow to process the query request and obtaining the question-and-answer results generated by the workflow corresponding to the query request includes: The retrieval results are obtained by performing a joint retrieval on the query request based on the retrieval component. The context-enhanced component generates a semantic chain based on the search results; The target model is invoked based on the generation component, and the semantic chain is processed based on the target model to generate question-and-answer results.
[0007] In one embodiment, the context-based augmentation component generates a semantic chain based on the retrieval results, including: The context augmentation component is used to obtain parent and / or child content that has a hierarchical relationship with the search results; The semantic chain is constructed based on the parent content and / or the child content, as well as the search results.
[0008] In one embodiment, the step of calling the target model based on the generation component and processing the semantic chain based on the target model to generate question-answering results includes: Select the target model from at least two large language models based on the generative component; The parameters, prompts, and rate limiting strategies of the target model are set according to the user's custom configuration information. The semantic chain is processed based on the configured target model to generate question-and-answer results.
[0009] In one embodiment, the workflow further includes a user question component, and the step of executing the workflow to process the query request and obtaining the question-and-answer results corresponding to the query request generated by the workflow includes: When the query request includes document library domain questions and answers, the step of performing a joint retrieval of the query request based on the retrieval component to obtain retrieval results and subsequent steps are executed. When the query request includes online document Q&A, the intent recognition result is obtained by performing intent recognition on the query request based on the user question processing component. When the task type is determined to be local question answering based on the intent recognition result, the step of performing a joint retrieval of the query request based on the retrieval component to obtain the retrieval result and subsequent steps are executed. When the task type is determined to be global question answering based on the intent recognition result, the generation component calls the model to process the document slices corresponding to the query request, and processes the document slices to generate question answering results.
[0010] In one embodiment, the step of performing a joint retrieval of the query request based on the retrieval component to obtain retrieval results includes: Based on the retrieval component, the query request is subjected to a joint retrieval of at least two types of knowledge bases to obtain a first retrieval sub-result, wherein the knowledge base types include at least question-answer pair knowledge bases and document bases; The query request is subjected to at least two retrieval strategies for collaborative retrieval to obtain a second retrieval sub-result. The retrieval strategies include at least keyword retrieval, vector retrieval, and hybrid retrieval. A third search sub-result is obtained by performing a joint retrieval of multimodal data on the query request, wherein the multimodal data includes text, tables, and images; the search result includes the first search sub-result, the second search sub-result, and the third search sub-result.
[0011] In one embodiment, the step of executing the workflow to process the query request and obtaining the question-and-answer results corresponding to the query request generated by the workflow further includes: Obtain runtime logs and performance metrics; Based on the runtime logs and performance metrics, a dynamic tuning strategy is generated for the target component and / or the workflow.
[0012] In one embodiment, the step of generating process configuration instructions based on the query request includes: The intent of the query request is identified, and the scene features corresponding to the query request are determined. Based on the intent recognition results and the scene characteristics, process configuration instructions corresponding to the workflow are generated.
[0013] In addition, to achieve the above objectives, this application also proposes a question-answering system, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the question-answering method as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the question-and-answer method described above.
[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the question-and-answer method described above.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: By dynamically mapping query requests to customizable workflows, a transformation from a rigid, fixed processing model to a flexible and configurable intelligent question-answering architecture has been achieved. Through the dynamic selection and combination of reusable intelligent components, the adaptability to different business scenarios and complex query requirements has been improved. While ensuring the accuracy and completeness of question answers, the scalability, maintainability, and resource utilization efficiency of queries have been greatly enhanced. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating an embodiment of the question-and-answer method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the question-and-answer method of this application; Figure 3 This is a simplified flowchart illustrating the second embodiment of the question-and-answer method of this application. Figure 4 This is a flowchart illustrating the question-and-answer method of embodiment three of this application; Figure 5 This is a schematic diagram of the structure of the question-answering system provided in Embodiment 3 of the question-answering method of this application; Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the question-and-answer method in the embodiments of this application.
[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0023] The main solution of this application embodiment is: receiving a user's query request, generating a process configuration instruction based on the query request; responding to the process configuration instruction, dynamically selecting a target component from a plurality of pre-set intelligent components, and combining the target components to generate a workflow, the workflow including the target components in series; executing the workflow to process the query request, and obtaining the question and answer results corresponding to the query request generated by the workflow.
[0024] In this embodiment, for ease of description, the following description uses a question-and-answer system as the execution subject.
[0025] Traditional question-and-answer systems can only provide a few predefined, fixed function templates. The processing flow using fixed function templates cannot dynamically adjust the processing logic according to different query requests, making it difficult to adapt to the differentiated needs of different users for question-and-answer.
[0026] This application provides a solution that dynamically maps query requests to customizable workflows, transforming a rigid, fixed processing model into a flexible and configurable intelligent question-answering architecture. By dynamically selecting and combining reusable intelligent components, it enhances the adaptability to different business scenarios and complex query requirements. While ensuring the accuracy and completeness of question-answering, it significantly improves the scalability, maintainability, and resource utilization efficiency of queries.
[0027] It should be noted that the execution entity, the question-and-answer system, in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions. The following description uses a question-and-answer system as an example to illustrate this embodiment and the subsequent embodiments.
[0028] Based on this, the embodiments of this application provide a question-and-answer method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the question-and-answer method of this application.
[0029] In this embodiment, the question-and-answer method includes steps S10 to S30: Step S10: Receive the user's query request and generate process configuration instructions based on the query request.
[0030] Optionally, the query request may include questions or instructions entered by the user in natural language, such as asking for an explanation of the warranty policy for product A, or comparing the core parameters of product B and product C.
[0031] Optionally, the process configuration instructions include the smart components to be invoked; the execution order of the smart components; the initial parameters of each smart component; and the resource context required for execution.
[0032] In an optional embodiment, step S10 includes: performing intent recognition on the query request and determining the scene characteristics corresponding to the query request; and generating process configuration instructions corresponding to the workflow based on the intent recognition result and the scene characteristics.
[0033] Intent identification for query requests can be performed using natural language processing models or intent classification models to analyze user-input queries. These models categorize query requests into one or more predefined intent categories. For example, a query request to summarize the functional features of product A is identified as a document summary intent; a query request asking for the after-sales service phone number is identified as a fact-finding intent; and a query request comparing the advantages and disadvantages of solution A and solution B is identified as a comparative analysis intent. Simultaneously with intent identification, key entities, time, product names, and other elements are extracted from the query request to provide precise anchors for subsequent retrieval.
[0034] Determine the scenario characteristics corresponding to the query request and comprehensively analyze the business environment involved in the query request. Optionally, business scenario identification can involve determining the business area or department to which the query request belongs, such as sales consultation, technical support, or internal regulations inquiry. Optionally, determine the scenario characteristics of the scenario to which the query request belongs. Optionally, in high-security scenarios, such as paid consultations from external clients, high accuracy, low latency, and high stability are required, and the corresponding scenario characteristics are customer service and critical business. In general scenarios, such as routine document inquiries by internal employees, the requirements for response speed and resource assurance are relatively relaxed.
[0035] Based on the intent recognition result, the corresponding workflow configuration instructions are determined. For example, when the intent recognition result is a fact query, it is mapped to a concise workflow: the user question processing component and the retrieval component, which directly return a preset answer without calling the generation model to save computing power. When the intent recognition result is a document summary or complex reasoning, it is mapped to a complete workflow: the user question processing component, the document retrieval component, the ranking component, the context expansion component, and the generation component, ensuring the completeness and logic of the answer.
[0036] The process configuration instructions are determined based on the characteristics of the scenario. In high-security scenarios, resource tags are embedded in the process configuration instructions, instructing the system to allocate a dedicated model instance and a high-performance retrieval cluster for the process during subsequent execution, and to enable a more stringent answer review mechanism. In general scenarios, the instructions instruct the use of a shared, cost-optimized resource pool.
[0037] The process configuration instructions determined by the intent recognition results and the process configuration instructions determined by the scene characteristics are synthesized to generate the final process configuration instructions.
[0038] In one embodiment, the process configuration instruction is determined based on the type of query request. For example, when the query request type is to find a document, the process configuration instruction points to the retrieval service; when the query request type is to generate an answer by integrating knowledge, the process configuration instruction points to the document library domain question-and-answer service; when the query request type is a standard question, the process configuration instruction points to the QA (Question Answering Pair Knowledge Base) question-and-answer service to save computing power.
[0039] To support diverse business scenarios, a multi-tenant architecture is adopted, and independent management of resources, configurations, and permissions is achieved through a tenant isolation mechanism. In optional embodiments, the method is implemented based on a multi-tenant architecture, including: allocating and isolating dedicated computing and storage resources for different tenants; and independently configuring management model parameters, prompts, and search strategies for different tenants. Dedicated model resources are allocated for key business scenarios to ensure response timeliness and service stability; simultaneously, physical isolation of data retrieval is achieved through data storage isolation strategies for high-security and general-purpose scenarios, thereby enhancing data security.
[0040] Step S20: In response to the process configuration instruction, a target component is dynamically selected from a plurality of pre-set intelligent components, and the target components are combined to generate a workflow, wherein the workflow includes the target components in series.
[0041] The intelligent components are standardized, pluggable components, which encapsulate complex AI capabilities into independent, functionally defined intelligent components. Pluggable means that intelligent components connect through standardized interfaces and can be easily replaced, upgraded, or have new components added without affecting the stable operation of the entire system.
[0042] Optionally, the intelligent components include at least a user query processing component, a retrieval component, a ranking component, a context expansion component, a generation component, and an evaluation optimization component, as shown in the table below:
[0043] Core functionalities such as user query processing, retrieval, ranking, context expansion, and model generation are encapsulated into standardized intelligent components. These components are then combined and dynamically integrated on demand through standardized interfaces, building a loosely coupled, highly cohesive modular ecosystem. Each component supports independent deployment, hot upgrades, and elastic scaling, improving system iteration efficiency and technical architecture flexibility. Based on a unified component marketplace, component configuration and setup services are provided, supporting flexible integration by users through standardized interface protocols. Furthermore, it supports providing corresponding setup methods based on user intent and proposes optimization strategy suggestions based on historical data.
[0044] In response to the workflow configuration command, the desired target component is selected from multiple intelligent components. In the domain question-and-answer workflow, the workflow configuration command corresponds to the document library domain question-and-answer service, and the intelligent components in the workflow are, in order: user question processing component, retrieval component, ranking component, context expansion component, and generation component. In the simple retrieval workflow, the workflow configuration command corresponds to the retrieval service, and the intelligent components in the workflow are, in order: user question processing component, retrieval component, and ranking component.
[0045] In an optional embodiment, a pre-set service template library is acquired and displayed on the interactive interface. The service template library contains service templates based on different application scenarios, and the service templates include serialized processes. In response to a process configuration instruction, a target component is dynamically selected from a plurality of pre-set intelligent components, and a workflow is generated based on the service template and the target component.
[0046] Step S30: Execute the workflow to process the query request and obtain the question and answer results corresponding to the query request generated by the workflow.
[0047] The query request is input into the pre-assembled specific workflow. The workflow engine will sequentially call the smart components in each workflow according to a preset order, using the output of the previous smart component as the input of the next smart component to obtain the question-and-answer results corresponding to the query request.
[0048] Optionally, taking domain-specific question answering as an example, the user question processing component optimizes the query request. The retrieval component finds the most relevant knowledge fragments from the knowledge base based on the optimized question. The ranking component scores and sorts these fragments. The context expansion component, based on the sorted results, finds related superior overviews or subordinate details to form a complete and logically coherent contextual document. Finally, the generation component submits this document and the original question to the large language model, instructing it to generate a precise, complete final answer that cites its sources.
[0049] After the workflow is completed, the final question-and-answer results are collected. These results are not merely text generated by the model; they are typically a structured object. Optionally, the results include the final answer, cited knowledge sources, similarity scores for search results, and optimization suggestions from the system. Cited knowledge sources include document titles, page numbers, and excerpts of content, while system optimization suggestions may include adjustments to search strategies.
[0050] In one embodiment, the output question-and-answer results are received through a user interface or an API (Application Programming Interface), and can be selectively displayed or hidden based on requirements. Optionally, the question-and-answer results include search results, domain-specific questions and answers, and online question-and-answer results. Search results include knowledge titles, knowledge fragments, and similarity scores. Domain-specific questions and answers and online question-and-answer results include model-based question-and-answer results and cited knowledge sources.
[0051] Based on historical user data, the system provides optimization strategy suggestions for workflows and allows users to edit workflows and submit optimized configurations according to these suggestions, achieving closed-loop management of the entire workflow through API. This process efficiently adapts to diverse scenario requirements and ensures the stability and accuracy of functional outputs. Simultaneously, it supports resource configuration based on scenario characteristics, avoiding resource waste or insufficiency.
[0052] In the technical solution of this embodiment, by dynamically mapping query requests to customizable workflows, a transformation from a rigid fixed processing mode to a flexible and configurable intelligent question-answering architecture is realized. Through the dynamic selection and serial combination of reusable intelligent components, the adaptability to different business scenarios and complex query requirements is improved. While ensuring the accuracy and completeness of question-answering, the scalability, maintainability and resource utilization efficiency of queries are greatly enhanced.
[0053] Based on the first embodiment of this application, in the second embodiment of this application, the same or similar content as the above embodiment can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S30 includes: Step S31: Perform a joint search on the query request based on the search component to obtain search results; Step S32: Generate a semantic chain based on the search results using the context augmentation component; Step S33: Invoke the target model based on the generation component, and process the semantic chain based on the target model to generate question-and-answer results.
[0054] When the query request includes document library domain questions and answers, proceed to steps S31 to S33.
[0055] Before the retrieval component processes the query, the user query processing component processes the query request. After the retrieval component processes the query, the ranking component sorts the retrieval results, and the sorted retrieval results are input into the context expansion component.
[0056] In one embodiment, the retrieval component does not rely solely on a single search method but can simultaneously employ multiple retrieval strategies. The retrieval component aggregates, deduplicates, and performs preliminary sorting of results from different knowledge sources and retrieval strategies, forming a comprehensive and highly relevant list of search results, avoiding omissions caused by a single strategy. Optionally, the retrieval strategy includes keyword retrieval, used to match key terms in the question, such as terms of service, user account, termination, etc., ensuring the recall of document fragments with precise lexical matches. Optionally, the retrieval strategy includes vector retrieval, used to understand the intent of the entire question at a semantic level, identifying paragraphs that are highly semantically related even if they do not have exactly the same keywords, for example, paragraphs about contract termination conditions.
[0057] In an optional embodiment, step S31 includes: performing a joint search on the query request using the retrieval component on at least two types of knowledge bases to obtain a first retrieval sub-result, wherein the knowledge base types include at least a question-answer pair knowledge base and a document base; performing a collaborative search on the query request using at least two retrieval strategies using the retrieval component to obtain a second retrieval sub-result, wherein the retrieval strategies include at least keyword search, vector search, and hybrid search; performing a joint search on the query request using multimodal data using the retrieval component to obtain a third retrieval sub-result, wherein the multimodal data includes text, tables, and images; and the retrieval results include the first retrieval sub-result, the second retrieval sub-result, and the third retrieval sub-result.
[0058] Joint retrieval of multiple knowledge bases directly addresses the challenge of processing multi-source heterogeneous knowledge resources. Question-answering (QA) knowledge bases store standard questions and pre-set answers, offering high retrieval efficiency and accurate answers. Document databases store unstructured, long documents such as reports and manuals, containing deeper knowledge. Joint retrieval allows information to be retrieved from both knowledge sources simultaneously. For example, for standard questions, accurate answers from the QA database are prioritized; for complex questions requiring reasoning, in-depth content is extracted from the document database, thus avoiding insufficient answer coverage due to a single knowledge base type.
[0059] Multiple retrieval strategies are employed for collaborative searching, and the multi-strategy collaborative mechanism is described. Keyword retrieval, based on precise word matching, ensures the accuracy and interpretability of the retrieved results. Vector retrieval, based on semantic similarity, ensures the retrieval of documents with different expressions but related meanings, improving the recall rate. Hybrid retrieval combines the advantages of the first two methods, first performing separate searches, and then using a unified algorithm such as weighted scoring to fuse and rearrange the results. This addresses the shortcomings of relying on a single retrieval strategy, ensuring that the system can find relevant information using the optimal strategy regardless of whether the user uses keywords or natural language queries, greatly improving the robustness and accuracy of the retrieval.
[0060] This system enables joint retrieval of multimodal data, accurately reflecting support for text, tables, and images, and represents an advanced design for modern knowledge bases. Text processing handles pure textual information. Tables handle structured data, requiring an understanding of row and column relationships and data semantics. Images handle charts, flowcharts, diagrams, etc., requiring a multimodal model to understand image content and map it to a semantic space. This solves the semantic fragmentation problem caused by differences in data types.
[0061] In an optional embodiment, step S32 includes: obtaining parent content and / or child content that has a hierarchical relationship with the search results based on the context expansion component; and constructing a semantic chain based on the parent content and / or child content, and the search results.
[0062] The context expansion component receives search results from the retrieval component. These results are typically fragments of information extracted from a large knowledge base, such as key paragraphs, list items, or data tables. In this case, the information fragments may be isolated, decontextualized, and detached from their original document structure, leading to missing information fragments. The fragments themselves may not fully answer the user's question, lacking necessary background, definitions, or preconditions. The context expansion component analyzes the hierarchical position of each search result fragment within its original document and intelligently expands it accordingly.
[0063] The context expansion component dynamically retrieves parent and child content relevant to the core search results based on the document's hierarchical structure. For example, parent content might be the chapter title and summary of the current paragraph; child content might be a detailed list or examples within the paragraph. The parent content, child content, and search results are then logically assembled into a long, coherent text sequence, serving as a semantic chain.
[0064] Parent content is higher-level, more general content that contains the current search results within the document hierarchy. For example, if the core retrieved fragment is specific content from Chapter 3, Section 2, Item 5, its parent content might include: a direct parent, such as the title and introduction of Chapter 3 and Section 2; and a higher-level parent, such as the chapter title and abstract of Chapter 3. Parent content provides background, scope, and main idea.
[0065] Sub-level content refers to more specific and detailed information contained within the current search results at the document level. For example, regarding Chapter 3, Section 2, Article 5, the sub-level content includes: specific examples provided under that article; charts or data referenced in that article; and exceptions or implementing rules for that article. The sub-level content provides details, evidence, and exceptions.
[0066] After collecting all the relevant text blocks—search results, parent content, and child content—the component is not simply piled up, but rather intelligently and logically reorganized to construct a coherent semantic chain. It typically begins with a general parent content block, setting the context and scope of the discussion. The search results, serving as core arguments or main answers, are embedded in the most relevant positions above the main body. Child content, as supporting material, is precisely appended after the core information being explained and corroborated. The resulting semantic chain is a complete, logically coherent, and self-contained long text context.
[0067] In an optional embodiment, step S33 includes: selecting a target model from at least two large language models based on the generation component; setting the parameters, prompt words, and call rate limiting strategy of the target model according to the user's custom configuration information; and processing the semantic chain based on the set target model to generate question-and-answer results.
[0068] The generation component calls the appropriate target model according to the preset configuration. The generation component submits the query request and semantic chain as part of the prompt words to the target model. For example, if the target model is a large language model, the large language model performs deep understanding and reasoning based on this complete and logically clear context, generating accurate, complete, and source-quotable question-and-answer results, which greatly improves reliability and credibility.
[0069] The generation component does not randomly or fixedly select a model, but rather acts as an intelligent router, dynamically choosing the most suitable target model based on preset strategies. These strategies include business scenario requirements, cost control, load balancing, and functional characteristics. For example, business scenario requirements might lead to the selection of the most powerful high-quality model for generating formal reports with extremely high answer quality; for internal fast queries, a more economical and faster model might be chosen. Cost control involves selecting models based on their call costs to optimize overall operational expenses. Load balancing routes requests to other available instances when a model instance is overloaded, ensuring system stability. Functional characteristics are determined by whether certain tasks require specific model support.
[0070] Optionally, the parameters of the target model include, but are not limited to: temperature, used to control the randomness and creativity of the generated answers. Low temperature ensures stable and predictable answers; high temperature allows for greater diversity. Kernel sampling influences the range of vocabulary selection. Maximum generated length limits the length of the answer. Hint words ensure that the style, format, and content of the generated answers conform to business specifications. The call rate limiting policy is used to configure requests per second, concurrency, and quota management. Requests per second limits the frequency at which a single user or tenant calls the model within a unit of time. Concurrency limits the number of requests processed simultaneously. Quota management sets daily or monthly limits on the total number of calls for different teams or businesses.
[0071] The above solution ensures both controllable generation quality and fair use of system resources, as well as overall service stability, preventing system paralysis caused by excessive requests from a single user.
[0072] The generation component combines the user's custom prompts, the constructed complete semantic chain, and the user's query request into a structured request, which is then sent to the target model. The target model performs deep computation based on all the received information; the semantic chain provides rich, coherent, and clearly derived context. The model ultimately produces an accurate, complete, logically sound answer with supporting citations. This ensures that the final question-and-answer output is not only accurate and reliable but also interpretable, greatly enhancing user trust in the system.
[0073] In the technical solution of this embodiment, the multi-strategy joint retrieval of the retrieval component ensures the retrieval of the most relevant information fragments from multi-source heterogeneous knowledge bases. On this basis, the context expansion component dynamically constructs a complete semantic chain, which effectively solves the problems of incomplete answers and logical gaps caused by isolated retrieval results and broken contextual associations. Finally, the generation component drives the large language model to generate accurate, reliable and well-interpretable answers based on the semantic chain, thereby achieving a synergistic improvement in retrieval accuracy, answer completeness and generation reliability in complex document library question-answering scenarios.
[0074] In an optional embodiment, when the query request includes retrieval, the step of performing a joint retrieval of the query request based on the retrieval component to obtain retrieval results is executed; when the query request includes document library domain question answering, the step of performing a joint retrieval of the query request based on the retrieval component to obtain retrieval results and subsequent steps are executed; when the query request includes online document question answering, the intent recognition result is obtained by performing intent recognition on the query request based on the user question processing component; when the task type is determined to be local question answering based on the intent recognition result, the step of performing a joint retrieval of the query request based on the retrieval component to obtain retrieval results and subsequent steps are executed; when the task type is determined to be global question answering based on the intent recognition result, the document slices corresponding to the query request are processed by calling the model based on the generation component, and the document slices are processed to generate question answering results.
[0075] With numerous components, diverse application scenarios, and varied knowledge base types, intelligent question-answering systems need to ensure efficient output of various functions. This is achieved through two core processes: application function configuration and dynamic service integration, enabling flexible component invocation and dynamic strategy execution. Figure 3 The system demonstrates the call flow, where users select application functions before entering any question. It analyzes user intent and scenario characteristics through models to automatically recommend function configurations. Users can choose function configurations based on suggestions or have the system automatically execute preset processes. Users can dynamically combine various intelligent components based on their configurations to build service flows. The system also includes a built-in library of multiple service templates and supports user-defined editing.
[0076] The search service, as a core capability module of the system, has its functional components detailed in the table below. The search function supports dynamic switching between general-purpose and high-security instance clusters, ensuring differentiated performance and security for internal and customer scenarios.
[0077]
[0078] The document library-based question-answering service generates models based on search results, supporting dynamic answer generation by combining knowledge base content. Users can configure the model invocation strategy. After receiving a natural language question from a user, it first searches for relevant knowledge fragments in the knowledge base by calling the search engine, then constructs a complete semantic chain through a context-based dynamic expansion module, and finally generates an accurate and interpretable answer based on the context.
[0079] QA library domain question answering service supports directly returning preset answers without calling the generation model, and saves computing resources through switch configuration.
[0080] The online document Q&A service integrates intent recognition, information extraction, and answer generation modules to achieve an end-to-end online Q&A process. Users can upload documents and enter questions in real time, and the entire process, from intent recognition and information extraction to Q&A result generation, is automatically completed.
[0081] In the technical solution of this embodiment, by dynamically allocating differentiated processing flows according to the query request type and intent recognition results, the precise scheduling and optimized utilization of retrieval resources and generation computing power are realized. In pure retrieval and document library question answering scenarios, the accuracy of knowledge retrieval and semantic chain integrity are ensured. In online document question answering scenarios, intent-driven precise positioning of local questions and end-to-end efficient generation of global questions are realized, thereby systematically balancing response speed, answer quality and computing cost in complex application environments.
[0082] Based on any embodiment of this application, in the third embodiment of this application, the content that is the same as or similar to the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 4 In addition to step S30, the following are also included: Step S40: Obtain runtime logs and performance metrics; Step S50: Based on the running logs and the performance metrics, generate a dynamic tuning strategy for the target component and / or the workflow.
[0083] Optionally, the runtime log records the entire process of the system processing each user's query request, including events and context information. The runtime log includes request content, workflow path, component-level details, timestamps, etc. The request content includes the original user question and the tenant or user ID (identifier). The workflow path includes the executed intelligent components and their execution order. Component-level details describe the inputs, outputs, internal key decisions, and potential errors or warnings for each intelligent component. Timestamps are the start and end times of each key step. This is achieved through end-to-end tracing technology, generating a unique ID for each request, thereby linking logs scattered across multiple components to form a complete story chain.
[0084] Optionally, performance metrics are quantitative data collected from the system that reflect its health and efficiency. Performance metrics are typically time-varying sequence data. They include system-level metrics, component-level metrics, business-level metrics, and so on. System-level metrics include QPS (Queries Per Second), response latency, error rate, CPU (Central Processing Unit) utilization, memory utilization, GPU (Graphics Processing Unit) utilization, and so on. Component-level metrics include recall rate of retrieval components, ranking relevance of ranking components, and answer quality scores of generation components, and so on. Business-level metrics include user satisfaction feedback, answer acceptance rate, and so on. These metrics are collected, stored, and displayed through monitoring agents and time-series databases. When problems occur, bottlenecks can be quickly located, and when optimization is needed, there is sufficient data to support the analysis.
[0085] Regularly or in real-time analyze the collected runtime logs and performance metrics. Based on the analysis results, the optimization engine automatically generates specific and feasible optimization suggestions. Through end-to-end log analysis, the bottleneck was identified as primarily occurring in the context extension component, due to frequent database queries to retrieve parent or child content.
[0086] Component-level optimization strategies include parameter tuning, algorithm tuning, and model tuning. Parameter tuning addresses the aforementioned bottlenecks by suggesting adding a caching layer to the database queries of the context extension component. Alternatively, it may suggest adjusting the filtering threshold of the retrieval component. Algorithm and model tuning address inaccurate retrieval results by suggesting that the vector model of the current retrieval component is underperforming and recommending an upgrade.
[0087] Workflow-level optimization strategies include process refactoring, resource scheduling recommendations, and policy push and execution. Process refactoring addresses the waste of resources in executing the entire workflow—from retrieval to ranking, context expansion, and generation—for a simple query. It recommends skipping the context expansion component and directly proceeding to the generation stage for queries identified as factual. Resource scheduling recommendations suggest allocating a dedicated GPU instance to tenant A's generation component if a tenant's QPS remains consistently high, thus avoiding impacting the service quality of other tenants. Policy push and execution involves pushing generated policies to operations personnel or tenant administrators via user portals, emails, or internal alerting systems. More advanced systems may even support automated policy execution; for example, automatically triggering a degradation mechanism to temporarily disable non-core functions when high system load is detected.
[0088] In the technical solution of this embodiment, by systematically collecting full-link operation logs and multi-dimensional performance indicators, a deep observability of the system's health status and performance is achieved. Then, based on data-driven analysis, dynamic optimization strategies for intelligent component parameter configuration and workflow structure are automatically generated. Finally, a complete closed loop from monitoring, diagnosis to optimization is built, which reduces the reliance of system operation and maintenance on human experience and continuously improves the response efficiency, answer quality and overall resource utilization efficiency of the question and answer service.
[0089] Reference Figure 5 The method described in the above embodiments is applied to a question-answering system. The question-answering system in this application is constructed with a four-layer technical architecture: an interaction layer, a component layer, a security layer, and an optimization layer. Figure 5 It demonstrates the architecture of the question-and-answer system and the core modules contained in each layer of the architecture.
[0090] The interaction layer serves as the entry point for the system to connect with users and external systems. It is primarily responsible for receiving questions, reading configurations, and scheduling tasks. Within the interaction layer, various functional modules are linked together with different intelligent components to complete corresponding tasks, thereby supporting diverse user needs. These modules are mainly divided into three types: retrieval functionality, domain-specific question-and-answer functionality, and online question-and-answer functionality. The retrieval function allows users to retrieve different types of slices or question-and-answer pairs from an offline-processed knowledge base; the domain-specific question-and-answer function allows users to generate models based on knowledge base retrieval results; and the online question-and-answer function allows users to upload documents for real-time question-and-answer sessions, while also supporting multimodal input. As the core capability layer of the system, the component layer achieves efficient retrieval and accurate generation of multi-type and multi-modal knowledge through a multi-strategy collaboration mechanism. It also possesses modular architecture capabilities, allowing users to flexibly build personalized applications by customizing component chaining processes, registering new components, or using pre-built case templates. Furthermore, the system introduces intelligent agent-assisted design, enabling users to describe their requirements using natural language, and the system automatically recommends typical application solutions or directly generates configuration processes, achieving low-code or no-code application construction, lowering the technical threshold and improving development efficiency.
[0091] The assurance layer serves as a non-functional safeguard for the system. The gateway unifies internal and external information exchange; the assurance layer is primarily responsible for system logging and anomaly monitoring, a crucial guarantee for stable system operation. This layer includes a gateway module, a configuration management module, a logging module, and anomaly monitoring modules. The core of configuration management is the personalized configuration of knowledge applications under specific functions, such as retrieval and production parameters; the logging module provides a unified logging interface for the interaction layer and component layer, enabling problem tracing and performance analysis through end-to-end logging; the anomaly monitoring module monitors system status in near real-time through application logs, providing early warnings for configuration anomalies and component failures.
[0092] The optimization layer is the core module for the system's intelligent evolution and efficiency improvement. Through regular performance testing, online diagnostics, and knowledge health analysis, it provides dynamic tuning suggestions. The system periodically performs component-level and application-level performance tests, generates multi-dimensional evaluation reports, and automatically recommends component parameter adjustment schemes based on the test results. Simultaneously, the system tracks key performance indicators in real time. When anomalies are detected, tuning suggestions are pushed through the user portal, and a degradation mechanism is triggered to ensure service stability. Furthermore, based on users' historical operation and feedback data, the system proactively recommends personalized optimization strategies and assists users in completing configuration adjustments through interactive guidance, ultimately constructing a data-driven closed-loop optimization system.
[0093] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the question-and-answer method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0094] This application provides a question-answering system, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the question-answering method in the first embodiment described above.
[0095] The following is for reference. Figure 6 It shows a schematic diagram of a structure suitable for implementing the question-and-answer system of the embodiments of this application. Figure 6 The question-and-answer system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0096] like Figure 6As shown, the question-and-answer system may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the question-and-answer system. The processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touchscreen, touchpad, keyboard, etc.; an output device 1008 including, for example, a liquid crystal display, etc.; a storage device 1003 including, for example, a magnetic tape, hard disk, etc.; and a communication device 1009. The communication device 1009 allows the question-and-answer system to exchange data via wireless or wired communication with other devices. Although the diagram illustrates question-and-answer systems with various configurations, it should be understood that implementation or possession of all of the systems shown is not required. More or fewer systems may be implemented alternatively.
[0097] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0098] The question-and-answer system provided in this application, employing the question-and-answer method described in the above embodiments, can solve the technical problem that processing flows using fixed functional templates cannot dynamically adjust processing logic according to different query requests, making it difficult to adapt to the differentiated needs of different users for question-and-answer. Compared with the prior art, the beneficial effects of the question-and-answer system provided in this application are the same as those of the question-and-answer method provided in the above embodiments, and other technical features of this question-and-answer system are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0099] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0100] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0101] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the question-and-answer method in the above embodiments.
[0102] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0103] The aforementioned computer-readable storage medium may be included in the question-and-answer system, or it may exist independently without being assembled into the question-and-answer system.
[0104] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the question-and-answer system, the system achieves the following transformations: by dynamically mapping query requests to customizable workflows, it moves from a rigid, fixed processing model to a flexible and configurable intelligent question-and-answer architecture. Through the dynamic selection and combination of reusable intelligent components, it enhances its adaptability to different business scenarios and complex query requirements. While ensuring the accuracy and completeness of question-and-answer responses, it significantly improves the scalability, maintainability, and resource utilization efficiency of queries.
[0105] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0106] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0107] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0108] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described question-and-answer method. This solves the technical problem that processing flows using fixed functional templates cannot dynamically adjust processing logic according to different query requests, making it difficult to adapt to the differentiated question-and-answer needs of different users. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the question-and-answer method provided in the above embodiments, and will not be repeated here.
[0109] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the question-and-answer method described above.
[0110] The computer program product provided in this application can solve the technical problem that processing flows using fixed functional templates cannot dynamically adjust processing logic according to different query requests, making it difficult to adapt to the differentiated needs of different users for question answering. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the question answering methods provided in the above embodiments, and will not be repeated here.
[0111] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A question and answer method, characterized by, The question and answer method comprises: receiving a query request of a user, and generating a process configuration instruction according to the query request; in response to the process configuration instruction, dynamically selecting a target component from a plurality of intelligent components set in advance, and combining the target component to generate a work flow, the work flow comprising the target components connected in series; executing the work flow to process the query request, and obtaining a question and answer result corresponding to the query request generated by the work flow.
2. The question-answering method of claim 1, wherein, The work flow at least comprises a retrieval component, a context expansion component and a generation component, and the step of executing the work flow to process the query request and obtaining the question and answer result corresponding to the query request generated by the work flow comprises: based on the retrieval component, jointly retrieving the query request to obtain a retrieval result; based on the context expansion component, generating a semantic chain according to the retrieval result; based on the generation component, calling a target model, processing the semantic chain based on the target model to generate a question and answer result.
3. The question answering method of claim 2, wherein, The step of generating a semantic chain according to the retrieval result based on the context expansion component comprises: based on the context expansion component, obtaining parent content and / or child content having a hierarchical association with the retrieval result; based on the parent content and / or the child content and the retrieval result, constructing the semantic chain.
4. The question answering method of claim 2, wherein, The step of based on the generation component calling a target model, processing the semantic chain based on the target model to generate a question and answer result comprises: based on the generation component, selecting a target model from at least two large language models; based on user's custom configuration information, setting parameters, prompt words and calling throttling strategies of the target model; based on the set target model, processing the semantic chain to generate a question and answer result.
5. The question answering method of claim 2, wherein, The work flow further comprises a user question component, and the step of executing the work flow to process the query request and obtaining the question and answer result corresponding to the query request generated by the work flow comprises: when the query request comprises a document library domain question and answer, executing the step of jointly retrieving the query request based on the retrieval component to obtain a retrieval result and subsequent steps; when the query request comprises an online document question and answer, performing intent recognition on the query request based on a user question processing component to obtain an intent recognition result; when the task type is determined to be a local question and answer according to the intent recognition result, executing the step of jointly retrieving the query request based on the retrieval component to obtain a retrieval result and subsequent steps; when the task type is determined to be a global question and answer according to the intent recognition result, calling a model based on the generation component to process a slice of a document corresponding to the query request, and processing the slice of the document to generate a question and answer result.
6. The question answering method of claim 2, wherein, The step of jointly retrieving the query request based on the retrieval component to obtain a retrieval result comprises: based on the retrieval component, jointly retrieving the query request to obtain a first retrieval sub-result, the query request being jointly retrieved to at least two types of knowledge bases, the knowledge base types at least comprising a question and answer pair knowledge base and a document library; The query request is subjected to at least two retrieval strategies for collaborative retrieval to obtain a second retrieval sub-result. The retrieval strategies include at least keyword retrieval, vector retrieval, and hybrid retrieval. A third search sub-result is obtained by performing a joint retrieval of multimodal data on the query request, wherein the multimodal data includes text, tables, and images; the search result includes the first search sub-result, the second search sub-result, and the third search sub-result.
7. The question answering method of claim 1, wherein, The steps of executing the workflow to process the query request and obtaining the question-and-answer results corresponding to the query request generated by the workflow also include: Obtain runtime logs and performance metrics; Based on the runtime logs and performance metrics, a dynamic tuning strategy is generated for the target component and / or the workflow.
8. The question answering method of claim 1, wherein, The step of generating process configuration instructions based on the query request includes: The intent of the query request is identified, and the scene features corresponding to the query request are determined. Based on the intent recognition results and the scene characteristics, process configuration instructions corresponding to the workflow are generated.
9. A question answering system, characterized by The question-and-answer system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the question-and-answer method as described in any one of claims 1 to 8.
10. A storage medium, characterized by The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the question-and-answer method as described in any one of claims 1 to 8.