Electric power system master equipment defect diagnosis method and system based on large language model

Through the defect diagnosis method of main equipment of power system based on large language models, the limitations of traditional methods in natural language understanding and interpretability of inference results are solved, efficient and accurate diagnosis is achieved, cost reduction and adapting to the needs of modern power systems.

CN119622482APending Publication Date: 2025-03-14ELECTRIC POWER RES INST STATE GRID SHANXI ELECTRIC POWER

Patent Information

Application Number
CN202510155095.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Traditional master device defect diagnosis methods have limitations in natural language understanding, interpretability of inference results, and relying on numerical detection, making it difficult to understand the nuances between device names and defect descriptions, lack the ability to generate evidence, and cannot effectively play a role in the absence of equipment status or lack of exact information.

Method used

The defect diagnosis method of main equipment of the power system based on the large language model is adopted. By collecting defect description information, the pre-constructed natural language representation model is used for preliminary understanding and classification, and the inference ability of the large language model is stimulated through prompt engineering to generate high-quality diagnostic basis and results.

Benefits of technology

It improves diagnostic efficiency and accuracy, generates high-quality diagnostic basis and results, reduces dependence on expert experience, reduces diagnostic costs, and adapts to the needs of modern power systems for efficient and intelligent operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119622482A_ABST
    Figure CN119622482A_ABST
Patent Text Reader

Abstract

The invention provides an electric power system main equipment defect diagnosis method and system based on a large language model, and relates to the technical field of electric power system operation and maintenance and intelligent diagnosis, and the method comprises the steps: collecting defect description information of electric power system main equipment; preliminarily understanding the defect description information by using a pre-constructed natural language representation model, obtaining corresponding embedded representation, executing a defect level classification task and a defect basis classification task, and outputting a defect level classification result and a defect basis classification result; and summarizing by utilizing a large language model, fusing the summarized classification information into a prompt text, exciting the reasoning ability of the large language model through a prompt project, and finally obtaining a diagnosis basis and a diagnosis result corresponding to the defect description information. According to the method, excellent results are obtained in defect level classification tasks and question and answer tasks, and high-quality classification evidences and guidance information can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system operation and maintenance and intelligent diagnosis, and in particular to a method and system for diagnosing defects of main equipment in a power system based on a large language model. Background Art

[0002] In today's society, as an infrastructure supporting industrial, commercial activities and people's daily lives, the stability and reliability of the power system plays a vital role in maintaining social order and promoting economic and social development. With the continued growth of global energy demand and the proposal of sustainable development goals, the role of the power system in ensuring energy supply and promoting green and low-carbon development has become increasingly prominent. However, if there are defects in the core equipment of the power system, such as transformers and reactors, it may directly lead to energy transmission interruptions, seriously affecting the normal operation of various industries and people's daily electricity consumption. Therefore, accurate and timely diagnosis of defects in the main equipment of the power system is a key link to ensure the stable operation of the system and improve operation and maintenance efficiency.

[0003] Traditional main equipment defect diagnosis mainly relies on manual operation, which is carried out according to the procedure documents or defect manuals through line inspection, data analysis, feature identification and other steps. This method is not only time-consuming and laborious, but also requires high professional skills and practical experience of operation and maintenance personnel, and it is difficult to adapt to the needs of modern power systems for efficient and intelligent operation and maintenance.

[0004] With the rapid development of smart grid technology and the advent of the era of power big data, advanced technologies such as sensor monitoring systems, big data analysis, expert systems, and machine learning algorithms have been gradually introduced into the field of main equipment defect diagnosis, significantly improving the efficiency and accuracy of diagnosis. For example, some studies have deeply analyzed historical defect record data to mine the characteristics of key equipment and family defective equipment, providing a scientific basis for targeted maintenance; some studies have used improved Bayesian networks to construct a mapping relationship between fault type and fault location, realizing comprehensive monitoring of the overall operating status of the transformer; some studies have proposed hybrid oversampling technology and SVM models optimized based on the GWO algorithm to address the problem of insufficient defect samples, effectively improving the performance of the diagnostic model; in addition, some studies have integrated historical data files to build a safety measures knowledge base based on knowledge graphs and SCD files, providing strong support for intelligent operation and maintenance.

