Power transformer fault diagnosis method and system based on flatness enhanced Mama

By combining a flatness regularization term-optimized Mamba neural network with a large language model, the accuracy and efficiency issues in small-sample scenarios of power transformer fault diagnosis are solved, achieving efficient, real-time, and reliable fault diagnosis.

CN121580245APending Publication Date: 2026-02-27STATE GRID SICHUAN ELECTRIC POWER CORP ELECTRIC POWER RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511775518.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing power transformer fault diagnosis technologies lack diagnostic accuracy in small sample and rare fault scenarios, have insufficient model generalization ability, high hardware resource requirements, poor interpretability, and are difficult to deploy in a lightweight manner on edge devices.

Method used

A fault diagnosis method based on flatness-enhanced Mamba neural network is adopted. By combining DGA data and PRPD map, the model training is optimized by introducing a flatness regularization loss function. Combined with a large language model for auxiliary diagnosis, the robustness and accuracy of the model in small sample scenarios are improved.

Benefits of technology

It improves the efficiency and accuracy of power transformer fault diagnosis, reduces the dependence on hardware resources, and enables real-time diagnosis and high-reliability diagnostic results on edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121580245A_ABST
    Figure CN121580245A_ABST
Patent Text Reader

Abstract

The invention discloses a power transformer fault diagnosis method and system based on flatness enhanced Mama, relates to the field of transformer fault detection, and solves the problem of insufficient efficiency and precision in the existing power transformer fault diagnosis technology. The technical scheme is characterized by comprising the following steps: acquiring DGA data and a PRPD atlas of a power transformer at the current moment; inputting the DGA data and the PRPD atlas at the current moment into a pre-trained first fault diagnosis model, and outputting a first fault diagnosis result of the power transformer; wherein the training process of the first fault diagnosis model comprises the steps of obtaining DGA data and a PRPD atlas of a power transformer at historical moments, inputting the DGA data and the PRPD atlas at the historical moments into an initialized Mama neural network for training, and obtaining a trained fault diagnosis model when a loss function converges; wherein the loss function is a weighted summation function of cross entropy loss and flatness regular term loss.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of transformer fault detection, more particularly, it relates to a power transformer fault diagnosis method and system based on flatness enhanced Mamba. BACKGROUND

[0002] At present, the diagnosis of power transformer faults such as winding overheating and insulation (such as partial discharge) mainly relies on technologies such as dissolved gas analysis in oil and frequency response analysis. These methods usually extract features from the collected signals or data through signal processing techniques (such as Fourier transform and wavelet transform), and then use traditional machine learning algorithms (such as support vector machines and decision trees) or deep learning models (such as CNN and RNN) for classification and diagnosis.

[0003] Disadvantages of existing solutions:

[0004] (1) Most existing solutions rely on a single model, whose performance is highly dependent on the quality and quantity of training data. When facing rare or new fault types, the generalization ability of the diagnosis model is insufficient due to the lack of sufficient training samples, which may lead to misdiagnosis or missed diagnosis.

[0005] (2) Many methods rely on pre-defined and artificially designed features. This approach is difficult to capture complex and non-linear deep features in fault signals, resulting in limited diagnostic accuracy.

[0006] (3) Some large deep learning models have high diagnostic accuracy, but have a large number of parameters and require high hardware computing power, making it difficult to deploy them on edge devices such as substations, limiting their real-time performance and popularity.

[0007] (4) Existing diagnosis models are mainly trained based on specific data sets, lacking integration and utilization of a large amount of prior knowledge in the fault field (such as fault mechanism and personnel experience), resulting in poor model interpretability and difficulty in handling "small sample" problems. SUMMARY

[0008] The purpose of the present application is to provide a power transformer fault diagnosis method and system based on flatness enhanced Mamba, which solves the problem of insufficient efficiency and accuracy in existing power transformer fault diagnosis technology.

[0009] The above technical purpose of the present application is achieved by the following technical scheme:

