Construction and use method and device of operation and maintenance knowledge base

By retrieving and extracting knowledge base units in mixed documents from the knowledge pool to generate operation and maintenance knowledge bases, the problem of difficulty in building operation and maintenance knowledge bases suitable for mixed documents in the existing technology is solved, and the effect of reducing manual intervention and improving production efficiency is achieved.

CN119886305APending Publication Date: 2025-04-25WEBANK (CHINA)
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411973712.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

It is difficult to build an operation and maintenance knowledge base suitable for hybrid documents in the prior art, and the construction process requires a lot of manual intervention, which cannot meet the user's inference task needs for hybrid documents.

Method used

By obtaining the target keywords of the target operation and maintenance scenario, searching relevant documents from the knowledge pool of mixed documents containing code and text, extracting knowledge base units and generating operation and maintenance knowledge bases to reduce manual intervention.

Benefits of technology

It realizes the construction of an operation and maintenance knowledge base that can meet the needs of users' mixed document reasoning tasks, reduces manual intervention during the construction process and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886305A_ABST
    Figure CN119886305A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a construction and use method and device of an operation and maintenance knowledge base. The method comprises the steps of obtaining a target keyword corresponding to a target operation and maintenance scene; retrieving a target document related to the target keyword from a knowledge pool, wherein the knowledge pool comprises a mixed document containing codes and texts; extracting at least one knowledge base unit from the target document, and generating an operation and maintenance knowledge base based on the at least one knowledge base unit; the knowledge base unit comprises text knowledge fragments and code examples. The operation and maintenance knowledge base constructed in the mode can meet the inference task requirement of the user for the mixed document, and manual intervention can be reduced in the process of constructing the operation and maintenance knowledge base.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of production operation and maintenance, and in particular to a method and device for constructing and using an operation and maintenance knowledge base. Background Art

[0002] Within the enterprise, a standardized and universal internal knowledge base facilitates the implementation of various downstream tasks, such as Figure 1 In the operation and maintenance-audit scenario shown, two different groups of personnel are involved, namely operation and maintenance personnel and auditors. For operation and maintenance personnel, they need to learn skills from internal and external documents and write operation and maintenance scripts according to needs. For auditors, they need to obtain experience and knowledge from internal and external documents as background, identify the intent of the script files written by operation and maintenance personnel, and classify them according to management specifications to assess risks. However, in the actual production and development environment, due to insufficient authority, incomplete planning, improper management and other reasons, there is no set of standardized and universal internal knowledge base in the industry, and there is a lack of experience exchange between departments. This isolated knowledge island hinders the collaborative progress of businesses and reduces production efficiency. In addition, existing businesses in the industry purchase and use paid products from service providers, or authorize the use of open source tools and frameworks. These dedicated product documents and tool tutorials are often available on web sites for learning and reference. Based on this background, the knowledge base urgently needed in the industry will have a certain overlap with external documents. The construction of an internal knowledge base cannot be separated from external documents, but it is also different from external documents.

[0003] In related technologies, internal knowledge bases are constructed based on manual, rule-based or machine learning methods. The constructed internal knowledge bases are not suitable for retrieving mixed documents including code and text, and cannot meet the user's reasoning task requirements for mixed documents. In addition, manual intervention is required in the knowledge base construction process. Summary of the invention

[0004] The embodiment of the present invention provides a method and device for constructing and using an operation and maintenance knowledge base, so as to realize the construction of an operation and maintenance knowledge base, meet the user's demand for reasoning tasks of hybrid documents, and reduce manual intervention.

[0005] In a first aspect, an embodiment of the present invention provides a method for constructing an operation and maintenance knowledge base, the method comprising: obtaining target keywords corresponding to a target operation and maintenance scenario; retrieving target documents related to the target keywords from a knowledge pool, the knowledge pool comprising mixed documents containing code and text; extracting at least one knowledge base unit from the target document, and generating an operation and maintenance knowledge base based on the at least one knowledge base unit; the knowledge base unit comprises text knowledge fragments and code samples.

[0006] In the above scheme, since the knowledge pool includes mixed documents containing code and text, based on the target keywords corresponding to the target operation and maintenance scenario, the target documents related to the target keywords can be retrieved from the knowledge base, which contain text and code, and the knowledge base units are extracted from the target documents containing text and code. The operation and maintenance knowledge base generated can meet the user's reasoning task requirements for mixed documents containing code and text, such as the target reasoning task for operation and maintenance scripts. Moreover, the above operation and maintenance knowledge base construction method can reduce manual intervention in the construction process.

[0007] Optionally, the target document is in Markdown format; extracting at least one knowledge base unit from the target document, including: splitting the target document into multiple sub-documents in Markdown format according to the directory of each knowledge point in the target document, each of the multiple sub-documents including knowledge content; for each sub-document, executing: based on the six dimensions in the six-dimensional analysis method, extracting the knowledge content corresponding to each dimension from the sub-document; extracting code samples from the sub-document; and constructing the knowledge base unit corresponding to the sub-document according to the knowledge content and code samples corresponding to the six dimensions.

[0008] Optionally, before obtaining the target keywords corresponding to the target operation and maintenance scenario, it also includes: obtaining the operation and maintenance scripts generated by the system corresponding to the target operation and maintenance scenario within a preset time period; obtaining the target keywords corresponding to the target operation and maintenance scenario, including: extracting technical keyword roots from the operation and maintenance scripts generated by the system within a preset time period; expanding and disambiguating the technical keyword roots to obtain the target keywords corresponding to the target operation and maintenance scenario.

[0009] Optionally, before extracting at least one knowledge base unit from the target document, the method further includes: preprocessing the target document to filter irrelevant information in the target document.

[0010] Optionally, the knowledge pool includes technical documents corresponding to the target operation and maintenance scenario on a system external website and documents in a system internal document library.

[0011] In the second aspect, an embodiment of the present invention provides a method for using an operation and maintenance knowledge base, which is obtained based on the method for constructing an operation and maintenance knowledge base in the above-mentioned first aspect and any possible implementation method of the first aspect, and the method for using the operation and maintenance knowledge base includes: obtaining a first task instruction, the first task instruction including a target operation and maintenance script and a target reasoning task; based on the target operation and maintenance script, retrieving a target knowledge base unit related to the target operation and maintenance script and a knowledge base path corresponding to the target knowledge base unit from the operation and maintenance knowledge base; based on the thinking chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, multiple candidate results corresponding to the target reasoning task and auxiliary information, constructing a target thinking chain corresponding to the target reasoning task; according to the target thinking chain, executing the target reasoning task on the target operation and maintenance script to obtain a reasoning result.

[0012] In the above scheme, the operation and maintenance knowledge base obtained based on the construction method of the aforementioned operation and maintenance knowledge base can effectively retrieve the target knowledge base unit related to the target operation and maintenance script, and construct a target thinking chain by introducing the knowledge base path corresponding to the target knowledge base unit, combining the thinking chain template, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task and auxiliary information, which can provide an information chain for the execution subject that executes the target reasoning task efficiently and systematically, which helps to efficiently execute the target reasoning task with high efficiency and accuracy of the reasoning results.

