CN116775002A - Method and device for generating fault diagnosis instruction flow - Google Patents

Method and device for generating fault diagnosis instruction flow Download PDF

Info

Publication number
CN116775002A
CN116775002A CN202310781815.7A CN202310781815A CN116775002A CN 116775002 A CN116775002 A CN 116775002A CN 202310781815 A CN202310781815 A CN 202310781815A CN 116775002 A CN116775002 A CN 116775002A
Authority
CN
China
Prior art keywords
corpus
paragraph
diagnosis
sentence
language model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310781815.7A
Other languages
Chinese (zh)
Inventor
黄勋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fiberhome Technical Services Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fiberhome Technical Services Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd, Wuhan Fiberhome Technical Services Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202310781815.7A priority Critical patent/CN116775002A/en
Publication of CN116775002A publication Critical patent/CN116775002A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to the field of intelligent operation and maintenance, in particular to a method and a device for generating fault diagnosis instruction flow. Mainly comprises the following steps: constructing a paragraph corpus sample according to the sentence corpus sample, and training the language model by using the paragraph corpus sample until the output result of the language model is optimal; analyzing the paragraph corpus to be analyzed by using the trained language model, and matching the diagnosis instruction flow in the code form according to the analysis result of the language model. The invention can analyze the diagnosis instruction and the execution sequence of the diagnosis instruction by the diagnosis description text of the natural language input by the user, then match the diagnosis instruction with the diagnosis function, and generate the fault diagnosis instruction flow in the code form, so that the fault diagnosis instruction flow can be directly called by a downstream program to improve the automation efficiency of fault diagnosis.

Description

