Enterprise knowledge base query method based on large language model

By applying a large language model in enterprise knowledge base query, the problems of insufficient query flexibility and inefficiency in the existing technology are solved, efficient and accurate natural language query and personalized recommendation are achieved, and the knowledge base information is kept up to date.

CN119719345AInactive Publication Date: 2025-03-28SHANDONG ZHIQUN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202510220171.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing enterprise knowledge base query methods rely on traditional keyword matching or rule-based query technologies, and have problems such as insufficient flexibility, inefficiency and difficulty in dealing with natural language query.

Method used

The enterprise knowledge base query method based on a large language model is adopted. By preprocessing and storing the structured, semi-structured and unstructured data in the enterprise knowledge base, the user query statement is converted into vector representation, semantic understanding and intent analysis are carried out, comprehensive query vectors are generated, and parallel search and result fusion are carried out in combination with permission control.

Benefits of technology

It improves the accuracy and efficiency of query, supports natural language query, reduces user learning costs, realizes intelligent knowledge base query and personalized recommendation, and maintains the latest knowledge base information through automated learning and reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719345A_ABST
    Figure CN119719345A_ABST
Patent Text Reader

Abstract

The invention discloses an enterprise knowledge base query method based on a large language model, and relates to the technical field of information retrieval, and the method comprises the following steps: converting a user query statement into vector representation, and carrying out semantic understanding and intention analysis based on the large language model to generate a query vector; refining the query vector by using the multi-round dialogue capability of the large language model to obtain a comprehensive query vector; the user identity is obtained, and the user access permission is controlled in combination with the semantic understanding and intention analysis results of the large language model; performing parallel retrieval according to the comprehensive query vector in combination with the user access permission to generate a final query result; personalized recommendation is carried out on the user, the query effect is judged according to the user feedback score and the personalized recommendation accuracy, and the model is optimized according to the query effect. The problems that in the prior art, flexibility is insufficient, efficiency is low, and natural language query is difficult to process are solved; and the query accuracy and efficiency are improved by utilizing a large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information retrieval technology, and more specifically, to an enterprise knowledge base query method based on a large language model. Background Art

[0002] The enterprise knowledge base query method based on the large language model aims to use modern natural language processing technology and the powerful understanding ability of the large language model to extract valuable information from the enterprise knowledge base and improve the efficiency and accuracy of knowledge query. This method combines the natural language understanding of the large language model with the structured knowledge of enterprise data, and can automatically perform intelligent query, analysis and recommendation. With the continuous development of information and intelligent technology, enterprises have accumulated a large amount of business data, knowledge and experience in their daily operations. These data and information are usually stored in different databases, documents and systems, resulting in serious data islands. How to effectively integrate the enterprise knowledge base and quickly obtain valuable information has become an important task to improve the operational efficiency, decision support and innovation capabilities of enterprises.

[0003] Deficiencies of existing technologies: Most of the existing enterprise knowledge base query methods rely on traditional keyword matching or rule-based query technology, which have problems such as insufficient flexibility, low efficiency, and difficulty in processing natural language queries. Therefore, a new method is needed to better utilize the powerful understanding and generation capabilities of modern large language models to improve the accuracy and efficiency of queries. Using large language models (such as the GPT series) to process natural language queries can understand context and semantics, thereby providing more accurate results, and enhance the design of refined permission management systems based on semantic search, vector retrieval and other technologies, combining roles and tasks to control access rights, and using identity-based permission control (RBAC) and content-based permission control to ensure security. If the query results are inaccurate, users can correct the errors, and the model will absorb feedback information, continuously optimize the quality of answers, and further improve the knowledge base; large language models can quickly understand and process natural language queries raised by users. Compared with traditional keyword searches, users do not need to strictly follow specific search syntax or formats, but can directly express their needs in natural language.

[0004] In view of the above problems, the present invention proposes a solution. Summary of the invention

