MP-Transformer-based hybrid fault diagnosis method for analog circuits

By constructing the MP-Transformer fault detection model, the problem of easy aliasing of mixed fault information in analog circuits is solved, achieving high-precision and high-generalization fault diagnosis and improving the reliability of complex circuits.

CN118731661BActive Publication Date: 2025-10-31HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410784915.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2025-10-31
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

In traditional analog circuit hybrid fault diagnosis methods, fault information is easily mixed, resulting in low diagnostic accuracy, poor generalization performance, and inability to guarantee the reliability of complex circuits.

Method used

A hybrid fault diagnosis method for analog circuits based on MP-Transformer is adopted. The method uses a multi-period Transformer network to diagnose hybrid fault signals of analog circuits. By constructing an MP-Transformer fault detection model, including a linear embedding layer, a feature depth extraction layer, an aggregation layer, and a global average pooling layer, the feature extraction unit is used to perform feature upscaling, extraction, and dimensionality reduction. Combined with the characteristics of multi-period signals and the Transformer network, fault detection is achieved.

Benefits of technology

It significantly improves the accuracy and generalization performance of mixed fault diagnosis in analog circuits, can accurately distinguish mixed fault information, reduce the probability of soft faults causing hard faults, and improve the reliability of large and complex circuit systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118731661B_ABST
    Figure CN118731661B_ABST
Patent Text Reader

Abstract

This invention relates to a hybrid fault diagnosis method for analog circuits based on MP-Transformer, belonging to the field of hybrid fault diagnosis for analog circuits. It addresses the problem of traditional diagnostic methods where hybrid soft fault information in analog circuits is easily aliased, leading to low overall diagnostic accuracy and poor generalization performance, thus failing to guarantee the reliability of diagnosing complex circuits. This invention utilizes an MP-Transformer fault detection model to detect hybrid fault signals in analog circuits. The model parameters are determined based on the response signals of the output nodes of the analog circuit under test as measurement points. Feature extraction is performed under these determined model parameters, and feature deformation techniques are technically integrated with Transformer networks, enabling accurate fault diagnosis of hybrid faults. This invention is primarily used for the detection of hybrid faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hybrid fault diagnosis of analog circuits. Background Technology

[0002] With the widespread application of various electronic components in modern life, the stability and reliability of these components throughout their lifecycle have become crucial issues for ensuring the safety of complex circuits. In complex circuits, 80% of failures are caused by analog circuits, which account for 20% of all failures. Therefore, reducing the failure rate of analog circuits is key to ensuring normal circuit operation. Analog circuit failures are categorized into soft and hard failures based on the severity of component failures. Soft failures indicate that environmental factors (temperature, humidity, and pressure) cause the parameter values ​​of components in the analog circuit to deviate from the allowable tolerance range, where tolerance represents the inherent error in parameter values ​​generated during component manufacturing. Hard failures refer to short-circuit or open-circuit failures in analog circuits caused by component structural deformation or extreme exceeding of parameter limits. Hard failures can cause serious failure or complete damage to electronic equipment, leading to catastrophic failures. The high nonlinearity, component tolerance, and parameter continuity of analog circuits present significant research challenges for identifying soft failures. Designing efficient diagnostic strategies to accurately identify soft failures in analog circuits, reduce the probability of hard failures caused by the cumulative effect of soft failures, and avoid serious accidents are critical issues. Because multiple components in a circuit may fail simultaneously, the overlapping of two types of fault information presents a greater challenge to fault diagnosis. Mixed faults refer to the simultaneous failure of one or more components in a circuit. In this case, fault information often overlaps and becomes confused, making it difficult to distinguish fault signals and thus making accurate fault diagnosis more challenging. The complexity of fault modes and the interweaving of multiple fault signals not only increases the complexity of diagnosis but also places higher demands on traditional diagnostic methods. Traditional diagnostic methods are prone to overlapping of mixed soft fault information in analog circuits, resulting in low overall diagnostic accuracy, poor generalization performance, and an inability to guarantee the reliability of diagnosing complex circuits.

[0003] Therefore, it is necessary to design a hybrid fault diagnosis method for analog circuits with superior diagnostic capabilities, which can distinguish various types of fault information, especially hybrid fault information, to achieve accurate diagnosis of hybrid faults and meet the reliability requirements of large and complex circuit systems. Summary of the Invention