Method and device for generating fault diagnosis instruction flow
Technical Field
The invention relates to the field of intelligent operation and maintenance, in particular to a method and a device for generating fault diagnosis instruction flow.
Background
Intelligent diagnosis of faults has been a focus of attention by practitioners. The automatic development of fault diagnosis operation according to fault description or diagnosis action text is always a goal pursued by practitioners. For this reason, a large number of expert systems or diagnostic rule libraries are created to assist practitioners in increasing the level of automation of intelligent diagnosis of faults.
Along with the fire explosion of the generated language model technology, cases of synergy and energization of the language model are continuously presented in various fields, and technical ideas for solving the problem of fault diagnosis in the communication field by using the language model begin to appear. At present, the intelligent diagnosis of faults mainly comprises the following schemes: 1. extracting human-computer object triplet data from a user, an information system and a physical system through learning entity relation joint extraction models; and constructing a communication system equipment fault knowledge graph according to the man-machine object triplet data, and performing visual display. 2. And directly outputting the outline description text related to the fault characteristics through the input alarm information text. The two schemes generate a knowledge graph or a description text through an alarm text, and the generated result is still from text to text in nature, and cannot be directly used for program call or directly improve the automation level of fault diagnosis.
In view of this, how to overcome the defects existing in the prior art, and solve the problem that the analysis result of the instruction flow cannot be directly used for program call in the prior art is a problem to be solved in the technical field.
Disclosure of Invention
Aiming at the defects or improvement demands of the prior art, the invention solves the problem that the instruction flow analysis result in the prior art cannot be directly used for program call.
The embodiment of the invention adopts the following technical scheme:
in a first aspect, the present invention provides a method for generating a fault diagnosis instruction flow, which specifically includes: constructing a paragraph corpus sample according to the sentence corpus sample, and training the language model by using the paragraph corpus sample until the output result of the language model is optimal; analyzing the paragraph corpus to be analyzed by using the trained language model, and matching the diagnosis instruction flow in the code form according to the analysis result of the language model.
Preferably, the constructing a paragraph corpus sample according to the sentence corpus sample specifically includes: generating a first number of sentence corpus samples, wherein each sentence corpus sample corresponds to a diagnosis instruction, and generating a sentence template through the sentence corpus samples; generating a second number of sentence corpus samples based on the sentence template, and constructing the generated sentence corpus samples into paragraph corpus samples according to the execution sequence of the diagnosis instructions, wherein the second number is larger than the first number.
Preferably, the generating the second number of sentence corpus samples based on the sentence template specifically includes: filling different sentence templates by using random values, so that each sentence template contains different numbers and/or different types of diagnostic actions; and taking the filled sentence template as a sentence corpus until the number of the sentence corpora reaches a second number.
Preferably, the constructing the generated sentence corpus sample into the paragraph corpus sample according to the execution sequence of the diagnosis instruction specifically includes: arranging the sentence corpus with the appointed number according to the sequence of step numbers to obtain a paragraph corpus sample with a first instruction flow; and/or randomly increasing the jump positions and/or the jump quantity for the arranged sentence corpus to obtain a paragraph corpus sample with a second instruction flow; and/or randomly adding noise interference in the paragraph corpus sample of the first instruction flow or the paragraph corpus sample of the second instruction flow so as to simulate the situation in the real scene.
Preferably, the training the language model by using the paragraph corpus sample specifically includes: taking natural language text in the paragraph corpus sample as an input set of the language model, and taking an instruction flow in the paragraph corpus sample as an output set of the language model; and adjusting parameters of the language model until the instruction flow output by the language model is close to the instruction flow in the output set.
Preferably, the analyzing the paragraph corpus to be analyzed by using the trained language model specifically includes: the language model generates a node information text corresponding to each diagnosis instruction according to the input natural language text, and extracts node information in each node information text through a regular expression template; generating nodes of the diagnosis flow chart according to the node information, and generating side relations of the diagnosis flow chart according to the execution sequence and the jump relation of the nodes; and generating a diagnosis flow chart according to the node information and the side relation, and taking the diagnosis flow chart as an analysis result of the paragraph corpus.
Preferably, the extracting node information in each node information text through the regular expression template specifically includes: and extracting the characteristics of the node information text through a regular expression template, converting the characteristic character strings of the node information text into list objects, wherein each list object comprises one or more dictionary structures related to downstream execution functions, and the dictionary structures are used as node information.
Preferably, the analyzing the paragraph corpus to be analyzed by using the trained language model further includes: and carrying out regular expression template verification on the output results of the edges and the nodes in the diagnosis flow chart, and adding a credibility mark in the edges according to the verification results.
Preferably, the diagnosis instruction flow in the form of the code is matched according to the analysis result of the language model, and specifically includes: matching the closest diagnostic function of the node according to the node information of each node, and obtaining a similarity evaluation index of each matching result; and selecting the diagnosis function with the highest similarity evaluation index as the diagnosis function which is actually executed, and transmitting the function parameters in the node information into the diagnosis function as the diagnosis instruction of the corresponding step of the node.
On the other hand, the invention provides a device for generating fault diagnosis instruction flow, which specifically comprises the following steps: the fault diagnosis method comprises the steps of connecting at least one processor with a memory through a data bus, wherein the memory stores instructions executed by the at least one processor, and the instructions are used for completing the fault diagnosis instruction flow generation method in the first aspect after being executed by the processor.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the diagnosis description text of the natural language input by the user is used for analyzing the diagnosis instruction and the execution sequence of the diagnosis instruction, then the diagnosis instruction is matched with the diagnosis function, and a fault diagnosis instruction flow in a code form is generated, so that the fault diagnosis instruction flow can be directly called by a downstream program, and the fault diagnosis automation efficiency is improved.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings that are required to be used in the embodiments of the present invention will be briefly described below. It is evident that the drawings described below are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a flowchart of a method for generating a fault diagnosis instruction flow according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for generating a fault diagnosis instruction according to another embodiment of the present invention;
FIG. 3 is a flowchart of a method for generating a fault diagnosis instruction according to another embodiment of the present invention;
FIG. 4 is a schematic diagram of partial data in the training process of the language model used in the method according to the embodiment of the present invention;
fig. 5 is a schematic diagram of a device structure for generating a fault diagnosis instruction flow according to an embodiment of the present invention;
wherein, the reference numerals are as follows:
11: a processor; 12: a memory.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The present invention is an architecture of a specific functional system, so that in a specific embodiment, functional logic relationships of each structural module are mainly described, and specific software and hardware implementations are not limited.
In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other. The invention will be described in detail below with reference to the drawings and examples.
Example 1:
currently, failure handling text described in natural language cannot be directly converted into an executable failure diagnosis program. In view of this current situation, the present embodiment provides a method for generating a fault diagnosis instruction flow based on a language model, where the method can be applied in the field of intelligent operation and maintenance, for example, in the scenarios of large-scale equipment fault diagnosis, communication system fault diagnosis, and the like.
As shown in fig. 1, the specific steps of the method for generating the fault diagnosis instruction flow provided by the embodiment of the invention are as follows:
step 101: constructing a paragraph corpus sample according to the sentence corpus sample, and training the language model by using the paragraph corpus sample until the output result of the language model is optimal.
In the method provided by the embodiment, the diagnosis description text in the natural language format is analyzed by using the language model, and the diagnosis instructions to be used and the execution sequence of the diagnosis instructions are split from the whole section of diagnosis description text.
In order to make the analysis result output by the language model as accurate as possible, the language model needs to be trained using a sample of the diagnostic descriptive text. In the actually used diagnosis description text, each sentence generally corresponds to a diagnosis instruction, and the execution sequence of the diagnosis instruction is indicated according to the sequence of each sentence, the step number in the sentence, or the skip position specification between sentences. In the method provided by the embodiment, when the corpus sample is generated, the corpus sample at sentence level is generated corresponding to the actually used diagnosis description text, and each corpus sample contains input data in the form of natural language text and output data in the form of diagnosis instructions corresponding to the natural language text, so that the language model can acquire the corresponding diagnosis instruction data according to each sentence in the diagnosis description text. Furthermore, a paragraph corpus sample is also required to be constructed according to the sentence corpus sample, and the paragraph corpus sample is used for training the language model, so that the language model can acquire the execution sequence and the skip relation of each sentence in the diagnosis description text according to the sentence sequence, the step number or the skip position in the paragraph.
In the training process, the training result can be judged according to the diagnosis instruction or diagnosis instruction flow actually corresponding to the sentence corpus sample, and the more the diagnosis instruction generated by the language model is close to the diagnosis instruction actually corresponding to the input sentence corpus sample, the more the input result of the language model is optimal. In the actual training process, in order to facilitate automatic judgment, the loss function can be used for judging whether the language model is trained, after the training of the language model reaches the designated times, whether the value of the loss function is lower than a preset threshold value is judged, and when the value of the loss function is lower than the preset threshold value, the loss function is converged, and the language model reaches the optimal value. In specific implementation, the preset threshold may be set according to an acceptable theoretical error, or may be set according to an empirical value of an actual test result.
Step 102: analyzing the paragraph corpus to be analyzed by using the trained language model, and matching the diagnosis instruction flow in the code form according to the analysis result of the language model.
After the language model is trained by using the language sample, the language model can be used for analyzing the actual paragraph corpus after the optimized language model is obtained, and the diagnosis instruction corresponding to each sentence in the paragraph corpus, the execution sequence of the diagnosis instruction and the jump relation are obtained.
After the analysis is performed by using the language model, in order to enable the diagnostic instructions to be directly called and operated by the downstream program, the analyzed diagnostic instructions are also required to be matched with the diagnostic functions actually required to be executed, and each diagnostic instruction corresponds to one diagnostic function and contains operation information such as actual parameters of the diagnostic function. Meanwhile, the execution sequence and the skip relation of the diagnostic function are organized according to the execution sequence and the skip relation of the diagnostic instruction, and finally, the fault diagnostic instruction flow in a code form capable of being directly invoked and executed is obtained.
After steps 101-102 provided in this embodiment, a fault diagnosis instruction flow may be generated according to a diagnosis description text in a natural language format input by a user, and each step in the diagnosis instruction flow is matched with a corresponding program object, so that a downstream program may directly execute a corresponding diagnosis function to perform automatic fault diagnosis.
In practical implementations, the corpus samples used for training are generally from a troubleshooting manual, and the number of samples is small. Further, since the input corpus in the troubleshooting manual does not have a diagnosis instruction output in the code object format corresponding thereto, such a text cannot be directly used as a corpus sample at the time of language model training. In order to obtain a sufficient corpus sample, as shown in fig. 2, the following steps may be taken to construct a paragraph corpus sample from sentence corpus samples.
Step 201: generating a first number of sentence corpus samples, wherein each sentence corpus sample corresponds to one diagnosis instruction, and generating a sentence template through the sentence corpus samples.
Typically, one-to-one sentence-level text/instructions are easier to construct, while paragraph-level corpus samples are difficult to construct directly. Therefore, in the method provided by the embodiment, the sentence-level corpus sample is used to construct the paragraph-level corpus sample. In practical implementation, the content, format and number of sentence corpus samples can be determined according to practical needs. For convenience of use, the format of the sentence corpus sample is preferably a dictionary structure, and the dictionary structure contains keys of types such as function names, function descriptions, function actual parameters and the like corresponding to the instructions, and values corresponding to each type of key. When the method is specifically used, the corresponding diagnosis instruction can be determined through function names or function descriptions in sentence corpus samples, and parameters of the diagnosis instruction are determined according to function real parameters. Sentence corpus samples may be obtained using a variety of available means, such as: by handwriting, it is generated from typical examples in the troubleshooting manual, and it is generated from typical diagnostic text for practical use.
Furthermore, in order to quickly generate sentence corpus samples, a small amount of sentence corpus samples can be used as sentence templates, and a larger amount of sentence corpus samples can be generated through the sentence templates. In a specific implementation, the number of the sentence corpus samples which are initially generated is specified by the first number, and the number can be specifically determined according to actual needs, and the generated sentence templates can be used for preliminarily covering various diagnostic instructions which need to be used, and the number can be less than 100.
Step 202: generating a second number of sentence corpus samples based on the sentence template, and constructing the generated sentence corpus samples into paragraph corpus samples according to the execution sequence of the diagnosis instructions, wherein the second number is larger than the first number.
The corpus sample at the paragraph level contains a plurality of diagnosis instructions and possibly complex jump flow, the construction process is tedious and easy to make mistakes, and the corpus sample is difficult to construct by manual handwriting. In this embodiment, a sufficient number of sentence corpus samples are used to construct a paragraph corpus sample. Specifically, after sentence templates are obtained, different sentence templates are filled by using random values, so that each sentence template contains different numbers and/or different types of diagnostic actions; and taking the filled sentence template as sentence corpus until the number of the sentence corpus reaches the second number.
After obtaining a sufficient number of sentence corpus samples, adding step serial numbers into each sentence corpus sample, and arranging the appointed number of sentence corpora according to the sequence of the step serial numbers to obtain a paragraph corpus sample with a first instruction flow.
And combining diagnosis flows such as an execution sequence, a jump position and the like to construct a paragraph corpus sample. In the implementation, the number of sentence corpus samples for constructing the paragraph corpus samples is specified by the second number, so as to meet the requirement of the paragraph corpus samples. The number of constructed paragraph corpus samples needs to meet the requirement of language model training; or a small number of paragraph corpus samples can be constructed, for example, 400 paragraph corpus samples are constructed, and then the number of the paragraph corpus samples is increased according to the number of the downstream functions.
For the generated corpus samples of paragraphs, different parameters can be used to improve the diversity of the samples, and further increase the number of corpus samples of paragraphs, for example: adjusting the number of sentences in the paragraphs; changing the sentence corpus sample contained; randomly increasing the jump positions and/or the jump quantity for the arranged sentence corpus; obtaining a paragraph corpus sample with a second instruction flow; noise interference is randomly added in the paragraph corpus sample of the first instruction flow or the paragraph corpus sample of the second instruction flow so as to simulate the situation in a real scene and the like. The above modes can be alternatively used under the condition of no conflict, and can also be mutually combined so as to obtain more diversified and more quantity paragraph corpus samples.
After steps 201 to 202 provided in this embodiment, automatic construction of the paragraph corpus sample can be completed, and the corpus sample for language model training is obtained.
After a sufficient amount of paragraph corpus samples are obtained, the paragraph corpus samples can be used for training a language model. The language model used may be selected according to the proficiency of hardware and personal use, and the embodiment does not limit the specific choice of language model. The following description uses the T5 model in the transducer class model as an example, T5 is the Text-to-Text Transfer Transformer model of the google open source, a sequence-to-sequence (seq 2 seq) model. It is to be understood that the following examples are provided for illustrative purposes only and that in actual practice, the implementation may be performed in the following manner, other language models may be selected, or the embodiments may be adapted.
As shown in fig. 3, the process of training a language model using paragraph corpus samples is as follows.
Step 301: taking natural language text in the paragraph corpus sample as an input set of the language model, and taking an instruction flow in the paragraph corpus sample as an output set of the language model.
After the paragraph corpus sample set is generated according to steps 201-202, the paragraph corpus sample set can be directly used, or the paragraph corpus sample can be preprocessed. For example: and (3) word segmentation is carried out on each instance in an input set (natural language text) and an output set (instruction flow) in the sample set, and the maximum token (word example) lengths max_input and max_output of the input set and the output set are respectively obtained. The placeholder is then used to pad the input set to the max_input length and to pad the output set to the max_output length. After the processing, the lengths of all the examples in the input set are consistent, and the lengths of all the examples in the output set are consistent, so that the format requirements of the input and output of the T5 model are met.
Step 302: and adjusting parameters of the language model until the instruction flow output by the language model is close to the instruction flow in the output set.
According to the text of the input paragraph corpus sample, the language model learns to generate an instruction flow which can be matched with codes according to the fault diagnosis description of the natural language text. This process can be regarded as a classification problem: that is, according to the input sequence of the max_input length, a proper token is selected for each position of the sequence of the max_output length to fill in, and the filled-in sequence is taken as output. Because the training purpose of the language model is to enable the language model to generate the instruction flow in the output set according to the paragraph corpus sample in the input set, in the training process, the instruction flow output by the language model can be compared with the instruction flow in the output set, the instruction flow in the output set is used as the standard instruction flow, and the more the sequence output by the language model is close to the standard instruction flow, the more the trained language model output result is optimized, and the used loss function and super parameters can be adjusted according to the data size and specific model selection. The value of the loss function may be observed to have a decreasing trend during the training process, and when the value of the loss function is below a preset threshold, it indicates that the loss function has converged. The partial data during training is shown in fig. 4. After the training round is finished, the model is saved, and the optimized language model after training can be obtained.
After steps 301 to 302 provided in this embodiment, training of the language model may be completed, and an optimized language model may be obtained.
After the optimized language model is obtained, the language model can be used for analyzing the actual paragraph corpus, in order to facilitate the subsequent matching with the diagnosis function in the code form, the corpus analysis result can be organized in the form of a diagnosis flow chart (graph), and the edge (edge) relation and node (node) information of the fault diagnosis flow chart can be generated according to the diagnosis description text in the natural language format input by the user. The language model generates a node information text corresponding to each diagnosis instruction according to the input natural language text, and extracts node information in each node information text through a regular expression template; generating nodes of the diagnosis flow chart according to the node information, generating side relations of the diagnosis flow chart according to the execution sequence and the jump relation of the nodes, generating the diagnosis flow chart according to the node information and the side relations, and taking the diagnosis flow chart as an analysis result of the paragraph corpus. The side relationship of the diagnostic flow chart is the upstream and downstream connection relationship between the steps and branch jump information, and the node information in the diagnostic flow chart refers to the information of the specific diagnostic function to be executed, including function numbers, function aliases, function descriptions, function actual parameters and the like.
In order to further improve the executable degree of the diagnosis flow and provide credibility information of the diagnosis flow for the downstream, the generation result of the language model can be optimized. The following provides some simple optimization methods, which may be used alone or in combination, and other optimization methods may be used as needed in practical implementations.
(1) And extracting the characteristics of the node information text through a regular expression template, converting the characteristic character strings of the node information text into list objects, wherein each list object comprises one or more dictionary structures related to downstream execution functions, and the dictionary structures are used as node information.
The regular expression template can be generated according to the content and format of the node information, the node information in the text form generated by the language model can be converted into list objects through extraction of the regular expression template, and each list object comprises one or more dictionary structures related to downstream execution functions, wherein the dictionary structures comprise: function number (func_idx), function alias (func_alias), function description (func_info) and function real parameter (func_params) four kinds of keys and their corresponding values, so as to normalize node information in one step, and make the node information in text form easier to be converted into diagnostic function in code form.
(2) And carrying out regular expression template verification on the output results of the edges and the nodes in the diagnosis flow chart, and adding a credibility mark in the edges according to the verification results.
In order to avoid that the paragraph corpus itself contains an error flow or an error flow occurs in the language model analysis process, regular expression template verification can be performed on the edge and node output results, the edge mark conforming to the template is a useable edge mark, and the edge mark not conforming to the template is a unreuseable edge mark. In a specific scene, adding a credibility mark to a flow edge generated by a model through regular expression template verification. The marking result can be used as a significant prompt for human user modification or direct execution, the human user can modify the output result of the language model, the modified output result is more reliable through manual improvement, the input paragraph corpus sample and the side and node information in the diagnosis flow chart modified by the user can be stored as new paragraph corpus samples, the sample library is expanded, and the training iteration of the model is optimized.
After analysis, extraction and optimization, the data required by the start node, the end node, the jump information, the credibility mark list and the like of the edges in the diagnosis flow chart can be obtained, the format requirements when the diagnosis functions are matched are met, and the data can be directly used as real parameters to be transmitted to the subsequent matching functions. Matching the closest diagnostic function of the node according to the node information of each node, and obtaining a similarity evaluation index of each matching result; and selecting the diagnosis function with the highest similarity evaluation index as the diagnosis function which is actually executed, and transmitting the function parameters in the node information into the diagnosis function as the diagnosis instruction of the corresponding step of the node. Specifically, the triplets of func_idx, func_alias and func_info may be utilized, and the most closely matched diagnostic functions in the database of diagnostic functions may be used for execution, where the similarity evaluation index may be represented by an edit distance (metric), and the lower the edit distance, the higher the similarity evaluation index, and the edit distance of each dimension in the triplets may be adjusted as required.
Finally, selecting the smallest diagnostic function from the candidate diagnostic function set as the matched diagnostic function, and transmitting func_params into the matched diagnostic function to execute the diagnosis in the step. According to the diagnosis flow chart, each node is matched, and the diagnosis process represented by the whole paragraph corpus can be completed by sequentially executing the nodes according to the execution sequence and the jump position provided by the edge relation.
The fault diagnosis instruction flow generation method provided by the embodiment has the following advantages:
1. the fault diagnosis text described by natural language is directly converted into a callable program object for the call of a downstream program, so that the conversion from the fault diagnosis text to the diagnosis program can be automatically carried out.
2. The construction method of paragraph level fault training corpus is realized, and corpus foundation is provided for model training in the fault diagnosis field under the reality condition that samples in the field are rare; and adds a link to extend the sample library using human feedback.
3. A diagnosis flow is generated by supporting more complex paragraph corpus texts, such as scenes containing a plurality of diagnosis operations and a plurality of parameters in sentences.
4. The output result optimizing method is provided by combining the output reality of the language model, so that the output result can be manually modified according to the credibility.
5. In combination with the model output reality, the edit distance calculated values of three dimensions of the function number, the function alias and the function description are provided as the matching measurement, and the final execution function is matched in a searching mode under the condition that the current model generation result cannot completely and accurately output the real function, so that the reliability is improved.
Example 2:
based on the method for generating the fault diagnosis instruction flow provided in embodiment 1, in this embodiment, a specific implementation procedure of the method in embodiment 1 is further described with reference to a specific example in an actual implementation scenario. In different specific application scenes, the system can be supplemented and adjusted according to different use requirements or actual scenes. The technical solutions in the embodiments of the present invention may be selected and combined with the technical solutions in embodiment 1 for use in the case where there is no conflict.
A first number of sentence corpus samples is first generated, per step 101.
For example, in a specific implementation scenario, a sentence corpus sample is generated in the following form, where each { } is a sentence corpus sample. In practical implementation, the specific form of sentence corpus is not limited, and can provide enough information and can be used by language model.
{ "query": "checks whether the network management service INIT-NMB service is normal,
"answer" ("[ function number 3_c5k_srvname ] checks to see if $ { servername = [ 'INIT-NMB' ]") is a normal parameter, direct.
{ "query": "checks whether an alarm RLOS appears at the home terminal,
"answer" [ function sequence number 4_ck_loc_alarm ] checks whether $ { location } appears $ { alarm } parameter subject (location= [ 'local' ], alarm= [ 'RLOS' ] ").
In each sentence corpus sample, the diagnosis description text and the diagnosis instruction information are contained by using label distinction. The diagnostic instruction information comprises data such as function serial numbers, function descriptions, function actual parameters and the like. In actual use, the data such as the function sequence number, the function description, the function real parameters and the like can be used as the to-be-filled items of the sentence template, and random values or other acceptable contents are used for filling the to-be-filled items, so that a second number of sentence corpus samples are obtained.
After the sentence corpus sample is obtained, a paragraph corpus sample can be constructed through the sentence corpus sample. In practical implementation, the specific form of the paragraph corpus is not limited, and can provide enough information and be used by a language model.
{ "Q": "step:. 59ping one network management address, check if the network management service TM-SERVER service is normal; checking whether the alarm ALA1, PMN2 and TYUP3 occur at the local end, and checking whether the network management service INIT-NMB and YUO service are normal. Other cases jump step __ x 39; if yes, jump step is that whether the 38_nstep 12 optical fiber is full red, whether PLYU alarm information exists in the root alarm or not, and begin to check; step_60 if successful; failure jumps to step_41_nstep 33 to see if historical alarms for SXZ and ZMO occur within 24 minutes; and if the alarms L3T and Tg7 exist in the management port and the root alarm of the ping network element, otherwise, switching to step __. If yes, jump step __. If no reaction occurs, transferring step that _2\ nstep __21 checks the network element, single disk and port information of the fault, and ending the whole troubleshooting; other cases jump step 58",
"A"; "[ [ [ -" step_59 ", -" step_39 ", -" other "], - [ -" step_59 ", -" step_38 ", -" success "], [ (step_12", - "step_60", - "success" ], - [ - "step_12", - "step_41", - "fail" ], [ "step_33", "step_59", "" fail "], [ (step_33", "" step_29 "," "success" ], [ "step_33", "step_2", "" other "], [" step_21 "," "step_58", "" other "], { step_59"; the function number 6_ping_addr checks if the { alarm } parameter is present or not (location= [ 'local end' ], alarm= [ 'ALA1', 'PMN2', 'TYUP3' ] 'function number 3_ck srname ] checks if the { SERVER name } is normal (SERVER name= [' TM-SERVER ']) ], if the { alarm } parameter is present or not (location=' location = 'local end' ], alarm = [ 'ALA1', 'PMN2', 'TYUP3' ] 'function number 3_ck srname ]' checks if the { SERVER name } is normal (SERVER name= [ 'N-NM', YUO ']) ], if the { alarm function number 12_n is specified (location=' alarm) parameter is present or not, "step_33" - [ function number 10_ck_tm_alarm ] checks whether parameter subject (time= [29], alarm = [ ' SXZ ', ' ZMO ', ' function number 7_get_pos ] fault location information parameter subject () \n [ function number 9_ck_root_alarm ] has alarm $ { alarm { (alarm } 8T ', ' Tg7' ]) \n } parameter subject) } in the near $ { time } minute, $ { alarm } parameter subject (alarm = [ ' L3T ', ' Tg7' ]), ' n "," check "- [ function number 21\7_get_pos ] fault location information parameter subject () \n [ function number 2] end ()" -function number 2] parameter of the alarm } end ("-2_d) parameter.
In the paragraph corpus sample, the label is used for distinguishing the diagnosis description text and the diagnosis instruction information. Where "Q" represents a diagnosis description text and "a" represents diagnosis instruction information. "step" indicates a step number, and the following numbers indicate the execution order of diagnostic instructions, which are executed in this step order, and corresponding jumps are made according to the "jump" description. Random noise interference can also be added or some information can be replaced by a random value in order to obtain more paragraph corpus samples, for example, in the above example: the random messy characters and numbers after step numbering are random noise dry burning, and the diagnosis action can be replaced by a random value.
After obtaining a sufficient number of paragraph corpus samples, the language model may be trained using the paragraph corpus samples according to step 102. In particular implementations, the language model used and the parameters of the language model may be selected as desired. In this embodiment, the T5 model in the converterler class model is used as a language model, and the cross entropy loss function in the classification problem is trained and adopted. The training process uses Adam optimization algorithm for gradient descent optimization model parameters, learning rate set to 0.0001, training batch size (batch size) 1, training round set 40. The super parameters in the training process can be adjusted according to different data sizes and language models.
After the language model training is completed, the language model can be used for analyzing the actual paragraph corpus. Taking the paragraph corpus as an example, after language model analysis, checking by a regular expression template, and adding a credibility mark. Finally, generating a starting node, a terminating node, jump information and a credibility mark of the edges in the diagnosis flow chart. And composes the above information into a list object in the following form.
[
[“STEP_1”,STEP_2”,“force”,“reliable”],
[“STEP_1”,STEP_3”,“reliable”],
...
]
On the other hand, node information in the diagnostic flow chart may also be generated by analyzing the results, for example: the node information of a certain node is exemplified as follows:
STEP_9:
[ { ' func_idx ': '4', ' func_alias ': ' ck_loc_alarm ', ' func_info ': the method includes the steps of ' checking whether a $ { positioning } appears or not, ' func_params } ' is present in ' a ' view } ' and ' func_params } ' is present in ' a ' view $ { alarm } ' is present in ' view } ' a ' view } ' is present in ' view [ -alarm } ' is not present in ' view [ -alarm [ -ALA 1', ' view } ' is not present in ' view } ' and ' func_params } ' is not present in ' view [ -alarm } ' is not present in ' view } ' is not present in ' view }, and ' view } ' is not present in ' view { (view } ' is not present in ' view } ' view $ view } ' is not present in ' view { (view } ' is not present in ' view } ' view of ' view $ view } ' is not present in ' view } ' view of ' in ' view of ' an ' of ' side of ' an.
Where 'func_idx' represents a function number, 'func_alias' represents a function alias, 'func_info' represents a function description, 'alim' represents a function argument. Through the node information, the selectable diagnostic function of each node and the real parameters of the diagnostic function can be obtained.
In practical implementation, the output result of the edge relation and the node information can be improved manually, so that the output result is more accurate. The complete paragraph corpus can be used as a new paragraph corpus sample to carry out iterative training on the language model.
After the edge relation and the node information are obtained, the actually executed diagnostic function can be matched according to the node information. The retrieval may be performed in a database storing diagnostic functions using func_idx, func_alias, and func_info triplets, and the retrieval may be performed using a diagnostic function having the highest matching similarity evaluation index, the similarity evaluation index being an edit distance, the lower the edit distance, the higher the evaluation index, and the edit distances in three dimensions being given different weights 0.7,0.2,0.1.
The candidate function is denoted as F and the edit distance can be calculated using the following manner.
metric=edit-distance(func_number,F.func_number)*0.7+
edit-distance(func_alias,F.func_alias)*0.2+
edit-distance(func_info,F.func_info)*0.1。
Finally, selecting a diagnostic function F with the minimum metric from the candidate F set, and executing a diagnostic step on the incoming func_params.
After the evaluation index of each node in the diagnosis flow chart is obtained, the diagnosis function corresponding to each node can be sequentially executed according to the sequence indicated by the edge relation in the diagnosis flow chart, and the diagnosis process indicated in the diagnosis description text is completed.
As can be seen from the above examples, the method for generating the fault diagnosis instruction flow provided in embodiment 1 can automatically implement conversion from the diagnosis description text to the diagnosis function code, and implement automatic generation of the fault diagnosis instruction flow.
Example 3:
on the basis of the method for generating the fault diagnosis instruction flow provided in the foregoing embodiments 1 to 2, the present invention further provides a device for generating the fault diagnosis instruction flow, which can be used to implement the method, as shown in fig. 5, and is a schematic device architecture diagram of an embodiment of the present invention. The apparatus for generating the fault diagnosis instruction flow of the present embodiment includes one or more processors 11 and a memory 12. In fig. 5, a processor 11 is taken as an example.
The processor 11 and the memory 12 may be connected by a bus or otherwise, for example in fig. 5.
The memory 12 is a nonvolatile computer-readable storage medium as a failure diagnosis instruction flow generation method, and can be used to store a nonvolatile software program, a nonvolatile computer-executable program, and modules, as in the failure diagnosis instruction flow generation methods of embodiments 1 to 2. The processor 11 executes various functional applications and data processing of the apparatus for generating a failure diagnosis instruction flow, that is, implements the failure diagnosis instruction flow generating methods of embodiments 1 to 2, by running the nonvolatile software programs, instructions, and modules stored in the memory 12.
Memory 12 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 12 may optionally include memory located remotely from processor 11, which may be connected to processor 11 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The program instructions/modules are stored in the memory 12 and when executed by the one or more processors 11 perform the method of fault diagnosis instruction flow generation in embodiments 1 to 2 described above, for example, performing the steps shown in fig. 1 to 3 described above.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the embodiments may be implemented by a program that instructs associated hardware, the program may be stored on a computer readable storage medium, the storage medium may include: read Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (10)

