Early fault diagnosis method and related equipment for new energy vehicle motor based on meta-learning and twin network

By combining meta-learning and Siamese network-based methods with multi-source signal processing and incremental learning, the problems of small samples, weak signals, and complex operating conditions in the early fault diagnosis of motors in new energy vehicles are solved, achieving high-precision fault identification and early warning of unknown faults.

CN123049336APending Publication Date: 2026-11-06WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611045919.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing technologies for early fault diagnosis of motors in new energy vehicles suffer from problems such as low diagnostic accuracy under small sample conditions, difficulty in identifying weak fault signals, insufficient adaptability to complex operating conditions, and difficulty in identifying unknown and novel faults.

Method used

A method based on meta-learning and Siamese networks is adopted. A standardized multi-source signal matrix is ​​constructed through multi-source signal acquisition and preprocessing. Meta-tasks are formed by using sliding window slicing. Sample embedding vector mapping is performed by combining multi-scale convolutional neural networks and relational networks. The comprehensive similarity is calculated and loss weighted update is performed by combining Euclidean distance to realize fault identification and early warning. The model is updated through incremental learning.

Benefits of technology

It achieves high-precision diagnosis of early faults in new energy vehicle motors under small sample, variable operating conditions and weak signal conditions. It can identify unknown new faults and continuously learn incrementally, thus improving the accuracy and adaptability of diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123049336A_ABST
    Figure CN123049336A_ABST
Patent Text Reader

Abstract

This application provides a method and related equipment for early fault diagnosis of new energy vehicle motors based on meta-learning and Siamese networks, belonging to the field of new energy vehicle fault diagnosis technology. The method includes: obtaining an aligned, standardized multi-source signal matrix; forming a meta-task; inputting the support set and query set into a multi-scale convolutional neural network with shared weights, and weightedly fusing similarity scores and Euclidean distance to obtain a comprehensive similarity; weighted summing of the meta-task loss and contrastive loss to obtain a total loss, and inversely updating the parameters of the multi-scale convolutional neural network and the relational network; inputting the test sample into the updated multi-scale convolutional neural network to obtain the test sample embedding vector; when the test sample comes from a new class set or the maximum average comprehensive similarity is lower than a preset threshold, it is judged as an unknown novel fault and an early warning is triggered; constructing a meta-task containing both new and old categories to obtain the current early fault diagnosis result of the motor. This application can identify unknown novel faults and continuously perform incremental learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of fault diagnosis technology for new energy vehicles, and in particular to a method and related equipment for early fault diagnosis of new energy vehicle motors based on meta-learning and twin networks. Background Technology

[0002] In related technologies, motor fault diagnosis methods are mainly divided into: 1) Signal processing-based methods rely on manual feature engineering and have limited sensitivity to early, subtle faults. 2) Traditional machine learning-based methods are limited by feature quality and have weak generalization ability. 3) Deep learning-based methods can automatically extract deep features, but they heavily rely on a large amount of labeled data.

