Question and answer method and apparatus

CN122692084APending Publication Date: 2026-09-04SUNWARD INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610819875.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-08
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

[0003]然而,在应对复杂营销场景时,问答系统难以根据用户问题的逻辑结构充分检索,检索整合后的回答存在片面性,造成答案信息不准确的问题

Benefits of technology

[0016] A fourth aspect of the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122692084A_ABST
    Figure CN122692084A_ABST
Patent Text Reader

Abstract

The application provides a question and answer method and device, which can be applied to the technical field of natural language processing. The question and answer method comprises the following steps: in response to receiving a query request of a user, a query task corresponding to the query request is disassembled into a plurality of query subtasks based on a plurality of business entities, wherein the plurality of business entities are extracted from query text parsed from the query request; according to a dependency relationship among the plurality of query subtasks, each corresponding retrieval source of the plurality of query subtasks is retrieved respectively to obtain a plurality of retrieval subresults of the plurality of query subtasks, wherein the dependency relationship at least comprises a precedence dependency relationship and a conditional dependency relationship; and information fusion is performed on the plurality of retrieval subresults and the query text by using a large language model to obtain an answer text of the query request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and more specifically to a question-answering method and apparatus. Background Technology

[0002] As enterprises continue to deepen their digital transformation, marketers, customers, and internal employees need to quickly obtain heterogeneous information from multiple sources, such as product parameters, sales data, equipment status, and market dynamics.

[0003] However, when dealing with complex marketing scenarios, question-and-answer systems struggle to fully retrieve information based on the logical structure of user questions, resulting in biased and inaccurate answers. Summary of the Invention

[0004] In view of the above problems, the present invention provides a question-and-answer method and apparatus.

[0005] According to a first aspect of the present invention, a question-answering method is provided, comprising: in response to receiving a user's query request, decomposing a query task corresponding to the query request into multiple query subtasks based on multiple business entities, wherein the multiple business entities are extracted from query text parsed from the query request; retrieving from retrieval sources corresponding to each of the multiple query subtasks according to the dependencies between the multiple query subtasks, obtaining retrieval sub-results for each of the multiple query subtasks, wherein the dependencies include at least pre-dependencies and conditional dependencies; and fusing information from the multiple retrieval sub-results and the query text using a large language model to obtain the answer text for the query request.

[0006] According to an embodiment of the present invention, the business entity includes at least one of the following: the device identifier of the business, the device execution time, the device performance, and the fault type; the multiple query subtasks include at least two of the following: the device verification subtask, the operating condition query subtask, the device fault retrieval subtask, and the network supplementary retrieval subtask.

[0007] According to an embodiment of the present invention, the equipment verification subtask verifies the validity of the equipment identifier; the operating condition query subtask retrieves structured data related to the equipment execution time and equipment performance from a first local database; the equipment fault retrieval subtask retrieves unstructured data related to equipment faults from a second local database; and the online supplementary retrieval subtask retrieves data related to the query task from a webpage.

[0008] According to an embodiment of the present invention, retrieving unstructured data related to equipment failure from a second local database includes: matching multiple business entities with multiple entity vectors in an entity vector sub-library of the second local database; if the matching result indicates that at least one of the multiple business entities does not exist in the entity vector sub-library, retrieving multiple candidate text vectors based on the query text in the text vector sub-library of the second local database; and selecting equipment failure retrieval sub-results from the multiple candidate text vectors based on the relevance between the query text and the candidate text vectors, as well as the timeliness of the candidate text vectors.

[0009] According to embodiments of the present invention, based on the dependencies between multiple query subtasks, retrieval is performed from the databases corresponding to each of the multiple query subtasks to obtain the respective retrieval sub-results of the multiple query subtasks. This includes: based on the pre-dependency relationship between the device verification subtask and the operating condition query subtask, if the device verification subtask is completed and the verification result indicates that the device identifier verification is passed, the operating condition query subtask is executed to obtain the device performance retrieval sub-result; based on the conditional dependency relationship between the operating condition query subtask and the device fault retrieval subtask, if the query result of the operating condition query subtask indicates that the device is operating abnormally, the device fault retrieval subtask is executed to obtain the fault retrieval sub-result; based on the conditional dependencies between the operating condition query subtask, the device fault retrieval subtask, and the network supplementary retrieval subtask, if the number of operating condition query sub-results and the number of fault retrieval sub-results obtained by completing the operating condition query subtask are less than a preset retrieval number, the network supplementary retrieval subtask is executed to obtain supplementary retrieval sub-results.

[0010] According to an embodiment of the present invention, the above method further includes: if the verification result indicates that the device identifier verification fails, outputting feedback information of invalid query to the user's client; if the query result of the working condition query subtask indicates that the device is operating normally, executing the network supplementary retrieval subtask.

[0011] According to an embodiment of the present invention, information fusion is performed on multiple retrieval sub-results and query text using a large language model to obtain the answer text of the query request, including: attaching source information to each of the multiple retrieval sub-results and concatenating them with the query text to obtain the prompt word context; inputting the prompt word context into the large language model to obtain the answer text.

[0012] According to an embodiment of the present invention, based on multiple business entities, the query task corresponding to the user's query text is decomposed into multiple query sub-tasks, including: based on the query requirements corresponding to multiple business entities and preset business execution rules, the query task is decomposed into multiple query sub-tasks using the logical reasoning capability of a large language model.

[0013] According to an embodiment of the present invention, the method further includes: splitting the answer text into a model reasoning fragment and a target answer fragment according to the content attributes; and pushing the model reasoning fragment and the target answer fragment to the user's client in a preset order based on a preset communication protocol.

[0014] A second aspect of the present invention provides a question-answering device, comprising: a decomposition module, configured to, in response to receiving a user's query request, decompose a query task corresponding to the query request into multiple query sub-tasks based on multiple business entities, wherein the multiple business entities are extracted from query text parsed from the query request; a retrieval module, configured to, according to the dependencies between the multiple query sub-tasks, retrieve from the retrieval sources corresponding to each of the multiple query sub-tasks respectively, to obtain retrieval sub-results for each of the multiple query sub-tasks, wherein the dependencies include at least pre-dependencies and conditional dependencies; and an information fusion module, configured to, using a large language model, fuse the multiple retrieval sub-results and the query text to obtain the answer text for the query request.

[0015] A third aspect of the present invention provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0016] A fourth aspect of the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.

[0017] A fifth aspect of the present invention also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.

[0018] According to embodiments of the present invention, by decomposing the query task corresponding to the query request into multiple query sub-tasks based on multiple business entities, a refined decomposition of complex queries can be achieved, closely aligning with the inherent logic of the user's question. Furthermore, based on the dependencies between the multiple query sub-tasks, retrieval is performed from the respective retrieval sources of each query sub-task to obtain the retrieval sub-results for each query sub-task. This intelligent scheduling of multiple retrieval sources overcomes the limitations of fixed retrieval paths.