[0005] Although these methods have made significant progress in automated defect diagnosis, there are still some common problems that need to be solved. First, these methods mainly serve numerical analysis and have limited natural language processing capabilities, making it difficult to deeply understand the subtle differences between different equipment names and defect descriptions. Secondly, for operation and maintenance personnel, they would like to see the reasoning results while understanding the basis and evidence of the reasoning. However, most existing machine learning methods lack the ability to generate evidence and are difficult to conform to human cognitive habits. Finally, most models rely heavily on numerical detection. When the equipment status is vague or lacks exact information, these models often cannot function effectively. Therefore, how to overcome these limitations and further improve the intelligence level and practicality of main equipment defect diagnosis is an important direction of current research. Summary of the invention

[0006] To this end, an embodiment of the present invention provides a method and system for diagnosing defects in main equipment of a power system based on a large language model. The present invention is used to address the limitations of traditional defect diagnosis methods in natural language understanding, explainability of reasoning results, and reliance on numerical detection.

[0007] In order to solve the above problems, an embodiment of the present invention provides a method for diagnosing defects of main equipment in a power system based on a large language model, the method comprising: Collect defect description information of main equipment in the power system; Use the pre-built natural language representation model to preliminarily understand the defect description information, obtain the corresponding embedded representation, perform the defect level classification task and the defect basis classification task, and output the defect level classification result and the defect basis classification result; The defect level classification results and the defect basis classification results are summarized using a large language model, the summarized classification information is integrated into the prompt text, and the reasoning ability of the large language model is stimulated through prompt engineering, and finally the diagnostic basis and diagnostic results corresponding to the defect description information are obtained.

[0008] Preferably, the pre-built natural language representation model is a Bert model with a fully connected layer added, and the fully connected layer is used to map the sentence representation into the classification space.

[0009] Preferably, the performing of the defect level classification task and the defect basis classification task and outputting the defect level classification result and the defect basis classification result specifically includes: Construct defect level classification data set and defect basis classification data set; Use the pre-built natural language representation model to classify and train the data set. During the training process, use the cross entropy loss function to test the model training status, and use the Adam optimizer for optimization, and finally obtain the defect level classification results and defect basis classification results.

[0010] Preferably, the stimulating the reasoning ability of the large language model through prompt engineering specifically includes: Design role-playing prompts to align responses to the electricity domain and increase the professionalism, correctness, and credibility of responses; Introduce thought chain prompts, including instructions, logical basis, and examples, to guide large language models to reason.

[0011] Preferably, the instructions in the thought chain prompt are used to limit the output format and output range of the large language model; the logical basis is used to guide the reasoning process; and the examples are used to provide specific reasoning examples.

[0012] Preferably, the thought chain prompts are divided into two cases, namely, few-sample prompts and zero-sample prompts, according to whether there are examples. Few-sample prompts refer to providing the solution process of one or more example questions, guiding the large language model to imitate the solution process of the example questions, and outputting the correct answers; zero-sample prompts refer to not involving any directly related knowledge, but only providing prompts on the idea.

[0013] Preferably, the method further comprises clustering the defect description information using a K-Means clustering algorithm through a few sample prompts, and selecting the node closest to the centroid in each cluster as a typical example.

[0014] The embodiment of the present invention further provides a power system main equipment defect diagnosis system based on a large language model, which is used to implement the above-mentioned power system main equipment defect diagnosis method based on a large language model, and specifically includes: An information collection module is used to collect defect description information of the main equipment of the power system; A classification module is used to use a pre-built natural language representation model to preliminarily understand the defect description information, obtain the corresponding embedded representation, and perform defect level classification tasks and defect basis classification tasks, and output defect level classification results and defect basis classification results; The large language model reasoning module is used to use the large language model to summarize the defect level classification results and the defect basis classification results, integrate the summarized classification information into the prompt text, and stimulate the reasoning ability of the large language model through the prompt project, and finally obtain the diagnostic basis and diagnostic results corresponding to the defect description information.

[0015] An embodiment of the present invention also provides an electronic device, which includes a processor, a memory and a bus system, wherein the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned power system main equipment defect diagnosis method based on a large language model.

[0016] An embodiment of the present invention also provides a computer storage medium, which stores a computer software product. The computer software product includes a number of instructions for enabling a computer device to execute the above-mentioned method for diagnosing defects of main equipment in a power system based on a large language model.

[0017] It can be seen from the above technical solutions that the present invention has the following beneficial effects: (1) Improve diagnostic efficiency and accuracy: By introducing a large language model, the present invention realizes the automatic diagnosis of defects in the main equipment of the power system. This method reduces manual intervention, improves diagnostic efficiency, reduces dependence on expert experience, and thus reduces diagnostic costs.