[0013] Optionally, the thinking chain template includes downstream task instruction information items, input script information items, deployment path information items, related knowledge and path information items, candidate result set information items of the reasoning task, and at least one extended information item in sequence; based on the thinking chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task, and the auxiliary information, the target thinking chain corresponding to the target reasoning task is constructed, including: filling the instruction content included in the first task instruction into the downstream task instruction information item, filling the target operation and maintenance script into the input script information item, filling the target knowledge base unit and the knowledge base path corresponding to the target knowledge base unit into the related knowledge and path information item, inputting the multiple candidate results corresponding to the target reasoning task into the candidate result set information item of the reasoning task, filling the auxiliary information into the extended information item, and completing the construction of the target thinking chain corresponding to the target reasoning task.

[0014] Optionally, the knowledge base path corresponding to the target knowledge base unit is used to locate the knowledge base to which the target knowledge base unit belongs when executing the reasoning task, and to locate the specific position of the target knowledge base unit in the operation and maintenance knowledge base.

[0015] Optionally, the auxiliary information includes a script deployment path corresponding to the target operation and maintenance script.

[0016] Optionally, the method further includes: selecting a relevant deployment path from an operation and maintenance deployment path library as the script deployment path corresponding to the target operation and maintenance script according to parameters in the target operation and maintenance script and / or the path where the target operation and maintenance script is running.

[0017] Optionally, based on the target operation and maintenance script, a target knowledge base unit related to the target operation and maintenance script is retrieved from the operation and maintenance knowledge base, including: determining the similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script, and each knowledge base unit in the operation and maintenance knowledge base; taking the k knowledge base units in the operation and maintenance knowledge base that have the highest similarity with the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script as the target knowledge base units, where k is a positive integer.

[0018] Optionally, determining the target similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and each knowledge base unit in the operation and maintenance knowledge base includes: for each knowledge base unit in the operation and maintenance knowledge base, executing:

[0019] Determine a first similarity set between a target operation and maintenance script and a knowledge base unit, the first similarity set including at least one of the following similarities: a first similarity, a second similarity, and a third similarity; wherein the first similarity is a similarity between the target operation and maintenance script and a code sample in the knowledge base unit, the second similarity is a similarity between the target operation and maintenance script and the knowledge base unit, and the third similarity is a similarity between the target operation and maintenance script and a text knowledge fragment in the knowledge base unit;

[0020] Determine a second similarity set between a script deployment path corresponding to a target operation and maintenance script and a knowledge base unit, the second similarity set comprising at least one of the following similarities: a fourth similarity and a fifth similarity, wherein the fourth similarity is a similarity between the script deployment path and a code sample in the knowledge base unit, and the fifth similarity is a similarity between the script deployment path and the knowledge base unit;

[0021] Determine a third similarity set between the target operation and maintenance script and the script deployment path and the knowledge base unit, the third similarity set including at least one of the following similarities: a sixth similarity, a seventh similarity, and an eighth similarity; wherein the sixth similarity is the similarity between the target operation and maintenance script and the script deployment path and the code sample in the knowledge base unit, the seventh similarity is the similarity between the target operation and maintenance script and the script deployment path and the knowledge base unit, and the eighth similarity is the similarity between the target operation and maintenance script and the script deployment path and the text knowledge fragment in the knowledge base unit;

[0022] According to the first similarity set, the second similarity set and the third similarity set, a target similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and the knowledge base unit is determined.

[0023] Optionally, the target reasoning task is to predict the category to which the script belongs, and the multiple candidate results corresponding to the target reasoning task include a script candidate classification set.

[0024] Optionally, the target reasoning task is to predict the script intent of the script, and the multiple candidate results corresponding to the target reasoning task include a script candidate intent set.

[0025] In a third aspect, an embodiment of the present invention further provides a device for constructing an operation and maintenance knowledge base, including:

[0026] An acquisition unit, used to acquire target keywords corresponding to a target operation and maintenance scenario;

[0027] A retrieval unit, used to retrieve a target document related to the target keyword from a knowledge pool, wherein the knowledge pool includes mixed documents containing codes and texts;

[0028] A construction unit is used to extract at least one knowledge base unit from the target document and generate an operation and maintenance knowledge base based on the at least one knowledge base unit; the knowledge base unit includes text knowledge fragments and code samples.

[0029] In a fourth aspect, an embodiment of the present invention further provides a device for using an operation and maintenance knowledge base, wherein the operation and maintenance knowledge base is constructed based on the first aspect and any possible implementation of the first aspect, and the device for using the operation and maintenance knowledge base includes:

[0030] An acquisition unit, configured to acquire a first task instruction, wherein the first task instruction includes a target operation and maintenance script and a target reasoning task;

[0031] A retrieval unit, configured to retrieve, based on the target operation and maintenance script, a target knowledge base unit related to the target operation and maintenance script and a knowledge base path corresponding to the target knowledge base unit from the operation and maintenance knowledge base;

[0032] A construction unit, configured to construct a target thinking chain corresponding to the target reasoning task based on the thinking chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, a plurality of candidate results corresponding to the target reasoning task, and auxiliary information;

[0033] The reasoning unit is used to execute the target reasoning task on the target operation and maintenance script according to the target thinking chain to obtain the reasoning result.

[0034] In a fifth aspect, an embodiment of the present invention provides a computing device, including:

[0035] A memory for storing program instructions;

[0036] The processor is used to call the program instructions stored in the memory and execute the position synchronization method according to the obtained program.

[0037] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a position synchronization method. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A schematic diagram of an operation and maintenance-audit scenario provided by an embodiment of the present invention;

[0040] Figure 2 A schematic diagram of a process for constructing an operation and maintenance knowledge base provided by an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of a sub-document and a knowledge base unit in Markdown format provided in an embodiment of the present invention;

[0042] Figure 4 A flowchart of a method for using an operation and maintenance knowledge base provided by an embodiment of the present invention;

[0043] Figure 5 A schematic diagram of the similarity between the target operation and maintenance script and the script deployment path and the knowledge base unit provided in the embodiment of the present invention;

[0044] Figure 6 A schematic diagram of a search process provided by an embodiment of the present invention;

[0045] Figure 7 A schematic diagram of a target thinking chain provided by an embodiment of the present invention;

[0046] Figure 8 The reasoning process provided for the embodiment of the present invention;

[0047] Fig. 9 A device for constructing an operation and maintenance knowledge base provided by an embodiment of the present invention;

[0048] Fig.10 A device for using an operation and maintenance knowledge base provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.

[0050] First, the terms used in the present invention are explained.

[0051] The Agent in the large language model (LLM) is an intelligent entity based on the large language model that can autonomously understand, plan decisions and perform complex tasks.

[0052] Retrieval augmented generation (RAG) refers to optimizing the output of large language models so that they can generate responses by referencing knowledge bases other than the training data source.

[0053] 5W1H, namely, why, what, where, when, who, how, is an analysis method also called six whys analysis method, which can also be understood as a thinking method or a creative technique. It is widely used in corporate management, daily work life and study.