[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention

[0004] The main objective of this application is to propose a method and related equipment for early fault diagnosis of new energy vehicle motors based on meta-learning and twin networks. This method can achieve high-precision diagnosis of early weak faults in new energy vehicle motors under small sample sizes and varying operating conditions, and can also identify unknown new faults and continuously learn incrementally.

[0005] To achieve the above objectives, one aspect of this application proposes a method for early fault diagnosis of new energy vehicle motors based on meta-learning and twin networks, the method comprising the following steps: Collect multi-source signals during the operation of the motor of a new energy vehicle, preprocess the multi-source signals, and obtain an aligned and standardized multi-source signal matrix; The standardized multi-source signal matrix is ​​used to construct a sample set by sliding window slicing, which is divided into a base class set and a new class set. Several fault categories are randomly selected from the base class set, and several samples of each category form a support set and several samples of each category form a query set, thus forming a meta-task. The support set and the query set are input into a multi-scale convolutional neural network with shared weights, which is mapped to the support set sample embedding vector and the query set sample embedding vector. The similarity score is obtained through a relational network, the Euclidean distance is calculated, and the similarity score and the Euclidean distance are weighted and fused to obtain the comprehensive similarity. The prediction probability of the query sample is calculated using the comprehensive similarity, the meta-task loss is obtained by combining the real label, the contrast loss is obtained by using the Euclidean distance, the total loss is obtained by weighted summation of the meta-task loss and the contrast loss, and the parameters of the multi-scale convolutional neural network and the relational network are updated in reverse. The sample to be tested is input into the updated multi-scale convolutional neural network to obtain the embedding vector of the sample to be tested. The average comprehensive similarity between the embedding vector of the sample to be tested and the embedding vector of the support set sample of each category is calculated. The one with the largest similarity is judged as the predicted fault category. When the sample to be tested comes from the new category set or the maximum average comprehensive similarity is lower than the preset threshold, it is judged as an unknown new fault and an early warning is triggered. The samples of the unknown novel faults that have been verified in the new class set are added to the base class set to construct a meta-task containing both new and old classes. The multi-scale convolutional neural network and the relational network are adjusted and updated with an incremental loss that includes regularization constraints to obtain the current early fault diagnosis results of the motor.

[0006] In some embodiments, the step of acquiring multi-source signals during the operation of a new energy vehicle motor, and preprocessing the multi-source signals to obtain an aligned, standardized multi-source signal matrix includes: The three-phase stator current signal is acquired by the Hall current sensor built into the motor controller; Vibration signals are collected by an accelerometer mounted on the motor housing; Temperature signals at the ends of the stator windings and the housing are monitored by temperature sensors pre-embedded inside the motor. The motor speed signal is obtained through the motor's built-in rotary transformer; An adaptive notch filter is used to filter out the fundamental frequency wave of the three-phase stator current signal, and the Parker vector mode is calculated to enhance the fault characteristics, thereby obtaining the enhanced current characteristics. The envelope spectrum of the vibration signal is calculated, the bearing fault impact component is extracted by Morlet wavelet transform, and low-frequency operating condition disturbances are removed to obtain the enhanced vibration characteristics. The shell temperature signal is filtered by moving average to extract a slow change trend that meets preset conditions as a temperature feature; The enhanced current characteristics, the enhanced vibration characteristics, and the temperature characteristics are resampled at equal angles according to the motor speed signal, and time-synchronized according to the speed pulse to obtain a time-aligned multi-source feature sequence. The time-aligned multi-source feature sequence is processed by Z-score normalization. The mean of the original signal value within the time window is subtracted from each original signal value in the time-aligned multi-source feature sequence, and then divided by the standard deviation of the original signal value to obtain the normalized value. The normalized value has a mean of zero and a standard deviation of one, which is used to eliminate quantization differences between different sensors to obtain the standardized multi-source signal matrix.

[0007] In some embodiments, the step of constructing a sample set by sliding window slicing using the standardized multi-source signal matrix, dividing it into a base class set and a new class set, randomly selecting several fault categories from the base class set, with several samples from each category forming a support set, and several samples from each category forming a query set, forms a meta-task, including: The standardized multi-source signal matrix is ​​sliced ​​using a sliding window. Each window extracts a segment of the multi-source signal with a continuous time step as a sample, and all samples constitute a sample set. The sample set is divided into a base class set and a new class set; the base class set includes bearing inner ring faults, outer ring faults, minor demagnetization, and mild inter-turn short circuits, which are used for meta-training; the new class set includes rotor eccentricity, mixed faults, and severe demagnetization, which are used for meta-testing. Several fault categories are randomly selected from the base class set, and several samples are randomly selected from each of the selected fault categories to form a support set; From each of the same fault categories, several samples are randomly selected to form a query set; The support set and the query set together constitute a meta-task; the support set is used to provide reference samples of various faults in the meta-task, and the query set is used to calculate the loss between the model prediction and the true label in the meta-task; the new class set does not participate in the training of the meta-task, but is used to verify the model's ability to identify unknown faults.

[0008] In some embodiments, the step of inputting the support set and the query set into a multi-scale convolutional neural network with shared weights, mapping them to support set sample embedding vectors and query set sample embedding vectors, obtaining similarity scores through a relational network, calculating Euclidean distance, and weightedly fusing the similarity scores and the Euclidean distance to obtain a comprehensive similarity includes: A multi-scale convolutional neural network is configured. The input of the multi-scale convolutional neural network is a two-dimensional matrix formed by splicing the multi-source signals corresponding to the support set samples and the query set samples. The number of channels in the two-dimensional matrix corresponds to the current, vibration, and temperature signal sources. The multi-scale convolutional neural network contains three parallel convolutional branches with kernel sizes of 3x3, 5x5, and 7x7, respectively, which are used to capture fault features at different time scales. Each sample in the support set is input into the multi-scale convolutional neural network and mapped to the support set sample embedding vector corresponding to the sample. Each sample in the query set is input into the multi-scale convolutional neural network and mapped to the corresponding query set sample embedding vector. Each support set sample embedding vector and each query set sample embedding vector are concatenated sequentially into a combined vector. The combined vector is then input into a relational network, which outputs a similarity score between the support set samples and the query set samples. The similarity score ranges from zero to one. Calculate the Euclidean distance between each of the support set sample embedding vectors and each of the query set sample embedding vectors, and calculate the maximum Euclidean distance between all sample pairs; The Euclidean distance is normalized using the maximum Euclidean distance to obtain the normalized Euclidean distance; The similarity score is weighted and fused with the normalized Euclidean distance to obtain the comprehensive similarity between the support set samples and the query set samples.

[0009] In some embodiments, the step of calculating the prediction probability of the query sample using the comprehensive similarity, obtaining the meta-task loss by combining the true label, obtaining the contrast loss using the Euclidean distance, and weighted summing the meta-task loss and the contrast loss to obtain the total loss, and then back-updating the parameters of the multi-scale convolutional neural network and the relational network, includes: Using the comprehensive similarity, a normalized exponential function is used to calculate the prediction probability that each query sample is predicted to be each fault category. The prediction probability is calculated by dividing the value of the exponential function with the natural constant as the base and the comprehensive similarity as the exponent by the sum of the exponential function values ​​of the comprehensive similarity between the query sample and all fault categories. The cross-entropy loss function is used to calculate the meta-task loss by combining the predicted probability of each query sample with the true label of the query sample. The contrast loss is calculated using the Euclidean distance between the support set sample embedding vector and the query set sample embedding vector. The contrast loss is as follows: for sample pairs belonging to the same fault category, the sum of squares of the Euclidean distances is calculated; for sample pairs belonging to different fault categories, the maximum value of the difference between a preset distance threshold and the Euclidean distance compared to zero is calculated, and then the maximum value is squared; the contrast loss is obtained by adding the parts belonging to the same fault category and the parts belonging to different fault categories and multiplying by one-half. The total loss is obtained by weighting and summing the meta-task loss and the comparison loss according to preset weighting coefficients. Using the total loss, the parameters of the multi-scale convolutional neural network and the parameters of the relational network are updated synchronously using the backpropagation algorithm, resulting in updated parameters of the multi-scale convolutional neural network and updated parameters of the relational network.

[0010] In some embodiments, the step of inputting the test sample into the updated multi-scale convolutional neural network to obtain the test sample embedding vector, calculating the average comprehensive similarity between the test sample embedding vector and the support set sample embedding vectors of each category, and taking the largest one as the predicted fault category, and when the test sample comes from the new category set or the largest average comprehensive similarity is lower than a preset threshold, it is judged as an unknown new type of fault and an early warning is triggered, including: The sample to be tested is input into the updated multi-scale convolutional neural network and mapped to the embedding vector of the sample to be tested. For each fault category, calculate the comprehensive similarity between the embedding vector of the sample to be tested and the embedding vectors of all support set samples under that fault category, and then take the average of the comprehensive similarity of all support set samples under that fault category to obtain the average comprehensive similarity between the sample to be tested and the fault category. The average comprehensive similarity of all fault categories is compared, and the fault category with the largest average comprehensive similarity is taken as the predicted fault category of the sample to be tested. The maximum average comprehensive similarity is compared with a preset threshold, and it is determined whether the sample to be tested belongs to the new class set. When the maximum average comprehensive similarity is lower than the preset threshold or the sample to be tested comes from the new class set, the sample to be tested is determined to be an unknown new type of fault, triggering an early warning and suggesting a review.

[0011] In some embodiments, the step of adding the samples of the unknown novel faults in the new class set, after verification, to the base class set, constructing a meta-task containing both new and old classes, and adjusting and updating the multi-scale convolutional neural network and the relational network with an incremental loss that includes regularization constraints to obtain the current early fault diagnosis result of the motor includes: The samples of the unknown new faults that have triggered the warning and have been verified are added to the base class set along with the fault type labels corresponding to the samples of the unknown new faults to form the expanded training set. Resample from the expanded training set, select several fault categories from the old and new categories respectively, and select several samples from each category to form a support set and a query set, and construct an incremental meta-task containing the old and new categories; The incremental loss is calculated using the incremental meta-task; the incremental loss is the sum of the total loss of the incremental meta-task and the regularization constraint term; the regularization constraint term is the sum of the squares of the updated parameters of the multi-scale convolutional neural network minus the parameters before the update, plus the sum of the squares of the updated parameters of the relational network minus the parameters before the update, used to constrain the parameter update magnitude. Using the incremental loss, the parameters of the multi-scale convolutional neural network and the parameters of the relational network are adjusted and updated using the backpropagation algorithm to obtain the adjusted and updated parameters of the multi-scale convolutional neural network and the adjusted and updated parameters of the relational network. The test sample is input into the adjusted and updated multi-scale convolutional neural network and the relational network, and the current early fault diagnosis result of the motor is output; the current early fault diagnosis result of the motor includes the determination of known fault categories or the early warning information of unknown new faults.

[0012] To achieve the above objectives, another aspect of this application proposes an early fault diagnosis system for new energy vehicle motors based on meta-learning and twin networks, used to implement the method described above. The system includes: A multi-source signal acquisition and preprocessing module is used to acquire multi-source signals during the operation of the motor of a new energy vehicle, preprocess the multi-source signals, and obtain an aligned and standardized multi-source signal matrix. The sample construction module is used to construct a sample set by sliding window slicing using the standardized multi-source signal matrix, which is divided into a base class set and a new class set. Several fault categories are randomly selected from the base class set, and several samples of each category constitute a support set and several samples of each category constitute a query set, forming a meta-task. The twin metric network module is used to input the support set and the query set into a multi-scale convolutional neural network with shared weights, map them into support set sample embedding vectors and query set sample embedding vectors, obtain similarity scores through a relational network, calculate Euclidean distance, and weightedly fuse the similarity scores and the Euclidean distance to obtain a comprehensive similarity. The meta-learning training module is used to calculate the prediction probability of the query sample using the comprehensive similarity, obtain the meta-task loss by combining the real label, obtain the contrast loss using the Euclidean distance, and obtain the total loss by weighted summation of the meta-task loss and the contrast loss, and then update the parameters of the multi-scale convolutional neural network and the relational network in reverse. The fault identification and early warning module is used to input the sample to be tested into the updated multi-scale convolutional neural network to obtain the embedding vector of the sample to be tested, calculate the average comprehensive similarity between the embedding vector of the sample to be tested and the embedding vector of the support set samples of each category, and take the largest one as the predicted fault category. When the sample to be tested comes from the new category set or the maximum average comprehensive similarity is lower than the preset threshold, it is judged as an unknown new type of fault and an early warning is triggered. The incremental learning update module is used to add the samples of the unknown new faults in the new class set, which have been verified, to the base class set, construct a meta-task containing the old and new classes, and adjust and update the multi-scale convolutional neural network and the relational network with an incremental loss that has been subject to regularization constraints to obtain the current early fault diagnosis results of the motor.

[0013] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.

[0014] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0015] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.