[0018] (2) Generate high-quality diagnostic evidence and results: Use the improved Bert model to initially understand and classify defect description information, providing a basis for subsequent diagnosis. Through the prompt learning method, the reasoning potential of the large language model is used to deeply explore fault information and generate high-quality, easy-to-read defect analysis and treatment opinions. This method not only provides accurate diagnostic results, but also provides detailed diagnostic evidence, which helps maintenance personnel quickly locate and handle problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the implementation cases of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention will be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 A flowchart of a method for diagnosing defects of main equipment in a power system based on a large language model provided in an embodiment; Figure 2 It is a Bert model structure diagram in the embodiment; Figure 3 This is a diagram of the Transformer layer structure in the embodiment; Figure 4 This is an example diagram of a thinking chain prompt in the embodiment; Figure 5 It is a prompt template and example diagram in the embodiment Figure 6 A block diagram of a power system main equipment defect diagnosis system based on a large language model provided in an embodiment. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 field without creative work are within the scope of protection of the present invention. Embodiment 1

[0021] Main equipment defect diagnosis is the basis for the smooth operation of the power system, but the traditional method is mainly manual, with problems such as low efficiency, high diagnostic cost, and reliance on expert experience. With the advent of the smart grid and big data era, although sensor monitoring systems, big data analysis and other technologies have entered the defect diagnosis system, there are still limitations in processing equipment fault information described in natural language. In order to solve the above problems, such as Figure 1 As shown, an embodiment of the present invention proposes a method for diagnosing defects of main equipment in a power system based on a large language model, the method comprising: S1: Collect defect description information of main equipment in the power system; S2: Use the pre-built natural language representation model to preliminarily understand the defect description information, obtain the corresponding embedded representation, perform the defect level classification task and the defect basis classification task, and output the defect level classification results and the defect basis classification results; S3: Use the large language model to summarize the defect level classification results and defect basis classification results, integrate the summarized classification information into the prompt text, and stimulate the reasoning ability of the large language model through prompt engineering, and finally obtain the diagnostic basis and diagnostic results corresponding to the defect description information.

[0022] From the above technical scheme, it can be seen that the present invention is a method for diagnosing defects of main equipment in power systems based on a large language model. First, the improved Bert model is used to preliminarily understand and classify the defect description information. Then, the large language model is used to deeply explore the reasoning potential through prompt learning to generate high-quality, easy-to-read defect analysis and treatment opinions. This scheme effectively makes up for the problems of low efficiency, high cost and reliance on expert experience of traditional manual diagnosis, and shows excellent results in classification tasks and question-answering tasks, with significant technical advantages and practical application value.

[0023] In order to improve the ability of the large language model to understand the power system defect text, a feasible solution is to directly train and fine-tune the large language model. However, the number of parameters of the large language model far exceeds that of the conventional language model, which will inevitably cause huge training overhead and cannot dynamically adapt to multiple tasks. To solve this problem, the present invention attempts to convert the complex defect reasoning task into multiple subtasks, which can be specifically divided into the following steps: (1) Use a lightweight model to learn the initial text, perform defect level classification and defect basis classification tasks, and form a preliminary understanding of the defects; (2) Inject the classification results into the large language model through prompt learning; (3) Design prompts for the large language model to stimulate its reasoning ability; (4) Use the large language model to reason and output the results.

[0024] In this embodiment, the Bert model is selected to implement steps (1) and (2). The Bert model is a natural language representation model based on Transformer. Compared with previous classic word embedding methods such as GloVe and Word2vec, the Bert model introduces an attention mechanism to collect relevant semantic information and can learn a deep contextual representation of each word.

[0025] The basic structure of the Bert model is as follows Figure 2 As shown in the figure, for the input "oil-immersed transformer oil leakage", each character is regarded as a "word", and its initial representation is divided into three parts: word embedding containing its own semantic information, segment embedding of the labeled sentence, and position embedding. The three are summed up to obtain the input representation. Then the Transformer encoder is used for two-step training, which are called "masked language model" and "next sentence prediction" respectively. The masked language model refers to randomly masking a part of the input and requiring the model to predict the masked content. The next sentence prediction refers to randomly selecting two sentences A and B to determine whether sentence B is the next sentence after A. Neither of these two steps of training involves data annotation and is a self-supervised process. The model is pre-trained through self-supervised learning, allowing subsequent users to adjust the model parameters with only a small amount of data to align the model to downstream tasks.

[0026] The structure of a single Transformer layer is as follows Figure 3 The original Transformer model includes an encoder and a decoder, while the Bert model only uses part of the encoder structure, including multi-head attention, residual connection and normalization, feedforward layer, and the second residual connection and normalization.