[0019] By using a large language model to fuse information from multiple search sub-results and query texts to obtain the answer text, the information from multiple search sub-results and query texts can be taken into account, thus improving the accuracy of the answer when there is sufficient search data. Attached Figure Description

[0020] The above-described features, other objects, and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which:

[0021] Figure 1 This diagram illustrates an application scenario of the question-and-answer method according to an embodiment of the present invention.

[0022] Figure 2 A flowchart illustrating a question-and-answer method according to an embodiment of the present invention is shown schematically;

[0023] Figure 3 This diagram schematically illustrates the system framework of a question-and-answer method according to an embodiment of the present invention.

[0024] Figure 4 This schematically illustrates a flowchart of how, according to an embodiment of the present invention, a retrieval is performed from the databases corresponding to each of the multiple query subtasks based on the dependencies between multiple query subtasks to obtain the retrieval sub-results of each of the multiple query subtasks.

[0025] Figure 5 A flowchart illustrating a question-and-answer method according to another embodiment of the present invention is shown schematically;

[0026] Figure 6 A schematic diagram illustrating the structure of a question-and-answer device according to an embodiment of the present invention is shown.

[0027] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a question-and-answer method according to an embodiment of the present invention. Detailed Implementation

[0028] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0030] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0031] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0032] In the technical solution of this invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0033] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this invention offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.

[0034] As enterprises continue to deepen their digital transformation, marketers, customers, and internal employees need to quickly obtain heterogeneous information from multiple sources, such as product parameters, sales data, equipment status, and market dynamics.

[0035] However, when dealing with complex marketing scenarios, question-and-answer systems struggle to comprehensively retrieve information based on the logical structure of user questions. The resulting integrated answers are often one-sided, leading to inaccurate information.

[0036] In view of this, embodiments of the present invention provide a question-answering method, comprising: responding to receiving a user's query request, decomposing the query task corresponding to the query request into multiple query sub-tasks based on multiple business entities, wherein the multiple business entities are extracted from the query text parsed from the query request; according to the dependencies between the multiple query sub-tasks, retrieving from the retrieval sources corresponding to each of the multiple query sub-tasks respectively, to obtain the retrieval sub-results of each of the multiple query sub-tasks, wherein the dependencies include at least pre-dependencies and conditional dependencies; and using a large language model to fuse the information of the multiple retrieval sub-results and the query text to obtain the answer text of the query request.

[0037] Figure 1 The diagram illustrates an application scenario of the question-and-answer method according to an embodiment of the present invention.

[0038] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0039] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0040] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0041] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0042] It should be noted that the question-and-answer method provided in the embodiments of the present invention can generally be executed by server 105. Correspondingly, the question-and-answer device provided in the embodiments of the present invention can generally be located in server 105. The question-and-answer method provided in the embodiments of the present invention can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the question-and-answer device provided in the embodiments of the present invention can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0043] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0044] Figure 2 A flowchart illustrating a question-and-answer method according to an embodiment of the present invention is shown schematically.

[0045] like Figure 2 As shown, the question-and-answer method in this embodiment includes operations S210 to S230.

[0046] In operation S210, in response to receiving a user's query request, the query task corresponding to the query request is decomposed into multiple query subtasks based on multiple business entities. The multiple business entities are extracted from the query text obtained by parsing the query request.

[0047] According to an embodiment of the present invention, a user's query request may be generated by the client based on the query text input by the user and sent by the client to the server. Upon receiving the query request, the server parses the query text from the query request.

[0048] For example, query request parsing methods can include message parsing, field parsing, etc. For instance, message header stripping parsing: removing protocol fields, checksums, and routing parameters from the request message header, and extracting the message payload as the original query text. For example, if the query request is a structured form message, extracting user input content as the query text according to preset key fields.

[0049] For example, the user's input query text could be "Regarding the fuel consumption of excavator A in 2025, and providing reasonable suggestions." The query task could be to query the fuel consumption of excavator A in 2025, and then query improvement measures based on the fuel consumption data.

[0050] The query text could also be "Please provide the sales data for excavator A for the past two years, including sales volume, customers, and prices." The query task could be to retrieve the sales volume, customers, and prices for excavator A for the past two years.

[0051] According to embodiments of the present invention, different business entities can correspond to different query subtasks. For example, a business entity can be a business time, and the corresponding query subtask can be a time range query. For example, a business entity can be a product identifier, and the corresponding query subtask can be a product query subtask.

[0052] In operation S220, based on the dependencies between multiple query subtasks, retrieval is performed from the retrieval sources corresponding to each of the multiple query subtasks to obtain the retrieval sub-results of each of the multiple query subtasks. The dependencies include at least pre-dependencies and conditional dependencies.

[0053] According to an embodiment of the present invention, the multiple query subtasks can be sorted according to the dependencies between them to obtain a query task sequence. Retrieval is then performed from the retrieval sources corresponding to each of the multiple query subtasks according to the query task sequence to obtain the retrieval results for each of the multiple query subtasks.

[0054] According to an embodiment of the present invention, the prerequisite dependency relationship can be that the two query subtasks are strongly serially constrained, and the subsequent query subtask can only start after the preceding query subtask has been fully executed and output a valid result; if the preceding task fails to execute or the result is invalid, the execution of the subsequent query subtask can be directly blocked.

[0055] According to an embodiment of the present invention, the conditional dependency relationship can be that the completion of the preceding query subtask is the basis, but whether to start the subsequent query subtask is determined by the output conditions of the preceding query subtask. If the preset business conditions are met, the subsequent query subtask is executed; otherwise, the query subtask is skipped. It should be noted that the preset business conditions can be set according to the actual query subtask situation and are not specifically limited.

[0056] For example, if there is a dependency between two query subtasks, the search is first performed from the retrieval source corresponding to the preceding query subtask to obtain its result. If the preceding query subtask result is valid, the search is then performed from the retrieval source corresponding to the following query subtask to obtain its result. If the preceding query subtask result is invalid or fails, the execution of the subsequent query subtask is directly blocked, and an invalid query feedback message can be output to the user's client.

[0057] For example, there might be a conditional dependency between two query subtasks. First, a search is performed from the retrieval source corresponding to the preceding query subtask to obtain its result. If the preceding query result meets the preset business conditions, a search can then be performed from the retrieval source corresponding to the following query subtask. If the preceding query result does not meet the preset business conditions, that query subtask can be skipped, and other query subtasks can continue to be executed.

[0058] In operation S230, the large language model is used to fuse information from multiple retrieval sub-results and query text to obtain the answer text of the query request.

[0059] According to an embodiment of the present invention, the large language model can be a generative artificial intelligence model trained based on a deep learning architecture, possessing multiple capabilities such as natural language understanding, named entity extraction, semantic intent recognition, logical reasoning decomposition, and thought chain content generation.

[0060] According to an embodiment of the present invention, the content generation capability of the large language model can be used to fuse multiple search sub-results and query text to obtain the answer text of the query request.

