Motor anomaly detection method, electronic equipment and storage medium

By combining the VAE model with adversarial game training of generative adversarial networks, and combining adaptive dilated convolution with multi-layer perceptron, the problems of sample scarcity and imbalance in permanent magnet synchronous motor anomaly detection are solved, the detection precision and accuracy are improved, and the stability and feature expression ability of the model are enhanced.

CN120761848APending Publication Date: 2025-10-10CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510916243.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

The existing methods for detecting abnormalities in permanent magnet synchronous motors have problems such as scarcity of abnormal samples and unbalanced sample distribution, which results in limited detection accuracy.

Method used

The VAE model is combined with the adversarial game training of the generative adversarial network. The operating characteristic signals of the motor under normal working conditions are used to build an anomaly detection model through variational inference. The adaptive dilated convolution unit and multi-layer perceptron are combined for feature extraction and reconstruction. The difference index between the test data and the reconstructed sample is calculated for anomaly detection.

Benefits of technology

It improves the precision and accuracy of motor anomaly detection, effectively addresses the problems of scarcity of abnormal samples and unbalanced sample distribution, enhances the stability and feature expression ability of the model, and provides reliable fault prediction support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120761848A_ABST
    Figure CN120761848A_ABST
Patent Text Reader

Abstract

The invention provides a motor anomaly detection method, electronic equipment and a storage medium, and the method comprises the steps: inputting to-be-detected data of a motor at a plurality of moments into an anomaly detection model, obtaining a reconstruction sample which is corresponding to the to-be-detected data and is close to normal data distribution, the anomaly detection model comprises a VAE model, the VAE model comprises an encoder and a decoder, and the encoder is connected with the decoder; the anomaly detection model is obtained by combining variational reasoning of a VAE model and adversarial game training of a generative adversarial network according to an operation characteristic signal of the motor in a normal working state; and calculating a difference index between the to-be-detected data and the reconstructed sample, and carrying out anomaly detection on the motor based on the difference index. The precision and accuracy of the motor anomaly detection model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of fault detection, and in particular to a motor abnormality detection method, electronic equipment, and storage medium. Background Art

[0002] Permanent magnet synchronous motors (PMSMs) are the preferred drive system for electric vehicles due to their high efficiency, high power density, and fast response. Their permanent magnets provide a stable magnetic field, reducing energy loss. Their superior dynamic response and precise torque control enable vehicles to achieve exceptional acceleration and driving stability. However, motor failure can cause the vehicle to malfunction, severely impacting driving safety and performance.

[0003] Currently, the mainstream method for detecting anomalies in permanent magnet synchronous motors (PMSMs) relies on raw vibration, current, and magnetic field signals. Because vibration models can effectively reflect internal faults, many researchers are analyzing the spatiotemporal distribution of stator magnetic flux to extract rotor features, enabling online detection of motor rotor faults. As industries become increasingly complex and downtime costs increase, predictive maintenance is becoming a more proactive strategy. This approach leverages real-time data from sensors, monitoring systems, and predictive algorithms to assess equipment condition, identify potential faults, and schedule maintenance activities accordingly.

[0004] However, the main problem with current methods is that abnormal samples are scarce and the sample distribution is unbalanced, which limits the accuracy of the anomaly detection model. Summary of the Invention

[0005] The purpose of the embodiments of the present application is to provide a motor abnormality detection method, electronic device and storage medium to improve the precision and accuracy of the motor abnormality detection model.

[0006] In the first aspect, the present application provides a motor abnormality detection method, comprising: inputting the test data of the motor at multiple moments into an abnormality detection model to obtain reconstructed samples corresponding to the test data that are close to the normal data distribution, wherein the abnormality detection model includes a VAE model, the VAE model includes an encoder and a decoder, and the abnormality detection model is based on the operating characteristic signals of the motor under normal working conditions, combined with the variational reasoning of the VAE model and the adversarial game training of the generative adversarial network; calculating the difference index between the test data and the reconstructed sample, and performing abnormality detection on the motor based on the difference index.

[0007] In this approach, the anomaly detection model is derived by utilizing the motor's operating characteristic signals under normal operating conditions, combining variational reasoning with a VAE model and adversarial game training with a generative adversarial network. This model can learn the distribution characteristics of normal data, effectively addressing the scarcity of abnormal samples and the imbalance of sample distribution, thereby improving the stability of model training. By inputting the motor's test data at multiple moments into this anomaly detection model, reconstructed samples that approximate the normal data distribution can be obtained. Anomaly detection is performed by calculating the difference between the test data and the reconstructed samples. This effectively measures the degree of deviation between the test data and normal data, thereby improving the precision and accuracy of motor anomaly detection and providing strong support for predictive maintenance of motors.

[0008] As an optional method, the encoder includes an adaptive dilated convolution unit, which inputs the test data of the motor at multiple moments into the anomaly detection model to obtain reconstructed samples corresponding to the test data that are close to the normal data distribution, including: dividing the test data into time windows according to a preset time length to obtain multiple time window data; extracting features of each time window data to obtain corresponding eigenvalues; calculating the standard score corresponding to each eigenvalue; determining the dilation rate of the corresponding time window data according to the standard score, inputting the time window data into the adaptive dilated convolution unit for dilated convolution to obtain feature data; and outputting reconstructed samples based on the feature data.

[0009] In the above scheme, the test data is divided into time windows with preset time lengths and feature values ​​are extracted. The expansion rate is adaptively determined in combination with the standard score, and multi-scale feature extraction is performed on different feature data using adaptive expansion convolution units. This can not only capture abnormal details for high-deviation features, but also simplify the processing of low-deviation features to improve efficiency, effectively avoiding the inefficiency of complex deep architectures, thereby improving the characterization ability of feature data, making the output reconstructed samples more accurately reflect the normal data distribution characteristics, and providing a more reliable basis for anomaly detection.

