Knowledge base version control method and device, medium and product

By calling large language models in the RAG knowledge base to retrieve and generate the version number of the knowledge base document, the problems of inefficiency and confusing version number when manually labeling the version number is solved, and the intelligence and logic of the version management of the knowledge base document are realized.

CN120146026AActive Publication Date: 2025-06-13PIPECHINA SOUTH CHINA CO +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510624643.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-06-13
Estimated Expiration
2045-05-15

AI Technical Summary

Technical Problem

In the prior art, when managing RAG knowledge base documents by manually marking document version numbers, it is less efficient, and the generation of version numbers lacks logic and coherence, which can easily lead to confusion.

Method used

By calling the large language model, the historical version number of the knowledge base document is retrieved from the search-enhanced knowledge base, and a new version number with logical relationship with the historical version number is generated to realize intelligent version management of the knowledge base document.

Benefits of technology

It improves the intelligence level of the knowledge base document version management, solves the problems of inefficiency and confusing version numbers when manually labeling version numbers, and realizes the logic and coherence of version numbers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146026A_ABST
    Figure CN120146026A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge base version control method and device, a medium and a product, relates to the technical field of artificial intelligence, and aims to solve the problems of low efficiency and disordered version numbers during manual document version number labeling. The knowledge base version control method comprises the following steps: receiving an uploaded knowledge base document; calling a large language model, and retrieving at least one historical version number of the knowledge base document from the retrieval enhancement generation knowledge base; the time interval between the uploading of the knowledge base document and the generation of the at least one historical version number is smaller than the time interval between the uploading of the knowledge base document and the generation of other historical version numbers, and the other historical version numbers are historical version numbers of knowledge base documents except the at least one historical version number in the retrieval enhancement generation knowledge base; the at least one historical version number is input into the large language model, a first version number of the knowledge base document is generated, and a logic relation exists between the first version number and the at least one historical version number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular, to a knowledge base version control method, device, medium, and product. Background Art

[0002] With the rapid development of artificial intelligence (AI) technology, retrieval-augmented generation (RAG) is one of the popular cutting-edge technologies of large models. RAG is a generative AI method for large language models (LLMs). When a large language model needs to generate text or answer questions, it first retrieves relevant information from a large collection of documents (i.e., the RAG knowledge base), and then uses this retrieved information to guide the generation of text, thereby improving the quality and accuracy of predictions. However, with the continuous accumulation and update of documents in the RAG knowledge base, it is easy to cause document chaos. In the related art, documents are managed by manually annotating document version numbers.

[0003] However, when managing documents by manually annotating document version numbers, the efficiency is low, and the generation of version numbers lacks logic and coherence, which is easy to cause chaos. Therefore, how to effectively manage different versions of documents in the RAG knowledge base to improve the intelligent level of version management has become an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this application is to provide a knowledge base version control method, device, medium, and product, aiming to solve the problems of low efficiency and chaotic version numbers when manually annotating document version numbers.

[0005] To achieve the above object, this application adopts the following technical solutions: In a first aspect, this application provides a knowledge base version control method, including: receiving an uploaded knowledge base document; calling a large language model to retrieve at least one historical version number of the knowledge base document from the retrieval-augmented generation knowledge base; the time interval between uploading the knowledge base document and generating at least one historical version number is less than the time interval between uploading the knowledge base document and generating other historical version numbers, where the other historical version numbers are the historical version numbers of the knowledge base document in the retrieval-augmented generation knowledge base except for the at least one historical version number; inputting the at least one historical version number into the large language model to generate a first version number of the knowledge base document, and there is a logical relationship between the first version number and the at least one historical version number.

[0006] The knowledge base version control method provided by the embodiments of the present application, when a new knowledge base document needs to be uploaded, retrieves the historical version number of the knowledge base document closest to the knowledge base document from the retrieval-augmented generation knowledge base by calling a large language model. Further, the historical version number of the knowledge base document is input into the large language model to generate the version number of the knowledge base document that has a continuous relationship with the historical version number of the knowledge base document. That is to say, usually, the existing knowledge base documents in the retrieval-augmented generation knowledge base carry their own version numbers, so the historical version number of the knowledge base document can be retrieved from the retrieval-augmented generation knowledge base through the large language model. There is a logical relationship between the newly generated version number and the historical version number, which can facilitate subsequent querying of different versions of the knowledge base document. Thus, the technical problem of low efficiency and lack of logic and coherence in the generation of version numbers, which is prone to confusion, when managing documents by manually annotating document version numbers is solved, and the effective management of different versions of documents in the retrieval-augmented generation knowledge base is realized to improve the intelligent level of version management.

[0007] In some embodiments, it further includes: when the format of the first version number is the preset version number format, determining the first version number as the target version number of the knowledge base document; or, when the formats of at least one historical version number are the same and there is a continuous relationship between any two adjacent historical version numbers among at least one historical version number, determining the first version number as the target version number.

[0008] In some embodiments, after receiving the uploaded knowledge base document, it further includes: calling a large language model to extract the second version number of the knowledge base document from the knowledge base document.