[0061] According to an embodiment of the present invention, the answer text may include reasoning sub-content formed by model logical deduction and conclusion sub-content of summary output.

[0062] According to embodiments of the present invention, by decomposing the query task corresponding to the query request into multiple query sub-tasks based on multiple business entities, a refined decomposition of complex queries can be achieved, closely aligning with the inherent logic of the user's question. Furthermore, based on the dependencies between the multiple query sub-tasks, retrieval is performed from the respective retrieval sources of each query sub-task to obtain the retrieval sub-results for each query sub-task. This intelligent scheduling of multiple retrieval sources overcomes the limitations of fixed retrieval paths.

[0063] By using a large language model to fuse information from multiple search sub-results and query texts to obtain the answer text, the information from multiple search sub-results and query texts can be taken into account, thus improving the accuracy of the answer when there is sufficient search data.

[0064] According to an embodiment of the present invention, based on multiple business entities, the query task corresponding to the user's query text is decomposed into multiple query sub-tasks, including: based on the query requirements corresponding to multiple business entities and preset business execution rules, the query task is decomposed into multiple query sub-tasks using the logical reasoning capability of a large language model.

[0065] According to embodiments of the present invention, a large language model can be used to extract business entities from query text by calling keyword extraction templates. For example, business entities may include queried equipment information, query intent types, etc. For instance, equipment information may include equipment attributes, equipment appearance descriptions, equipment uses, etc. Query intent types may include queries for basic equipment information, actual equipment operating status, basic information related to business, predictive information for business, etc.

[0066] According to embodiments of the present invention, the query requirement can be determined based on the query intent type. For example, the query intent type can be a query for basic device information, and the query requirement can obtain basic device information from device-related search sources. For example, the query intent type can be a query for business prediction information, and the query requirement can be to obtain historical business data from business search sources and make predictions based on the historical business data.

[0067] According to embodiments of the present invention, the preset business execution rules can be pre-set based on the actual situation of the business. For example, the business may be marketing products, and the preset business execution rules for this business may only allow querying basic product information, market changes, historical marketing records, etc. For example, the business may be quality inspection products, and the preset business rules for this business may include querying quality inspection categories and the corresponding qualified product parameters under each quality inspection category.

[0068] According to embodiments of the present invention, based on the query requirements corresponding to multiple business entities and preset business execution rules, the complex query task is decomposed into multiple query subtasks using the logical reasoning capabilities of a large language model. Furthermore, a retrieval task sequence can be generated based on the dependencies and execution priorities among these subtasks. The system can automatically identify data dependencies, logical order, and call relationships among the subtasks, rationally sort them according to execution priority, and generate an ordered retrieval task sequence. This ensures that subtasks are executed according to correct logic, avoiding problems such as data errors, task blocking, and duplicate retrievals caused by disordered execution order.

[0069] According to an embodiment of the present invention, relying on the powerful semantic understanding and logical reasoning capabilities of the large language model, it can first accurately analyze the core objectives, constraints and preset business execution rules of complex query requirements under multiple business entities, effectively avoiding problems such as requirement misunderstanding and rule omission that are easy to occur in manual decomposition, and decompose the overall complex query task layer by layer into query sub-tasks with clear boundaries and independent execution, which greatly reduces the execution difficulty and logical complexity of a single task.

[0070] According to an embodiment of the present invention, the business entity includes at least one of the following: the device identifier of the business, the device execution time, the device performance, and the fault type; the multiple query subtasks include at least two of the following: the device verification subtask, the operating condition query subtask, the device fault retrieval subtask, and the network supplementary retrieval subtask.

[0071] According to an embodiment of the present invention, the device identifier for a service can be a unique identifier for the device corresponding to that service. For example, a service can be product marketing, and the device corresponding to product marketing can be an excavator, whose device identifier can be "SWE150*06193". For example, a service can be executing a test script, and the device corresponding to this service can be a central processing unit (CPU), whose device identifier can be "cpu01".

[0072] According to an embodiment of the present invention, the device execution time can be used to lock the time range of the retrieval. For example, the device execution time can be "July 20, 2024 to August 16, 2024".

[0073] According to embodiments of the present invention, device performance can be used to define a performance range for retrieval. For example, for a fan, device performance can be rotational speed. For a robotic arm, device performance can be fuel consumption, working time, etc. Device performance varies for different devices and is not specifically limited.

[0074] According to embodiments of the present invention, the fault type can be set according to different equipment. For example, for an excavator, the fault type could be high fuel consumption, etc.

[0075] According to an embodiment of the present invention, the device verification subtask can be used to verify whether the device belongs to a preset device in a preset device list based on the device identifier. The preset device can be a product manufactured by a manufacturer or an operational device, and is not specifically limited thereto.

[0076] According to an embodiment of the present invention, the operating condition query subtask can query the operating condition of a device from a data source based on at least one of the following: device identifier, device execution time, and device performance.

[0077] According to an embodiment of the present invention, the equipment fault retrieval subtask may be to query the faults existing in the equipment from the data source based on the operating conditions of the equipment.

[0078] According to an embodiment of the present invention, the network-based supplementary retrieval subtask may involve querying relevant content about a device based on at least one of the following: device identifier, device execution time, device performance, and fault type.

[0079] According to an embodiment of the present invention, the equipment verification subtask verifies the validity of the equipment identifier; the operating condition query subtask retrieves structured data related to the equipment execution time and equipment performance from a first local database; the equipment fault retrieval subtask retrieves unstructured data related to equipment faults from a second local database; and the online supplementary retrieval subtask retrieves data related to the query task from a webpage.

[0080] According to an embodiment of the present invention, the device verification subtask may be to verify whether the device belongs to a preset device in a preset device list based on the device identifier. If the device belongs to a preset device in the preset device list, the device verification is determined to be successful; if the device does not belong to a preset device in the preset device list, the device verification is determined to be unsuccessful.

[0081] According to an embodiment of the present invention, the first local database may include operating condition information of various preset devices in a preset device list. For example, a large language model is invoked to convert natural language such as query text and multiple business entities into SQL (Structured Query Language) statements to connect to the first local database for query execution, and structured data related to device execution time and device performance are converted into tabular form.

[0082] According to embodiments of the present invention, the second local database may include document fragments containing performance-related information of various preset devices. For example, the device fault retrieval subtask may be a multi-level RAG (Retrieval-Augmented Generation) retrieval. A preliminary search can be performed based on various business entities, followed by a more comprehensive search based on the query text.

[0083] According to embodiments of the present invention, the network-based supplementary retrieval subtask can be a network retrieval triggered by the existence of a knowledge blind spot in at least one of the first and second local databases. For example, if at least one retrieval result in the operating condition query subtask or the equipment fault retrieval subtask has generally low relevance to the query text, a network-based supplementary retrieval subtask can be triggered, or the retrieval task sequence can be replanned.

