A distribution transformer fault detection method and system for photovoltaic areas
By building a Transformer-based semantic large model and reinforcement learning algorithm, combined with the Mamba model to optimize the embedding layer, the problems of low efficiency and accuracy in fault detection of distribution transformers in photovoltaic areas were solved, achieving more efficient and accurate fault detection.
Patent Information
- Application Number
- CN202510876351.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-06-27
AI Technical Summary
Existing technologies are difficult to effectively improve the fault detection efficiency and accuracy of distribution transformers in photovoltaic areas. In particular, the subjectivity of the hierarchical analysis method leads to low detection efficiency and poor accuracy.
Build a Transformer-based semantic large model, combine reinforcement learning algorithms and the Mamba model, build a training set based on historical fault text and usage rules, optimize the embedding layer, and perform iterative training to improve fault detection capabilities.
The accuracy and timeliness of fault detection are significantly improved, which enables a better understanding of the fault characteristics in the distribution transformer operating data and provides fast and efficient fault detection results.
Smart Images

Figure CN120429645B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a distribution transformer fault detection method and system for photovoltaic stations. Background Art
[0002] With the continuous development of technology, the large-scale integration of renewable energy sources has posed significant challenges to the safety and reliability of the power grid. This is particularly true for photovoltaic energy, which is volatile and random. When a large number of distributed photovoltaic systems are connected in an unordered manner, the distribution transformers in the photovoltaic grid are at risk of reverse overload or even burnout. Currently, there are two main methods for status assessment and fault diagnosis of distribution transformers: pattern recognition and hierarchical analysis. However, these methods are gradually failing to meet the requirements for safe and reliable operation of the power grid. In particular, the model established by the hierarchical analysis method is highly subjective and cannot objectively represent the status of the distribution transformer, resulting in low efficiency and poor accuracy in fault detection of distribution transformers.
[0003] Therefore, how to improve the efficiency and accuracy of fault detection of distribution transformers in photovoltaic areas has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0004] The present invention provides a distribution transformer fault detection method and system for photovoltaic area, which solves the problem of how to improve the fault detection efficiency and accuracy of distribution transformers in photovoltaic area.
[0005] To solve the above technical problems, the first aspect of the present invention provides a distribution transformer fault detection method for a photovoltaic area, comprising:
[0006] Obtain historical fault texts of the photovoltaic area and usage rules of the distribution transformer, and convert the historical fault texts and the usage rules into historical question-answer pairs to construct a training set;
[0007] Select some historical question-answer pairs to train the Transformer-based reward model to obtain a trained reward model;
[0008] The semantic large model is trained using the training set, and based on a reinforcement learning strategy, the parameters of the semantic large model during training are iteratively fine-tuned using the trained reward model until a preset number of iterations is reached, thereby obtaining a trained semantic large model; the semantic large model includes an optimized embedding layer, a Transformer layer, and an output layer, and the optimized embedding layer is obtained by fusing a general embedding layer and a domain embedding layer using a Mamba model;
[0009] Real-time operating data of the distribution transformer is obtained to construct a real-time problem, and the real-time problem is processed using the trained semantic big model to obtain a fault detection result.
[0010] As one preferred solution, converting the historical fault text and the usage rules into historical question-answer pairs includes:
[0011] The usage rules are converted into a question-answer format, and the historical fault text is converted into a fault phenomenon-cause or solution format, to obtain a plurality of historical question-answer pairs.
[0012] As one of the preferred solutions, the reward model is obtained by removing the last non-embedding layer in the pre-trained Transformer model and adding a linear layer to the output of the Transformer encoder layer.
[0013] As one preferred solution, the reward model includes an input embedding layer, a Transformer encoder layer, a global pooling layer, and a linear layer; wherein,
[0014] The aforementioned method selects some historical question-answer pairs to train a Transformer-based reward model, and obtains a trained reward model, including:
[0015] Select some historical question-answer pairs and annotate them with quality scores to obtain a historical input sequence;
[0016] Converting the historical input sequence into a historical embedding vector through the input embedding layer;
[0017] Using the Transformer encoder layer to capture semantic information in the historical embedding vector to obtain historical semantic features;
[0018] Using the global pooling layer to reduce the dimension of the historical semantic features to obtain historical global features;
[0019] Processing the historical global features according to the linear layer to obtain a historical prediction score;
[0020] Calculating the loss between the historical prediction score and the labeled quality score, and updating the model parameters of the reward model according to the loss calculation result;
[0021] The reward model after the model parameters are updated is used to iteratively execute the prediction process of the quality score of the historical input sequence until the loss between the final historical prediction score and the labeled quality score reaches the preset loss requirement, thereby obtaining a trained reward model.
[0022] As one of the preferred solutions, the training set is used to train the semantic large model, and based on the reinforcement learning strategy, the trained reward model is used to iteratively fine-tune the parameters of the semantic large model during the training process until a preset number of iterations is reached to obtain a trained semantic large model, including:
[0023] The training set is converted into a multi-dimensional training vector by using word embedding technology through the optimized embedding layer to construct a history vector matrix;
[0024] The Transformer layer is used to capture long-range dependencies in the history vector matrix to obtain global feature information;
[0025] Processing the global feature information using the output layer to obtain a historical prediction result;
[0026] Comparing the historical prediction results with the corresponding results in the training set to obtain a comparison result, and inputting the historical prediction results into the trained reward model for evaluation based on the proximal optimization strategy in the reinforcement learning algorithm to obtain a reward score;
[0027] The parameters of the semantic big model are updated according to the comparison result and the reward score, and the semantic big model after the model parameters are updated is used to iteratively execute the process of generating the historical prediction results of the training set until a preset number of iterations is reached to obtain a semantic big model that has completed training.
[0028] As one preferred solution, the optimized embedding layer uses word embedding technology to convert the training set into a multi-dimensional training vector to construct a history vector matrix, including:
[0029] Training the universal embedding layer using the training set to retain universal knowledge, thereby obtaining a trained universal embedding layer;
[0030] Extracting the electric power field professional terms corresponding to the usage rules in the training set to construct an extended vocabulary, and adjusting the extended vocabulary according to the number of the electric power field professional terms to obtain a domain training set to train the domain embedding layer, thereby obtaining a trained domain embedding layer;
[0031] Using the Mamba model, the trained general embedding layer and the trained domain embedding layer are dynamically fused to obtain a trained optimized embedding layer;
[0032] Based on the trained optimized embedding layer, word embedding method, block embedding method and position embedding method are respectively adopted to convert the training set into a multi-dimensional training vector to generate a history vector matrix.
[0033] As one preferred solution, the Mamba model includes an inner Mamba polymerization layer and an outer Mamba polymerization layer; wherein,
[0034] The method of dynamically fusing the trained universal embedding layer and the trained domain embedding layer using the Mamba model to obtain a trained optimized embedding layer includes:
[0035] Using the intra-layer Mamba aggregation layer to process the first historical features output by the trained general embedding layer and the second historical features output by the trained domain embedding layer, respectively, to obtain historical processing features for linear splitting, thereby generating first processing features and second processing features;
[0036] Interactively fusing the first processing feature and the second processing feature using the outer Mamba aggregation layer to obtain a historical fusion feature;
[0037] The first processed feature, the second processed feature and the historical fusion feature are taken as input, and after full connection processing or convolution processing, a trained optimized embedding layer is generated.
[0038] As one preferred solution, the generation process of the first processing feature and the second processing feature is expressed by the following formula:
[0039]
[0040]
[0041]
[0042] Where, are the first processing results for the first and second historical features respectively; are the second processing results for the first and second historical features respectively; is the SiLu activation function layer; B is the batch normalization layer; D is the depth convolution layer; is the linear layer; X is the input feature; Processing features for history; is the first historical characteristic or the second historical characteristic; F is a constant; It is the SSM layer in the intralayer Mamba aggregation layer; 、 are the first processing feature and the second processing feature, respectively; It is a linear split process; 、 They are the first and second feature processing functions respectively;
[0043] The generation process of the historical fusion feature is expressed by the following formula:
[0044]
[0045]
[0046]
[0047]
[0048] Where, is the fused features obtained by modeling all modality tokens as long sequences; It is the SSM layer in the outer Mamba polymer layer; 、 are the first processing feature and the second processing feature of the next MA block split by the fusion feature; is the final feature; L is the layer normalization; is the class label; A is the average; It is a historical fusion feature.
[0049] As one of the preferred solutions, the objective function of the proximal optimization strategy is expressed as follows:
[0050]
[0051] Where, is the objective function; is the expected value; is the probability ratio; is the advantage function at time t; is the clipping function; c is a hyperparameter.
[0052] A second aspect of the present invention provides a distribution transformer fault detection system for a photovoltaic area, comprising:
[0053] A training set construction module is used to obtain historical fault texts of the photovoltaic area and the usage rules of the distribution transformer, and convert the historical fault texts and the usage rules into historical question-answer pairs to construct a training set;
[0054] The first model training module is used to select some historical question-answer pairs to train the Transformer-based reward model to obtain a trained reward model;
[0055] The second model training module is used to train the semantic large model using the training set and, based on a reinforcement learning strategy, iteratively fine-tune the parameters of the semantic large model during training using the trained reward model until a preset number of iterations is reached, thereby obtaining a trained semantic large model; the semantic large model includes an optimized embedding layer, a Transformer layer, and an output layer; the optimized embedding layer is obtained by fusing the general embedding layer and the domain embedding layer using the Mamba model;
[0056] A real-time fault detection module is used to obtain the real-time operating data of the distribution transformer to construct a real-time problem, and use the trained semantic big model to process the real-time problem to obtain a fault detection result.
[0057] Compared with the prior art, the embodiments of the present invention have the following advantages:
[0058] (1) By using historical fault text and usage rules to build a training set, the model can learn a wealth of fault modes and distribution transformer usage knowledge, enhancing the model's generalization ability in different scenarios. By building a large semantic model based on Transformer and combining iterative optimization with the proximal optimization strategy and reward model in the reinforcement learning algorithm, it can more accurately understand the fault characteristics in the distribution transformer operation data and improve the accuracy and timeliness of fault detection.
[0059] (2) The optimized embedding layer is obtained by fusing the general embedding layer and the domain embedding layer through the Mamba model, which significantly improves the efficiency and accuracy of the embedding layer fusion, enabling the model to better process professional data in the field of distribution transformers and improve the performance of the model; using the trained semantic big model to process real-time operation data, accurate fault detection results can be obtained quickly and efficiently, providing timely decision support for operation and maintenance personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0061] Figure 1 This is a flow chart of a distribution transformer fault detection method for a photovoltaic area provided by an embodiment of the present invention;
[0062] Figure 2 This is a structural diagram of a distribution transformer fault detection system for a photovoltaic area provided by an embodiment of the present invention;
[0063] Reference numerals:
[0064] Among them, 10, training set construction module; 20, first model training module; 30, second model training module; 40, real-time fault detection module. DETAILED DESCRIPTION
[0065] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings and embodiments. Obviously, the embodiments described are only some embodiments of the present invention, rather than all embodiments. The purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0066] In the description of this application, the terms "first," "second," "third," etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first," "second," "third," etc. may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0067] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be a communication between the two components. The terms "vertical", "horizontal", "left", "right", "up", "down" and similar expressions used herein are for illustrative purposes only, and do not indicate or imply that the system or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances.
[0068] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this application have the same meanings as those commonly understood by those skilled in the art. The terms used in this specification are only for describing specific embodiments and are not intended to limit the present invention. Those skilled in the art will understand the specific meanings of the above terms in this application according to specific circumstances.
[0069] In one embodiment, if Figure 1 As shown, the first aspect of the present invention provides a distribution transformer fault detection method for a photovoltaic area, comprising:
[0070] S1. Obtain historical fault texts of photovoltaic areas and usage rules of distribution transformers, and convert the historical fault texts and the usage rules into historical question-answer pairs to construct a training set; specifically, the present invention collects historical fault cases of distribution transformers in photovoltaic areas, including fault description, fault time, fault equipment, fault cause, fault solution and other information as well as technical specifications of different types of distribution transformers, and extracts usage rules from the specifications, such as rated capacity, operating temperature range, load rate limit, etc.; among them, since there are fewer distribution transformer failure cases in photovoltaic areas, in order to enable the model to more accurately and comprehensively detect the failure of distribution transformers in photovoltaic areas, among the selected transformer failure cases, most are distribution transformer failure cases in photovoltaic areas, and a few are distribution transformer failure cases in non-photovoltaic areas.
[0071] In one embodiment, converting the historical fault text and the usage rules into historical question-answer pairs includes:
[0072] The usage rules are converted into a question-answer format, and the historical fault text is converted into a fault phenomenon-cause or solution format, to obtain a plurality of historical question-answer pairs.
[0073] The present invention adopts word segmentation tools to segment historical fault cases, or uses a pre-trained language model (such as BERT) for sentence segmentation, and generates questions based on the fault phenomenon (such as transformer overheating). The corresponding answers are the cause of the fault or solution (such as question: What are the possible causes of transformer overheating? Answer: It may be a winding short circuit or a cooling system failure). For the technical specification, regular expressions or template matching rules are designed to extract key parameters, and then questions are generated based on the parameter names. The answers are specific values or ranges (such as question: What is the rated capacity of the distribution transformer? Answer: 1000kVA), thereby obtaining several historical question and answer pairs. Alternatively, historical failure cases and technical specifications can be batch-transferred to existing large models (such as the GPT series) using Python. After processing by the large model, question-answer pairs are generated and output in a unified .txt format. Each case can generate 60-80 historical question-answer pairs in JSON format. Each historical question-answer pair has an input and an output. Furthermore, an "instruction" element containing the "answer question" is added before the input. This serves as a prompt to help the model produce higher-quality answers. The resulting historical question-answer pairs are then constructed into a training set to facilitate subsequent model training.
[0074] S2. Select some historical question-answer pairs to train a Transformer-based reward model to obtain a trained reward model; wherein the reward model is obtained by removing the last non-embedding layer in the pre-trained Transformer model and adding a linear layer to the output of the Transformer encoder layer; the reward model includes an input embedding layer, a Transformer encoder layer, a global pooling layer, and a linear layer;
[0075] Specifically, the reward model architecture of this invention is based on a large pre-trained Transformer-based model (such as BERT or RoBERTa). The last non-embedding layer in this pre-trained model is removed, and a linear layer is superimposed on the Transformer encoder layer. By lightly fine-tuning and adapting the pre-trained Transformer-based model, this invention can flexibly adapt to reward scoring tasks, while maintaining the depth of semantic understanding while reducing parameter adjustments and significantly improving the training efficiency and generalization ability of the reward model.
[0076] In one embodiment, step S2 includes:
[0077] Select some historical question-answer pairs and annotate them with quality scores to obtain a historical input sequence;
[0078] Converting the historical input sequence into a historical embedding vector through the input embedding layer;
[0079] Using the Transformer encoder layer to capture semantic information in the historical embedding vector to obtain historical semantic features;
[0080] Using the global pooling layer to reduce the dimension of the historical semantic features to obtain historical global features;
[0081] Processing the historical global features according to the linear layer to obtain a historical prediction score;
[0082] Calculating the loss between the historical prediction score and the labeled quality score, and updating the model parameters of the reward model according to the loss calculation result;
[0083] The reward model after the model parameters are updated is used to iteratively execute the prediction process of the quality score of the historical input sequence until the loss between the final historical prediction score and the labeled quality score reaches the preset loss requirement, thereby obtaining a trained reward model.
[0084] Specifically, the present invention randomly extracts a portion of samples (e.g., 20%) from historical question-answer pairs, and professionals or based on preset quality standards label the extracted historical question-answer pairs with quality scores; the quality score can be a continuous value (e.g., a score of 0-10) or a discrete value (e.g., low quality, medium quality, high quality), and the labeled historical question-answer pairs and their quality scores are combined into a historical input sequence.
[0085] Use a pre-trained word embedding model (such as Word2Vec, GloVe, or BERT) as the input embedding layer to convert each word in the historical question-answer pair into a vector representation of fixed dimension. For each historical question-answer pair, concatenate the word vector in the question and the word vector in the answer in sequence to form a sequence embedding of the question-answer pair, namely the historical embedding vector.
[0086] A multi-layer Transformer encoder structure is adopted, and each layer contains a multi-head self-attention mechanism and a feedforward neural network as the Transformer encoder layer. This layer can capture the semantic associations between different words in historical question and answer pairs through the self-attention mechanism, and learn the deep semantic features of historical question and answer pairs, namely historical semantic features. These features contain the semantic information and contextual relationships of historical question and answer pairs.
[0087] Select an appropriate global pooling method (maximum pooling, average pooling, etc.) to reduce the dimensionality of the historical semantic features output by the Transformer encoder layer, and then extract the global features of the historical question-answer pairs, remove redundant information, and obtain more compact historical global features.
[0088] The historical global features output by the global pooling layer are mapped to the quality score space through a linear layer and calculated to obtain the historical prediction score of each historical question-answer pair. An appropriate loss function (such as mean squared error loss (MSE) or cross entropy loss) is selected to measure the difference between the historical prediction score and the labeled quality score. An optimization algorithm (such as stochastic gradient descent (SGD) or Adam) is used to update the model parameters of the reward model based on the loss calculation results.
[0089] The reward model after model parameter update iteratively predicts the quality score of the historical input sequence and calculates the corresponding loss. When the final calculated loss reaches the preset loss requirement, such as less than 0.1, the training process is stopped and the trained reward model is obtained.
[0090] By training the reward model, the present invention can accurately score the quality of historical question-answer pairs, providing a reliable basis for subsequent model training. The trained reward model can serve as an important feedback signal to guide the training of the semantic large model towards generating high-quality question-answer pairs, thereby accelerating the convergence of the model and improving the quality of the model.
[0091] S3. Using the training set to train the semantic large model, and based on a reinforcement learning strategy, iteratively fine-tuning the parameters of the semantic large model during training using the trained reward model until a preset number of iterations is reached, thereby obtaining a trained semantic large model; the semantic large model includes an optimized embedding layer, a Transformer layer, and an output layer;
[0092] In one embodiment, step S3 includes:
[0093] The training set is converted into a multi-dimensional training vector by using word embedding technology through the optimized embedding layer to construct a history vector matrix;
[0094] The Transformer layer is used to capture long-range dependencies in the history vector matrix to obtain global feature information;
[0095] Processing the global feature information using the output layer to obtain a historical prediction result;
[0096] Comparing the historical prediction results with the corresponding results in the training set to obtain a comparison result, and inputting the historical prediction results into the trained reward model for evaluation based on the proximal optimization strategy in the reinforcement learning algorithm to obtain a reward score;
[0097] The parameters of the semantic big model are updated according to the comparison result and the reward score, and the semantic big model after the model parameters are updated is used to iteratively execute the process of generating the historical prediction results of the training set until a preset number of iterations is reached to obtain a semantic big model that has completed training.
[0098] Specifically, the present invention uses the Mamba model to fuse a general embedding layer with a domain embedding layer to create an optimized embedding layer. This layer uses word embedding technology to convert the problem portion of the training set into a fixed-dimensional vector representation. All word vectors in the training set are then arranged in sequence to form a history vector matrix, which serves as the input for the subsequent Transformer layer. The optimized embedding layer used in the present invention can understand both general semantics and in-depth understanding of specific domains when processing text, greatly improving the accuracy of subsequent fault detection.
[0099] To mask the answer part of the question-answer pair, the Transformer layer in the semantic model first passes the mapping matrix 、 、 , to optimize the history vector matrix X corresponding to the problem part of the embedding layer output E Converted to the input matrix, the conversion process is calculated by matrix multiplication in the linear layer, and its formula is as follows:
[0100]
[0101] Where Q is the query matrix; K is the key matrix; and V is the value matrix.
[0102] Multiply the matrix Q and the matrix K and perform similarity calculation to obtain weights, which are converted into probability distributions through the softmax function. This probability distribution can represent the importance distribution of each generated word relative to the next predicted word. Finally, the obtained weights are multiplied by the matrix V to obtain the attention value, which is performed through the attention function. The specific formula is as follows:
[0103]
[0104] Where, d k is the dimension of the input matrix. The denominator is designed to avoid excessive weights and prevent the result of the softmax function from being either 0 or 1.
[0105] At the same time, the multi-head self-attention layer in the Transformer layer contains multiple self-attention layers. The present invention uses each self-attention layer to calculate different features of the text respectively, runs them in parallel, and finally splices and linearly combines them to obtain the output Y T , the specific formula is as follows:
[0106]
[0107]
[0108] Where H i is the output matrix of the i-th single-head self-attention layer; Y T is the output matrix of the masked multi-head self-attention layer; W 0 is the parameter matrix to be trained.
[0109] The feedforward neural network in the Transformer layer consists of fully connected layers, which are combined with normalization layers to generate encoded text vectors. This vector can better reflect the semantic information of the text than the input. The specific calculation method is as follows:
[0110]
[0111] Where L is the layer normalization result, and the Layernorm(X) function represents the layer normalization calculation of the matrix; Y Decoder is the output matrix of the Decoder, that is, the global feature information. The FeedForward(X) function represents the calculation of the fully connected layer. The fully connected layer also contains the ReLU function to perform nonlinear transformation to make up for the problem that the fully connected layer can only perform linear calculations. The specific calculation method is as follows:
[0112]
[0113] Where X is the input of the fully connected layer; W1, W2, b1, and b2 are the parameters to be trained.
[0114] The output layer of the large semantic model consists of a linear layer and a softmax layer. The softmax layer converts the global feature information output by the Transformer layer into a probability distribution, while the linear layer maps the probability distribution results to the word list to indicate the probability of each word being the next word. The word with the highest probability is predicted and generated, generating the historical prediction result, which is the corresponding answer to the question. At the same time, due to the influence of the masked multi-head self-attention layer, the softmax layer only predicts the next word based on all previous content.
[0115] The difference between the answer predicted by the semantic large model and the original answer in the training set, such as accuracy and loss value, is calculated. When the difference does not meet the required standard (such as less than the preset difference threshold), the present invention adopts the proximal optimization strategy in the reinforcement learning algorithm, that is, the proximal strategy algorithm, to input each answer output by the semantic large model into the trained reward model for evaluation and output the reward score. The intelligent agent analyzes the answer and reward score of the semantic large model and uses the optimization algorithm (such as Adam, SGD, etc.) to update the model parameters of the semantic large model. In this way, the large model is fine-tuned through continuous iteration. The proximal strategy algorithm can avoid excessive changes in model parameters and constrain the parameter update range. The objective function of the proximal optimization strategy is:
[0116]
[0117]
[0118]
[0119] Where, is the objective function; is the expected value; is the probability ratio, that is, the ratio of the model parameter strategy after the update to the model parameter strategy before the update; 、 These are the model parameter strategies before and after the update; is the advantage function at time t, which is also and The difference between is the expected return of the model when it is in state s, is the expected reward after the model performs action a when the state is s. The reward is the sum of the reward scores obtained by the model from the initial state to the final state; is a clipping function used to limit the amplitude of policy updates and prevent drastic policy changes; c is a hyperparameter used to set the clipping range.
[0120] The semantic macromodel, with updated model parameters, is then used to re-predict the training set. The comparison, evaluation, and parameter update process is repeated until the preset number of iterations is reached, or the difference between the predicted answer and the true answer in the training set meets the required standard, resulting in a fully trained semantic macromodel. Furthermore, during the training of the semantic macromodel, specialized terms related to the power sector and distribution transformers are specially marked, and the weighted penalty for the location of the terms is increased by four times. This allows the resulting semantic macromodel to focus on specialized terms related to the power sector and distribution transformers.
[0121] In addition, the iterative training of the semantic large model can also be stopped when the parameters of the model meet the requirements. The present invention can use LLaMA-Factory and WebUI as auxiliary tools for fine-tuning. The specific training parameters are:
[0122] The following hyperparameters were used during training;
[0123] Learning_rate: 5e-05
[0124] train_batch_size: 2
[0125] eval_batch_size: 2
[0126] Seed:42
[0127] gradient_accumulation_steps: 8
[0128] total_train_batch_size; 16
[0129] Optimizer: Adam with betas=(0.9, 0.999) and epsilon=1e-08
[0130] lr_scheduler_type: cosine
[0131] num_epochs: 6.0
[0132] mixed_precision_training: Native AMP
[0133] The training was performed three times, and 10% of the training set was selected as the validation set in each training. In the first two training sessions, three rounds of data training (epochs) were performed in each training session, and six rounds of data training (epochs) were performed in the third training session. The learning rate of each experiment was 5e-5, the maximum gradient norm was 1, the calculation model was fp16, and the gradient accumulation was 8.
[0134] The present invention uses a proximal optimization strategy combined with a trained reward model to iteratively fine-tune the large semantic model, which can make the model better adapt to specific tasks and fields and improve the model's performance in semantic understanding and generation. The optimization embedding layer integrates the general embedding layer and the domain embedding layer, so that the model can learn general semantic knowledge and domain-specific knowledge at the same time, thereby enhancing the model's generalization ability and enabling it to perform well in different scenarios. The adopted proximal optimization strategy can effectively guide the model parameters to update in the optimization direction, accelerate the model's convergence speed, and improve training efficiency.
[0135] In one embodiment, the optimized embedding layer is obtained by fusing a general embedding layer and a domain embedding layer through a Mamba model; wherein, the optimized embedding layer uses word embedding technology to convert the training set into a multi-dimensional training vector to construct a history vector matrix, including:
[0136] Training the universal embedding layer using the training set to retain universal knowledge, thereby obtaining a trained universal embedding layer;
[0137] Extracting the electric power field professional terms corresponding to the usage rules in the training set to construct an extended vocabulary, and adjusting the extended vocabulary according to the number of the electric power field professional terms to obtain a domain training set to train the domain embedding layer, thereby obtaining a trained domain embedding layer;
[0138] Using the Mamba model, the trained general embedding layer and the trained domain embedding layer are dynamically fused to obtain a trained optimized embedding layer;
[0139] Based on the trained optimized embedding layer, word embedding method, block embedding method and position embedding method are respectively adopted to convert the training set into a multi-dimensional training vector to generate a history vector matrix.
[0140] Specifically, the optimized embedding layer in the present invention is obtained by fusing the general embedding layer and the domain embedding layer through the Mamba model. Therefore, the general embedding layer and the domain embedding layer need to be trained separately, and then the two are fused through the Mamba model. Among them, the Mamba model is a structured state-space sequence model that can efficiently process complex long sequence data.
[0141] Use a large-scale general corpus (such as Wikipedia, news data, etc.) to pre-train a general embedding layer (such as Word2Vec, BERT), and fine-tune the general embedding layer on the training set, retaining its original parameters, thereby preserving general knowledge and adapting it to the task-specific language style. The trained general embedding layer is used to generate a multi-dimensional vector representation of the general language.
[0142] Professional terms related to power regulations (such as rated voltage, etc.) are extracted from the training set, and an extended vocabulary is generated based on the term frequency or domain expert annotation (such as retaining high-frequency terms or supplementing the domain dictionary). Based on the extended vocabulary, several rows are added to the embedding matrix of the pre-trained model (such as FastText, BERT, etc.), where the number of rows depends on the number of professional terms, and the elements are initialized to all zeros; finally, during the training process, the original pre-training parameters are frozen, and only the vectors of the new words are updated and trained on the domain embedding layer composed of FastText, BERT, etc. to obtain the trained domain embedding layer to generate a multi-dimensional vector representation of power domain terms.
[0143] Based on the Mamba model, the output of the trained general embedding layer and the output of the trained domain embedding layer are used as input. After full connection processing or convolution processing, the trained optimized embedding layer can be obtained. In addition, the output of the trained general embedding layer and the output of the trained domain embedding layer can be used as input. The final embedding representation of each word is dynamically calculated through the attention mechanism or gating mechanism to obtain the trained optimized embedding layer.
[0144] The trained optimized embedding layer uses word embedding, block embedding, and position embedding methods to convert the training set into multi-dimensional training vectors to generate a historical vector matrix. The word embedding method converts the training set text into token form, represents it through the token ID, and then converts it into vector storage. The block embedding method divides a text into different blocks to prevent the problem caused by the same words appearing multiple times in a sentence, so that the same words can be distinguished. The position embedding method represents the absolute position of each token in the text to record its position information. Finally, the embedding information of each word is combined and output in the form of a multi-dimensional vector to obtain the historical vector matrix.
[0145] The present invention combines word embedding (capturing character-level features), block embedding (processing phrase or clause structure) and position embedding (preserving word order information) to generate richer multi-dimensional training vectors and enhance the expressive power of the historical vector matrix. By expanding the vocabulary and domain training set, the model is ensured to learn the core terms and expressions in the power field, thereby improving the prediction accuracy of professional texts.
[0146] In one embodiment, the Mamba model includes an inner Mamba aggregation layer and an outer Mamba aggregation layer; wherein,
[0147] The method of dynamically fusing the trained universal embedding layer and the trained domain embedding layer using the Mamba model to obtain a trained optimized embedding layer includes:
[0148] Using the intra-layer Mamba aggregation layer to process the first historical features output by the trained general embedding layer and the second historical features output by the trained domain embedding layer, respectively, to obtain historical processing features for linear splitting, thereby generating first processing features and second processing features;
[0149] Interactively fusing the first processing feature and the second processing feature using the outer Mamba aggregation layer to obtain a historical fusion feature;
[0150] The first processed feature, the second processed feature and the historical fusion feature are taken as input, and after full connection processing or convolution processing, a trained optimized embedding layer is generated.
[0151] Specifically, the present invention uses an intra-layer Mamba aggregation layer to capture the feature information in the general embedding layer and the domain embedding layer, and represents the tokens output by the general embedding layer and the domain embedding layer as , where F can be 1 or 2. When F is 1, is the first historical feature output by the universal embedding layer (such as universal word vector, image feature, etc.). When F is 2, The second historical feature output by the domain embedding layer (such as domain-specific word vectors, domain knowledge graph embedding, etc.); the intra-layer Mamba aggregation layer is used to process each historical feature independently, that is, 、 The feature information of each layer, namely the historical processing features, is obtained by processing the deep convolution layer, batch normalization layer, SSM layer and SiLu activation function layer in the intra-layer Mamba aggregation layer respectively. Then, the feature information of different embedding layers is connected along the token dimension and split after passing through the linear layer to generate the first processing features and the second processing features. The intra-layer Mamba aggregation layer better captures the feature discrimination information in the general embedding layer and the domain embedding layer, and effectively captures the interaction in each layer through SSM, and finally outputs the features of each layer. The specific processing process can be expressed by the following formula:
[0152]
[0153]
[0154]
[0155] Where, are the first processing results for the first and second historical features respectively; are the second processing results for the first and second historical features respectively; is the SiLu activation function layer; B is the batch normalization layer; D is the depth convolution layer; is the linear layer; X is the input feature, ; Processing features for history; is the first historical characteristic or the second historical characteristic; F is a constant; It is the SSM (Structured State Space Model) layer in the intra-layer Mamba aggregation layer; 、 are the first processing feature and the second processing feature, respectively; It is a linear splitting process, that is, feature splitting along the token dimension; 、 They are the first and second feature processing functions respectively, that is, when the input feature X is hour, are the first processing results for the first and second historical features respectively; are the second processing results for the first and second historical features respectively;
[0156] Then, the outer Mamba aggregation layer is used to integrate the complementary features between each layer to interactively fuse the feature information of each layer. That is, the SSM layer in the outer Mamba aggregation layer is used to concatenate the first processing feature and the second processing feature, that is, the average value of the cls token and token of each embedding layer. Then, the feature is stabilized by the normalization layer in the outer Mamba aggregation layer and simplified by the linear layer in the outer Mamba aggregation layer to obtain the final feature value, that is, the historical fusion feature. The specific processing process can be expressed by the following formula:
[0157]
[0158]
[0159]
[0160]
[0161] Where, is the fused features obtained by modeling all modality tokens as long sequences; It is the SSM layer in the outer Mamba polymer layer; 、 are the first processing feature and the second processing feature of the next MA block split by the fusion feature; is the final feature; L is layer normalization, which is used to stabilize feature learning; is the class label; A is the average; It is a historical fusion feature.
[0162] Finally, the first processed features, the second processed features and the historical fusion features are taken as input and spliced together to form a multi-dimensional feature vector. The spliced features are then nonlinearly transformed through a multi-layer perceptron (MLP) to generate a trained optimized embedding layer; or a convolutional neural network (CNN) is used to extract local features from the spliced features to generate a trained optimized embedding layer (which contains feature representations of general information, domain information and their interactive information).
[0163] The present invention uses layered processing of the inner-layer Mamba aggregation layer and the outer-layer Mamba aggregation layer to enable the model to adapt to the feature differences of data in different fields and improve the performance of the model on specific field tasks; the outer-layer Mamba aggregation layer deeply combines the general features and the domain features through the interactive fusion mechanism, captures the complex relationship between the two, and generates a more discriminative feature representation; the finally generated optimized embedding layer combines the original features and the fused features, and through full connection or convolution processing, further improves the expressive ability of the features and provides higher-quality input for subsequent tasks; through the layered aggregation and interactive fusion mechanism, the advantages of general features and domain features are fully utilized to generate a more discriminative optimized embedding layer, which is suitable for multi-domain and multi-modal tasks, and improves the generalization ability and domain adaptability of the model.
[0164] S4. Acquire real-time operating data of the distribution transformer to construct a real-time problem, and use the trained semantic big model to process the real-time problem to obtain a fault detection result;
[0165] Specifically, the present invention collects real-time operating data from each distribution transformer in a photovoltaic substation, such as voltage, current, temperature, and power. It then uses natural language processing techniques to convert this real-time data into real-time questions, which are then fed into a trained semantic model for processing, yielding fault detection results. Furthermore, for ease of evaluation, the present invention uses the ROUGE and BLEU parameters, along with the language model's ability to answer questions about distribution transformer faults in a specific photovoltaic substation, as evaluation criteria for the language model's testing.
[0166] The ROUGE and BLEU parameters of the language model before fine-tuning are:
[0167] Predict_bleu-4:15.278063999999999,
[0168] predict_rouge-l:37.415641,
[0169] predict_rouge-2:16.6243805,
[0170] predict_rouge-1:27.522209999999994,
[0171] predict_runtime: 106.2964,
[0172] predict_samples_per_second: 1.882,
[0173] predict_steps_per_second: 0.235.
[0174] After fine-tuning, the ROUGE and BLEU parameters of the language model are:
[0175] Predict_bleu-4:32.753387000000004,
[0176] predict_rouge-l:57.7081085,
[0177] predict_rouge-2:38.026931,
[0178] predict_rouge-1:51.949852,
[0179] predict_runtime: 53.535,
[0180] predict_samples_per_second: 3.736,
[0181] predict_steps_per_second: 0.467.
[0182] The answer to the question by the large language model before fine-tuning:
[0183] According to the title description, the fault phenomenon is that the current of the collector phase C increases to 27A, with a phase difference of 180 degrees, and trips after a duration of about 200ms. This may be because a part of the equipment in the photovoltaic power station fails, resulting in excessive current, exceeding the rated current of the transformer, causing the transformer to trip.
[0184] First, you need to check whether the equipment in the photovoltaic power station is operating normally, including photovoltaic panels, inverters, controllers, etc. If any equipment is found to be faulty, it needs to be repaired or replaced in a timely manner.
[0185] Secondly, it is necessary to check whether the wiring and protection devices of the transformer are normal. If wiring errors are found or the protection devices are damaged, they need to be adjusted or replaced in time.
[0186] Once again, you need to check whether the voltage and current of the power grid are normal. If you find that the voltage or current of the power grid is abnormal, you need to notify the power grid company in time for processing.
[0187] Finally, it is necessary to check whether the monitoring system of the photovoltaic power station is normal. If any system failure is found, it needs to be repaired in time.
[0188] In summary, the cause of the fault may be that some equipment in the photovoltaic power station fails, resulting in excessive current, exceeding the rated current of the transformer, causing the transformer to trip.
[0189] The fine-tuned language model answers the question:
[0190] Failure cause analysis:
[0191] 1. The collector BC phase current suddenly increased to 27A, with a phase difference of 180 degrees, and lasted for about 200ms before tripping. This may be caused by fault current.
[0192] 2. Since the installed capacity of the PV power station is 20 MW, the voltage level connected to the grid is 35 kV, and the rated current on the high-voltage side of the step-up transformer is 15 A, the sudden increase in the BC phase current of the collector to 27 A may be due to a fault in the PV panels or PV inverter of the PV power station, resulting in the increased current.
[0193] 3. In addition, the phase difference of 180 degrees may also be caused by a fault in the PV panel or PV inverter. It may be due to the unbalanced voltage output of the PV panel or PV inverter, resulting in a current phase difference of 180 degrees.
[0194] 4. Since the fault duration was about 200ms and the circuit breaker tripped, this may be due to the fault current being too large, causing the switch to trip and the protection device to operate.
[0195] 5. Further inspection of the PV panels, PV inverter, collectors, and step-up transformer is required to determine the specific cause of the fault and repair or replace the faulty components. At the same time, attention should also be paid to the maintenance and upkeep of the PV power station to avoid similar failures.
[0196] It can be seen that the photovoltaic distribution transformer fault detection method based on the semantic big model of the present invention can diagnose, analyze and detect the faults of the photovoltaic distribution transformer in the photovoltaic area more accurately and comprehensively.
[0197] In the embodiment of the present application, based on the problem of how to improve the efficiency and accuracy of fault detection of distribution transformers in photovoltaic areas, a distribution transformer fault detection method for photovoltaic areas is designed. The method converts the fault text of the photovoltaic area and the usage rules of the distribution transformer into a question-answer pair in JSON format to train the reward model; and converts the question part of the question-answer pair into a vector form through the optimized embedding layer of the semantic big model, covering the answer part of the question-answer pair, and passes the question part through multiple Transformer layers and output layers of the language big model to obtain the distribution probability of the label and output the word with the highest probability to form the answer to the question, and converts the original The answer is compared with the formed answer, and the trained reward model and the proximal optimization strategy in the reinforcement learning algorithm are used to fine-tune the training language large model; finally, the trained language large model is tested to enable it to better diagnose the fault of the distribution transformer in the photovoltaic area, and then detect the fault of the distribution transformer in the photovoltaic area in real time; it makes full use of the semantic large model and distribution transformer fault cases, and to a certain extent solves the problems of traditional fault detection being inaccurate and highly subjective, makes full use of unstructured information, is versatile, and greatly improves the efficiency of transformer status assessment and fault diagnosis, so that the power grid can operate safely and reliably.
[0198] It should be noted that although the steps in the above flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders.
[0199] In another embodiment, Figure 2 As shown, the second aspect of the present invention provides a distribution transformer fault detection system for a photovoltaic area, comprising:
[0200] A training set construction module 10 is used to obtain historical fault texts of the photovoltaic area and the usage rules of the distribution transformer, and convert the historical fault texts and the usage rules into historical question-answer pairs to construct a training set;
[0201] The first model training module 20 is used to select some historical question-answer pairs to train a Transformer-based reward model to obtain a trained reward model;
[0202] A second model training module 30 is configured to train the semantic large model using the training set and, based on a reinforcement learning strategy, iteratively fine-tune the parameters of the semantic large model during training using the trained reward model until a preset number of iterations is reached, thereby obtaining a trained semantic large model; the semantic large model includes an optimized embedding layer, a Transformer layer, and an output layer; the optimized embedding layer is obtained by fusing the general embedding layer and the domain embedding layer using the Mamba model;
[0203] The real-time fault detection module 40 is used to obtain the real-time operating data of the distribution transformer to construct a real-time problem, and use the trained semantic big model to process the real-time problem to obtain a fault detection result.
[0204] It should be noted that the various modules in the above-mentioned distribution transformer fault detection system for photovoltaic areas can be implemented in whole or in part through software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. For the specific definition of a distribution transformer fault detection system for photovoltaic areas, please refer to the above definition of a distribution transformer fault detection method for photovoltaic areas. The two have the same functions and effects and will not be repeated here.
[0205] In summary, the present invention relates to the field of machine learning technology, and discloses a distribution transformer fault detection method and system for photovoltaic substations. The method converts the historical fault texts of the photovoltaic substations and the usage rules of the distribution transformers into historical question-answer pairs, and uses them to train a Transformer-based reward model, and then uses them to train a semantic large model including an optimized embedding layer, a Transformer layer and an output layer. Based on the proximal optimization strategy in the reinforcement learning algorithm, the parameters of the semantic large model in training are iteratively fine-tuned by the trained reward model until a preset number of iterations is reached to obtain a trained semantic large model; real-time problems constructed by real-time operating data in the distribution transformer are input into the trained semantic large model for processing to obtain fault detection results; the present invention uses machine learning technology to solve the problems of inaccurate and highly subjective traditional fault detection, and greatly improves the efficiency of fault diagnosis of distribution transformers.
[0206] Each embodiment in this specification is described in a progressive manner, and the same or similar parts of each embodiment can be directly referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the various technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0207] The above-described embodiments merely represent several preferred implementations of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art could make several improvements and substitutions without departing from the technical principles of the present invention, and these improvements and substitutions should also be considered within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be based on the scope of protection of the claims.
Claims
1. A method for detecting faults in distribution transformers in photovoltaic areas, characterized in that: include: Obtain historical fault texts of the photovoltaic area and usage rules of the distribution transformer, and convert the historical fault texts and the usage rules into historical question-answer pairs to construct a training set; Select some historical question-answer pairs to train the Transformer-based reward model to obtain a trained reward model; The training set is used to train the semantic large model, and based on the reinforcement learning strategy, the parameters of the semantic large model in the training process are iteratively fine-tuned by the trained reward model until the preset number of iterations is reached, and the semantic large model that has completed the training is obtained, including: using the word embedding technology to convert the training set into a multi-dimensional training vector by optimizing the embedding layer to construct a historical vector matrix; using the Transformer layer to capture the long-distance dependency relationship in the historical vector matrix to obtain global feature information; using the output layer to process the global feature information to obtain a historical prediction result; comparing the historical prediction result with the corresponding result in the training set. The historical prediction results are compared to obtain a comparison result, and based on the proximal optimization strategy in the reinforcement learning algorithm, the historical prediction results are input into the trained reward model for evaluation to obtain a reward score; the parameters of the semantic large model are updated according to the comparison result and the reward score, and the semantic large model after the model parameters are updated is used to iteratively execute the generation process of the historical prediction results of the training set until a preset number of iterations is reached, thereby obtaining a semantic large model that has completed training; the semantic large model includes an optimized embedding layer, a Transformer layer and an output layer, and the optimized embedding layer is obtained by fusing the general embedding layer and the domain embedding layer through the Mamba model; Acquire real-time operating data of the distribution transformer to construct a real-time problem, and use the trained semantic big model to process the real-time problem to obtain a fault detection result; The method of converting the training set into a multi-dimensional training vector by optimizing the embedding layer and using word embedding technology to construct a history vector matrix includes: Training the universal embedding layer using the training set to retain universal knowledge, thereby obtaining a trained universal embedding layer; Extracting the electric power field professional terms corresponding to the usage rules in the training set to construct an extended vocabulary, and adjusting the extended vocabulary according to the number of the electric power field professional terms to obtain a domain training set to train the domain embedding layer, thereby obtaining a trained domain embedding layer; Using the Mamba model, the trained general embedding layer and the trained domain embedding layer are dynamically fused to obtain a trained optimized embedding layer; Based on the trained optimized embedding layer, word embedding method, block embedding method and position embedding method are respectively adopted to convert the training set into a multi-dimensional training vector to generate a history vector matrix.
2. A method for detecting faults in distribution transformers for photovoltaic areas according to claim 1, characterized in that: The converting the historical fault text and the usage rules into historical question-answer pairs includes: The usage rules are converted into a question-answer format, and the historical fault text is converted into a fault phenomenon-cause or solution format, to obtain a plurality of historical question-answer pairs.
3. A method for detecting faults in distribution transformers for photovoltaic areas according to claim 1, characterized in that: The reward model is obtained by removing the last non-embedding layer in the pre-trained Transformer model and adding a linear layer to the output of the Transformer encoder layer.
4. A method for detecting faults in distribution transformers for photovoltaic areas according to claim 3, characterized in that: The reward model includes an input embedding layer, a Transformer encoder layer, a global pooling layer, and a linear layer; wherein, The aforementioned method selects some historical question-answer pairs to train a Transformer-based reward model, and obtains a trained reward model, including: Select some historical question-answer pairs and annotate them with quality scores to obtain a historical input sequence; Converting the historical input sequence into a historical embedding vector through the input embedding layer; Using the Transformer encoder layer to capture semantic information in the historical embedding vector to obtain historical semantic features; Using the global pooling layer to reduce the dimension of the historical semantic features to obtain historical global features; Processing the historical global features according to the linear layer to obtain a historical prediction score; Calculating the loss between the historical prediction score and the labeled quality score, and updating the model parameters of the reward model according to the loss calculation result; The reward model after the model parameters are updated is used to iteratively execute the prediction process of the quality score of the historical input sequence until the loss between the final historical prediction score and the labeled quality score reaches the preset loss requirement, thereby obtaining a trained reward model.
5. The method for detecting faults of distribution transformers in photovoltaic areas according to claim 1, characterized in that: The Mamba model includes an inner Mamba aggregation layer and an outer Mamba aggregation layer; wherein, The method of dynamically fusing the trained universal embedding layer and the trained domain embedding layer using the Mamba model to obtain a trained optimized embedding layer includes: Using the intra-layer Mamba aggregation layer to process the first historical features output by the trained general embedding layer and the second historical features output by the trained domain embedding layer, respectively, to obtain historical processing features for linear splitting, thereby generating first processing features and second processing features; Interactively fusing the first processing feature and the second processing feature using the outer Mamba aggregation layer to obtain a historical fusion feature; The first processed feature, the second processed feature and the historical fusion feature are taken as input, and after full connection processing or convolution processing, a trained optimized embedding layer is generated.
6. A method for detecting faults in distribution transformers for photovoltaic areas according to claim 5, characterized in that: The generation process of the first processing feature and the second processing feature is expressed by the following formula: Where, are the first processing results for the first and second historical features respectively; are the second processing results for the first and second historical features respectively; is the SiLu activation function layer; B is the batch normalization layer; D is the depth convolution layer; is the linear layer; X is the input feature; Processing features for history; is the first historical characteristic or the second historical characteristic; F is a constant; It is the SSM layer in the intralayer Mamba aggregation layer; 、 are the first processing feature and the second processing feature, respectively; It is a linear split process; 、 They are the first and second feature processing functions respectively; The generation process of the historical fusion feature is expressed by the following formula: Where, is the fused features obtained by modeling all modality tokens as long sequences; It is the SSM layer in the outer Mamba polymer layer; 、 are the first processing feature and the second processing feature of the next MA block split by the fusion feature; For the final feature; L is layer normalization; is the class label; A is the average; It is a historical fusion feature.
7. A method for detecting faults in distribution transformers for photovoltaic areas according to claim 1, characterized in that: The objective function of the proximal optimization strategy is expressed as follows: Where, is the objective function; is the expected value; is the probability ratio; is the advantage function at time t; is the clipping function; c is a hyperparameter.
8. A distribution transformer fault detection system for photovoltaic areas, characterized in that: include: A training set construction module is used to obtain historical fault texts of the photovoltaic area and the usage rules of the distribution transformer, and convert the historical fault texts and the usage rules into historical question-answer pairs to construct a training set; The first model training module is used to select some historical question-answer pairs to train the Transformer-based reward model to obtain a trained reward model; The second model training module is used to train the semantic large model using the training set, and based on the reinforcement learning strategy, iteratively fine-tune the parameters of the semantic large model in the training process through the trained reward model until the preset number of iterations is reached to obtain the semantic large model that has completed the training, including: using the word embedding technology to convert the training set into a multi-dimensional training vector by optimizing the embedding layer to construct a historical vector matrix; using the Transformer layer to capture the long-distance dependency relationship in the historical vector matrix to obtain global feature information; using the output layer to process the global feature information to obtain historical prediction results; comparing the historical prediction results with the training vector matrix. The corresponding results are concentrated and compared to obtain a comparison result. Based on the proximal optimization strategy in the reinforcement learning algorithm, the historical prediction results are input into the trained reward model for evaluation to obtain a reward score. The parameters of the semantic large model are updated according to the comparison result and the reward score, and the semantic large model after the model parameters are updated is used to iteratively execute the generation process of the historical prediction results of the training set until a preset number of iterations is reached to obtain a trained semantic large model. The semantic large model includes an optimized embedding layer, a Transformer layer and an output layer. The optimized embedding layer is obtained by fusing the general embedding layer and the domain embedding layer through the Mamba model. A real-time fault detection module is used to obtain real-time operating data of the distribution transformer to construct a real-time problem, and use the trained semantic big model to process the real-time problem to obtain a fault detection result; The method of converting the training set into a multi-dimensional training vector by optimizing the embedding layer and using word embedding technology to construct a history vector matrix includes: Training the universal embedding layer using the training set to retain universal knowledge, thereby obtaining a trained universal embedding layer; Extracting the electric power field professional terms corresponding to the usage rules in the training set to construct an extended vocabulary, and adjusting the extended vocabulary according to the number of the electric power field professional terms to obtain a domain training set to train the domain embedding layer, thereby obtaining a trained domain embedding layer; Using the Mamba model, the trained general embedding layer and the trained domain embedding layer are dynamically fused to obtain a trained optimized embedding layer; Based on the trained optimized embedding layer, word embedding method, block embedding method and position embedding method are respectively adopted to convert the training set into a multi-dimensional training vector to generate a history vector matrix.
Citation Information
Patent Citations
Electric power customer service intelligent question-answering method based on large semantic model and related device
CN119441398A