[0010] As an optional method, the encoder includes a multi-layer perceptron MLP, which performs feature extraction on each time window data to obtain corresponding eigenvalues, including: calculating the eigenvalue vector corresponding to each time window data, the eigenvalue vector including the maximum value, minimum value, first mean value and at least one of the adaptive feature elements in the time window data, wherein the adaptive feature element is obtained by inputting each time window data into the MLP respectively; normalizing the maximum value, minimum value, first mean value and adaptive feature element of the eigenvalue vector respectively to obtain the eigenvalue corresponding to the eigenvalue vector.

[0011] In the above scheme, by calculating the statistical features of the time window data, such as the maximum, minimum, and first mean, and using MLP to adaptively extract feature elements, a multi-dimensional eigenvalue vector is formed. Combined with normalization processing to eliminate feature scale differences, it not only retains the basic distribution characteristics of the data, but also uses the nonlinear learning ability of MLP to explore potential feature associations, thereby improving the richness and adaptability of feature expression, providing more comprehensive and balanced feature input for subsequent anomaly detection, and enhancing the model's ability to capture abnormal signals.

[0012] As an alternative, standard scores include 、 、 as well as , the standard score is calculated using the following formula: ; ; ; ;in, 、 、 、 Respectively represent The maximum value, minimum value, first mean value and adaptive characteristic element of the eigenvalue vector, 、 、 、 They represent the average of the maximum value, the average of the minimum value, the average of the first mean value, and the average of the adaptive feature elements of all eigenvalue vectors, respectively. 、 、 、 They represent the standard deviation of the maximum value, minimum value, first mean value, and adaptive feature element of all eigenvalue vectors respectively.

[0013] In the above scheme, the standard score is calculated by the above formula, and the maximum value, minimum value, first mean value and adaptive feature elements of the time window data are standardized to eliminate the dimensional differences of different features, so that each feature value has a unified and comparable scale. At the same time, the degree of deviation of each feature value relative to the overall mean is quantified, highlighting the deviation amplitude of abnormal features, providing an accurate quantitative basis for the subsequent adaptive adjustment of the expansion rate based on the standard score, thereby improving the standardization of feature data processing and the accuracy of abnormal feature identification.

[0014] As an optional manner, determining the expansion rate of the corresponding time window data according to the standard score includes: determining the maximum value of the standard scores corresponding to each time window data as the expansion rate.

[0015] In the above scheme, by determining the maximum value of the standard scores corresponding to each time window data as the expansion rate, the scale of the convolution operation can be dynamically adapted based on the degree of feature deviation. A smaller expansion rate is automatically used for time periods with a higher possibility of abnormality (larger standard scores), thereby achieving refined capture of abnormal features. At the same time, a relatively larger expansion rate is used for normal feature areas to simplify calculations. While ensuring the accuracy of abnormal feature extraction, the model processing efficiency is improved, and the flexibility of feature expression and the targetedness of anomaly detection are enhanced.

[0016] As an optional method, reconstructing samples based on feature data output includes: generating a second mean and standard deviation of the feature data through an encoder; reparameterizing the second mean and standard deviation to obtain latent variables; and reconstructing data according to the latent variables through a decoder to obtain reconstructed samples.

[0017] In the above scheme, the encoder generates the second mean and standard deviation of the feature data, and the probability distribution of the latent variables can be constructed to capture the statistical laws of the feature data. The reparameterization technology is used to transform the random sampling process into a differentiable operation to ensure the stability of model training and the effectiveness of backpropagation. The decoder reconstructs the data based on the latent variables, and can map the feature data back to the data space to generate reconstructed samples that fit the normal data distribution, providing a reliable benchmark for accurately calculating the difference between the test data and the normal data, thereby improving the accuracy of anomaly detection and the generalization ability of the model.

[0018] As an optional method, before inputting the test data of the motor at multiple moments into the anomaly detection model to obtain reconstructed samples corresponding to the test data that are close to the normal data distribution, it also includes: inputting the running feature signal into the VAE model, and inputting the latent variables output by the encoder into the generative adversarial network, wherein the generative adversarial network includes a generator and a discriminator; iteratively training the encoder, decoder, generator and discriminator according to the encoder loss function, decoder loss function, generator loss function and discriminator loss function, saving the optimal parameters of the encoder and decoder, and obtaining the anomaly detection model.

[0019] In the above scheme, by inputting the running feature signal into the VAE model and combining it with the generator and discriminator of the generative adversarial network for joint training, the multi-loss function iterative optimization mechanism of the encoder, decoder, generator and discriminator is used to enable the model to fully learn the potential distribution characteristics of normal data, and enhance the authenticity and robustness of the feature expression with the help of the adversarial game process of the generative adversarial network, effectively solving the model training problem caused by the scarcity of abnormal samples. At the same time, by saving the optimal parameters, the accuracy and stability of the anomaly detection model in reconstructing the normal data distribution is ensured, laying a solid foundation for subsequent anomaly detection.

[0020] As an optional method, the difference index includes the mean square error between the test data and the reconstructed sample, and the motor is detected for abnormality based on the difference index, including: if the mean square error exceeds a preset threshold, it is determined that the motor is abnormal.