[0084] According to embodiments of the present invention, knowledge fusion is performed through multi-source heterogeneous retrieval sub-results of structured, unstructured, and real-time information. Specifically, structured data from a first local database, unstructured document fragments from a second local database, real-time text from web searches, and query text are uniformly converted into natural language descriptions. Furthermore, a large language model is invoked in conjunction with thought chain prompts to integrate multi-source information for logical reasoning and answer generation. This achieves deep fusion of multi-source heterogeneous knowledge and complementary information advantages, thereby improving the comprehensiveness, accuracy, and timeliness of the answers.

[0085] According to an embodiment of the present invention, retrieving unstructured data related to equipment failure from a second local database includes: matching multiple business entities with multiple entity vectors in an entity vector sub-library of the second local database; if the matching result indicates that at least one of the multiple business entities does not exist in the entity vector sub-library, retrieving multiple candidate text vectors based on the query text in the text vector sub-library of the second local database; and selecting equipment failure retrieval sub-results from the multiple candidate text vectors based on the relevance between the query text and the candidate text vectors, as well as the timeliness of the candidate text vectors.

[0086] According to an embodiment of the present invention, the entity vector sub-database contains multiple entity vectors, each representing a vector of multiple preset business entities. These preset business entities can be obtained from various data sources such as historical query information and historical business information to cover diverse query requirements.

[0087] Multiple business entities are matched with multiple entity vectors in the entity vector sub-library of the second local database. If the entity vector sub-library contains at least one of the multiple business entities, unstructured data about equipment failures can be retrieved directly based on the multiple business entities.

[0088] If at least one of the multiple business entities is not present in the entity vector sub-library, a search is performed based on the query text in the text vector sub-library of a second local database to obtain multiple candidate text vectors. For example, the text vector sub-library may include vectors of document fragments about equipment malfunctions.

[0089] Global vector similarity retrieval is performed based on the relevance between the query text and the candidate text vectors, as well as the timeliness of the candidate text vectors. Then, the CrossEncoder model is used to sort multiple candidate text vectors to filter out the candidate text vectors with higher relevance, which are used as sub-results for equipment fault retrieval.

[0090] While related search-enhanced generation (RAG) systems can handle unstructured documents well, they lack the ability to integrate structured business data and real-time network information. The fragmentation of multi-source knowledge limits the accuracy and timeliness of the generated answers.

[0091] This invention filters and ranks multiple candidate text vectors based on the relevance between the query text and the candidate text vectors, as well as the timeliness of the candidate text vectors. Specifically, the final ranking score... Taking into account both semantic relevance and business rule weighting factors, the calculation formula is as follows:

[0092] (1)

[0093] It is the query text output by the CrossEncoder model. With candidate text vectors The correlation between them It is based on business rules (such as the timeliness of candidate text vectors). The weighting factors are calculated based on factors such as equipment model matching degree. and These are the relevance between the query text and the candidate text vectors, and the weight coefficients of the respective business rule weight factors, satisfying... This formula ensures that the final selected candidate text vectors are not only semantically most relevant but also best suited to the specific needs of the current business scenario.

[0094] According to embodiments of the present invention, multiple business entities are precisely matched with entity vectors in a second local database entity vector sub-library. This enables rapid location of structured entity data, achieving high-accuracy target retrieval. When the entity matching coverage is complete, reliable results are directly obtained, significantly improving retrieval efficiency and accuracy. When the matching results show that the entity vector sub-library is missing at least one business entity, a fallback strategy based on the query text for retrieval in the text vector sub-library is automatically switched to avoid retrieval failure or result interruption due to missing entities, ensuring the continuity and robustness of the retrieval process. At the same time, highly relevant content is filtered by combining the semantic relevance of the query text and candidate text vectors, and a secondary filtering is performed by incorporating the timeliness dimension of the candidate text vectors. This ensures that the retrieval results semantically match the query intent, prioritizes the use of the latest and most valuable text data, effectively eliminates outdated and irrelevant information, and ultimately obtains accurate, fresh, and highly available equipment fault retrieval sub-results.

[0095] Figure 3 The diagram illustrates a system framework schematic of a question-and-answer method according to an embodiment of the present invention.

[0096] like Figure 3 As shown, the overall system framework of the question-and-answer method can retrieve the source, service layer, and user interaction layer. Each module interacts through standardized asynchronous interfaces and relies on a thread pool to achieve high concurrency processing. The details are as follows:

[0097] The search sources may include a first local database (structured data) 301, a second local database (unstructured data) 302, and web pages 303.

[0098] The first local database (structured data) 301 can connect to a MySQL database for storing core data such as product information, operational status, and sales. It features built-in field mapping rules to automatically convert database fields to marketing natural language, supports the generation of compliant SQL statements from large language models, and enables accurate queries and result formatting.

[0099] The second local database (unstructured data) 302 can be a persistent entity vector sub-database built on LanceDB, supplemented by a text vector sub-database for auxiliary retrieval. An embedding model is used to generate vector indexes, and document slicing is performed to construct the text vector sub-database. Business entity retrieval and text vector retrieval are integrated to achieve a two-layer optimization of coarse screening of business entities and fine ranking of text vectors, improving retrieval accuracy.

[0100] A 303 error can be resolved by configuring request headers and timeout parameters through a search engine, allowing users to retrieve real-time industry news and competitor updates based on their queries. It includes built-in webpage parsing, cleaning, deduplication, and sensitive filtering modules to remove invalid and illegal information and supplement the knowledge base with real-time content not covered, ensuring information timeliness.

[0101] The service layer may include a preliminary content review module 304, a query task decomposition module 305, a query subtask scheduling module 306, an information fusion module 307, a cross-language adaptation module 308, and a high-concurrency management module 309.

[0102] The initial content review module 304 can be built on a semantic-level review engine based on a large language model, covering the entire process of user input, search results, and answer generation. It can accurately identify illegal content, has built-in interception logic, terminate the process and return a compliance prompt when there is a violation, and achieve full-link compliance control.

[0103] The query task decomposition module 305 can rely on a large language model to extract business entities such as device identifier, device execution time, device performance and fault type from compliant queries, and decompose complex query tasks into query subtasks such as device verification subtask, operating condition query subtask, device fault retrieval subtask and network supplement retrieval subtask; finally, it generates a JSON format query task sequence through a dynamic planner and schedules the subsequent retrieval process.

[0104] The query subtask scheduling module 306 can intelligently schedule retrieval paths based on the query task sequence through an inference-based dynamic routing mechanism, supporting single-route or multi-route combination execution. Related question-and-answer systems often use fixed retrieval paths, making it difficult to dynamically plan retrieval strategies based on the logical structure of user questions. They are unable to break down complex queries with multiple conditions and hops and intelligently schedule multiple data sources, resulting in biased answers.