[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides an enterprise knowledge base query method based on a large language model, which solves the problems raised in the above-mentioned background technology through the enterprise knowledge base query method based on a large language model.

[0006] To achieve the above object, the present invention provides the following technical solutions: A method for querying an enterprise knowledge base based on a large language model comprises the following steps: Preprocess and store structured, semi-structured and unstructured data in enterprise knowledge base in different ways; Convert user query statements into vector representations, perform semantic understanding and intent analysis based on a large language model, generate query vectors, and use the multi-round dialogue capabilities of the large language model to refine the query vectors to obtain a comprehensive query vector. Obtain user identity and use identity-based access control (RBAC) and content-based access control (CBAC) combined with the results of semantic understanding and intent analysis of a large language model to control user access rights; Extract information related to structured, semi-structured and unstructured data based on the comprehensive query vector, perform parallel search on the enterprise knowledge base in combination with user access rights, and fuse the parallel search results to generate the final query results; Users provide feedback and ratings based on the query results, and personalized recommendations are made to users based on historical records. The query effect is judged based on the user feedback rating and the accuracy of personalized recommendations, and the model is optimized based on the query effect.

[0007] In a preferred embodiment, the process of preprocessing and storing structured, semi-structured and unstructured data in the enterprise knowledge base in different ways is as follows: Standardize structured data, convert structured data in different formats into a unified database table structure for storage, and extract key features as indexes for easy and fast retrieval; For semi-structured data, we use parsing algorithms to convert it into structured data format, and combine it with semantic annotation technology to add semantic tags to each data element to enhance the semantic understanding of the data; For unstructured data, natural language processing technology is used to perform word segmentation, part-of-speech tagging, and naming operations to extract key information from the text and convert it into vector representation, which is stored in a vector database.

[0008] In a preferred embodiment, the process of performing semantic understanding and intent analysis based on a large language model to generate a query vector is as follows: The vectorized query is input into the large language model, which analyzes the query vector based on pre-trained language knowledge and semantic understanding capabilities. The model uses a multi-layer neural network structure to extract features and encode semantics of input vectors to determine the subject, field, and intent of the user's query. The large language model generates vocabulary vectors based on the results of semantic understanding and intent analysis, combined with its own knowledge representation and reasoning mechanism; The weighted sum of the word vectors in the query statement is used to obtain a vector that reflects the query intent, that is, to generate a query vector.

[0009] In a preferred embodiment, the comprehensive query vector acquisition process is as follows: When the large language model determines that the initial query intent is ambiguous or uncertain, a multi-round dialogue mechanism is initiated. The model generates a guiding question based on the current understanding results and feeds it back to the user. After the user replies, the new reply content is merged with the original query statement, and word segmentation, vectorization, semantic understanding and intent analysis are performed again to further refine the query vector and combine it with the vector reflecting the query intent to obtain a comprehensive query vector.

[0010] In a preferred embodiment, the process of controlling user access rights is as follows: Confirm the user's identity through the authentication mechanism, determine the user's predefined role based on the user's identity, and confirm whether the user has the authority to access resources through RBAC; Analyze request semantics through the Large Language Model (LLM) to identify the content of the request. Based on the content of the user's request, analyze the sensitivity of the content through CBAC and dynamically decide whether to allow access. Combine the user's role and the content of the request to perform more fine-grained permission control on the request.

[0011] In a preferred embodiment, the process of extracting information related to structured, semi-structured and unstructured data according to the comprehensive query vector is as follows: Extract key information related to structured data from the query vector, match it in the structured data index library based on the extracted key information, and read the complete data record from the structured data storage area based on the index matching result; Analyze the query vector to determine the semantic keywords contained therein, search for tags matching the extracted semantic keywords in the semi-structured data semantic tag library, and select the corresponding semi-structured data from the semi-structured data storage area based on the tag matching results, perform preliminary analysis, and extract relevant fields and content; The query vector is similar to each data vector in the unstructured data vector database, and the unstructured data is sorted according to the similarity calculation results, and text fragments with higher similarity are selected.

[0012] In a preferred embodiment, the process of generating the final query result is as follows: Based on the extracted relevant information and user access rights, filter out the data range to which the user has access rights; Aggregate the results obtained from structured, semi-structured and unstructured data searches to form a unified result set; and add a source identifier to each piece of data in the set, indicating whether it comes from a structured data, semi-structured data or unstructured data search result; De-duplicate the integrated result set, evaluate and sort the de-duplicated results based on the relevance between the data and the query vector. For structured data, the ranking is based on the matching degree of the query conditions; for semi-structured data, the ranking is based on the matching degree of the semantic tags; for unstructured data, the ranking is based on the vector similarity; a relevance score is assigned to each piece of data; According to the relevance score, the data in the comprehensive result set is sorted, and the data with high relevance is placed in the front to form an ordered result list; The ordered list of results is fed into a large language model, which performs in-depth analysis of the results based on language understanding and reasoning capabilities. Based on the in-depth analysis results, the final query results are generated and returned to the user in the form of natural language.

[0013] In a preferred embodiment, the user performs feedback scoring according to the query results as follows: After the user obtains the query results, a rating interface is presented to the user, and corresponding text prompts are set to guide the user to evaluate the query results; The process of making personalized recommendations to users based on historical records is as follows: Build user profiles using machine learning algorithms based on users’ historical query records, browsing behaviors, and feedback scores; The K-Means clustering algorithm is used to divide users into different interest groups. The feature extraction technology (TF-IDF) is used to extract the keywords that users are interested in, and a profile is created for each user that includes interest preferences and business field concerns. Based on user portraits and enterprise knowledge base content, collaborative filtering algorithms are used to make personalized recommendations for users, and user groups with similar interests to the target user are found by calculating the similarity between users; Recommend knowledge content that similar users are interested in and that the target user has not searched for to the target user; The process of obtaining the personalized recommendation accuracy is as follows: The accuracy of personalized recommendations is calculated by weighted summing the ratio of the number of times users click on recommended content to the number of recommendation impressions, combined with the ratio of the number of further operations performed by users after clicking on recommended content to the number of clicks.

[0014] In a preferred embodiment, the step of judging the query effect according to the user feedback score and the personalized recommendation accuracy is as follows: User feedback rating and personalized recommendation accuracy are defined as input variables and divided into different fuzzy sets respectively; The query effect is defined as the output variable and divided into fuzzy sets; Formulate fuzzy rules to describe the impact of user feedback scores and personalized recommendation accuracy on query results; perform fuzzy reasoning based on fuzzy rules to judge query results.

[0015] The technical effects and advantages of the enterprise knowledge base query method based on a large language model of the present invention are as follows: 1. The present invention enables users to ask questions in a more natural and direct way by understanding the context and semantics of natural language, without having to rely on complex keywords or specific query syntax. When querying the knowledge base, enterprise employees only need to describe the problem in ordinary language, and the system can automatically understand and provide accurate answers, thereby greatly improving the efficiency and accuracy of the query. The query method based on the large language model can handle complex natural language expressions and support fuzzy queries and multiple expressions. Traditional knowledge base query systems often require users to enter precise keywords or fixed query conditions, while the large language model can automatically infer the user's true intentions and adapt to various natural language expressions, thereby reducing the user's learning cost. The large language model has powerful reasoning and generation capabilities, and can provide more intelligent services for enterprise knowledge base queries. Not only can it retrieve existing documents, but it can also generate new answers based on existing knowledge to help users better understand complex problems, and even provide reasonable speculation or suggestions for some questions that do not have clear answers.

[0016] 2. The present invention ensures that the information in the knowledge base is kept up to date by training and updating according to new enterprise documents and data. Through automated learning and reasoning processes, new knowledge can be quickly absorbed and applied to queries, avoiding the cumbersome process of manual intervention. Large language models can play a role in multiple fields, not only limited to knowledge queries in specific fields of enterprises, but also extended to cross-disciplinary knowledge fusion and query. For example, enterprises can apply a unified query interface in multiple scenarios such as different business fields and technical fields, making the cross-domain circulation of information more efficient. Through intelligent language models, users can obtain a more flexible interactive experience. The system can understand and accurately respond to user needs, reduce misunderstandings and repeated questions, and improve overall user satisfaction. In addition, more convenient services can be provided through voice recognition, conversational interfaces, etc. Traditional knowledge base query systems may require manual maintenance and management, especially in large-scale enterprises, where the cost of manual intervention is high. The query method based on the large language model can realize automated answers, reduce manual intervention, and save the operating costs of enterprises. The large language model can provide personalized query results based on the historical query records and preferences of different users. This personalized service can improve the relevance of information and the efficiency of users, helping enterprises to better meet the needs of different user groups. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 The present invention is a schematic diagram of the structure of an enterprise knowledge base query method based on a large language model. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Embodiment 1, Figure 1 The present invention provides an enterprise knowledge base query method based on a large language model.

[0020] S10, preprocessing and storing structured, semi-structured and unstructured data in the enterprise knowledge base in different ways; Standardize structured data, convert structured data in different formats into a unified database table structure for storage, and extract key features as indexes for easy and fast retrieval; For semi-structured data, a parsing algorithm is used to convert it into a structured data format. For example, an XML document is parsed into key-value pairs for storage, and semantic annotation technology is combined to add semantic tags to each data element to enhance the semantic understanding of the data. For unstructured data, natural language processing technology is used to perform word segmentation, part-of-speech tagging, and named entity recognition preprocessing operations to extract key information from the text and convert it into vector representation and store it in a vector database.

[0021] S20 converts user query statements into vector representations, performs semantic understanding and intent analysis based on the large language model, generates query vectors, and uses the multi-round dialogue capability of the large language model to interact with users, clarify user needs, and refine query vectors. The request sentence input by the user is processed by natural language processing tools to segment the sentence into independent vocabulary units; The word embedding technology is used to convert each word into a low-dimensional vector representation. The process is as follows: For the split independent vocabulary units ; Its context words are: , is the context window size, and the word vector is learned by maximizing the objective function. The objective function calculation formula is as follows: ;in ; In the formula, is the objective function, is a vocabulary, It is vocabulary The input vector is It is vocabulary The output vector of At the beginning of model training, the input vector and output vector are randomly initialized. During the training process, the input vector is updated through the back propagation algorithm according to the above objective function. As the training progresses, the output vector is constantly adjusted to better match the input vector, so that the model can accurately predict the context words.

[0022] The vectorized query statement is input into the large language model, which analyzes the query vector based on its pre-trained language knowledge and semantic understanding ability. The model uses a multi-layer neural network structure (such as the multi-head attention mechanism and feedforward neural network in the Transformer architecture) to extract features and semantically encode the input vector, thereby determining the subject, field, and possible intent direction of the user's query.

[0023] Based on the results of semantic understanding and intent analysis, the large language model combines its own knowledge representation and reasoning mechanism to generate an initial query vector. This vector can be regarded as a mathematical expression of the user's query intent, which contains key semantic features and weight information related to the query.

[0024] By weighted summing up the word vectors in the query, a vector representation that reflects the query intent is obtained; When the large language model determines that the initial query intent is ambiguous or uncertain, a multi-round dialogue mechanism is initiated. The model generates a guiding question based on the current understanding results and feeds it back to the user. After the user replies, the new reply content is merged with the original query statement, and the steps of word segmentation, vectorization, semantic understanding and intent analysis are performed again to further refine the query vector and obtain a comprehensive query vector; the calculation formula of the comprehensive query vector is: ; In the formula, is the comprehensive query vector, is a vector reflecting the query intent, is the refined query vector, is the weighting factor.

[0025] S30, obtain the user identity, use identity-based access control (RBAC) and content-based access control (CBAC) combined with the results of large language model semantic understanding and intent analysis to control user access rights; The system confirms the user's identity through authentication mechanisms (such as username / password, two-factor authentication, biometrics, etc.) and determines the user's predefined role based on the user's identity; The system uses a large language model (LLM) to analyze the semantics of the request and identify the content of the request. When a user requests the system to access data or perform an operation through natural language, LLM can analyze the user's intentions, understand their specific needs, and perform in-depth analysis of the semantics of the request to identify whether the request involves sensitive information.

[0026] The system uses RBAC to confirm whether the user has the authority to access resources. If the user is a common user, his role only allows access to basic data, but cannot operate sensitive data. In this case, RBAC will limit the user's access rights according to the role definition. Based on the content of the user's request, the system analyzes the sensitivity of the content through CBAC and dynamically decides whether to allow access. Combined with the user's role and the content of the request, the system can perform more fine-grained permission control on the request through LLM.

[0027] The system combines identity-based access control (RBAC), content-based access control (CBAC), and semantic analysis and intent recognition of large language models to determine whether users are allowed to access specific resources or perform certain operations. This comprehensive control method can achieve flexible and secure access management while avoiding overly rigid access control and providing more personalized and dynamic access authorization.

[0028] S40, extracting information related to structured, semi-structured and unstructured data according to the comprehensive query vector, performing parallel search on the enterprise knowledge base in combination with user access rights, and fusing the parallel search results to generate a final query result; Extract key information related to structured data from the query vector, such as specific attribute names, value ranges, etc., and match them in the structured data index library based on the extracted key information. If the index library is built based on data structures such as B-Tree and Hash, use these index structures to quickly locate the location of the data records that meet the conditions. According to the index matching results, read the complete data records from the structured data storage area and process them; Analyze the query vector to determine the semantic keywords contained therein. For example, if the query vector contains "customer contract related information", extract semantic keywords such as "customer contract"; search for tags matching the extracted semantic keywords in the semi-structured data semantic tag library. The semantic tag library can be built based on structures such as inverted indexes to facilitate quick search. For example, find all semi-structured data records marked as "customer contract" related; based on the results of tag matching, select the corresponding semi-structured data from the semi-structured data storage area, such as XML documents, emails, etc., and perform preliminary analysis to extract relevant fields and content; Calculate the similarity between the query vector and each data vector in the unstructured data vector database, sort the unstructured data according to the similarity calculation results, and select text fragments with higher similarity; Based on the extracted relevant information and user access rights, filter out the data range that the user has access rights to. For example, if the user belongs to the sales department, his / her rights can only access sales-related data. Then, for queries related to the "R&D department", it is necessary to determine whether the user has cross-department access rights. If not, limit the query scope to data that can be associated with the sales department.

[0029] Aggregate the results from structured, semi-structured, and unstructured data searches to form a unified result set. Add a source identifier to each piece of data in the set, indicating whether it comes from a structured, semi-structured, or unstructured data search result.

[0030] De-duplicate the integrated result set by comparing key features of the data (such as the primary key of structured data, the unique identifier of semi-structured data, and the text fingerprint of unstructured data) to remove duplicate data records and avoid displaying redundant information to users.

[0031] The deduplicated results are evaluated and sorted based on the relevance of the data to the query vector. For structured data, the order is based on the matching degree of the query conditions; for semi-structured data, the order is based on the matching degree of the semantic tags; for unstructured data, the order is based on the vector similarity. A relevance score is assigned to each piece of data.

[0032] According to the relevance score, the data in the comprehensive result set is sorted, and the data with high relevance is placed in the front to form an ordered result list.

[0033] The ordered list of results is input into the large language model, which performs in-depth analysis of the results based on its powerful language understanding and reasoning capabilities.

[0034] During the analysis process, the large language model uses its own knowledge reserves to fill in the knowledge gaps in the results.

[0035] The large language model generates the final accurate and complete query results based on the results of deep reasoning and returns them to the user in the form of natural language.

[0036] S50, the user provides feedback and rating based on the query results, and personalized recommendations are made to the user based on historical records. The query effect is judged based on the user feedback rating and the accuracy of personalized recommendations, and the model is optimized based on the query effect.

[0037] After the user obtains the query results, a concise and clear rating interface is presented to the user, with a numerical rating (1 - 5 points) and corresponding text prompts to guide the user to evaluate the accuracy, completeness, relevance and other aspects of the query results.

[0038] For example, prompt the user to "Please rate the degree to which the query results meet your needs, 1 point means very dissatisfied and 5 points means very satisfied."

[0039] Based on the user's historical query records, browsing behavior, feedback ratings and other data, a user portrait is constructed using a machine learning algorithm. The K-Means clustering algorithm is used to divide users into different interest groups, and feature extraction technology (TF-IDF) is used to extract keywords that users are interested in, thereby establishing a portrait for each user that includes information such as interest preferences and business field concerns.

[0040] Based on user portraits and enterprise knowledge base content, a collaborative filtering algorithm is used to make personalized recommendations for users. By calculating the similarity between users, user groups with similar interests to the target user are found, and then knowledge content that these similar users are interested in and has not been searched by the target user is recommended to the target user.

[0041] The ratio of the number of times users click on recommended content to the number of recommended impressions is combined with the ratio of the number of times users perform further operations (such as viewing details, downloading documents, etc.) after clicking on the recommended content to the number of clicks, and the personalized recommendation accuracy is calculated by weighted summation. The steps to judge the query effect based on user feedback scores and personalized recommendation accuracy are as follows: In step C1, user feedback scores and personalized recommendation accuracy are defined as input variables, and they are divided into different fuzzy sets.

[0042] For example, "Low", "Medium", "High" for user feedback ratings, and "Low", "Medium", "High" for personalized recommendation accuracy.

[0043] Step C2, define the query effect as the output variable and divide it into fuzzy sets, for example, "Low", "High", for the query effect.

[0044] Step C3, formulate a set of fuzzy rules to describe the impact of different input variables on output variables. The definition of rules can be based on professional knowledge or obtained through data analysis and experiments. For example: Mark the user feedback score as B, the personalized recommendation accuracy as P, and the query effect as D, then we can define Rule 1: IF (B is High) AND (P is High) THEN (D is High ) Rule 2: IF (B is Low) AND (P is Low) THEN (D is Low ) ... Step C4, perform fuzzy reasoning according to fuzzy rules to determine the query effect.

[0045] It should be noted that the division of fuzzy sets can be adjusted according to actual conditions. For example, although this embodiment takes three fuzzy sets as an example, in fact, the user feedback score, personalized recommendation accuracy and query effect can be divided into more than three sets to facilitate better precise adjustment.

[0046] Furthermore, for the judgment of the query effect, a threshold can be set according to the actual situation. For example, when the user feedback score exceeds 4, it is marked as "High"; when the personalized recommendation accuracy is higher than 80%, it is marked as "High", etc., which will not be elaborated here.

[0047] In the process of adjusting the weight parameters of the large language model, the gradient of the loss function with respect to the model parameters is calculated through the back-propagation algorithm, and then the parameters are updated according to the gradient direction to reduce the loss function value and improve the model performance.

[0048] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0049] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product.