[0010] In a first aspect of the present application, a power transformer fault diagnosis method based on flatness enhanced Mamba is provided, the method comprising:

[0011] Collecting DGA data and PRPD spectrum of the power transformer at the current time;

[0012] inputting the DGA data and the PRPD spectrum of the current moment into a pre-trained first fault diagnosis model to output a first fault diagnosis result of the power transformer; wherein a training process of the first fault diagnosis model comprises: acquiring DGA data and a PRPD spectrum of a historical moment of the power transformer, inputting the DGA data and the PRPD spectrum of the historical moment into an initialized Mamba neural network for training, and obtaining the trained fault diagnosis model when a loss function converges; wherein the loss function is a weighted summation function of a cross-entropy loss and a flatness regularization term loss.

[0013] In an implementation scheme, the method further comprises:

[0014] acquiring historical fault events, standard specification data and fault diagnosis data of the power transformer;

[0015] fine-tuning network parameters of the initialized large language model with the historical fault events, the standard specification data and the fault diagnosis data to obtain a second fault diagnosis model;

[0016] if a confidence of the fault diagnosis result output by the first fault diagnosis model is lower than a preset confidence threshold, inputting the concentration data and the PRPD spectrum corresponding to the first fault diagnosis result lower than the confidence threshold into the second fault diagnosis model for analysis to obtain a second fault diagnosis result.

[0017] In an implementation scheme, an expression of the loss function is: wherein, denotes a regularization intensity coefficient, denotes a cross-entropy loss, denotes a flatness regularization term loss, denotes network parameters of the Mamba neural network.

[0018] In an implementation scheme, an expression of the flatness regularization term loss is: wherein, denotes a balance coefficient, denotes a zero-order flatness constraint, denotes a first-order flatness constraint, denotes a perturbation radius.

[0019] In an implementation scheme, an expression of the zero-order flatness constraint is: wherein, denotes a perturbation vector.

[0020] In an implementation scheme, an expression of the first-order flatness constraint is: wherein, denotes a perturbation vector.

[0021] In an implementation scheme, the DGA data and the PRPD spectrum of the current moment are input into a pre-trained first fault diagnosis model, and a first fault diagnosis result of the power transformer is output, including:

[0022] The DGA data and the PRPD spectrum of the current moment are extracted respectively to obtain a data vector of the DGA data and a feature vector of the PRPD spectrum;

[0023] The data vector and the feature vector are spliced to obtain a multi-modal input vector;

[0024] The multi-modal input vector is input into the pre-trained first fault diagnosis model, and the first fault diagnosis result of the power transformer is output.

[0025] In a second aspect of the present application, a power transformer fault diagnosis system based on flatness enhanced Mamba is provided, and the system includes:

[0026] A data acquisition module is configured to acquire DGA data and a PRPD spectrum of the power transformer at a current moment;

[0027] A fault diagnosis module is configured to input the DGA data and the PRPD spectrum of the current moment into a pre-trained first fault diagnosis model, and output a first fault diagnosis result of the power transformer; wherein the training process of the first fault diagnosis model includes: acquiring DGA data and a PRPD spectrum of the power transformer at a historical moment, inputting the DGA data and the PRPD spectrum of the historical moment into an initialized Mamba neural network for training, and obtaining a trained fault diagnosis model when a loss function converges; wherein the loss function is a weighted sum function of a cross-entropy loss and a flatness regularization loss.

[0028] In a third aspect of the present application, an electronic device is provided, including a memory and a processor;

[0029] The memory is configured to store a computer program, and the computer program includes program instructions;

[0030] The processor is configured to execute the program instructions to enable the electronic device to perform the steps of the power transformer fault diagnosis method based on flatness enhanced Mamba provided in the first aspect of the present application.

[0031] In a fourth aspect of the present application, a computer readable storage medium is provided, and the computer readable storage medium includes a computer program, which, when executed by one or more processors, implements the power transformer fault diagnosis method based on flatness enhanced Mamba provided in the first aspect of the present application.