[0105] The core scheduling logic of this invention is as follows: Structured query routing can be used to call a large language model to drive SQL generation, converting natural language into compliant SQL statements without injection risks, executing database queries, and formatting the results into standardized tables using the tabulate library. Vector retrieval routing can employ a hybrid retrieval strategy of keywords, vectors, and rules. For example, it first matches the entity vector sub-library; if no match is found, it performs a global vector retrieval, then uses CrossEncoder to sort and filter multiple candidate text vectors, while simultaneously filtering and sorting the results according to business rules. Network search routing can automatically trigger network searches for knowledge base blind spots or time-sensitive needs, fetching compliant webpage summaries as a supplement, and includes built-in retrieval priority and timeout interruption logic.

[0106] The information fusion module 307 can integrate results from multiple sources such as structured tables, document fragments, and web summaries, automatically splicing source information to construct an enhanced prompt context; it calls the large language model in conjunction with thought chain prompts to generate structured answers with reasoning processes; and it uses SSE (Server-Sent Events) streaming output technology to push the reasoning process and final answer in chunks, while simultaneously annotating the source of the answer and the generation prompts. The enhanced prompt context constructed by this module follows the following template structure to guide the large language model in structured reasoning and generation.

[0107] For example, the template structure followed by the context of enhanced cue words is as follows:

[0108] You are now an intelligent marketing assistant. Please answer user questions by combining "structured data", "knowledge base documents", and "real-time information".

[0109] Structured data: {Insert a formatted table here, such as equipment condition data}.

[0110] Knowledge base documents: {Insert relevant product manuals or technical document excerpts here}.

[0111] Real-time news: {Here inserts a summary of relevant news found through online search and its source link}.

[0112] Please follow these steps to think about and answer: Analyze structured data and summarize key indicators and trends; consult knowledge base documents to find the technical principles or explanations related to the question; refer to real-time information to obtain the latest industry trends or user feedback; synthesize all the above information to generate a final answer that is clearly structured and logically rigorous.

[0113] The user's question is: {the user's original query}.

[0114] Please first demonstrate your thought process, and then provide your final answer.

[0115] The cross-language adaptation module 308 can integrate with the interfaces of third-party translation applications, automatically identify the user's language, complete the translation of non-Chinese queries and the back-translation of answers, and achieve low-cost cross-border marketing Q&A adaptation.

[0116] The high-concurrency management module 309 can be based on a fast interface framework and a thread pool executor to achieve asynchronous non-blocking request processing, configure concurrency, rate limiting, and circuit breaker parameters, and ensure the efficiency and stability of large-scale enterprise-level access.

[0117] The user interaction layer may include a communication interface 310. The communication interface 310 can provide a standardized interface, adaptable to multiple platforms such as front-end pages, mini-programs, and enterprise management systems. Users send query requests via natural language, and the system returns a streaming output of the reasoning process and the final answer, simultaneously displaying reference sources, data links, and other tracing information.

[0118] Based on the complete source code of this invention, the server system deployment is completed, with the following specific steps: Configure the startup parameters of the fast interface framework service, bind the service address and log path, and enable asynchronous services. Load the large language model and embedding model, and configure model parameters. Initialize the LanceDB vector library by slicing business text information such as product manuals and technical documents and generating vector indexes; simultaneously, construct entity vector sub-libraries and text vector sub-libraries. Connect to the MySQL database through SQLAlchemy, configure the connection pool, and implement built-in field mapping rules to support intelligent SQL generation from the large language model. Enable sensitive review, high concurrency control, and SSE streaming output functions to complete the full-link initialization of the system. Integrate the interfaces of search engines and third-party translation applications, and configure the interface parameters.

[0119] According to embodiments of the present invention, a dynamic knowledge routing mechanism based on large language model reasoning is constructed to achieve task decomposition of complex queries and intelligent scheduling of multi-source knowledge sources, overcoming the limitations of fixed retrieval paths. A deep knowledge fusion generation method is designed to address the shortcomings of fragmented multi-source data; an industrial-grade hybrid retrieval optimization strategy is adopted to balance retrieval efficiency and accuracy, adapting to professionally intensive, large-scale industry scenarios.

[0120] According to embodiments of the present invention, based on the dependencies between multiple query subtasks, retrieval is performed from the databases corresponding to each of the multiple query subtasks to obtain the respective retrieval sub-results of the multiple query subtasks. This includes: based on the pre-dependency relationship between the device verification subtask and the operating condition query subtask, executing the operating condition query subtask after the device verification subtask is completed and the verification result indicates that the device identifier verification is passed, to obtain the device performance retrieval sub-result; based on the conditional dependency relationship between the operating condition query subtask and the device fault retrieval subtask, executing the device fault retrieval subtask when the operating condition query subtask indicates that the device is operating abnormally, to obtain the fault retrieval sub-result; based on the conditional dependencies between the operating condition query subtask, the device fault retrieval subtask, and the network supplementary retrieval subtask, executing the network supplementary retrieval subtask when the number of operating condition query sub-results and the number of fault retrieval sub-results obtained after completing the operating condition query subtask are less than a preset retrieval number, to obtain supplementary retrieval sub-results.

[0121] According to an embodiment of the present invention, the query text input by the user can be "Query the fuel consumption of equipment SWE150E06193 from July 20th to August 16th, 2024, and analyze the reasons for the high fuel consumption". A preliminary content review (such as semantic-level sensitivity detection) is performed by calling the large language model review interface. If the content is deemed compliant, it is allowed to proceed, and the request is logged.

[0122] Business entities are extracted based on a large language model. These entities can include equipment identifier "SWE150E06193", equipment execution time "from 2024-07-20 to 2024-08-16", equipment performance such as "working hours" and "fuel consumption", and fault type "analyze the reasons for high fuel consumption". Business entities can also include additional intents, such as business prediction information and equipment prediction information.

[0123] By leveraging the reasoning capabilities of a large language model, complex query tasks can be broken down into multiple sub-tasks. For example, the equipment verification sub-task verifies the validity of the equipment number, the operating condition query sub-task retrieves working hours and fuel consumption data for a specified time period from a first local database, and the equipment fault retrieval sub-task retrieves documents from a second local database about common reasons for high fuel consumption of the equipment.

[0124] Based on the prerequisite dependencies between the equipment verification subtask and the operating condition query subtask, the condition dependencies between the operating condition query subtask and the equipment fault retrieval subtask, and the condition dependencies between the operating condition query subtask, the equipment fault retrieval subtask, and the network supplementary retrieval subtask, the dynamic planner can output a retrieval task sequence.

[0125] Pre-dependency indicates that the equipment verification subtask and the operating condition query subtask have a preset execution order. For example, the equipment verification subtask is executed first, followed by the operating condition query subtask.

[0126] Conditional dependencies can include causal relationships and conditional triggering relationships.

[0127] A causal relationship can mean that the cause of equipment failure is retrieved only when equipment is malfunctioning. In other words, there is a causal relationship between the operating condition query subtask and the equipment failure retrieval subtask.