[0021] In the above scheme, by using the mean square error as a difference indicator, the degree of numerical deviation between the test data and the reconstructed sample can be quantified, and a standardized anomaly judgment rule is established with the help of a preset threshold, making the anomaly detection process intuitive and operational; when the mean square error exceeds the threshold, the motor is judged to be abnormal, and the deviation from the normal data distribution can be identified in a timely and clear manner, providing a concise and effective judgment basis for the rapid warning and accurate diagnosis of motor faults, and improving the real-time and reliability of anomaly detection.

[0022] In a second aspect, the present application provides an electronic device comprising: a processor, a memory and a bus, wherein the processor and the memory communicate with each other via the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method steps of the first aspect.

[0023] In a third aspect, the present application provides a computer-readable storage medium, comprising: the computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to execute the method steps of the first aspect.

[0024] In a fourth aspect, the present application provides a computer program product, comprising computer program instructions, which, when read and executed by a processor, execute the method steps of the first aspect.

[0025] Other features and advantages of the present application will be described in the subsequent description, and in part will become apparent from the description, or will be understood by practicing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 A flow chart of a motor abnormality detection method provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of a training motor anomaly detection model provided in an embodiment of the present application; Figure 3 A schematic diagram of the electronic device structure provided in an embodiment of the present application; Figure 4 A schematic structural diagram of a motor abnormality detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.

[0029] It should be noted that all technical and scientific terms used herein have the same meanings as those commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0030] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.

[0031] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0032] It can be understood that the motor abnormality detection method provided in the embodiment of the present application can be applied to a terminal device (also referred to as an electronic device) or a server; the terminal device can specifically be a smart phone, a tablet computer, a computer, a personal digital assistant (PDA), etc.; the server can specifically be an application server or a web server.

[0033] To facilitate understanding of the technical solution provided in the embodiment of the present application, the application scenario of the motor abnormality detection method provided in the embodiment of the present application is introduced below using a server as an example of the execution entity.

[0034] Reference Figure 1 , Figure 1 A flow chart of a motor abnormality detection method provided in an embodiment of the present application includes the following steps: Step S10: input the to-be-detected data of the motor at multiple time points into the anomaly detection model to obtain a reconstructed sample corresponding to the to-be-detected data and close to a normal data distribution, wherein the anomaly detection model comprises a VAE model, the VAE model comprises an encoder and a decoder, and the anomaly detection model is obtained according to running characteristic signals of the motor in a normal working state and in combination with variational inference of the VAE model and adversarial game training of a generative adversarial network.

[0035] When it is necessary to detect the motor, the to-be-detected data of the motor at multiple continuous time points, such as vibration acceleration signals, current effective values, magnetic field signals and the like, are acquired by a sensor to form a time series data sequence. The core of step S10 is to process the to-be-detected data of the motor by using the pre-trained anomaly detection model to generate a reconstructed sample reflecting the characteristic of the normal data distribution. The reconstructed sample is an output sample generated by encoding and decoding the input data by the VAE model, and the core target is to approximate the distribution characteristic of the normal input data used when training the model as much as possible. The anomaly detection model is trained in combination with the adversarial game mechanism of the generative adversarial network (GAN) based on the variational autoencoder (VAE) as a basic framework.

[0036] The VAE model comprises an encoder and a decoder, and the core content is variational inference. The VAE can generate a latent space to compress the real sample into some feature points, and then sample the low-dimensional feature points to generate a reconstructed sample approximating the real sample. The function of the encoder is to map the input to-be-detected data of the motor to a latent feature space, and output a latent variable subject to a Gaussian distribution. The decoder reconstructs the input data according to the latent variable to realize the fitting of the normal data distribution.

[0037] The VAE applied to the motor anomaly detection can well represent the sample features, and the difference between the reconstructed sample and the real sample can be directly compared through the encoding and decoding steps. However, since the VAE training completely depends on the assumed loss function and Kullback-Leibler divergence to approximate the real distribution, the mapping between the input sample and the hidden vector exists information loss, so that the generated data exists deviation.