[0054] Chunk, or data block. In computer science and data processing, it usually refers to dividing a large block of data into smaller, more manageable pieces or blocks.

[0055] Markdown can be used to add formatting elements to a plain text document and then convert it into a valid HyperText Markup Language (HTML) document.

[0056] HTML document, or Hypertext Markup Language, is a standard markup language used to create web pages.

[0057] It should be noted that the term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " herein, unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship. And in the description of the embodiments of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. In the description of the present application, unless otherwise specified, the meaning of "multiple" is two or more.

[0058] Figure 2 The flowchart of a method for constructing an operation and maintenance knowledge base provided by an embodiment of the present invention is exemplarily shown. The method for constructing an operation and maintenance knowledge base can be executed by a construction device or a component inside the construction device. For ease of description, the following embodiments are described by taking the construction device as an example. Figure 2 As shown, the method for constructing the operation and maintenance knowledge base includes the following steps:

[0059] Step 201, constructing a device to obtain target keywords corresponding to a target operation and maintenance scenario.

[0060] Before step 201, the construction device may also obtain an operation and maintenance script generated by the system corresponding to the target operation and maintenance scenario within a preset time period. Then, technical keyword roots are extracted from the operation and maintenance script generated by the system within the preset time period. After that, the technical keyword roots are expanded and disambiguated to obtain target keywords corresponding to the target operation and maintenance scenario.

[0061] In other embodiments, after extracting technical keyword roots from the operation and maintenance script, the extracted technical keyword roots can be combined with the commonly used technical keywords input by the user as target keywords. It should be understood that after expanding and disambiguating the technical keyword roots, the expanded and disambiguated technical keywords and the commonly used technical keywords input by the user can be combined to form target keywords.

[0062] In actual applications, we first need to determine the target operation and maintenance scenario, understand what technologies are involved in the target operation and maintenance scenario, and use LLM as Agent01 to count and extract common technical keyword stems (Stem) from a large number of operation and maintenance scripts generated by the actual system corresponding to the target operation and maintenance scenario. For example, input all the operation and maintenance scripts generated within a period of time to monitor mobile payment, and use the locally deployed LLM to count and extract the Zebra keyword stem, which is a set of database solutions for payment in the bank's internal system.

[0063] The above expansion and disambiguation of technical keyword roots is mainly based on the polysemy of technical keywords. LLM is used as Agent02 to expand and disambiguate keyword roots to obtain technical keywords and reduce the difference in knowledge distribution. For example, the above keyword Zebra can also be translated into "zebra", which does not match the actual operation and maintenance scenario. Therefore, it can be expanded to "Zebra communication protocol" as the target keyword.

[0064] Step 202: The construction device retrieves target documents related to the target keyword from the knowledge pool, and the knowledge pool includes mixed documents containing code and text.

[0065] Among them, the knowledge pool includes technical documents corresponding to the target operation and maintenance scenarios on the system's external website and documents in the system's internal document library, such as online tutorials on external websites and product library documents within the system. Its characteristics are mixed documents containing a large amount of text and code.

[0066] The construction device can use LLM as Agent03 to obtain target documents related to target keywords from the knowledge pool and store them in Markdown format.

[0067] Since the actual online documents contain a lot of noise, such as the website registration information at the bottom of the online documents. 2015-2024 Shanghai XX Information Technology Co., Ltd." These are irrelevant information. Before executing step 203, the construction device can also pre-process the target document to filter out irrelevant information in the target document.

[0068] The preprocessing can also be a cleaning process, for example, using LLM as a filter agent, using the prompting project to clean the target document, and obtaining a relatively clean target document. The cleaning process involves reliability assessment, and a quality assessment of the target document before and after cleaning can be performed by sampling 5%-20% of the documents until the cleaned target document meets the quality requirements, and the cleaning process is terminated, so that the ability of the agent to filter irrelevant information is guaranteed. Then, the construction device can perform step 203 on the cleaned target document.

[0069] Step 203, the construction device extracts at least one knowledge base unit from the target document, and generates an operation and maintenance knowledge base based on the at least one knowledge base unit; the knowledge base unit includes text knowledge fragments and code samples.

[0070] The target document is in Markdown format.

[0071] The online documents involved in the actual operation and maintenance scenarios have the following characteristics: (1) The objectives, large and small titles are arranged in a hierarchical manner and are structured; (2) There are HTML and Markdown formats that are mixed with code and text, mixed with dirty data, such as special links and symbols such as urls and emojis; (3) The content is divided into text introductions and code samples, where the code samples are written according to different functions. If the plain text is divided only according to punctuation marks in the prior art, the paragraph division will fail, because for Markdown documents mixed with code and text, there are almost no punctuation marks in the plain text. To this end, the above step 203 extracts at least one knowledge base unit from the target document, which can be achieved through the following process:

[0072] S11, splitting the target document into multiple sub-documents in Markdown format according to the catalog of each knowledge point in the target document, each of the multiple sub-documents including knowledge content.

[0073] For example, we can obtain the tag class of "toc (table of content)" from the online document "Chapter 6 of CentOS7 Storage Management", that is, obtain the directory of the target document, and then divide it according to the directory of each knowledge point, such as 6.1.1, 6.1.2, and 6.1.3, so as to split a relatively large Markdown document into multiple sections of Markdown documents. Each section of the Markdown document is a sub-document in Markdown format. For example, the content of 6.1.1 forms a sub-document in Markdown format, the content of 6.1.2 forms a sub-document in Markdown format, and the content of 6.1.3 forms a sub-document in Markdown format. Then, we can use the construction hint to extract the 5W1H+Case knowledge unit in each sub-document.

[0074] S12: For each sub-document, execute the following S121 to S123 once respectively.

[0075] S121, based on the six dimensions in the six-dimensional analysis method, extract the knowledge content corresponding to each dimension from the sub-documents respectively.

[0076] The six dimensions of the six-how analysis method are: what is (WHAT), who can use it (WHO), when to use it (WHEN), why to use it (WHY), where to use it (WHERE), and how to use it (HOW). Agent can be used to introduce the knowledge points mentioned in the target document in terms of what is (WHAT), who can use it (WHO), when to use it (WHEN), why to use it (WHY), where to use it (WHERE), and how to use it (HOW).

[0077] S122, extracting code samples from sub-documents;

[0078] Agent is also used to extract code samples (Case) corresponding to different functions.

[0079] S123, constructing a knowledge base unit corresponding to the sub-document according to the knowledge points and code samples corresponding to the six dimensions.

[0080] In step S123, the Markdown document of each section can be input to the Agent, and one or more Markdown tables storing 5W1H+Case can be output accordingly. At this time, the Markdown tables can be organized into a Markdown document knowledge base according to the document directory toc, which is convenient for subsequent vectorization indexing and construction of the path of the retrieved related 5W1H+Case in the knowledge base.

