An ethernet fault diagnosis method and system based on feature enhancement contrast learning

CN122969957APending Publication Date: 2026-10-23CHANGSHA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611094371.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]现有技术方案在列车以太网物理层波形故障诊断场景下存在多重固有缺陷:第一,多数方法依赖固定数学模型与人工特征映射,对列车交变工况下波形的随机性、链路反射、强电磁噪声适配能力不足,难以捕捉轻微故障带来的细微波形畸变;第二,采用CEEMDAN分解后未对IMF模态做质量前置筛选,噪声模态、低频趋势模态、低信息密度模态会全部流入特征提取流程,大幅污染有效故障特征;第三,提取高维时频特征后缺少精细化冗余筛选机制,冗余、弱相关、低判别性特征持续干扰模型训练,提升计算复杂度同时降低分类精度;第四,传统对比学习仅简单挖掘难负样本,未联合考量样本隐空间相似度与不确定性方差,高噪声伪负样本会错误牵引分类决策边界,削弱模型泛化能力

Benefits of technology

1、在信号分解后搭建融合能量贡献率、相关系数、峭度、样本熵多指标的IMF综合质量评估体系,提前剔除纯噪声模态、低频趋势模态与低信息密度无效模态,仅保留携带物理层故障特征的高质量IMF分量参与后续分析。可大幅削减电磁干扰、线路反射、交变振动带来的无效信号干扰,有效提升电缆老化、接头松动、瞬时短路等轻微故障波形特征的信噪比,适配列车车载多干扰、非线性非平稳的真实运行工况,强化早期故障微弱特征的提取稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122969957A_ABST
    Figure CN122969957A_ABST
Patent Text Reader

Abstract

The present application belongs to the field of fault diagnosis, and particularly relates to an Ethernet fault diagnosis method and system based on feature enhancement contrast learning, which comprises the following steps: performing CEEMDAN decomposition on train Ethernet waveforms, screening effective IMF according to quality, extracting time-frequency features, performing chi-square test and RFE two-stage reduction; fusing features through TCN-MLP after double-mask enhancement; constructing basic contrast loss by dynamically updating class center; screening difficult samples by confidence, combining similarity and variance to weight difficult negative sample loss; interpolating boundary samples to generate interpolation loss, training the model by combining multiple losses, and inputting field waveforms into the model to output fault categories. The present application can filter out noise redundancy, suppress pseudo-negative sample interference, and improve the diagnosis accuracy of slight and confused faults of train Ethernet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of fault diagnosis, specifically relating to an Ethernet fault diagnosis method and system based on feature-enhanced contrastive learning. Background Technology

[0002] Onboard Ethernet has become the core bearer network for next-generation train control, traction, and onboard monitoring data transmission. It directly links the reliable interaction of train operation control commands and safety monitoring signals, and its communication stability is a core guarantee for the safe operation of rail vehicles. Trains are subjected to complex operating conditions such as continuous vibration, alternating high and low temperatures, high-voltage electromagnetic interference, and long-term cable aging. The Ethernet physical layer is prone to latent faults such as loose joints, cable degradation, transient short circuits, and electromagnetic noise disturbances. These faults do not directly cause complete communication interruption, but only manifest as subtle waveform anomalies such as waveform amplitude distortion, edge distortion, and frequency band energy shift. These are early and minor faults, and cannot be identified and accurately located in advance by relying solely on software layer statistical indicators such as switch packet loss and CRC errors. They can easily develop into serious operational hazards such as network intermittent interruptions and loss of control commands. Therefore, conducting refined intelligent fault diagnosis on the raw waveform signals of the train Ethernet physical layer to achieve accurate identification of early and confusing faults is an urgent engineering challenge to be solved in the field of onboard network health management for rail vehicles.

[0003] Among the related technologies, the main approaches are to decompose vibration signals and combine them with time-frequency features to achieve gearbox fault diagnosis, rely on LSTM networks to complete switch machine fault classification, construct a dual-channel feature fusion self-supervised learning framework, use CEEMDAN to extract physical features to achieve fault waveform labeling, fuse physical layer and information layer data, and complete train Ethernet intrusion detection through convolutional neural networks and attention mechanisms.

[0004] Existing technical solutions suffer from several inherent defects in train Ethernet physical layer waveform fault diagnosis scenarios: First, most methods rely on fixed mathematical models and manual feature mapping, which are insufficiently adaptable to the randomness of waveforms, link reflections, and strong electromagnetic noise under alternating train operating conditions, making it difficult to capture subtle waveform distortions caused by minor faults; Second, after CEEMDAN decomposition, no pre-screening of IMF modes is performed, and noise modes, low-frequency trend modes, and low information density modes all flow into the feature extraction process, significantly polluting effective fault features; Third, after extracting high-dimensional time-frequency features, there is a lack of a refined redundancy screening mechanism, and redundant, weakly correlated, and low-discriminative features continuously interfere with model training, increasing computational complexity and reducing classification accuracy; Fourth, traditional contrastive learning only simply mines hard negative samples without jointly considering the latent space similarity and uncertainty variance of samples, and high-noise pseudo-negative samples will incorrectly guide the classification decision boundary, weakening the model's generalization ability. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide an Ethernet fault diagnosis method and system based on feature enhancement contrastive learning, which reduces the probability of false positives and false negatives and improves the accuracy of fault classification.

[0006] An Ethernet fault diagnosis method based on feature-enhanced contrastive learning includes: Multiple sets of discrete train Ethernet waveform signals to be trained are acquired. White noise is superimposed on the original waveform signals to construct a noisy signal. The noisy signal is decomposed and iterated through multiple rounds of EMD to extract multi-order IMF components and update the residuals synchronously. The original Ethernet waveform signal can be recovered after all IMF components are superimposed with the final residuals. The decomposition is stopped and the final IMF components are obtained. The overall quality score is calculated based on the final IMF components. Valid IMF components are selected based on the overall quality score and the score threshold. The signal to be processed is generated based on all valid IMF components and the Ethernet waveform signal. The signal features of the signal to be processed are extracted to construct a high-dimensional feature matrix. The high-dimensional feature matrix is ​​first screened by chi-square test to obtain a set of screened signal features. The importance of each signal feature is obtained according to the set of screened signal features. The signal features with the lowest importance are eliminated in a loop until the number of features reaches a preset value to obtain the optimal set of important features. Data augmentation is performed on the optimal importance feature set using a double random mask, generating two sets of augmented features, namely the first augmented feature and the second augmented feature. The first augmented feature is dilated and pooled by TCN to obtain the first pooled feature. The second augmented feature is input into the MLP network and pooled to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature. Construct a fault category center matrix, update the category center rows in the fault category center matrix according to the fusion feature to obtain the updated category centers, calculate the posterior probability based on the updated category centers and the fusion feature, and obtain the cross-entropy loss based on the posterior probability. The temperature coefficient and smooth label distribution are adaptively generated based on the posterior probability. The KL divergence loss is obtained based on the smooth target distribution and the posterior probability. The contrastive learning loss is obtained by weighted summation of the fused cross-entropy loss and the KL divergence loss. Based on the sample prediction confidence interval, a candidate pool of difficult samples is selected, anchor samples and candidate negative samples are divided, and the reliability weight of negative samples is calculated by combining cosine similarity with sample variance to construct a weighted contrast loss for difficult negative samples. Two sets of samples are randomly selected from the difficult sample candidate pool. Based on the sample angle between the two sets of samples and the two sets of samples, latent features are generated. The fault categories of the latent features are matched according to the fault categories of the two sets of samples. The sample cross-entropy loss of the latent features is calculated based on the fault categories of the latent features. The total model loss is obtained by weighting and summing the contrastive learning loss, the hard-to-bear sample weighted contrastive loss, and the interpolation cross-entropy loss. The prediction model is then iteratively optimized based on backpropagation of the total loss to obtain the optimized prediction model after training. The actual Ethernet waveform signal of the train at the scene is collected, and the actual Ethernet waveform signal is input into the optimization prediction model to output the fault category of the train at the scene.