[0128] The conditional triggering relationship allows the network-based supplementary retrieval subtask to be triggered only when the number of operating condition query sub-results and the number of fault retrieval sub-results meet preset triggering conditions. Specifically, the network-based supplementary retrieval subtask is triggered if the total number of operating condition query sub-results and the total number of fault retrieval sub-results is less than a preset retrieval number. For example, if the sum of the number of operating condition query sub-results and the number of fault retrieval sub-results is less than the preset retrieval number, then the network-based supplementary retrieval subtask is triggered. The preset retrieval number can be any preset value such as 10, 15, or 20.

[0129] Therefore, when the equipment is malfunctioning, and the number of sub-results for operating condition query and fault retrieval is less than the preset number of retrievals, the query sub-tasks in the retrieval task sequence are executed in the following order: equipment verification sub-task, operating condition query sub-task, equipment fault retrieval sub-task, and network supplementary retrieval sub-task.

[0130] The work status query subtask may include calling the large language model to convert natural language conditions such as business entities and query text into SQL statements (without injection risk), executing the first local database query, and formatting the work status query sub-results into a table format.

[0131] The fault retrieval subtask can match multiple entity vectors in the entity vector sub-library by fault type "analyze the cause of high fuel consumption", accurately locate the vector table of equipment table "SWE150*06193", perform the retrieval of unstructured data about equipment faults, and sort and filter candidate text vectors by CrossEncoder. At the same time, the results are sorted according to business rules (such as fault type priority: fuel system > engine > hydraulic system).

[0132] The online supplementary retrieval subtask can search for "reasons for high excavator fuel consumption", obtain real-time webpage summaries and clean and filter them as supplementary context.

[0133] According to embodiments of the present invention, a hierarchical execution logic is constructed through pre-dependencies and conditional dependencies between tasks. Equipment identification verification is completed and passed before the operational status query is initiated, filtering invalid query requests at the source and avoiding useless computations. When equipment malfunctions, fault retrieval is automatically triggered to accurately locate the problem and output fault-related results, aligning with the business logic of fault diagnosis. When the total number of search results for both operational status and faults does not reach a preset quantity, network-based supplementary retrieval is proactively initiated to expand data sources. Information is dynamically supplemented based on the completeness of the results, effectively improving the richness and completeness of the search results.

[0134] According to an embodiment of the present invention, the above method further includes: if the verification result indicates that the device identifier verification fails, outputting feedback information of invalid query to the user's client; if the query result of the working condition query subtask indicates that the device is operating normally, executing the network supplementary retrieval subtask.

[0135] According to an embodiment of the present invention, if the device identification verification fails, it means that the verified device does not belong to the preset devices in the preset device list. Therefore, no relevant information can be found in the first local database and the second local database, and feedback information of invalid query can be output to the user's client.

[0136] According to an embodiment of the present invention, due to the conditional dependency between the operating condition query subtask and the equipment fault retrieval subtask—that is, equipment fault-related details are only queried when the equipment is operating abnormally—the network supplementary retrieval subtask can be executed directly when the equipment is operating normally.

[0137] According to an embodiment of the present invention, branch logic processing can be performed based on the device identification verification result and the device operating status. When the device identification verification fails, invalid query feedback is pushed in a timely manner to quickly inform the user of the problem and avoid the continued execution of invalid processes. When the device is operating normally, network supplementary retrieval is automatically triggered to further expand information sources and enrich query content.

[0138] According to embodiments of the present invention, the reasoning capabilities of a large language model are moved forward to the task planning stage. Complex user query requests are analyzed for intent, business entity extraction, and query task decomposition to generate multiple query sub-tasks. Based on the type of the query sub-tasks and their different dependencies, intelligent scheduling of routing paths such as structured queries, vector retrieval, and network searches is achieved. This enables on-demand combination and collaborative invocation of multiple knowledge sources, overcoming the limitations of fixed routing and providing the ability to handle complex queries with multiple conditions and hops.

[0139] Figure 4 The illustration shows a flowchart of how, according to an embodiment of the present invention, multiple query sub-tasks are retrieved from their respective databases based on the dependencies between them, resulting in the retrieval results for each query task.

[0140] like Figure 4 As shown, based on the dependencies between multiple query subtasks, retrieval is performed from the databases corresponding to each of the multiple query subtasks to obtain the retrieval sub-results of each query task, including operations S401~S413.

[0141] In operation S401, a user's query request is received.

[0142] Multiple business entities can be extracted from the query text obtained by parsing the query request.

[0143] For example, the server can identify the user's client's system language. If it is not Chinese, it will call the translation application interface to translate the query text into Chinese, so as to facilitate subsequent intent parsing and retrieval operations.

[0144] Based on multiple business entities, the query task corresponding to the query request is broken down into multiple query subtasks.

[0145] In operation S402, determine whether the preliminary content review has passed. If yes, proceed to operation S404; otherwise, proceed to operation S403.

[0146] Preliminary content review may include identifying inappropriate content in the query text and determining if there is built-in blocking logic in the query request. For example, by receiving a user's natural language query, basic parameters such as user ID, system language, and function type are parsed. The preliminary content review is then determined; if a violation is found, the query is blocked and an invalid query feedback message is output to the user's client; if it complies with the rules, it proceeds to the next step and the request is logged.

[0147] In operation S403, an invalid query feedback message is output to the user's client.

[0148] In operation S404, the query task corresponding to the query request is broken down into multiple query subtasks.

[0149] In operation S405, determine whether the multiple query subtasks include the device verification subtask. If yes, execute operation S406; otherwise, execute operation S408.

[0150] In operation S406, determine whether the verification result indicates that the device identification verification has passed. If yes, proceed to operation S407; otherwise, proceed to operation S403.

[0151] In operation S407, determine whether the multiple query subtasks include the working condition query subtask. If yes, execute operation S409; otherwise, execute operation S412.

[0152] The process ended after operating S408.

[0153] In operation S409, determine whether the result of the operating condition query subtask indicates that the equipment is operating abnormally. If yes, execute operation S410; otherwise, execute operation S412.

[0154] In operation S410, the equipment fault retrieval subtask is executed to obtain the fault retrieval sub-results.

[0155] In operation S411, determine whether the number of sub-results of the working condition query and the number of sub-results of the fault retrieval are less than the preset retrieval number. If yes, execute operation S412; otherwise, execute operation S413.

[0156] In operation S412, a network supplementary retrieval subtask is executed to obtain supplementary retrieval sub-results.

[0157] In operation S413, the large language model is used to fuse information from multiple retrieval sub-results and query text to obtain the answer text for the query request.

[0158] According to an embodiment of the present invention, information fusion is performed on multiple retrieval sub-results and query text using a large language model to obtain the answer text of the query request, including: attaching source information to each of the multiple retrieval sub-results and concatenating them with the query text to obtain the prompt word context; inputting the prompt word context into the large language model to obtain the answer text.

[0159] According to embodiments of the present invention, the source information may include the data source of the search sub-result and the time when the data source was generated or stored. After attaching source information to multiple search sub-results respectively, they are concatenated with the query text to construct an enhanced prompt context.

[0160] According to an embodiment of the present invention, a large language model is invoked in conjunction with the CoT (CoT) to generate a structured answer text that includes the reasoning process.