[0009] In some embodiments, it further includes: when the format of the second version number is the preset version number format, determining the second version number as the target version number of the knowledge base document; or, when target information is extracted from the knowledge base document, determining the second version number as the target version number, where the target information is used to represent that the knowledge base document is an updated document.

[0010] In some embodiments, it further includes: when the formats of at least one historical version number are the same, there is a continuous relationship between any two adjacent historical version numbers among at least one historical version number, and target information is extracted from the knowledge base document, calling a large language model to generate a prompt message, where the prompt message is used to represent that the first version number conflicts with the second version number; inputting the first version number and the second version number into a version number preference model to obtain the target version number of the knowledge base document.

[0011] In some embodiments, the version number preference model is trained as follows: Obtain a training set; the training set includes: version numbers historically selected by multiple users; input the training set into an initial model for training to obtain the version number preference model.

[0012] In some embodiments, it further includes: in response to an operation of confirming the selection of a target version number, retrieve a target knowledge base document from the retrieval-enhanced generation knowledge base, and the label of the target knowledge base document is the latest version indication label; delete the label of the target knowledge base document; insert a knowledge base document into the retrieval-enhanced generation knowledge base; mark the knowledge base document with the latest version indication label; save the historical version label of the knowledge base document, and the historical version label includes a first version number and / or a second version number; the second version number is the version number extracted from the knowledge base document by invoking a large language model.

[0013] In some embodiments, it further includes: receive a user request message for requesting to retrieve a knowledge base document from the retrieval-enhanced generation knowledge base; in the case where the user request message does not include version specification information, retrieve a knowledge base document marked with the latest version indication label from the retrieval-enhanced generation knowledge base; the version specification information includes at least one of the following: the version number of the knowledge base document to be retrieved, the time range of the knowledge base document to be retrieved, the historical version label of the knowledge base document to be retrieved; or, in the case where the user request message includes version specification information, retrieve the knowledge base document corresponding to the version specification information from the retrieval-enhanced generation knowledge base.

[0014] In a second aspect, a knowledge base version control device is provided, including: a communication unit and a processing unit; the communication unit is used to receive an uploaded knowledge base document; the processing unit is used to invoke a large language model to retrieve at least one historical version number of the knowledge base document from the retrieval-enhanced generation knowledge base; the time interval between uploading the knowledge base document and generating at least one historical version number is less than the time interval between uploading the knowledge base document and generating other historical version numbers, and the other historical version numbers are the historical version numbers of the knowledge base document in the retrieval-enhanced generation knowledge base other than the at least one historical version number; the processing unit is further used to input the at least one historical version number into the large language model to generate a first version number of the knowledge base document, and there is a continuous relationship between the first version number and the last historical version number among the at least one historical version number.

[0015] In a third aspect, an electronic device is provided, including a memory and a processor; the memory is used to store computer execution instructions, and the processor is connected to the memory through a bus; when the retrieval-enhanced generation knowledge base version control device runs, the processor executes the computer execution instructions stored in the memory to enable the retrieval-enhanced generation knowledge base version control device to execute the knowledge base version control method in the first aspect.

[0016] The knowledge base version control device may be a network device or a part of the network device, such as a chip system in the network device. The chip system is used to support the network device to implement the functions involved in the first aspect and any possible implementation manner thereof. For example, it acquires, determines, and sends the data and / or information involved in the above knowledge base version control method. The chip system includes a chip and may also include other discrete devices or circuit structures.

[0017] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes computer-executable instructions. When the computer-executable instructions run on a computer, the computer is caused to execute the knowledge base version control method of the first aspect.

[0018] In a fifth aspect, a computer program product is further provided. The computer program product includes computer instructions. When the computer instructions run on the knowledge base version control device, the knowledge base version control device is caused to execute the knowledge base version control method of the first aspect as described above.

[0019] It should be noted that the above computer instructions may be stored in whole or in part on the computer-readable storage medium. Among them, the computer-readable storage medium may be packaged together with the processor of the knowledge base version control device or separately packaged from the processor of the knowledge base version control device. The embodiments of the present application do not make any limitation in this regard.

[0020] The descriptions of the second aspect, the third aspect, the fourth aspect, and the fifth aspect in the present application may refer to the detailed description of the first aspect.