[0007] Optionally, the noisy signal is iteratively decomposed through multiple rounds of EMD to extract multi-order IMF components and simultaneously update the residuals until the original Ethernet waveform signal can be recovered by superimposing all IMF components with the final residuals, at which point the decomposition stops. This includes: The noisy signal is decomposed into several IMF components by performing multiple rounds of EMD decomposition. The average IMF component is obtained by averaging several IMF components. The residual is obtained based on the noisy signal and the average IMF component; Continuously add white noise to the noisy signal until the first step is executed. After EMD decomposition, the first wheel obtained The average IMF component and the first When the sum of the nth residuals is the same as the original signal, stop the decomposition and proceed to the nth... The average IMF component is used as the final IMF component.

[0008] Optionally, the step of calculating the comprehensive quality score based on the final sampled IMF components, and filtering valid IMF components according to the comprehensive quality score and a score threshold, includes: Set a sampling window, and sample the final IMF component according to the sampling window to obtain the sampled IMF component; Based on the sampled IMF components; The energy contribution rate is calculated based on the sampled IMF components. The correlation coefficient is calculated based on the covariance and standard deviation of the sampled IMF components and the standard deviation of the Ethernet waveform signal. Calculate the kurtosis within the sampling window based on the sampled IMF components; The energy contribution rate, correlation coefficient, and kurtosis are weighted and summed to obtain the comprehensive quality score; The final IMF component with a comprehensive quality score greater than the scoring threshold is considered as a valid IMF component.

[0009] Optionally, the process of extracting signal features from the signal to be processed to construct a high-dimensional feature matrix, first performing a coarse screening of the high-dimensional feature matrix using a chi-square test to obtain a screened signal feature set, and then determining the importance of each signal feature based on the screened signal feature set, including: Normalize the high-dimensional feature matrix to obtain the normalized feature matrix; Divide the features in the normalized feature matrix into B intervals according to their value ranges, and obtain the i-th feature in the normalized feature matrix within each interval. The normalized feature belongs to the first... c Observation frequency for each fault category; The number is calculated based on the observation frequency. Chi-square statistics of each normalized feature; Based on the chi-square statistics, all normalized features in the normalized feature matrix are coarsely filtered, retaining the top features. The normalized features form the feature set for screening signals; The selected signal feature set is input into the learner to obtain an importance score matrix, which consists of multiple importance scores, each of which corresponds to the importance of a normalized feature.

[0010] Optionally, the optimal importance feature set is augmented using a double random mask to generate two sets of augmented features, namely a first augmented feature and a second augmented feature. The first augmented feature is subjected to TCN dilated convolution and pooling to obtain a first pooled feature. The second augmented feature is input into an MLP network and pooled to obtain a second pooled feature. The first pooled feature and the second pooled feature are fused to obtain a fused feature, including: Set a first random mask matrix and a second random mask matrix, obtain a first enhanced feature based on the importance feature set and the first random matrix, and obtain a second enhanced feature based on the importance feature set and the second random matrix; The first enhanced feature is subjected to TCN dilated convolution and pooling to obtain the first pooled feature. The second enhanced feature is input into MLP and then pooled to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature.

[0011] Optionally, the step of adaptively generating the temperature coefficient and smoothing the label distribution based on the posterior probability includes: Set the maximum and minimum temperatures for adaptive temperature control; The temperature coefficient is obtained based on the posterior probability, the maximum temperature value, and the minimum temperature value. Based on the temperature coefficient and the maximum temperature, the smoothing coefficient is obtained; The smoothed tag distribution is obtained based on the smoothing coefficient and the fault category corresponding to the Ethernet waveform signal.

[0012] Optionally, the step of randomly selecting two groups of samples from the difficult sample candidate pool, generating latent features based on the sample angle between the two groups of samples and the two groups of samples, matching the fault category of the latent features with the fault category of the two groups of samples, and calculating the sample cross-entropy loss of the latent features based on the fault category of the latent features includes: Two groups of samples are randomly selected from the difficult sample candidate pool, namely the first sample and the second sample; Calculate the angle between the first sample and the second sample; Calculate the latent features based on the sample angle, the first sample, and the second sample; If the fault categories of the first sample and the second sample are the same, then the fault category of the first sample is taken as the fault category of the latent feature. If the fault categories of the first sample and the second sample are different, the fault category of the latent feature is calculated based on the fault category of the first sample, the fault category of the second sample, and the interpolation coefficient. Based on the fault category of the latent feature and the probability that the latent feature is predicted as the correct fault category by the prediction model, the sample cross-entropy loss of the latent feature is obtained.