[0004] The purpose of this invention is to address the problem that traditional diagnostic methods often suffer from aliasing of mixed soft fault information in analog circuits, leading to low overall diagnostic accuracy, poor generalization performance, and inability to guarantee the reliability of diagnosing complex circuits. This invention provides a mixed fault diagnosis method for analog circuits based on MP-Transformer. It utilizes a multi-cycle Transformer network, namely the MP-Transformer, to diagnose mixed fault signals in analog circuits.

[0005] A hybrid fault diagnosis method for analog circuits based on MP-Transformer, comprising the following steps:

[0006] Step 1: Use PSpice to perform Monte Carlo simulation of the analog circuit under test under test excitation signal to obtain the response signal of each measurement point at each sampling time under each fault type in each sampling period. The measurement point response matrix formed by the response signals of all measurement points in each sampling period is combined with the fault type corresponding to that sampling period to form a training sample. Among all measurement points, there is one measurement point that is the output node of the analog circuit under test. The response signal of each measurement point and the test excitation signal are both multi-period signals. The test excitation signal is composed of the superposition of k excitation signals with different periods.

[0007] Step 2: Construct an MP-Transformer fault detection model and determine the model parameters of the MP-Transformer fault detection model;

[0008] Step 3: Use the response matrix of each measurement point in the training sample as the input data of the MP-Transformer fault detection model, and use the fault type in the training sample as the label of the MP-Transformer fault detection model to train the MP-Transformer fault detection model.

[0009] Step 4: Acquire the response signals of each measurement point at each sampling time during the current sampling period of the analog circuit under test under the excitation signal. Then, input the measurement point response matrix formed by the response signals of all measurement points during the current sampling period into the trained MP-Transformer fault detection model, output the fault type, and complete the fault diagnosis of the analog circuit under test.

[0010] Preferably, the MP-Transformer fault detection model includes a linear embedding layer, a feature depth extraction layer, an aggregation layer, a global average pooling layer, and a fully connected layer;

[0011] A linear embedding layer is used to perform feature fusion on the response matrix of the measurement points to obtain a one-dimensional fused feature X. 1D ;

[0012] The feature depth extraction layer includes k feature extraction units that test the excitation signal; each feature extraction unit is used to extract one-dimensional fused features X according to its corresponding model parameters. 1D After sequentially performing dimensionality increase, feature extraction, and dimensionality reduction, a one-dimensional feature is output. The one-dimensional feature output by the i-th feature extraction unit; i∈{1,…,k};

[0013] The aggregation layer is used to linearly superimpose k one-dimensional features output by the feature depth extraction layer to obtain the superimposed features.

[0014] The global average pooling layer is used to perform global average pooling on the stacked features, followed by fully connected processing through a fully connected layer.

[0015] Preferably, each feature extraction unit includes a feature deformation module 1, a Transformer module, and a feature deformation module 2;

[0016] Feature deformation module 1 modulates the received one-dimensional fused feature X according to its corresponding model parameters. 1D Transform into a two-dimensional feature tensor Then, it is sent to the Transformer module for feature extraction, and the result is... The data is sent to feature deformation module 2, which then performs the deformation based on the corresponding model parameters. Transform into one-dimensional features

[0017] The two-dimensional feature tensor output by feature deformation module 1 in the i-th feature extraction unit;

[0018] This is the two-dimensional feature tensor output by the Transformer module in the i-th feature extraction unit.

[0019] Preferably, the model parameters corresponding to the i-th feature extraction unit include the frequency f. i and period p i , i∈{1,…,k}.

[0020] Preferably,

[0021] Among them, Padding(X) 1D ) for X 1D Adding zeros along the time dimension results in an X that has been padded. 1D The length is an integer multiple of the period. This indicates that feature transformation module 1 in the i-th feature extraction unit transforms the one-dimensional fused feature into p. i ×fi A two-dimensional feature tensor of the form p i and f i These represent the number of rows and columns of the transformed two-dimensional feature tensor, respectively.

[0022] Preferably,

[0023] Here, Trunc(·) represents an optimization operation on the features. This indicates that the dimension is p i ×f i The two-dimensional features are transformed back into one-dimensional features with dimension 1.

[0024] Preferably, the implementation methods for determining the model parameters of the MP-Transformer fault detection model include:

[0025] When any training sample is selected as the output node of the analog circuit under test, the corresponding sampling period is a one-dimensional multi-period signal composed of all response signals. The one-dimensional multi-period signal is then subjected to FFT transformation in time order to obtain the spectrum amplitude A.

[0026] In the spectral amplitude A, obtain the frequencies corresponding to the first k peaks in descending order of peak amplitude, and the frequencies f among the frequencies corresponding to the first k peaks. i The corresponding period p i ;f1 to f k and p1 to p k All are used as model parameters;