[0021] In the embodiments of the present application, the name of the above knowledge base version control device does not constitute a limitation on the device or function module itself. In actual implementation, these devices or function modules may appear under other names. For example, the receiving unit may also be referred to as a receiving module, a receiver, etc. As long as the functions of each device or function module are similar to those of the present application and fall within the scope of the claims of the present application and their equivalent technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0023] Figure 1 FIG. is a schematic structural diagram of a knowledge base version control system provided by an embodiment of the present application; Figure 2 FIG. is a schematic flowchart of a knowledge base version control method provided by an embodiment of the present application; Figure 3 It is a schematic flowchart of yet another knowledge base version control method provided by an embodiment of the present application; Figure 4 It is a schematic flowchart of yet another knowledge base version control method provided by an embodiment of the present application; Figure 5 It is a schematic flowchart of yet another knowledge base version control method provided by an embodiment of the present application; Figure 6 It is a schematic flowchart of yet another knowledge base version control method provided by an embodiment of the present application; Figure 7 It is a schematic flowchart of yet another knowledge base version control method provided by an embodiment of the present application; Figure 8 It is a schematic flowchart of yet another knowledge base version control method provided by an embodiment of the present application; Figure 9 It is a schematic diagram of the complete steps of the version number generation process in a knowledge base version control method provided by an embodiment of the present application; Figure 10 It is a schematic structural diagram of a knowledge base version control device provided by an embodiment of the present application. Detailed implementation manners

[0024] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0025] In the description of the present application, it should be understood that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, unless otherwise stated, the meaning of "a plurality" is two or more.

[0026] In the description of the present application, it should be noted that, unless otherwise clearly defined and limited, the terms "installed", "connected", "connected", and "communicated" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection. It may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific situations.

[0027] In the embodiments of the present application, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the presence of additional identical elements in the process, article or device comprising such element.

[0028] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0029] In the related art, when managing documents in the RAG knowledge base, the version number of the document can be manually marked, and the latest version can be marked by a fixed tag. For example, the fixed tag can be "latest" (the latest).

[0030] However, the method for managing documents in the RAG knowledge base in the related art has the following disadvantages: 1. Traditional version control: It overly relies on manually marking the version number, and the generation of the version number lacks logic and coherence, which easily leads to confusion.

[0031] 2. Static tag management: The existing RAG system marks the latest version with a fixed tag (such as "latest"), but the update of the version number depends on manual judgment and is prone to lag.

[0032] 3. Version conflict problem: Users may obtain outdated information because the default version is not updated in a timely manner, and the generation of the version number lacks historical reference.

[0033] Especially for scenarios that require frequent updates and have strong version logic, such as software development documents, scientific research data sets, and policy and regulation libraries, the disadvantages of the method for managing documents in the RAG knowledge base in the related art are more obvious.

[0034] In view of the above problems, the present application provides a knowledge base version control method, which focuses on solving the requirement of default retrieval of the latest version. By intelligently generating version number suggestions through a large language model and combining a user collaboration confirmation mechanism, the "latest" tag is dynamically managed to achieve seamless switching of the latest version. In the specific process, the LLM actively analyzes the latest historical version of the current document in the RAG knowledge base, generates coherent version number suggestions using the LLM (for example, generating a suggested version number V2.2 based on the latest historical version V2.1), and extracts the potential version numbers of the current document. User collaboration confirmation is supported. Combining the potential version numbers extracted by the LLM with the generated version number suggestions, an interactive interface is provided for the user to correct or confirm, so as to perform version update after the user corrects or confirms.

[0035] Supports dynamic tag management, can automatically remove the "latest" tag of the old version, mark the new version as the default retrieval target, and ensure real-time performance. When the user retrieves, the latest version (marked as latest) is used by default, and flexible on-demand query of historical versions is supported, taking into account both accuracy and flexibility to optimize the retrieval efficiency. This solution significantly improves the intelligent level of version management and user participation.

[0036] The knowledge base version control method provided by the present application is particularly applicable to the following scenarios: 1. Software development: Ensure that developers default to obtaining the latest application programming interface (API) documentation, and historical versions are used for compatibility testing.

[0037] 2. Government affairs system: Policy document versions are intelligently updated quarterly, and the public retrieves the latest version by default.

[0038] 3. Academic research: Dataset versions are marked according to research stages, supporting version traceability and replication.

[0039] The above knowledge base version control method can be applied to a knowledge base version control system. Figure 1 It is a schematic structural diagram of a knowledge base version control system provided by an embodiment of the present application. As Figure 1 shown, the knowledge base version control system includes: a terminal device 101 and an electronic device 102. The electronic device 102 includes: a multi-version collaborative management platform, an LLM, and a RAG knowledge base.

[0040] Among them, the terminal device 101 is used to upload the knowledge base document to the multi-version collaborative management platform of the electronic device 102. The multi-version collaborative management platform is used to call the LLM, retrieve at least one historical version number of the knowledge base document from the RAG knowledge base, and input at least one historical version number into the LLM to generate a first version number of the knowledge base document that has a logical relationship with at least one historical version number, so as to realize the generation of the version number of the newly uploaded knowledge base document.

[0041] In the embodiments of the present application, both the terminal device 101 and the electronic device 102 can be physical machines. For example, the terminal device 101 can be a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a desktop computer, also known as a desktop or a desktop computer, etc. The embodiments of the present application do not limit this. The electronic device 102 can be a base station device, a desktop computer, a server, or a server group composed of multiple servers. The embodiments of the present application do not limit this.

[0042] It should be noted that Figure 1 the structure shown in Figure 1 does not constitute a limitation on the knowledge base version control system. In addition to