[0081] For example, Figure 3 In the figure, the left side is a sub-document in Markdown format of Section 6.1.3 split from the target document, and the right side is two knowledge base units extracted from the sub-document, namely 5W1H+Case1 to create the OSD of FileStore and 5W1H+Case2 to create the OSD of BlueStore.

[0082] The above embodiment is introduced by taking the construction of an operation and maintenance knowledge base as an example. In actual applications, different operation and maintenance knowledge bases will be constructed for different target operation and maintenance scenarios, such as the company A knowledge base and the company B knowledge base. In the internal system, these operation and maintenance knowledge bases are used as the knowledge base of the RAG framework. Through multiple agents responsible for different tasks in the RAG framework, the internal knowledge base is used to perform target reasoning tasks.

[0083] In the embodiment of the present application, since the knowledge pool includes mixed documents containing code and text, based on the target keywords corresponding to the target operation and maintenance scenario, the target documents related to the target keywords can be retrieved from the knowledge base, which contain text and code, and the knowledge base units are extracted from the target documents containing text and code. The operation and maintenance knowledge base generated can meet the user's reasoning task requirements for mixed documents containing code and text, such as the target reasoning task for the operation and maintenance script. Moreover, the above-mentioned operation and maintenance knowledge base construction method can reduce manual intervention in the construction process.

[0084] Figure 4The flowchart of a method for using an operation and maintenance knowledge base provided by an embodiment of the present invention is exemplarily shown. The method for using the operation and maintenance knowledge base can be executed by a device or a component inside the device. For ease of description, the following embodiments are described by using a device as an example. Figure 2 The operation and maintenance knowledge base is constructed by the construction method shown in Figure 4 As shown, the method of using the operation and maintenance knowledge base includes the following steps:

[0085] Step 401, obtaining a first task instruction, the first task instruction including a target operation and maintenance script and a target reasoning task;

[0086] Among them, the first task instruction is used to instruct the execution of a target reasoning task on a target operation and maintenance script, wherein the target reasoning task is, for example, a category to which the prediction script belongs, or, for example, a script intent of the prediction script, which is not limited in this application.

[0087] The target operation and maintenance script can be real script data generated by industry operation and maintenance and business, mixed with code, text, comments and other content.

[0088] Step 402: based on the target operation and maintenance script, retrieve from the operation and maintenance knowledge base a target knowledge base unit related to the target operation and maintenance script, and a knowledge base path corresponding to the target knowledge base unit.

[0089] Step 403, construct the target thinking chain corresponding to the target reasoning task based on the thinking chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task and the auxiliary information.

[0090] Optionally, in the above step 401, the target reasoning task is to predict the category to which the script belongs, and the multiple candidate results corresponding to the target reasoning task include a script candidate classification set. Alternatively, the target reasoning task is to predict the script intent of the script, and the multiple candidate results corresponding to the target reasoning task include a script candidate intent set.

[0091] Step 404, according to the target thinking chain, execute the target reasoning task on the target operation and maintenance script to obtain the reasoning result.

[0092] In an embodiment of the present application, the operation and maintenance knowledge base obtained based on the aforementioned operation and maintenance knowledge base construction method can effectively retrieve the target knowledge base unit related to the target operation and maintenance script, and construct a target thinking chain by introducing the knowledge base path corresponding to the target knowledge base unit, combining the thinking chain template, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task, and auxiliary information. This can provide an information chain for the execution subject that executes the target reasoning task efficiently and in an orderly manner, which helps to efficiently execute the target reasoning task and improve the accuracy of the reasoning results.

[0093] In a possible implementation, the auxiliary information in the above step 403 may also include a script deployment path corresponding to the target operation and maintenance script.

[0094] Each operation and maintenance script involves container operations, and the container points to a specific deployment path, also known as the script deployment path. There are multiple ways to obtain the script deployment path corresponding to the target operation and maintenance script.

[0095] In one possible manner, according to the parameters in the target operation and maintenance script, a relevant deployment path is selected from the operation and maintenance deployment path library as the script deployment path corresponding to the target operation and maintenance script.

[0096] For example, the parameters of some commands in the operation and maintenance script, such as the parameter data of ceph-volume, contain " / dev / sda", which is related to the script deployment path "data / appsystems / fs-store / dev / sda / ".

[0097] In another possible manner, the path where the target operation and maintenance script is running is selected from the operation and maintenance deployment path library as the script deployment path corresponding to the target operation and maintenance script.

[0098] For example, a redis monitoring script "monitor_redis.sh" is strongly related to the deployment path ".. / database / redis / dbxxx / ". Another example is that the target operation and maintenance script runs on the path "data / appsystems / fs-store / dev / sda / ", and the " / data / appsystems / fs-store" in the operation and maintenance deployment path candidate library is strongly related.

[0099] In another possible manner, according to the parameters in the target operation and maintenance script and the path where the target operation and maintenance script is run, a relevant deployment path is selected from the operation and maintenance deployment path library as the script deployment path corresponding to the target operation and maintenance script.

[0100] The above script deployment path is an implicit category mapping for each operation and maintenance script, which is helpful for script classification. Because the large model LLM lacks the corresponding knowledge of script deployment, it is necessary to supplement the corresponding deployment background and retrieve the information difference between LLM and operation and maintenance scenarios, which can not only allow the model to learn the association between deployment paths, but also improve LLM's reasoning ability for operation and maintenance script deployment. Therefore, we first use the Agent to select the most likely deployment path from the pre-configured operation and maintenance deployment path candidate library, perform a classification process, and obtain the possible script deployment path of the target operation and maintenance script. Considering that some operation and maintenance scripts do not have an actual deployment path, it is set to "null" when the deployment path cannot be predicted.

[0101] In the above step 402, based on the target operation and maintenance script, the target knowledge base unit related to the target operation and maintenance script is retrieved from the operation and maintenance knowledge base, which can be achieved by the following steps S21 and S22:

[0102] S21, determining the similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and each knowledge base unit in the operation and maintenance knowledge base.

[0103] Considering that the target operation and maintenance script and the script deployment path are strongly related, and the code content of these two parts is relatively high, it can be known from practical experience that the code samples in the knowledge base unit also contain more code, and the corresponding 5W1H contains more text. Therefore, the script deployment path calculates the vector similarity more for the part containing Case. The above step S21 can measure the similarity from three perspectives: code-code, text-text, and code-text. For example Figure 5 In the example, the operation and maintenance script h, deployment path p, and h|p, which are the concatenation of the operation and maintenance script and deployment path, are taken as input. h and h|p contain some text, while p is all code. The 5W1H+Case in the knowledge base segment is also split into Case with more code content and 5W1H with more text content. Therefore, after splitting these contents, the similarity is calculated based on the content ratio.

[0104] In a possible implementation, for each knowledge base unit in the operation and maintenance knowledge base, the following steps S211 to S214 are respectively executed once to obtain the similarity between the knowledge base unit and the target operation and maintenance script and the script deployment path.