[0027] Compared with contemporary models, such as GPT-2, the Bert model has richer parameter adjustment experience and open source Chinese fine-tuning models. In order to improve the model's adaptability to Chinese, the present invention chooses to use the Chinese pre-trained Bert model Bert-base-chinese open sourced by Google. This model supports simplified and traditional Chinese, can meet basic Chinese understanding needs, and does not cause excessive computing overhead.

[0028] In order to improve the adaptability of the Bert model to specific tasks, the Bert model sets the parameters as variable during the training process, that is, the Bert model is fine-tuned. The Bert model has two commonly used output formats, one is called "pooleroutput", which outputs the embedding of the identifier "[CLS]" at the beginning of each sentence in Bert; the other is called "sequenceoutput", which outputs the embedding representation of all words, which corresponds to the Chinese representation of each character. Obviously, the former focuses more on the representation of the entire sentence and is suitable for classification tasks. This embodiment adopts this output method and records the representation of the [CLS] symbol as h CLS .

[0029] In step S2, a pre-built natural language representation model is used to preliminarily understand the defect description information, obtain the corresponding embedded representation, and perform the defect level classification task and the defect basis classification task, and output the defect level classification results and the defect basis classification results.

[0030] Specifically, the pre-built natural language representation model in this embodiment adds a fully connected layer on the basis of Bert to undertake the classification task. The main function of this layer is to map the sentence representation to the classification space. The process can be expressed by the formula: ; Among them, Softmax(·) is the multi-classification activation function used here, and W and b are the weight and bias of the fully connected layer, respectively.

[0031] The process specifically includes constructing a defect level classification dataset and a defect basis classification dataset, using a pre-built natural language representation model to classify and train the dataset. During the training process, the cross entropy loss function is used to test the model training status, and the Adam optimizer is used for optimization. The cross entropy loss function can be expressed as: ; Where N is the number of samples, P(n) is the probability that the classification result of the sample with sequence n is correct, and here is the corresponding representation in the output vector output.

[0032] According to the dimension setting of the fully connected layer, the Bert model can be used to complete binary classification and multi-classification tasks. For the purpose of preliminarily perceiving the degree of fault, the present invention uses this method to complete two-step classification: defect level classification, the main purpose of which is to estimate the severity of the defect; defect basis classification, which aims to preliminarily perceive the available causes and reasoning paths, and assist in large language model question and answer. In addition, the Bert model itself acts as an encoder, which can convert the input natural language into character embeddings and word embeddings, allowing downstream tasks to introduce vectorized representations into machine learning methods to complete more operations and processing.

[0033] In step S3, the defect level classification results and defect basis classification results are summarized using a large language model (this embodiment uses a conversational large language model ChatGLM3), the summarized classification information is integrated into the prompt text, and the reasoning ability of the large language model is stimulated through the prompt project, and finally the diagnostic basis and diagnostic results corresponding to the defect description information are obtained. The reasoning ability of the large language model is stimulated by the prompt project, including: designing role-playing prompts to align the answers to the power field and improve the professionalism, correctness and credibility of the answers; introducing thinking chain prompts, including instructions, logical basis and examples, to guide the large language model to reason.

[0034] Specifically, the large language model itself has certain basic knowledge and domain knowledge, and can give corresponding answers to different questions. The answer is usually readable and logical, but in the field of electricity, there are many professional terms and complex professional knowledge. It may be difficult for the large language model to quickly correspond to the corresponding field background, resulting in biased or even wrong output answers. This phenomenon is called the "hallucination" problem of the large language model. In order to ensure the quality of the answer, some artificial means are needed to guide the large language model, that is, prompt engineering. The present invention will start from the perspective of prompts and adopt a method that combines role-playing and thinking chain technology to improve the ability of the large language model in question-answering tasks.

[0035] 1. Role-playing tips Presetting scenarios and identities for the large language model will have a positive impact on the model's reasoning ability. "Humanizing" the large language model will help the model generate higher quality and more readable answers. The present invention has designed a separate prompt for this phenomenon, which is named "role-playing prompt" here. The purpose of this prompt is twofold: first, to align the answer to the power field and improve the professionalism of the answer; second, to improve the accuracy and credibility of the answer. To this end, the role-playing prompt should include at least two parts, and these two points need to be emphasized.

[0036] Taking the two requirements into consideration, the role-playing prompts are designed as follows: “You are an expert in the field of electricity. From now on, you will take a quiz on your knowledge of the power grid, answer various questions and ensure the accuracy of your answers. I am the host of this competition, and the finals are about to begin.” The prompt includes professional identity information "power field expert" and scenario information "knowledge test", emphasizing the field and accuracy while implying the knowledge tendency "power grid professional knowledge test question", which can cover the prompt requirements. This prompt will be placed at the beginning of the prompt template.