[0043] the components shown, the knowledge base version control system may include more or fewer components than those shown in the figure, or combine some components, or arrange different components.

[0043] The knowledge base version control method provided by the embodiments of the present application will be introduced in detail below with reference to the accompanying drawings.

[0044] The knowledge base version control method provided by the embodiments of the present application is applied to Figure 1 the electronic device 102 in the knowledge base version control system shown in Figure 2 . As Figure 2 shown, the knowledge base version control method includes S201 - S203: S201. Receive the uploaded knowledge base document.

[0045] Optionally, when a manager needs to upload a new knowledge base document to the RAG knowledge base, the knowledge base document can be sent to the multi-version collaborative management platform of the electronic device. Correspondingly, the multi-version collaborative management platform can receive the knowledge base document.

[0046] Exemplarily, the knowledge base document can be a document of types such as software development documents, scientific research data documents, policy and regulation documents, etc.

[0047] S202. Invoke a large language model to retrieve at least one historical version number of the knowledge base document from the retrieval-augmented generation knowledge base.

[0048] Among them, the time interval between uploading the knowledge base document and generating at least one historical version number is less than the time interval between uploading the knowledge base document and generating other historical version numbers. Other historical version numbers are the historical version numbers of the knowledge base documents in the retrieval-augmented generation knowledge base except for at least one historical version number.

[0049] Optionally, a large number of knowledge base documents are stored in the RAG knowledge base. Each knowledge base document carries at least one label, such as a time label, a type label, a "latest" label (which can also be called the latest version indication label), and a version number label. Among them, the generated time label can be used to represent the time point when the knowledge base document is added to the RAG knowledge base, such as 10:00. The type label can be used to represent the type of the knowledge base document, such as software development documents, scientific research data documents, or policy and regulation documents, etc. The "latest" label can be used to represent that the knowledge base document is the latest version document. The version number label can be used to represent the version number of the knowledge base document, such as V2.1 or V2.2, etc.

[0050] The multi-version collaborative management platform can invoke the LLM. The LLM retrieves all knowledge base documents of the same type as the uploaded knowledge base document from the RAG knowledge base according to the type label of each knowledge base document in the RAG knowledge base. Further, according to the time label, at least one historical version number that is the most recent is retrieved from all knowledge base documents of the same type, that is, the time interval between uploading the new knowledge base document and generating at least one historical version number is less than the time interval between uploading the new knowledge base document and generating other historical version numbers.

[0051] Exemplarily, at least one historical version number can be 3 historical version numbers, namely V2.0, V2.1, and V2.2.

[0052] S203. Input at least one historical version number into the large language model to generate the first version number of the knowledge base document.

[0053] Among them, there is a logical relationship between the first version number and at least one historical version number.

[0054] Optionally, the multi-version collaborative management platform can input at least one historical version number into the LLM to generate the first version number of the knowledge base document, that is, generate the proposed version number of the new knowledge base document. The first version number of the knowledge base document can also be called the proposed version number.

[0055] The logical relationship between version numbers can be continuous increment, continuous decrement, etc. The present disclosure does not limit this.

[0056] Exemplarily, when inputting V2.0, V2.1, and V2.2 into the LLM, the first version number of the generated knowledge base document can be V2.3.

[0057] In some embodiments of the present application, in combination with Figure 2 , such as Figure 3 shown, after S203 above, it further includes S301 or S302: S301. When the format of the first version number is the preset version number format, determine the first version number as the target version number of the knowledge base document.

[0058] Optionally, the administrator can pre-configure the preset version number format in the multi-version collaborative management platform. The preset version number format can be semantic version or timestamp, etc. When the preset version number format is semantic version, it means that the semantic version takes precedence over the timestamp. Then, if the format of the first version number is semantic version, the first version number is determined as the target version number of the knowledge base document, and vice versa. Further, recommend the target version number of the knowledge base document to the user for the user to select. That is to say, the multi-version collaborative management platform can automatically generate the priority sorting of the version numbers according to the normativity of the version number format, and recommend the version number with a higher priority to the user to meet the user's requirements for the normativity of the version number format.

[0059] Exemplarily, the semantic version can be expressed as Vm.n, where m and n can be integers greater than or equal to 0, such as V2.0, V2.1, V2.2, etc. If the preset version number format is semantic version and the first version number is V2.3, then V2.3 can be determined as the target version number.

[0060] Exemplarily, the timestamp can be expressed as year + quarter, such as 2024Q3, where 2024 represents the year 2024 and Q3 represents the third quarter.

[0061] S302. When the formats of at least one historical version number are the same and there is a continuous relationship between any two adjacent historical version numbers among at least one historical version number, determine the first version number as the target version number.

[0062] Optionally, if the format of each historical version number in at least one historical version number is semantic version and there is a continuous relationship between any two adjacent historical version numbers among at least one historical version number, then the first version number can be determined as the target version number, and vice versa. Further, recommend the target version number of the knowledge base document to the user for the user to select.