[0161] For example, the prompts can explicitly require the large language model to first output the thought process (analyzing data, comparing documents, and making a comprehensive judgment) before outputting the final conclusion.

[0162] According to embodiments of the present invention, adding source information to the retrieval sub-results can clarify the data source, improve the credibility and traceability of the content, and facilitate subsequent verification and problem localization; concatenating the processed retrieval results with the query text to construct the context of prompt words can provide a complete and relevant reference for the large language model, supplement semantic information, and enable the model to accurately understand the query intent; relying on rich contextual input, the large language model generates answer text, ensuring that the output content closely matches the real retrieval data.

[0163] According to an embodiment of the present invention, the method further includes: splitting the answer text into a model reasoning fragment and a target answer fragment according to the content attributes; and pushing the model reasoning fragment and the target answer fragment to the user's client in a preset order based on a preset communication protocol.

[0164] According to embodiments of the present invention, content attributes may include the reasoning process content and the final conclusion content of the large language model. For example, the reasoning process content may be used as a model reasoning segment, and the final conclusion content may be used as a target answer segment.

[0165] According to an embodiment of the present invention, the preset communication protocol may be SSE (Server-Sent Events) technology. The preset order may be the output order of the model reasoning fragment and the target answer fragment.

[0166] For example, SSE technology can be used to push model reasoning segments and target answer segments in chunks. Users first see a thought process sequence such as, "Analysis of database records: The device consumed 75-95 liters of fuel per day between July 20th and August 16th, higher than typical values; based on technical documentation, possible causes include a clogged fuel filter, engine tuning deviations, etc." They then receive a structured answer containing suggestions and links to the data sources. This completes the interaction.

[0167] According to embodiments of the present invention, text can be split based on content attributes, distinguishing between the reasoning process and the final answer, thus achieving structured content division; segmented push according to preset protocols and sequences can standardize data transmission format and output logic, ensuring that the client receives, parses, and displays content in an orderly manner, thereby improving the regularity, compatibility, and display experience of data transmission.

[0168] Figure 5 A flowchart illustrating a question-and-answer method according to another embodiment of the present invention is shown schematically.

[0169] like Figure 5 As shown, the question-and-answer method of this other embodiment includes operations S510 to S560.

[0170] When operating the S510, it receives user query requests and performs preliminary content review on the query requests.

[0171] When operating S520, the query text obtained from parsing the query request is converted into target language text.

[0172] For example, the query text is in English, and the target language text could be in Chinese. The query text needs to be converted to the target language text, i.e., Chinese. Multiple business entities can be extracted from the converted query text to facilitate subsequent operations and enable retrieval from multiple target language search sources.

[0173] When operating S530, the query task corresponding to the user's query text is broken down into multiple query subtasks.

[0174] In operation S540, based on the dependencies between multiple query subtasks, retrieval is performed from the retrieval sources corresponding to each of the multiple query subtasks to obtain the retrieval sub-results of each of the multiple query subtasks.

[0175] When operating the S550, the large language model is used to fuse information from multiple search sub-results and query text to obtain the answer text for the query request.

[0176] After the answer text is translated back into the S560, it is streamed to the user's client.

[0177] For example, based on content attributes, the answer text is split into a model inference fragment and a target answer fragment; the answer text can be in the target language, i.e., Chinese. After translating the answer text back into English corresponding to the query request, English versions of the model inference fragment and target answer fragment are obtained. Based on a preset communication protocol, the English versions of the model inference fragment and target answer fragment are pushed to the user's client in a preset order.

[0178] Based on innovative collaborative mechanisms such as dynamic routing based on reasoning, multi-source heterogeneous knowledge fusion generation, and hybrid retrieval optimization, a complete technical closed loop is constructed from complex query understanding, multi-source knowledge scheduling, heterogeneous information fusion to industrial-grade retrieval optimization, solving the deficiencies in multi-source heterogeneous processing, complex reasoning, and industrial adaptation.

[0179] Figure 6 A schematic block diagram of a question-and-answer device according to an embodiment of the present invention is shown.

[0180] like Figure 6 As shown, the question-and-answer device 600 of this embodiment includes a disassembly module 610, a retrieval module 620, and an information fusion module 630.

[0181] The decomposition module 610 is used to respond to a received user query request by decomposing the query task corresponding to the query request into multiple query subtasks based on various business entities. These multiple business entities are extracted from the query text parsed from the query request. In one embodiment, the decomposition module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0182] The retrieval module 620 is used to retrieve results from the retrieval sources corresponding to each of the multiple query subtasks based on the dependencies between them, thereby obtaining the retrieval sub-results for each of the multiple query subtasks. The dependencies include at least prerequisite dependencies and conditional dependencies. In one embodiment, the retrieval module 620 can be used to execute the operation S220 described above, which will not be repeated here.

[0183] The information fusion module 630 is used to fuse multiple retrieval sub-results and query text using a large language model to obtain the answer text of the query request. In one embodiment, the information fusion module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0184] According to an embodiment of the present invention, the business entity includes at least one of the following: the device identifier of the business, the device execution time, the device performance, and the fault type; the multiple query subtasks include at least two of the following: the device verification subtask, the operating condition query subtask, the device fault retrieval subtask, and the network supplementary retrieval subtask.

[0185] According to an embodiment of the present invention, the equipment verification subtask verifies the validity of the equipment identifier; the operating condition query subtask retrieves structured data related to the equipment execution time and equipment performance from a first local database; the equipment fault retrieval subtask retrieves unstructured data related to equipment faults from a second local database; and the online supplementary retrieval subtask retrieves data related to the query task from a webpage.

[0186] According to an embodiment of the present invention, retrieving unstructured data related to equipment failure from a second local database includes: matching multiple business entities with multiple entity vectors in an entity vector sub-library of the second local database; if the matching result indicates that at least one of the multiple business entities does not exist in the entity vector sub-library, retrieving multiple candidate text vectors based on the query text in the text vector sub-library of the second local database; and selecting equipment failure retrieval sub-results from the multiple candidate text vectors based on the relevance between the query text and the candidate text vectors, as well as the timeliness of the candidate text vectors.

[0187] According to an embodiment of the present invention, the retrieval module 620 includes a first execution submodule, a second execution submodule, and a third execution submodule. The first execution submodule is used to execute the operating condition query submodule to obtain a device performance retrieval sub-result based on the prerequisite dependency between the device verification sub-task and the operating condition query sub-task, provided that the device verification sub-task has been completed and the verification result indicates that the device identifier verification has passed. The second execution submodule is used to execute the device fault retrieval sub-task to obtain a fault retrieval sub-result based on the conditional dependency between the operating condition query sub-task and the device fault retrieval sub-task, provided that the query result of the operating condition query sub-task indicates that the device is operating abnormally. The third execution submodule is used to execute the network supplementary retrieval sub-result based on the conditional dependencies between the operating condition query sub-task, the device fault retrieval sub-task, and the network supplementary retrieval sub-task, provided that the number of operating condition query sub-results and the number of fault retrieval sub-results obtained after completing the operating condition query sub-task are less than a preset retrieval number.