[0013] An Ethernet fault diagnosis system based on feature-enhanced contrastive learning includes: The signal decomposition module is used to acquire multiple sets of discrete train Ethernet waveform signals to be trained, add white noise to the original waveform signals to construct a noisy signal, extract multi-order IMF components from the noisy signal through multiple rounds of EMD decomposition and update the residuals synchronously, until the original Ethernet waveform signal can be recovered by superimposing all IMF components with the final residuals, and then the decomposition stops to obtain the final IMF components. The modal filtering module is used to calculate the overall quality score based on the final IMF components after sampling, filter valid IMF components according to the overall quality score and the score threshold, and generate a signal to be processed based on all valid IMF components and Ethernet waveform signals. The feature simplification module is used to extract signal features of the signal to be processed and construct a high-dimensional feature matrix. First, the high-dimensional feature matrix is ​​subjected to a chi-square test to complete the first round of feature coarse screening to obtain a set of screened signal features. The importance of each signal feature is obtained according to the set of screened signal features. The signal features with the lowest importance are cyclically eliminated until the number of features reaches a preset value to obtain the optimal set of important features. The feature fusion encoding module is used to perform data augmentation on the optimal importance feature set using a double random mask, generating two sets of augmented features, namely the first augmented feature and the second augmented feature. The first augmented feature is dilated and pooled by TCN to obtain the first pooled feature. The second augmented feature is input into the MLP network and pooled to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature. The category center update module is used to construct a fault category center matrix, update the category center rows in the fault category center matrix according to the fusion feature to obtain the updated category centers, calculate the posterior probability according to the updated category centers and the fusion feature, and obtain the fusion cross-entropy loss according to the posterior probability. The basic contrastive loss calculation module is used to adaptively generate the temperature coefficient and smooth the label distribution based on the posterior probability, obtain the KL divergence loss based on the smoothed target distribution and the posterior probability, and obtain the contrastive learning loss by weighted summation of the fused cross-entropy loss and the KL divergence loss. The variance-aware hard negative sample mining module is used to filter the candidate pool of hard samples based on the sample prediction confidence interval, divide anchor samples and candidate negative samples, calculate the reliability weight of negative samples by combining cosine similarity with sample variance, and construct the weighted contrast loss of hard negative samples. The latent space interpolation augmentation module is used to randomly select two sets of samples from the hard sample candidate pool, generate latent features based on the sample angle between the two sets of samples and the two sets of samples, match the fault category of the latent features according to the fault category of the two sets of samples, and calculate the sample interpolation cross-entropy loss of the latent features based on the fault category of the latent features. The model training optimization module is used to sum the contrastive learning loss, the hard-negative sample weighted contrastive loss, and the interpolation cross-entropy loss to obtain the total model loss. Based on the total loss, the prediction model is iteratively optimized through backpropagation to obtain the optimized prediction model after training. The fault diagnosis output module is used to acquire the actual Ethernet waveform signal of the train on site, input the actual Ethernet waveform signal into the optimization prediction model, and output the fault category of the train on site.

[0014] A terminal device includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor loads and executes the computer program, it employs an Ethernet fault diagnosis method based on feature-enhanced contrastive learning.

[0015] A computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, employs an Ethernet fault diagnosis method based on feature-enhanced contrastive learning.

[0016] The beneficial effects of this invention are: 1. After signal decomposition, a comprehensive IMF quality assessment system is established, integrating multiple indicators such as energy contribution rate, correlation coefficient, kurtosis, and sample entropy. Pure noise modes, low-frequency trend modes, and low-information-density invalid modes are eliminated in advance, retaining only high-quality IMF components carrying physical layer fault characteristics for subsequent analysis. This significantly reduces invalid signal interference from electromagnetic interference, line reflection, and alternating vibration, effectively improving the signal-to-noise ratio of waveform characteristics of minor faults such as cable aging, loose joints, and transient short circuits. It adapts to the real operating conditions of trains with multiple interferences, nonlinearity, and non-stationarity, enhancing the stability of extracting weak features of early faults.

[0017] 2. Two-stage feature simplification reduces computational overhead while retaining high-discriminative fault features. A two-stage feature compression strategy—using chi-square test for coarse screening and recursive feature elimination of RFE (Reactive Factor Exclusion) for fine screening—layer by layer removes redundant variables, weakly correlated variables, and low-discriminative features from the high-dimensional time-frequency feature pool. On one hand, this significantly reduces the model's input dimension, lowering the computational power consumption and inference latency of in-vehicle embedded diagnostic equipment, meeting the lightweight requirements of real-time vehicle monitoring. On the other hand, it filters training noise from irrelevant features, allowing the model to focus on the core time-frequency fingerprints that can distinguish faults at different physical layers, reducing classification bias caused by feature confusion.

[0018] 3. By using dynamic class center maintenance, basic variational loss, confidence-adaptive temperature adjustment, and probabilistic latent representation mechanism, samples form clearer intra-class clustering and inter-class separation relationships around stable class centers in the latent space, thereby enhancing robust representation ability and uncertainty characterization ability in complex noise environments.

[0019] 4. Similarity-variance joint hard negative sample mining suppresses spurious negative sample interference and stabilizes the classification boundary. The VarCon architecture introduces a confidence truncation sample purification mechanism, first filtering unreliable samples with abnormal confidence to construct a hard sample candidate pool; then, it combines latent space cosine similarity and sample latent uncertainty variance-weighted hard negative sample loss, assigning high loss weights to reliable boundary negative samples with high similarity and small variance, and significantly reducing the weights of noisy spurious negative samples with high similarity but large variance. This effectively avoids the error of high uncertainty and ambiguous labeling transitional state samples influencing the fault decision boundary, alleviates the problems of clustering of similar faults and confusion of dissimilar faults, and significantly improves the diagnostic stability and generalization ability of the model under multiple similar fault categories.

[0020] 5. Targeted Enhancement of Boundary Samples via Latent Space Spherical Interpolation to Improve the Accuracy of Minor / Early Fault Identification: Unlike traditional data augmentation methods that only randomly perturb the original input space, this invention expands the sample distribution of reliable but difficult boundary samples by performing spherical linear interpolation in the feature latent space. Interpolated samples of the same class retain the true labels, while interpolated samples at the boundary of different classes use soft labels for smoothing supervision. This targeted expansion of the latent space samples for early faults, minor faults, and highly confusing faults addresses the training bottleneck of scarce fault boundary samples. The model can fully learn the subtle distinguishing features of different fault states, significantly reducing the probability of misjudgment and missed judgment for difficult-to-distinguish faults such as cable aging and minor electromagnetic interference. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating an Ethernet fault diagnosis method based on feature-enhanced contrastive learning according to the present invention. Detailed Implementation

[0022] An Ethernet fault diagnosis method based on feature-enhanced contrastive learning, such as Figure 1 As shown, the present invention includes: S1. Obtain multiple sets of discrete train Ethernet waveform signals to be trained and their corresponding real fault labels. Add white noise to the discrete train Ethernet waveform signals to construct a noisy signal. Extract multi-order IMF components from the noisy signal through multiple rounds of EMD decomposition and iterative update the residuals. Continue until all IMF components are superimposed with the final residuals to reconstruct the discrete train Ethernet waveform signal. Stop the decomposition and obtain the final IMF components. Specifically, Ethernet waveform signals are a set of discrete waveform signals. During processing, they are sampled and processed at different time windows. Discrete Ethernet waveform signals are represented as follows:

[0023] in, For the first There are 10 Ethernet waveform signals, where N is the maximum number of signals.

[0024] The noisy signal is iteratively decomposed through multiple rounds of EMD to extract multi-order IMF components and the residuals are updated synchronously until the original Ethernet waveform signal can be recovered by superimposing all IMF components with the final residuals. The decomposition then stops. This process includes: The noisy signal is decomposed into several IMF components by performing multiple rounds of EMD decomposition. The average IMF component is obtained by averaging several IMF components. The residual is obtained based on the noisy signal and the average IMF component; Continuously add white noise to the noisy signal until the first step is executed. After EMD decomposition, the first wheel obtained The average IMF component and the first When the sum of the nth residuals is the same as the original signal, stop the decomposition and proceed to the nth... The average IMF component is used as the final IMF component.

