Welding quality abnormity early warning method and system

By combining the CNN-LSTM network and VAE model, the existing welding quality monitoring methods have been solved, and the problems of limited accuracy and insufficient spatial and temporal feature modeling are realized, high-precision welding quality abnormality detection and correction are achieved, and the accuracy of welding quality monitoring is improved. efficiency.

CN119494019APending Publication Date: 2025-02-21HEFEI GUOXUAN HIGH TECH POWER ENERGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411682742.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The existing battery welding quality monitoring methods rely on manual annotation, with limited accuracy, and cannot fully model the spatio-temporal characteristics of the welding process, and lack a correction mechanism for the preliminary prediction results, resulting in low abnormal detection accuracy.

Method used

The CNN-LSTM network combined with the VAE model is used to extract the local spatial characteristics of welding power waveform data through convolutional neural networks. The long and short-term memory network captures the time series characteristics. The variational autoencoder optimizes and corrects the preliminary prediction results, and finally uses DTW distance Distribution makes abnormal judgments.

Benefits of technology

It improves the accuracy and robustness of welding quality abnormality detection, effectively captures the spatio-temporal characteristics of welding power waveform data, enhances the accuracy and correction capabilities of the model, and reduces the cost of manual intervention and subsequent detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494019A_ABST
    Figure CN119494019A_ABST
Patent Text Reader

Abstract

The invention discloses an early warning method and system for abnormal welding quality, and the method comprises the steps: carrying out the preprocessing of collected ultrasonic welding power data, obtaining a data set, and dividing the data set into a training set and a test set; based on a training set in the data set, training to obtain an anomaly detection model of the CNN-LSTM network, and testing through a test set; inputting ultrasonic welding power data to be detected into the anomaly detection model for prediction to obtain a preliminary prediction result, namely obtaining a preliminary power waveform data code; correcting the preliminary prediction result by using a VAE model to obtain a final prediction result, namely obtaining a reconstructed power waveform data code; and the DTW distance distribution is adopted to conduct anomaly judgment on the final prediction result, and if the DTW distance of the final prediction result is larger than a DTW distance threshold value, it is determined that the ultrasonic welding power to be detected is abnormal. And the identification and prediction capability of welding quality abnormity and the precision of an abnormity detection model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of early warning technology, and in particular to an early warning method and system for abnormal welding quality. Background Art

[0002] With the rapid development of the electric vehicle industry, the performance and quality requirements for battery products are getting higher and higher. Among them, the welding quality of battery cells is one of the key factors affecting the overall performance of the battery pack.

[0003] For a long time, battery manufacturers have been facing the problem of battery cell welding quality, which has led to quality risks in a large number of battery cells, thus affecting the overall quality and efficiency of the battery. In recent years, deep learning has been generally used in the prior art to extract the spatiotemporal characteristics of the welding power waveform sequence to accurately identify abnormal welding quality. However, the existing battery welding quality early warning monitoring method has the following problems:

[0004] (1) Methods that rely on manual labeling have limited accuracy: Currently, most battery welding quality monitoring solutions rely on manually labeled sample data for feature engineering and model training, which cannot fully explore the complex patterns contained in the data, resulting in low anomaly detection accuracy.

[0005] (2) Lack of comprehensive modeling of the spatiotemporal characteristics of the welding process: Welding power waveform data has both local spatial characteristics and time series characteristics. Existing methods are usually unable to effectively capture these two characteristics, which affects the accuracy of anomaly detection.

[0006] (3) Insufficient correction capability of preliminary prediction results: There are certain limitations in relying solely on supervised learning models for welding quality prediction, and there is a lack of a mechanism to optimize and correct the prediction results using unsupervised learning technology. Summary of the invention

[0007] The present invention aims to provide a method and system for early warning of welding quality anomalies, so as to improve the recognition and prediction capabilities of welding quality anomalies and the accuracy of anomaly detection models.

[0008] To achieve the above object, the present invention provides the following technical solutions:

[0009] In a first aspect, an embodiment of the present invention provides an early warning method for abnormal welding quality, comprising:

[0010] The collected ultrasonic welding power data is preprocessed to obtain a data set, and the data set is divided into a training set and a test set;

[0011] Based on the training set in the data set, a CNN-LSTM network anomaly detection model is trained and tested using a test set;

[0012] Inputting the ultrasonic welding power data to be measured into the anomaly detection model for prediction to obtain a preliminary prediction result, that is, obtaining a preliminary power waveform data code;