[0037] 2. Thinking chain tips The core idea of ​​the thought chain prompt is to guide the large language model to decompose a complex problem into multiple sub-problems, and solve them step by step, so as to improve the problem-solving ability of the large language model. The present invention sorts out the logical framework of the existing thought chain technology, divides a complete thought chain prompt into three parts: instructions, logical basis, and examples, and carries out targeted scope definition: the "instructions" part is used to limit the output format and output range of the large language model, such as "output reasoning process", "output answer in json format"; "logical basis" is the guidance of the reasoning process, such as possible reasoning paths, reasoning steps, etc. "Example" directly gives one or more ideal inputs and outputs in a small sample manner. Each example includes questions and answers. Considering the application scenarios of the thought chain technology, it should at least include questions, thinking processes, and answers to questions.

[0038] Depending on whether there is an "example", the thought chain prompt can be divided into two types: few-sample prompt and zero-sample prompt. Few-sample prompts will give the solution process of one or more example questions, guide the large language model to imitate the solution process of the example questions, and output the correct answer. Zero-sample prompts do not involve any directly related knowledge, but only give prompts on thinking, such as "pay attention to thinking step by step". An example prompt is Figure 4 shown.

[0039] The fault diagnosis criteria of the main equipment are diverse. If a zero-sample prompt is designed, it may be necessary to introduce an external knowledge base specifically for a specific problem, and it is difficult to summarize a unified, concise and clear reasoning prompt. Therefore, the present invention chooses to use a few-sample prompt to provide a large language model with a reasoning example and a simple reasoning guidance method to achieve a thinking chain prompt.

[0040] The above has preliminarily processed the input problem from the two perspectives of defect level classification and defect basis classification. However, from the perspective of improving the readability of the results, it is still necessary to use a large language model to understand the summarized classification results and integrate the summarized classification results into the prompts, which is also conducive to the large language model capturing the key points in natural language and giving more targeted answers.

[0041] Furthermore, the most direct way to make the large language model understand the classification results is to insert the information directly into the prompt text. Specifically, for the defect level classification results, when filling in the prompt template, add an additional "classification result" item, and then fill in the classification results and confidence. The confidence value can be obtained directly from the classifier output. In order to enhance the expressiveness, an additional conversion step is performed here. If the confidence is higher than 0.7, it will be marked as "high", lower than 0.7 but higher than 0.5, it will be marked as "medium", otherwise it will be marked as "low". For the defect basis classification results, also add the "classification basis" item, and directly fill in the text information of the corresponding classification basis.

[0042] "Examples" play a potential role in a small amount of training in prompts. Therefore, selecting highly relevant and representative prompt examples is particularly important for the results of prompt engineering. For a single fault, the device where the fault occurs is known, and the fault defect level can be directly obtained through the Bert model classification process to achieve two-layer filtering. However, the results of this filtering process are relatively limited and cannot highlight the typicality of the prompt examples.

[0043] In order to screen more representative examples, the present invention introduces an example evaluation process based on the K-Means clustering algorithm. Specifically, there may be similarities between questions. In clustering tasks, similar questions tend to cluster in the same cluster, and the closer the question is to the centroid of the cluster, the more "representative" it is considered.

[0044] The algorithm flow of the K-Means clustering algorithm is: (1) Randomly select k centroids; (2) For each node, calculate its coordinates with each centroid and assign it to the corresponding cluster; (3) Determine whether the cluster of any node has changed. If not, end the iteration and output the clustering result. Otherwise, continue with step (4). (4) Update the centroid coordinates, the new coordinates are the average of all node coordinates in the cluster; (5) Continue with step (2).

[0045] A typical k value setting method is to first filter the existing database for defective equipment and defect levels, obtain a problem candidate set, and determine the number of prompt examples. The k value is directly set according to the number, and clustering is performed in the candidate set to select the node closest to the centroid in each cluster. However, considering the characteristics of the power data set, the candidate set corresponding to atypical problems may be empty. To eliminate this hidden danger, the present invention uses a clustering-first-filtering operation.

[0046] Since the defect levels are mainly divided into three categories: "general", "serious" and "critical", the k value is initially set to 3. After multiple rounds of iterations, the model tends to converge, and the cluster centroid coordinates (x, y) can be obtained. The training data can be sorted according to the distance between them and the cluster centroid, and the central node can be selected. The distance calculation formula is: ; in, represents the coordinates of the i-th node in the current cluster, is the coordinate of the central node, and n is the dimension of the clustering space. The smaller the distance, the closer the node is to the centroid, that is, the more typical the example is.