1. The fault diagnosis instruction flow generation method is characterized by comprising the following steps:
constructing a paragraph corpus sample according to the sentence corpus sample, and training the language model by using the paragraph corpus sample until the output result of the language model is optimal;
analyzing the paragraph corpus to be analyzed by using the trained language model, and matching the diagnosis instruction flow in the code form according to the analysis result of the language model.
2. The method of claim 1, wherein the constructing a paragraph corpus sample from a sentence corpus sample specifically comprises:
generating a first number of sentence corpus samples, wherein each sentence corpus sample corresponds to a diagnosis instruction, and generating a sentence template through the sentence corpus samples;
generating a second number of sentence corpus samples based on the sentence template, and constructing the generated sentence corpus samples into paragraph corpus samples according to the execution sequence of the diagnosis instructions, wherein the second number is larger than the first number.
3. The method for generating the fault diagnosis instruction flow according to claim 2, wherein the generating the second number of sentence corpus samples based on the sentence template specifically includes:
filling different sentence templates by using random values, so that each sentence template contains different numbers and/or different types of diagnostic actions;
and taking the filled sentence template as a sentence corpus until the number of the sentence corpora reaches a second number.
4. The method for generating the fault diagnosis instruction flow according to claim 2, wherein the constructing the generated sentence corpus sample into the paragraph corpus sample according to the execution sequence of the diagnosis instruction specifically includes:
arranging the sentence corpus with the appointed number according to the sequence of step numbers to obtain a paragraph corpus sample with a first instruction flow;
and/or randomly increasing the jump positions and/or the jump quantity for the arranged sentence corpus to obtain a paragraph corpus sample with a second instruction flow;
and/or randomly adding noise interference in the paragraph corpus sample of the first instruction flow or the paragraph corpus sample of the second instruction flow so as to simulate the situation in the real scene.
5. The method of claim 1, wherein the training the language model using the paragraph corpus sample specifically comprises:
taking natural language text in the paragraph corpus sample as an input set of the language model, and taking an instruction flow in the paragraph corpus sample as an output set of the language model;
and adjusting parameters of the language model until the instruction flow output by the language model is close to the instruction flow in the output set.
6. The method for generating the fault diagnosis instruction flow according to claim 1, wherein the analyzing the paragraph corpus to be analyzed by using the trained language model specifically comprises:
the language model generates a node information text corresponding to each diagnosis instruction according to the input natural language text, and extracts node information in each node information text through a regular expression template;
generating nodes of the diagnosis flow chart according to the node information, and generating side relations of the diagnosis flow chart according to the execution sequence and the jump relation of the nodes;
and generating a diagnosis flow chart according to the node information and the side relation, and taking the diagnosis flow chart as an analysis result of the paragraph corpus.
7. The method for generating the fault diagnosis instruction flow according to claim 6, wherein extracting node information in each node information text through a regular expression template specifically comprises:
and extracting the characteristics of the node information text through a regular expression template, converting the characteristic character strings of the node information text into list objects, wherein each list object comprises one or more dictionary structures related to downstream execution functions, and the dictionary structures are used as node information.
8. The method of generating a fault diagnosis instruction flow according to claim 6, wherein the analyzing the paragraph corpus to be analyzed using the trained language model further comprises:
and carrying out regular expression template verification on the output results of the edges and the nodes in the diagnosis flow chart, and adding a credibility mark in the edges according to the verification results.
9. The method for generating a fault diagnosis instruction according to any one of claims 1 to 8, wherein the diagnosis instruction in the form of a code is matched according to the analysis result of the language model, specifically comprising:
matching the closest diagnostic function of the node according to the node information of each node, and obtaining a similarity evaluation index of each matching result;
and selecting the diagnosis function with the highest similarity evaluation index as the diagnosis function which is actually executed, and transmitting the function parameters in the node information into the diagnosis function as the diagnosis instruction of the corresponding step of the node.
10. The device for generating the fault diagnosis instruction flow is characterized in that:
comprising at least one processor and a memory connected by a data bus, the memory storing instructions for execution by the at least one processor, the instructions, upon execution by the processor, for performing the method of fault diagnosis instruction flow generation of any of claims 1-9.
CN202310781815.7A 2023-06-28 2023-06-28 Method and device for generating fault diagnosis instruction flow Pending CN116775002A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310781815.7A CN116775002A (en) 2023-06-28 2023-06-28 Method and device for generating fault diagnosis instruction flow

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310781815.7A CN116775002A (en) 2023-06-28 2023-06-28 Method and device for generating fault diagnosis instruction flow