[0188] According to an embodiment of the present invention, the above-described apparatus further includes an output module and an execution module. The output module is used to output feedback information indicating an invalid query to the user's client if the verification result indicates that the device identifier verification fails. The execution module is used to execute a network supplementary retrieval subtask if the query result of the operating condition query subtask indicates that the device is operating normally.

[0189] According to an embodiment of the present invention, the information fusion module 630 includes a splicing submodule and an input submodule. The splicing submodule is used to attach source information to multiple retrieval sub-results respectively, and then splice them with the query text to obtain the prompt word context; the input submodule is used to input the prompt word context into the large language model to obtain the answer text.

[0190] According to an embodiment of the present invention, the decomposition module 610 includes a decomposition submodule. The decomposition submodule is used to decompose a query task into multiple query subtasks based on the query requirements corresponding to multiple business entities and preset business execution rules, utilizing the logical reasoning capability of a large language model.

[0191] According to an embodiment of the present invention, the above-described apparatus further includes a splitting module and a pushing module. The splitting module is used to split the answer text into a model reasoning fragment and a target answer fragment according to the content attributes; the pushing module is used to push the model reasoning fragment and the target answer fragment to the user's client according to a preset communication protocol and in a preset order.

[0192] According to embodiments of the present invention, any plurality of modules among the disassembly module 610, retrieval module 620, and information fusion module 630 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the disassembly module 610, retrieval module 620, and information fusion module 630 can be at least partially implemented as a hardware circuit, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented by any other reasonable means of integrating or packaging the circuit, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the disassembly module 610, retrieval module 620, and information fusion module 630 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0193] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a question-and-answer method according to an embodiment of the present invention.

[0194] like Figure 7 As shown, an electronic device 700 according to an embodiment of the present invention includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0195] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in said one or more memories.

[0196] According to an embodiment of the present invention, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0197] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.

[0198] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a 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, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703 described above.

[0199] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the question-and-answer method provided in the embodiments of the present invention.

[0200] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0201] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0202] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0203] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0204] 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 the present invention. 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 a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may 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.

[0205] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.

[0206] The embodiments of the present invention have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of the invention. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the invention, and all such substitutions and modifications should fall within the scope of the invention.

Claims

1. A question-and-answer method, characterized in that, The method includes: In response to receiving a user's query request, the query task corresponding to the query request is decomposed into multiple query subtasks based on multiple business entities, wherein the multiple business entities are extracted from the query text parsed from the query request; Based on the dependencies between the multiple query subtasks, retrieval is performed from the retrieval sources corresponding to each of the multiple query subtasks to obtain the retrieval sub-results of each of the multiple query subtasks. The dependencies include at least pre-dependencies and conditional dependencies. By using a large language model to fuse information from multiple retrieval sub-results and the query text, the answer text for the query request is obtained.

2. The method according to claim 1, characterized in that, The business entity includes at least one of the following: the device identifier of the business, the device execution time, the device performance, and the fault type; The multiple query subtasks include at least two of the following: equipment verification subtask, operating condition query subtask, equipment fault retrieval subtask, and network supplementary retrieval subtask.

3. The method according to claim 2, characterized in that, The device verification subtask is to verify the validity of the device identifier; The operating condition query subtask retrieves structured data related to the device's execution time and performance from the first local database; The equipment fault retrieval subtask retrieves unstructured data related to equipment faults from the second local database. The online supplementary retrieval subtask retrieves data related to the query task from web pages.

4. The method according to claim 3, characterized in that, The step of retrieving unstructured data related to equipment failure from the second local database includes: Match the multiple business entities with multiple entity vectors in the entity vector sub-library of the second local database; If the matching result indicates that at least one of the multiple business entities does not exist in the entity vector sub-library, a search is performed in the text vector sub-library of the second local database based on the query text to obtain multiple candidate text vectors; Based on the correlation between the query text and the candidate text vector, and the timeliness of the candidate text vector, a device fault retrieval sub-result is obtained by filtering from multiple candidate text vectors.

5. The method according to claim 2, characterized in that, The step of retrieving data from the databases corresponding to each of the multiple query subtasks based on their dependencies to obtain the retrieval results for each of the multiple query subtasks includes: Based on the prerequisite dependency between the equipment verification subtask and the operating condition query subtask, after the equipment verification subtask is completed and the verification result indicates that the equipment identifier has passed verification, the operating condition query subtask is executed to obtain the equipment performance retrieval sub-result. Based on the conditional dependency between the operating condition query subtask and the equipment fault retrieval subtask, when the query result of the operating condition query subtask indicates that the equipment is operating abnormally, the equipment fault retrieval subtask is executed to obtain the fault retrieval sub-result. Based on the conditional dependencies between the operating condition query subtask, the equipment fault retrieval subtask, and the network supplementary retrieval subtask, if the number of operating condition query sub-results and the number of fault retrieval sub-results obtained by executing the operating condition query subtask are less than the preset retrieval number, the network supplementary retrieval subtask is executed to obtain supplementary retrieval sub-results.

6. The method according to claim 5, characterized in that, The method further includes: If the verification result indicates that the device identifier verification fails, an invalid query feedback message will be output to the user's client. If the query result of the operating condition query subtask indicates that the equipment is operating normally, the network supplementary retrieval subtask is executed.

7. The method according to claim 1, characterized in that, The process of fusing information from multiple retrieval sub-results and the query text using a large language model to obtain the answer text for the query request includes: After attaching source information to each of the multiple search sub-results, they are concatenated with the query text to obtain the context of the prompt words; The context of the prompt word is input into the large language model to obtain the answer text.

8. The method according to claim 1, characterized in that, Based on the multiple business entities, the query task corresponding to the user's query text is broken down into multiple query sub-tasks, including: Based on the query requirements corresponding to multiple business entities and the preset business execution rules, the query task is decomposed into multiple query sub-tasks using the logical reasoning capabilities of the large language model.

9. The method according to claim 1, characterized in that, The method further includes: Based on content attributes, the answer text is split into model reasoning fragments and target answer fragments; Based on a preset communication protocol, the model reasoning fragment and the target answer fragment are pushed to the user's client in a preset order.

10. A question-and-answer device, characterized in that, The device includes: The decomposition module is used to respond to a user's query request by decomposing the query task corresponding to the query request into multiple query subtasks based on multiple business entities, wherein the multiple business entities are extracted from the query text parsed from the query request; The retrieval module is used to retrieve from the retrieval sources corresponding to each of the multiple query subtasks according to the dependency relationship between the multiple query subtasks, and obtain the retrieval sub-results of each of the multiple query subtasks, wherein the dependency relationship includes at least the pre-dependency relationship and the conditional dependency relationship. The information fusion module is used to fuse multiple search sub-results and the query text using a large language model to obtain the answer text of the query request.