[0047] The main purpose of the filtering step is to select the examples that are closest to the corresponding centroid and whose defective equipment and defect level are opposite to the current problem in the sorted problem candidate set. If there are no qualified problems, the problems with the same defective equipment are located first. After the two-step operation of clustering screening and filtering, examples similar to the current problem and as typical as possible can be obtained.

[0048] To summarize the above content, the large language model prompt template consists of five parts, namely role-playing prompts, examples, instruction prompts, questions, and text classification results. The questions and text classification results are nested. Figure 5 shown.

[0049] Guided by the prompt template, the large language model will output answers in a semi-structured manner, allowing batch processing through simple procedures.

[0050] In order to further illustrate the advantages of the present invention, it is described below in conjunction with specific experiments.

[0051] 1. Experimental data The experimental data set is a table of defects and faults of power main equipment. This table is obtained from the daily operation and maintenance data of main equipment in multiple locations after manual sorting, cleaning, and deduplication. The table includes a variety of situations covered and not covered in the defect standard library. The detailed information is shown in Table 1.

[0052] Table 1 Experimental data information

[0053] For the defect level classification task, a defect level classification dataset is constructed. Among them, the defect level is divided into three categories: general defects, serious defects, and critical defects. Critical defects refer to problems in equipment or other external objects that directly threaten safe operation and need to be dealt with urgently. If not handled in time, they may threaten personal safety, cause equipment damage, large-scale power outages, or even fire accidents; serious defects refer to current defects that threaten personal safety or stable power supply, but do not affect the normal operation of the equipment and need to be dealt with as soon as possible; equipment defects that are not critical defects or serious defects are general defects, which have a low impact level and a small impact range. The equipment defect level is not static and may become more serious or disappear with the operation of the equipment or changes in the climate and environment. Grasping the evolution direction of general defects and distinguishing the urgency of serious defects and critical defects are the key and difficulty of the defect level classification task.

[0054] For the defect basis classification task, a defect basis classification dataset was constructed. According to statistics, there are 549 classification bases in total, among which the most common ones include "defect does not affect operation temporarily", "mild: no label or lack of label", etc. Among the 550 categories, only 2 categories appear more than 3,500 times, accounting for more than 5%, and the highest accounted for 7.1%. Most classification bases accounted for less than 0.1%. The problem of multiple categories and few samples is the main challenge of this classification task.

[0055] For the question-answering task, this experiment requires the language model to answer the classification basis based on the given phenomenon and the classification results output in the previous step, and give suggestions. The correctness and rationality of the suggestions will be judged by experts.

[0056] 2. Evaluation indicators For the defect level classification task, this experiment selected accuracy, precision, recall and F1-score to evaluate the experimental results. These concepts are obtained from the confusion matrix. The confusion matrix of the classification results is shown in Table 2: Table 2 Classification result confusion matrix

[0057] The true positive, false positive, true negative, and false negative are represented as TP, FP, TN, and FN respectively. The accuracy, precision, recall, and F1 value can be expressed as follows: ; ; ; ; For the question-answering task, this experiment mainly uses the conventional evaluation method of natural language generation tasks. Combined with the characteristics of power problems, this experiment comprehensively considers the quality of generated information and the correctness and application value of the generated results in power problems, and designs an evaluation system based on fluency, consistency, common sense logic, and answer accuracy. The full score is set to 100 points, and the proportion design is shown in Table 3.

[0058] Table 3 Scoring criteria for question-answering tasks

[0059] Among them, fluency refers to the readability of the answer, consistency refers to the degree of fit between the answer and the power field, common sense logic refers to whether the answer content conforms to general logic and whether there are any ambiguities or misunderstandings, and answer accuracy refers to whether the answer to the question is correct. If the answer is completely wrong, no other items will be scored and it will be directly recorded as 0. The specific explanation of the table content is shown in Table 4.

[0060] Table 4 Scoring criteria

[0061] In this experiment, 200 answers were randomly selected from the generated answers and scored by experts in the power field to assess the quality of the answers and evaluate the model's ability in question-answering tasks.

[0062] 3. Experimental results analysis 3.1 Classification Experiment Results and Analysis The classification results of the model on all data are shown in Table 5. To prove the effectiveness of the method of the present invention, this experiment selected the commonly used methods of text classification Transformer, FastText, DPCNN and the classic methods TextCNN and TextRNN for comparison. Here, TextRNN-Att means that the attention mechanism is introduced on the basis of the original TextRNN, and TextRCNN means that a pooling layer is added on the basis of TextRNN. It can be seen from the experimental results that the Bert model used in the present invention far exceeds the benchmark method in multiple evaluation indicators.