[0032] Compared with the prior art, the present application has the following beneficial effects:

[0033] 1. The present application introduces a flatness perception optimization mechanism in the loss function of the Mamba neural network, so that the trained first fault diagnosis model can still maintain high diagnostic confidence in small sample and distribution offset scenarios, thereby reducing the dependence on large models, thereby solving the problems of insufficient efficiency and accuracy in existing power transformer fault diagnosis technologies.

[0034] 2. In the complex or rare fault scenario that the first fault diagnosis model is indeed difficult to handle, a second fault diagnosis model is introduced to assist in correction, to further improve the robustness and credibility of the overall diagnosis. BRIEF DESCRIPTION OF DRAWINGS

[0035] The accompanying drawings, which are included to provide a further understanding of the embodiments of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and together with the description serve to explain the principles of the present application. In the drawings:

[0036] Figure 1 A flowchart of a power transformer fault diagnosis method based on flatness enhanced Mamba provided by the embodiments of the present application;

[0037] Figure 2 An architecture diagram based on the first fault diagnosis model and the second fault diagnosis model provided by the embodiments of the present application;

[0038] Figure 3 A power transformer fault diagnosis system based on flatness enhanced Mamba provided by the embodiments of the present application. DETAILED DESCRIPTION

[0039] To make the objects, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with embodiments and drawings, and the illustrative embodiments of the present application and the description thereof are only used to explain the present application, and should not be regarded as a limitation to the present application.

[0040] It should be noted that the term "include" or "may include" used in various embodiments of the present application indicates the existence of the claimed function, operation or element, and does not limit the addition of one or more functions, operations or elements. In addition, as used in various embodiments of the present application, the terms "include", "have" and their synonyms only mean to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing, and should not be understood as first excluding the existence or addition of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing.

[0041] It should be understood that terms such as "first", "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined as "first", "second" can be explicitly or implicitly included one or more of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly specified.

[0042] Figure 1 A flowchart of a power transformer fault diagnosis method based on flatness enhanced Mamba provided for an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the method comprises: Figure 1

[0043] S101, collecting the DGA data and PRPD spectrum of the power transformer at the current time.

[0044] In this embodiment, the DGA data refers to the concentration of dissolved gases in the oil of the power transformer, such as CH4, C2H6, C2H4, C2H2, etc.

[0045] Phase-Resolved Partial Discharge (PRPD) is a visual diagnostic tool that presents in the form of a two-dimensional scatter plot by synchronously collecting the amplitude, phase angle and occurrence frequency of partial discharge pulses. Just as an electrocardiogram can determine the rhythm of the heart, a PRPD spectrum can convert the invisible partial discharge activity inside the transformer into an analyzable visual pattern, accurately identify the type of insulation defect, and is the core live detection method specified in IEC 60270, GB / T 7354-2018 and other standards. The core principle is that the occurrence of partial discharge is closely related to the phase of alternating voltage, and the discharge threshold of insulation defects (such as voids, surface contamination, metal tips) under the action of electric field is different, resulting in the concentration of discharge pulses in a specific phase interval of the voltage cycle, forming a unique distribution characteristic.

[0046] S102 inputs the DGA data and PRPD spectrum at the current time into a pre-trained first fault diagnosis model, and outputs a first fault diagnosis result of the power transformer; wherein the training process of the first fault diagnosis model comprises: obtaining the DGA data and PRPD spectrum at a historical time of the power transformer, inputting the DGA data and PRPD spectrum at the historical time into an initialized Mamba neural network for training, and obtaining the trained fault diagnosis model when the loss function converges; wherein the loss function is a weighted sum function of cross-entropy loss and flatness regularization loss.