[0038] Therefore, the embodiments of the present application introduce the generator and discriminator in GAN when training the anomaly detection model. The generator generates simulated data based on the latent variables output by the VAE encoder, and the discriminator is responsible for distinguishing whether the input data is real normal data or generated simulated data. Through the adversarial game between the two, the generator and the discriminator reach a Nash equilibrium through backpropagation, that is, the loss function of both models can be minimized, and the model's ability to learn the normal data distribution is optimized. The training process of the anomaly detection model is as follows: The motor's operating characteristic signals (such as vibration signals, current signals, and other time series data) are collected in normal working state and input into the VAE model as training data. The encoder encodes the normal operating characteristic signals to generate latent variables. Obey the posterior distribution , are encoder parameters, where the distribution of latent variables approximates the standard normal distribution through the KL divergence constraint. The generator is based on the latent variable Generate simulated data G(z), the discriminator discriminates the real data x and the generated data G(z), and outputs the discrimination probability D(x) and D(G(z)). The objective function of VAE is ,in, Indicates that the encoder is based on the input Generated latent variables The posterior distribution of are encoder parameters, represents the probability distribution of the decoder, are encoder parameters, represents the Kullback-Leibler divergence value, Indicates The mathematical expectation is calculated under the distribution, and the objective function of GAN is adopted ,in, represents the input of the generator, represents the input of the discriminator, represents the generated samples of the generator, Indicates that the discriminator determines the generated sample is the probability of the true sample, Denotes that the discriminator determines is the probability of the true sample, represents the distribution of real samples, Represents input The prior distribution of Indicates the real sample distribution Lower pair input Find the mathematical expectation, Represents the prior distribution of real samples The mathematical expectation is calculated below. By jointly optimizing the encoder loss function (KL divergence), the decoder loss function (reconstruction error, such as mean squared error), the generator loss function (minimizing the discriminator's probability of distinguishing generated data), and the discriminator loss function (maximizing the accuracy of distinguishing real data from generated data), the model learns the underlying distribution characteristics of normal data.

[0039] In the detection phase, after the test data is input into the trained anomaly detection model, the encoder extracts and encodes the time series data to generate a latent variable z, which represents the distribution of the test data in the latent space. The decoder reconstructs the data based on the latent variable z and outputs a reconstructed sample that is close to the normal data distribution. Since the model is trained on data from the motor’s normal operating state, the reconstructed samples reflect the model’s best fit to the “normal state”.

[0040] Step S20: Calculate the difference index between the test data and the reconstructed sample, and perform abnormality detection on the motor based on the difference index.

[0041] Step S20 determines an abnormality by quantifying the degree of deviation between the measured data and the reconstructed sample distribution. A smaller deviation indicates that the measured data is closer to a normal distribution, while a larger deviation indicates a more significant deviation. A preset abnormality threshold θ is used. When the calculated difference index exceeds the threshold θ, the motor is considered abnormal. If it does not exceed the threshold, the motor is considered to be operating normally.

[0042] In this approach, the anomaly detection model is derived by utilizing the motor's operating characteristic signals under normal operating conditions, combining variational reasoning with a VAE model and adversarial game training with a generative adversarial network. This model can learn the distribution characteristics of normal data, effectively addressing the scarcity of abnormal samples and the imbalance of sample distribution, thereby improving the stability of model training. By inputting the motor's test data at multiple moments into this anomaly detection model, reconstructed samples that approximate the normal data distribution can be obtained. Anomaly detection is performed by calculating the difference between the test data and the reconstructed samples. This effectively measures the degree of deviation between the test data and normal data, thereby improving the precision and accuracy of motor anomaly detection and providing strong support for predictive maintenance of motors.

[0043] In some embodiments, the encoder includes an adaptive dilated convolution unit, and step S10 includes: Step S101: Divide the data to be measured into time windows according to a preset time length to obtain multiple time window data.

[0044] For the time series test data collected during motor operation, the continuous data is divided into multiple time window data segments according to a preset duration. Those skilled in the art can adjust the preset duration according to actual conditions, and this application does not impose specific limitations on this. For example, the preset duration can be set to 5 seconds. Since the collected test data is collected uniformly, each time window data segment contains the same number of continuous sampling points (e.g., 100 test data points).

[0045] Step S102: Extract features from each time window data to obtain corresponding feature values.

[0046] For each time window, extract statistical quantities or transformation features that reflect the data distribution, such as time-domain and frequency-domain features. For example, basic statistical features such as the maximum, minimum, and mean can be extracted, or frequency features can be extracted through signal transformations (such as Fourier transforms). The extracted feature values ​​can be used to form a multidimensional feature vector, with each dimension corresponding to a feature type, which comprehensively characterizes the signal characteristics within that time period.

[0047] Step S103: Calculate the standard score corresponding to each eigenvalue.

[0048] A standard score (Z-Score) is calculated for each eigenvalue to eliminate dimensional differences between features and make them comparable. The standard score reflects the degree to which a single eigenvalue deviates from the mean of the feature across all time window data. A larger absolute value of the standard score indicates a greater degree of deviation from the normal data distribution for that eigenvalue, and a greater likelihood of anomalies in the corresponding time window data.

[0049] Step S104: Determine the expansion rate of the corresponding time window data according to the standard score, input the time window data into the adaptive expansion convolution unit for expansion convolution, and obtain feature data.

[0050] Based on the standard score of each time window data, a corresponding dilation rate is assigned to it. The dilation rate determines the spacing between sampling points in the convolution operation. For example, a dilation rate of 2 means that one sampling point is separated from each other, while a dilation rate of 6 means that five sampling points are separated from each other. Time window data with high standard scores indicates significant feature deviations, so a smaller dilation rate is assigned to it to fine-tune the capture of local abnormal features. Time window data with low standard scores indicates that the features are close to the normal distribution, so a larger dilation rate is assigned to simplify calculations and extract global features.

[0051] The time window data is fed into the adaptive dilated convolution unit, which performs convolution operations based on the assigned dilation rate to generate feature data containing multi-scale features. This process effectively captures the detailed differences in abnormal features in different time windows while reducing the computational redundancy caused by using a fixed-depth architecture.

[0052] Step S105: Output a reconstructed sample based on the feature data.

[0053] The feature data output by the adaptive dilated convolution unit is subsequently processed by the encoder to generate latent variables. The decoder then generates reconstructed samples based on these latent variables. These samples reflect the model's fit to the normal data distribution. By adaptively adjusting the dilation rate, the feature data can more accurately represent signal characteristics at different time periods, thereby improving the accuracy of the reconstructed samples.

[0054] In the above scheme, the test data is divided into time windows with preset time lengths and feature values ​​are extracted. The expansion rate is adaptively determined in combination with the standard score, and multi-scale feature extraction is performed on different feature data using adaptive expansion convolution units. This can not only capture abnormal details for high-deviation features, but also simplify the processing of low-deviation features to improve efficiency, effectively avoiding the inefficiency of complex deep architectures, thereby improving the characterization ability of feature data, making the output reconstructed samples more accurately reflect the normal data distribution characteristics, and providing a more reliable basis for anomaly detection.

[0055] In some embodiments, the encoder includes a multi-layer perceptron (MLP), and step S102 includes: Step 1) Calculate the eigenvalue vector corresponding to each time window data segment, where the eigenvalue vector includes at least one of the maximum value, minimum value, first mean value, and adaptive feature element in the time window data segment, wherein the adaptive feature element is obtained by inputting each time window data segment into the MLP.