[0063] Table 5 Experimental results of all equipment

[0064] The results of the model classifying only the main transformer defects are shown in Table 6. It can be seen that although the model can still achieve experimental results that far exceed other benchmark methods, the advantage is significantly lower than the full set. Considering that the main transformer is the device with the highest frequency in the training data set, this may be related to the fact that other models have been more fully trained on more training data. From this phenomenon, it can be inferred that the Bert model can achieve better training results on less training data and is less prone to overfitting problems. This may be related to the excellent semantic understanding ability of the Bert model. Compared with the classic text classification method, this method can deeply understand the semantic information of the text, effectively model the connection between sentences and words, and more effectively model the characteristics of each type of sample on a smaller data set.

[0065] Table 6 Main transformer test results

[0066] The results of the defect basis classification experiment are shown in Table 7. In this experiment, the Bert model basically achieved the recognition of the classification basis, while other benchmark methods were stretched thin on this complex multi-classification problem and had difficulty in modeling the relationship between the fault phenomenon and the classification basis. Their accuracy and precision were both below 60%.

[0067] Table 7 Defect classification experimental results

[0068] From the above classification experiment results, the following conclusions can be drawn: (1) The present invention has great potential in text classification tasks and can effectively understand the connotation of texts, even professional terms and expertise in the power field; (2) The present invention is more suitable for a small number of sample training environments, can capture sample features more quickly when training data is limited, and is less likely to fall into the overfitting problem; (3) Compared with traditional text classification methods, the present invention is better at processing diverse text information and classification scenarios, and is better able to cope with complex reading comprehension problems.

[0069] 3.2 Question-answering experiment results and analysis The experimental results of the power main equipment defect question answering are shown in Table 8. It can be found that there is little difference in fluency and consistency between using only the large language model and adding prompt guidance, but the prompt information still has a positive impact on these two aspects. In terms of common sense logic, the large language model using prompts improved by 2.75 points, or about 12.67%, compared with the model without prompts. This shows that well-designed prompts can objectively improve the rationality of the expression of the results generated by the large language model. As for the accuracy of the answer, the score of the prompted model increased by 2.91 points, or about 7.77%, compared with the model without prompts. The experimental results can prove that prompt learning has a significant positive impact on generating reasonable answers.

[0070] Table 8 Defect question answering experiment results

[0071] From the question-answering experiment, we can draw the following conclusions: (1) The large language model has acquired some basic knowledge about electricity and can answer simple questions in the electricity field, but the generated answers may contain errors in details or be too broad and lack practicality; (2) Prompt learning helps improve the common sense logic and answer accuracy of large language models, that is, it helps improve the reasoning ability of the model. Designing effective prompt templates and prompt learning schemes can stimulate the ability of large language models to "recall" and "understand" domain knowledge, allowing the model to adapt to more complex situations. Embodiment 2

[0072] like Figure 6 As shown, the present invention provides a power system main equipment defect diagnosis system based on a large language model, which is used to implement the power system main equipment defect diagnosis method based on a large language model in the above-mentioned embodiment 1, and specifically includes: An information collection module is used to collect defect description information of the main equipment of the power system; The classification module is used to use the pre-built natural language representation model to preliminarily understand the defect description information, obtain the corresponding embedded representation, and perform the defect level classification task and defect basis classification task, and output the defect level classification result and defect basis classification result; The large language model reasoning module is used to use the large language model to summarize the defect level classification results and defect basis classification results, integrate the summarized classification information into the prompt text, and stimulate the reasoning ability of the large language model through prompt engineering, and finally obtain the diagnostic basis and diagnostic results corresponding to the defect description information.

[0073] The present embodiment is a power system main equipment defect diagnosis system based on a large language model, which is used to implement the aforementioned power system main equipment defect diagnosis method based on a large language model. Therefore, the specific implementation method of the power system main equipment defect diagnosis system based on a large language model can be found in the embodiment part of the power system main equipment defect diagnosis method based on a large language model in the aforementioned text. In order to avoid redundancy, it will not be repeated here. Embodiment 3

[0074] An embodiment of the present invention also provides an electronic device, which includes a processor, a memory and a bus system, wherein the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned power system main equipment defect diagnosis method based on a large language model. Embodiment 4

[0075] An embodiment of the present invention also provides a computer storage medium, which stores a computer software product. The computer software product includes a number of instructions for enabling a computer device to execute the above-mentioned method for diagnosing defects of main equipment in a power system based on a large language model.