[0025] Specifically, adding to discrete Ethernet waveform signals The coefficient of the second increase is White noise, let the first The white noise added next is , Then it is possible to construct a method for the original signal. Noise-added signal:

[0026] in, This is a noisy signal.

[0027] set up Indicates to After performing EMD decomposition, extract the operator for its first-order IMF, then the... The first-order IMF component after adding white noise is:

[0028] in, For the first The first-order IMF component after adding white noise.

[0029] Then to The IMF calculated with added noise is averaged to obtain the first-order final IMF component:

[0030] in, This is the first-order final IMF component.

[0031] First-order residual Calculate the difference between the original signal and the first-order final IMF component:

[0032] in, For the first-order residual, For the first Ethernet waveform signal.

[0033] IMF components Extraction. First, for the... Sub-white noise Perform EMD decomposition and extract the first... The first modal component is denoted as: Then, the noise mode component is added to the previous residual to construct the second noise mode component. Rank, number The signal after adding noise:

[0034] Then the first The first time white noise was added The order IMF components are:

[0035] in, For the first The first time white noise was added IMF components of order.

[0036] Then to The IMF calculated with added noise is averaged to obtain the first... Final IMF component:

[0037] F-decomposition termination condition: All extracted IMF components and the final residual The sum is consistent with the original signal, that is, the discrete train Ethernet waveform signal can be reconstructed after all IMF components are superimposed with the final residual, expressed as:

[0038] S2. Calculate the overall quality score based on the final IMF components. Based on the overall quality score and a preset scoring threshold, filter out the valid IMF components. Generate the signal to be processed based on all valid IMF components and the discrete train Ethernet waveform signal. A comprehensive quality score is calculated based on the final IMF components. Valid IMF components are then selected based on the comprehensive quality score and a score threshold, including: Set a sampling window, and sample the final IMF component according to the sampling window to obtain the sampled IMF component; The energy contribution rate is calculated based on the sampled IMF components; The correlation coefficient is calculated based on the covariance and standard deviation of the sampled IMF components and the standard deviation of the Ethernet waveform signal. Calculate the kurtosis within the sampling window based on the sampled IMF components; The energy contribution rate, correlation coefficient and kurtosis are weighted and summed to obtain the comprehensive quality score. All comprehensive quality scores are averaged to obtain the average comprehensive quality score. The final IMF component with an average overall quality score greater than the scoring threshold is considered the effective IMF component.

[0039] Specifically, the extracted IMF components are evaluated and screened based on indicators such as energy contribution rate, correlation coefficient, and kurtosis to obtain signals for subsequent processing.

[0040] The formula for calculating the energy contribution rate is:

[0041] in, As for energy contribution rate, Indicates The local analysis window is the starting point. Display window Sampling points within, To sample IMF components, For the first The sampling values ​​of the first-order IMF component within the sampling window, This represents the total order of all IMF components after EMD decomposition. This is the loop variable for summing all IMF components.

[0042] The formula for calculating the correlation coefficient is:

[0043] in, This indicates the calculation of covariance. This indicates the calculation of standard deviation. This represents the sampled Ethernet waveform signal. The correlation coefficient.

[0044] The formula for calculating kurtosis is:

[0045] in, for cliff, The mean, As expected.

[0046] The overall quality score is expressed as:

[0047] in, For the overall quality score, , as well as As weight,

[0048] For all sampling points, calculate the average overall quality score:

[0049] in, The average overall quality score, The number of samples.

[0050] like Then the corresponding IMF component is retained, where surface Show scoring threshold Ethernet waveform signal Together with all the retained IMF components, they form a signal for subsequent processing, denoted as . .

[0051] S3. Extract the signal features of the signal to be processed to construct a high-dimensional feature matrix. Perform a first round of coarse feature screening on the high-dimensional feature matrix through chi-square test to obtain a set of screened signal features. Evaluate the importance of each signal feature based on the set of screened signal features. Iteratively eliminate the signal features with the lowest importance until the number of remaining signal features reaches a preset value to obtain the optimal set of important features. Specifically, signal features include time-domain features and frequency-domain features. Time-domain features include mean, standard deviation, peak-to-peak value, root mean square value, and skewness. Frequency-domain features include average amplitude of the spectrum, maximum amplitude of the spectrum, and variance of the amplitude of the spectrum. Before extracting frequency-domain features, the time-domain signal is converted into a frequency-domain signal through Discrete Fourier Transform.

[0052] Signal features of the signal to be processed are extracted to construct a high-dimensional feature matrix. First, a chi-square test is used to perform a coarse screening of the high-dimensional feature matrix, resulting in a filtered signal feature set. Based on the filtered signal feature set, the importance of each signal feature is determined, including: Normalize the high-dimensional feature matrix to obtain the normalized feature matrix; Divide the features in the normalized feature matrix into B intervals according to their value ranges, and obtain the i-th feature in the normalized feature matrix within each interval. The normalized feature belongs to the first... c Observation frequency for each fault category; The number is calculated based on the observation frequency. Chi-square statistics of each normalized feature; Based on the chi-square statistics, all normalized features in the normalized feature matrix are coarsely filtered, retaining the top features. The normalized features form the feature set for screening signals; The selected signal feature set is input into the learner to obtain the importance score matrix, which consists of multiple importance scores, each of which corresponds to the importance of a normalized feature.

[0053] Specifically, the extracted signal is processed into a vector, represented as follows: ,in, If we denote the feature dimension, then all feature vectors are: ,in, This represents the set of all feature vectors corresponding to the nth original signal. Represents the first dimension of D 1 eigenvector Represents a high-dimensional feature matrix. Let T represent the Nth feature vector set, and T be the transpose.

[0054] Let the first The category label for each sample (Ethernet waveform signal) is ,in Let represent the total number of fault categories (including normal categories). Then, the label vector for all samples is: , For the first N The label vector of each sample.

[0055] First, a chi-square test is used for the initial feature screening.

[0056] For high-dimensional features Perform normalization to obtain the feature matrix. This is to meet the chi-square test's requirement for non-negative inputs. Representation of the characteristic matrix The Middle The first sample feature.

[0057] The feature value range [0,1] is divided into equal-width regions. a range, that is , ∈B, for the first The first feature, the first The data in the nth interval satisfy the condition that it is the nth interval. The observation frequency of each category is (the first category) In terms of the characteristic, it falls into the first There are intervals and the category is (Actual sample size)

[0058] in, This represents the observation frequency.

[0059] The features are ranked according to the calculated chi-square statistics, and the top-ranked features are selected. We obtain the feature set of the selected signal by considering several features, denoted as [feature set]. ,in This represents the remaining feature dimensions after the initial screening.