[0013] The VAE model is used to correct the preliminary prediction results to obtain the final prediction results, that is, to obtain the reconstructed power waveform data encoding;

[0014] The DTW distance distribution is used to judge the abnormality of the final prediction result. If the DTW distance of the final prediction result is greater than the DTW distance threshold, it is determined that the ultrasonic welding power to be tested is abnormal.

[0015] In a second aspect, an embodiment of the present invention provides an early warning system for abnormal welding quality, comprising:

[0016] An acquisition processing unit, used for preprocessing the acquired ultrasonic welding power data to obtain a data set, and dividing it into a training set and a test set;

[0017] A model building unit, used for training an anomaly detection model of a CNN-LSTM network based on a training set in the data set, and testing the model through a test set;

[0018] A prediction unit, used for inputting the ultrasonic welding power data to be measured into the abnormality detection model for prediction to obtain a preliminary prediction result, that is, to obtain a preliminary power waveform data code;

[0019] A correction unit, used to correct the preliminary prediction result using the VAE model to obtain the final prediction result, that is, to obtain the reconstructed power waveform data encoding;

[0020] The abnormality detection unit is used to use the DTW distance distribution to make an abnormality judgment on the final prediction result. If the DTW distance of the final prediction result is greater than the DTW distance threshold, it is determined that the ultrasonic welding power to be tested is abnormal.

[0021] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program or instructions to implement the steps of the aforementioned method for early warning of abnormal welding quality.

[0022] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein a computer program or instruction is stored in the computer storage medium, and when the computer program or instruction is executed by a processor, the steps of the aforementioned method for early warning of abnormal welding quality are implemented.

[0023] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps of the aforementioned method for early warning of abnormal welding quality.

[0024] Technical effects and advantages of the present invention: 1. The present invention adopts a deep learning model combining a convolutional neural network (CNN) and a long short-term memory network (LSTM), which can effectively extract complex spatiotemporal features in welding power waveform data. Through an end-to-end learning method, it does not need to rely on artificial feature engineering, improves the accuracy of anomaly detection, effectively captures the spatiotemporal features of welding power waveform data, and enhances the robustness and accuracy of the anomaly detection model;

[0025] 2. The CNN-LSTM hybrid model can simultaneously model the local spatial features and time series features of the data, improve the ability to identify abnormal patterns in the welding power waveform, enhance the robustness of the model, and use unsupervised learning technology to optimize and correct the preliminary prediction results, further improving the accuracy of welding quality warning;

[0026] 3. The variational autoencoder (VAE) is introduced as an unsupervised generation model to optimize and correct the preliminary prediction results of the CNN-LSTM model, which effectively reduces the prediction bias of the supervised learning model and further improves the accuracy of welding quality warning.

[0027] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 This is a flow chart of an early warning method for abnormal welding quality according to an embodiment of the present invention;

[0030] Figure 2 A detailed flow chart of an early warning method for abnormal welding quality according to an embodiment of the present invention;

[0031] Figure 3 This is a schematic structural diagram of an early warning system for abnormal welding quality according to an embodiment of the present invention;

[0032] Figure 4 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] In order to solve the deficiencies of the prior art, the present invention discloses an early warning method for abnormal welding quality, such as Figure 1 and Figure 2 As shown, the following steps are included:

[0035] Step S1: preprocessing the collected ultrasonic welding power data to obtain a data set, and dividing it into a training set and a test set;

[0036] Step S2: Based on the training set in the data set, train an anomaly detection model of the CNN-LSTM network and test it through the test set;

[0037] Step S3: inputting the ultrasonic welding power data to be measured into the abnormality detection model to perform prediction to obtain a preliminary prediction result, that is, obtaining a preliminary power waveform data code;

[0038] Step S4: using the VAE model to correct the preliminary prediction result to obtain the final prediction result, that is, to obtain the reconstructed power waveform data encoding;

[0039] Step S5: using the DTW distance distribution to judge the abnormality of the final prediction result. If the DTW distance of the final prediction result is greater than the DTW distance threshold, it is determined that the ultrasonic welding power to be tested is abnormal.

[0040] In some specific embodiments, step S1: preprocessing the collected ultrasonic welding power data to obtain a data set, and dividing it into a training set and a test set, including:

[0041] Each ultrasonic welding power data is represented as a time series, that is, the power waveform data X = {x1, x2, ..., x t ,...,x T}, where x t represents the power waveform data at time t, and T represents the total time.

[0042] That is to say, when the frequency of ultrasonic welding power is 20KHz, if the welding time is 1 second, 20K power data will be generated. These 20K power data are a waveform in the time dimension, namely, power waveform data.

[0043] The power waveform data is mapped to a predetermined interval (i.e., the interval [-1, 1]) by linear function normalization to avoid the influence of different channel feature weights due to different dimensions, etc., and the normalized data set is obtained as follows:

[0044]

[0045] In the formula, X′ i represents the normalized i-th data set, X i represents a time series data set, i.e., the i-th time series; X max and X min Respectively represent the maximum and minimum values ​​in the time series features.

[0046] Based on the normalized data set, the normal data is taken as positive examples and the abnormal data is taken as negative examples, and they are divided into training set and test set accordingly.

[0047] In this embodiment, combined with the expert experience of on-site quality personnel, 2000 manually labeled normal power waveform data are used as positive examples, and 800 manually labeled abnormal power waveform data are used as negative examples, which are used to construct the training set and the test set respectively.

[0048] In some specific embodiments, step S2: based on the training set in the data set, training an anomaly detection model of the CNN-LSTM network and testing it through the test set includes:

[0049] The training set is input into a CNN network, and the CNN network utilizes the characteristics of each power waveform data to extract local spatial features of the power waveform data;

[0050] Inputting the local spatial features into the LSTM network for training to obtain an anomaly detection model of the CNN-LSTM network;

[0051] The local spatial features are input into the LSTM network to extract the time series features of the power waveform data.

[0052] In some specific embodiments, in step S2, the training set is input into the CNN network, and the CNN network utilizes the characteristics of each power waveform data to extract the local spatial features of the power waveform data, including:

[0053] The training set is input into the CNN network. Based on the features of each power waveform data, the CNN network performs spatial feature extraction and convolution kernel convolution on each power waveform data in the training set to obtain the high-level features y after convolution. i ;

[0054] For the high-level feature y iPerform convolution calculation to obtain feature sequence J;

[0055] The feature sequence J is subjected to maximum pooling processing to retain the key information of the feature sequence J and reduce the parameters to obtain the local optimal solution M, that is, the local spatial feature.

[0056] Among them, the convolution kernel W of the CNN network is W = {w1,w2,...,w j ,...,w k}, where k represents the size of the convolution kernel;

[0057] Training set In the formula, i represents the size of the training set, and j represents the size of each power waveform data;

[0058] The advanced features are:

[0059]

[0060] In the formula, y i represents the i-th element of the power waveform data after spatial feature extraction and convolution kernel convolution, x i+j represents the i+jth element of the power waveform data after convolution; w j represents the jth weight of the convolution kernel, and j represents the convolution length of the convolution kernel;

[0061] The characteristic sequence J = [y0, y1, y2, ..., y T-k+1 ], where T represents the total time;

[0062] The local optimal solution M=max{J}, where J represents the feature sequence.

[0063] In some specific embodiments, in step S2, the local edge space feature is input into the LSTM network to extract the time series feature of the power waveform data, including:

[0064] The local spatial features of the power waveform data are sequentially input into the LSTM network to extract the time series features, and the output preliminary power waveform data encoding is calculated and obtained, i.e., the preliminary prediction result;

[0065] The LSTM network includes a forget gate, an input gate, an internal memory unit and an output gate, and the local spatial feature is calculated in the LSTM network as follows:

[0066] f t =σ(W f .[h t-1 ,y t ]+b f ),

[0067] it =σ(W i [h t-1 ,y t ]+b i ),

[0068]

[0069] o t =σ(W o [h t-1 ,y t ]+b o ),

[0070]

[0071] In the formula, f t represents the forget gate, i t represents the input gate, Represents the internal memory unit, o t represents the output gate, h t represents the node output value, that is, the output result of the hidden state; σ represents the Sigmoid activation function, W f , W i , W c and W o Both represent the weights corresponding to the forget gate, input gate, internal memory unit and output gate, h t-1 represents the implicit state of the previous time step t-1, that is, it carries the information passed from the previous time step to the current time step; y t represents the input of the current time step t, that is, the feature vector of the input data at time step t; b f 、b i 、b c and b o represents bias, and tanh represents the hyperbolic tangent function.