[0016] The embodiments of this application include at least the following beneficial effects: This application provides a method, system, electronic device, storage medium, and program product for early fault diagnosis of new energy vehicle motors based on meta-learning and Siamese networks. The solution includes: obtaining an aligned, standardized multi-source signal matrix; forming a meta-task; inputting the support set and query set into a multi-scale convolutional neural network with shared weights, and weightedly fusing similarity scores and Euclidean distance to obtain a comprehensive similarity; weighted summing of the meta-task loss and contrastive loss to obtain a total loss, and inversely updating the parameters of the multi-scale convolutional neural network and the relational network; inputting the test sample into the updated multi-scale convolutional neural network to obtain the test sample embedding vector; when the test sample comes from a new class set or the maximum average comprehensive similarity is lower than a preset threshold, it is judged as an unknown novel fault and an early warning is triggered; constructing a meta-task containing both new and old categories to obtain the current early fault diagnosis result of the motor. This application can identify unknown novel faults and continuously perform incremental learning. Attached Figure Description

[0017] Figure 1 This is a flowchart of the early fault diagnosis method for new energy vehicle motors based on meta-learning and twin networks provided in the embodiments of this application; Figure 2 This is a flowchart illustrating the early fault diagnosis method for new energy vehicle motors based on meta-learning and twin networks provided in an embodiment of this application. Figure 3 This is a flowchart of early fault diagnosis for new energy vehicle motors provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0020] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.

[0021] 1) Z-score: A data standardization method, also known as zero-mean standardization.

[0022] 2) PT100 Temperature Sensor: PT100 is a platinum resistance temperature sensor. "PT" stands for platinum, and "100" indicates that its resistance is 100 ohms at zero degrees Celsius.

[0023] 3) Park vector: A mathematical tool for transforming three-phase current signals from a stationary coordinate system to a rotating coordinate system, also known as the Clarke transform.

[0024] 4) Morlet wavelet transform: a time-frequency analysis method that uses Morlet wavelets (a complex exponential wave modulated by a Gaussian function) as basis functions to perform wavelet transform on signals.

[0025] 5) N-way K-shot: This is a task sampling strategy in few-shot learning, used to construct meta-tasks.

[0026] 6) Meta-task: It is the basic training unit in meta-learning, consisting of a support set and a query set.

[0027] 7) Backpropagation algorithm: used to calculate the gradient of the loss function with respect to the parameters of each layer of the network, and update the parameters accordingly to gradually reduce the loss.

[0028] 8) Siamese metric network model: A neural network architecture consisting of two or more branch networks with shared weights, used to learn a similarity metric between samples.

[0029] 9) Multi-scale convolutional neural network: A network structure based on convolutional neural network that extracts features in parallel through multiple convolutional kernels of different sizes, thereby capturing information patterns of different scales (time span or spatial range) in the input data.

[0030] 10) Relational Network: A neural network module specifically designed to learn the similarity measure between samples. Through training, it learns to determine whether two embedded vectors belong to the same category.

[0031] In related technologies, early fault data of new energy vehicle motors is extremely scarce, which leads to a significant decrease in the diagnostic accuracy of existing methods under small sample conditions, making it impossible to solve the dual challenges of small sample constraints and weak feature recognition at the same time.

[0032] In view of this, this application provides a method and related equipment for early fault diagnosis of new energy vehicle motors based on meta-learning and twin networks. This solution aims to solve the following technical problems in the early weak fault diagnosis of new energy motors: 1) Fault data is scarce under small sample conditions, making it difficult for diagnostic models to achieve high accuracy; 2) Weak fault signals have small amplitude and low signal-to-noise ratio, making it difficult for diagnostic models to effectively extract fault features; 3) The motor operating conditions are complex and changeable, resulting in insufficient adaptability of diagnostic models across operating conditions; 4) Traditional classification models can only identify known fault types, making it difficult for them to identify new faults.

[0033] Figure 1 This is an optional flowchart of an early fault diagnosis method for new energy vehicle motors based on meta-learning and twin networks provided in this application embodiment. Figure 1 The method may include, but is not limited to, steps S101 to S106.

[0034] Step S101: Collect multi-source signals during the operation of the new energy vehicle motor, preprocess the multi-source signals, and obtain an aligned standardized multi-source signal matrix; Step S102: Construct a sample set by sliding window slicing using a standardized multi-source signal matrix, dividing it into a base class set and a new class set. Randomly select several fault categories from the base class set, with several samples from each category forming a support set and several samples from each category forming a query set, thus forming a meta-task. Step S103: Input the support set and query set into a multi-scale convolutional neural network with shared weights, map them into support set sample embedding vectors and query set sample embedding vectors, obtain similarity scores through a relational network, calculate Euclidean distance, and weightedly fuse the similarity scores and Euclidean distances to obtain a comprehensive similarity. Step S104: Calculate the prediction probability of the query sample using comprehensive similarity, obtain the meta-task loss by combining the real label, obtain the contrast loss using Euclidean distance, and obtain the total loss by weighted sum of the meta-task loss and the contrast loss. Update the parameters of the multi-scale convolutional neural network and the relational network in reverse. Step S105: Input the sample to be tested into the updated multi-scale convolutional neural network to obtain the embedding vector of the sample to be tested. Calculate the average comprehensive similarity between the embedding vector of the sample to be tested and the embedding vector of each class support set sample. Take the largest one as the predicted fault category. When the sample to be tested comes from a new class set or the maximum average comprehensive similarity is lower than the preset threshold, it is judged as an unknown new fault and an early warning is triggered. Step S106: Add the samples of unknown new faults in the new class set that have been verified to the base class set, construct a meta-task containing the new and old classes, and adjust and update the multi-scale convolutional neural network and relational network with incremental loss with added regularization constraints to obtain the current early fault diagnosis results of the motor.

[0035] In steps S101 to S106 of this embodiment, meta-learning is combined with a Siamese metric network. A standardized multi-source signal matrix is ​​obtained through multi-source signal acquisition and preprocessing. A support set and query set are constructed using a sliding window slicing and N-way K-shot sampling strategy to form a meta-task. A shared-weight multi-scale convolutional neural network maps the support set and query set samples into embedding vectors. A comprehensive similarity is obtained by fusing relational networks and Euclidean distance. The comprehensive similarity is used to calculate the meta-task loss, and the contrast loss is calculated using Euclidean distance. The two are weighted and summed to obtain the total loss, which is then used to update the network parameters. This allows the model to simultaneously achieve feature aggregation of similar samples and separation of dissimilar samples during training, gaining the ability to quickly learn fault features from a small number of samples. The sample to be tested is input into the updated network to calculate its similarity to various types of samples. The average comprehensive similarity is taken as the fault category, and the unknown new fault warning is triggered when the test sample comes from the new class set or the maximum similarity is lower than the preset threshold, so as to realize accurate diagnosis of known faults and effective identification of unknown faults. The unknown fault samples confirmed by the new class set are added to the base class set, and the network is fine-tuned and updated with incremental loss with added regularization constraints. While retaining the diagnostic ability of the old class, the new fault characteristics are gradually mastered. Finally, the accurate diagnosis of early faults of new energy vehicle motors and the continuous evolution of the model are realized under multiple complex conditions such as small sample, variable operating conditions, weak signals and unknown faults.