[0027] f i p is the frequency corresponding to the i-th peak among the frequencies corresponding to the first k peaks. i f is the period corresponding to the i-th peak among the frequencies corresponding to the first k peaks. i and p i Each of them corresponds to the i-th response signal, where i∈{1,…,k}.

[0028] Preferably,

[0029] To round up, T is the length of the one-dimensional multi-period signal composed of all response signals within the sampling period.

[0030] Preferably, the calibrated cross-entropy loss function (Calibrated CELoss) of the MP-Transformer fault detection model is:

[0031] Calibrated CE Loss=-∑logp(y∣x)-βH(p(y∣x));

[0032] p(y|x) is the probability that the output is y given input x, where x and y are the given input and label, respectively. H(p(y|x)) is the entropy of probability p(y|x), and β represents the strength of the penalty coefficient.

[0033] Preferably, H(p(y∣x))=-∑p(y∣x)log(p(y∣x)).

[0034] This invention proposes the MP-Transformer model, which combines multi-period signal characteristics with a Transformer network, possessing powerful feature extraction and fault classification capabilities. The MP-Transformer model generates a response signal using multi-period test excitation signals and utilizes a Transformer network to extract features from the signal, thereby achieving fault detection. This innovative design can effectively capture subtle features under different fault types, improving the detection accuracy and precision of mixed faults.

[0035] Advantages of this invention:

[0036] This invention effectively solves the problem of easy aliasing of mixed soft fault information in analog circuits in traditional diagnostic methods by constructing an MP-Transformer fault detection model, thereby significantly improving diagnostic accuracy. The MP-Transformer fault detection model, through a feature depth extraction layer, can extract more detailed and comprehensive fault features, achieving accurate diagnosis of complex mixed faults. It enhances network generalization performance by combining multi-period signal characteristics with the Transformer network, enabling the model to fully mine information within and between periods. This gives the model stronger generalization ability when facing different types of analog circuit faults, ensuring efficient and accurate fault diagnosis even in diverse and complex circuit environments. Simultaneously, it accurately distinguishes mixed fault information: the MP-Transformer fault detection model's unique feature extraction unit effectively distinguishes and identifies different types of fault signals by performing dimensionality upscaling, feature extraction, and dimensionality reduction on one-dimensional fused features. Even in the case of mixed faults, it can accurately diagnose the specific information of each fault, avoiding diagnostic errors caused by information aliasing. This invention uses PSpice simulation and FFT transform techniques to accurately determine the parameters of the MP-Transformer fault detection model, ensuring the reliability and accuracy of the model in practical applications. This parameter determination method can efficiently obtain the characteristic information of the circuit under test, providing a solid foundation for subsequent fault diagnosis.

[0037] This invention constructs an MP-Transformer fault detection model to detect mixed fault signals in analog circuits. After determining the model parameters, the MP-Transformer fault detection model is trained. The feature depth extraction layer designed in the MP-Transformer fault detection model extracts features by sequentially upscaling the one-dimensional fused features according to the corresponding model parameters through its feature extraction unit. This is because both the measurement point response signal and the test excitation signal are multi-cycle signals. The features extracted after two-dimensionalization have intra-cycle and inter-cycle information, which can fully reflect the relationship between the measurement point response signal and the test excitation signal. The features extracted after two-dimensionalization have intra-cycle and inter-cycle information, which can fully explore the mixed fault information of the signal and accurately diagnose mixed fault situations.

[0038] A feature depth extraction layer is introduced into the MP-Transformer model to handle one-dimensional fused features. This layer performs dimensionality upscaling, feature extraction, and dimensionality reduction operations on features extracted from multi-period signals to obtain high-dimensional feature vectors. This innovative method can extract fault features more meticulously, effectively distinguish mixed fault signals, avoid signal information aliasing, and improve diagnostic accuracy.

[0039] This invention effectively distinguishes between various types of fault information, especially complex mixed faults, enabling accurate diagnosis of mixed faults in analog circuits. This not only helps reduce the probability of soft faults causing hard faults but also significantly improves the reliability of large, complex circuit systems, meeting the high reliability requirements of modern electronic components and preventing serious accidents caused by faults. This method provides an efficient and accurate solution for fault diagnosis of complex circuits and has broad application prospects. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the MP-Transformer fault detection model described in this invention;

[0041] Figure 2 This is a flowchart of the analog circuit hybrid fault diagnosis method based on MP-Transformer described in this invention;