[0076] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

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

[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0079] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A method for diagnosing defects of main equipment in a power system based on a large language model, characterized in that: include: Collect defect description information of main equipment in the power system; Use the pre-built natural language representation model to preliminarily understand the defect description information, obtain the corresponding embedded representation, perform the defect level classification task and the defect basis classification task, and output the defect level classification result and the defect basis classification result; The defect level classification results and the defect basis classification results are summarized using a large language model, the summarized classification information is integrated into the prompt text, and the reasoning ability of the large language model is stimulated through prompt engineering, and finally the diagnostic basis and diagnostic results corresponding to the defect description information are obtained.

2. The method for diagnosing defects of main equipment in a power system based on a large language model according to claim 1, characterized in that: The pre-built natural language representation model adds a fully connected layer on the basis of the Bert model, and the fully connected layer is used to map the sentence representation to the classification space.

3. The method for diagnosing defects of main equipment in a power system based on a large language model according to claim 1, characterized in that: The performing of the defect level classification task and the defect basis classification task and outputting the defect level classification result and the defect basis classification result specifically includes: Construct defect level classification data set and defect basis classification data set; Use the pre-built natural language representation model to classify and train the data set. During the training process, use the cross entropy loss function to test the model training status, and use the Adam optimizer for optimization, and finally obtain the defect level classification results and defect basis classification results.

4. The method for diagnosing defects of main equipment in a power system based on a large language model according to claim 1, characterized in that: The prompt engineering is used to stimulate the reasoning ability of the large language model, specifically including: Design role-playing prompts to align responses to the electricity domain and increase the professionalism, correctness, and credibility of responses; Introduce thought chain prompts, including instructions, logical basis, and examples, to guide large language models to reason.

5. The method for diagnosing defects of main equipment in a power system based on a large language model according to claim 4, characterized in that: The instructions in the thought chain prompt are used to limit the output format and output range of the large language model; the logical basis is used to guide the reasoning process; and the examples are used to provide specific reasoning examples.

6. The method for diagnosing defects of main equipment in a power system based on a large language model according to claim 4, characterized in that: The thought chain prompt is divided into two types: few-sample prompt and zero-sample prompt according to whether there are examples. The few-sample prompt refers to providing the solution process of one or more example questions, guiding the large language model to imitate the solution process of the example questions, and outputting the correct answer. Zero-sample prompts do not involve any directly related knowledge and only provide hints on ideas.

7. The method for diagnosing defects of main equipment in a power system based on a large language model according to claim 6, characterized in that: The method also includes clustering the defect description information using a K-Means clustering algorithm through a few sample prompts, and selecting the node closest to the centroid in each cluster as a typical example.

8. A power system main equipment defect diagnosis system based on a large language model, characterized in that: The system is used to implement the method for diagnosing defects of main equipment in a power system based on a large language model as described in any one of claims 1 to 7, and specifically includes: An information collection module is used to collect defect description information of the main equipment of the power system; A classification module is used to use a pre-built natural language representation model to preliminarily understand the defect description information, obtain the corresponding embedded representation, and perform defect level classification tasks and defect basis classification tasks, and output defect level classification results and defect basis classification results; The large language model reasoning module is used to use the large language model to summarize the defect level classification results and the defect basis classification results, integrate the summarized classification information into the prompt text, and stimulate the reasoning ability of the large language model through the prompt project, and finally obtain the diagnostic basis and diagnostic results corresponding to the defect description information.

9. An electronic device, characterized in that: The electronic device includes a processor, a memory and a bus system, the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the power system main equipment defect diagnosis method based on a large language model as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer storage medium stores a computer software product, which includes a number of instructions for enabling a computer device to execute the method for diagnosing defects of main equipment in a power system based on a large language model as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intelligent defect diagnosis model construction method based on main transformer load characteristics

    CN113435195A

  • Method, device, medium and program product for realizing power defect description reasoning by LLM

    CN118070901A

  • Ophthalmology automatic inquiry system based on large language model dynamic prompt project

    CN119007992A

  • Generation and use of classification model from synthetically generated data

    US20240428138A1

Cited By

  • Code defect reasoning instruction template generation method and system for large language model

    CN120631737A

  • Code defect reasoning instruction template generation method and system for large language model

    CN120631737B

  • Process parameter optimization diagnosis method fusing large language model and structured model

    CN120805035A

  • A diagnostic method for process parameter optimization that integrates large language models and structured models

    CN120805035B

  • Method and device for determining familial defects of power equipment

    CN120995296A