[0105] S211, determine a first similarity set between a target operation and maintenance script and a knowledge base unit, the first similarity set including at least one of the following similarities: a first similarity, a second similarity, and a third similarity; wherein the first similarity is the similarity between the target operation and maintenance script and the code sample in the knowledge base unit, the second similarity is the similarity between the target operation and maintenance script and the knowledge base unit, and the third similarity is the similarity between the target operation and maintenance script and the text knowledge fragment in the knowledge base unit.

[0106] The similarity involved in this application can be vectorized using the retrieval model f to calculate the cosine similarity Cosine. The first similarity in S211 can be Figure 5 The similarity between the operation and maintenance script and Case in S1 = cosine(f(h),f(Case)), and the second similarity can be Figure 5 The similarity between the operation and maintenance script in 5W1H+Case is s2=cosine(f(h),f(5W1H+Case)). The third similarity can be Figure 5 The similarity between the operation and maintenance script and 5W1H is s3 = cosine(f(h),f(5W1H)).

[0107] S212, determine a second similarity set between the script deployment path corresponding to the target operation and maintenance script and the knowledge base unit, the second similarity set including at least one of the following similarities: a fourth similarity and a fifth similarity, wherein the fourth similarity is the similarity between the script deployment path and the code sample in the knowledge base unit, and the fifth similarity is the similarity between the script deployment path and the knowledge base unit.

[0108] The fourth similarity in the above S212 can be Figure 5 The similarity between the deployment path and Case in s4 = cosine(f(p),f(Case)), the fifth similarity can be Figure 5 The similarity between the deployment path in and 5W1H+Case is s5=cosine(f(p),f(5W1H+Case)).

[0109] S213, determine a third similarity set between the target operation and maintenance script and the script deployment path and the knowledge base unit, the third similarity set includes at least one of the following similarities: a sixth similarity, a seventh similarity, and an eighth similarity; wherein the sixth similarity is the similarity between the target operation and maintenance script and the script deployment path and the code sample in the knowledge base unit, the seventh similarity is the similarity between the target operation and maintenance script and the script deployment path and the knowledge base unit, and the eighth similarity is the similarity between the target operation and maintenance script and the script deployment path and the text knowledge fragment in the knowledge base unit.

[0110] The sixth similarity in the above S213 can be Figure 5 The similarity between the deployment path and Case in s6 = cosine(f(h|p),f(Case)), the seventh similarity can be Figure 5 The similarity between the combined operation and maintenance script, deployment path and 5W1H+Case is s7=cosine(f(h|p),f(5W1H+Case)). The eighth similarity can be Figure 5 The similarity between the combined operation and maintenance script, deployment path and 5W1H is s8=cosine(f(h|p),f(5W1H)).

[0111] S214: Determine target similarities between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and the knowledge base unit according to the first similarity set, the second similarity set, and the third similarity set.

[0112] The target similarity is, for example, Sim, which can be calculated by the following formula:

[0113] Sim=W1*(s1+s2+s3)+W2*(s4+s5)+W3*(s6+s7);

[0114] Among them, W1 controls the similarity of the operation and maintenance script itself, and is actually used to be greater than 0.5. W2 controls the similarity ratio of the deployment path, and W3 controls the similarity ratio of the combination of the operation and maintenance script and the deployment path. Therefore, the relationship between W1, W2, and W3 needs to be comprehensively considered during the retrieval process, and the retrieval model f also needs to be fine-tuned through code data to achieve better results.

[0115] S22, taking the k knowledge base units in the operation and maintenance knowledge base that have the highest similarity with the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script as target knowledge base units, where k is a positive integer.

[0116] For example Figure 6 In the retrieval process diagram shown, an operation and maintenance script is used to determine the script deployment path: / data / appsytems / fs-store from the operation and maintenance deployment path candidate library. The target similarity is obtained by calculating the code-to-code similarity between the code in the operation and maintenance script and the code in the code sample (Case) in the knowledge base unit, calculating the text-to-text similarity between the text knowledge in the operation and maintenance script and the text knowledge fragment (5W1H) in the knowledge base unit, and calculating the code-to-code similarity between the code in the script deployment path and the code sample (Case) in the knowledge base unit. Then, based on the target similarity, the target knowledge base unit with the highest similarity to the operation and maintenance script and the script deployment path is determined.

[0117] Considering the information gap between LLM and the knowledge base, it is necessary to supplement LLM's overall concept of the knowledge base, that is, after determining the target knowledge base unit through the above process, the knowledge base path corresponding to the target knowledge base unit can also be determined to indicate where each knowledge base unit is in the knowledge base. In other words, the knowledge base path indicates the location of the 5W1H+Case in the knowledge base, thereby reducing the information gap and improving the accuracy of the response generation of downstream reasoning tasks.

[0118] In an embodiment of the present application, the knowledge base path corresponding to the target knowledge base unit is used to locate the operation and maintenance knowledge base where the target knowledge base unit is located, as well as its specific position in the operation and maintenance knowledge base when executing the reasoning task.

[0119] For example, if the target knowledge base unit is "delete configuration file-5W1H+case", its corresponding knowledge base path is, for example, "zebra / … / management / 6.1.3 / delete / ", and both the knowledge base zebra in the internal system and the knowledge base ceph include "delete configuration file-5W1H+case". When performing the target reasoning task, if only the target knowledge base unit "delete configuration file-5W1H+case" is searched, reference document 1 related to the knowledge base unit "delete configuration file-5W1H+case" belonging to the knowledge base zebra and reference document 2 related to the knowledge base unit "delete configuration file-5W1H+case" in the knowledge base ceph will be retrieved at the same time. In this application, by combining the target knowledge base unit "Delete Configuration File - 5W1H + case" and the knowledge base path "zebra / … / management / 6.1.3 / delete / " corresponding to the target knowledge base unit, the knowledge base zebra to which the target knowledge base unit "Delete Configuration File - 5W1H + case" belongs can be accurately located. By combining the knowledge base path corresponding to the target knowledge base unit, the reference document 1 involved in the knowledge base unit "Delete Configuration File - 5W1H + case" belonging to the knowledge base zebra can be directly retrieved, thereby improving the discrimination of knowledge and also helping to improve the final classification accuracy.

[0120] In a possible implementation of constructing a target thinking chain corresponding to the target reasoning task in the above step 403, the thinking chain template includes, in sequence, a downstream task instruction information item, an input script information item, relevant knowledge and path information items, a candidate result set information item of the reasoning task, and at least one extended information item. Fill the instruction content included in the first task instruction into the downstream task instruction information item, fill the target operation and maintenance script into the input script information item, fill the target knowledge base unit and the knowledge base path corresponding to the target knowledge base unit into the relevant knowledge and path information item, input the multiple candidate results corresponding to the target reasoning task into the candidate result set information item of the reasoning task, and fill the auxiliary information into the extended information item, thereby completing the construction of the target thinking chain corresponding to the target reasoning task.

[0121] Among them, the extended information item can be a blank item reserved in the thinking chain template, or it can be an information item with a set name. The specific name of the extended information item can be set according to actual needs. This application does not limit the number of extended information items.

[0122] Optionally, the auxiliary information may be blank information, that is, it does not contain any content. In this case, the extended information item in the thought chain template may not be filled in. Of course, the thought chain template may also be set not to include the extended information item.