[0060] Then, RFE is used for a second feature selection.

[0061] Select a learner and use ( ) indicates that the base learner can be an algorithm such as Support Vector Machine, Random Forest, or Linear Regression. In the RFE process, the original feature set is denoted as . , The first after coarse screening Individual signal characteristics.

[0062] Step 1: Obtain the importance score vector based on the base learner. : And based on this, identify the features with the least importance:

[0063] in, Importance score vector One of the first The importance of each feature , The index of the feature with the least importance.

[0064] Step 2: Remove the least important features from the feature set to generate a new feature set.

[0065] in, The feature with the least importance, This is the new feature set generated after the removal.

[0066] According to the new Repeat steps 1 and 2 until the number of remaining features reaches the preset target value, thus obtaining the filtered feature set. ,in This indicates the feature dimensions after filtering.

[0067] S4. Data augmentation is performed on the optimal importance feature set using a double random mask to generate two sets of augmented features, namely the first augmented feature and the second augmented feature. The first augmented feature is dilated and pooled by TCN to obtain the first pooled feature. The second augmented feature is input into the MLP network and pooled to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature. Data augmentation is performed on the optimal importance feature set using a double random mask, generating two sets of augmented features: a first augmented feature and a second augmented feature. The first augmented feature is then subjected to TCN dilated convolution and pooling to obtain the first pooled feature. The second augmented feature is input into an MLP network for feature extraction and pooling to obtain the second pooled feature. The first and second pooled features are then fused to obtain the fused feature, which includes: Set a first random mask matrix and a second random mask matrix. Obtain a first enhanced feature based on the importance feature set and the first random matrix. Obtain a second enhanced feature based on the importance feature set and the second random matrix. The first enhanced feature is subjected to TCN dilated convolution and pooling to obtain the first pooled feature. The second enhanced feature is input into MLP and then pooled to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature.

[0068] Specifically, the first random mask matrix and the second random mask matrix follow a probability of A random matrix with a Bernoulli distribution, where the element value is 0 or 1, and the dimension and feature set. Consistent.

[0069] The first and second enhancement features are generated as follows:

[0070]

[0071] in, The first random mask matrix, This is the second random mask matrix. This indicates element-wise multiplication. As the first enhancement feature, for Second enhancement feature.

[0072] As input to the TCN branch, As input to the MLP.

[0073] Using a TCN-MLP hybrid encoder, local and global relationships of features are learned.

[0074] For the TCN branch, a two-layer one-dimensional dilated convolution structure is adopted. The basic calculation form of a single-layer dilated convolution is as follows:

[0075] in, Indicates the TCN branch number The output of layer neurons, = ; Indicates the TCN branch number The weights of layer neurons, Indicates the TCN branch number Bias terms of layer neurons; Represents a non-linear activation function; Indicates the TCN branch number The coefficient of thermal expansion of the layer.

[0076] After two layers of dilated convolution, the output is pooled to obtain the output of the TCN branch:

[0077] in, Represents the pooling function. Indicates the TCN branch number The output of layer neurons, This is the first pooling feature.

[0078] The MLP branch receives the enhanced signal in parallel with the TCN branch. This is used to uncover global nonlinear combination relationships between various feature dimensions. An MLP branch can be represented as:

[0079] in, Indicates the MLP branch number The output of layer neurons, = , Indicates the MLP branch number The weights of layer neurons, Indicates the MLP branch number Bias terms for layer neurons.

[0080] After passing through the MLP, its output is pooled to obtain the output of the MLP branch:

[0081] in, Indicates the number of layers in the MLP. This is the second pooling feature.

[0082] Then, output the TCN branch. With MLP branch output The features are concatenated and then combined through a fusion mapping layer to obtain unified features.

[0083]

[0084] in, For splicing features, This indicates the fusion characteristics after fusion. This represents the weights of neurons in the fusion mapping layer. This represents the bias term of the fusion mapping neuron.

[0085] S5. Construct a fault category center matrix. Update the corresponding category centers in the fault category center matrix according to the fault category to which the fused feature belongs to obtain updated category centers. Calculate the posterior probability based on the similarity between the updated category centers and the quality inspection of the fused feature. Calculate the fusion cross-entropy loss based on the posterior probability and the true fault label. Specifically, a dynamic class center maintenance mechanism is introduced to calculate the loss function based on VarCN contrastive learning.

