A dynamic optimization question and answer method, device and medium based on a multi-source knowledge base
By constructing a multi-source structured knowledge base and acquiring user feature data, generating dynamic retrieval priorities, and optimizing answer generation using a large language model, the problem of poor user experience in existing question-answering systems is solved, and efficient personalized answer output is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU YUNSHEN TECH CO LTD
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-05
Smart Images

Figure CN122153047A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of question-answering system technology, and in particular to a dynamic optimization question-answering method, device and medium based on a multi-source knowledge base. Background Technology
[0002] As enterprise IT infrastructure development deepens, internal business systems become increasingly complex, leading to frequent system issues encountered by R&D personnel, technical support staff, and business users in their daily work. Currently, enterprises typically manage and resolve these issues through multiple fragmented channels: such as recording bugs through the ZenTao system, handling technical inquiries through the middleware team, and documenting configuration problems through project documentation. When users encounter problems, they need to search on multiple platforms or consult relevant personnel, resulting in low problem-solving efficiency. Furthermore, the Q&A data accumulated from different channels is isolated, containing a large amount of duplicate and conflicting information.
[0003] To address these issues, a unified question-and-answer system can be implemented. However, most current question-and-answer systems employ a uniform retrieval strategy, relying solely on keyword or semantic matching. This results in inaccurate results and an inability to provide differentiated answers based on user identity (e.g., R&D personnel, customers) and individual needs and preferences. Consequently, users struggle to understand the answers, leading to a poor user experience. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a dynamic optimization question-answering method, device, and medium based on a multi-source knowledge base. Through multi-source data fusion and user feature adaptation, it can adjust the data retrieval priority for users and output accurate, reliable, and high-quality answers that meet user needs, thereby improving the user experience.
[0005] According to a first aspect of the present invention, a dynamic optimization question-answering method based on a multi-source knowledge base is provided, comprising the following steps: S1. Collect and standardize multiple question-and-answer data sources to construct a structured knowledge base; the structured knowledge base includes several knowledge base records, wherein each knowledge base record includes a preset standard question and standard answer.
[0006] S2, in response to a user's question request to the structured knowledge base, obtain the user characteristic data of the user who initiated the question request; the user characteristic data includes at least three dimensions: basic identity data, historical behavior data, and demand preference data.
[0007] S3. Based on user feature data and the current static basic weight of each knowledge base record, generate a dynamic retrieval priority for each knowledge base record for the user; the current static basic weight is calculated based on historical likes and feedback data of historical answers generated based on the corresponding knowledge base records.
[0008] S4. Based on the question request and dynamic retrieval priority, a search is performed in the structured knowledge base. The standard answers in the retrieved knowledge base records are optimized using a large language model to generate the target answer and output it.
[0009] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the above-described dynamic optimization question-answering method based on a multi-source knowledge base.
[0010] According to a third aspect of the present invention, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0011] The present invention has at least the following beneficial effects: This invention provides a dynamic optimization question-answering method based on a multi-source knowledge base. First, it collects and standardizes multiple question-answering data sources to construct a structured knowledge base, laying a high-quality data foundation for subsequent accurate retrieval and answer generation. Then, in response to user question requests to the structured knowledge base, it obtains the user's characteristic data, achieving accurate characterization of user identity and needs. Next, based on the user characteristic data and the current static base weight of each knowledge base record, it generates a dynamic retrieval priority corresponding to each knowledge base record for the user, achieving an organic combination of historical feedback and individual user preferences. Finally, based on the question request and dynamic retrieval priority, it performs a retrieval in the structured knowledge base. The standard answers in the retrieved knowledge base records are optimized using a large language model to generate the target answer and output it. This ensures that the retrieval ranking can both carry high-quality answers from historical experience and accurately adapt to the current user's identity and needs, significantly improving the relevance and personalization of the retrieval results. In summary, this invention, through multi-source data fusion and user characteristic adaptation, can adjust the data retrieval priority for users and output accurate, reliable, and high-quality answers that meet user needs, improving the user experience. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 The flowchart illustrates a dynamic optimization question-answering method based on a multi-source knowledge base, as provided in an embodiment of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] This invention provides a dynamic optimization question-answering method based on a multi-source knowledge base, such as... Figure 1 As shown, the method includes the following steps: S1 collects and standardizes multiple types of question-and-answer data sources to build a structured knowledge base; this can be understood as: the question-and-answer data source includes several types of preset questions and corresponding preset answers.
[0016] Specifically, the structured knowledge base includes several knowledge base records, each of which includes a preset standard question and standard answer. The standardization process includes text standardization and format standardization. Text standardization involves cleaning the question description and answer, removing special characters, redundant spaces, invalid line breaks, etc., and segmenting the text using a text segmentation algorithm to extract keywords for semantic matching in subsequent models. Format standardization involves unifying file encoding, naming rules, and attachment storage paths.
[0017] Furthermore, the structured knowledge base includes a schedule question base, a ZenTao question base, a middleware question base, and a knowledge base for storing configuration questions and functional questions.
[0018] The system includes several sections: a schedule issue repository to store frequently occurring schedule-related issues encountered by R&D personnel, such as schedule creation, modification, querying, and permission allocation, and to be updated regularly; a ZenTao issue repository to store all user-submitted bug-related issues exported from the internal ZenTao system, filtering for valid bug issues, and updating regularly; a middleware issue repository to store middleware-related technical issues handled by technical support personnel, focusing on issues containing images and code, such as screenshots of interface errors, configuration screenshots, error codes, and configuration codes; and a knowledge base for storing configuration and functional issues, categorized by project and product version, collecting configuration and functional issues for different projects and product versions.
[0019] As described above, by collecting and standardizing multiple question-and-answer data sources, a structured knowledge base containing standard questions and answers is constructed, laying a high-quality data foundation for subsequent accurate retrieval and answer generation, and ensuring that the question-and-answer system has standardized and reusable knowledge sources.
[0020] In a preferred embodiment, step S1 includes the following steps: S101, calculate the semantic similarity of preset questions between different question-and-answer data sources, and correct the semantic similarity according to the data feature matching situation to identify duplicate questions between different data sources; this can be understood as: when the corrected semantic similarity is greater than the preset threshold, it is considered a duplicate question.
[0021] Specifically, the semantic similarity is corrected using the following formula: F1 = F0 × (1 + η × E), where F1 is the corrected semantic similarity, F0 is the original semantic similarity, η is the feature influence coefficient, and E is the quantitative value of data feature matching. For example, a larger value is assigned to E when the problem scenario and the project to which it belongs are consistent.
[0022] S102, based on the identified duplicate questions between different question-and-answer data sources, identify conflicting answer data where the semantics of the preset answers corresponding to the duplicate questions are inconsistent in different question-and-answer data sources.
[0023] S103, Calculate the confidence level C of each conflicting answer data based on several preset evaluation dimensions; the preset evaluation dimensions include update time dimension, user feedback dimension, and data source dimension; wherein, the confidence level C of any conflicting answer data meets the following condition: C = ω1 × T + ω2 × (H / H) max )+ω3×S, where T is the quantified value of the update time of the conflicting answer data, H is the historical number of likes for the conflicting answer data, and H max S represents the maximum number of likes recorded in a knowledge base of the same type, S is the authoritative quantitative value of the data source, and ω1, ω2 and ω3 are the weights of each preset evaluation dimension.
[0024] The update time quantification value is inversely proportional to the time elapsed since the update. For example, an update within 7 days corresponds to a quantification value of 10 points, an update within 8-30 days corresponds to a quantification value of 8 points, an update within 31-90 days corresponds to a quantification value of 6 points, and an update more than 90 days corresponds to a quantification value of 3 points. The authoritative data source quantification value is related to the data source; for example, a problem from the middle platform library is worth 9 points, while a problem from the ZenTao library is worth 8 points.
[0025] S104, automatically resolve conflicting answer data based on confidence level, retain or merge high-confidence data, and generate standardized knowledge base records; this can be understood as: the standard questions and standard answers in the knowledge base records are the fusion results after resolution.
[0026] The above-mentioned methods, through duplicate identification, conflict detection, confidence quantification, and automatic resolution of multi-source data, eliminate data redundancy and semantic contradictions in the knowledge base from the source, generate highly consistent and reliable standardized knowledge base records, provide a clean and reliable data foundation for subsequent personalized retrieval and answer generation, and significantly improve the accuracy and stability of the question-answering system.
[0027] S2, in response to a user's question request to the structured knowledge base, obtain the user characteristic data of the user who initiated the question request; the user characteristic data includes at least three dimensions: basic identity data, historical behavior data, and demand preference data.
[0028] Specifically, the basic identity dimension includes information such as user type, department, associated projects, and job level; the historical behavior dimension includes information such as historical search keywords, types of answers viewed in the past, historical likes, and historical feedback and suggestions; and the demand preference dimension is the user preferences collected through first login guidance and dynamic learning, such as the level of detail in the answer, expression style, whether attachments are required, and code examples.
[0029] The above-mentioned approach, by acquiring feature data from three dimensions—basic user identity, historical behavior, and needs and preferences—achieves a precise characterization of user identity and needs. This provides reliable data support for providing personalized question-and-answer services, enabling the system to identify different users and generate corresponding personalized answers, thereby improving the user experience.
[0030] S3 generates a dynamic retrieval priority for each knowledge base record for each user based on user feature data and the current static base weight of each knowledge base record.
[0031] Specifically, the current static base weight is calculated based on historical likes from users on historical answers generated from corresponding knowledge base records.
[0032] Furthermore, the current static basic weights meet the following conditions: W1 = W0 × (1 + k × (L / L) max In this context, W1 represents the current static base weight of any knowledge base record, W0 represents the preset initial weight of any knowledge base record, k is the weight adjustment coefficient, and L is the total number of historical likes for the historical answers generated by any knowledge base record. max The highest number of likes for a knowledge base of the same type.
[0033] In one specific embodiment, the steps for generating the dynamic retrieval priority corresponding to the knowledge base record include the following: S301, based on several dimensions in the user feature data, calculates the degree of matching between the user feature data and each knowledge base record.
[0034] Specifically, the degree of matching P between user feature data and any knowledge base record meets the following conditions: Where U represents the user feature data vector, Z is any knowledge base record vector, and U i Z is the quantized value of the i-th feature dimension in the user feature data. i The quantized value of the i-th feature dimension corresponding to any knowledge base record pre-labeled by the system, where m is the total number of feature dimensions in the user feature data.
[0035] S302, calculate the dynamic retrieval priority for each knowledge base record based on its matching degree and current static base weight; wherein, the dynamic retrieval priority for any knowledge base record meets the following conditions: W2 = W1 × (1 + θ × P), where W2 represents the dynamic retrieval priority corresponding to any knowledge base record, W1 represents the current static basic weight of the knowledge base record, θ is the user feature influence coefficient, and P is the degree of matching between the user feature data and the knowledge base record.
[0036] As described above, by integrating real-time acquired user feature data and static basic weights pre-calculated based on historical likes and feedback, a personalized search priority is dynamically generated for each knowledge base record for the current user. This achieves an organic combination of historical feedback and individual user preferences, enabling the search ranking to not only carry high-quality answers from historical experience but also accurately adapt to the current user's identity and needs, significantly improving the relevance and personalization of search results.
[0037] S4. Based on the question request and dynamic retrieval priority, a search is performed in the structured knowledge base. The standard answers in the retrieved knowledge base records are optimized using a large language model to generate the target answer and output it.
[0038] Specifically, the retrieval in the structured knowledge base based on the question request and dynamic retrieval priority includes the following steps: S401, calculate the semantic similarity between the question request and each knowledge base record, and filter out knowledge base records whose semantic similarity exceeds a preset similarity threshold to form a candidate set. Those skilled in the art can set the preset similarity threshold according to actual needs, which will not be elaborated here.
[0039] S402: Based on the dynamic retrieval priority corresponding to each knowledge base record in the candidate set, the knowledge base records in the candidate set are sorted in descending order, and the top target number of knowledge base records are selected as the retrieval results; this can be understood as: the large language model optimizes the selected retrieval results and outputs the target answer.
[0040] The above-mentioned retrieval and personalized sorting based on question requests and dynamic retrieval priorities achieve a dual guarantee of content relevance and user adaptation. It ensures that the retrieval results are semantically accurate in matching the user's question, and that the sorting results match the user's personalized preferences, effectively improving the quality of the final answer and user satisfaction.
[0041] Furthermore, the method also includes the following steps: S10 collects user feedback data on the target answer and supplementary suggestion text through the user interaction interface, and stores the feedback data, supplementary suggestion text, target answer and corresponding knowledge base records in association.
[0042] S20 extracts effective content from supplementary suggestions in user feedback using a large language model, and automatically supplements or corrects the standard answers in the knowledge base records based on likes and the extracted effective content, forming a closed-loop optimization.
[0043] As described above, by collecting user feedback and suggestions on the target answer, and using a large language model to extract effective content from the suggestions, the knowledge base records are automatically supplemented and corrected. This enables the knowledge base to continuously learn and evolve from user interactions, thereby constantly improving the quality of answers and the level of system intelligence.
[0044] In another embodiment, step S4 further includes the following steps: S410, Calculate the quality score Q of the target answer; the formula for calculating the quality score Q is as follows: Q = α × (L0 / L) max )+β×(1-|V1-V2| / V max )+γ×(N1 / N2), where L0 is the maximum number of likes for the knowledge base record referenced in the target answer, L max V represents the maximum number of likes for a knowledge base of the same type, |V1-V2| represents the distance between the semantic vector of the target answer and the semantic vector recorded in the knowledge base, and V maxThe maximum semantic distance is defined as follows: N1 is the number of solution steps in the target answer, N2 is the expected number of steps, and α, β, and γ are preset weighting coefficients. It should be noted that, for example, if the target answer references multiple knowledge base records, the record with the highest number of upvotes is selected. In the formula, the upvote rate of the knowledge base records referenced by the target answer represents the reliability of the answer source, the distance between semantic vectors represents consistency, the ratio of the number of solution steps to the expected number of steps represents completeness, and the expected number of steps is obtained from the step metadata field stored in the knowledge base record.
[0045] S420, if the quality score exceeds a preset quality threshold, the target answer is directly output to the user interface. Those skilled in the art can set the preset quality threshold according to actual needs, which will not be elaborated here.
[0046] S430, if the quality score does not exceed the preset quality threshold, the parameters in the dynamic retrieval priority are readjusted, and the target answer is regenerated based on the adjusted parameters until the quality score of the regenerated target answer exceeds the quality threshold or the preset maximum number of retries is reached.
[0047] In a preferred embodiment, if the quality score does not exceed a preset quality threshold, the parameter θ in the dynamic retrieval priority is adjusted, and the adjustment amount Δθ meets the following conditions: Δθ=λ×(GQ)×W d Where G is the preset quality threshold, and W d λ represents the preset weight coefficient corresponding to the dimension with the highest deduction in Q, and λ is the learning rate used to control the adjustment compensation, typically set to 0.1. Specifically, when obtaining W... d When calculating the difference between the score of its corresponding dimension and the ideal score, the preset weight coefficient corresponding to the dimension with the largest difference is taken as W. d For example, if N1 / N2=0.5 and γ=0.3, then the integrity score for the integrity dimension is γ×(N1 / N2)=0.15, and the deduction is γ-0.15=0.15. If the integrity dimension has the highest deduction, then W... d =γ=0.3.
[0048] The above describes how a multi-dimensional quality scoring model is constructed to quantitatively evaluate the generated target answer. By introducing an iterative optimization mechanism of "scoring-feedback-retry," the system achieves automatic monitoring and dynamic correction of answer quality. When the quality of the generated answer fails to meet the standards, the system can automatically identify the dimension with the most severe deduction and precisely adjust the core parameters affecting that dimension accordingly. This allows for targeted optimization of the subsequent retrieval and generation processes, ensuring that the output target answer meets the preset standards in terms of reliability, consistency, and completeness. This significantly improves the system's stability and user experience.
[0049] Embodiments of the present invention also provide a non-transitory computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments. The at least one instruction or the at least one program is loaded and executed by the processor to implement the dynamic optimization question-answering method based on a multi-source knowledge base provided in the above embodiments.
[0050] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0051] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims
1. A dynamic optimization question-answering method based on a multi-source knowledge base, characterized in that, The method includes the following steps: S1. Collect and standardize multiple question-and-answer data sources to construct a structured knowledge base; the structured knowledge base includes several knowledge base records, wherein each knowledge base record includes a preset standard question and standard answer; S2, in response to a user's question request to the structured knowledge base, obtain the user characteristic data of the user who initiated the question request; the user characteristic data includes at least three dimensions: basic identity data, historical behavior data, and demand preference data; S3. Based on user feature data and the current static basic weight of each knowledge base record, generate a dynamic retrieval priority for each knowledge base record for the user; the current static basic weight is calculated based on historical likes and feedback data of historical answers generated based on the corresponding knowledge base records. S4. Based on the question request and dynamic retrieval priority, a search is performed in the structured knowledge base. The standard answers in the retrieved knowledge base records are optimized using a large language model to generate the target answer and output it.
2. The dynamic optimization question-answering method based on a multi-source knowledge base according to claim 1, characterized in that, The structured knowledge base includes a schedule question base, a ZenTao question base, a middle platform question base, and a knowledge base for storing configuration and functional questions.
3. The dynamic optimization question-answering method based on a multi-source knowledge base according to claim 1, characterized in that, Step S1 includes the following steps: S101, calculate the semantic similarity of preset questions between different question-and-answer data sources, and correct the semantic similarity based on the data feature matching to identify duplicate questions between different data sources; S102, Based on the identified duplicate questions between different question-and-answer data sources, identify conflicting answer data where the semantics of the preset answers corresponding to the duplicate questions are inconsistent in different question-and-answer data sources; S103, Calculate the confidence level C of each conflicting answer data based on several preset evaluation dimensions; the preset evaluation dimensions include update time dimension, user feedback dimension, and data source dimension; wherein, the confidence level C of any conflicting answer data meets the following condition: C = ω1 × T + ω2 × (H / H) max )+ω3×S, where T is the quantified value of the update time of the conflicting answer data, H is the historical number of likes for the conflicting answer data, and H max The maximum number of likes recorded in a knowledge base of the same type, S is the authoritative quantitative value of the data source, and ω1, ω2 and ω3 are the weights of each preset evaluation dimension, respectively. S104: Automatically resolve conflicting answer data based on confidence level, retain or merge high-confidence data, and generate standardized knowledge base records.
4. The dynamic optimization question-answering method based on a multi-source knowledge base according to claim 1, characterized in that, The current static base weights meet the following conditions: W1 = W0 × (1 + k × (L / L) max In this context, W1 represents the current static base weight of any knowledge base record, W0 represents the preset initial weight of any knowledge base record, k is the weight adjustment coefficient, and L is the total number of historical likes for the historical answers generated by any knowledge base record. max The maximum number of likes recorded for a knowledge base of the same type.
5. The dynamic optimization question-answering method based on a multi-source knowledge base according to claim 1, characterized in that, In step S3, the steps for generating the dynamic retrieval priority corresponding to the knowledge base record include the following: S301, based on several dimensions in the user feature data, calculate the degree of matching between the user feature data and each knowledge base record; S302, calculate the dynamic retrieval priority for each knowledge base record based on its matching degree and current static base weight; wherein, the dynamic retrieval priority for any knowledge base record meets the following conditions: W2 = W1 × (1 + θ × P), where W2 represents the dynamic retrieval priority corresponding to any knowledge base record, W1 represents the current static basic weight of the knowledge base record, θ is the user feature influence coefficient, and P is the degree of matching between the user feature data and the knowledge base record.
6. The dynamic optimization question-answering method based on a multi-source knowledge base according to claim 1, characterized in that, In step S4, the retrieval in the structured knowledge base based on the question request and dynamic retrieval priority includes the following steps: S401, calculate the semantic similarity between the question request and each knowledge base record, and filter out the knowledge base records whose semantic similarity exceeds a preset similarity threshold as a candidate set; S402, based on the dynamic retrieval priority corresponding to each knowledge base record in the candidate set, sort the knowledge base records in the candidate set in descending order, and select the top target number of knowledge base records as the retrieval results.
7. The dynamic optimization question-answering method based on a multi-source knowledge base according to claim 1, characterized in that, The method further includes the following steps: S10: Collect user feedback data on the target answer and supplementary suggestion text through the user interaction interface, and store the feedback data, supplementary suggestion text, target answer and corresponding knowledge base record in association; S20 extracts effective content from supplementary suggestions in user feedback using a large language model, and automatically supplements or corrects the standard answers in the knowledge base records based on likes and the extracted effective content, forming a closed-loop optimization.
8. The dynamic optimization question-answering method based on a multi-source knowledge base according to claim 1, characterized in that, Step S4 also includes the following steps: S410, Calculate the quality score Q of the target answer; the formula for calculating the quality score Q is as follows: Q = α × (L0 / L) max )+β×(1-|V1-V2| / V max )+γ×(N1 / N2), where L0 is the maximum number of likes for the knowledge base record referenced in the target answer, L max V represents the maximum number of likes for a knowledge base of the same type, |V1-V2| represents the distance between the semantic vector of the target answer and the semantic vector recorded in the knowledge base, and V max The maximum semantic distance is the preset value, N1 is the number of solution steps in the target answer, N2 is the expected number of steps, and α, β and γ are the preset weight coefficients. S420, if the quality score exceeds the preset quality threshold, the target answer will be directly output to the user interface; S430, if the quality score does not exceed the preset quality threshold, the parameters in the dynamic retrieval priority are readjusted, and the target answer is regenerated based on the adjusted parameters until the quality score of the regenerated target answer exceeds the quality threshold or the preset maximum number of retries is reached.
9. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the dynamic optimization question answering method based on a multi-source knowledge base as described in any one of claims 1-8.
10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.