[0123] Optionally, the auxiliary information may also be the script deployment path corresponding to the target operation and maintenance script. In this case, the name of the extended information item in the thinking chain template may be a deployment path information item. In this case, the thinking chain template may include downstream task instruction information items, input script information items, deployment path information items, related knowledge and path information items, and candidate result set information items for reasoning tasks. Fill the instruction content included in the first task instruction into the downstream task instruction information item, fill the target operation and maintenance script into the input script information item, fill the script deployment path corresponding to the target operation and maintenance script into the deployment path information item, fill the target knowledge base unit and the knowledge base path corresponding to the target knowledge base unit into the related knowledge and path information item, and input the multiple candidate results corresponding to the target reasoning task into the candidate result set information item of the reasoning task, thereby completing the construction of the target thinking chain corresponding to the target reasoning task.

[0124] Optionally, the auxiliary information may also be other information that needs to be supplemented. In this case, the name of the extended information item in the thought chain template may be determined according to the other information that needs to be supplemented. For example, the name of the extended information item may be Figure 7 In the example shown, the auxiliary information is Figure 7 Please fill in the specific content under "Other" as shown.

[0125] Optionally, the auxiliary information may also be the script deployment path corresponding to the target operation and maintenance script and other information that needs to be supplemented. In this case, the thinking chain template may include downstream task instruction information items, input script information items, deployment path information items, related knowledge and path information items, candidate result set information items of the reasoning task, and other information items. Fill the instruction content included in the first task instruction into the downstream task instruction information item, fill the target operation and maintenance script into the input script information item, fill the script deployment path corresponding to the target operation and maintenance script into the deployment path information item, fill the target knowledge base unit and the knowledge base path corresponding to the target knowledge base unit into the related knowledge and path information item, input the multiple candidate results corresponding to the target reasoning task into the candidate result set information item of the reasoning task, and fill other information that needs to be supplemented into the extended information item, thereby completing the construction of the target thinking chain corresponding to the target reasoning task, for example Figure 7 The target thinking chain is shown.

[0126] It should be understood that the specific content included in the auxiliary information is not limited to the several situations shown above, and can be set according to the needs of actual applications, and the corresponding extended information items can also be set based on the needs of actual applications.

[0127] In the above embodiment, the candidate result set information item of the reasoning task can be determined according to the target reasoning task. For example, if the target reasoning task is the category to which the reasoning script belongs, then the candidate result set information item of the reasoning task can be a script candidate class, and the multiple candidate results corresponding to the target reasoning task are the script category candidate set, and the script category candidate set can include multiple script candidate categories. For another example, if the target reasoning task is the script intent of the reasoning script, then the candidate result set information item of the reasoning task can be an intent candidate class, and the multiple candidate results corresponding to the target reasoning task are the intent candidate set, and the intent candidate set can include multiple script intents.

[0128] Taking the target reasoning task of predicting the category to which the script belongs as an example, the thought chain template corresponding to the script classification task may include: Figure 7 The downstream task instructions shown in the figure, the input script, the deployment path, the relevant knowledge and the path, the multiple candidate results corresponding to the target reasoning task, and other information items, the construction of the target thinking chain can specifically include filling the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task, and the script deployment path corresponding to the target operation and maintenance script into the corresponding information items in the thinking chain template corresponding to the target reasoning task, so as to construct the following Figure 7 The target thinking chain is shown in Figure 1. Then the agent is used to perform the script classification task based on the target thinking chain.

[0129] The above-mentioned target reasoning tasks are different, and the corresponding thinking chains are also different. By efficiently and methodically listing the information chains that can be provided to the Agent and supplementing the external logic that needs to be explained, the Agent's response error rate can be reduced to a great extent.

[0130] In the following, with the help of a specific example, the target thinking chain corresponding to the script classification task shown in 7, and the target reasoning task being the script classification task, is used as an example to introduce the reasoning process of performing the target reasoning task according to the target thinking chain. Figure 8 The inference process shown performs a script classification task.

[0131] First, the Agent has a preliminary classification concept for candidate classes and operation and maintenance scripts. For example, the script classification involves 200 candidate classes, each of which contains three levels of categories: primary operation objects, secondary operation objects, and operation actions, with auxiliary information such as relevant departments, operation instructions, and classification reference documents.

[0132] Secondly, the Agent is based on the relationship between the deployment path and the operation and maintenance script. For example, the "fs" in the deployment path " / data / appsystem / fs-store" refers to the "filestore" file storage. It is known that the operation and maintenance scripts written by the "server storage team" responsible for file storage usually involve file operations. Based on practical experience, they are usually classified into "storage-file system-(*)" and "storage-block storage-(*)". The first-level operation object is storage, and the second-level operation object is the file system or block storage. Therefore, the deployment path is introduced to filter out irrelevant candidate classes and narrow the possibility of classification.

[0133] Then, according to the retrieved relevant knowledge 5W1H+Case, it is known that the operation instructions and classification reference documents contain templates of standard operations, such as "Standard Operation #01234" involves the code "ceph-volume" command. Because the retrieved relevant 5W1H+Case contains the knowledge fragment "Create OSD of FileStore" related to storage management, and the fragment contains the "ceph-volume" command, it can be matched. Through matching, irrelevant candidate classes can be filtered. Therefore, by introducing 5W1H+Case, the candidate classification can be narrowed down again. At the same time, according to actual experience, the position of knowledge in the knowledge base is introduced, that is, the position of 5W1H+Case in the Markdown document library, that is, the toc directory according to which 5W1H+Case is constructed. Because the reference documents involved in the classification may belong to different knowledge bases, such as "Company A-Document" and "Company B-Document", after the relevant documents are retrieved, the directory of which company's knowledge base the relevant documents belong to is introduced, which can improve the discrimination of knowledge and effectively improve the final classification accuracy.

[0134] Finally, the most likely candidate category is predicted based on the above reasoning steps. The agent is responsible for script classification. Based on the external information given by the thinking chain, it reasoned step by step and obtained the final category prediction from many candidate categories. Combined with its own reasoning ability, it further enhanced its classification accuracy.

[0135] However, the actual RAG framework can be used in many scenarios. The embodiment of the present application can construct a Markdown knowledge base with good properties of 5W1H+Case, and can give its overall position in the knowledge base. When it is changed to a script intent recognition task, it is only necessary to adjust the task instructions and candidate classifications to complete the script intent recognition, and predict the most likely script intent from the candidate intents, such as updating the task instructions to "known operation and maintenance script..., please predict possible script intents from the given information", and updating the script intent candidate classes to "file update, file deletion...", and executing the same reasoning process to reduce the possibility of candidate classes step by step until the most likely intent category is finally predicted.

[0136] In the embodiment of the present application, by constructing a target knowledge base, it is possible to improve the accuracy of code-related knowledge retrieval and provide a beneficial knowledge chain for downstream reasoning tasks.

[0137] Based on the same technical concept, Fig. 9 An operation and maintenance knowledge base construction device 900 provided in an embodiment of the present invention is exemplarily shown. The location synchronization device 900 can execute the process of the operation and maintenance knowledge base construction method.