[0056] The following uses the maximum value, minimum value, first mean value, and adaptive feature element as examples to illustrate. For each time window data segmented in step S101 (e.g., a vibration signal sequence of 5 seconds and 100 sampling points), the following basic statistical features are first extracted as feature values: Maximum value: The peak value of the data within the time window, reflecting the extreme fluctuation of the signal.

[0057] Minimum value: The valley value of the data within the time window, which together with the maximum value represents the fluctuation range of the signal.

[0058] First mean: The arithmetic mean of the data within the time window, reflecting the average level of the signal.

[0059] Then the following features are extracted adaptively through MLP: Adaptive feature elements: Each time window data is used as input by an MLP, which, through multiple layers of nonlinear transformations, outputs an adaptive feature element. This element automatically learns underlying patterns (such as periodicity and trends) in the data using the MLP's weight parameters. This element compensates for the inadequacy of basic statistical features in representing complex features and mitigates the randomness of the three eigenvalues ​​mentioned above. The encoder integrates a multilayer perceptron (MLP) to enhance the feature representation of time window data. The MLP consists of an input layer, hidden layers, and an output layer. The hidden layers can contain one or more layers of fully connected neurons, and learn the nonlinear characteristics of the data using nonlinear activation functions (such as ReLU and Sigmoid).

[0060] The above four types of eigenvalues ​​are combined into eigenvalue vectors in a fixed order to form a multi-dimensional description of the data in each time window. For example, let U represent all eigenvalue vectors, , where n represents n segments of data. The eigenvalue vectors can also be combined into a feature matrix as shown below: ; Step 2) Normalize the maximum value, minimum value, first mean value and adaptive characteristic element of the eigenvalue vector respectively to obtain the eigenvalue corresponding to the eigenvalue vector.

[0061] Because the dimensions and value ranges of the maximum, minimum, first mean, and adaptive feature elements may differ, it is necessary to normalize the eigenvalues ​​of each dimension in the eigenvalue vector separately, for example, using Min-Max normalization, to eliminate the impact of scale deviation on subsequent model training. After normalization, each element of the eigenvalue vector is adjusted to a uniform scale, forming the final eigenvalue used for subsequent processing, ensuring that the encoder treats features of different dimensions equally.

[0062] In the above scheme, by calculating the statistical features such as the maximum, minimum, and first mean of the time window data, and using MLP to adaptively extract feature elements to form a multi-dimensional eigenvalue vector, combined with normalization processing to eliminate feature scale differences, it not only retains the basic distribution characteristics of the data, but also uses the nonlinear learning ability of MLP to explore potential feature associations, thereby improving the richness and adaptability of feature expression, providing more comprehensive and balanced feature input for subsequent anomaly detection, and enhancing the model's ability to capture abnormal signals.

[0063] In some embodiments, the standard score includes 、 、 as well as , the standard score is calculated using the following formula: ; ; ; ; in, 、 、 、 Respectively represent The maximum value, minimum value, first mean value and adaptive characteristic element of the eigenvalue vector, 、 、 、 They represent the average of the maximum value, the average of the minimum value, the average of the first mean value, and the average of the adaptive feature elements of all eigenvalue vectors, respectively. 、 、 、 They represent the standard deviation of the maximum value, minimum value, first mean value, and adaptive feature element of all eigenvalue vectors respectively.

[0064] For the eigenvalue vectors of all time window data output in step S102, the statistical parameters of each feature dimension are calculated respectively, including the mean of the maximum value, the standard deviation of the maximum value, the mean of the minimum value, the standard deviation of the minimum value, the mean of the first mean value, the standard deviation of the first mean value, the mean of the adaptive feature element, and the standard deviation of the adaptive feature element. Then, the standard score (Z-Score) is used to quantify the degree of deviation of each eigenvalue in the time window data from the overall distribution. The larger the absolute value of the standard score, the more significant the deviation of the eigenvalue from the normal distribution. For example, when When the corresponding maximum value belongs to an extreme value with a probability of less than 0.3% in the normal distribution (assuming that the data is approximately normally distributed), it can be directly marked as an abnormal candidate. It can be understood that 0.3% is only an example and can be adjusted to other values.

[0065] In the above scheme, the standard score is calculated by the above formula, and the maximum value, minimum value, first mean value and adaptive feature elements of the time window data are standardized to eliminate the dimensional differences of different features, so that each feature value has a unified and comparable scale. At the same time, the degree of deviation of each feature value relative to the overall mean is quantified, highlighting the deviation amplitude of abnormal features, providing an accurate quantitative basis for the subsequent adaptive adjustment of the expansion rate based on the standard score, thereby improving the standardization of feature data processing and the accuracy of abnormal feature identification.

[0066] In some embodiments, determining the expansion rate of the corresponding time window data according to the standard score in step S104 includes: The maximum value of the standard scores corresponding to each time window data is determined as the expansion rate.