[0036] In some embodiments, step S101 may include, but is not limited to, steps S111 to S119: Step S111: Acquire the three-phase stator current signal through the Hall current sensor built into the motor controller; Step S112: Vibration signals are collected by an acceleration sensor installed on the motor housing; Step S113: Monitor the temperature signals of the stator winding ends and the housing using a temperature sensor pre-embedded inside the motor; Step S114: Obtain the motor speed signal through the motor's built-in rotary transformer; Step S115: The three-phase stator current signal is filtered out by an adaptive notch filter to remove the power frequency fundamental wave, and the Parker vector mode is calculated to enhance the fault characteristics, thereby obtaining the enhanced current characteristics. Step S116: Calculate the envelope spectrum of the vibration signal, extract the bearing fault impact component using Morlet wavelet transform, and remove low-frequency operating condition disturbances to obtain the enhanced vibration characteristics. Step S117: Apply a moving average filter to the shell temperature signal and extract the slow change trend that meets the preset conditions as the temperature feature. Step S118: The enhanced current characteristics, enhanced vibration characteristics, and temperature characteristics are resampled at equal angles according to the motor speed signal, and time-synchronized according to the speed pulse to obtain a time-aligned multi-source feature sequence. Step S119: The time-aligned multi-source feature sequence is processed by Z-score normalization. The mean of the original signal value within the time window is subtracted from each original signal value in the time-aligned multi-source feature sequence, and then divided by the standard deviation of the original signal value to obtain the normalized value. The normalized value has a mean of zero and a standard deviation of one, which is used to eliminate the quantization difference between different sensors and obtain a standardized multi-source signal matrix.

[0037] In steps S111 to S119 of some embodiments, four signals—three-phase current, vibration, temperature, and rotational speed—are collected using a Hall current sensor, an acceleration sensor, a PT100 temperature sensor, and a rotary transformer. Adaptive notch filtering retains the 3rd, 5th, and 7th harmonics, and combined with Parker vector mode amplification of fault characteristics, envelope spectrum analysis and Morlet wavelet transform are performed on the vibration signal to extract the bearing fault impact component in the 2kHz-8kHz frequency band. Equal-angle resampling eliminates the influence of rotational speed variations, and Z-score normalization eliminates quantization differences between different sensors. Finally, a multi-source signal matrix with time alignment, unified dimensions, and standardized operating conditions is obtained, providing high-quality, multi-dimensional, and strongly correlated input data for subsequent small-sample fault diagnosis models, ensuring the accuracy and adaptability of the diagnosis.

[0038] In some embodiments, step S102 may include, but is not limited to, steps S201 to S205: Step S201: The standardized multi-source signal matrix is ​​sliced ​​using a sliding window. Each window extracts a segment of the multi-source signal with a continuous time step as a sample, and all samples constitute a sample set. Step S202: Divide the sample set into a base class set and a new class set; the base class set includes bearing inner ring faults, outer ring faults, minor demagnetization, and mild inter-turn short circuits, which are used for meta-training; the new class set includes rotor eccentricity, mixed faults, and severe demagnetization, which are used for meta-testing. Step S203: Randomly select several fault categories from the base class set, and randomly select several samples from each selected fault category to form a support set; Step S204: Randomly select several samples from each of the same fault categories to form a query set; In step S205, a meta-task is constructed using the support set and the query set. The support set is used to provide reference samples for various types of faults in the meta-task, and the query set is used to calculate the loss between the model prediction and the true label in the meta-task. The new class set does not participate in the training of the meta-task and is used to verify the model's ability to identify unknown faults.

[0039] In steps S201 to S205 of some embodiments, the standardized signal matrix is ​​constructed into a sample set by sliding window slicing. This sample set is divided into a base class set (bearing inner ring fault, outer ring fault, slight demagnetization, mild inter-turn short circuit) for meta-training and a new class set (rotor eccentricity, mixed fault, severe demagnetization) for meta-testing. N fault categories are randomly selected from the base class set, with K samples from each category forming a support set and Q samples forming a query set to form a meta-task. This allows the support set to provide reference samples, the query set to calculate the loss and update the model, and the new class set to not participate in training but to be reserved for subsequent verification. This simulates real small sample scenarios in diverse meta-tasks, enabling the model to learn fault features quickly from a small number of samples, laying a data foundation for subsequent cross-fault category generalization diagnostic capabilities.

[0040] In some embodiments, step S103 may include, but is not limited to, steps S301 to S307: Step S301: Set up a multi-scale convolutional neural network; the input of the multi-scale convolutional neural network is a two-dimensional matrix after splicing the multi-source signals corresponding to the support set samples and the query set samples respectively; the number of channels of the two-dimensional matrix corresponds to the current, vibration and temperature signal sources; the multi-scale convolutional neural network contains three parallel convolutional branches, and the kernel sizes of the three parallel convolutional branches are 3x3, 5x5 and 7x7 respectively, which are used to capture fault features at different time scales; Step S302: Input each sample in the support set into a multi-scale convolutional neural network and map it into the support set sample embedding vector corresponding to the sample. Step S303: Input each sample in the query set into a multi-scale convolutional neural network and map it into the query set sample embedding vector corresponding to the sample. Step S304: Concatenate each support set sample embedding vector and each query set sample embedding vector in sequence into a combined vector, input the combined vector into the relation network, and output the similarity score between the support set samples and the query set samples through the relation network; the similarity score ranges from zero to one. Step S305: Calculate the Euclidean distance between each support set sample embedding vector and each query set sample embedding vector, and calculate the maximum Euclidean distance between all sample pairs. Step S306: Normalize the Euclidean distance using the maximum Euclidean distance to obtain the normalized Euclidean distance. Step S307: The similarity score is weighted and fused with the normalized Euclidean distance to obtain the comprehensive similarity between the support set samples and the query set samples.

[0041] In steps S301 to S307 of some embodiments, a multi-scale convolutional neural network with shared weights (three parallel convolutional branches with convolutional kernels of 3×3, 5×5, and 7×7, respectively, and a channel attention mechanism to embed fault-sensitive frequency band priors) maps support set samples and query set samples to embedding vectors in the same feature space. Then, a similarity score is output through a relational network and combined with Euclidean distance for weighted fusion to obtain a comprehensive similarity. This enables the model to capture fault features at different time scales through multi-scale convolutional branches, focus on early weak fault-related frequency domain components through the attention mechanism, and comprehensively measure the similarity of samples from different perspectives through a dual measurement strategy. This improves the ability to extract weak fault features and the accuracy of measurement under low signal-to-noise ratio and complex working conditions.

[0042] In some embodiments, step S104 may include, but is not limited to, steps S401 to S405: Step S401: Using the comprehensive similarity, the predicted probability of each query sample being predicted as each fault category is calculated using a normalized exponential function. The prediction probability is calculated by dividing the value of the exponential function with the natural constant as the base and the comprehensive similarity as the exponent by the sum of the exponential function values ​​of the comprehensive similarity between the query sample and all fault categories. Step S402: The cross-entropy loss function is used to calculate the meta-task loss using the predicted probability of each query sample and the true label of the query sample. Step S403: Calculate the contrast loss using the Euclidean distance between the support set sample embedding vectors and the query set sample embedding vectors. The contrast loss is as follows: For sample pairs belonging to the same fault category, calculate the sum of squares of the Euclidean distances; for sample pairs belonging to different fault categories, calculate the maximum value of the difference between the preset distance threshold minus the Euclidean distance and zero, and then square the maximum value; add the parts belonging to the same fault category and the parts belonging to different fault categories and multiply by one-half to obtain the contrast loss. Step S404: The meta-task loss and the comparison loss are weighted and summed according to preset weight coefficients to obtain the total loss; Step S405: Using the total loss, the backpropagation algorithm is used to synchronously update the parameters of the multi-scale convolutional neural network and the relational network, resulting in the updated parameters of the multi-scale convolutional neural network and the updated parameters of the relational network.