[0138] like Fig. 9 As shown, the construction device 900 includes:

[0139] An acquisition unit 901 is used to acquire target keywords corresponding to a target operation and maintenance scenario;

[0140] A retrieval unit 902 is used to retrieve a target document related to a target keyword from a knowledge pool, where the knowledge pool includes mixed documents containing codes and texts;

[0141] The construction unit 903 is used to extract at least one knowledge base unit from the target document and generate an operation and maintenance knowledge base based on the at least one knowledge base unit; the knowledge base unit includes text knowledge fragments and code samples.

[0142] Optionally, the target document is in Markdown format; the construction unit 903 is used to:

[0143] According to the catalog of each knowledge point in the target document, the target document is split into multiple sub-documents in Markdown format, and each of the multiple sub-documents includes knowledge content;

[0144] For each sub-document, perform the following steps: based on the six dimensions in the six-dimensional analysis method, extract the knowledge content corresponding to each dimension from the sub-document; extract code samples from the sub-document; and construct the knowledge base unit corresponding to the sub-document based on the knowledge content and code samples corresponding to the six dimensions.

[0145] Optionally, the acquisition unit 901 is used to: obtain the operation and maintenance script generated by the system corresponding to the target operation and maintenance scenario within a preset time period; extract technical keyword roots from the operation and maintenance script generated by the system within the preset time period; expand and disambiguate the technical keyword roots to obtain the target keyword corresponding to the target operation and maintenance scenario.

[0146] Optionally, the retrieval unit 902 is further used to: pre-process the target document and filter irrelevant information in the target document.

[0147] Optionally, the knowledge pool includes technical documents corresponding to the target operation and maintenance scenario on a system external website and documents in a system internal document library.

[0148] Based on the same technical concept, Fig.10 An apparatus 1000 for using an operation and maintenance knowledge base provided in an embodiment of the present invention is exemplarily shown. The apparatus 1000 can execute the process of a method for using the operation and maintenance knowledge base.

[0149] like Fig.10 As shown, the construction device 1000 includes:

[0150] An acquisition unit 1001 is used to acquire a first task instruction, where the first task instruction includes a target operation and maintenance script and a target reasoning task;

[0151] A retrieval unit 1002 is used to retrieve a target knowledge base unit related to the target operation and maintenance script and a knowledge base path corresponding to the target knowledge base unit from the operation and maintenance knowledge base based on the target operation and maintenance script;

[0152] A construction unit 1003 is used to construct a target thinking chain corresponding to the target reasoning task based on the thinking chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task, and the auxiliary information;

[0153] The reasoning unit 1004 is used to perform a target reasoning task on a target operation and maintenance script according to a target thinking chain to obtain a reasoning result.

[0154] Optionally, the thinking chain template includes, in sequence, downstream task instruction information items, input script information items, deployment path information items, related knowledge and path information items, candidate result set information items of the reasoning task, and at least one extended information item; the construction unit 1003 is specifically used to: fill the instruction content included in the first task instruction into the downstream task instruction information item, fill the target operation and maintenance script into the input script information item, fill the target knowledge base unit and the knowledge base path corresponding to the target knowledge base unit into the related knowledge and path information item, input the multiple candidate results corresponding to the target reasoning task into the candidate result set information item of the reasoning task, fill the auxiliary information into the extended information item, and complete the construction of the target thinking chain corresponding to the target reasoning task.

[0155] Optionally, the knowledge base path corresponding to the target knowledge base unit is used to locate the knowledge base to which the target knowledge base unit belongs when executing the reasoning task, and to locate the specific position of the target knowledge base unit in the operation and maintenance knowledge base.

[0156] Optionally, the auxiliary information includes a script deployment path corresponding to the target operation and maintenance script.

[0157] Optionally, the retrieval unit 1002 is further used to: select a relevant deployment path from the operation and maintenance deployment path library as the script deployment path corresponding to the target operation and maintenance script according to the parameters in the target operation and maintenance script and / or the path where the target operation and maintenance script is running.

[0158] Optionally, the retrieval unit 1002 is specifically configured to:

[0159] Determine the similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and each knowledge base unit in the operation and maintenance knowledge base;

[0160] The k knowledge base units with the highest similarity to the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script in the operation and maintenance knowledge base are used as target knowledge base units, where k is a positive integer.

[0161] Optionally, the retrieval unit 1002 is specifically configured to:

[0162] For each knowledge base unit in the operation and maintenance knowledge base, execute:

[0163] Determine a first similarity set between a target operation and maintenance script and a knowledge base unit, the first similarity set including at least one of the following similarities: a first similarity, a second similarity, and a third similarity; wherein the first similarity is a similarity between the target operation and maintenance script and a code sample in the knowledge base unit, the second similarity is a similarity between the target operation and maintenance script and the knowledge base unit, and the third similarity is a similarity between the target operation and maintenance script and a text knowledge fragment in the knowledge base unit;

[0164] Determine a second similarity set between a script deployment path corresponding to a target operation and maintenance script and a knowledge base unit, the second similarity set comprising at least one of the following similarities: a fourth similarity and a fifth similarity, wherein the fourth similarity is a similarity between the script deployment path and a code sample in the knowledge base unit, and the fifth similarity is a similarity between the script deployment path and the knowledge base unit;

[0165] Determine a third similarity set between the target operation and maintenance script and the script deployment path and the knowledge base unit, the third similarity set including at least one of the following similarities: a sixth similarity, a seventh similarity, and an eighth similarity; wherein the sixth similarity is the similarity between the target operation and maintenance script and the script deployment path and the code sample in the knowledge base unit, the seventh similarity is the similarity between the target operation and maintenance script and the script deployment path and the knowledge base unit, and the eighth similarity is the similarity between the target operation and maintenance script and the script deployment path and the text knowledge fragment in the knowledge base unit;

[0166] According to the first similarity set, the second similarity set and the third similarity set, a target similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and the knowledge base unit is determined.

[0167] Optionally, the target reasoning task is to predict the category to which the script belongs, and the multiple candidate results corresponding to the target reasoning task include a script candidate classification set.

[0168] Optionally, the target reasoning task is to predict the script intent of the script, and the multiple candidate results corresponding to the target reasoning task include a script candidate intent set.

[0169] Based on the same technical concept, an embodiment of the present invention provides a computing device, including:

[0170] A memory for storing program instructions;

[0171] The processor is used to call the program instructions stored in the memory and execute the method for constructing the operation and maintenance knowledge base or the method for using the operation and maintenance knowledge base according to the obtained program.

[0172] Based on the same technical concept, an embodiment of the present invention provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned method for constructing an operation and maintenance knowledge base or the method for using an operation and maintenance knowledge base.

[0173] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take 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.

[0174] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0177] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0178] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of this application and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for constructing an operation and maintenance knowledge base, characterized in that: include: Obtain target keywords corresponding to the target operation and maintenance scenario; Retrieving a target document related to the target keyword from a knowledge pool, wherein the knowledge pool includes mixed documents containing codes and texts; At least one knowledge base unit is extracted from the target document, and an operation and maintenance knowledge base is generated based on the at least one knowledge base unit; the knowledge base unit includes text knowledge fragments and code samples.