Publications (1)

Publication Number Publication Date
CN116775002A true CN116775002A (en) 2023-09-19

Family

ID=87985689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310781815.7A Pending CN116775002A (en) 2023-06-28 2023-06-28 Method and device for generating fault diagnosis instruction flow

Country Status (1)

Country Link
CN (1) CN116775002A (en)

Similar Documents

Publication Publication Date Title
US20190155905A1 (en) Template generation for a conversational agent
US7685082B1 (en) System and method for identifying, prioritizing and encapsulating errors in accounting data
CN111931517B (en) Text translation method, device, electronic equipment and storage medium
US11281862B2 (en) Significant correlation framework for command translation
CN109857846B (en) Method and device for matching user question and knowledge point
CN110287480A (en) A kind of name entity recognition method, device, storage medium and terminal device
CN110532573A (en) A kind of interpretation method and system
CN113268561B (en) Problem generation method based on multi-task joint training
CN111324708A (en) Natural language processing system based on human-computer interaction
CN110516240B (en) Semantic similarity calculation model DSSM (direct sequence spread spectrum) technology based on Transformer
CN111506709B (en) Entity linking method and device, electronic equipment and storage medium
WO2023278052A1 (en) Automated troubleshooter
CN115238045B (en) Method, system and storage medium for extracting generation type event argument
CN112417852B (en) Method and device for judging importance of code segment
CN110489730A (en) Text handling method, device, terminal and storage medium
CN116974626B (en) Analysis sequence chart generation method, device, equipment and computer readable storage medium
CN110909174B (en) Knowledge graph-based method for improving entity link in simple question answering
CN116775002A (en) Method and device for generating fault diagnosis instruction flow
Apvrille et al. System Architects Are not Alone Anymore: Automatic System Modeling with AI
Veerappa et al. Assessing the maturity of requirements through argumentation: A good enough approach
CN116842128B (en) Text relation extraction method and device, computer equipment and storage medium
EP4283546A1 (en) Machine learning prediction of additional steps of a computerized workflow
US20230214688A1 (en) Method, Apparatus for Determining Answer to Question, Device, Storage Medium and Program Product
CN110647314A (en) Skill generation method and device and electronic equipment
CN107092515A (en) A kind of LPMLN inference methods and system based on rebound strength curve logical program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination