Receipt text generation method and device, medium, equipment and product
By obtaining the characteristic data of the pending work orders, combining the operation and maintenance knowledge base and processing measures recommendation model, and using the large language model to generate automatically generated return text, the problem of irregular work order return content in the existing technology is solved, and the problem of unstandard work order reply content is improved The quality and usability of reply text.
Patent Information
- Application Number
- CN202411362440.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In the existing operation and maintenance process, the content of work order reply is manually filled out, resulting in uneven content quality, lack of in-depth reason analysis, and it is difficult to extract valuable experience and knowledge.
By obtaining the characteristic data of the pending work order, input it into the work order processing recommendation model, combining the knowledge text in the operation and maintenance knowledge base, automatically generated reply text, and using the large language model to optimize the output to ensure that the content is complete and standardized.
Significantly improve the quality and usability of reply text, enhance the industry cognitive ability of the large language model, overcome internal implicit knowledge uncertainty and difficulty in dynamic update, and provide complete and standardized work order reply text .
Smart Images

Figure CN119166753A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing technology, and in particular to a receipt text generation method, device, computer-readable storage medium, electronic device and computer program product. Background Art
[0002] With the implementation of multi-cloud unified operation and maintenance, the faults faced by operation and maintenance personnel are becoming more complex and diverse. After the fault is handled, filling in the receipt content such as "fault cause analysis" and "solution" plays a vital role in the experience accumulation and knowledge recommendation of subsequent operation and maintenance work.
[0003] In the existing operation and maintenance process, the content of the work order return slip mainly depends on the personal experience and filling habits of the operation and maintenance personnel, which makes the quality of the return slip text uneven, and often leads to incomplete and non-standard content. For example, some work order return slips only use a few simple words to describe the cause of the failure, such as "hard disk failure" or "IP is not connected", lacking in-depth cause analysis, making it difficult for subsequent maintenance personnel to extract valuable experience and knowledge from it. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a receipt text generation method, device, computer-readable storage medium, electronic device and computer program product, which can automatically generate a complete and standardized work order receipt text, thereby significantly improving the quality and usability of the receipt text.
[0005] The first embodiment of the present invention provides a method for generating a receipt text, comprising:
[0006] Get the feature data of the work order to be processed;
[0007] Inputting the characteristic data into a work order processing measure recommendation model to obtain a processing measure text;
[0008] Combining the target parameters in the feature data into a query text;
[0009] Based on the query text, obtaining corresponding knowledge text from the operation and maintenance knowledge base;
[0010] Combining the treatment measure text and the knowledge text to obtain a prompt text;
[0011] The prompt text is input into a large language model to generate a receipt text for the work order to be processed.
[0012] Optionally, the training method of the work order processing measure recommendation model includes:
[0013] Obtain a historical work order sample set; wherein the historical work order sample set includes feature data, fault analysis texts, and solution texts corresponding to a number of historical work order samples;
[0014] Inputting the fault analysis text and solution text in each of the historical work order samples into a preset text classification model to obtain a corresponding processing measure label;
[0015] The feature data and the processing measure label corresponding to each of the historical work order samples are used as the training input data and the training output label of the initial classification model respectively;
[0016] The initial classification model is trained to obtain the work order processing measure recommendation model.
[0017] Optionally, the operation and maintenance knowledge base is obtained by the following steps:
[0018] Obtain a fault case library and an operation and maintenance guide; wherein the fault case library includes at least one fault case;
[0019] Perform text slicing on each of the fault cases to obtain corresponding fault diagnosis slices and fault handling slices;
[0020] Slicing the operation and maintenance guidebook, and obtaining a plurality of guidebook slices each having a title through a title compensation mechanism;
[0021] All the fault diagnosis slices, the fault handling slices and the instruction manual slices are stored in a vector database to obtain the operation and maintenance knowledge base.
[0022] Optionally, acquiring corresponding knowledge text from an operation and maintenance knowledge base based on the query text includes:
[0023] Among all the fault diagnosis slices and the instruction manual slices in the operation and maintenance knowledge base, find the text slice with the highest similarity to the query text as the index slice;
[0024] When the index slice is the fault diagnosis slice, obtaining the corresponding fault processing slice as the knowledge text;
[0025] When the index slice is the instruction manual slice, the instruction manual slice with the same title is obtained as the knowledge text.
[0026] Optionally, the role of the large language model is set as a data center hardware operation and maintenance engineer.
[0027] Optionally, before inputting the prompt text into the large language model, the method further includes:
[0028] When the prompt text exceeds the input limit of the large language model, the prompt text is compressed by a preset text conversion model to obtain a new prompt text.
[0029] Optionally, after generating the receipt text of the work order to be processed, the method further includes:
[0030] Modifying the receipt text of the work order to be processed to obtain a modified work order;
[0031] Adding the correction work order to the operation and maintenance knowledge base so that the operation and maintenance knowledge base can be expanded;
[0032] The revised work order is added to the historical work order sample set, so that the historical work order sample set can be used for retraining to obtain a new work order processing measure recommendation model.
[0033] A second aspect of the present invention provides a receipt text generating device, characterized in that it includes:
[0034] The work order data acquisition module is used to obtain the characteristic data of the work order to be processed;
[0035] A processing measure acquisition module, used for inputting the characteristic data into a work order processing measure recommendation model to obtain a processing measure text;
[0036] A query text acquisition module, used to compose a query text from the target parameters in the feature data;
[0037] A knowledge text acquisition module, used to acquire corresponding knowledge text from the operation and maintenance knowledge base based on the query text;
[0038] A prompt text combination module, used for combining the treatment measure text and the knowledge text to obtain a prompt text;
[0039] The receipt text generation module is used to input the prompt text into the large language model to generate the receipt text of the work order to be processed.
[0040] An embodiment of the third aspect of the present invention provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the receipt text generation method described in any embodiment of the first aspect above.
[0041] The fourth aspect of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the receipt text generation method described in any embodiment of the first aspect.
[0042] An embodiment of the fifth aspect of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the receipt text generation method described in any embodiment of the first aspect when executing the computer program.
[0043] Compared with the prior art, the embodiments of the present invention provide a method, device, computer-readable storage medium, electronic device and computer program product for generating a receipt text. The method constructs a dynamic prompt text through an operation and maintenance knowledge base and a processing measure recommendation model, optimizes the input of a large language model, and guides the large language model to automatically generate a complete and standardized work order receipt text, thereby significantly improving the quality and usability of the receipt text.
[0044] In addition, the embodiment of the present invention uses a preset text classification model to perform data cleaning and automatic labeling on a set of historical work order samples to obtain training data; and uses the training data to train the initial classification model to obtain a work order processing measure recommendation model, so that the work order processing measure recommendation model can recommend the optimal processing measures for the current work order to be processed based on historical work order processing experience, that is, output the corresponding processing measure text.
[0045] In addition, the embodiment of the present invention constructs an operation and maintenance knowledge base through a fault case library and an operation and maintenance guidance manual, and combines the operation and maintenance knowledge base with a large language model to overcome the uncertainty of implicit knowledge within the large language model and the shortcomings of difficulty in dynamic updating, while enhancing the industry cognition ability of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flowchart of an embodiment of the method for generating a receipt text provided by the present invention;
[0047] Figure 2 It is an example diagram of an embodiment of the original text of the operation and maintenance guidance manual provided by the present invention;
[0048] Figure 3 It is a schematic diagram of an embodiment of obtaining corresponding knowledge text from an operation and maintenance knowledge base provided by the present invention;
[0049] Figure 4 is an exemplary diagram of an embodiment of a content instruction input into a large language model provided by the present invention;
[0050] Figure 5 It is a flowchart of another embodiment of the method for generating a receipt text provided by the present invention;
[0051] Figure 6 It is a structural schematic diagram of an embodiment of a receipt text generating device provided by the present invention;
[0052] Figure 7 It is a structural schematic diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this technical field without creative work are within the scope of protection of the present invention.
[0054] The existing work order receipt text mainly relies on manual filling, and there are no mandatory restrictions on the content and format, which will lead to obvious individual differences in the content of the filled receipt, as shown in Table 1. Due to the different personal experience and filling habits of operation and maintenance personnel, the quality of work order receipt text varies.
[0055] Table 1 Example of work order receipt content
[0056]
[0057] As can be seen from Table 1, the two parts of "fault cause analysis" and "solution" in the historical receipt text are filled in manually and lack mandatory content and format requirements, resulting in irregular or inconsistent receipt content. Some receipts are too simple to provide valuable information; some receipts confuse "fault cause analysis" and "solution", which not only makes it difficult to accurately record the cause of the problem and the solution, but also is not conducive to the accumulation of experience and knowledge reference for subsequent work.
[0058] Therefore, the embodiments of the present invention provide a receipt text generation method, device, computer-readable storage medium, electronic device and computer program product to address the problem of missing and non-standard receipt content in historical receipt texts of operation and maintenance personnel, which can automatically generate work order receipt texts with complete and standardized content, thereby significantly improving the quality and usability of the receipt texts.
[0059] See also Figure 1 , is a flow chart of an embodiment of the receipt text generation method provided by the present invention.
[0060] The first embodiment of the present invention provides a method for generating a receipt text, including steps S1 to S6, which are specifically as follows:
[0061] Step S1: Obtain feature data of the work order to be processed;
[0062] Step S2: inputting the characteristic data into a work order processing measure recommendation model to obtain a processing measure text;
[0063] Step S3: Combining the target parameters in the feature data into a query text;
[0064] Step S4: based on the query text, obtaining corresponding knowledge text from the operation and maintenance knowledge base;
[0065] Step S5: combining the treatment measure text and the knowledge text to obtain a prompt text;
[0066] Step S6: input the prompt text into the large language model to generate a receipt text for the work order to be processed.
[0067] It should be noted that the characteristic data of the work order to be processed in the above step S1 includes: resource pool classification, device IP, name of the province of the problem, SN serial number, work order subject and responsible manufacturer, as shown in Table 2. The target parameters in the characteristic data include: resource pool classification, SN serial number, work order subject and responsible manufacturer.
[0068] Table 2 Example content of pending work orders
[0069]
[0070] After obtaining the characteristic data, the embodiment of the present invention inputs the obtained characteristic data into the work order processing measure recommendation model obtained by training the historical work order data. The model recommends the optimal processing measures for the current work order to be processed based on a large amount of historical work order processing experience, that is, outputs the corresponding processing measure text. On the other hand, the target parameter in the characteristic data is first converted into a query text, that is, the field information of the target parameter in the characteristic data is spliced into a description text. For example, based on the characteristic data contained in Table 2, the query text that can be obtained is "North China-B Province Resource Pool, SN serial number is 210085463959, inspection storage server power module failure, equipment manufacturer is XX"; then, the retrieval augmented generation (RAG) technology is used to recall the knowledge text most relevant to the query text from the operation and maintenance knowledge base. Through the above process, after obtaining the relevant processing measure text and knowledge text, the two texts are combined to form a prompt text. Finally, the prompt text is input into the large language model (LLM), and with the help of the powerful natural language generation ability of the large language model, a high-quality receipt text is automatically generated. Of course, the input of the large language model will also include the original question text (original question response) constructed based on the work order to be processed.
[0071] It is worth noting that the embodiment of the present invention uses an industry corpus (such as a fault case library and an operation and maintenance guide) to create an external knowledge base (i.e., an operation and maintenance knowledge base), and combines the knowledge base with a large language model to give full play to the advantages of the accuracy and interpretability of explicit knowledge, so as to overcome the uncertainty of implicit knowledge within the large language model and the shortcomings of difficulty in dynamic updating, while enhancing the industry cognitive ability of the large language model. In addition, through the work order processing measure recommendation model and the reference text provided by the external knowledge base, dynamic prompt text can be further constructed to optimize the input of the large language model, thereby guiding the large language model to produce expected output, that is, the large language model can automatically generate a complete and standardized work order receipt text, thereby significantly improving the quality and availability of the receipt text.
[0072] Specifically, in view of the shortcomings of the general large language model in terms of professionalism, timeliness and security, such as insufficient knowledge training in specific professional fields, untimely knowledge updates and the inability of enterprises' confidential documents to directly participate in fine-tuning, the embodiment of the present invention provides additional industry knowledge for the large language model through the work order processing measure recommendation model and the operation and maintenance knowledge base. Using this additional knowledge as a reference greatly improves the accuracy of the large language model's reasoning, enabling it to generate work order reply texts that meet expectations.
[0073] In an optional embodiment, the training method of the work order processing measure recommendation model includes:
[0074] Obtain a historical work order sample set; wherein the historical work order sample set includes feature data, fault analysis texts, and solution texts corresponding to a number of historical work order samples;
[0075] Inputting the fault analysis text and solution text in each of the historical work order samples into a preset text classification model to obtain a corresponding processing measure label;
[0076] The feature data and the processing measure label corresponding to each of the historical work order samples are used as the training input data and the training output label of the initial classification model respectively;
[0077] The initial classification model is trained to obtain the work order processing measure recommendation model.
[0078] It should be noted that each historical work order sample includes corresponding feature data, fault analysis text (such as the root cause analysis of the problem in Table 3) and solution text; among them, the feature data includes resource pool classification, device IP, name of the problem province, SN serial number, work order subject and responsible manufacturer.
[0079] Before constructing a work order processing measure recommendation model, the embodiment of the present invention first uses a preset text classification model to clean the fault analysis text (root cause analysis of the problem) and the solution text in the historical work order sample, and uses the processed results as the processing measure labels, as shown in Table 3. Then, the feature data in the historical work order sample is used as the training input data of the initial classification model, and the corresponding processing measure labels are used as the training output labels of the initial classification model. Finally, the initial classification model is trained using supervised learning. After the training, the initial classification model is the work order processing measure recommendation model. This model can recommend the optimal processing measure text for subsequent work orders to be processed based on historical work order processing experience; wherein, the initial classification model is at least any one of a random forest model, a decision tree, a support vector machine, and a neural network.
[0080] Table 3 Text content of historical work order data before and after cleaning
[0081]
[0082] As can be seen from Table 3, the original text data contains a lot of instantiation information (such as time), which has no practical significance in the subsequent reasoning process of the large language model. By using the preset text classification model, the instantiation information in the fault analysis text (root cause analysis) and solution text can be effectively removed, and the results can be output in a regular text format, with a stability rate of up to 98.51%.
[0083] It is worth noting that the preset text classification model in the embodiment of the present invention can be a zero-shot learning-MT5 text classification model, such as the nlp_mt5_zero-shot-augment_chinese-base model. The zero-shot learning-MT5 text classification model is a multilingual pre-trained text-to-text conversion model that can complete text processing and text classification tasks without a large amount of labeled data. In the text classification task (i.e., generating treatment measure labels) of the embodiment of the present invention, the traditional model usually needs to provide hundreds to thousands of labeled data for each category to train the model. If a new category appears, such as "virtual machine failure", the traditional model needs to re-collect and annotate the data, while the zero-shot learning-MT5 text classification model can directly understand and generate text, so that the text classification model can directly recognize and process new categories.
[0084] In an optional embodiment, the operation and maintenance knowledge base is obtained by the following steps:
[0085] Obtain a fault case library and an operation and maintenance guide; wherein the fault case library includes at least one fault case;
[0086] Perform text slicing on each of the fault cases to obtain corresponding fault diagnosis slices and fault handling slices;
[0087] Slicing the operation and maintenance guidebook, and obtaining a plurality of guidebook slices each having a title through a title compensation mechanism;
[0088] All the fault diagnosis slices, the fault handling slices and the instruction manual slices are stored in a vector database to obtain the operation and maintenance knowledge base.
[0089] It should be noted that the embodiment of the present invention mainly uses the document loading method supported by LangChain (LLM application development framework) to load and collect documents in formats such as WORD, CSV, and PDF (OCR parsing images). This process can directly connect to the storage address of the original database of fault cases and the original database of operation and maintenance manuals, so that the two databases are dynamically updated regularly and automatically. As the number of processing scenarios involved in work orders continues to increase, these two databases will continue to expand and enrich.
[0090] After the original text of the fault case and the operation and maintenance guide is imported through the above process, the traditional method usually adopts fixed-length segmentation, which often leads to the loss of a large number of contextual associations and the fragmentation of knowledge points. However, the embodiment of the present invention takes into account the significant differences in text styles between the fault case and the operation and maintenance guide, and adopts different text slicing strategies to ensure the association of information between each slice.
[0091] A fault case usually includes the following parts: problem description, analysis and location, solution and case summary, as shown in Table 4.
[0092] Table 4 Example content of fault case
[0093]
[0094] It should be noted that the fault cases in the embodiments of the present invention can be presented in a tabular form (as shown in Table 4) or in a text form, such as writing the example content in Table 4 in a paragraph structure into a problem description paragraph, an analysis and positioning paragraph, a solution paragraph, and a case summary paragraph. The inventors found that the solution paragraph and the case summary paragraph can be used as the input of the prompt text; the problem description paragraph and the analysis and positioning paragraph generally contain more text, which is easy to exceed the input limit of the large language model (i.e., the token limit), and these two paragraphs have little effect on the reasoning results of the large model (i.e., the generation of the work order return content), but using them as retrieval conditions can significantly improve the recall rate. Therefore, the embodiment of the present invention uses the combination of the problem description paragraph and the analysis and positioning paragraph as a text slice (recorded as a fault diagnosis slice), and uses the combination of the solution paragraph and the case summary paragraph as another text slice (recorded as a fault handling slice).
[0095] It is worth noting that user questions (query texts) often describe problems that occur during operation and maintenance work. If the entire fault case is taken as a slice, the recall rate is only 61%. However, the embodiment of the present invention divides the fault case into fault diagnosis slices and fault handling slices, searches in all fault diagnosis slices, and then recalls the corresponding fault handling slices, and the recall rate can be as high as 86%; wherein, the calculation formula of the recall rate is: recall rate = TP / (TP+FN); TP represents true positive examples (the number of instances correctly predicted by the model as positive samples), and FN represents false negative examples (the number of instances incorrectly predicted by the model as negative samples).
[0096] See also Figure 2 , is an example diagram of an embodiment of the original text of the operation and maintenance instruction manual provided by the present invention. For the operation and maintenance instruction manual, it is a pure knowledge document, including instructions for maintaining each device, descriptions of operation and maintenance rules and professional terms, etc. These contents are more structured and have obvious contextual associations. They cannot be simply sliced according to paragraphs, and they cannot be sliced using a fixed-length method. Therefore, the embodiment of the present invention uses the natural language processing library Spacy as a text segmentation tool. Spacy is equivalent to a pre-trained model with a complex sentence segmentation function, which can effectively segment the text into separate sentences, thereby better retaining contextual information in the formed text blocks. In addition, the embodiment of the present invention also adds a title compensation mechanism to ensure the integrity of the instruction manual slices. Specifically, when a certain paragraph exceeds the preset text block size (chunk size), the title will be supplemented for the text block (chunk) without a title to ensure the integrity of the slice (text block).
[0097] For example, assume that the following text content exists in the operation and maintenance instruction manual: "Daily maintenance work assessment requirements: The maintenance work plan execution cycle is divided into days, weeks, months, quarters, years, etc. Unless there are special reasons, all maintenance work should be completed on time according to the execution cycle requirements. The work plan should be completed in full according to the planned inspection items and the scope of the equipment list involved, and a statistical assessment of the completeness rate should be conducted." After being segmented by Spacy, two independent slices are obtained: "Daily maintenance work assessment requirements: The maintenance work plan execution cycle is divided into days, weeks, months, quarters, years, etc. Unless there are special reasons, all maintenance work should be completed on time according to the execution cycle requirements" and "The work plan should be completed in full according to the planned inspection items and the scope of the equipment list involved, and a statistical assessment of the completeness rate should be conducted." For the second slice, due to the lack of a title, the relevant title will be added to it. Finally, the second slice with a title is "Daily maintenance work assessment requirements: The work plan should be completed in full according to the planned inspection items and the scope of the equipment list involved, and a statistical assessment of the completeness rate should be conducted." This ensures that the segmented text blocks are more logically coherent in terms of contextual association and information integrity.
[0098] Furthermore, the embodiment of the present invention will store all the fault diagnosis slices, fault handling slices and instruction manual slices obtained in the above process into a vector database to form an operation and maintenance knowledge base. When storing in the vector database, each text slice needs to be converted into a numerical vector (Embeddings) that can be processed by the computer, which can be achieved through various current Embedding models, such as Word2Vec, ELMo, GPT, BERT and OpenAI Embedding. The embodiment of the present invention will select a suitable Embedding model according to the following evaluation criteria:
[0099] (1) Hit rate: the proportion of correct answers in the first k search results. For example, if 5 results are recalled based on an input, and 2 of them are correct, then the hit rate = 2 / 5 = 40%. Obviously, the higher the hit rate, the stronger the search ability.
[0100] (2) Average reciprocal ranking: The accuracy of the model is evaluated by looking at the position of the first correct document among the first N documents related to the question; in other words, the average reciprocal ranking is the reciprocal ranking of the first correct document in the corresponding recall result and then averaged. Specifically, in the i-th retrieval query, n results are recalled. If the first recall result is the first correct answer, the score is 1; if the second recall result is the first correct answer, the score is 1 / 2 = 0.5; similarly, if the n-th recall result is the first correct answer, the score is 1 / n; if the n recall results do not match the correct answer, the score is 0; finally, all the retrieval times are combined, all the scores are summed up, and then averaged to obtain the average reciprocal ranking, the formula is as follows:
[0101]
[0102] Among them, MRR is the average reciprocal ranking, Q is the total number of search queries, and rank i is the ranking of the first correct answer in the i-th search query. The MRR value is between 0 and 1. The higher the value, the more effective the search system is, because the correct answer appears earlier in the search results.
[0103] The embodiment of the present invention uses historical operation and maintenance issues as search conditions, sorts multiple Embedding models according to the above evaluation criteria, and finally finds that OpenAI Embedding performs best in both hit rate and average reciprocal ranking, which are 0.87 and 0.71 respectively. This means that using the OpenAI Embedding model, users are likely to find the correct answer they need in the first few results retrieved. Therefore, the embodiment of the present invention selects the OpenAI Embedding model as the model for converting text slices into numerical vectors.
[0104] See also Figure 3 , is a schematic diagram of an embodiment of obtaining corresponding knowledge text from an operation and maintenance knowledge base provided by the present invention.
[0105] In an optional embodiment, acquiring corresponding knowledge text from an operation and maintenance knowledge base based on the query text includes:
[0106] Among all the fault diagnosis slices and the instruction manual slices in the operation and maintenance knowledge base, find the text slice with the highest similarity to the query text as the index slice;
[0107] When the index slice is the fault diagnosis slice, obtaining the corresponding fault processing slice as the knowledge text;
[0108] When the index slice is the instruction manual slice, the instruction manual slice with the same title is obtained as the knowledge text.
[0109] It should be noted that when all fault diagnosis slices, fault handling slices and instruction manual slices are stored in the vector database to form a complete operation and maintenance knowledge base, the original slices and the generated Embeddings are stored together, such as Figure 3In addition, some key meta information, such as link address and shard size, is also stored for use as filtering conditions during retrieval. To achieve efficient storage and query, the embodiment of the present invention uses the open source Milvus vector database to build an operation and maintenance knowledge base; the Milvus vector database supports vector field and vector similarity query, and can provide real-time vector indexing and query functions.
[0110] After constructing the operation and maintenance knowledge base, the embodiment of the present invention first converts the query text (i.e. Figure 3 The vectorized query text is obtained by vectorizing the user questions in the query text. Then, the RAG enhanced retrieval technology is used to recall the target slice text most relevant to the query from the operation and maintenance knowledge base as the knowledge text in the subsequent prompt text. Specifically, among all the fault diagnosis slices and instruction manual slices, the text slice with the highest similarity to the query text (i.e., the highest similarity score) is found through vector similarity query, which is called the index slice. Figure 3 As shown. If the found index slice belongs to the fault diagnosis slice, continue to obtain the fault handling slice associated with the fault diagnosis slice. This is because the fault diagnosis slice contains a problem description paragraph and an analysis and location paragraph, which are used to describe and locate the fault problem, while the fault handling slice contains a solution paragraph and a case summary paragraph, which can better provide users with a complete solution. If the found index slice belongs to the instruction manual slice, match it based on the title of the slice and obtain other related slices under the same title. This is because the instruction manual slice involves detailed maintenance rules and operating steps, and slices with the same title usually contain related or continuous information, which can answer users' questions more comprehensively.
[0111] In an optional embodiment, the role of the large language model is set as a data center hardware operation and maintenance engineer.
[0112] After obtaining the prompt text through the work order processing measure recommendation model and the operation and maintenance knowledge base, the embodiment of the present invention will further set the role of the large language model, define it as a "data center hardware operation and maintenance engineer", and send this role setting together with the prompt text to the large language model, so that when answering, it is closer to the perspective and professional language style of the data center hardware operation and maintenance engineer, which can improve the accuracy and professionalism of the return slip text, thereby better meeting the actual needs of users.
[0113] See also Figure 4 , is an example diagram of an embodiment of a content instruction input to a large language model provided by the present invention. Figure 4 As can be seen, the prompt text (prompt) mainly includes two parts of text content:
[0114] (1) The knowledge text most relevant to the query text obtained from the operation and maintenance knowledge base, namely, "Solution: This server is a storage server without business virtual machines. The power module supports hot swapping and can be directly replaced. Case summary: This case analyzes the problem of abnormal power module of the storage server. There are several ways to troubleshoot the abnormal power supply of the server: 1. Abnormal power supply, 2. Abnormal power cord, 3. Abnormal PDU power supply. Combining the information checked on site and in the BMC log, it is determined that the problem is caused by abnormal power supply. The fault is restored after replacing the power module."
[0115] (2) The work order processing measure recommendation model provides the processing measure text for the current work order to be processed based on the historical work order processing experience, that is, "[Problem cause] Power supply failure\n[Repair solution] The power supply needs to be replaced to repair the failure."
[0116] After assembling the contents of the above two parts into a promt, you can also add the original question text (original question reply) based on the pending work order to the promt. Of course, you can also add restrictions on the answer content in the prompt, including but not limited to "Please follow the above operation and maintenance manual and historical experience as a guide. It is not allowed to add fabricated elements to the answer" and "The answer is in the original format [cause of the problem] [repair solution], and the cause of the problem and the repair solution are briefly explained", etc. Figure 4 In addition, you can also assign a role to the large language model and define it as a "data center hardware operation and maintenance engineer" so that its answer style is more in line with the requirements of this professional role.
[0117] Through the restrictions of the above series of content instructions, the final output result of the large language model is [Cause of the problem]: It may be that the power module fails, such as unstable power supply, aging wires, damaged power adapter or internal component failure, resulting in the device being unable to power normally. \n\n[Repair plan]: To ensure the normal operation of data center equipment, it is necessary to replace the faulty power module immediately, use a backup power supply or a new, compatible power adapter to replace it, and then perform a safe power-off and plug-in operation to avoid data loss or further damage to other hardware. During the replacement process, it is necessary to check whether the new power supply is working properly and test whether all connections are stable. "It is worth noting that the large language model used in the embodiment of the present invention is the Qwen-7B general large model, which does not need to be trained.
[0118] In an optional embodiment, before inputting the prompt text into the large language model, the process further includes:
[0119] When the prompt text exceeds the input limit of the large language model, the prompt text is compressed by a preset text conversion model to obtain a new prompt text.
[0120] It is worth noting that if the generated prompt exceeds the input limit (Token limit) of the large language model, you can use the preset text conversion model to compress the content in the prompt text, such as using the zero-sample learning-MT5 text conversion model to extract key information from the knowledge text to compress the prompt text. This ensures that the Token limit is not exceeded and the core content of the prompt text is not lost.
[0121] See also Figure 5 , is a flow chart of another embodiment of the receipt text generation method provided by the present invention.
[0122] In an optional embodiment, after generating the receipt text of the work order to be processed, the method further includes:
[0123] Modifying the receipt text of the work order to be processed to obtain a modified work order;
[0124] Adding the correction work order to the operation and maintenance knowledge base so that the operation and maintenance knowledge base can be expanded;
[0125] The revised work order is added to the historical work order sample set, so that the historical work order sample set can be used for retraining to obtain a new work order processing measure recommendation model.
[0126] like Figure 5 As shown, the embodiment of the present invention, on the one hand, constructs a dynamic text library of operation and maintenance knowledge through a fault case library and an operation and maintenance instruction manual, which is used to store original general texts and receive new work orders (which can be used as fault cases) corrected by experts; then, the fault cases and the operation and maintenance instruction manual are taken out from the dynamic text library of operation and maintenance knowledge for slicing processing to obtain corresponding text slices; then, the text slices are vectorized to obtain slice vectors and store them in a vector database, and finally form an operation and maintenance knowledge base. On the other hand, the historical work order sample set is cleaned by a preset text classification model (such as zero-sample learning-MT5 text classification model), the instantiation information is removed and automatic labeling is realized, so as to obtain training data; then, the initial classification model is trained by these training data, and finally a work order processing measure recommendation model is obtained; wherein, the historical work order sample set can also receive new work orders corrected by experts.
[0127] After obtaining the operation and maintenance knowledge base and the work order processing measure recommendation model, when facing a new work order to be processed, the feature data of the work order needs to be input into the work order processing measure recommendation model to obtain the processing measure text. At the same time, the target parameters in the feature data are combined into a query text and vectorized to obtain a query vector. Further, the knowledge text corresponding to the query vector is obtained from the operation and maintenance knowledge base through enhanced retrieval technology. Subsequently, the knowledge text and the processing measure text are assembled into a prompt text, which is input into the large language model to automatically generate the receipt text of the work order to be processed.
[0128] The expert (operation and maintenance personnel) corrects the generated receipt text to obtain the final corrected work order. This corrected work order will be added to the operation and maintenance knowledge dynamic text library and the historical work order sample collection, so that the operation and maintenance knowledge base can be expanded, and the historical work order sample collection can be used for retraining to obtain a new work order processing measure recommendation model, thereby obtaining a better prompt and a more complete, standardized and accurate receipt text. In addition, since the receipt text is automatically generated and provided to the operation and maintenance personnel, the operation and maintenance personnel can process the work order based on the reference information provided by the receipt content, which can obviously greatly improve the efficiency of work order processing.
[0129] See also Figure 6 , is a structural diagram of an embodiment of the receipt text generating device provided by the present invention.
[0130] The second aspect of the present invention provides a receipt text generation device, which is used to implement the receipt text generation method described in any embodiment of the first aspect, and the device includes:
[0131] The work order data acquisition module 11 is used to acquire the characteristic data of the work order to be processed;
[0132] A processing measure acquisition module 12 is used to input the characteristic data into a work order processing measure recommendation model to obtain a processing measure text;
[0133] A query text acquisition module 13, used to form a query text from the target parameters in the feature data;
[0134] A knowledge text acquisition module 14 is used to acquire corresponding knowledge text from the operation and maintenance knowledge base based on the query text;
[0135] A prompt text combination module 15, used for combining the treatment measure text and the knowledge text to obtain a prompt text;
[0136] The receipt text generation module 16 is used to input the prompt text into the large language model to generate the receipt text of the work order to be processed.
[0137] It should be noted that the receipt text generation device provided in the second embodiment of the present invention can implement all the processes of the receipt text generation method described in the first embodiment above. The functions of each module in the device and the technical effects achieved are respectively the same as the functions and technical effects achieved by the receipt text generation method described in the first embodiment above, and will not be repeated here.
[0138] An embodiment of the third aspect of the present invention provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the receipt text generation method described in any embodiment of the first aspect above.
[0139] The fourth aspect of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the receipt text generation method described in any embodiment of the first aspect.
[0140] See also Figure 7 , is a structural diagram of an embodiment of an electronic device provided by the present invention.
[0141] An embodiment of the fifth aspect of the present invention provides an electronic device, comprising a processor 21, a memory 22, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the receipt text generation method described in any embodiment of the first aspect when executing the computer program.
[0142] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0143] The processor 21 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor 21 can also be any conventional processor. The processor 21 is the control center of the electronic device, and various parts of the electronic device are connected using various interfaces and lines.
[0144] The memory 22 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory 22 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, and a flash card (Flash Card), etc., or the memory 22 can also be other volatile solid-state storage devices.
[0145] It should be noted that the above electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 7 The structural diagram shown is only a structural example of the above-mentioned electronic device, and does not constitute a structural limitation of the above-mentioned electronic device. The above-mentioned electronic device may include more or less components than shown in the figure, or a combination of certain components, or different components.
[0146] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for generating receipt text, It is characterized in that include: Get the feature data of the work order to be processed; Inputting the characteristic data into a work order processing measure recommendation model to obtain a processing measure text; Combining the target parameters in the feature data into a query text; Based on the query text, obtain corresponding knowledge text from the operation and maintenance knowledge base; Combining the treatment measure text and the knowledge text to obtain a prompt text; The prompt text is input into a large language model to generate a receipt text for the work order to be processed.
2. The receipt text generation method according to claim 1, It is characterized in that The training method of the work order processing measure recommendation model includes: Obtain a historical work order sample set; wherein the historical work order sample set includes feature data, fault analysis texts, and solution texts corresponding to a number of historical work order samples; Inputting the fault analysis text and solution text in each of the historical work order samples into a preset text classification model to obtain a corresponding processing measure label; The feature data and the processing measure label corresponding to each of the historical work order samples are used as the training input data and the training output label of the initial classification model respectively; The initial classification model is trained to obtain the work order processing measure recommendation model.
3. The receipt text generation method according to claim 1, It is characterized in that The operation and maintenance knowledge base is obtained by the following steps: Obtain a fault case library and an operation and maintenance guide; wherein the fault case library includes at least one fault case; Perform text slicing on each of the fault cases to obtain corresponding fault diagnosis slices and fault handling slices; Slicing the operation and maintenance guidebook, and obtaining a plurality of guidebook slices each having a title through a title compensation mechanism; All the fault diagnosis slices, the fault handling slices and the instruction manual slices are stored in a vector database to obtain the operation and maintenance knowledge base.
4. The method for generating a receipt text according to claim 3, It is characterized in that The acquiring corresponding knowledge text from the operation and maintenance knowledge base based on the query text includes: Among all the fault diagnosis slices and the instruction manual slices in the operation and maintenance knowledge base, find the text slice with the highest similarity to the query text as the index slice; When the index slice is the fault diagnosis slice, obtaining the corresponding fault processing slice as the knowledge text; When the index slice is the instruction manual slice, the instruction manual slice with the same title is obtained as the knowledge text.
5. The method for generating a receipt text according to claim 1, It is characterized in that The role of the large language model is set as a data center hardware operation and maintenance engineer.
6. The method for generating a receipt text according to claim 1, It is characterized in that Before inputting the prompt text into the large language model, the method further includes: When the prompt text exceeds the input limit of the large language model, the prompt text is compressed by a preset text conversion model to obtain a new prompt text.
7. The method for generating a receipt text according to claim 2, It is characterized in that After generating the receipt text of the work order to be processed, the method further includes: Modifying the receipt text of the work order to be processed to obtain a modified work order; Adding the correction work order to the operation and maintenance knowledge base so that the operation and maintenance knowledge base can be expanded; The revised work order is added to the historical work order sample set, so that the historical work order sample set can be used for retraining to obtain a new work order processing measure recommendation model.
8. A receipt text generating device, It is characterized in that include: The work order data acquisition module is used to obtain the characteristic data of the work order to be processed; A processing measure acquisition module, used for inputting the characteristic data into a work order processing measure recommendation model to obtain a processing measure text; A query text acquisition module, used to compose a query text from the target parameters in the feature data; A knowledge text acquisition module, used to acquire corresponding knowledge text from the operation and maintenance knowledge base based on the query text; A prompt text combination module, used for combining the treatment measure text and the knowledge text to obtain a prompt text; The receipt text generation module is used to input the prompt text into the large language model to generate the receipt text of the work order to be processed.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program; wherein, when the computer program is run, it controls the device where the computer-readable storage medium is located to execute the receipt text generation method according to any one of claims 1 to 7.
10. A computer program product, It is characterized in that It comprises a computer program, which, when executed by a processor, implements the receipt text generation method as described in any one of claims 1 to 7.
11. An electronic device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the receipt text generation method according to any one of claims 1 to 7 when executing the computer program.
Citation Information
Patent Citations
Work order processing method and device, equipment and storage medium
CN116843322A
Operation and maintenance knowledge generation method
CN117573833A
Work order processing method and device, equipment, medium and program product
CN118093821A
Model training method and question answering method for question answering system
CN118093841A
LLM-based equipment demand matching method and apparatus, and storage medium
CN118312583A
Cited By
Work order intelligent decision support method and device based on retrieval enhancement generation and medium
CN121501971A