[0063] That is to say, if the formats of the historical version numbers are the same and there is a continuous relationship, it indicates that the logical coherence of the historical versions is relatively strong. Then, the logical coherence between the version number generated based on the historical version number and the historical version number is also relatively strong. In this case, it is more reasonable to recommend the version number generated based on the historical version number.

[0064] Exemplarily, at least one historical version number is V2.0, V2.1, and V2.2 respectively. It can be seen that there is a continuous relationship between V2.0 and V2.1, and there is a continuous relationship between V2.1 and V2.2.

[0065] In some embodiments of the present application, in combination with Figure 2 , such as Figure 4 shown, after the above S201, it further includes S401: S401. Call the large language model to extract the second version number of the knowledge base document from the knowledge base document.

[0066] Optionally, the multi-version collaborative management platform can call the LLM to identify the specific content of the knowledge base document and extract the second version number of the knowledge base document from it. The second version number of the knowledge base document can also be referred to as the potential version number.

[0067] For example, if "2024Q3 update" exists or is implied in the specific content of the knowledge base document, then "2024Q3" can be determined as the second version number of the knowledge base document.

[0068] That is to say, in addition to the version number generation method of generating the version number based on the historical version number, the potential version number can also be extracted by identifying the specific content of the knowledge base document for the user to choose, so as to enrich the version number generation method and enhance the rationality of version number generation.

[0069] In some embodiments of the present application, in combination with Figure 4 , such as Figure 5 shown, after the above S401, it further includes S501 or S502: S501. In the case where the format of the second version number is the preset version number format, determine the second version number as the target version number of the knowledge base document.

[0070] Optionally, when the preset version number format is a timestamp, it means that the timestamp takes precedence over the semantic version. Then, if the format of the second version number is a timestamp, the second version number is determined as the target version number of the knowledge base document, and vice versa. Further, recommend the target version number of the knowledge base document to the user for the user to choose. That is to say, the multi-version collaborative management platform can automatically generate the priority ranking of the version numbers according to the standardization of the version number format and recommend the version number with a higher priority to the user to meet the user's requirements for the standardization of the version number format.

[0071] Exemplarily, if the preset version number format is a timestamp and the second version number is 2024Q3, then 2024Q3 can be determined as the target version number.

[0072] S502. When the target information is extracted from the knowledge base document, determine the second version number as the target version number.

[0073] Wherein, the target information is used to represent that the knowledge base document is an updated document.

[0074] Optionally, the multi-version collaborative management platform can identify the specific content of the knowledge base document, and when the target information indicating that the knowledge base document is an updated document is extracted from the specific content of the knowledge base document, determine the second version number as the target version number. That is to say, if the target information indicating that the knowledge base document is an updated document can be extracted from the knowledge base document, it means that the potential version number extracted from the knowledge base document can reflect the update situation of the document. At this time, recommending the potential version number to the user can facilitate the user to understand the update situation of the document. Therefore, it is more reasonable to determine the potential version number extracted from the knowledge base document as the target version number of the knowledge base document.

[0075] Exemplarily, the target information can be key information such as "quarterly report" indicating that the knowledge base document is an updated document.

[0076] In some embodiments of the present application, in combination with Figure 2 and Figure 4 , as Figure 6 shown, after the above S401 and S203, S601 - S602 are further included: S601. When at least one historical version number has the same format, there is a continuous relationship between any two adjacent historical version numbers among at least one historical version number, and the target information is extracted from the knowledge base document, call the large language model to generate a prompt message.

[0077] Wherein, the prompt message is used to represent that there is a conflict between the first version number and the second version number.

[0078] That is to say, if at least one historical version number has the same format, there is a continuous relationship between any two adjacent historical version numbers among at least one historical version number, and the target information is extracted from the knowledge base document, it means that there is a conflict between the first version number and the second version number, that is, both the first version number and the second version number can be used as the target version number. Then at this time, the multi-version collaborative management platform can call the LLM to analyze the relevance between the two and generate a prompt message to remind the user. The prompt message can also be called an explanatory prompt message.

[0079] Exemplarily, the prompt message can be "It is recommended that version number V2.3 is consistent with the historical version, but the content of the knowledge base document implies quarterly updates."

[0080] S602. Input the first version number and the second version number into the version number preference model to obtain the target version number of the knowledge base document.

[0081] Optionally, the version number preference model can represent the version numbers frequently selected by the user. Input the first version number and the second version number into the version number preference model. If the version number frequently selected by the user is the first version number, then the target version number of the knowledge base document is obtained as the first version number; if the version number frequently selected by the user is the second version number, then the target version number of the knowledge base document is obtained as the second version number for the user to select. That is to say, when there is a conflict between the first version number and the second version number, the version number can be selected according to the user preference, thereby enhancing the rationality of version number generation.

[0082] Exemplarily, if the user prefers the timestamp, the extracted potential version number 2024Q3 is preferentially displayed.

[0083] In some embodiments of the present application, the version number preference model is trained in the following manner: Obtain a training set; the training set includes: multiple version numbers historically selected by users.

[0084] Input the training set into an initial model for training to obtain a version number preference model.

[0085] That is to say, the version numbers historically selected by users can reflect the user preference, which can facilitate the selection of a version number that more conforms to the user preference when there is a version number conflict later, and enhance the rationality of version number generation.

[0086] In some embodiments of the present application, as Figure 7 shown, it further includes S701 - S705: S701. In response to an operation of confirming the selection of the target version number, retrieve the target knowledge base document from the retrieval - enhanced generation knowledge base.

[0087] Among them, the label of the target knowledge base document is the latest version indication label.

[0088] S702. Delete the label of the target knowledge base document.

[0089] S703. Insert the knowledge base document into the retrieval - enhanced generation knowledge base.

[0090] S704. Mark the latest version indication label for the knowledge base document.

[0091] S705. Save the historical version label of the knowledge base document.

[0092] Among them, the historical version tags include the first version number and / or the second version number. The second version number is the version number extracted from the knowledge base document by invoking the large language model.

[0093] Optionally, when the user confirms to select the proposed version number, the multi-version collaborative management platform can retrieve the knowledge base documents of the same type with the "latest" tag in the RAG knowledge base and remove its "latest" tag. Further, the multi-version collaborative management platform can insert new knowledge base documents into the RAG knowledge base and mark them as "latest", while retaining the historical version tags, such as V2.3, 2024Q3.

[0094] That is to say, by automatically removing the "latest" tag of the old version and marking the "latest" tag for the new version, the default retrieval target can be set to the new version, ensuring real-time performance and avoiding the problem in related technologies that users may obtain outdated information due to the default version not being updated in time. At the same time, the historical version tags are retained to facilitate subsequent retrieval and query according to these historical version tags, taking into account both accuracy and flexibility.

[0095] In some embodiments of the present application, in combination with Figure 7 , as Figure 8 shown, after S705, it further includes S801, and S802 or S803: S801, receiving a user request message.

[0096] Among them, the user request message is used to request the retrieval of knowledge base documents in the retrieval augmented generation knowledge base.

[0097] S802, when the user request message does not include version specification information, retrieving the knowledge base documents marked with the latest version indication tag from the retrieval augmented generation knowledge base.

[0098] Among them, the version specification information includes at least one of the following: the version number of the knowledge base document to be retrieved, the time range of the knowledge base document to be retrieved, the historical version tag of the knowledge base document to be retrieved.

[0099] That is to say, when the user retrieves knowledge base documents using the RAG knowledge base, if the version to be retrieved is not specified, the multi-version collaborative management platform can retrieve the knowledge base documents marked with "latest", that is, the latest version of the knowledge base documents, to ensure that users obtain the latest information and avoid users obtaining outdated information.

[0100] Optionally, the time range of the knowledge base document to be retrieved can be the time range when the knowledge base document to be retrieved is added to the RAG knowledge base, or the time range generated by the version number of the knowledge base document, etc.

[0101] S803. When the user request message includes version specification information, retrieve the knowledge base document corresponding to the version specification information from the retrieval-enhanced generated knowledge base.

[0102] That is to say, when the user uses the RAG knowledge base to retrieve the knowledge base document, if the version to be retrieved is not specified, the multi-version collaborative management platform can retrieve the corresponding knowledge base document according to the specific information of the specified version to meet the user's needs.

[0103] In some embodiments of the present application, the following is combined with Figure 9 , to introduce the complete steps of the version number generation process in the knowledge base version control method provided by the present application: S1: The administrator uploads the knowledge base document and calls the LLM to perform the following operations: Sub-step S11: Retrieve the last 3 historical version numbers (such as V2.0, V2.1, V2.2) in the RAG knowledge base that are related to the uploaded knowledge base document.

[0104] Sub-step S12: Input the 3 historical version numbers into the LLM to generate the next proposed version number (such as V2.3).

[0105] Sub-step S13: The LLM parses the specific content of the uploaded knowledge base document and extracts the potential version number (such as the "2024Q3 update" implicitly contained in the document).

[0106] S2: Return to the administrator the proposed version number generated by the LLM (such as V2.3), the potential version number extracted from the document (such as 2024Q3), and the list of historical version numbers (such as V2.0, V2.1, V2.2), and support the following manual selection strategies, that is, support manual input or selection of the version number: 1. Intelligent priority recommendation. Based on the normativity of the version number format (such as semantic version V2.3 taking precedence over timestamp 2024Q3), the historical version trend (such as continuously increasing semantic versions), and the nature of the update of the document content (such as quarterly updates, feature iterations), automatically generate a priority ranking. For example, if the historical version numbers are all in semantic format, then V2.3 is recommended first; if the specific content of the uploaded knowledge base document contains "quarterly report", then 2024Q3 is recommended first.

[0107] 2. Conflict detection and dynamic prompt. When there is a conflict between the proposed version number by the LLM and the potential version number extracted from the document (such as V2.3 vs 2024Q3), call the LLM to analyze the relevance between the two, generate an explanatory prompt (such as "The proposed version number V2.3 is consistent with the historical versions, but the document content implies a quarterly update"), and recommend the optimal option based on historical data.