[0067] Through the steps in the above embodiment, 4 Z-Scores can be obtained for each time window ( , , , ) score, and the largest score is selected from the four scores as the representative. Because a larger Z value indicates a larger deviation, the likelihood of an anomaly within that time window is higher. Typically, a Z value greater than 3 is considered an anomaly, indicating that an outlier is a data point outside of 3 standard deviations from the mean. A dilation rate is then adaptively assigned to the data within each time window based on the maximum Z-score value. In one embodiment, the dilation rate can be 2, 4, 6, or 8. When the maximum Z-score value of the time window data is ≥3, a dilation rate of 2 is assigned, as this allows for more detailed extraction of anomaly features within that time window. When the maximum Z-score value of the time window data is 2≤Z<3, a dilation rate of 4 is assigned. When the maximum Z-score value of the time window data is 1≤Z<2, a dilation rate of 6 is assigned. When the maximum Z-score value of the time window data is 0≤Z<1, a dilation rate of 8 is assigned. This is because the amount of non-anomalous data is large and similar. A larger dilation rate can simplify the model while reducing the amount of noise data, thereby improving accuracy.

[0068] The process of allocating expansion rates can be expressed as follows: ; in, =1,2,…,n, indicating n time windows, Indicates the The time window data after the dilated convolution, Indicates the Time window data, represents dilated convolution, represents the expansion rate.

[0069] In the above scheme, by determining the maximum value of the standard scores corresponding to each time window data as the expansion rate, the scale of the convolution operation can be dynamically adapted based on the degree of feature deviation. A smaller expansion rate is automatically used for time periods with a higher possibility of abnormality (larger standard scores), thereby achieving refined capture of abnormal features. At the same time, a relatively larger expansion rate is used for normal feature areas to simplify calculations. While ensuring the accuracy of abnormal feature extraction, the model processing efficiency is improved, and the flexibility of feature expression and the targetedness of anomaly detection are enhanced.

[0070] In some embodiments, step S105 includes: Step 1) Generate the second mean and standard deviation of the feature data through the encoder.

[0071] The encoder receives the feature data output from the adaptive dilated convolution unit, which already contains multi-scale feature information after time window division, feature extraction and dilated convolution processing. The encoder further abstracts the feature data through two MLPs, one of which outputs the second mean. , an MLP output standard deviation The second mean and standard deviation The Gaussian distribution of the latent variable z is defined , which enables the model to capture the probability distribution characteristics of feature data rather than a single definite value.

[0072] Step 2) Reparameterize the second mean and standard deviation to obtain the latent variable.

[0073] In order to solve the problem of non-differentiable sampling operation when generating latent variables, the reparameterization method is used to transform the random sampling process into a differentiable calculation process: First, a random noise vector is sampled from the standard normal distribution , and then by the formula , generating latent variables .

[0074] Step 3) The decoder reconstructs the data based on the latent variables to obtain reconstructed samples.

[0075] The decoder maps the latent variable z from the low-dimensional feature space back to the original data space through layer-by-layer nonlinear transformation, and the generated reconstructed samples approximate the normal data distribution.

[0076] In the above scheme, the encoder generates the second mean and standard deviation of the feature data, and the probability distribution of the latent variables can be constructed to capture the statistical laws of the feature data. The reparameterization technology is used to transform the random sampling process into a differentiable operation, thereby improving the stability of model training and the effectiveness of backpropagation. The decoder reconstructs the data based on the latent variables, and can map the feature data back to the data space to generate reconstructed samples that fit the normal data distribution, providing a reliable benchmark for accurately calculating the difference between the test data and the normal data, thereby improving the accuracy of anomaly detection and the generalization ability of the model.

[0077] In some embodiments, before step S10, the method further includes: Step 1) Input the running feature signal into the VAE model, and input the latent variable output by the encoder into the generative adversarial network, where the generative adversarial network includes a generator and a discriminator.

[0078] The training dataset is constructed by collecting time-series data of the motor's operating characteristic signals under normal operating conditions, such as vibration, current, and temperature. These characteristic signals are then fed into a VAE model, which consists of an encoder and a decoder. The encoder outputs latent variables, which are then fed into a generative adversarial network (GAN). The generator can embed an LSTM network to explore the interrelationships between temporal variables and improve the expressiveness of features. The generated samples are then mixed with the input operating characteristic signal samples and fed into a discriminator. The mixed data is then used to train the discriminator, achieving a game equilibrium between the generator and the discriminator.

[0079] Step 2) Iteratively train the encoder, decoder, generator, and discriminator according to the encoder loss function, decoder loss function, generator loss function, and discriminator loss function, save the optimal parameters of the encoder and decoder, and obtain the anomaly detection model.

[0080] The model is iteratively trained using the following four loss functions: Encoder loss function for: ; in, Represents latent variables No. dimension, Indicates the encoder output The variance of the dimensional latent variable, Indicates the encoder output The square of the mean of the dimensional latent variable.

[0081] The goal of the encoder loss function is to constrain the distribution of the latent variable z to approach the standard normal distribution, preventing overfitting and enhancing generalization ability.

[0082] Decoder loss function for: ; in, , represents time t, represents the input sample data at time t, Represents the reconstructed sample data at time t.

[0083] The goal of the decoder loss function is to measure the difference between the reconstructed sample and the original input, ensuring that the decoder can accurately restore the normal data characteristics and mine deeper and more important features in the data.

[0084] Generator loss function for: ; in, represents the input of the generator, represents the generated samples of the generator, Indicates that the discriminator determines the generated sample is the probability of the true sample, Represents latent variables The distribution of Represents the latent variable According to its distribution Find the mathematical expectation.

[0085] The goal of the generator loss function is to train the generator so that the samples it generates can deceive the discriminator, improve the model's ability to fit the normal data distribution, and make the generated samples as close to the real samples as possible.

[0086] Discriminator loss function for: ; in, represents the input of the discriminator, Denotes that the discriminator determines is the probability of the true sample, represents the distribution of real samples, Indicates the real sample distribution Next variable Find the mathematical expectation.

