Question and answer processing method and apparatus, electronic device, and storage medium
By acquiring user questions and process status from the intelligent question-answering system, and combining knowledge fragments and permission information, streaming answers are generated, solving the problems of low answer accuracy and security in existing systems, and achieving more operational answer generation and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PICC INFORMATION TECH CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-07-21
AI Technical Summary
Existing intelligent question-answering systems struggle to provide step-by-step operational guidance for specific process nodes within office automation and business process management platforms, resulting in low accuracy of answers.
By acquiring user questions, retrieved knowledge fragments, and process status, these are combined to form input prompts for the target large model. Answers are generated using streaming requests, and permission-aware retrieval and asynchronous buffer queues are combined to ensure the accuracy and security of the answers.
It improves the accuracy and usability of the answers generated by the question-and-answer system, provides more practical operation guidelines, and ensures data security and system stability.
Smart Images

Figure CN122432274A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent question-answering technology, and in particular to a question-answering processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, in existing office automation (OA) and business process management (BPM) platforms based on intelligent question-answering technology, the answer is usually generated by a large model after matching the user's question with the knowledge base content.
[0003] However, because the question-and-answer systems in office automation (OA) and business process management (BPM) platforms can only output general answers based on a common knowledge base, it is difficult to provide step-by-step operation guidance for specific process nodes, resulting in low accuracy of the final generated answers. Summary of the Invention
[0004] The purpose of this invention is to provide a question-and-answer processing method, apparatus, electronic device, and storage medium to solve the problem of low accuracy of answers generated by existing question-and-answer systems.
[0005] To solve the above-mentioned technical problems, the embodiments of the present invention are implemented as follows: In a first aspect, an embodiment of the present invention provides a question-and-answer processing method, the method comprising: Obtain user questions raised during the business process, retrieve a set of knowledge fragments that match the user's question intent, and the process status of the business process; The system combines user questions, sets of knowledge fragments, and process states into input prompts for the target large model, and then uses these input prompts to invoke the target large model to generate answers to user questions.
[0006] In one implementation, the method of generating an answer to a user's question by invoking a target large model based on input prompts includes: Send a streaming request to the target large model, carrying input prompts; Receive multiple target text fragments returned by the target large model to compose the answer to the user's question; Based on the SSE protocol, multiple target text fragments are pushed to the user in a streaming manner.
[0007] In one implementation, the process state includes: process instance identifier, current task node identifier of the business process, and dynamic form data.
[0008] Secondly, embodiments of the present invention provide another question-and-answer processing method, the method comprising: Obtain user questions and user permission information raised during business processes; Based on the permission information, determine the list of target file identifiers that meet the permission requirements; Based on the target file identifier list and the user question, a set of knowledge fragments matching the user question's intent is retrieved from the target knowledge base. This set of knowledge fragments is used to form the input prompts for the target big model that generates the answer to the user question. The input prompts for the target big model are determined by a combination of the user question, the set of knowledge fragments, and the process state of the business process.
[0009] In one implementation, the target knowledge base includes a first document library and a second document library generated based on multiple text blocks corresponding to documents included in the first document library; based on a target file identifier list and user questions, a set of knowledge fragments that match the user's question intent is retrieved from the target knowledge base, including: Based on the target file identifier list and user questions, a set of candidate question-and-answer documents is obtained by matching from the first document library; Based on the candidate question-and-answer document set and the user's question, a set of knowledge fragments is obtained by matching from the second document library.
[0010] Thirdly, embodiments of the present invention provide yet another question-and-answer processing method, the method comprising: Obtain multiple original process files corresponding to the business process and generate a file identifier for each original process file; Each original process file is semantically segmented to obtain multiple text blocks; Multiple original process files and multiple text blocks corresponding to each original process file are vectorized to obtain multiple first documents and multiple second documents; each first document corresponds to one original process file; each second document corresponds to one text block. Multiple first documents and multiple second documents are stored in a first document library and a second document library, respectively. The first document library is used to determine a list of target file identifiers that meet the user's permission information and a set of candidate question-and-answer documents that match the user's questions raised in the business process. The second document library is used to determine a set of knowledge fragments that match the set of candidate question-and-answer documents and the user questions. The set of knowledge fragments is used to generate answers to the user questions.
[0011] Fourthly, embodiments of the present invention provide a question-and-answer processing apparatus, the apparatus comprising: The first acquisition module is used to acquire user questions raised by users in the business process, a set of knowledge fragments that match the questioning intent of the user questions, and the process status of the business process. The calling module is used to combine user questions, knowledge fragment sets, and process states into input prompts for the target large model, so as to call the target large model to generate answers to user questions based on the input prompts.
[0012] Fifthly, embodiments of the present invention provide another question-and-answer processing apparatus, the apparatus comprising: The second acquisition module is used to acquire user questions raised by users in the business process and user permission information; The first determining module is used to determine a list of target file identifiers that meet the permission information based on the permission information. The second determining module is used to retrieve a set of knowledge fragments from the target knowledge base that match the user's question intent based on the target file identifier list and the user question; wherein, the set of knowledge fragments is used to form the input prompts of the target big model for generating the answer to the user question; the input prompts of the target big model are determined by the combination of the user question, the set of knowledge fragments, and the process state of the business process.
[0013] In a sixth aspect, embodiments of the present invention provide an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the question-and-answer processing method provided in the above embodiments.
[0014] In a seventh aspect, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the question-and-answer processing method provided in the above embodiments.
[0015] The above-described at least one technical solution adopted in the embodiments of the present invention can achieve the following beneficial effects: The question-and-answer processing method provided in this invention combines user questions raised during a business process, a set of knowledge fragments matching the user's question intent, and the process state of the business process into input prompts for a target large model. This allows the target large model to generate answers to user questions based on these input prompts. By combining the current process state of the user's business process, the set of knowledge fragments matching the user's question intent, and the user question itself into input prompts for the target large model, the target large model can generate answers that provide more operational and step-by-step guidance tailored to specific process states when generating answers to user questions based on these input prompts. This effectively improves the accuracy and practicality of the answers generated by the question-and-answer system. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a question-and-answer processing method provided in an embodiment of the present invention. Figure 1 ; Figure 2 A flowchart illustrating a question-and-answer processing method provided in an embodiment of the present invention. Figure 2 ; Figure 3 A flowchart illustrating a question-and-answer processing method provided in an embodiment of the present invention. Figure 3 ; Figure 4 This is a schematic diagram of the system structure of a question-and-answer system provided in an embodiment of the present invention; Figure 5 A schematic diagram of the structure of a question-and-answer processing device provided in an embodiment of the present invention. Figure 1 ; Figure 6 A schematic diagram of the structure of a question-and-answer processing device provided in an embodiment of the present invention. Figure 2 ; Figure 7 This is a schematic diagram of the structure of a question-and-answer processing electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0019] 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.
[0020] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit this disclosure.
[0022] Explanation of relevant terms: 1. Multi-source heterogeneous knowledge (MSHK) Multi-Source Heterogeneous Knowledge (MSHK) refers to knowledge content related to office processes that originate from different processes and have different data structures and formats, including but not limited to: structured data (such as BPMN process definitions), semi-structured data (such as operation and maintenance work orders), and unstructured data (such as user operation logs, PDF manuals, audio and video operation guides, etc.).
[0023] 2. Intelligent Data Acquisition and Editing (IIC) Intelligent Information Collection (IIC) refers to the entire process of collecting, preprocessing, cleaning, segmenting, vectorizing, and injecting multi-source heterogeneous knowledge into a knowledge base through an automated pipeline. It includes key technical steps such as file type recognition, audio and video transcoding, speech recognition (ASR), and semantic chunking.
[0024] 3. Permission-Aware Retrieval (PAR) Permission-Aware Retrieval (PAR) is a mechanism that dynamically integrates a user's real-time permission context during information retrieval. The system calculates the scope of knowledge a user is authorized to access (such as a list of directory IDs (kbIdList) and a list of file IDs (fileIds)) based on their identity (e.g., role, department) and uses this scope as a hard filter in a vector database or full-text search engine to ensure that only authorized content is returned.
[0025] 4. Process Context (PCtx) Process context (PCtx) refers to the specific business status information of a user in the office process platform, including but not limited to: process instance ID (processInstanceId), current task node ID (currentTaskId), form variables, etc.
[0026] 5. Retrieval Enhancement Generation (RAG) Retrieval-Augmented Generation (RAG) is a technological paradigm that combines information retrieval with Large Language Modeling (LLM). The system first retrieves document fragments related to the user's question from an external knowledge base, and then inputs these fragments along with the original question into a large model to guide it in generating a fact-based, accurate, and traceable answer.
[0027] 6. Streaming Question Answering (SQA) Streaming Question Answering (SQA) is a technology that uses the Server-Sent Events (SSE) protocol to transmit the answer content generated step by step by a large language model to the client in real time, word by word, which significantly improves the user interaction experience and avoids long waiting times.
[0028] 7. Asynchronous Buffer Queue (ABQ) Asynchronous Buffering Queue (ABQ) is a flow control mechanism used in high-concurrency scenarios. The system temporarily stores user requests in memory or a message queue, and the background consumer processes them at a uniform rate according to the system load capacity, achieving "peak shaving and valley filling" to ensure service stability and availability.
[0029] Currently, large enterprises and organizations commonly deploy complex office automation (OA) or business process management (BPM) platforms, containing tens of thousands of differentiated processes. Users often encounter operational difficulties due to the complexity and frequent updates of these processes. Traditional solutions primarily include: (1) Consult static documents: such as user manuals, FAQ documents, etc. However, these documents are often outdated, difficult to search, and cannot provide accurate answers for the user's specific context (such as the process node being operated, personal role).
[0030] (2) Human customer service / operation support: slow response, high cost, and knowledge is difficult to accumulate and reuse.
[0031] (3) Simple keyword search: Full-text search in the knowledge base returns a list of results with low relevance, resulting in a poor user experience.
[0032] In recent years, intelligent question-answering technology based on large language models has begun to be applied. Its basic model involves matching user questions with knowledge base content, and then the large model generates the answer. However, in complex office workflow scenarios, existing technologies have significant shortcomings: (1) Single source of knowledge: relying solely on structured user manuals while ignoring valuable data such as unstructured operation and maintenance records and real user operation logs.
[0033] (2) Lax access control: It is either open to the entire knowledge base or completely closed. It is impossible to dynamically filter the knowledge base content based on the user's real-time identity, role and department, which poses serious data security and compliance risks.
[0034] (3) Low accuracy of question and answer: Due to the lack of contextual understanding of the user's current operation process, the generated answers are often general rather than operation guidelines for specific process nodes. The question and answer system does not understand the specific process instance and node that the user is currently in, and cannot provide contextualized and step-by-step guidance.
[0035] (4) Poor system response efficiency and stability: When processing massive process data and high-concurrency requests, there is a lack of effective buffering and queuing mechanisms for adaptability, which can easily cause system blockage.
[0036] Example 1 Embodiment 1 of the present invention provides a question-and-answer processing method to solve the problem of low accuracy of answers generated by existing question-and-answer systems.
[0037] like Figure 1 As shown, an embodiment of the present invention provides a question-and-answer processing method, the method comprising: Step S101: Obtain the user questions raised by the user in the business process, the set of knowledge fragments that match the user's questioning intent, and the process status of the business process.
[0038] Specifically, in the context of intelligent question-and-answer systems for enterprise-level office workflows, a Business Process (BP) refers to a series of ordered and standardized operational steps designed to achieve a specific business objective. It defines "who does what, when," and is the core management object of OA and BPM platforms. The Process Status (PS) of a Business Process refers to the specific stage or operational status of the process at a particular point in time. It describes "where the process is currently," and is the core basis for the system to determine "what to do next."
[0039] When a user performs a certain operation step in a business process, they can ask a user question such as "What should I do next?" The context-enhanced question-answering engine will simultaneously receive the user's question in the business process, the set of knowledge fragments that match the user's question intent, and the process status of the business process, and use them to generate an answer to the user's question. This answer can guide the user to complete the next operation.
[0040] In one implementation, multi-source heterogeneous data corresponding to the business processes is pre-collected from OA and BPM platforms. This multi-source heterogeneous data includes: Structured data: Directly read workflow definition files (such as BPMN, containing semantics such as nodes, gateways, and form variables) and official user manuals (PDF / Word / PPT) from the office platform via scheduled tasks; Semi-structured / unstructured data: Obtain problem solutions from the operation and maintenance work order system, user-submitted notes in the process, anonymized historical operation logs (which can be associated with specific process nodes), and audio and video operation guidance media files through API, FTP encrypted transmission, log monitoring, etc.
[0041] After preprocessing, speech recognition, text cleaning and segmentation, and vectorization of the aforementioned multi-source heterogeneous data, a target knowledge base is constructed. The context-enhanced question answering engine can retrieve a set of knowledge fragments from this target knowledge base that match the user's question intent. Intent matching is based on the similarity between the user's question vector and the knowledge fragments in the knowledge fragment set meeting a set of predetermined conditions.
[0042] In one implementation, the process state includes: process instance identifier, current task node identifier of the business process, and dynamic form data. Specifically, it includes: processInstanceId (process instance ID), currentTaskId (current task node ID), formVariables (form variables), etc.
[0043] Step S102: Combine the user question, knowledge fragment set, and process status into input prompts for the target large model, and then use the target large model to generate the answer to the user question based on the input prompts.
[0044] Specifically, this step aims to integrate the user's question, relevant knowledge from the knowledge fragment set, and process status to construct a structured input prompt, and then call the target large model to generate the answer. This can be achieved by combining a pre-built prompt template, filling the prompt template with the user's question, knowledge fragment set, and process status, thus constructing the input prompt.
[0045] To adapt to intelligent question-and-answer scenarios in enterprise-level office workflows (OA / BPM), the target large model typically needs to possess one or more of the following capabilities: (1) Instruction compliance: Able to accurately understand and execute complex Prompt instructions, such as "provide step-by-step guidance based on the current process status"; (2) Contextual understanding: Able to handle long text input and effectively utilize process context (such as formVariables) for reasoning; (3) Streaming output: Supports returning results in a streaming manner, that is, generating the text word by word or sentence by sentence, rather than returning the full text at once; (4) Enterprise-level compliance: Possesses data privacy protection mechanisms or supports private deployment to meet the security requirements of enterprise data not leaving the domain; In specific implementations, the target large model can be: a general large model, such as OpenAI GPT-4, Claude 3, Tongyi Qianwen, Wenxin Yiyan, etc.; a domain fine-tuning model, a dedicated model that is fine-tuned for a specific industry (such as finance, law, manufacturing); or an open source model, such as Llama 3, Qwen, ChatGLM, etc., which is usually used for private deployment scenarios.
[0046] The target large model is usually located in the backend service layer and is called by the "context-enhanced question answering engine" through the API interface. The text stream generated by the engine is then pushed to the frontend user.
[0047] In one implementation, the method of generating an answer to a user's question by invoking a target large model based on input prompts includes: Send a streaming request to the target large model, carrying input prompts; Receive multiple target text fragments returned by the target large model to compose the answer to the user's question; Based on the SSE protocol, multiple target text fragments are pushed to the user in a streaming manner.
[0048] Specifically, the frontend of the context-enhanced question-answering engine submits user questions, a set of knowledge fragments, and process status to the backend. Upon receiving these, the backend sends an asynchronous streaming request to the target model's API, carrying an input prompt containing the user question, knowledge fragment set, and process status. When generating the answer, the target model uses streaming protocols such as Server-Sent Events (SSE) to break the complete answer into multiple consecutive target text chunks and returns them in real time. The backend continuously listens for and receives these text chunks. Each chunk is processed as soon as it arrives (e.g., decoding, format checking, security filtering). While receiving chunks, the backend can selectively store the complete answer on the server for later analysis or recording, but does not wait for all chunks to be received. A persistent SSE connection is maintained between the frontend and backend. After processing each target text chunk returned from the target model, the backend immediately pushes the chunk back to the frontend through the established SSE connection. The front end continuously receives these fragments and renders them onto the user interface in real time, displaying the answer word by word or sentence by sentence, so that users can see the answer generation process almost in real time.
[0049] The question-and-answer processing method provided in this invention combines user questions raised during a business process, a set of knowledge fragments matching the user's question intent, and the process state of the business process into input prompts for a target large model. This allows the target large model to generate answers to user questions based on these input prompts. By combining the current process state of the user's business process, the set of knowledge fragments matching the user's question intent, and the user question itself into input prompts for the target large model, the target large model can generate answers that provide more operational and step-by-step guidance tailored to specific process states when generating answers to user questions based on these input prompts. This effectively improves the accuracy and practicality of the answers generated by the question-and-answer system.
[0050] Example 2 Embodiment 2 of the present invention provides another question-and-answer processing method to solve the problems of low accuracy and security of answers generated by existing question-and-answer systems.
[0051] like Figure 2 As shown, an embodiment of the present invention provides a question-and-answer processing method, the method comprising: Step S201: Obtain the user questions raised by the user in the business process and the user's permission information; Specifically, when a user raises a question during the business process, the permission-aware retrieval module pre-built in this embodiment of the invention extracts and parses the interface authentication token from the HTTP header of the question-and-answer request, obtaining the user's email address. Then, using this email address as a key, it calls the identity authentication service of the OA / BPM platform, extracting the user's permission information such as userId, roles, departments, and permissions from the user information returned by the identity authentication service.
[0052] In this embodiment of the invention, the constructed question-answering system includes a context-enhanced question-answering engine, a permission-aware retrieval module, and a target knowledge base. The constructed question-answering system can be deployed in an enterprise office platform (OA / BPM platform). When a user performs a certain operation step in the business process of the enterprise office platform, they can submit a question-answering request to the question-answering system regarding the current operation step, including questions such as "What should I do next?" The permission-aware retrieval module of the question-answering system will extract and parse the interface authentication token from the HTTP header of the question-answering request to obtain the user's email address. Then, using this email address, it will further obtain the user's permission information from the identity authentication service of the permission-aware retrieval module.
[0053] Step S202: Determine a list of target file identifiers that meet the permission information based on the permission information; Specifically, this step is the core security filtering step of Permission-Aware Retrieval (PAR). Its goal is to dynamically determine the scope of knowledge files that a user is authorized to access based on their real-time identity information, ensuring that subsequent knowledge retrieval and answer generation are conducted within the authorized scope.
[0054] The permission-aware retrieval module invokes its internal permission knowledge base (a service or database storing "permission-resource" mappings) to perform permission matching calculations. Based on the user's permission information, it calls methods such as getDocumentIdByUser() to dynamically calculate the list of knowledge base directory IDs (kbIdList) and the list of specific file IDs (fileIds) that the user is authorized to access, satisfying the permission information. The calculated list of specific file IDs (fileIds) represents all knowledge files that the user is currently authorized to access at the moment of the query. The target file identifier list is a list composed of file IDs (fileIds), which is a permission subset of the permission knowledge base, representing all knowledge files that the user can retrieve within the current permission context.
[0055] Step S203: Based on the target file identifier list and the user question, retrieve a set of knowledge fragments from the target knowledge base that matches the user question's intent; wherein, the set of knowledge fragments is used to form the input prompts for the target big model that generates the answer to the user question; the input prompts for the target big model are determined by the combination of the user question, the set of knowledge fragments, and the process state of the business process.
[0056] This step is the execution phase of the permission-aware retrieval process. Its core objective is to retrieve the most relevant knowledge fragments to the user's question within the scope of files the user is authorized to access (corresponding to the target file identifier list), providing contextual basis for subsequent answer generation. This step is conducted within a restricted knowledge space, ensuring the "permission security" of the retrieval.
[0057] Specifically, the search scope of the target knowledge base is first limited to a fixed range based on a list of target file identifiers. Then, within this limited search range, semantic retrieval is performed to find the knowledge fragments that best match the user's question intent, constructing a knowledge fragment set. This set is a list of the Top-K knowledge fragments after permission filtering and semantic ranking. These knowledge fragments match the user's question intent and all originate from files the user has access to. Finally, the retrieved knowledge fragment set is returned to the context-enhanced question-answering engine. This engine combines the knowledge fragment set with the retrieved user question and the process state of the business flow to determine the input prompt for the target big model, thereby generating the answer to the user's question by invoking the target big model.
[0058] In one implementation, the target knowledge base includes a first document library and a second document library generated based on multiple text blocks corresponding to the documents included in the first document library.
[0059] Specifically, based on the target file identifier list and the user question, a set of knowledge fragments that match the user's question intent are retrieved from the target knowledge base, including: Based on the target file identifier list and user questions, a set of candidate question-and-answer documents is obtained by matching from the first document library; Based on the candidate question-and-answer document set and the user's question, a set of knowledge fragments is obtained by matching from the second document library.
[0060] In this implementation, the target knowledge base adopts a hierarchical retrieval architecture, comprising two logical libraries, and determines the final set of knowledge fragments through a two-step retrieval process. Specifically, the target knowledge base includes a first document library and a second document library. The first document library stores complete, structured documents (such as knowledge base articles, user manuals, FAQ entries, etc.) that have undergone preprocessing and vectorization. Each document is an independent unit with metadata (such as title, ID, tags, and permission identifiers). The second document library stores second documents generated based on multiple text blocks corresponding to the documents included in the first document library after preprocessing, semantic segmentation, and vectorization.
[0061] Accordingly, the final set of knowledge fragments is determined through a two-step retrieval process, including: Within a fixed search range defined by the target file identifier list, the system uses the user's question and the file identifiers in the target file identifier list as input to perform a search from the first document database and returns a set of candidate question-and-answer documents sorted by relevance. Using candidate question-and-answer documents and user questions from the candidate question-and-answer document set as input, multiple knowledge fragments belonging to the candidate document set and whose similarity to the user question vector meets the set conditions are selected from the second document library; Multiple knowledge fragments are rearranged based on their relevance scores, and the Top-K most relevant knowledge fragments that users have access to are selected to obtain a set of knowledge fragments.
[0062] The question-answering method in this invention integrates an enterprise-level IAM system, dynamically injecting user permission information at multiple stages of knowledge retrieval. If knowledge base question-answering is selected, the question undergoes knowledge base document fragment filtering and similarity retrieval, with multiple rounds of hard filtering using DM / ES / vector libraries to prevent single-time privilege overreach, ultimately obtaining the Top-K knowledge fragments and their sources that the user is authorized to access. If a specific question-answering model based on the knowledge base does not return an answer, a general question-answering model is invoked as a fallback, or a general answer can be directly selected from the general model.
[0063] The question-and-answer processing method provided in this invention can dynamically determine the scope of knowledge files that a user is authorized to access based on their real-time identity information, ensuring that subsequent knowledge retrieval and answer generation are conducted within the authorized scope. It not only enables the generation of highly accurate answers based on a set of knowledge fragments that match the user's question intent, but also guarantees that the returned answers are within the user's permission range. This solves the data security and compliance issues in intelligent question answering, ensuring that sensitive process information is only visible to authorized personnel, meeting enterprise-level security requirements.
[0064] Example 3 Embodiment 3 of the present invention provides another question-and-answer processing method to solve the problems of low accuracy and security of answers generated by existing question-and-answer systems.
[0065] like Figure 3 As shown, an embodiment of the present invention provides a question-and-answer processing method, the method comprising: Step S301: Obtain multiple original process files corresponding to the business process and generate a file identifier for each original process file; Step S302: Semantically segment each original process file to obtain multiple text blocks; Step S303: Vectorize the multiple original process files and the multiple text blocks corresponding to each original process file to obtain multiple first documents and multiple second documents; wherein, each first document corresponds to one original process file; and each second document corresponds to one text block. Step S304: Store multiple first documents and multiple second documents into a first document library and a second document library, respectively; wherein, the first document library is used to determine a set of candidate question-and-answer documents that match the target file identifier list that satisfies the user's permission information and the user's question raised in the business process; the second document library is used to determine a set of knowledge fragments that match the set of candidate question-and-answer documents and the user's question; the set of knowledge fragments is used to generate answers to the user's question.
[0066] In embodiments of the present invention, such as Figure 4 As shown, the constructed question-and-answer system also includes an intelligent data acquisition and knowledge fusion module. This module is responsible for storing multi-source heterogeneous data, including multiple original process documents, collected from the OA and BPM platforms and constructing it into a target knowledge base comprising a first document library and a second document library. This multi-source heterogeneous data includes: Structured data: Directly read workflow definition files (such as BPMN, containing semantics such as nodes, gateways, and form variables) and official user manuals (PDF / Word / PPT) from the office platform via scheduled tasks; Semi-structured / unstructured data: Obtain problem solutions from the operation and maintenance work order system, user-submitted notes in the process, anonymized historical operation logs (which can be associated with specific process nodes), and audio and video operation guidance media files through API, FTP encrypted transmission, log monitoring, etc.
[0067] The original process file corresponds to the independent original file in the structured data, semi-structured / unstructured data mentioned above, such as a separately stored PDF file, an audio file, or a video file.
[0068] In this embodiment of the invention, the constructed question-answering system also includes an asynchronous buffering and flow control module. In the enterprise-level intelligent question-answering scenario for office workflows addressed by this invention, user questions often involve real-time workflow status queries, multi-source knowledge retrieval, and large-model inference, resulting in long response times for a single request (typically hundreds of milliseconds to several seconds). Without an asynchronous buffering and flow control mechanism, service avalanches or response timeouts are highly likely during peak business periods (such as end-of-month expense reports and concentrated annual approval periods), making it impossible for core functions such as "knowledge fusion," "context enhancement," and "permission awareness" to operate stably. Therefore, the asynchronous buffering and flow control module is incorporated as supporting infrastructure into the overall architecture to ensure the availability and reliability of other modules in a real production environment, rather than merely remaining at the theoretical level.
[0069] Asynchronous processing: Time-consuming tasks such as data acquisition, transcoding, and ASR are all executed asynchronously in an independent thread pool using the @Async annotation, avoiding blocking the main business thread.
[0070] Flow control: A buffer queue is set up at the entry point of the process Q&A request. Requests during peak periods are queued first and processed by the backend consumer at a uniform rate according to the system's capacity to prevent system overload.
[0071] Meanwhile, the asynchronous buffer queue (ABQ) of this system is not a general message middleware call; it is deeply bound to the permission context and process state lifecycle. Each request in the queue carries a userId and a processInstanceId to ensure that the permission context does not become invalid during asynchronous processing; When a process instance ends or a user session expires, the system automatically discards the relevant queued requests to avoid invalid calculations. Combined with Streaming Question Answering (SSE), queue consumers push results incrementally at the token level, rather than waiting for the complete result to be generated. This fine-grained traffic scheduling mechanism for process-oriented question answering scenarios goes beyond the scope of general peak shaving and valley filling.
[0072] In one implementation, multiple raw process files are acquired and stored in a knowledge center built on NAS storage. A file identifier is generated for each raw process file, which is used for candidate question-and-answer document sets and knowledge fragment retrieval. This knowledge center is used to store all source knowledge (multi-source heterogeneous data).
[0073] Before semantic segmentation of each of the multiple stored original process files, the following steps are also included: File preprocessing: For audio and video operation guides, convert them to WAV / PCM format using tools such as FFmpeg; Automatic Speech Recognition (ASR): Converts processed audio files into text, transforming them into TXT format files that can be used for subsequent knowledge storage and question answering; Text cleaning: Standardize and clean all text content (manuals, work orders, logs, TXT).
[0074] The cleaned original process files are intelligently chunked according to semantics, and each chunk is associated with its original file metadata (such as fileId, directoryId, information, etc.).
[0075] Finally, multiple original process files and their corresponding text blocks are vectorized. The vectorized original process files and metadata (especially permission identifiers) are stored in a first document repository built on Elasticsearch (ES). The vectorized data of all text blocks corresponding to each original process file are stored in a vector database built on Milvus. The first document repository identifies a list of target file identifiers that match the user's permission information and a set of candidate question-and-answer documents that match the user's questions in the business process, enabling rapid retrieval of original process files. The second document repository identifies a set of knowledge fragments that match the candidate question-and-answer document set and the user's questions, achieving precise matching of source knowledge. This allows for the generation of more accurate answers based on the knowledge fragment set.
[0076] The question-and-answer processing method provided in this embodiment of the invention forms a dual-index structure through a first document library and a second document library. It can quickly retrieve the original process files based on the first document library, and accurately locate the set of knowledge fragments that match the user's question based on the second document library, effectively improving the efficiency and accuracy of generating answers to user questions.
[0077] Example 4 The above describes the question-and-answer processing method provided by the embodiments of the present invention. Based on the same idea, the embodiments of the present invention also provide a question-and-answer processing device.
[0078] like Figure 5 As shown, the question-and-answer processing device 500 includes: The first acquisition module 501 is used to acquire user questions raised by users in the business process, a set of knowledge fragments that match the questioning intent of the user questions, and the process status of the business process. Module 502 is used to combine the user question, the set of knowledge fragments, and the process status into input prompts for the target large model, so as to generate the answer to the user question based on the input prompts.
[0079] In one implementation, the calling module 502 includes: Request module 5021 is used to send a streaming request to the target large model, carrying input prompts. The receiving module 5022 is used to receive multiple target text fragments returned by the target large model to form the answer to the user's question; The push module 5023 is used to push multiple target text fragments to the user in a streaming manner based on the SSE protocol.
[0080] In one implementation, the process status acquired by the first acquisition module 501 includes: process instance identifier, current task node identifier of the business process, and dynamic form data.
[0081] Example 5 Based on the same idea, this invention also provides another question-and-answer processing device.
[0082] like Figure 6 As shown, the question-and-answer processing device 600 includes: The second acquisition module 601 is used to acquire user questions raised by users in the business process and user permission information; The first determining module 602 is used to determine a list of target file identifiers that meet the permission information based on the permission information; The second determining module 603 is used to retrieve and determine a set of knowledge fragments that match the user's question intent from the target knowledge base based on the target file identifier list and the user question; wherein, the set of knowledge fragments is used to form the input prompts of the target big model for generating the answer to the user question; the input prompts of the target big model are determined by the combination of the user question, the set of knowledge fragments, and the process state of the business process.
[0083] In one implementation, the second determining module 603 includes: The first matching module 6031 is used to match a set of candidate question-and-answer documents from the first document library based on the target file identifier list and the user question; The second matching module 6032 is used to match a set of knowledge fragments from the second document library based on the candidate question-and-answer document set and the user question.
[0084] Example 6 Figure 7 A schematic diagram of the hardware structure of a question-and-answer processing electronic device for implementing various embodiments of the present invention.
[0085] The electronic device includes a processor 701 and a memory 702 storing computer program instructions. Specifically, the processor 701 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement embodiments of the present invention.
[0086] Memory 702 may include mass storage for data or instructions. For example, and not limitingly, memory 702 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 702 may include removable or non-removable (or fixed) media. Where appropriate, memory 702 may be internal or external to an electronic device. In a particular embodiment, memory 702 may be a non-volatile solid-state memory.
[0087] In one embodiment, memory 702 may be read-only memory (ROM). In one embodiment, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0088] The processor 701 implements any of the question-and-answer processing methods described in the above embodiments by reading and executing computer program instructions stored in the memory 702.
[0089] In one example, the electronic device may also include a communication interface 703 and a bus 710. For example, Figure 7 As shown, the processor 701, memory 702, and communication interface 703 are connected through bus 710 and complete communication with each other.
[0090] The communication interface 703 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of the present invention.
[0091] Bus 710 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 710 may include one or more buses. While specific buses are described and illustrated in embodiments of the invention, the invention contemplates any suitable bus or interconnect.
[0092] Furthermore, in conjunction with the question-and-answer processing methods in the above embodiments, this invention can be implemented using a computer-readable storage medium. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the question-and-answer processing methods in the above embodiments.
[0093] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0094] The above description is merely a specific implementation of the present invention. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0095] Secondly, those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0097] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0098] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0099] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0100] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0101] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0102] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0103] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A question-and-answer processing method, characterized in that, The method includes: Obtain user questions raised by users in the business process, a set of knowledge fragments that match the questioning intent of the user questions, and the process status of the business process; The user question, the set of knowledge fragments, and the process status are combined into an input prompt for the target large model, and the target large model is invoked based on the input prompt to generate an answer to the user question.
2. The method according to claim 1, characterized in that, The step of generating the answer to the user's question by invoking the target large model based on the input prompt includes: Carrying the input prompt, initiate a streaming request to the target large model; Receive multiple target text fragments returned by the target large model to form the answer to the user's question; Based on the SSE protocol, the multiple target text fragments are pushed to the user in a streaming manner.
3. The method according to claim 1, characterized in that, The process status includes: process instance identifier, current task node identifier of the business process, and dynamic form data.
4. A question-and-answer processing method, characterized in that, The method includes: Obtain user questions and user permission information raised during business processes; Based on the permission information, determine a list of target file identifiers that satisfy the permission information; Based on the target file identifier list and the user question, a set of knowledge fragments matching the user question's intent is retrieved from the target knowledge base; wherein, the set of knowledge fragments is used to form the input prompt of the target large model that generates the answer to the user question; the input prompt of the target large model is determined by a combination of the user question, the set of knowledge fragments, and the process state of the business process.
5. The method according to claim 4, characterized in that, The target knowledge base includes a first document library and a second document library generated based on multiple text blocks corresponding to documents included in the first document library; the step of retrieving and determining a set of knowledge fragments matching the user's question intent from the target knowledge base based on the target file identifier list and the user question includes: Based on the target file identifier list and the user question, a candidate question-and-answer document set is obtained by matching from the first document library; The knowledge fragment set is obtained by matching the candidate question-and-answer document set with the user question from the second document library.
6. A question-and-answer processing method, characterized in that, The method includes: Obtain multiple original process files corresponding to the business process and generate a file identifier for each original process file; Each original process file is semantically segmented to obtain multiple text blocks; The plurality of original process files and the plurality of text blocks corresponding to each original process file are vectorized to obtain a plurality of first documents and a plurality of second documents; wherein, each first document corresponds to one of the original process files; and each second document corresponds to one of the text blocks. The plurality of first documents and the plurality of second documents are respectively stored in a first document library and a second document library; wherein, the first document library is used to determine a list of target file identifiers that meet the user's permission information and a set of candidate question-and-answer documents that match the user's question raised in the business process; the second document library is used to determine a set of knowledge fragments that match the set of candidate question-and-answer documents and the user question; the set of knowledge fragments is used to generate an answer to the user question.
7. A question-and-answer processing device, characterized in that, The device includes: The first acquisition module is used to acquire user questions raised by users in the business process, a set of knowledge fragments that match the questioning intent of the user questions, and the process status of the business process; The module is used to combine the user question, the set of knowledge fragments, and the process status into an input prompt for the target large model, and then use the target large model to generate an answer to the user question based on the input prompt.
8. A question-and-answer processing device, characterized in that, The device includes: The second acquisition module is used to acquire user questions raised by users in the business process and user permission information; The first determining module is used to determine a list of target file identifiers that satisfy the permission information based on the permission information. The second determining module is used to retrieve and determine a set of knowledge fragments that match the questioning intent of the user question from the target knowledge base based on the target file identifier list and the user question; wherein, the set of knowledge fragments is used to form the input prompt of the target large model for generating the answer to the user question; the input prompt of the target large model is determined by a combination of the user question, the set of knowledge fragments, and the process state of the business process.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the question-and-answer processing method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the question-and-answer processing method as described in any one of claims 1 to 6.