[0047] ​In this embodiment, the core idea of the Mamba model lies in its unique selective state space mechanism. Unlike traditional recurrent neural networks (RNN) or Transformer models, Mamba can dynamically adjust its internal state transition parameters according to the content of the input data, intelligently filtering out unimportant information and focusing only on the data segments most valuable to the current task. This selectivity enables Mamba to greatly improve computational efficiency and inference speed while maintaining high accuracy.

[0048] In the present application, in order to further improve the robustness and generalization ability of small models in small sample and rare fault scenarios, a flatness-aware optimization mechanism is introduced into the Mamba model. This mechanism minimizes the empirical risk and the flatness index of the loss surface during training, allowing the model parameters to converge to a smoother optimal solution, thereby reducing sensitivity to input perturbations and distribution shifts. The specific workflow is as follows:

[0049] The DGA data and PRPD spectrum at the current time are extracted to obtain the data vector of the DGA data and the feature vector of the PRPD spectrum.

[0050] The data vector and the feature vector are spliced to obtain a multi-modal input vector.

[0051] Specifically, the collected DGA data is normalized and the characteristic ratio (e.g., C2H2 / C2H4) is calculated to form a structured data vector. The PRPD spectrum is grayed and size normalized for image processing to capture the morphological characteristics of partial discharge, forming a feature vector. The data vector of the DGA data and the feature vector of the PRPD spectrum are spliced to form a unified multi-modal input vector. The preprocessed multi-modal input vector is input into the Mamba neural network.

[0052] Mamba neural network state space modeling: The input vector is first mapped to a high-dimensional hidden space through a feature extraction layer. Then, in the core module of the Mamba neural network, the model dynamically processes these hidden features based on its selective state space modeling mechanism. It dynamically adjusts the state transition matrix based on the content of the features to capture the nonlinear dynamic changes in the fault signal. Finally, the processed hidden state vector is fed into a lightweight classifier to output the final fault type and confidence. Among them, Mamba is based on a discretized state space model, and the core recursive formula is as follows:

[0053] where, is the input vector (multi-modal feature), is the hidden state vector, is the output vector, , , are the input-dependent state transition matrix, input projection matrix and output projection matrix respectively, which are dynamically adjusted according to .

[0054] The present application introduces a flatness-aware optimization mechanism to improve the robustness and generalization ability of the small model Mamba neural network in small sample and rare fault scenarios. This mechanism introduces a flatness regularization term during training to make the model parameters converge to a smoother optimal solution, thereby reducing the sensitivity to input perturbations and distribution shifts. Specifically, it includes the following three levels:

[0055] Zero-order flatness constraint: In the parameter space, if the loss function value does not change much within a certain perturbation radius, then the solution is flat. Its calculation formula is: where, denotes the network parameters of the Mamba neural network, denotes the perturbation vector, denotes the cross-entropy loss. This indicator can reflect the worst-case change of the loss function value under small perturbations.

[0056] First-order flatness constraint: If the gradient of the loss function does not change drastically within the perturbation range, then the solution is not sensitive to parameter perturbations. Its mathematical definition is: This indicator represents the maximum value of the gradient norm within the perturbation range, reflecting the stability of the solution.

[0057] Comprehensive flatness regularization term: The comprehensive flatness regularization term can take into account both zero-order and first-order flatness. Its calculation formula is:

[0058] where, denotes the balance coefficient, denotes the zero-order flatness constraint, denotes the first-order flatness constraint. Among them, is the balance coefficient. When , it degenerates to pure zero-order flatness; when , it degenerates to first-order flatness; , both are taken into account.

[0059] The calculation formula of the training loss function of the Mamba neural network is: where, is the regularization strength coefficient. Through this loss function optimization mechanism, the Mamba neural network can converge to a smoother optimal solution during training, thereby maintaining stable diagnostic performance in small sample and rare fault scenarios.

[0060] The first fault diagnosis model obtained by training the Mamba neural network through the flatness-aware optimization loss mechanism described in the foregoing embodiment has a hidden state vector input to a lightweight classifier, which outputs a fault type and a corresponding confidence. When the diagnosis confidence is higher than a preset threshold (e.g., 90%), the result is directly taken as the final diagnosis output.