[0042] Figure 3 This is a schematic diagram of the feature transformation module.

[0043] Figure 4 This is the schematic diagram of a Sallen-Key bandpass filter circuit;

[0044] Figure 5This is an iterative curve graph of the MP-Transformer model; where the horizontal axis Epochs represents the number of iterations, the vertical axis Value represents the specific value of the curve, Loss represents the network loss curve, and Accuracy represents the network accuracy curve.

[0045] Figure 6 This is a schematic diagram of the confusion matrix of the MP-Transformer model used for fault diagnosis of Sallen-Key bandpass filter circuits. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0048] With the widespread development of deep learning in computer vision and natural language processing in recent years, its powerful feature extraction and generalization capabilities have attracted widespread attention in various fields. Digitally driven deep learning methods have also been widely used in analog circuit fault diagnosis. The Transformer, proposed by the Google Brain team in 2017, is a novel deep learning network architecture that uses only self-attention mechanisms. Its powerful feature extraction capabilities and unique memory for long sequences have led to its widespread application in natural language processing, subsequently becoming the foundational framework for various large language models. Benefiting from its powerful ability to process long sequences when dealing with circuit timing signals, it also possesses strong feature extraction and classification capabilities for mixed fault signals. Therefore, addressing the problem of traditional diagnostic methods where mixed soft fault information in analog circuits is easily aliased, resulting in low overall diagnostic accuracy and poor generalization performance that cannot guarantee the reliability of complex circuit diagnosis, this invention utilizes a constructed multi-period Transformer network, namely MP-Transformer, to diagnose mixed fault signals in analog circuits, providing an MP-Transformer-based method for diagnosing mixed faults in analog circuits.

[0049] Example 1:

[0050] See Figure 1 and Figure 2 This embodiment describes a hybrid analog circuit fault diagnosis method based on MP-Transformer, which includes the following steps:

[0051] Step 1: Use PSpice to perform Monte Carlo simulation of the analog circuit under test under test excitation signal to obtain the response signal of each measurement point at each sampling time under each fault type in each sampling period. The measurement point response matrix formed by the response signals of all measurement points in each sampling period is combined with the fault type corresponding to that sampling period to form a training sample. Among all measurement points, there is one measurement point that is the output node of the analog circuit under test. The response signal of each measurement point and the test excitation signal are both multi-cycle signals. The test excitation signal is composed of the superposition of k excitation signals with different cycles. The response signal of each measurement point is the voltage signal of that measurement point.

[0052] Step 2: Construct an MP-Transformer fault detection model and determine the model parameters of the MP-Transformer fault detection model;

[0053] Step 3: Use the response matrix of each measurement point in the training sample as the input data of the MP-Transformer fault detection model, and use the fault type in the training sample as the label of the MP-Transformer fault detection model to train the MP-Transformer fault detection model.

[0054] Step 4: Acquire the response signals of each measurement point at each sampling time during the current sampling period of the analog circuit under test under the excitation signal. Then, input the measurement point response matrix formed by the response signals of all measurement points during the current sampling period into the trained MP-Transformer fault detection model, output the fault type, and complete the fault diagnosis of the analog circuit under test.

[0055] Further, see Figure 1 The MP-Transformer fault detection model includes a linear embedding layer, a feature depth extraction layer, an aggregation layer, a global average pooling layer, and a fully connected layer.

[0056] A linear embedding layer is used to perform feature fusion on the response matrix of the measurement points to obtain a one-dimensional fused feature X. 1D ;

[0057] The feature depth extraction layer includes k feature extraction units that test the excitation signal; each feature extraction unit is used to extract one-dimensional fused features X according to its corresponding model parameters. 1D After sequentially performing dimensionality increase, feature extraction, and dimensionality reduction, a one-dimensional feature is output. The i-th feature extraction unit outputs a one-dimensional feature; i ∈ {1,…,k}; specifically, the model parameters corresponding to the i-th feature extraction unit include the frequency f. i and period p i, i∈{1,…,k}.

[0058] The aggregation layer is used to linearly superimpose k one-dimensional features output by the feature depth extraction layer to obtain the superimposed features.

[0059] The global average pooling layer is used to perform global average pooling on the stacked features, followed by fully connected processing through a fully connected layer.

[0060] In this preferred embodiment, the feature extraction unit extracts the one-dimensional fused feature X according to its corresponding model parameters. 1D After sequentially performing dimensionality-upgrading feature extraction, compared to the traditional method of extracting only one-dimensional features, the features extracted after dimensionality-upgrading have intra-period and inter-period information, which can fully explore the fault information of the signal.