[0072] In this application, a CNN network is used to extract local spatial features of the input training set data and input the data into an LSTM network. Considering that the power waveform data not only has spatial characteristics with local edge features, but also has temporal features between adjacent depths, this application uses an LSTM network that can capture temporal features to predict the power waveform data.

[0073] This application adopts the CNN-LSTM model that combines the advantages of the CNN network and the LSTM network. It can extract local edge feature spatial characteristics (i.e., local spatial features) in the power waveform data, thereby mining deep information, and use the LSTM neural network to mine the data time series characteristics to achieve effective capture of spatiotemporal features.

[0074] In some specific embodiments, step S4: using the VAE model to correct the preliminary prediction result to obtain the final prediction result, that is, to obtain the reconstructed power waveform data encoding, includes:

[0075] The VAE model is obtained by training the training set, so that the VAE model learns the potential features and potential relationships between the power waveform data in the training set during the training process;

[0076] The preliminary prediction results are input into the VAE model, and the VAE model uses the potential features and potential relationships between the power waveform data to correct the preliminary prediction results, output a more accurate final prediction result, and effectively improve the accuracy of the prediction results of the CNN-LSTM model;

[0077] The VAE model uses the potential features and potential relationships between the power waveform data to correct the preliminary prediction results, including:

[0078] The VAE model consists of a probabilistic encoder q Φ (z|x) and decoder p θ (z|x); The goal of the VAE model is to make the posterior distribution p of the VAE model θ (z|x) is as close as possible to the prior distribution p θ (x); where the prior distribution p θ (x) is the standard normal distribution N(0,1);

[0079] Taking the input preliminary prediction result as the real sample x, the probability encoder converts the real sample x into a posterior distribution p of a latent variable z θ (z|x); where the real sample x={x1',x'2,...,x t ',...,x' T},x′ t Represents the power waveform data in the real sample at time t;

[0080] The VAE model uses a probabilistic encoder q Φ (z|x) approximates the posterior distribution p θ (z|x), and the posterior distribution p θ (z|x) is assumed to be Gaussian, which enables the decoder to learn and predict the latent variable z and to extract the latent variable z from the posterior distribution p θ Extract sample z from (z|x) and reconstruct the original input data, that is, decode sample z to restore it to the real sample x as much as possible.

[0081] VAE is an unsupervised deep learning generative model that can model the distribution of training data; this application uses the VAE model to learn the characteristics of the training set data, and outputs the final prediction results after correcting the preliminary prediction results, which can effectively improve the accuracy of the prediction results of the CNN-LSTM model; this application uses a CNN network combined with an LSTM network for encoding, and uses a CNN network combined with an LSTM network for decoding, so that the VAE model is suitable for predicting power waveform data, which is more conducive to feature extraction.

[0082] In some specific embodiments, the purpose of minimizing the reconstruction loss function of the VAE model in step S4 is to decode the sample z extracted from the decoder into a real sample x;

[0083] Then the minimized reconstruction loss function of the VAE model is:

[0084]

[0085] In the formula, L(θ, Φ; x) represents the minimum reconstruction loss function of the VAE model, θ represents the abbreviation of the normal distribution N(μ, σ), Φ represents the abbreviation of the normal distribution N(μ, σ), and x represents the real sample; KL (q Φ (z|x)||p θ (z)) represents the encoded posterior distribution q Φ (z|x) and standard normal distribution p θ (x) divergence between; q Φ (z|x) represents the probability encoder, p θ (z) represents the probability distribution of the latent variable z; Represents the sum of square errors between the reconstruction layer and the input layer of the VAE model, p θ (x|z) represents the posterior distribution.

[0086] In some specific embodiments, step S5: using DTW distance distribution to judge the abnormality of the final prediction result, if the DTW distance of the final prediction result is greater than the DTW distance threshold, it is determined that the ultrasonic welding power to be tested is abnormal, including:

[0087] Step S51: extract normal samples and abnormal samples from the training set and the test set respectively, calculate and analyze the DTW distance distribution of the normal samples and the DTW distance distribution of the abnormal samples, and determine a suitable DTW distance threshold τ;

[0088] Assume that the DTW distance of normal samples follows the distribution N(μ_normal,σ_normal), and the DTW distance of abnormal samples follows the distribution N(μ_normal,σ_normal). In order to distinguish the two types of samples to the greatest extent, τ = (μ_normal,σ_normal) / 2) can be selected as the decision threshold, which ensures that the DTW distance of normal samples and abnormal samples has the greatest discrimination near this threshold.