[0061] Therefore, the fault diagnosis method provided by the embodiments of the present application further includes:

[0062] The historical fault events, standard specification data, and fault diagnosis data of the power transformer are obtained.

[0063] The network parameters of the large language model initialized by the historical fault events, standard specification data, and fault diagnosis data are fine-tuned to obtain a second fault diagnosis model.

[0064] If the confidence of the fault diagnosis result output by the first fault diagnosis model is lower than a preset confidence threshold, the concentration data corresponding to the first fault diagnosis result whose confidence is lower than the confidence threshold and the PRPD spectrum are input to the second fault diagnosis model for analysis to obtain a second fault diagnosis result.

[0065] Specifically, the second fault diagnosis model serves as an expert of power equipment fault diagnosis knowledge and is used to correct and assist the diagnosis of the first fault diagnosis model. An open-source LLM (e.g., Qwen-VL, DeepSeek-V3, etc.) is adopted and trained again based on historical fault cases, standard specifications, and expert diagnosis records of the power transformer, so as to fine-tune the network parameters of the large language model. Meanwhile, in combination with a retrieval enhancement generation technology, relevant information is retrieved from a power knowledge base in the inference process without changing the model parameters, and the information is taken as a component of the Prompt, thereby effectively improving the diagnosis and analysis capability in the field of power transformers.

[0066] It should be noted that only when the diagnosis confidence of the first fault diagnosis model is lower than the preset threshold, the sample is marked as a difficult sample and routed to the second fault diagnosis model. All original data (DGA, PRPD spectrum, etc.) corresponding to the difficult sample and the first fault diagnosis result output by the first fault diagnosis model are taken as a unified Prompt and input to the second fault diagnosis model. The second fault diagnosis model uses its huge knowledge base and strong reasoning capability to deeply analyze the sample and gives the final diagnosis result in combination with a diagnosis standard (e.g., the IEC standard). The second fault diagnosis model also provides a natural language fault explanation to set forth the diagnosis basis and enhance the credibility of the result.

[0067] As shown in FIG. 6, an oil-immersed transformer in operation is monitored online, and two faults, i.e., winding overheating and core overheating, are mainly diagnosed. Figure 2 As shown in FIG. 6, an oil-immersed transformer in operation is monitored online, and two faults, i.e., winding overheating and core overheating, are mainly diagnosed.

[0068] The system collects the DGA data (H2, CH4, C2H6, C2H4, C2H2 concentration) of the transformer in real time and generates the corresponding time trend curve.

[0069] The DGA data and its trend characteristics are input into the Mamba model, i.e., the first fault diagnosis model, which is obtained by flatness perception optimization training. In the normal operation condition, the Mamba model outputs a diagnosis result of normal, with a high reliability, and the system directly adopts the result. In a certain monitoring, the Mamba model preliminarily judges an overheating fault, but the reliability is lower than the preset threshold, and the system labels the sample as a difficult sample.

[0070] The original data of the difficult sample and the preliminary result of the Mamba are input into the large model (the second fault diagnosis model) for further analysis. The large model combines the IEC standard and historical case knowledge to correct the diagnosis result to winding overheating.

[0071] The final diagnosis result is output, and the corresponding diagnosis basis explanation is generated, for example, the C2H4 and C2H6 concentrations in the DGA data are abnormal, combined with the historical operation data, it is judged as early winding overheating, and further detection is suggested.

[0072] The workflow described in the above embodiment ensures that most samples can be efficiently and stably processed by the small model Mamba with the introduction of the flatness perception optimization mechanism under the premise of ensuring high-precision diagnosis, thereby realizing the real-time and low-cost diagnosis. For complex faults that the Mamba model cannot confidently judge, the expert knowledge of the LLM is used for secondary correction, and the accuracy and robustness of the overall diagnosis are significantly improved, so the second fault diagnosis model with intensive computing resources is only called when necessary.