2. The method according to claim 1, characterized in that The target document is in Markdown format; and extracting at least one knowledge base unit from the target document includes: According to the catalog of each knowledge point in the target document, split the target document into multiple sub-documents in Markdown format, each of the multiple sub-documents including knowledge content; For each subdocument, execute: Based on the six dimensions in the six-dimensional analysis method, extract the knowledge content corresponding to each dimension from the sub-documents respectively; extracting code samples from the subdocument; According to the knowledge contents respectively corresponding to the six dimensions and the code examples, a knowledge base unit corresponding to the sub-document is constructed.

3. A method for using an operation and maintenance knowledge base, characterized in that: The operation and maintenance knowledge base is constructed based on the method according to claim 1 or 2, and the method comprises: Obtaining a first task instruction, wherein the first task instruction includes a target operation and maintenance script and a target reasoning task; Based on the target operation and maintenance script, a target knowledge base unit related to the target operation and maintenance script and a knowledge base path corresponding to the target knowledge base unit are retrieved from the operation and maintenance knowledge base; Based on the thinking chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task and the auxiliary information, construct a target thinking chain corresponding to the target reasoning task; According to the target thinking chain, the target reasoning task is executed on the target operation and maintenance script to obtain a reasoning result.

4. The method according to claim 3, characterized in that The thought chain template includes, in sequence, downstream task instruction information items, input script information items, deployment path information items, related knowledge and path information items, candidate result set information items of the reasoning task, and at least one extended information item; the thought chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, the multiple candidate results corresponding to the target reasoning task, and the auxiliary information are constructed to construct the target thought chain corresponding to the target reasoning task, including: Fill the instruction content included in the first task instruction into the downstream task instruction information item, fill the target operation and maintenance script into the input script information item, fill the target knowledge base unit and the knowledge base path corresponding to the target knowledge base unit into the relevant knowledge and path information item, input the multiple candidate results corresponding to the target reasoning task into the candidate result set information item of the reasoning task, fill the auxiliary information into the extended information item, and complete the construction of the target thinking chain corresponding to the target reasoning task.

5. The method according to claim 3, characterized in that The knowledge base path corresponding to the target knowledge base unit is used to locate the knowledge base to which the target knowledge base unit belongs when executing the reasoning task, and to locate the specific position of the target knowledge base unit in the operation and maintenance knowledge base.

6. The method according to claim 3, characterized in that The auxiliary information includes a script deployment path corresponding to the target operation and maintenance script.

7. The method according to claim 6, characterized in that The method further comprises: According to the parameters in the target operation and maintenance script and / or the path where the target operation and maintenance script is located when running, a relevant deployment path is selected from the operation and maintenance deployment path library as the script deployment path corresponding to the target operation and maintenance script.

8. The method according to claim 6, characterized in that The retrieving a target knowledge base unit related to the target operation and maintenance script from the operation and maintenance knowledge base based on the target operation and maintenance script includes: Determine the similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script, and each knowledge base unit in the operation and maintenance knowledge base; The k knowledge base units in the operation and maintenance knowledge base with the highest similarity to the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script are used as the target knowledge base units, where k is a positive integer.

9. The method according to claim 8, characterized in that Determining the target similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and each knowledge base unit in the operation and maintenance knowledge base includes: For each knowledge base unit in the operation and maintenance knowledge base, execute: Determine a first similarity set between the target operation and maintenance script and the knowledge base unit, the first similarity set including at least one of the following similarities: a first similarity, a second similarity, and a third similarity; wherein the first similarity is the similarity between the target operation and maintenance script and the code sample in the knowledge base unit, the second similarity is the similarity between the target operation and maintenance script and the knowledge base unit, and the third similarity is the similarity between the target operation and maintenance script and the text knowledge fragment in the knowledge base unit; Determine a second similarity set between a script deployment path corresponding to the target operation and maintenance script and the knowledge base unit, wherein the second similarity set includes at least one of the following similarities: a fourth similarity and a fifth similarity, wherein the fourth similarity is a similarity between the script deployment path and a code sample in the knowledge base unit, and the fifth similarity is a similarity between the script deployment path and the knowledge base unit; Determine a third similarity set between the target operation and maintenance script and the script deployment path and the knowledge base unit, the third similarity set including at least one of the following similarities: a sixth similarity, a seventh similarity, and an eighth similarity; wherein the sixth similarity is the similarity between the target operation and maintenance script and the script deployment path and the code sample in the knowledge base unit, the seventh similarity is the similarity between the target operation and maintenance script and the script deployment path and the knowledge base unit, and the eighth similarity is the similarity between the target operation and maintenance script and the script deployment path and the text knowledge fragment in the knowledge base unit; According to the first similarity set, the second similarity set and the third similarity set, a target similarity between the target operation and maintenance script and the script deployment path corresponding to the target operation and maintenance script and the knowledge base unit is determined.

10. The method according to any one of claims 3 to 9, characterized in that: The target reasoning task is to predict the category to which the script belongs, and the multiple candidate results corresponding to the target reasoning task include a script candidate classification set.

11. The method according to any one of claims 3 to 9, characterized in that: The target reasoning task is to predict the script intent of the script, and the multiple candidate results corresponding to the target reasoning task include a script candidate intent set.

12. A device for constructing an operation and maintenance knowledge base, characterized in that: include: An acquisition unit, used to acquire target keywords corresponding to a target operation and maintenance scenario; A retrieval unit, used to retrieve a target document related to the target keyword from a knowledge pool, wherein the knowledge pool includes mixed documents containing codes and texts; A construction unit is used to extract at least one knowledge base unit from the target document and generate an operation and maintenance knowledge base based on the at least one knowledge base unit; the knowledge base unit includes text knowledge fragments and code samples.

13. A device for using an operation and maintenance knowledge base, characterized in that: The operation and maintenance knowledge base is constructed based on the method according to claim 1 or 2, and the using device includes: An acquisition unit, configured to acquire a first task instruction, wherein the first task instruction includes a target operation and maintenance script and a target reasoning task; A retrieval unit, configured to retrieve, based on the target operation and maintenance script, a target knowledge base unit related to the target operation and maintenance script and a knowledge base path corresponding to the target knowledge base unit from the operation and maintenance knowledge base; A construction unit, configured to construct a target thinking chain corresponding to the target reasoning task based on the thinking chain template corresponding to the target reasoning task, the first task instruction, the target operation and maintenance script, the target knowledge base unit, the knowledge base path corresponding to the target knowledge base unit, a plurality of candidate results corresponding to the target reasoning task, and auxiliary information; The reasoning unit is used to execute the target reasoning task on the target operation and maintenance script according to the target thinking chain to obtain the reasoning result.

14. A computing device, characterized in that include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 11 according to the obtained program.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Knowledge base construction method and device, storage medium and program product

    CN120598008A