[0086] Construction dimension Category center matrix ( , (representing fault category and feature dimension respectively), matrix elements are: Represents a class center for a fault. .

[0087] Momentum updates for class centers are performed using an exponential moving average method.

[0088] in, The momentum coefficient representing the update of the class center. Indicates the first in the current batch Number of class samples For the first A fusion feature, To update the category center. Next... Normalization process:

[0089] in, For normalized normalization, It is a 2-norm.

[0090] Then, input features With normalized centers of each category Perform inner product calculations and check the base temperature. Scaling and Softmax transformation yield the first... The sample belongs to the first Posterior probability of class :

[0091] in, For posterior probability, Indicates the first The class center of each fault. This represents the total number of fault categories.

[0092] From this, the posterior probabilities of all categories can be obtained. , Let be the posterior probability of the Cth fault category, and further, a fused cross-entropy loss can be constructed. :

[0093] in, Indicates the first The label of each sample is When the value is 1, it is 1; otherwise, it is 0.

[0094] S6. Adaptively generate temperature coefficient and smooth label distribution based on posterior probability. Calculate KL divergence loss based on the smooth label distribution and posterior probability. Weight the fusion cross-entropy loss and KL divergence loss to obtain contrastive learning loss. Temperature coefficients and smoothed label distributions are adaptively generated based on posterior probabilities, including: Set the maximum and minimum temperatures for adaptive temperature control; The temperature coefficient is obtained based on the posterior probability, the maximum temperature value, and the minimum temperature value. The smoothing coefficient is obtained based on the temperature coefficient and the maximum temperature. The smoothed tag distribution is obtained based on the smoothing coefficient and the fault category corresponding to the Ethernet waveform signal.

[0095] Specifically, firstly based on this posterior probability Building an adaptive temperature .

[0096]

[0097] in , These represent the maximum and minimum temperatures for adaptive temperature control, respectively. Furthermore, an adaptive label smoothing coefficient is constructed. :

[0098] Obtain smooth target distribution :

[0099] in, Indicates the first The label (fault category) for each sample is: , This represents the total number of fault categories.

[0100] Therefore, predict the posterior probability. With smooth target distribution The KL divergence loss between them is:

[0101] in, KL divergence loss The final contrastive learning loss.

[0102]

[0103] in, To compare learning loss, The weights are the KL divergence loss weights.

[0104] S7. Based on the prediction confidence interval, a candidate pool of difficult samples is selected, and anchor samples and candidate negative samples are divided from it. Combining cosine similarity and sample variance, the reliability weight of candidate negative samples is calculated to construct a weighted contrast loss for difficult negative samples. Specifically, the sample prediction confidence interval can be set by the user. After the model has been trained to a certain stage, in order to avoid interference from high-noise samples (poor posterior probability, i.e., low confidence) and simple redundant samples (poor posterior probability, i.e., high confidence), the samples are sorted according to the posterior probability, and only samples in the middle interval are retained to form a difficult sample candidate pool.

[0105] Let the set of candidate negative samples in the hard sample candidate pool be . The anchor point sample set is For the first The anchor point sample and the first Given 10 candidate negative samples, calculate their cosine similarity. :

[0106] in, To prevent extremely small positive numbers with a denominator of zero.

[0107] Further calculate the sample reliability weights:

[0108] in, Indicates the first The average variance of the candidate negative samples ( The larger the value, the higher the uncertainty of the candidate negative sample; therefore, the weight of that sample should be reduced. Represents the set of candidate negative samples The One sample; and Represents the coefficient. Represents reliability weight, For the first The anchor point sample and the first Cosine similarity of candidate negative samples.

[0109] Calculate the weighted contrast loss for hard-to-bear samples based on the sample reliability weights:

[0110] in, Indicates the size of the anchor point sample set. Represents the coefficient.

[0111] S8. Randomly select two groups of samples from the difficult sample candidate pool. Generate latent features based on the sample angle between the two groups of samples and the two groups of samples. Determine the fault category corresponding to the latent features based on the fault category to which the two groups of samples belong. Calculate the sample interpolation cross-entropy loss of the latent features based on the fault category corresponding to the latent features. Two sets of samples are randomly selected from the hard sample candidate pool. Based on the angle between the two sets of samples and the two sets of samples themselves, latent features are generated. The fault category corresponding to the latent features is determined based on the fault category of the two sets of samples. The sample interpolation cross-entropy loss of the latent features is calculated based on the fault category corresponding to the latent features, including: Two groups of samples are randomly selected from the difficult sample candidate pool, namely the first sample and the second sample; Calculate the angle between the first sample and the second sample; Calculate latent features based on the sample angle, the first sample, and the second sample; If the fault categories of the first sample and the second sample are the same, then the fault category of the first sample is taken as the fault category of the latent feature. If the fault categories of the first sample and the second sample are different, the fault category of the latent feature is calculated based on the fault category of the first sample, the fault category of the second sample, and the interpolation coefficient. Based on the fault category of the latent feature and the probability that the latent feature is predicted as the correct fault category by the prediction model, the sample cross-entropy loss of the latent feature is obtained.

[0112] Specifically, the latent space spherical linear interpolation augmentation method is used to expand the sample distribution near the fault category boundary.

[0113] From the difficult sample candidate pool Two samples were selected from the first samples to participate in the interpolation calculation. Second Sample First, calculate the included angle between them. :

[0114] in, To prevent extremely small positive numbers with a denominator of zero.

[0115] Then, spherical linear interpolation is used to generate synthetic latent features:

[0116] in, These are the interpolation coefficients. .

[0117] if = That is, interpolating between similar samples, then the latent features tags = ;if That is, interpolating from out-of-class samples, then the latent features The tags are:

[0118] Calculate the cross-entropy loss of the latent features:

[0119] in, This represents the total number of potential features generated in one training iteration.

[0120] Indicates the first The potential features were predicted by the prediction model as follows: Probability of class:

[0121] in, This indicates the category header.

[0122] Indicates the first The potential feature in the first The supervised label values ​​on the class samples. If it is a class-based interpolation,

[0123] If it is a heterogeneous interpolation

[0124] If the sample belong Class samples, then ,otherwise If the sample belong Class samples, then ,otherwise .

[0125] S9. The contrastive learning loss, the hard-to-bear sample weighted contrastive loss, and the sample interpolation cross-entropy loss are weighted and summed to obtain the total model loss. Based on the total model loss, the prediction model to be trained is iteratively optimized through the backpropagation algorithm to obtain the optimized prediction model after training. Therefore, after training to a certain stage, the final contrastive learning loss function becomes:

[0126] in, This indicates the weight of the loss term.

[0127] S10. Acquire the actual Ethernet waveform signal of the train on site, input the actual Ethernet waveform signal into the optimization prediction model, and output the fault category of the train on site.

[0128] An Ethernet fault diagnosis system based on feature-enhanced contrastive learning includes: The signal decomposition module is used to acquire multiple sets of discrete train Ethernet waveform signals to be trained, add white noise to the original waveform signals to construct a noisy signal, extract multi-order IMF components from the noisy signal through multiple rounds of EMD decomposition and update the residuals synchronously, until the original Ethernet waveform signal can be recovered by superimposing all IMF components with the final residuals, and then the decomposition stops to obtain the final IMF components. The modal filtering module is used to calculate the comprehensive quality score based on the final IMF components, filter valid IMF components according to the comprehensive quality score and the score threshold, and generate a signal to be processed based on all valid IMF components and Ethernet waveform signals. The feature simplification module is used to extract signal features of the signal to be processed and construct a high-dimensional feature matrix. First, the high-dimensional feature matrix is ​​subjected to a chi-square test to complete the first round of coarse feature screening to obtain a set of filtered signal features. The importance of each signal feature is obtained based on the set of filtered signal features. The signal features with the lowest importance are cyclically removed until the number of features reaches a preset value to obtain the optimal set of important features. The feature fusion encoding module is used to perform data augmentation on the optimal importance feature set using a double random mask, generating two sets of augmented features, namely the first augmented feature and the second augmented feature. The first augmented feature is dilated and pooled by TCN to obtain the first pooled feature. The second augmented feature is input into the MLP network and pooled to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature. The category center update module is used to construct the fault category center matrix, update the category centers in the fault category center matrix according to the fusion features to obtain the updated category centers, calculate the posterior probability based on the updated category centers and the fusion features, and obtain the fusion cross-entropy loss based on the posterior probability. The basic contrastive loss calculation module is used to adaptively generate the temperature coefficient and smooth the label distribution based on the posterior probability, obtain the KL divergence loss based on the smoothed target distribution and the posterior probability, and obtain the contrastive learning loss by weighted summation of the fused cross-entropy loss and the KL divergence loss. The variance-aware hard negative sample mining module is used to filter the candidate pool of hard samples based on the sample prediction confidence interval, divide anchor samples and candidate negative samples, calculate the reliability weight of negative samples by combining cosine similarity with sample variance, and construct the weighted contrast loss of hard negative samples. The latent space interpolation augmentation module is used to randomly select two sets of samples from the hard sample candidate pool, generate latent features based on the sample angle between the two sets of samples and the two sets of samples, match the fault category of the latent features according to the fault category of the two sets of samples, and calculate the sample interpolation cross-entropy loss of the latent features based on the fault category of the latent features. The model training optimization module is used to sum the contrastive learning loss, the hard-negative sample weighted contrastive loss, and the interpolation cross-entropy loss to obtain the total model loss. Based on the total loss, the prediction model is iteratively optimized through backpropagation to obtain the optimized prediction model after training. The fault diagnosis output module is used to acquire the actual Ethernet waveform signal of the train on site, input the actual Ethernet waveform signal into the optimization prediction model, and output the fault category of the train on site.

[0129] This application also discloses a terminal device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor loads and executes the computer program, it employs an Ethernet fault diagnosis method based on feature-enhanced contrastive learning.

[0130] The terminal device can be a computer device such as a desktop computer, a laptop computer, or a cloud server. The terminal device includes, but is not limited to, a processor and a memory. For example, the terminal device may also include input / output devices, network access devices, and buses.

[0131] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it.

[0132] The memory can be an internal storage unit of the terminal device, such as a hard disk or RAM of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) equipped on the terminal device. Furthermore, the memory can be a combination of internal storage units and external storage devices of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.

[0133] In this terminal device, an Ethernet fault diagnosis method based on feature enhancement contrastive learning from the above embodiments is stored in the terminal device's memory and loaded and executed on the terminal device's processor for convenient use.

[0134] This application also discloses a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it employs an Ethernet fault diagnosis method based on feature enhancement contrastive learning as described in the above embodiments.

[0135] The computer program can be stored in a computer-readable medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or certain middleware. The computer-readable medium includes any entity or device capable of carrying computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the computer-readable medium includes, but is not limited to, the above-mentioned components.

[0136] In this computer-readable storage medium, an Ethernet fault diagnosis method based on feature enhancement contrastive learning in the above embodiments is stored in the computer-readable storage medium and loaded and executed on the processor to facilitate the storage and application of the above method.

[0137] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.

[0138] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.

Claims

1. An Ethernet fault diagnosis method based on feature-enhanced contrastive learning, characterized in that, include: Multiple sets of discrete train Ethernet waveform signals to be trained and their corresponding real fault labels are obtained. White noise is superimposed on the discrete train Ethernet waveform signals to construct a noisy signal. The noisy signal is decomposed and iterated through multiple rounds of EMD to extract multi-order IMF components and update the residuals synchronously. The discrete train Ethernet waveform signals can be reconstructed after all IMF components are superimposed with the final residuals. The decomposition is then stopped, and the final IMF components are obtained. The overall quality score is calculated based on the final IMF components. Valid IMF components are selected based on the overall quality score and the preset score threshold. The signal to be processed is generated based on all valid IMF components and the discrete train Ethernet waveform signal. The signal features of the signal to be processed are extracted to construct a high-dimensional feature matrix. The high-dimensional feature matrix is ​​subjected to the first round of coarse feature screening through the chi-square test to obtain a set of screened signal features. The importance of each signal feature is evaluated based on the set of screened signal features. The signal features with the lowest importance are iteratively eliminated until the number of remaining signal features reaches a preset value, and the optimal set of important features is obtained. Data augmentation is performed on the optimal importance feature set using a double random mask, generating two sets of augmented features, namely the first augmented feature and the second augmented feature. The first augmented feature is processed by TCN dilated convolution and pooling to obtain the first pooled feature. The second augmented feature is input into the MLP network for feature extraction and pooling to obtain the second pooled feature. The first pooled feature and the second pooled feature are then fused to obtain the fused feature. Construct a fault category center matrix. Update the corresponding category centers in the fault category center matrix according to the fault category to which the fused feature belongs to obtain updated category centers. Calculate the posterior probability based on the similarity between the updated category centers and the quality inspection of the fused feature. Calculate the fusion cross-entropy loss based on the posterior probability and the true fault label. The temperature coefficient and smooth label distribution are adaptively generated based on the posterior probability. The KL divergence loss is calculated based on the smooth label distribution and the posterior probability. The cross-entropy loss and the KL divergence loss are weighted and summed to obtain the contrastive learning loss. The candidate pool of difficult samples is selected based on the prediction confidence interval, and anchor samples and candidate negative samples are divided from it. The reliability weight of candidate negative samples is calculated by combining cosine similarity and sample variance to construct the weighted contrast loss of difficult negative samples. Two sets of samples are randomly selected from the difficult sample candidate pool. Based on the sample angle between the two sets of samples and the two sets of samples, latent features are generated. Based on the fault categories to which the two sets of samples belong, the fault category corresponding to the latent features is determined. Based on the fault category corresponding to the latent features, the sample interpolation cross-entropy loss of the latent features is calculated. The contrastive learning loss, the hard-to-bear sample weighted contrastive loss, and the sample interpolation cross-entropy loss are weighted and summed to obtain the total model loss. Based on the total model loss, the prediction model to be trained is iteratively optimized through the backpropagation algorithm to obtain the optimized prediction model after training. The actual Ethernet waveform signal of the train at the scene is collected, and the actual Ethernet waveform signal is input into the optimization prediction model to output the fault category of the train at the scene.

2. The Ethernet fault diagnosis method based on feature-enhanced contrastive learning according to claim 1, characterized in that, The noisy signal is iteratively decomposed through multiple rounds of EMD to extract multi-order IMF components and the residuals are updated synchronously until all IMF components are superimposed with the final residuals to reconstruct the discrete train Ethernet waveform signal. The decomposition then stops. This process includes: The noisy signal is decomposed into several IMF components by performing multiple rounds of EMD decomposition. The average IMF component is obtained by averaging several IMF components. The residual is obtained based on the noisy signal and the average IMF component; Continuously add white noise to the noisy signal until the first step is executed. After EMD decomposition, the first wheel obtained The average IMF component and the first When the sum of the nth residuals is the same as the original signal, stop the decomposition and proceed to the nth... The average IMF component is used as the final IMF component.

3. The Ethernet fault diagnosis method based on feature-enhanced contrastive learning according to claim 1, characterized in that, The process of calculating a comprehensive quality score based on the final sampled IMF components, and then filtering out valid IMF components based on the comprehensive quality score and a preset scoring threshold, includes: Set a sampling window, and sample the final IMF component according to the sampling window to obtain the sampled IMF component; Based on the sampled IMF components; The energy contribution rate is calculated based on the sampled IMF components. The correlation coefficient is calculated based on the covariance and standard deviation of the sampled IMF components and the standard deviation of the Ethernet waveform signal. Calculate the kurtosis within the sampling window based on the sampled IMF components; The energy contribution rate, correlation coefficient, and kurtosis are weighted and summed to obtain the comprehensive quality score; The final IMF component with a comprehensive quality score greater than the scoring threshold is considered as a valid IMF component.

4. The Ethernet fault diagnosis method based on feature-enhanced contrastive learning according to claim 1, characterized in that, The process involves extracting signal features from the signal to be processed to construct a high-dimensional feature matrix. A chi-square test is then used to perform a preliminary screening of the high-dimensional feature matrix, resulting in a selected signal feature set. Based on this selected signal feature set, the importance of each signal feature is evaluated, including: Normalize the high-dimensional feature matrix to obtain the normalized feature matrix; Divide the features in the normalized feature matrix into B intervals according to their value ranges, and obtain the i-th feature in the normalized feature matrix within each interval. The normalized feature belongs to the first... c Observation frequency for each fault category; The number is calculated based on the observation frequency. Chi-square statistics of each normalized feature; Based on the chi-square statistics, all normalized features in the normalized feature matrix are coarsely filtered, retaining the top features. The normalized features form the feature set for screening signals; The selected signal feature set is input into the learner to obtain an importance score matrix, which consists of multiple importance scores, each of which corresponds to the importance of a normalized feature.

5. The Ethernet fault diagnosis method based on feature-enhanced contrastive learning according to claim 1, characterized in that, The optimal importance feature set is augmented using a double random mask to generate two sets of augmented features: a first augmented feature and a second augmented feature. The first augmented feature is then subjected to TCN dilated convolution and pooling to obtain a first pooled feature. The second augmented feature is input into an MLP network and pooled to obtain a second pooled feature. The first pooled feature and the second pooled feature are then fused to obtain a fused feature, including: Set a first random mask matrix and a second random mask matrix, obtain a first enhanced feature based on the importance feature set and the first random matrix, and obtain a second enhanced feature based on the importance feature set and the second random matrix; The first enhanced feature is subjected to TCN dilated convolution and pooling to obtain the first pooled feature. The second enhanced feature is input into MLP and then pooled to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature.

6. The Ethernet fault diagnosis method based on feature-enhanced contrastive learning according to claim 1, characterized in that, The adaptive generation of temperature coefficients and smooth label distribution based on posterior probability includes: Set the maximum and minimum temperatures for adaptive temperature control; The temperature coefficient is obtained based on the posterior probability, the maximum temperature value, and the minimum temperature value. Based on the temperature coefficient and the maximum temperature, the smoothing coefficient is obtained; The smoothed tag distribution is obtained based on the smoothing coefficient and the fault category corresponding to the Ethernet waveform signal.

7. The Ethernet fault diagnosis method based on feature-enhanced contrastive learning according to claim 1, characterized in that, The process involves randomly selecting two groups of samples from a difficult sample candidate pool, generating latent features based on the angle between the two groups and the samples themselves, determining the fault category corresponding to the latent features based on the fault categories of the two groups, and calculating the sample interpolation cross-entropy loss of the latent features based on the fault categories corresponding to the latent features. This includes: Two groups of samples are randomly selected from the difficult sample candidate pool, namely the first sample and the second sample; Calculate the angle between the first sample and the second sample; Calculate the latent features based on the sample angle, the first sample, and the second sample; If the fault categories of the first sample and the second sample are the same, then the fault category of the first sample is taken as the fault category of the latent feature. If the fault categories of the first sample and the second sample are different, the fault category of the latent feature is calculated based on the fault category of the first sample, the fault category of the second sample, and the interpolation coefficient. Based on the fault category of the latent feature and the probability that the latent feature is predicted as the correct fault category by the prediction model, the sample cross-entropy loss of the latent feature is obtained.

8. An Ethernet fault diagnosis system based on feature-enhanced contrastive learning, characterized in that, include: The signal decomposition module is used to acquire multiple sets of discrete train Ethernet waveform signals to be trained and their corresponding real fault labels. White noise is superimposed on the discrete train Ethernet waveform signals to construct a noisy signal. The noisy signal is then iteratively decomposed through multiple rounds of EMD to extract multi-order IMF components and update the residuals synchronously. The discrete train Ethernet waveform signals can be reconstructed after all IMF components are superimposed with the final residuals, at which point the decomposition stops and the final IMF components are obtained. The modal filtering module is used to calculate the comprehensive quality score based on the final IMF components, filter out the effective IMF components according to the comprehensive quality score and the preset scoring threshold, and generate the signal to be processed according to all the effective IMF components and the discrete train Ethernet waveform signal. The feature simplification module is used to extract signal features of the signal to be processed to construct a high-dimensional feature matrix. The high-dimensional feature matrix is ​​subjected to the first round of coarse feature screening through chi-square test to obtain a set of screened signal features. The importance of each signal feature is evaluated based on the set of screened signal features. The signal features with the lowest importance are iteratively eliminated until the number of remaining signal features reaches a preset value, and the optimal set of important features is obtained. The feature fusion encoding module is used to perform data augmentation on the optimal importance feature set using a double random mask, generating two sets of augmented features, namely the first augmented feature and the second augmented feature. The first augmented feature is processed by TCN dilated convolution and pooling to obtain the first pooled feature. The second augmented feature is input into the MLP network for feature extraction and pooling to obtain the second pooled feature. The first pooled feature and the second pooled feature are fused to obtain the fused feature. The category center update module is used to construct a fault category center matrix. According to the fault category to which the fused feature belongs, the corresponding category center in the fault category center matrix is ​​updated to obtain the updated category center. Based on the updated category center and the similarity of the fused feature quality inspection, the posterior probability is calculated. Based on the posterior probability and the real fault label, the fusion cross-entropy loss is calculated. The temperature coefficient and smooth label distribution are adaptively generated based on the posterior probability. The KL divergence loss is calculated based on the smooth label distribution and the posterior probability. The cross-entropy loss and the KL divergence loss are weighted and summed to obtain the contrastive learning loss. The variance-aware hard negative sample mining module is used to filter the candidate pool of hard samples based on the prediction confidence interval, and divide the anchor sample and candidate negative sample from it. Combining cosine similarity and sample variance, the reliability weight of the candidate negative sample is calculated to construct the hard negative sample weighted contrast loss. The latent space interpolation augmentation module is used to randomly select two groups of samples from the difficult sample candidate pool, generate latent features based on the sample angle between the two groups of samples and the two groups of samples, determine the fault category corresponding to the latent features based on the fault category to which the two groups of samples belong, and calculate the sample interpolation cross-entropy loss of the latent features based on the fault category corresponding to the latent features. The model training optimization module is used to sum the contrastive learning loss, the hard-to-bear sample weighted contrastive loss, and the sample interpolation cross-entropy loss to obtain the total model loss. Based on the total model loss, the backpropagation algorithm is used to iteratively optimize the prediction model to be trained to obtain the optimized prediction model after training. The fault diagnosis output module is used to acquire the actual Ethernet waveform signal of the train on site, input the actual Ethernet waveform signal into the optimization prediction model, and output the fault category of the train on site.

9. A terminal device, comprising a memory and a processor, characterized in that, The memory stores a computer program that can run on a processor, and when the processor loads and executes the computer program, it employs the method described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is loaded and executed by the processor, it employs the method described in any one of claims 1 to 7.