[0073] Figure 3 A power transformer fault diagnosis system based on flatness enhanced Mamba is provided for the embodiments of the present application, as shown in Figure 3 The system comprises:

[0074] The data acquisition module 310 is configured to acquire the DGA data and the PRPD spectrum of the power transformer at the current time.

[0075] The fault diagnosis module 320 is configured to input the DGA data and the PRPD spectrum of the current moment into a pre-trained first fault diagnosis model, and output a first fault diagnosis result of the power transformer.

[0076] It can be understood that the implementation of each module of the power transformer fault diagnosis system based on the flatness-enhanced Mamba provided in the embodiment has been described in detail in the power transformer fault diagnosis method based on the flatness-enhanced Mamba described in the foregoing embodiment, and thus the embodiment will not be described again.

[0077] Correspondingly, the power transformer fault diagnosis system based on the flatness-enhanced Mamba provided in the embodiment introduces a flatness-aware optimization mechanism into the loss function of the Mamba neural network, so that the first fault diagnosis model trained can still maintain a relatively high diagnosis confidence in a small sample and distribution offset scenario, thereby reducing the dependence on a large model, and thus the problem of insufficient efficiency and accuracy in the existing power transformer fault diagnosis technology is solved.

[0078] In the complex or rare fault scenario that is indeed difficult for the first fault diagnosis model to handle, a second fault diagnosis model is introduced again for auxiliary correction, so as to further improve the robustness and credibility of the overall diagnosis.

[0079] The embodiment of the present application also provides an electronic device. The electronic device includes a processor, a memory, a communication interface and at least one communication bus for connecting the processor, the memory and the communication interface. The memory includes but is not limited to a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (PROM) or a portable read-only memory (CD-ROM), and the memory is used for related instructions and data.

[0080] The communication interface is configured to receive and send data. The processor can be one or more CPUs, and in the case of one CPU, the CPU can be a single-core CPU or a multi-core CPU. The processor in the electronic device is configured to read one or more programs stored in the memory and perform the following operations: collecting DGA data and a PRPD spectrum of the power transformer at a current time; inputting the DGA data and the PRPD spectrum at the current time into a pre-trained first fault diagnosis model to output a first fault diagnosis result of the power transformer; wherein the training process of the first fault diagnosis model comprises: obtaining DGA data and a PRPD spectrum at a historical time of the power transformer, inputting the DGA data and the PRPD spectrum at the historical time into an initialized Mamba neural network for training, and obtaining the trained fault diagnosis model when a loss function converges; wherein the loss function is a weighted sum function of a cross-entropy loss and a flatness regularization loss.

[0081] It should be noted that the specific implementation of each operation can be described above Figure 1 It should be noted that the specific implementation of each operation can be described above

[0082] The embodiment of the present application further provides a computer readable storage medium, which is a memory device in a computer device and is used for storing programs and data. It can be understood that the computer readable storage medium herein can include an internal storage medium in the computer device and can also include an extended storage medium supported by the computer device. The computer readable storage medium provides a storage space, which stores an operating system of the terminal. In addition, one or more instructions stored in the storage space are suitable for being loaded and executed by the processor, and the instructions can be one or more computer programs (including program codes). It should be noted that the computer readable storage medium herein can be a high-speed RAM memory or a non-volatile memory such as at least one disk memory. The processor can load and execute the one or more instructions stored in the computer readable storage medium to implement the corresponding steps of the power transformer fault diagnosis method based on the flatness enhanced Mamba in the above embodiment. It should be understood by those skilled in the art that the embodiment of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. In addition, the present application can be in 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.

[0083] The embodiment of the present application further provides a computer program product containing program instructions. The computer program product can be a software or program product containing program instructions, which can be run on a computing device or stored in any available medium. When the computer program product is run on at least one electronic device, the at least one electronic device is caused to perform a power transformer fault diagnosis method based on the flatness enhanced Mamba.