[0089] Step S52: Calculate the DTW distance of the final prediction result. When the DTW distance of the final prediction result is greater than the DTW distance threshold τ, the final prediction result is determined to be abnormal. This application uses this method, combined with the reconstruction capability of VAE and the characteristics of DTW distance distribution, to achieve more accurate and reliable power waveform anomaly detection.

[0090] The DTW dynamic time warping method is used to measure the preliminary prediction result (i.e., preliminary power waveform data encoding) x = {x1', x'2, ..., x t ',...,x' T} and the final prediction result (i.e., the reconstructed power waveform data encoding) y = {y1', y'2, ..., y t ',...,y' T The similarity between}, the DTW distance of the final prediction result is:

[0091] DTW ij =d(x i ,y j )+min(DTW i-1j ,DTW ij-1 ,DTW i-1j-1 ),

[0092] In the formula, DTW ij represents the minimum DTW distance between the first i elements in the preliminary power waveform data code x and the first j elements in the reconstructed power waveform data code y, d(x i ,y j ) represents the Euclidean distance metric between the i-th element of the preliminary power waveform data code x and the j-th element of the reconstructed power waveform data code y.

[0093] Based on the same inventive concept, the embodiment of the present invention also provides an early warning system for abnormal welding quality, such as Figure 3 As shown, including:

[0094] An acquisition processing unit, used for preprocessing the acquired ultrasonic welding power data to obtain a data set, and dividing it into a training set and a test set;

[0095] A model building unit, used for training an anomaly detection model of a CNN-LSTM network based on a training set in the data set, and testing the model through a test set;

[0096] A prediction unit, used for inputting the ultrasonic welding power data to be measured into the abnormality detection model for prediction to obtain a preliminary prediction result, that is, to obtain a preliminary power waveform data code;

[0097] A correction unit, used to correct the preliminary prediction result using the VAE model to obtain the final prediction result, that is, to obtain the reconstructed power waveform data encoding;

[0098] The abnormality detection unit is used to use the DTW distance distribution to make an abnormality judgment on the final prediction result. If the DTW distance of the final prediction result is greater than the DTW distance threshold, it is determined that the ultrasonic welding power to be tested is abnormal.

[0099] Regarding the system in the above embodiment, the specific manner in which each unit module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0100] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, whose structure is as follows: Figure 4 As shown, it includes a memory, a processor and a computer program stored in the memory, and the processor executes the computer program or instructions to implement the aforementioned early warning method for abnormal welding quality.

[0101] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the aforementioned method for warning of abnormal welding quality are implemented.

[0102] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps of the aforementioned method for early warning of abnormal welding quality.

[0103] The method provided by the present invention includes a CNN-LSTM-VAE model, that is, a CNN network, an LSTM network combined with a VAE model; the present invention uses a CNN network to extract local spatial features of original power waveform data and inputs the local spatial features into an LSTM network; the LSTM network extracts a deeper temporal relationship between features to obtain a preliminary predicted power waveform data value; the VAE model corrects the preliminary predicted power waveform data value to obtain a reconstructed power waveform data value, that is, a final prediction result.

[0104] The early warning system provided by this application can monitor abnormal conditions in the welding process in real time, issue early warning information in a timely manner, and promptly discover and isolate batteries with quality problems, preventing them from entering the subsequent assembly and testing stages, cutting off the spread of quality problems at the source, and effectively reducing the impact on the final product and reducing the cost of post-testing. In addition, through real-time monitoring and abnormal early warning, welding quality problems can be discovered in the first place, reducing the need for post-testing of large batches of batteries, reducing labor costs and time costs, and saving companies a lot of quality control expenses.

[0105] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for early warning of abnormal welding quality, characterized in that: include: The collected ultrasonic welding power data is preprocessed to obtain a data set, and the data set is divided into a training set and a test set; Based on the training set in the data set, a CNN-LSTM network anomaly detection model is trained and tested using a test set; Inputting the ultrasonic welding power data to be measured into the anomaly detection model for prediction to obtain a preliminary prediction result, that is, obtaining a preliminary power waveform data code; The VAE model is used to correct the preliminary prediction results to obtain the final prediction results, that is, to obtain the reconstructed power waveform data encoding; The DTW distance distribution is used to judge the abnormality of the final prediction result. If the DTW distance of the final prediction result is greater than the DTW distance threshold, it is determined that the ultrasonic welding power to be tested is abnormal.