[0061] For an original one-dimensional signal cluster of length T and number of measurement points n, it is necessary to first use a linear embedding layer to transform it into a one-dimensional fused feature of length T. The function of the linear embedding layer is feature fusion, which fuses multiple features from multiple measurement points into a single feature.

[0062] For a one-dimensional fused feature of length T, its original one-dimensional form is X. 1D ∈T. Since the test excitation signal is a multi-period signal, the response signal acquired in each sampling period also has periodicity. In order to represent the changes between the periods of the response signal, it is first necessary to find the period. Therefore, the Fast Fourier Transform (FFT) is used to analyze the time series formed in the response matrix of the test point in the frequency domain. It should be noted that when performing the Fast Fourier Transform, only the response signal of the output node of the analog circuit under test is used for the Fast Fourier Transform, as shown in Equation 1 below:

[0063]

[0064] Where FFT(·) and AMP(·) represent Fast Fourier Transform and spectral amplitude calculation, respectively. Indicates 1 to Within the interval, take the frequencies {f1,…,f} corresponding to the k largest peaks in amplitude A. k}, and frequencies {f1,…,f k The corresponding period {p1,...,pk} is... Not exceeding The largest integer, To round up and avoid noise from meaningless high frequencies, only the first k largest amplitude values ​​were selected, where k is the number of excitation signals in the test excitation signal. The first k peaks in A were taken to obtain the corresponding frequencies {f1,...,fk Then, the corresponding period {p1,...,p} is obtained. k}

[0065] Therefore, further, the implementation methods for determining the model parameters of the MP-Transformer fault detection model include:

[0066] When any output node of the analog circuit under test in any training sample is taken as the measurement point, the corresponding sampling time period is a one-dimensional multi-periodic signal composed of all response signals. An FFT transformation is then performed on this one-dimensional multi-periodic signal in chronological order to obtain the spectral amplitude A. i In the spectral amplitude A, obtain the frequencies corresponding to the first k peaks in descending order of peak amplitude, and the frequencies f among the first k peaks. i The corresponding period p i ;f1 to f k and p1 to p k All are used as model parameters;

[0067] To round up, T is the length of the one-dimensional multi-period signal composed of all response signals within the sampling period;

[0068] f i p is the frequency corresponding to the i-th peak among the frequencies corresponding to the first k peaks. i f is the period corresponding to the i-th peak among the frequencies corresponding to the first k peaks. i and p i Each of them corresponds to the i-th response signal, where i∈{1,…,k}.

[0069] Based on the selected frequencies {f1,...,f k} and period {p1,...,p k This allows one-dimensional fused features X to be extracted within the feature depth extraction layer. 1D The process involves sequentially increasing dimensionality, extracting features, and reducing dimensionality.

[0070] Furthermore, see Figure 1 Each feature extraction unit includes feature deformation module 1, Transformer module, and feature deformation module 2;

[0071] Feature deformation module 1 is based on its corresponding model parameter f i and p i For the received one-dimensional fused feature X 1D Transform into a two-dimensional feature tensor Then, it is sent to the Transformer module for feature extraction, and the result is... The data is sent to feature deformation module 2, which then determines the model parameters based on the data. i and p i Will Transform into one-dimensional features

[0072] The two-dimensional feature tensor output by feature deformation module 1 in the i-th feature extraction unit;

[0073] This is the two-dimensional feature tensor output by the Transformer module in the i-th feature extraction unit.

[0074] f i and p i The frequency and period are the values ​​corresponding to the i-th feature extraction unit.

[0075] In this preferred approach, dimensionality is first increased, features are extracted, and then dimensionality is reduced. The Transformer, with its powerful feature extraction and generalization capabilities, utilizes a multi-head attention mechanism for feature extraction, ensuring the comprehensiveness and accuracy of feature extraction and providing an accurate data foundation for subsequent fault diagnosis.

[0076] In the model parameter determination process, PSpice was used to perform Monte Carlo simulation of the analog circuit under test under test excitation signal to obtain the response signals of each measurement point under different fault types during each sampling period. A large number of training samples were generated, containing response signal data under different fault types, providing rich data support for subsequent model training. FFT transformation was used: the response signal of the output node of the analog circuit under test was subjected to FFT (Fast Fourier Transform) to obtain the spectral amplitude. Spectral analysis was used to extract the main frequency components and their corresponding periodic information. This frequency and periodic information served as the model parameter input, enabling the model to accurately capture the spectral characteristics of the fault signal. In the spectral amplitude, the first few main peaks were selected in descending order of peak amplitude, and their frequencies and periods were recorded as key parameters to ensure that the model could capture the most important fault signal features, improving the accuracy and sensitivity of fault detection.

[0077] The method for dimensionality upscaling in feature deformation module 1 is as follows: transforming the 1D (i.e., one-dimensional) time series... Reconstructing it into multiple two-dimensional tensors is shown in the following equation:

[0078]

[0079] in, Padding(X) is the two-dimensional feature tensor output by feature deformation module 1 in the i-th feature extraction unit. 1D ) for X1D Adding zeros along the time dimension results in an X that has been padded. 1D The length is an integer multiple of the period, i.e., Padding(X) 1D ) can and Compatible This indicates that feature transformation module 1 in the i-th feature extraction unit transforms the one-dimensional fused feature into p. i ×f i A two-dimensional feature tensor of the form p i and f i These are respectively the number of rows and columns of the transformed two-dimensional feature tensor. This represents the two-dimensional feature tensor obtained after the transformation. The entire transformation process is as follows: Figure 3 As shown, a set of two-dimensional feature tensors can be obtained based on the selected frequency and period. This represents k two-dimensional time tensors derived from different periods. The tensors obtained after the two-dimensional transformation also possess two types of local features: local features between adjacent time points (between columns) and local features between adjacent periods (between rows). This ensures the comprehensiveness and accuracy of feature extraction.