[0084] The above specific embodiments further explain the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A power transformer fault diagnosis method based on flatness-enhanced Mamba, characterized in that, The methods include: Collect the DGA data and PRPD map of the power transformer at the current moment; The current DGA data and PRPD map are input into a pre-trained first fault diagnosis model, and the first fault diagnosis result of the power transformer is output. The training process of the first fault diagnosis model includes: acquiring the historical DGA data and PRPD map of the power transformer, inputting the historical DGA data and PRPD map into an initialized Mamba neural network for training, and obtaining the trained fault diagnosis model when the loss function converges. The loss function is a weighted summation function of cross-entropy loss and flatness regularization term loss.

2. The power transformer fault diagnosis method based on flatness enhancement Mamba as described in claim 1, characterized in that, The method further includes: Acquire historical fault events, standard specification data, and fault diagnosis data of power transformers; By fine-tuning the network parameters of the initial large language model using historical fault events, standard specification data, and fault diagnosis data, a second fault diagnosis model is obtained. If the confidence level of the fault diagnosis result output by the first fault diagnosis model is lower than the preset confidence level threshold, the concentration data and PRPD spectrum corresponding to the first fault diagnosis result that is lower than the confidence level threshold are input into the second fault diagnosis model for analysis to obtain the second fault diagnosis result.

3. The power transformer fault diagnosis method based on flatness-enhanced Mamba according to claim 1, characterized in that, The expression for the loss function is: ,in, This represents the regularization strength coefficient. Represents cross-entropy loss, This represents the loss due to the flatness regularization term. This represents the network parameters of the Mamba neural network.

4. The power transformer fault diagnosis method based on flatness enhancement Mamba according to claim 3, characterized in that, The expression for the flatness regularization loss is: ;in, Represents the balance coefficient. This represents the zeroth-order flatness constraint. This represents a first-order flatness constraint. Indicates the disturbance radius.

5. The power transformer fault diagnosis method based on flatness enhancement Mamba according to claim 3, characterized in that, The expression for the zero-order flatness constraint is: ,in, This represents the perturbation vector.

6. The power transformer fault diagnosis method based on flatness enhancement Mamba according to claim 3, characterized in that, The expression for the first-order flatness constraint is: ,in, This represents the perturbation vector.

7. The power transformer fault diagnosis method based on flatness enhancement Mamba as described in claim 1, characterized in that, The current DGA data and PRPD map are input into the pre-trained first fault diagnosis model, which outputs the first fault diagnosis result of the power transformer, including: Extract the DGA data and PRPD map at the current time respectively to obtain the data vector of the DGA data and the feature vector of the PRPD map; The data vector and the feature vector are concatenated to obtain the multimodal input vector; The multimodal input vector is input into the pre-trained first fault diagnosis model, and the first fault diagnosis result of the power transformer is output.

8. A power transformer fault diagnosis system based on flatness-enhanced Mamba, characterized in that, The system includes: The data acquisition module is used to collect the DGA data and PRPD map of the power transformer at the current moment; The fault diagnosis module is used to input the current DGA data and PRPD map into a pre-trained first fault diagnosis model and output the first fault diagnosis result of the power transformer. The training process of the first fault diagnosis model includes: acquiring the historical DGA data and PRPD map of the power transformer, inputting the historical DGA data and PRPD map into an initialized Mamba neural network for training, and obtaining the trained fault diagnosis model when the loss function converges. The loss function is a weighted summation function of cross-entropy loss and flatness regularization term loss.

9. An electronic device, characterized in that, Including memory and processor; A memory for storing computer programs, the computer programs including program instructions; A processor is configured to execute the program instructions to cause the electronic device to perform the steps of a power transformer fault diagnosis method based on flatness enhancement Mamba as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when executed by one or more processors, implements a power transformer fault diagnosis method based on flatness enhancement Mamba as described in any one of claims 1 to 7.