[0087] The goal of the discriminator loss function is to train the discriminator to accurately distinguish between real data and generated data, and to enhance the model’s sensitivity to abnormal data. and the distribution of generated samples As input, the discriminator outputs a probability value about the sample being identified, that is, a direct scalar in the range of 0-1. The discriminator's goal is to identify whether the sample being identified is a real sample or a generated sample as much as possible. If the input is a real sample, the discriminator's output probability value is 1, and if the input is a generated sample, the discriminator's output probability value is 0. The learning goal of the discriminator is to make the output of real samples converge to 1 and the output of generated samples converge to 0.

[0088] Perform joint optimization of multiple loss functions and adopt an alternating iterative optimization method. You can first fix the encoder and decoder, optimize the discriminator parameters, and maximize the discriminator loss function. Then fix the discriminator and optimize the encoder, decoder and generator parameters to minimize ,When the decoder loss function and the discrimination accuracy reach a stable threshold, the optimal parameters of the encoder and decoder are saved, the generator and discriminator are discarded, and only the encoder-decoder structure that has undergone adversarial training is retained as the anomaly detection model.

[0089] In the above scheme, by inputting the running feature signal into the VAE model and combining it with the generator and discriminator of the generative adversarial network for joint training, the multi-loss function iterative optimization mechanism of the encoder, decoder, generator and discriminator is used to enable the model to fully learn the potential distribution characteristics of normal data, and enhance the authenticity and robustness of the feature expression with the help of the adversarial game process of the generative adversarial network, effectively solving the model training problem caused by the scarcity of abnormal samples. At the same time, by saving the optimal parameters, the accuracy and stability of the anomaly detection model in reconstructing the normal data distribution is ensured, laying a solid foundation for subsequent anomaly detection.

[0090] In some embodiments, the difference index includes a mean square error between the measured data and the reconstructed sample, and abnormality detection of the motor is performed based on the difference index, including: if the mean square error exceeds a preset threshold, determining that the motor is abnormal.

[0091] For the i The data to be tested in a time window and the corresponding reconstructed samples , the mean square error calculation formula is:

[0092] in, n For the i The number of sampling points in a time window, and Respectively i In the time window j The true value and reconstructed value of the data point.

[0093] The mean square error (MSE) reflects how well the reconstructed samples fit the original data. Because anomaly detection models are trained on normal data, when the data to be tested contains abnormal features, the reconstructed samples cannot accurately reproduce these features, resulting in a significant increase in the MSE.

[0094] Those skilled in the art can set the value of the preset threshold based on experience, and this application does not make any specific limitation on this. For example, the threshold is ( k is the coefficient, and if 3 is taken, it means a 99.7% confidence interval), where is the mean of the distribution parameters of the MSE calculated based on normal training data, is the standard deviation of the distribution parameter of MSE calculated based on normal training data. , then determine the If the motor operating status in a time window is abnormal, otherwise it is judged to be normal operation.

[0095] In the above scheme, by using the mean square error as a difference indicator, the degree of numerical deviation between the test data and the reconstructed sample can be quantified, and a standardized anomaly judgment rule is established with the help of a preset threshold, making the anomaly detection process intuitive and operational; when the mean square error exceeds the threshold, the motor is judged to be abnormal, and the deviation from the normal data distribution can be identified in a timely and clear manner, providing a concise and effective judgment basis for the rapid warning and accurate diagnosis of motor faults, and improving the real-time and reliability of anomaly detection.

[0096] Reference Figure 2 , Figure 2 A structural diagram of a training motor anomaly detection model provided in an embodiment of the present application. Figure 2 The training process of the motor anomaly detection model is demonstrated using the normal vibration data of the motor as input data.

[0097] The present application provides a computer program product, including computer program instructions. When the computer program instructions are read and executed by a processor, the methods provided by the above-mentioned method embodiments are executed.

[0098] The present application provides a computer-readable storage medium, including: a computer-readable storage medium storing computer instructions, wherein the computer instructions enable a computer to execute the methods provided by the above-mentioned method embodiments.

[0099] Figure 3 This is a schematic diagram of the electronic device structure provided in the embodiment of the present application, such as Figure 3 As shown, the electronic device includes: a processor 301, a memory 302 and a bus 303; wherein, the processor 301 and the memory 302 communicate with each other through the bus 303; the memory 302 stores program instructions that can be executed by the processor 301, and the processor 301 calls the program instructions to execute the methods provided by the above-mentioned method embodiments.

[0100] The processor 301 includes one or more (only one is shown in the figure), which can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 301 can be a general-purpose processor, including a central processing unit (CPU), a microcontroller unit (MCU), a network processor (NP), or other conventional processors; it can also be a special-purpose processor, including a neural network processing unit (NPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Furthermore, when there are multiple processors 301, some of them can be general-purpose processors, and others can be special-purpose processors.

[0101] Memory 302 includes one or more (only one is shown in the figure), which may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), and electrically erasable programmable read-only memory (EEPROM). Processor 301 and other possible components can access memory 302 and read and / or write data therein.

[0102] In particular, one or more computer program instructions may be stored in the memory 302 , and the processor 301 may read and execute these computer program instructions to implement the weak password scanning behavior identification method provided in the embodiment of the present application.

[0103] Bus 303 includes one or more (only one is shown in the figure) devices that can be used to communicate directly or indirectly with other devices to exchange data. Bus 303 may include devices for wired or wireless communication, such as optical fibers, Serial Peripheral Interface (SPI) modules, and Inter-Integrated Circuit (I2C) buses. It may also include devices for wireless communication, such as Bluetooth modules, Wi-Fi modules, and mobile communication modules (e.g., 4G and 3G modules).