[0080] The dimension reduction operation of feature deformation module No. 2 is implemented as follows:

[0081]

[0082] Trunc(·) indicates that the feature is optimized. This indicates that the dimension is p i ×f i The two-dimensional features are transformed back to one-dimensional features of dimension 1. To preserve the main features of the signal while reducing parameters and computational cost, and to prevent overfitting, a global average pooling layer is used after the features are linearly added through an aggregation layer. This global average pooling calculates the average value of the input features, as shown in the following formula:

[0083]

[0084] Where, lstart=|j×l in / l out |,lend=|(j+1)×l in / l out |,m are hyperparameters used to control the scaling factor of the output tensor. in Input dimension, l out This indicates the output dimension, lstart represents the start point, and lend represents the end point. The feature is formed by linearly adding the one-dimensional features output by the feature depth extraction layer. This represents the features after global average pooling, i.e., the output of the global average pooling layer.

[0085] Because of the existence of mixed faults, some fault classes contain hard-to-classify samples. The MP-Transformer fault detection model may be overconfident in easily classifiable samples, misclassifying hard-to-classify samples into easily classifiable classes. This could lead to overfitting and reduced generalization performance. Therefore, a negative entropy penalty term is introduced to punish the model's over-biasing towards easily classifiable fault classes. The entropy of the conditional distribution generated by the model using the softmax function on a given input x and label y is shown in the following equation:

[0086] H(p(y∣x))=-∑p(y∣x)log(p(y∣x)) (5);

[0087] Based on this, introducing this entropy term into the cross-entropy function yields the Calibrated CE Loss function, as shown in the following equation:

[0088] Calibrated CE Loss=-∑logp(y∣x)-βH(p(y∣x)) (6);

[0089] Here, p(y|x) represents the probability that the output is y given input x, where x and y are the given input and label, respectively. H(p(y|x)) is the entropy of probability p(y|x), and β represents the strength of the penalty coefficient. Through multiple empirical experiments, β = 2 is set as optimal in this paper. Finally, this loss function is used to train the model to obtain the final diagnostic result.

[0090] Verification experiment:

[0091] by Figure 4 The Sallen-Key bandpass filter circuit shown is the experimental object, and its schematic diagram is as follows. Figure 4 As shown, in this paper, the tolerances for resistors and capacitors are set to 10% and 5% respectively, the failure level η is set to 20%, and the nominal value of the components is set to X. S During this period, the fault value is set to X. F The upside and downside deviations can then be expressed as: X F = (1+η)×X S and X F = (1-η)×X SBased on sensitivity analysis, the most vulnerable components of the Sallen-Key bandpass filter circuit are identified as C1, C2, R2, R3, R4, and R5. Fault modes are categorized into 12 single-fault types, 13 double-fault types, and a normal state. To simplify the fault types, fault categories with three or more faults are not currently used for diagnosis; however, they can be added in practical applications. The single-fault category is defined as the uplink and downlink deviations of all components. The double-fault category selects cases that are more difficult to diagnose, such as R5↑&R3↑, C1↑&C2↑, C1↑&R2↑, C2↑&R2↑, C1↑&R3↑, C2↑&R3↑, R2↑&R3↑, R4↓&R3↑, R4↓&C2↑, R4↓&C1↓, R5↓&C2↓, R5↓&C1↓, and R5↓&R2↑. The fault parameter values ​​are shown in the table below, where SF represents a single fault, DF represents a double fault, ↑ represents upward offset, and ↓ represents downward offset.