[0050] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0051] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0052] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0053] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for querying an enterprise knowledge base based on a large language model, characterized in that: The following steps are involved: Preprocess and store structured, semi-structured and unstructured data in enterprise knowledge base in different ways; Convert user query statements into vector representations, perform semantic understanding and intent analysis based on a large language model, generate query vectors, and use the multi-round dialogue capabilities of the large language model to refine the query vectors to obtain a comprehensive query vector. Obtain user identity and use identity-based access control (RBAC) and content-based access control (CBAC) combined with the results of semantic understanding and intent analysis of a large language model to control user access rights; Extract information related to structured, semi-structured and unstructured data based on the comprehensive query vector, perform parallel search on the enterprise knowledge base in combination with user access rights, and fuse the parallel search results to generate the final query results; Users provide feedback and ratings based on the query results, and personalized recommendations are made to users based on historical records. The query effect is judged based on the user feedback rating and the accuracy of personalized recommendations, and the model is optimized based on the query effect.

2. The enterprise knowledge base query method based on a large language model according to claim 1, characterized in that: The process of preprocessing and storing structured, semi-structured and unstructured data in the enterprise knowledge base in different ways is as follows: Standardize structured data, convert structured data in different formats into a unified database table structure for storage, and extract key features as indexes for easy and fast retrieval; For semi-structured data, we use parsing algorithms to convert it into structured data format, and combine it with semantic annotation technology to add semantic tags to each data element to enhance the semantic understanding of the data; For unstructured data, natural language processing technology is used to perform word segmentation, part-of-speech tagging, and naming operations to extract key information from the text and convert it into vector representation, which is stored in a vector database.