2. The method for early warning of abnormal welding quality according to claim 1, characterized in that: The collected ultrasonic welding power data is preprocessed to obtain a data set, which is divided into a training set and a test set, including: Each ultrasonic welding power data is represented as a time series, that is, the power waveform data X = {x1, x2, ..., x t ,...,x T }, where x t Represents the power waveform data at time t, where T represents the total time; The power waveform data is mapped to a predetermined interval by linear function normalization to obtain a normalized data set: Where X' i represents the normalized i-th data set, X i represents a time series data set, i.e., the i-th time series; X max and X min Respectively represent the maximum and minimum values ​​in the time series features; Based on the normalized data set, the normal data is taken as positive examples and the abnormal data is taken as negative examples, and they are divided into training set and test set accordingly.

3. The method for early warning of abnormal welding quality according to claim 1, characterized in that: Based on the training set in the data set, the anomaly detection model of the CNN-LSTM network is trained, including: The training set is input into a CNN network, and the CNN network utilizes the characteristics of each power waveform data to extract local spatial features of the power waveform data; Inputting the local spatial features into the LSTM network for training to obtain an anomaly detection model of the CNN-LSTM network; The local spatial features are input into the LSTM network to extract the time series features of the power waveform data.

4. The method for early warning of abnormal welding quality according to claim 3, characterized in that: The training set is input into the CNN network, and the CNN network uses the characteristics of each power waveform data to extract the local spatial features of the power waveform data, including: The training set is input into the CNN network. Based on the features of each power waveform data, the CNN network performs spatial feature extraction and convolution kernel convolution on each power waveform data in the training set to obtain the high-level features y after convolution. i ; For the high-level feature y i Perform convolution calculation to obtain feature sequence J; Perform maximum pooling on the feature sequence J to retain the key information of the feature sequence J and reduce the parameters to obtain the local optimal solution M, that is, the local spatial feature; Among them, the convolution kernel W of the CNN network is W = {w1,w2,...,w j ,...,w k }, where k represents the size of the convolution kernel; Training set D = {(x i j ),i=1...d,j=1...T}, where d represents the size of the training set and j represents the size of each power waveform data; The advanced features are: In the formula, y i represents the i-th element in the power waveform data after spatial feature extraction and convolution kernel convolution, x i+j represents the i+jth element in the convolved power waveform data; w j represents the jth weight of the convolution kernel, and j represents the convolution length of the convolution kernel; The characteristic sequence J = [y0, y1, y2, ..., y T-k+1 ], where T represents the total time; The local optimal solution M=max{J}.

5. The method for early warning of abnormal welding quality according to claim 3 or 4, characterized in that: The local spatial features are input into the LSTM network to extract the time series features of the power waveform data, including: The local spatial features of the power waveform data are sequentially input into the LSTM network to extract the time series features, and the output preliminary power waveform data encoding is calculated and obtained, i.e., the preliminary prediction result; The LSTM network includes a forget gate, an input gate, an internal memory unit and an output gate, and the local spatial feature is calculated in the LSTM network as follows: f t =σ(W f .[h t-1 ,y t ]+b f ), i t =σ(W i [h t-1 ,y t ]+b i ), the t =σ(W o [h t-1 ,y t ]+b o ), In the formula, f t represents the forget gate, i t represents the input gate, Represents the internal memory unit, o t represents the output gate, h t represents the node output value, that is, the output result of the hidden state; σ represents the Sigmoid activation function, W f , W i , W c and W o Both represent the weights of the forget gate, input gate, internal memory unit, and output gate, h t-1 represents the implicit state of the previous time step t-1, y t represents the input of the current time step t; b f , b i , b c and b o represents bias, and tanh represents the hyperbolic tangent function.