[0108] 3. User-preference Adaptive Learning: The system records the user's historical selection behavior (such as frequently selecting the timestamp format), constructs a version number preference model, and dynamically adjusts the sorting of the candidate list in subsequent version number recommendations. For example, if the user prefers timestamps, the system will preferentially display 2024Q3 extracted from the document.

[0109] S3: Determine whether the user confirms the version number. If the user confirms the version number, retrieve documents of the same type with the label "latest" in the RAG knowledge base and remove their "latest" labels; if the user does not confirm the version number, end the process.

[0110] S4: Insert the uploaded knowledge base document and mark it as "latest", while retaining the historical version labels (such as V2.3, 2024Q3), and end the process.

[0111] In some embodiments of the present application, the user retrieval process in the knowledge base version control method provided by the present application is introduced below: Default Retrieval: When the user's request has no version specified, data is automatically obtained from the "latest" label library.

[0112] Historical Version Query: When the user specifies a version number, time range, or historical version label (such as "2024Q3"), retrieve from the RAG knowledge base.

[0113] The above mainly introduces the solution provided by the embodiments of the present application from the perspective of the method. To implement the above functions, it includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0114] The embodiments of the present application can divide the function modules of the knowledge base version control device according to the above method examples. For example, each function module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software function module. Optionally, the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.

[0115] Such as Figure 10As shown, it is a schematic structural diagram of a knowledge base version control device provided by an embodiment of the present application. Figure 10 The shown knowledge base version control device includes: a communication unit 1001 and a processing unit 1002; The communication unit 1001 is used to receive the uploaded knowledge base document.

[0116] The processing unit 1002 is used to call a large language model to retrieve at least one historical version number of the knowledge base document from the retrieval augmented generation knowledge base; the time interval between uploading the knowledge base document and generating at least one historical version number is less than the time interval between uploading the knowledge base document and generating other historical version numbers, and the other historical version numbers are the historical version numbers of the knowledge base document in the RAG knowledge base except for the at least one historical version number.

[0117] The processing unit 1002 is further used to input the at least one historical version number into the large language model to generate a first version number of the knowledge base document, and there is a continuous relationship between the first version number and the last historical version number among the at least one historical version number.

[0118] In some embodiments, the processing unit 1002 is specifically used for: Compare the scale data with a plurality of preset scale data respectively, and determine the data preprocessing period according to the comparison result.

[0119] In some embodiments, the processing unit 1002 is specifically used for: In the case where the format of the first version number is the preset version number format; or, in the case where the formats of the at least one historical version number are the same and there is a continuous relationship between any two adjacent historical version numbers among the at least one historical version number, determine the first version number as the target version number of the knowledge base document.

[0120] In some embodiments, the processing unit 1002 is specifically used for: Call a large language model to extract a second version number of the knowledge base document from the knowledge base document.

[0121] In some embodiments, the processing unit 1002 is specifically used for: In the case where the format of the second version number is the preset version number format, determine the second version number as the target version number of the knowledge base document; or, in the case where target information is extracted from the knowledge base document, determine the second version number as the target version number, and the target information is used to represent that the knowledge base document is an updated document.

[0122] In some embodiments, the processing unit 1002 is specifically used for: When there is at least one historical version number with the same format, there is a consecutive relationship between any two adjacent historical version numbers among at least one historical version number, and target information is extracted from the knowledge base document, a large language model is called to generate a prompt message, which is used to characterize that the first version number conflicts with the second version number; the first version number and the second version number are input into the version number preference model to obtain the target version number of the knowledge base document.

[0123] In some embodiments, the processing unit 1002 is specifically configured to: In response to an operation of confirming the selection of the target version number, retrieve the target knowledge base document from the retrieval enhanced generation knowledge base, where the label of the target knowledge base document is the latest version indication label; delete the label of the target knowledge base document; insert the knowledge base document into the retrieval enhanced generation knowledge base; mark the latest version indication label for the knowledge base document; save the historical version labels of the knowledge base document, where the historical version labels include the first version number and / or the second version number; the second version number is the version number extracted from the knowledge base document by calling the large language model.

[0124] In some embodiments, the processing unit 1002 is specifically configured to: Receive a user request message for requesting to retrieve a knowledge base document in the retrieval enhanced generation knowledge base; when the user request message does not include version specification information, retrieve the knowledge base document marked with the latest version indication label from the retrieval enhanced generation knowledge base; the version specification information includes at least one of the following: the version number of the knowledge base document to be retrieved, the time range of the knowledge base document to be retrieved, the historical version label of the knowledge base document to be retrieved; or, when the user request message includes version specification information, retrieve the knowledge base document corresponding to the version specification information from the retrieval enhanced generation knowledge base.

[0125] An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium includes computer-executable instructions, and when the computer-executable instructions run on a computer, the computer is caused to execute the knowledge base version control method provided in the above embodiments.