3. The enterprise knowledge base query method based on a large language model according to claim 2, characterized in that: The process of converting the user query statement into a vector representation is as follows: The request sentence input by the user is processed by natural language processing tools to segment the sentence into independent vocabulary units; The word embedding technology is used to convert each word into a low-dimensional vector representation. The process is as follows: For the separated independent vocabulary units , whose context words are: , is the context window size, and the word vector is learned by maximizing the objective function; The objective function calculation formula is as follows: ;in ; In the formula, is the objective function, is a vocabulary, It is vocabulary The input vector is It is vocabulary The input and output vectors are randomly initialized.

4. The enterprise knowledge base query method based on a large language model according to claim 3 is characterized in that: The process of generating a query vector by performing semantic understanding and intent analysis based on a large language model is as follows: The vectorized query is input into the large language model, which analyzes the query vector based on pre-trained language knowledge and semantic understanding capabilities. The model uses a multi-layer neural network structure to extract features and encode semantics of input vectors to determine the subject, field, and intent of the user's query. The large language model generates vocabulary vectors based on the results of semantic understanding and intent analysis, combined with its own knowledge representation and reasoning mechanism; The weighted sum of the word vectors in the query statement is used to obtain a vector that reflects the query intent, that is, to generate a query vector.

5. The enterprise knowledge base query method based on a large language model according to claim 4 is characterized in that: The comprehensive query vector acquisition process is as follows: When the large language model determines that the initial query intent is ambiguous or uncertain, a multi-round dialogue mechanism is initiated. The model generates a guiding question based on the current understanding results and feeds it back to the user. After the user replies, the new reply content is merged with the original query statement, and word segmentation, vectorization, semantic understanding and intent analysis are performed again to further refine the query vector and combine it with the vector reflecting the query intent to obtain a comprehensive query vector. The calculation formula of the comprehensive query vector is: ; In the formula, is the comprehensive query vector, is a vector reflecting the query intent, is the refined query vector, is the weighting factor.