6. The method for early warning of abnormal welding quality according to claim 1, characterized in that: The VAE model is used to correct the preliminary prediction results to obtain the final prediction results, that is, to obtain the reconstructed power waveform data encoding, including: The VAE model is obtained by training the training set, so that the VAE model learns the potential features and potential relationships between the power waveform data in the training set during the training process; The preliminary prediction result is input into the VAE model, and the VAE model corrects the preliminary prediction result by using the potential features and potential relationships between the power waveform data to output a more accurate final prediction result; The VAE model uses the potential features and potential relationships between the power waveform data to correct the preliminary prediction results, including: The VAE model consists of a probabilistic encoder q Φ (z|x) and decoder p θ (z|x); The goal of the VAE model is to make the posterior distribution p of the VAE model θ (z|x) is as close as possible to the prior distribution p θ (x); where the prior distribution p θ (x) is the standard normal distribution N(0,1); Taking the input preliminary prediction result as the real sample x, the probability encoder converts the real sample x into a posterior distribution p of a latent variable z θ (z|x); The VAE model uses a probabilistic encoder q Φ (z|x) approximates the posterior distribution p θ (z|x), and the posterior distribution p θ (z|x) is assumed to be Gaussian, which enables the decoder to learn and predict the latent variable z and to extract the latent variable z from the posterior distribution p θ Extract sample z from (z|x) and reconstruct the preliminary prediction result data, that is, decode sample z and restore it to the real sample x as much as possible.

7. The method for early warning of abnormal welding quality according to claim 1 or 6, characterized in that: The purpose of minimizing the reconstruction loss function of the VAE model is to decode the sample z extracted from the decoder into the real sample x; The minimized reconstruction loss function of the VAE model is: In the formula, L(θ, Φ; x) represents the minimized reconstruction loss function of the VAE model, θ represents the abbreviation of the normal distribution N(μ, σ), Φ represents the abbreviation of the normal distribution N(μ, σ), and x represents the real sample; KL (q Φ (z|x)||p θ (z)) represents the encoded posterior distribution q Φ (z|x) and standard normal distribution p θ (x) divergence between; q Φ (z|x) represents the probability encoder, p θ (z) represents the probability distribution of the latent variable z; Represents the sum of square errors between the reconstruction layer and the input layer of the VAE model, p θ (x|z) represents the posterior distribution.

8. The method for early warning of abnormal welding quality according to claim 1 or 2, characterized in that: The DTW distance distribution is used to judge the abnormality of the final prediction result. If the DTW distance distribution of the final prediction result is greater than the DTW distance threshold, the ultrasonic welding power to be tested is considered abnormal, including: Normal samples and abnormal samples are extracted from the training set and the test set respectively, the DTW distance distribution of normal samples and the DTW distance distribution of abnormal samples are calculated and analyzed, and the DTW distance threshold τ is determined; Calculate the DTW distance of the final prediction result. When the DTW distance of the final prediction result is greater than the DTW distance threshold τ, the final prediction result is determined to be abnormal. Among them, the DTW dynamic time warping method is used to measure the initial prediction result x = {x′1, x′2, ..., x′ t ,...,x' T } and the final prediction result y={y′1,y′2,...,y′ t ,...,y' T The similarity between}, the DTW distance of the final prediction result is: DTW ij =d(x i ,y j )+min(DTW i-1j ,DTW ij-1 ,DTW i-1j-1 ), In the formula, DTW ij represents the minimum DTW distance between the first i elements in the preliminary power waveform data code x and the first j elements in the reconstructed power waveform data code y, d(x i ,y j ) represents the Euclidean distance metric between the i-th element of the preliminary power waveform data code x and the j-th element of the reconstructed power waveform data code y.

9. An early warning system for abnormal welding quality, characterized in that: include: An acquisition processing unit, used for preprocessing the acquired ultrasonic welding power data to obtain a data set, and dividing it into a training set and a test set; A model building unit, used for training an anomaly detection model of a CNN-LSTM network based on a training set in the data set, and testing the model through a test set; A prediction unit, used for inputting the ultrasonic welding power data to be measured into the abnormality detection model for prediction to obtain a preliminary prediction result, that is, to obtain a preliminary power waveform data code; A correction unit, used to correct the preliminary prediction result using the VAE model to obtain the final prediction result, that is, to obtain the reconstructed power waveform data encoding; The abnormality detection unit is used to use the DTW distance distribution to make an abnormality judgment on the final prediction result. If the DTW distance of the final prediction result is greater than the DTW distance threshold, it is determined that the ultrasonic welding power to be tested is abnormal.

10. An electronic device, characterized in that: It comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program or instructions to implement the steps of a method for early warning of abnormal welding quality as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the method for early warning of abnormal welding quality described in any one of claims 1-8 are implemented.

12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by the processor, the steps of the method for early warning of abnormal welding quality described in any one of claims 1-8 are implemented.