[0104] Understandably, Figure 3 The structure shown is only for illustration, and the electronic device may also include Figure 3 More or fewer components than shown, or with Figure 3 Different structures are shown. Figure 3 Each component shown in the figure can be implemented using hardware, software, or a combination thereof. The electronic device may be a physical device, such as a switch, router, server, or PC, or a virtual device, such as a virtual machine or virtualized container. Furthermore, the electronic device is not limited to a single device but may also be a combination of multiple devices or an integrated environment consisting of a large number of devices.

[0105] Reference Figure 4 , Figure 4 A schematic diagram of a motor abnormality detection device provided in an embodiment of the present application includes: Input module 410: used to input the test data of the motor at multiple moments into the anomaly detection model to obtain reconstructed samples corresponding to the test data that are close to the normal data distribution, wherein the anomaly detection model includes a VAE model, and the VAE model includes an encoder and a decoder. The anomaly detection model is based on the operating characteristic signals of the motor under normal working conditions, combined with the variational reasoning of the VAE model and the adversarial game training of the generative adversarial network.

[0106] The calculation module 420 is used to calculate a difference index between the test data and the reconstructed sample, and perform abnormality detection on the motor based on the difference index.

[0107] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0108] In addition, the units described as separate components may or may not be physically separate, and 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0109] Furthermore, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0110] The above are merely examples of the present application and are not intended to limit the scope of protection of the present application. Those skilled in the art will appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A method for detecting motor abnormality, characterized in that: include: Inputting the test data of the motor at multiple moments into an anomaly detection model to obtain reconstructed samples corresponding to the test data that are close to the normal data distribution, wherein the anomaly detection model includes a VAE model, the VAE model including an encoder and a decoder, and the anomaly detection model is trained based on the operating characteristic signals of the motor under normal working conditions, combining the variational reasoning of the VAE model with the adversarial game training of the generative adversarial network; A difference index between the test data and the reconstructed sample is calculated, and abnormality detection is performed on the motor based on the difference index.

2. The method according to claim 1, characterized in that The encoder includes an adaptive dilated convolution unit, which inputs the test data of the motor at multiple moments into the anomaly detection model to obtain reconstructed samples corresponding to the test data that are close to the normal data distribution, including: Divide the data to be measured into time windows according to a preset time length to obtain multiple time window data; Perform feature extraction on each time window data to obtain corresponding feature values; Calculating a standard score corresponding to each of the eigenvalues; Determining a dilation rate for the corresponding time window data according to the standard score, inputting the time window data into the adaptive dilated convolution unit for dilated convolution to obtain feature data; The reconstructed sample is output based on the feature data.

3. The method according to claim 2, characterized in that The encoder includes a multi-layer perceptron MLP, and the feature extraction of each time window data to obtain a corresponding feature value includes: Calculate an eigenvalue vector corresponding to each time window data segment, wherein the eigenvalue vector includes at least one of a maximum value, a minimum value, a first mean value, and an adaptive feature element in the time window data segment, wherein the adaptive feature element is obtained by inputting each time window data segment into the MLP; Normalization is performed on the maximum value, the minimum value, the first mean value, and the adaptive characteristic element of the eigenvalue vector to obtain the eigenvalue corresponding to the eigenvalue vector.

4. The method according to claim 3, characterized in that The standard scores include 、 、 as well as , the standard score is calculated using the following formula: ; ; ; ; Among them, the 、 、 、 Respectively represent The maximum value, minimum value, first mean value and adaptive characteristic element of the eigenvalue vector, 、 、 、 Respectively represent the average value of the maximum value, the average value of the minimum value, the average value of the first mean value and the average value of the adaptive feature element of all eigenvalue vectors, 、 、 、 They represent the standard deviation of the maximum value, minimum value, first mean value, and adaptive feature element of all eigenvalue vectors respectively.

5. The method according to claim 4, characterized in that Determining the expansion rate of the corresponding time window data according to the standard score includes: The maximum value of the standard scores corresponding to each time window data is determined as the expansion rate.

6. The method according to claim 2, characterized in that Outputting the reconstructed sample based on the feature data includes: generating, by the encoder, a second mean and a standard deviation of the feature data; reparameterizing the second mean and the standard deviation to obtain a latent variable; The decoder reconstructs data according to the latent variables to obtain the reconstructed samples.

7. The method according to claim 1, characterized in that Before inputting the test data of the motor at multiple moments into the anomaly detection model to obtain reconstructed samples corresponding to the test data that are close to the normal data distribution, the method further includes: Inputting the running feature signal into the VAE model, and inputting the latent variable output by the encoder into the generative adversarial network, wherein the generative adversarial network includes a generator and a discriminator; The encoder, the decoder, the generator, and the discriminator are iteratively trained according to the encoder loss function, the decoder loss function, the generator loss function, and the discriminator loss function, and the optimal parameters of the encoder and the decoder are saved to obtain the anomaly detection model.

8. The method according to any one of claims 1 to 7, characterized in that The difference index includes a mean square error between the test data and the reconstructed sample, and the abnormality detection of the motor based on the difference index includes: If the mean square error exceeds a preset threshold, it is determined that an abnormality exists in the motor.

9. An electronic device, characterized in that: include: A processor, a memory, and a bus, wherein the processor and the memory communicate with each other via the bus; The memory stores program instructions that can be executed by the processor, and the processor can execute the method according to any one of claims 1 to 8 by calling the program instructions.

10. A computer-readable storage medium, characterized in that include: The computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to execute the method according to any one of claims 1 to 8.