6. The enterprise knowledge base query method based on a large language model according to claim 5, characterized in that: The process of controlling user access rights is as follows: Confirm the user's identity through the authentication mechanism, determine the user's predefined role based on the user's identity, and confirm whether the user has the authority to access resources through RBAC; Analyze request semantics through the Large Language Model (LLM) to identify the content of the request. Based on the content of the user's request, analyze the sensitivity of the content through CBAC and dynamically decide whether to allow access. Combine the user's role and the content of the request to perform more fine-grained permission control on the request.

7. The enterprise knowledge base query method based on a large language model according to claim 6, characterized in that: The process of extracting information related to structured, semi-structured and unstructured data according to the comprehensive query vector is as follows: Extract key information related to structured data from the query vector, match it in the structured data index library based on the extracted key information, and read the complete data record from the structured data storage area based on the index matching result; Analyze the query vector to determine the semantic keywords contained therein, search for tags matching the extracted semantic keywords in the semi-structured data semantic tag library, and select the corresponding semi-structured data from the semi-structured data storage area based on the tag matching results, perform preliminary analysis, and extract relevant fields and content; The query vector is similar to each data vector in the unstructured data vector database, and the unstructured data is sorted according to the similarity calculation results, and text fragments with higher similarity are selected.

8. The enterprise knowledge base query method based on a large language model according to claim 7, characterized in that: The process of generating the final query result is as follows: Based on the extracted relevant information and user access rights, filter out the data range to which the user has access rights; Aggregate the results from structured, semi-structured, and unstructured data searches into a unified result set; And add a source identifier for each piece of data in the collection, indicating whether it comes from structured data, semi-structured data or unstructured data search results; De-duplicate the integrated result set, evaluate and sort the de-duplicated results based on the relevance of the data to the query vector, and for structured data, based on the matching degree of the query conditions; For semi-structured data, a relevance score is assigned based on the matching degree of semantic tags; for unstructured data, a relevance score is assigned based on vector similarity; According to the relevance score, the data in the comprehensive result set is sorted, and the data with high relevance is placed in the front to form an ordered result list; The ordered list of results is fed into a large language model, which performs in-depth analysis of the results based on language understanding and reasoning capabilities. Based on the in-depth analysis results, the final query results are generated and returned to the user in the form of natural language.