[0092] Table 1 shows the single fault codes, fault categories, nominal values, and fault values ​​for the Sallen-Key bandpass filter circuit.

[0093]

[0094]

[0095] A pulse source was used as the excitation source of the circuit, with a voltage amplitude of 5V, a pulse period of 1ms, and a sampling period of 1us. A total of 1000 data points were obtained, representing 26 types of faults. For each fault, 300 Monte Carlo simulations were performed, resulting in a total of 7800 experimental data points. The training set and test set were divided in a 7:3 ratio.

[0096] Regarding the network parameters of the MP-Transformer fault detection model, the number of Transformer modules was set to 3, the number of multi-heads to 8, the feature dimension of the hidden layers to 128, AdamW was used as the optimizer, 50 iterations were performed, the batch size was set to 32, the dropout ratio was set to 0.1, and GeLU was used as the activation function. The final iteration curve of the MP-Transformer fault detection model is shown below. Figure 5 As shown, the accuracy of diagnosing 26 mixed faults in the Sallen-Key bandpass filter circuit is 99.62%, and its confusion matrix is ​​as follows. Figure 6 As shown. (Through) Figure 5 As can be seen, the network's accuracy increases rapidly with the number of iterations, while the overall loss decreases rapidly. The network almost converges around the 10th iteration, demonstrating its superior convergence performance. Figure 6 The number in the middle represents the number of responses in the network's judgment response signal that match the predicted class and the actual class. Figure 6It can be seen that the network makes the correct judgment in the vast majority of cases, and the diagnostic accuracy can reach 99.62%. Principle analysis:

[0097] This invention presents a hybrid fault diagnosis method for analog circuits based on MP-Transformer. Addressing the problem of low overall diagnostic accuracy and poor generalization performance due to the aliasing of mixed soft fault information in analog circuits, which fails to guarantee the reliability of complex circuits, this method utilizes a multi-period Transformer network (MP-Transformer) to diagnose hybrid fault signals in analog circuits. First, an MP-Transformer fault detection model is constructed, and its model parameters are determined. During parameter acquisition, the dominant frequency of the periodic signal is obtained through Fast Fourier Transform (FFT), yielding the frequencies and periods corresponding to the first k peaks in the frequency domain. These are then used as parameters for the feature depth extraction layer. The specific structure of each feature extraction unit in the feature depth extraction layer is designed, including a feature transformation module that converts the one-dimensional time signal into two-dimensional features. After feature extraction, dimensionality reduction is performed to better extract fault information within and between periods. Multi-head attention is used for feature extraction, and finally, a fully connected layer outputs the classification results. Experimental verification shows that this method achieves a hybrid fault diagnosis accuracy of 99.62% on a Sallen-Key bandpass filter circuit, demonstrating the effectiveness of this diagnostic method.

[0098] Through the aforementioned technical means, this invention can effectively distinguish various types of fault information, especially complex mixed faults, achieving accurate diagnosis of mixed faults in analog circuits. This not only helps reduce the probability of soft faults causing hard faults but also significantly improves the reliability of large and complex circuit systems, meeting the high reliability requirements of modern electronic components and avoiding serious accidents caused by faults. This method provides an efficient and accurate solution for fault diagnosis of complex circuits and has broad application prospects.

[0099] While the invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.

Claims

1. A hybrid fault diagnosis method for analog circuits based on MP-Transformer, characterized in that, The method includes the following steps: Step 1: Use PSpice to perform Monte Carlo simulation of the analog circuit under test under test excitation signal to obtain the response signal of each measurement point at each sampling time under each fault type in each sampling period. The measurement point response matrix formed by the response signals of all measurement points in each sampling period is combined with the fault type corresponding to that sampling period to form a training sample. Among all measurement points, there is one measurement point that is the output node of the analog circuit under test. The response signal of each measurement point and the test excitation signal are both multi-period signals. The test excitation signal is composed of the superposition of k excitation signals with different periods. Step 2: Construct an MP-Transformer fault detection model and determine the model parameters of the MP-Transformer fault detection model; Step 3: Use the response matrix of each measurement point in the training sample as the input data of the MP-Transformer fault detection model, and use the fault type in the training sample as the label of the MP-Transformer fault detection model to train the MP-Transformer fault detection model. Step 4: Acquire the response signals of each measurement point at each sampling time during the current sampling period of the analog circuit under test under the excitation signal. Then, input the measurement point response matrix formed by the response signals of all measurement points during the current sampling period into the trained MP-Transformer fault detection model, output the fault type, and complete the fault diagnosis of the analog circuit under test.

2. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 1, characterized in that, The MP-Transformer fault detection model includes a linear embedding layer, a feature depth extraction layer, an aggregation layer, a global average pooling layer, and a fully connected layer. A linear embedding layer is used to perform feature fusion on the response matrix of the measurement points to obtain a one-dimensional fused feature X. 1D ; The feature depth extraction layer includes k feature extraction units that test the excitation signal; each feature extraction unit is used to extract one-dimensional fused features X according to its corresponding model parameters. 1D After sequentially performing dimensionality increase, feature extraction, and dimensionality reduction, a one-dimensional feature is output. The one-dimensional feature output by the i-th feature extraction unit; i∈{1,…,k}; The aggregation layer is used to linearly superimpose k one-dimensional features output by the feature depth extraction layer to obtain the superimposed features. The global average pooling layer is used to perform global average pooling on the stacked features, followed by fully connected processing through a fully connected layer.

3. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 2, characterized in that, Each feature extraction unit includes feature deformation module 1, Transformer module, and feature deformation module 2; Feature deformation module 1 modulates the received one-dimensional fused feature X according to its corresponding model parameters. 1D Transform into a two-dimensional feature tensor Then, it is sent to the Transformer module for feature extraction, and the result is... The data is sent to feature deformation module 2, which then performs the deformation based on the corresponding model parameters. Transform into one-dimensional features The two-dimensional feature tensor output by feature deformation module 1 in the i-th feature extraction unit; This is the two-dimensional feature tensor output by the Transformer module in the i-th feature extraction unit.

4. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 2 or 3, characterized in that, The model parameters corresponding to the i-th feature extraction unit include the frequency f. i and period p i , i∈{1,…,k}.

5. The method for hybrid analog circuit fault diagnosis based on MP-Transformer according to claim 3, characterized in that, Among them, Padding(X) 1D ) for X 1D Adding zeros along the time dimension results in an X that has been padded. 1D The length is an integer multiple of the period. This indicates that feature transformation module 1 in the i-th feature extraction unit transforms the one-dimensional fused feature into p. i ×f i A two-dimensional feature tensor of the form p i and f i These represent the number of rows and columns of the transformed two-dimensional feature tensor, respectively.

6. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 3, characterized in that, Here, Trunc(·) represents an optimization operation on the features. This indicates that the dimension is p i ×f i The two-dimensional features are transformed back into one-dimensional features with dimension 1.

7. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 1, characterized in that, The methods for determining the model parameters of the MP-Transformer fault detection model include: When any training sample is selected as the output node of the analog circuit under test, the corresponding sampling period is a one-dimensional multi-period signal composed of all response signals. The one-dimensional multi-period signal is then subjected to FFT transformation in time order to obtain the spectrum amplitude A. In the spectral amplitude A, obtain the frequencies corresponding to the first k peaks in descending order of peak amplitude, and the frequencies f among the frequencies corresponding to the first k peaks. i The corresponding period p i ;f1 to f k and p1 to p k All are used as model parameters; f i p is the frequency corresponding to the i-th peak among the frequencies corresponding to the first k peaks. i f is the period corresponding to the i-th peak among the frequencies corresponding to the first k peaks. i and p i Each of them corresponds to the i-th response signal, where i∈{1,…,k}.

8. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 7, characterized in that, To round up, T is the length of the one-dimensional multi-period signal composed of all response signals within the sampling period.

9. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 1, characterized in that, The calibrated cross-entropy loss function (Calibrated CE Loss) for the MP-Transformer fault detection model is: Calibrated CE Loss=-∑logp(y∣x)-βH(p(y∣x)); p(y|x) is the probability that the output is y given input x, where x and y are the given input and label, respectively. H(p(y|x)) is the entropy of probability p(y|x), and β represents the strength of the penalty coefficient.

10. The method for hybrid fault diagnosis of analog circuits based on MP-Transformer according to claim 9, characterized in that, H(p(y∣x))=-∑p(y∣x)log(p(y∣x)).