Receipt text generation method, device, medium, equipment and product
By combining the work order processing measure recommendation model and the operation and maintenance knowledge base with a large language model, the problem of non-standard work order reply texts is solved, high-quality automatic generation is achieved, and the efficiency and information value of operation and maintenance work are improved.
Patent Information
- Application Number
- CN202411362440.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-09-27
AI Technical Summary
The quality of existing work order reply texts varies, the content is incomplete and non-standard, and it is difficult to provide valuable information, which affects the experience accumulation and knowledge recommendation of subsequent operation and maintenance work.
By building a work order processing measure recommendation model and an operation and maintenance knowledge base, using a large language model to generate standardized and complete receipt text, combined with a preset text classification model and text slicing technology, the input of the large language model is optimized to provide dynamic knowledge reference.
The quality and usability of receipt texts have been significantly improved, ensuring that the content is complete and meets professional requirements, thereby increasing the efficiency and information value of operations and maintenance.
Smart Images

Figure CN119166753B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing technology, and in particular to a method and device for generating receipt text, a computer-readable storage medium, an electronic device, and a computer program product. Background Art
[0002] With the implementation of unified multi-cloud operations and maintenance (O&M), operators are facing increasingly complex and diverse faults. After troubleshooting, completing a response sheet with information such as "Fault Cause Analysis" and "Solution" plays a crucial role in accumulating experience and providing knowledge recommendations for subsequent O&M work.
[0003] In the existing O&M process, work order acknowledgments rely heavily on the individual experience and reporting habits of maintenance personnel. This results in inconsistent quality and often leads to incomplete and non-standard acknowledgments. For example, some work order acknowledgments contain only a few simple descriptions of the cause of the failure, such as "hard drive failure" or "IP disconnected," lacking in-depth analysis, making it difficult for subsequent maintenance personnel to extract valuable experience and knowledge. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a method, device, computer-readable storage medium, electronic device and computer program product for generating a receipt text, which can automatically generate a complete and standardized work order receipt text, thereby significantly improving the quality and usability of the receipt text.
[0005] A 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, obtain 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 the large language model to generate the reply text of 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 text, and solution text 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 corresponding treatment measure labels;
[0015] The feature data and treatment measure labels corresponding to each of the historical work order samples are used as training input data and training output labels 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 manual text, and obtaining a plurality of manual 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, searching for a text slice having the highest similarity to the query text as an 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 pending work order, the method further includes:
[0030] Correcting the receipt text of the pending work order to obtain a corrected 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 embodiment of the present invention provides a receipt text generating device, characterized by comprising:
[0034] The work order data acquisition module is used to obtain the characteristic data of the work order to be processed;
[0035] A treatment measure acquisition module is used to input the characteristic data into the work order treatment measure recommendation model to obtain a treatment measure text;
[0036] A query text acquisition module, configured to compose a query text from target parameters in the feature data;
[0037] A knowledge text acquisition module is 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] An embodiment of 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 above.
[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 when executing the computer program, the processor implements the receipt text generation method described in any embodiment of the first aspect above.
[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 dynamic prompt text through an operation and maintenance knowledge base and a treatment measure recommendation model, optimizes the input of a large language model, and guides the large language model to automatically generate 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 instruction 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 This is a flow chart of an embodiment of a method for generating a receipt text provided by the present invention;
[0047] Figure 2 This is an example diagram of an embodiment of the original text of the operation and maintenance instruction manual provided by the present invention;
[0048] Figure 3 This 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 This is a flow chart of another embodiment of the method for generating a receipt text provided by the present invention;
[0051] Figure 6 This is a structural diagram of an embodiment of a receipt text generating device provided by the present invention;
[0052] Figure 7 It is a structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this technical field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0054] Existing work order receipts rely primarily on manual entry, with no mandatory restrictions on content or format. This results in significant individual differences in the content of completed receipts, as shown in Table 1. Due to the varying personal experience and reporting habits of operations personnel, the quality of work order receipts varies widely.
[0055] Table 1 Example of work order receipt content
[0056]
[0057] As shown in Table 1, the "Fault Cause Analysis" and "Solution" sections of historical receipts were manually filled out and lacked mandatory content and format requirements, resulting in non-standard or inconsistent content. Some receipts were too simplistic to provide valuable information, while others mixed up "Fault Cause Analysis" and "Solution." This not only made it difficult to accurately record the cause of the problem and the solution, but also hindered the accumulation of experience and knowledge 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 complete and standardized work order receipt texts, 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 method for generating a receipt text 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, obtain 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 the reply text of the work order to be processed.
[0067] It should be noted that the feature data of the work order to be processed in step S1 above includes: resource pool classification, device IP, problem province name, SN serial number, work order subject, and responsible manufacturer, as shown in Table 2. The target parameters in the feature 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 feature data, the embodiment of the present invention first inputs the acquired feature data into a work order handling action recommendation model trained with historical work order data. Based on extensive historical work order processing experience, this model recommends the optimal handling action for the current work order, namely, outputs the corresponding handling action text. Secondly, the target parameter in the feature data is first converted into a query text, that is, the field information of the target parameter in the feature data is spliced into a descriptive text. For example, based on the feature 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, using Retrieval Augmented Generation (RAG) technology, the knowledge text most relevant to the query text is retrieved from the operation and maintenance knowledge base. Through the above process, after obtaining the relevant handling action text and knowledge text, these two texts are then combined to form a prompt text. Finally, this prompt text is input into a large language model (LLM), which leverages the large language model's powerful natural language generation capabilities to automatically generate high-quality receipt text. Of course, the input of the large language model also includes 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 this 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 and difficulty of dynamic updating of implicit knowledge within the large language model, 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 complete and standardized work order reply text, thereby significantly improving the quality and availability of the reply text.
[0072] Specifically, to address the shortcomings of general-purpose large language models in terms of professionalism, timeliness, and security, such as insufficient training in specific professional fields, untimely knowledge updates, and the inability of confidential enterprise documents to directly participate in fine-tuning, the present invention provides the large language model with additional industry knowledge through a work order processing action recommendation model and an operations and maintenance knowledge base. Using this additional knowledge as a reference, the large language model's reasoning accuracy is greatly improved, enabling it to generate work order response text that meets 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 text, and solution text 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 corresponding treatment measure labels;
[0076] The feature data and treatment measure labels corresponding to each of the historical work order samples are used as training input data and training output labels 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, problem province name, SN serial number, work order subject and responsible manufacturer.
[0079] Before constructing the 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 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 is completed, 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 shown in Table 3, the original text data contains a lot of instantiation information (such as time), which is meaningless in the subsequent large language model reasoning process. By using the preset text classification model, we can effectively remove instantiation information from the fault analysis text (root cause analysis) and solution text, and output the results in a regular text format, with a stability rate of 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 label 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 manual text, and obtaining a plurality of manual 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 and regularly updated. As the number of processing scenarios involved in work orders continues to increase, these two databases will continue to expand and enrich.
[0090] After importing the original text of the troubleshooting case and the operation and maintenance manual through the above process, traditional methods typically use fixed-length segmentation, which often leads to the loss of a large amount of contextual associations and the fragmentation of knowledge points. However, the embodiments of the present invention take into account the significant differences in text styles between the troubleshooting case and the operation and maintenance manual and adopt different text segmentation strategies to ensure the information connection between each segment.
[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 easily exceeds 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 reply 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's worth noting that user questions (query text) often describe problems encountered during operation and maintenance. If the entire fault case is considered a slice, the recall rate is only 61%. However, by segmenting the fault case into a fault diagnosis slice and a fault handling slice, searching within all fault diagnosis slices, and then recalling the corresponding fault handling slice, the recall rate can reach as high as 86%. The recall rate is calculated as follows: Recall Rate = TP / (TP+FN); TP represents true positive examples (the number of instances correctly predicted as positive by the model), and FN represents false negative examples (the number of instances incorrectly predicted as negative by the model).
[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 maintenance of 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 adopts the natural language processing library Spacy as a text segmentation tool. Spacy is equivalent to a pre-trained model with complex sentence segmentation functions, which can effectively divide 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 paragraph of text 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, since it lacks a title, a 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 relevance 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. This 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 among the first k search results. For example, if 5 results are retrieved 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 capability.
[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 of the ranking of the first correct document in the corresponding recall results 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 n recall results do not match the correct answer, the score is 0; finally, all the scores are summed up and averaged across all retrieval times to obtain the average reciprocal ranking, which 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 rank of the first correct answer in the i-th search query. The MRR value ranges between 0 and 1. A higher value indicates a more effective retrieval system because the correct answer appears higher in the search results.
[0103] This embodiment of the present invention uses historical operation and maintenance questions as search criteria and ranks multiple Embedding models according to the above evaluation criteria. It ultimately finds that OpenAI Embedding performs best in both hit rate and average reciprocal rank, at 0.87 and 0.71, respectively. This means that using the OpenAI Embedding model, users are likely to find the correct answer they need within the first few results retrieved. Therefore, this 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, the acquiring of corresponding knowledge text from the 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, searching for a text slice having the highest similarity to the query text as an 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 metadata, such as the link address and shard size, is stored for use as filtering criteria during retrieval. To achieve efficient storage and querying, the embodiment of the present invention uses the open-source Milvus vector database to construct the operation and maintenance knowledge base; the Milvus vector database supports vector field and vector similarity queries, providing real-time vector indexing and query capabilities.
[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 user questions in the query are vectorized to obtain the vectorized 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 index slice found belongs to a fault diagnosis slice, then 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 index slice found belongs to an instruction manual slice, then 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. Slices with the same title usually contain related or continuous information, which can more comprehensively answer users' questions.
[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 can be 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 reply text, thereby better meeting the actual needs of users.
[0113] See also Figure 4 , is an example diagram of an embodiment of the content instruction input to the 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 most relevant knowledge text obtained from the operation and maintenance knowledge base is “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 abnormality of the storage server power module. 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 found in the on-site inspection and 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 action recommendation model provides the processing action text for the current work order 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 fault."
[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 guidance. It is not allowed to add fabricated elements to the answer" and "The answer should remain in the original format [cause of the problem] [repair solution], and briefly explain the cause of the problem and the repair solution", etc. Figure 4 In addition, you can assign a role to the large language model, defining it as a "data center hardware operations engineer," so that its answer style is more in line with the requirements of this professional role.
[0117] Given the limitations of the above series of content instructions, the final output of the large language model is [Problem Cause]: This could be due to a power module failure, such as unstable power supply, aging power cables, damaged power adapter, or internal component failure, causing the device to not power properly. [Repair Solution]: To ensure normal operation of data center equipment, the faulty power module must be replaced immediately with a backup power supply or a new, compatible power adapter. Then, safely disconnect the power supply and reconnect it to avoid data loss or further damage to other hardware. During the replacement process, check that the new power supply is functioning properly and test all connections for security. It is worth noting that the large language model used in this embodiment of the present invention is the Qwen-7B general-purpose large model, which does not require training.
[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's worth noting that if the generated prompt exceeds the input limit (token limit) of the large language model, you can use a preset text conversion model to compress the prompt text. For example, using the zero-shot 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 pending work order, the method further includes:
[0123] Correcting the receipt text of the pending work order to obtain a corrected 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 revised by experts (which can be used as fault cases); then, the fault cases and operation and maintenance instruction manuals are taken out from the dynamic text library of operation and maintenance knowledge and sliced to obtain corresponding text slices; then, the text slices are vectorized to obtain slice vectors and stored in a vector database, finally forming an operation and maintenance knowledge base. On the other hand, a preset text classification model (such as zero-sample learning-MT5 text classification model) is used to clean the data of the historical work order sample set, remove instantiation information and realize automatic labeling, thereby obtaining training data; then, the initial classification model is trained with 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 revised by experts.
[0127] After obtaining the operation and maintenance knowledge base and the work order action recommendation model, when faced with a new pending work order, the feature data of the work order is input into the work order action recommendation model to obtain the action text. Simultaneously, the target parameters in the feature data are combined into a query text and vectorized to obtain a query vector. Furthermore, enhanced retrieval technology is used to obtain the knowledge text corresponding to the query vector from the operation and maintenance knowledge base. Subsequently, the knowledge text and action text are assembled into prompt text, which is input into the large language model to automatically generate the reply text for the pending work order.
[0128] Experts (operation and maintenance personnel) revise the generated receipt text to produce the final revised work order. This revised work order is then added to the dynamic text library of operation and maintenance knowledge and the historical work order sample collection, allowing the operation and maintenance knowledge base to be expanded and the historical work order sample collection to be retrained to obtain a new work order processing action recommendation model, thereby obtaining a better prompt and 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 significantly improves the efficiency of work order processing.
[0129] See also Figure 6 , is a structural diagram of an embodiment of the receipt text generation device provided by the present invention.
[0130] A second embodiment of the present invention provides a receipt text generation device for implementing the receipt text generation method described in any one of the embodiments of the first aspect, the device comprising:
[0131] The work order data acquisition module 11 is used to obtain the characteristic data of the work order to be processed;
[0132] A treatment measure acquisition module 12 is used to input the characteristic data into a work order treatment measure recommendation model to obtain a treatment measure text;
[0133] A query text acquisition module 13, configured to compose a query text from target parameters in the feature data;
[0134] A knowledge text acquisition module 14 is configured to acquire corresponding knowledge text from an operation and maintenance knowledge base based on the query text;
[0135] A prompt text combining module 15 is used to combine 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] An embodiment of 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 above.
[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 (e.g., computer program 1, computer program 2, ...), which are stored in the memory 22 and executed by the processor 21 to implement the present invention. The one or more modules / units can be a series of computer program instruction segments that can implement 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. A general-purpose processor can be a microprocessor, or the processor 21 can be any conventional processor. The processor 21 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the electronic device.
[0144] The memory 22 mainly includes a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function, and the data storage area can store related data. 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 media card (SMC), a secure digital (SD) card, and a flash card. Alternatively, the memory 22 can be other volatile solid-state memory 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 an example of the structure 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 fewer components than shown in the figure, or combine 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 a receipt text, characterized in that: include: Get the feature data of the work order to be processed; Inputting the feature data into a work order processing measure recommendation model to obtain a processing measure text; wherein the work order processing measure recommendation model is trained by a historical work order sample set; 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 reply text of the work order to be processed; wherein the input of the large language model also includes an original question text constructed based on the work order to be processed.
2. The method for generating a receipt text according to claim 1, wherein: 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 text, and solution text 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 treatment measure label; The feature data and treatment measure labels corresponding to each of the historical work order samples are used as training input data and training output labels of the initial classification model respectively; The initial classification model is trained to obtain the work order processing measure recommendation model.
3. The method for generating a receipt text according to claim 1, wherein: 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 manual text, and obtaining a plurality of manual 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, wherein: The acquiring of 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, searching for a text slice having the highest similarity to the query text as an 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, wherein: 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, wherein: 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, wherein: After generating the receipt text of the work order to be processed, the method further includes: Correcting the receipt text of the pending work order to obtain a corrected 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, 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 treatment measure acquisition module is used to input the feature data into a work order treatment measure recommendation model to obtain a treatment measure text; wherein the work order treatment measure recommendation model is trained by a historical work order sample set; A query text acquisition module, configured to compose a query text from target parameters in the feature data; A knowledge text acquisition module is 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; A receipt text generation module is used to input the prompt text into a large language model to generate a receipt text for the work order to be processed; wherein the input of the large language model also includes an original question text constructed based on the work order to be processed.
9. A computer-readable storage medium, 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, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the receipt text generation method according to any one of claims 1 to 7.
11. An electronic device, characterized in that: The invention 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
Model training method and question answering method for question answering system
CN118093841A