[0126] An embodiment of the present application further provides a computer program product, which can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can implement the knowledge base version control method provided in the above embodiments. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that they can still modify or equivalently replace the technical solutions of the present invention, and these modifications or equivalent replacements cannot make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present invention.

[0127] For the system provided in the above embodiments, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be further decomposed or combined. For example, the modules in the above embodiments can be combined into one module, or can be further split into multiple sub-modules to complete all or part of the functions described above. For the names of the modules and steps involved in the embodiments of the present invention, they are only used to distinguish each module or step, and are not regarded as an improper limitation of the present invention.

[0128] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be realized by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or multiple blocks.

[0130] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or multiple blocks.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide for realizing the functions in the process Figure 1Steps of the function specified in one or more processes and / or boxes Figure 1 Steps of the function specified in one or more boxes

[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific implementation manners of the present invention, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A knowledge base version control method, characterized in that: include: Receive uploaded knowledge base documents; Calling the large language model to retrieve at least one historical version number of the knowledge base document from the retrieval enhanced generated knowledge base; the time interval between uploading the knowledge base document and generating the at least one historical version number is less than the time interval between uploading the knowledge base document and generating other historical version numbers, and the other historical version numbers are historical version numbers of the knowledge base document in the retrieval enhanced generated knowledge base except the at least one historical version number; The at least one historical version number is input into the large language model to generate a first version number of the knowledge base document, and there is a logical relationship between the first version number and the at least one historical version number.

2. The knowledge base version control method according to claim 1, characterized in that: Also includes: In the case where the format of the first version number is a preset version number format, determining the first version number as the target version number of the knowledge base document; or, In the case where the format of the at least one historical version number is the same and there is a continuous relationship between any two adjacent historical version numbers in the at least one historical version number, the first version number is determined as the target version number.

3. The knowledge base version control method according to claim 1, characterized in that: After receiving the uploaded knowledge base document, the method further includes: The large language model is called to extract the second version number of the knowledge base document from the knowledge base document.

4. The knowledge base version control method according to claim 3, characterized in that: Also includes: When the format of the second version number is a preset version number format, determining the second version number as the target version number of the knowledge base document; or, In the case where target information is extracted from the knowledge base document, the second version number is determined as the target version number, and the target information is used to characterize that the knowledge base document is an updated document.

5. The knowledge base version control method according to claim 4, characterized in that: Also includes: In the case where the format of the at least one historical version number is the same, there is a continuous relationship between any two adjacent historical version numbers in the at least one historical version number, and the target information is extracted from the knowledge base document, calling the large language model to generate prompt information, where the prompt information is used to indicate that the first version number conflicts with the second version number; The first version number and the second version number are input into a version number preference model to obtain a target version number of the knowledge base document.

6. The knowledge base version control method according to claim 5, characterized in that: The version number preference model is trained in the following way: Obtaining a training set; the training set includes: version numbers historically selected by multiple users; The training set is input into the initial model for training to obtain the version number preference model.

7. The knowledge base version control method according to any one of claims 2 to 6, characterized in that: Also includes: In response to confirming the operation of selecting the target version number, retrieving a target knowledge base document from the knowledge base, wherein the tag of the target knowledge base document is a latest version indication tag; Deleting the tag of the target knowledge base document; inserting the knowledge base document into the knowledge base; Marking the knowledge base document with the latest version indication tag; A historical version tag of the knowledge base document is saved, wherein the historical version tag includes the first version number and / or the second version number; the second version number is the version number extracted from the knowledge base document by calling the large language model.

8. The knowledge base version control method according to claim 7, characterized in that: Also includes: Receiving a user request message, wherein the user request message is used to request retrieval of knowledge base documents in the retrieval-enhanced generated knowledge base; In the case where the user request message does not include version specifying information, retrieving the knowledge base document marked with the latest version indication tag from the search enhancement generated knowledge base; the version specifying information includes at least one of the following: the version number of the knowledge base document to be retrieved, the time range of the knowledge base document to be retrieved, and the historical version tag of the knowledge base document to be retrieved; or In the case where the user request message includes the version specifying information, the knowledge base document corresponding to the version specifying information is retrieved from the search-enhanced generated knowledge base.

9. An electronic device, characterized in that: include: A processor and a memory; wherein the memory is used to store one or more programs, and the one or more programs include computer-executable instructions. When the device is running, the processor executes the computer-executable instructions stored in the memory to enable the device to perform the method described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: When the computer-executable instructions stored in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can perform the method as claimed in any one of claims 1 to 8.

11. A computer program product, characterized in that The computer program product comprises: a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Software version rollback method and device, server and storage medium

    CN110321254A

  • Knowledge base deployment method and device based on data fragmentation, electronic equipment and medium

    CN115907010A

  • Knowledge retrieval enhancement-based large language model question and answer method and device

    CN118113836A

  • Knowledge base version control optimization method and device based on RAG framework

    CN119003681A

  • RAG knowledge base construction method based on layout analysis and query generation

    CN119441507A