[0043] In steps S401 to S405 of some embodiments, the predicted probability of the query sample is calculated using a normalized exponential function based on the comprehensive similarity. The cross-entropy loss function combined with the real label is used to calculate the meta-task loss to measure the classification accuracy. The contrast loss is calculated using the Euclidean distance between the embedding vectors (the sum of the squared distances between similar samples and the sum of the squared distances between dissimilar samples multiplied by half) to bring similar samples closer and push dissimilar samples further away. The meta-task loss and the contrast loss are weighted and summed with a weight of 0.5 to obtain the total loss, and the network parameters are updated synchronously through backpropagation. This allows the model to achieve both accurate classification and feature space optimization during training. It not only ensures the classification accuracy within the meta-task but also enhances the aggregation of similar fault features and the separation of dissimilar fault features, thereby obtaining stronger discriminative and generalization abilities under small sample conditions.

[0044] In some embodiments, step S105 may include, but is not limited to, steps S501 to S504: Step S501: Input the test sample into the updated multi-scale convolutional neural network and map it into the test sample embedding vector. Step S502: For each fault category, calculate the comprehensive similarity between the embedding vector of the sample to be tested and the embedding vector of all support set samples under that fault category, and then take the average of the comprehensive similarity of all support set samples under that fault category to obtain the average comprehensive similarity between the sample to be tested and the fault category. Step S503: Compare the average comprehensive similarity of all fault categories, and take the fault category with the largest average comprehensive similarity as the predicted fault category of the sample to be tested. Step S504: Compare the maximum average comprehensive similarity with the preset threshold, and determine whether the sample to be tested belongs to a new class set. When the maximum average comprehensive similarity is lower than the preset threshold or the sample to be tested comes from a new class set, the sample to be tested is determined to be an unknown new type of fault, triggering an early warning and suggesting a review.

[0045] In steps S501 to S504 of some embodiments, the sample to be tested is input into the updated multi-scale convolutional neural network and mapped to the embedding vector of the sample to be tested. The average comprehensive similarity between the sample and the embedding vector of each class support set is calculated, and the one with the largest similarity is judged as the predicted fault category. At the same time, when the maximum average comprehensive similarity is lower than a preset threshold or the sample to be tested comes from a new class set, it is judged as an unknown new fault and an early warning is triggered. This enables the model to make accurate classification and output clear diagnostic conclusions based on a small number of reference samples when facing known faults. When facing new faults that have never appeared in the training set, it can actively identify them through the similarity threshold mechanism and prompt manual review. This avoids the limitation of traditional classification models that can only identify known fault types and provides more comprehensive protection for motor operation safety.

[0046] In some embodiments, step S106 may include, but is not limited to, steps S601 to S605: Step S601: The samples of unknown new faults that have triggered the warning and have been verified are added to the base class set along with the fault type labels corresponding to the samples of unknown new faults to form the expanded training set. Step S602: Resample from the expanded training set, select several fault categories from the old and new categories respectively, and select several samples from each category to form a support set and a query set, and construct an incremental meta-task containing the old and new categories; Step S603: Calculate the incremental loss using the incremental meta-task; the incremental loss is the sum of the total loss of the incremental meta-task and the regularization constraint term; the regularization constraint term is the sum of squares of the parameters after the multi-scale convolutional neural network update minus the parameters before the update, plus the sum of squares of the parameters after the relational network update minus the parameters before the update, used to constrain the parameter update magnitude. Step S604: Using incremental loss, the backpropagation algorithm is used to adjust and update the parameters of the multi-scale convolutional neural network and the relational network, so as to obtain the adjusted and updated parameters of the multi-scale convolutional neural network and the adjusted and updated parameters of the relational network. Step S605: Input the test sample into the adjusted and updated multi-scale convolutional neural network and relational network, and output the current early fault diagnosis result of the motor; the current early fault diagnosis result of the motor includes the judgment of known fault categories or the early warning information of unknown new faults.

[0047] In steps S601 to S605 of some embodiments, unknown new fault samples and their labels that have triggered warnings and been verified are added to the original base class set to form an expanded training set. Incremental meta-tasks containing both new and old categories are constructed by sampling from both categories. The offset of network parameters during incremental fine-tuning is limited by a regularization constraint term (the sum of squares of the updated parameters minus the parameters before the update). Fine-tuning is performed through backpropagation of incremental loss (total loss plus the regularization constraint term multiplied by 0.01). This allows the model to retain its diagnostic ability for old fault categories while gradually learning the characteristics of new fault categories, preventing catastrophic forgetting and enabling continuous evolution of the diagnostic model. This allows the model to continuously expand its knowledge boundary as running data accumulates, and adapt to the ever-changing needs of new energy vehicle motor fault diagnosis in the long term.

[0048] This application also provides an early fault diagnosis system for new energy vehicle motors based on meta-learning and twin networks, used to implement the method described above. The system includes: The multi-source signal acquisition and preprocessing module is used to acquire multi-source signals during the operation of the electric motor of a new energy vehicle, preprocess the multi-source signals, and obtain an aligned and standardized multi-source signal matrix. The sample construction module is used to construct a sample set by sliding window slicing using a standardized multi-source signal matrix. The sample set is divided into a base class set and a new class set. Several fault categories are randomly selected from the base class set. Several samples of each category form a support set, and several samples of each category form a query set, thus forming a meta-task. The twin metric network module is used to input the support set and query set into a multi-scale convolutional neural network with shared weights, map them into support set sample embedding vectors and query set sample embedding vectors, obtain similarity scores through a relational network, calculate Euclidean distance, and then weight and fuse the similarity scores and Euclidean distances to obtain a comprehensive similarity. The meta-learning training module is used to calculate the prediction probability of query samples using comprehensive similarity, combine the real labels to obtain the meta-task loss, use Euclidean distance to obtain the contrast loss, and weight the sum of the meta-task loss and the contrast loss to obtain the total loss, and then update the parameters of the multi-scale convolutional neural network and the relational network in reverse. The fault identification and early warning module is used to input the test sample into the updated multi-scale convolutional neural network to obtain the embedding vector of the test sample, calculate the average comprehensive similarity between the embedding vector of the test sample and the embedding vector of each category support set sample, and take the largest one as the predicted fault category. When the test sample comes from a new category set or the maximum average comprehensive similarity is lower than the preset threshold, it is judged as an unknown new type of fault and an early warning is triggered. The incremental learning update module is used to add samples of unknown new faults that have been verified in the new class set to the base class set, construct a meta-task containing both new and old classes, and adjust and update the multi-scale convolutional neural network and relational network with incremental loss that has been subject to additional regularization constraints to obtain the current early fault diagnosis results of the motor.

[0049] As an optional implementation, this application's embodiments, in order to address the challenges of early fault diagnosis in new energy vehicle motors, such as small sample sizes, weak features, variable operating conditions, and unknown faults, refer to... Figure 2 The present invention adopts the following technical solution: Step 1: Acquisition and processing of multi-source signals for early motor faults; Step 2: Construction of the meta-task sample set for small-sample scenarios of motor failure; Step 3: Construction of a twin metric network for weak fault features; Step 4: Meta-learning training and parameter optimization; Step 5: Early fault identification and early warning of unknown faults; Step 6: Incremental learning and model update.

[0050] The whole process is as follows Figure 3 As shown.