9. The enterprise knowledge base query method based on a large language model according to claim 8, characterized in that: The user's feedback scoring process based on the query results is as follows: After the user obtains the query results, a rating interface is presented to the user, and corresponding text prompts are set to guide the user to evaluate the query results; The process of making personalized recommendations to users based on historical records is as follows: Build user profiles using machine learning algorithms based on users’ historical query records, browsing behaviors, and feedback scores; The K-Means clustering algorithm is used to divide users into different interest groups. The feature extraction technology (TF-IDF) is used to extract the keywords that users are interested in, and a profile is created for each user that includes interest preferences and business field concerns. Based on user portraits and enterprise knowledge base content, collaborative filtering algorithms are used to make personalized recommendations for users, and user groups with similar interests to the target user are found by calculating the similarity between users; Recommend knowledge content that similar users are interested in and that the target user has not searched for to the target user; The process of obtaining the personalized recommendation accuracy is as follows: The accuracy of personalized recommendations is calculated by weighted summing the ratio of the number of times users click on recommended content to the number of recommendation impressions, combined with the ratio of the number of further operations performed by users after clicking on recommended content to the number of clicks.

10. The enterprise knowledge base query method based on a large language model according to claim 9, characterized in that: The steps of judging the query effect based on the user feedback score and the personalized recommendation accuracy are as follows: User feedback rating and personalized recommendation accuracy are defined as input variables and divided into different fuzzy sets respectively; The query effect is defined as the output variable and divided into fuzzy sets; Formulate fuzzy rules to describe the impact of user feedback scores and personalized recommendation accuracy on query results; Perform fuzzy reasoning based on fuzzy rules to determine the query effect.

Citation Information

Patent Citations

  • BERT-based machine reading understanding method, apparatus and device, and storage medium

    CN112464641A

  • Knowledge question-answering method based on big data and related products

    CN117828048A

  • Multi-element mixed retrieval method, device and equipment

    CN118260452A

  • Man-machine interaction type query optimization method and system for incomplete query

    CN118643060A

  • Dialogue method and device based on language model, storage medium and electronic device

    CN118863043A

Cited By

  • Interactive intelligent analysis method and device based on knowledge graph and medium

    CN120045686A

  • SQL (Structured Query Language) statement generation method based on large-model multi-stage iteration

    CN120086244A

  • Recommendation method and system based on user product use behavior

    CN120144751A

  • Government affair industry intelligent information retrieval and pushing system and method based on large model

    CN120336504A

  • Intention classification method and device based on vector retrieval and context awareness and medium

    CN120448929A