[0051] In the above steps, the typical early faults and their corresponding sensitive signals of permanent magnet synchronous motors in new energy vehicles in step 1 are shown in Table 1: Step A: Data Acquisition. Signal acquisition is performed using the sensors integrated into the new energy vehicle motor: The three-phase stator current signal (sampling rate 12.8 kHz) is acquired via the Hall current sensor built into the motor controller to extract harmonic components, detect inter-turn short circuits and demagnetization, and simultaneously extract modulation characteristics of bearing faults and rotor eccentricity using current demodulation technology; the stator winding end and housing temperature is monitored via a PT100 temperature sensor pre-embedded inside the motor (sampling frequency 1 Hz) to identify slow temperature rise anomalies caused by short circuits; and the real-time motor speed signal (sampling rate 1 kHz) is obtained via the motor's built-in rotary transformer for operating condition segmentation, feature normalization, and equal-angle resampling of the current signal.

[0052] Step B: Early Weak Signal Enhancement Preprocessing. For the aforementioned multi-source signals, this invention employs the following preprocessing method: An adaptive notch filter is used to filter out the fundamental frequency (50 / 400 Hz) of the current signal, retaining the 3rd, 5th, and 7th harmonic components, and the Park vector modulus is calculated. To enhance fault characteristics, the envelope spectrum of the vibration signal was calculated, and Morlet wavelet transform was used to extract the bearing fault impact component in the 2 kHz–8 kHz frequency band. Bandpass filtering was then performed in the 500 Hz–10 kHz range to remove low-frequency operating condition disturbances. For the temperature signal, a moving average filter was used with a 30-second window to extract the slow changing trend. For the speed signal, the current and vibration signals were resampled at equal angles according to the speed to eliminate the influence of operating condition changes on the characteristics.

[0053] Table 1. Correspondence between typical early faults and their sensitive signals

[0054] Step C: Time Alignment and Normalization. Synchronize all signals according to the speed pulse to ensure alignment of multi-source information under the same operating conditions. Use Z-score normalization:

[0055] in the formula The raw signal values ​​(such as raw data collected by sensors for current, vibration, temperature, etc.); This is the signal mean, that is, the average value of the signal within a time window; The standard deviation of the signal reflects the degree of signal fluctuation. The normalized values ​​have a mean of 0 and a standard deviation of 1, which are used to eliminate quantization differences between different sensors.

[0056] Step 2: After slicing the collected multi-source signals through a sliding window, a sample set is constructed. The sample set is divided into a base class set (bearing inner ring fault, outer ring fault, slight demagnetization, mild inter-turn short circuit) and a new class set (rotor eccentricity, mixed fault, severe demagnetization, etc.). The base class set is used for meta-training, and the new class set is used for meta-testing.

[0057] To simulate the small-sample environment in motor fault diagnosis, several N-way K-shot meta-tasks are constructed: randomly selected from the base class set. Each fault category is selected. Each sample constitutes a support set, and at the same time, each class selects... The query set consists of 10 samples. This indicates the number of fault categories included in each task. This indicates the number of supported samples for each class. Indicates the number of query samples for each category. Supported sets and query set They are represented as follows: ,

[0058] Support for collection S Let be the feature vector of the multi-source signal of the i-th sample; The fault category label corresponding to the i-th sample; The number of fault categories in the meta-task; The number of supporting samples for each type of fault.

[0059] ,

[0060] query set To be used for calculating loss and updating the model, For the first j The feature vector of each query sample; To query the true labels of the samples; Number of fault categories; The number of query samples for each type of fault.

[0061] Step 3: Construct a twin metric network model consisting of a feature extraction module and a metric calculation module.

[0062] Step A: Feature Extraction Module. The feature extraction module employs a multi-scale convolutional neural network with shared weights. .in: Input parameters: a two-dimensional matrix after splicing the source signals (number of channels = current, vibration, temperature, time step = 1024).

[0063] Convolutional layer: 3 parallel branches with kernel sizes of 3×3, 5×5 and 7×7, respectively, used to capture fault features at different time scales.

[0064] Domain specialization: Introducing fault-sensitive frequency band priors into the channel attention mechanism guides the network to focus on frequency domain components related to early faults.

[0065] Output embedding vector:

[0066] in The input is a two-dimensional matrix after splicing multiple source signals. It is a multi-scale convolutional neural network. The output embedding vector represents the position of the sample in the feature space.

[0067] Step B, the metric calculation module, employs a dual metric strategy of Euclidean distance and relational network. Support set samples are embedded... With query set sample embedding Concatenate and input relationship networks Output the similarity score between the two:

[0068] in the formula Indicates support set samples and query set samples The similarity score has a value between [0,1], and the closer it is to 1, the more similar the two samples are. Representing a relationship network, take the concatenation of the embedding vectors of two samples as input and output the similarity between them; Embedded vectors of support set samples Embedded vectors of query set samples The vectors are concatenated sequentially to form a longer vector, which serves as the input to the relational network. To further improve metric accuracy, the embeddings of the support set samples are also computed. With query set sample embedding Euclidean distance between This is used to measure the similarity between two samples in the feature space.

[0069] The formula for calculating the overall similarity is:

[0070] in The overall similarity score indicates that a higher value represents a sample from the support set. With query set sample The more likely they are to belong to the same type of fault. The weighting coefficients are used to balance the proportions of relation network score and Euclidean distance in the final similarity score. The similarity score output for the relational network; To support the Euclidean distance between the sample set and the query set, a smaller value indicates that the features are more similar; The maximum Euclidean distance between all sample pairs is used to... Normalize to the [0,1] interval.

[0071] Step 4: First, calculate the meta-task loss. For each meta-task, calculate the predicted probability distribution of the query set samples:

[0072] In the formula, For query samples Predicted as category The probability of; For the first j The feature vector of each query sample; For the first j The true labels of each query sample; Index for fault categories; For query samples With support of the central The overall similarity of samples of the same class; This is an exponential function used to convert similarity to non-negative values; The exponential similarity scores for all categories are summed for normalization. The meta-task loss is calculated using the cross-entropy loss function.

[0073] in, Cross-entropy loss for the meta-task measures the difference between the model's prediction and the true label. The total number of samples in the query set; To query the samples in the set and their true labels; Samples for the model Predicted as true label The probability of [the outcome]. To further enhance feature aggregation of similar fault samples and expand the separation distance of dissimilar samples, a contrastive loss is introduced:

[0074] in, To compare losses, it is used to bring similar samples closer together and push away dissimilar samples; For sample i and sample j Euclidean distance in the embedding space; Represents the sample i With sample j They belong to the same fault category; Indicates sample i With sample j They belong to different fault categories; The squared outlier loss further penalizes outlier samples that are too close in distance. The model's total loss function is the meta-task loss. Compared with loss The weighted sum is obtained, where, To balance the hyperparameter (0.5 in this scheme), the proportion of contrast loss in the total loss is controlled as follows:

[0075] Step 5: Place the sample to be tested Input the trained model, For the feature extraction network, extract its feature vector:

[0076] Calculate the similarity score between the test sample and the support set samples of various fault types:

[0077] in For the test sample and category c The average overall similarity; For category c Support set of samples; To support the centralized i Embedding vectors of each sample; The embedding vector for the sample to be tested; The maximum Euclidean distance between all sample pairs; For fusion weights; The similarity score output by the relational network is calculated as follows: Predicted fault categories :

[0078] When the maximum similarity score is lower than the preset threshold At that time, that is The current fault is determined to be an unknown new type of fault (such as a mixed fault, a new type of bearing defect, etc.), and an early warning is triggered and manual review is recommended.

[0079] Step 6: Once the number of new fault samples has accumulated to a preset amount, an incremental learning strategy is used to update the model. New fault types (such as rotor eccentricity or mixed faults) are added to the training set, and a new meta-task containing both old and new categories is reconstructed to fine-tune the model. To prevent drastic changes in model parameters during incremental updates that could affect the original diagnostic capabilities, a regularization term is introduced to constrain the parameter update magnitude.

[0080] in the formula This is a regularization loss, used to constrain the model parameters from deviating too far from the original parameters during incremental updates, thus preventing catastrophic forgetting. Extract network parameters for the updated features; Extract network parameters for features before incremental update; For the updated relational network parameters; These are the relational network parameters before the incremental update; This represents the square of the L2 norm, which is the sum of the squares of the differences between the components of the parameter vector. The total loss during fine-tuning:

[0081] in =0.01 is the regularization coefficient. , These are the parameters before the update. Through this regularization term, the model retains the ability to diagnose faults of the old categories while gradually learning the characteristics of new fault categories, thus achieving the ability to identify newly added fault types.

[0082] Compared with related technologies, this invention combines metric learning with Siamese networks, enabling the model to quickly learn fault features from a small number of samples. High-precision diagnosis can be achieved with only a few labeled samples, effectively solving the problem of low diagnostic accuracy under small sample conditions. The feature extraction module employs multi-scale convolutional kernels and attention mechanisms, significantly enhancing sensitivity to early, weak fault signals and accurately extracting fault features even under low signal-to-noise ratio conditions. Through a meta-task training strategy, the model learns universal fault feature representations in diverse tasks, adapting to diagnostic tasks under different speeds and load conditions. Simultaneously, by utilizing a similarity threshold mechanism, it can identify novel faults not present in the training set and trigger early warnings, providing more comprehensive safety assurance for the operation and maintenance of new energy vehicle motors.

[0083] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0084] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0085] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0086] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0087] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0088] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0089] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0090] The method, system, electronic device, storage medium, and program product for early fault diagnosis of new energy vehicle motors based on meta-learning and Siamese networks provided in this application combine meta-learning with Siamese metric networks to construct a dual metric model that includes multi-scale convolutional neural networks and relational networks. It learns general fault feature representations from a small number of labeled samples through meta-task training, thereby achieving high-precision diagnosis of early and weak faults in new energy vehicle motors under small sample conditions. At the same time, it effectively identifies new unknown faults not appearing in the training set and triggers early warnings by using a comprehensive similarity threshold discrimination mechanism. The model is continuously updated through an incremental learning strategy, so that the model gradually masters the ability to identify new faults while retaining the diagnostic capabilities of old categories. Ultimately, it achieves accurate diagnosis and continuous evolution of early motor faults under multiple complex conditions such as variable operating conditions, small samples, weak signals, and unknown faults.

[0091] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0092] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0093] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0094] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0095] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0096] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0097] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0098] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0099] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0100] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0101] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for early fault diagnosis of new energy vehicle motors based on meta-learning and twin networks, characterized in that, The method includes the following steps: Collect multi-source signals during the operation of the motor of a new energy vehicle, preprocess the multi-source signals, and obtain an aligned and standardized multi-source signal matrix; The standardized multi-source signal matrix is ​​used to construct a sample set by sliding window slicing, which is divided into a base class set and a new class set. Several fault categories are randomly selected from the base class set, and several samples of each category form a support set and several samples of each category form a query set, thus forming a meta-task. The support set and the query set are input into a multi-scale convolutional neural network with shared weights, which is mapped to the support set sample embedding vector and the query set sample embedding vector. The similarity score is obtained through a relational network, the Euclidean distance is calculated, and the similarity score and the Euclidean distance are weighted and fused to obtain the comprehensive similarity. The prediction probability of the query sample is calculated using the comprehensive similarity, the meta-task loss is obtained by combining the real label, the contrast loss is obtained by using the Euclidean distance, the total loss is obtained by weighted summation of the meta-task loss and the contrast loss, and the parameters of the multi-scale convolutional neural network and the relational network are updated in reverse. The sample to be tested is input into the updated multi-scale convolutional neural network to obtain the embedding vector of the sample to be tested. The average comprehensive similarity between the embedding vector of the sample to be tested and the embedding vector of the support set sample of each category is calculated. The one with the largest similarity is judged as the predicted fault category. When the sample to be tested comes from the new category set or the maximum average comprehensive similarity is lower than the preset threshold, it is judged as an unknown new fault and an early warning is triggered. The samples of the unknown novel faults that have been verified in the new class set are added to the base class set to construct a meta-task containing both new and old classes. The multi-scale convolutional neural network and the relational network are adjusted and updated with an incremental loss that includes regularization constraints to obtain the current early fault diagnosis results of the motor.

2. The method according to claim 1, characterized in that, The process of collecting multi-source signals during the operation of the new energy vehicle motor, preprocessing the multi-source signals to obtain an aligned and standardized multi-source signal matrix includes: The three-phase stator current signal is acquired by the Hall current sensor built into the motor controller; Vibration signals are collected by an accelerometer mounted on the motor housing; Temperature signals at the ends of the stator windings and the housing are monitored by temperature sensors pre-embedded inside the motor. The motor speed signal is obtained through the motor's built-in rotary transformer; An adaptive notch filter is used to filter out the fundamental frequency wave of the three-phase stator current signal, and the Parker vector mode is calculated to enhance the fault characteristics, thereby obtaining the enhanced current characteristics. The envelope spectrum of the vibration signal is calculated, the bearing fault impact component is extracted by Morlet wavelet transform, and low-frequency operating condition disturbances are removed to obtain the enhanced vibration characteristics. The shell temperature signal is filtered by moving average to extract a slow change trend that meets preset conditions as a temperature feature; The enhanced current characteristics, the enhanced vibration characteristics, and the temperature characteristics are resampled at equal angles according to the motor speed signal, and time-synchronized according to the speed pulse to obtain a time-aligned multi-source feature sequence. The time-aligned multi-source feature sequence is processed by Z-score normalization. The mean of the original signal value within the time window is subtracted from each original signal value in the time-aligned multi-source feature sequence, and then divided by the standard deviation of the original signal value to obtain the normalized value. The normalized value has a mean of zero and a standard deviation of one, which is used to eliminate quantization differences between different sensors to obtain the standardized multi-source signal matrix.

3. The method according to claim 1, characterized in that, The process involves constructing a sample set using a sliding window slice based on the standardized multi-source signal matrix, dividing it into a base class set and a new class set. Several fault categories are randomly selected from the base class set, with several samples from each category forming a support set and several samples from each category forming a query set, thus forming a meta-task, including: The standardized multi-source signal matrix is ​​sliced ​​using a sliding window. Each window extracts a segment of the multi-source signal with a continuous time step as a sample, and all samples constitute a sample set. The sample set is divided into a base class set and a new class set; the base class set includes bearing inner ring faults, outer ring faults, minor demagnetization, and mild inter-turn short circuits, which are used for meta-training; the new class set includes rotor eccentricity, mixed faults, and severe demagnetization, which are used for meta-testing. Several fault categories are randomly selected from the base class set, and several samples are randomly selected from each of the selected fault categories to form a support set; From each of the same fault categories, several samples are randomly selected to form a query set; The support set and the query set together constitute a meta-task; the support set is used to provide reference samples of various faults in the meta-task, and the query set is used to calculate the loss between the model prediction and the true label in the meta-task; the new class set does not participate in the training of the meta-task, but is used to verify the model's ability to identify unknown faults.

4. The method according to claim 1, characterized in that, The process of inputting the support set and the query set into a multi-scale convolutional neural network with shared weights, mapping them to support set sample embedding vectors and query set sample embedding vectors, obtaining similarity scores through a relational network, calculating Euclidean distance, and weightedly fusing the similarity scores and Euclidean distances to obtain a comprehensive similarity includes: A multi-scale convolutional neural network is configured. The input of the multi-scale convolutional neural network is a two-dimensional matrix formed by splicing the multi-source signals corresponding to the support set samples and the query set samples. The number of channels in the two-dimensional matrix corresponds to the current, vibration, and temperature signal sources. The multi-scale convolutional neural network contains three parallel convolutional branches with kernel sizes of 3x3, 5x5, and 7x7, respectively, which are used to capture fault features at different time scales. Each sample in the support set is input into the multi-scale convolutional neural network and mapped to the support set sample embedding vector corresponding to the sample. Each sample in the query set is input into the multi-scale convolutional neural network and mapped to the corresponding query set sample embedding vector. Each support set sample embedding vector and each query set sample embedding vector are concatenated sequentially into a combined vector. The combined vector is then input into a relational network, which outputs a similarity score between the support set samples and the query set samples. The similarity score ranges from zero to one. Calculate the Euclidean distance between each of the support set sample embedding vectors and each of the query set sample embedding vectors, and calculate the maximum Euclidean distance between all sample pairs; The Euclidean distance is normalized using the maximum Euclidean distance to obtain the normalized Euclidean distance; The similarity score is weighted and fused with the normalized Euclidean distance to obtain the comprehensive similarity between the support set samples and the query set samples.

5. The method according to claim 1, characterized in that, The process of calculating the prediction probability of the query sample using the comprehensive similarity, obtaining the meta-task loss by combining it with the real label, obtaining the contrast loss using the Euclidean distance, and then weighted summing the meta-task loss and the contrast loss to obtain the total loss, followed by back-updating the parameters of the multi-scale convolutional neural network and the relational network, includes: Using the comprehensive similarity, a normalized exponential function is used to calculate the prediction probability that each query sample is predicted to be each fault category. The prediction probability is calculated by dividing the value of the exponential function with the natural constant as the base and the comprehensive similarity as the exponent by the sum of the exponential function values ​​of the comprehensive similarity between the query sample and all fault categories. The cross-entropy loss function is used to calculate the meta-task loss by combining the predicted probability of each query sample with the true label of the query sample. The contrast loss is calculated using the Euclidean distance between the support set sample embedding vector and the query set sample embedding vector. The contrast loss is as follows: for sample pairs belonging to the same fault category, the sum of squares of the Euclidean distances is calculated; for sample pairs belonging to different fault categories, the maximum value of the difference between a preset distance threshold and the Euclidean distance compared to zero is calculated, and then the maximum value is squared; the contrast loss is obtained by adding the parts belonging to the same fault category and the parts belonging to different fault categories and multiplying by one-half. The total loss is obtained by weighting and summing the meta-task loss and the comparison loss according to preset weighting coefficients. Using the total loss, the parameters of the multi-scale convolutional neural network and the parameters of the relational network are updated synchronously using the backpropagation algorithm, resulting in updated parameters of the multi-scale convolutional neural network and updated parameters of the relational network.

6. The method according to claim 1, characterized in that, The process involves inputting the test sample into the updated multi-scale convolutional neural network to obtain the test sample embedding vector, calculating the average comprehensive similarity between the test sample embedding vector and the embedding vectors of the support set samples of each category, and taking the largest similarity as the predicted fault category. When the test sample comes from the new category set or the largest average comprehensive similarity is lower than a preset threshold, it is judged as an unknown new type of fault and an early warning is triggered, including: The sample to be tested is input into the updated multi-scale convolutional neural network and mapped to the embedding vector of the sample to be tested. For each fault category, calculate the comprehensive similarity between the embedding vector of the sample to be tested and the embedding vectors of all support set samples under that fault category, and then take the average of the comprehensive similarity of all support set samples under that fault category to obtain the average comprehensive similarity between the sample to be tested and the fault category. The average comprehensive similarity of all fault categories is compared, and the fault category with the largest average comprehensive similarity is taken as the predicted fault category of the sample to be tested. The maximum average comprehensive similarity is compared with a preset threshold, and it is determined whether the sample to be tested belongs to the new class set. When the maximum average comprehensive similarity is lower than the preset threshold or the sample to be tested comes from the new class set, the sample to be tested is determined to be an unknown new type of fault, triggering an early warning and suggesting a review.

7. The method according to claim 1, characterized in that, The process involves adding the samples of the unknown novel faults, after verification and confirmation, from the new class set to the base class set, constructing a meta-task containing both new and old classes, and adjusting and updating the multi-scale convolutional neural network and the relational network with an incremental loss that includes regularization constraints to obtain the current early fault diagnosis results for the motor, including: The samples of the unknown new faults that have triggered the warning and have been verified are added to the base class set along with the fault type labels corresponding to the samples of the unknown new faults to form the expanded training set. Resample from the expanded training set, select several fault categories from the old and new categories respectively, and select several samples from each category to form a support set and a query set, and construct an incremental meta-task containing the old and new categories; The incremental loss is calculated using the incremental meta-task; the incremental loss is the sum of the total loss of the incremental meta-task and the regularization constraint term; the regularization constraint term is the sum of the squares of the updated parameters of the multi-scale convolutional neural network minus the parameters before the update, plus the sum of the squares of the updated parameters of the relational network minus the parameters before the update, used to constrain the parameter update magnitude. Using the incremental loss, the parameters of the multi-scale convolutional neural network and the parameters of the relational network are adjusted and updated using the backpropagation algorithm to obtain the adjusted and updated parameters of the multi-scale convolutional neural network and the adjusted and updated parameters of the relational network. The test sample is input into the adjusted and updated multi-scale convolutional neural network and the relational network, and the current early fault diagnosis result of the motor is output; the current early fault diagnosis result of the motor includes the determination of known fault categories or the early warning information of unknown new faults.

8. A new energy vehicle motor early fault diagnosis system based on meta-learning and twin networks, used to implement the method as described in any one of claims 1 to 7, characterized in that, The system includes: A multi-source signal acquisition and preprocessing module is used to acquire multi-source signals during the operation of the motor of a new energy vehicle, preprocess the multi-source signals, and obtain an aligned and standardized multi-source signal matrix. The sample construction module is used to construct a sample set by sliding window slicing using the standardized multi-source signal matrix, which is divided into a base class set and a new class set. Several fault categories are randomly selected from the base class set, and several samples of each category constitute a support set and several samples of each category constitute a query set, forming a meta-task. The twin metric network module is used to input the support set and the query set into a multi-scale convolutional neural network with shared weights, map them into support set sample embedding vectors and query set sample embedding vectors, obtain similarity scores through a relational network, calculate Euclidean distance, and weightedly fuse the similarity scores and the Euclidean distance to obtain a comprehensive similarity. The meta-learning training module is used to calculate the prediction probability of the query sample using the comprehensive similarity, obtain the meta-task loss by combining the real label, obtain the contrast loss using the Euclidean distance, and obtain the total loss by weighted summation of the meta-task loss and the contrast loss, and then update the parameters of the multi-scale convolutional neural network and the relational network in reverse. The fault identification and early warning module is used to input the sample to be tested into the updated multi-scale convolutional neural network to obtain the embedding vector of the sample to be tested, calculate the average comprehensive similarity between the embedding vector of the sample to be tested and the embedding vector of the support set samples of each category, and take the largest one as the predicted fault category. When the sample to be tested comes from the new category set or the maximum average comprehensive similarity is lower than the preset threshold, it is judged as an unknown new type of fault and an early warning is triggered. The incremental learning update module is used to add the samples of the unknown new faults in the new class set, which have been verified, to the base class set, construct a meta-task containing the old and new classes, and adjust and update the multi-scale convolutional neural network and the relational network with an incremental loss that has been subject to regularization constraints to obtain the current early fault diagnosis results of the motor.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.