AC contactor fault prediction method and system based on improved BA-BP neural network
By improving the BA-BP neural network combined with the Mallat algorithm and the LSTM network, the problem of AC contactor failure prediction is solved, high-precision fault prediction is achieved, and the safety of the equipment is improved.
Patent Information
- Application Number
- CN202411860224.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to effectively predict the failure of AC contactors, which leads to the inability to diagnose and handle power equipment in time, which poses safety hazards.
The fault prediction method based on the improved BA-BP neural network is adopted, and the working signal data is collected through sensors, the Mallat algorithm is used for denoising processing, the LSTM network extracts feature data, and the improved BA algorithm is used to optimize the weight and bias value of the BP neural network, and a classification model is established for fault prediction.
It realizes the prediction of gradual faults of AC contactors, improves prediction accuracy, and enhances the safe and stable operation of electrical equipment.
Smart Images

Figure CN119881626A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of pattern recognition, and in particular relates to an AC contactor fault prediction method and system based on an improved BA-BP neural network. Background Art
[0002] An AC contactor is an electronic switching device used to control the current load in a circuit. It is widely used in electrical control systems of various industrial equipment and machinery. When an AC contactor fails, it may cause the electrical equipment to fail to work properly or even cause serious accidents such as fire. Its reliability is directly related to production safety. Therefore, studying the fault state of the AC contactor is of great significance to improving the safe operation level of electrical equipment.
[0003] At present, the traditional manual inspection method and power-off operation can no longer meet the current needs of AC contactor fault detection, and even if a fault occurs, it cannot be diagnosed and processed in time. Therefore, in order to ensure the safe and stable operation of the AC contactor, the present invention proposes an AC contactor fault prediction method and system based on an improved BA-BP neural network. Summary of the invention
[0004] The present invention aims to overcome the deficiencies of the prior art and proposes an AC contactor fault prediction method and system based on an improved BA-BP neural network to achieve the following objectives: to predict the progressive faults of the AC contactor and to improve the prediction accuracy.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is: an AC contactor fault prediction method based on an improved BA-BP neural network, the method comprising the following steps:
[0006] Step S1, collecting working signal data of the AC contactor through a sensor, and performing data selection and preprocessing based on the Mallat algorithm to obtain different fault data;
[0007] Step S2: For the fault data, feature extraction is performed based on the LSTM network;
[0008] Step S3: Establish a classification model based on the improved BA-BP neural network, and use the feature data extracted by the LSTM network for training and testing.
[0009] Preferably, the data selection and preprocessing process of step S1 includes:
[0010] Step S11, collecting responses of the AC contactor under different working conditions and loads as working signal data through a sensor;
[0011] Step S12, signal denoising is performed on the working signal data based on the Mallat algorithm; specifically, the input signal is first decomposed at different scales, and after decomposition, the noise signal is removed by filtering at different scales; finally, a valid signal is obtained by reconstruction transformation; the formula is expressed as follows:
[0012] Decomposition process:
[0013] φ j,k (t) = 2 -j / 2 ∑ k∈Z h k φ(2 -j tk)
[0014] ψ j,k (t) = 2 -j / 2 ∑ k∈Z g k ψ(2 -j tk)
[0015] S(t)=∑ k∈Z c j,k φ j,k (t)+∑ k∈Z d j,k ψ j,k (t)
[0016] Where t represents the time series; j represents the number of decomposition layers; S(t) represents the input signal; φ j,k (t) represents the scaling function; ψ j,k (t) represents the wavelet function; c j,k represents the kth scale coefficient on the jth scale; d j,k represents the wavelet function; h k represents a low-pass filter; g k represents a high-pass filter;
[0017] Reconstruction process:
[0018]
[0019] Among them, c j,n represents the nth scale coefficient on the jth scale;
[0020] Step S13: align the working signal data with the same timestamp through linear interpolation, merge them into a matrix, and classify and mark them according to different fault types to obtain different fault data, in preparation for the next step of processing.
[0021] Preferably, in step S2, different fault data are used as input of the LSTM network, and respective LSTM autoencoders are trained to extract the time series features of the data; the LSTM autoencoder includes an input layer, an LSTM layer, a fully connected layer, and an output layer connected in sequence; wherein the fully connected layer maps and reduces the dimension of the features learned by the LSTM layer, and the output layer outputs the features estimated by the final LSTM network.
[0022] Preferably, step S3 comprises:
[0023] Step S31, dividing the feature data extracted by the LSTM network into a training set and a test set, wherein the training set data is used to solve the optimal weight and bias value of the BP neural network, and the test set data is used to verify the final test effect of the model;
[0024] Step S32, normalizing the data of the training set and the test set;
[0025] Step S33, determining the topological structure of the BP neural network;
[0026] Step S34, initializing the improved BA algorithm;
[0027] Step S35, establishing a classification model based on an improved BA-BP neural network, that is, using an improved BA algorithm to search for optimal weights and bias values of the BP neural network;
[0028] Step S36, using the test set data to test the classification model based on the improved BA-BP neural network;
[0029] Step S37: output the test set classification result.
[0030] Preferably, in step S35, each bat in the improved BA algorithm represents a set of weights and bias values of a BP neural network, and step S35 includes:
[0031] Step S351: After the improved BA algorithm is initialized, the bat speed is updated using an improved speed update method according to the current position and the optimal individual position, and a new bat position is calculated;
[0032] Step S352, updating the bat pulse transmission frequency;
[0033] Step S353, calculating the fitness of all individuals in the group through the improved fitness function, and judging whether the bat position update condition is met according to the fitness value; if not met, returning to the step S341;
[0034] Step S354: when the bat position update condition is met, the bat position and pulse loudness are updated, and at the same time, the bat pulse transmission frequency is updated using an improved pulse transmission frequency update method;
[0035] Step S345, calculate the fitness of all individuals in the group again and sort them, and determine whether the end condition is met; if it is met, output the weight and bias value of the optimal BP neural network, otherwise, return to the step S341
[0036] Preferably, in step S351, the improvement of the speed update method includes: adding a SIW strategy to the speed update equation, the SIW strategy obtains the inertia weight by random distribution, and its calculation formula is as follows:
[0037] w=μ min +(μ max -μ min )×rand()+σ×randn()
[0038] Among them, μ min is the minimum value of SIW; μ max is the maximum value of SIW; rand() is a random number between 0 and 1; randn() is a random number with standard normal distribution; σ is the standard deviation of SIW and its mean, which is used to control the degree of SIW dispersion; the adjusted speed update equation is as follows:
[0039] v n (t+1)=wv n (t)+(x n (t)-p k (t))·f n (t)
[0040] Among them, v n (t+1), v n (t) represents the speed of bat n at time t+1 and time t respectively; w represents the SIW value; x n (t) represents the position of bat n at time t; p k (t) represents the position of the best bat k in the bat group at time t; f n (t) represents the pulse emission frequency of bat n at time t.
[0041] Preferably, in step S354, the improvement of the pulse transmission frequency update method includes: proposing an adaptive curve decreasing strategy so that the decreasing speed of the pulse transmission frequency is adjusted as the number of iterations changes, and the pulse transmission frequency update formula after adjustment is:
[0042]
[0043] Among them, t is the current iteration number; LG is the total number of algorithm iterations; β1 is the preset parameter used to adjust γ n (t) The changing trend of the update curve; y n (0) represents the original pulse emission frequency of bat n; γ n (t) represents the adjusted pulse emission frequency of bat n.
[0044] Preferably, in step S34, the improved BA algorithm uses a fitness function to drive the position update of the bat colony to evaluate the classification performance of the model; the fitness function of the improved BA algorithm is designed as follows:
[0045]
[0046] Among them, acc0 is the accuracy of the training set; acc1 is the accuracy of the test set; f represents the fitness function value.
[0047] At the same time, the present application also proposes an AC contactor fault prediction system based on an improved BA-BP neural network, the system including an AC contactor, a sensor, and a computer, the sensor being used to collect the working signal data of the AC contactor and send it to the computer, and the computer being used to execute a computer program constructed according to the above-mentioned AC contactor fault prediction method based on the improved BA-BP neural network.
[0048] The technical effects of the present invention are:
[0049] (1) The present invention adopts the Mallat algorithm, which can effectively distinguish the sudden change part and noise in the signal with non-stationary characteristics such as AC contactor, thereby realizing denoising of the non-stationary signal.
[0050] (2) The present invention adopts LSTM network for feature extraction, which avoids using all collected data directly as input of the neural network, which will cause the network to be very large and thus lead to problems such as training difficulties and overfitting, thereby improving the accuracy of the prediction results.
[0051] (3) The present invention utilizes the excellent global search capability of the improved BA algorithm to guarantee the output of the optimal solution to the greatest extent, obtain the optimal initial values of the weights and bias values of the BP neural network, improve the random defects of the BP network structure in determining the weights and bias values, and improve the stability of the algorithm. Compared with the traditional BA algorithm, the global search capability and local search capability of the algorithm are balanced, and the diversity and flexibility of the group are increased. Finally, the recognition and classification accuracy of the BP neural network is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1A flow chart of a method for predicting AC contactor faults based on an improved BA-BP neural network provided by an embodiment of the present invention;
[0053] Figure 2 A schematic diagram of the decomposition process of the Mallat algorithm provided in an embodiment of the present invention;
[0054] Figure 3 A schematic diagram of the Mallat algorithm reconstruction process provided by an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of the LSTM autoencoder structure provided in an embodiment of the present invention;
[0056] Figure 5 A schematic diagram of the LSTM unit structure provided in an embodiment of the present invention;
[0057] Figure 6 This is a flow chart of the improved BA-BP neural network algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following is a further detailed description of the specific implementation of the present invention by describing the embodiments with reference to the accompanying drawings, with the purpose of helping those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention and to facilitate its implementation. In order to make the technical solution of the present invention clearer, the present invention is explained by the following embodiments.
[0059] This embodiment provides an AC contactor fault prediction method based on an improved BA-BP neural network. Figure 1 The method comprises the following steps:
[0060] Step S1, collecting working signal data of the AC contactor through a sensor, and performing data selection and preprocessing based on the Mallat algorithm to obtain different fault data;
[0061] Step S2: For the fault data, feature extraction is performed based on the LSTM network;
[0062] Step S3: Establish a classification model based on the improved BA-BP neural network, and use the feature data extracted by the LSTM network for training and testing.
[0063] Specifically, in the signal monitoring process of the AC contactor, signal denoising is a very important link. In the complex and changeable workshop environment, the signal collected by the sensor contains both the response of the AC contactor under different working conditions and loads, and random noise, which has typical non-stationary characteristics. The Mallat algorithm can analyze the signal in the time and frequency domains at the same time, so it can effectively distinguish the mutation part and noise in the signal, thereby realizing the denoising of the non-stationary signal.
[0064] The Mallat algorithm is a fast wavelet decomposition and reconstruction algorithm based on multi-resolution analysis theory. It has good time resolution and frequency resolution, so it is very suitable for analyzing non-stationary signals and is widely used in signal analysis and processing. The Mallat algorithm first constructs a scale function and a wavelet function based on the multi-resolution analysis theory, and decomposes the signal to be analyzed into various frequency scales, thereby obtaining low-frequency coefficients and high-frequency coefficients of different scales; then selects appropriate thresholds at different scales for filtering to eliminate noise signals; finally, a valid signal is obtained through reconstruction transformation. Specifically, in step S1, the data selection and preprocessing process based on the Mallat algorithm includes:
[0065] Step S11, collecting responses of the AC contactor under different working conditions and loads as working signal data through a sensor;
[0066] Step S12, signal denoising is performed on the working signal data based on the Mallat algorithm; specifically, the input signal is first decomposed at different scales, and after decomposition, the noise signal is removed by filtering at different scales; finally, a valid signal is obtained by reconstruction transformation; the formula is expressed as follows:
[0067] Decomposition process:
[0068] φ j,k (t) = 2 -j / 2 ∑ k∈Z h k φ(2 -j tk)
[0069] ψ j,k (t) = 2 -j / 2 ∑ k∈Z g k ψ(2 -j tk)
[0070] S(t)=∑ k∈Z c j,k φ j,k (t)+∑ k∈Z d j,k ψ j,k (t)
[0071] Where t represents the time series; j represents the number of decomposition layers; S(t) represents the input signal; φ j,k (t) represents the scaling function; ψ j,k (t) represents the wavelet function; c j,k represents the kth scale coefficient on the jth scale; d j,k represents the wavelet function; h k represents a low-pass filter; g k Represents a high-pass filter; C j ={c j,k},D j ={d j,k}, the decomposition process of Mallat algorithm is as follows Figure 2 shown.
[0072] Reconstruction process: Using a similar idea to the above decomposition, the wavelet coefficients of each layer after decomposition are reconstructed step by step, and the reconstruction process of the Mallat algorithm can be reversely derived. The signal reconstruction formula is as follows:
[0073]
[0074] Among them, c j,n represents the nth scale coefficient on the jth scale; the reconstruction process of the Mallat algorithm is as follows Figure 3 shown.
[0075] Step S13: align the working signal data with the same timestamp through linear interpolation, merge them into a matrix, and classify and mark them according to different fault types to obtain different fault data, in preparation for the next step of processing.
[0076] If all the collected data is directly used as the input of the neural network, the scale of the network will be very large, resulting in problems such as training difficulties and overfitting, which will lead to inaccurate final prediction results. Therefore, it is necessary to fully extract the characteristic parameters that can characterize its state. Therefore, in step S2 of this embodiment, different fault data are used as the input of the LSTM network, and the respective LSTM autoencoders are trained to extract the time series features of the data, thereby improving the recognition and classification effects of the subsequent algorithms.
[0077] The LSTM autoencoder is Figure 4 As shown, it includes an input layer, an LSTM layer, a fully connected layer, and an output layer connected in sequence; wherein the fully connected layer maps and reduces the dimensions of the features learned by the LSTM layer, and the output layer outputs the features estimated by the final LSTM network.
[0078] Each LSTM layer includes multiple LSTM units, and the structure of each LSTM unit is as follows: Figure 5As shown in the figure, the LSTM unit introduces a "gate" structure: forget gate, input gate and output gate. The "gate" structure uses the sigmoid (logarithmic S-shaped function) activation function and multiplier to cleverly limit the input information between 0 and 1, so that it can selectively decide which information to let through. When data passes through an LSTM unit, the forget gate first decides which information to discard, then the input gate decides which new information to add, and finally the sigmoid activation function of the output gate obtains the judgment condition. By selectively memorizing and forgetting previous information, LSTM achieves long-term memory of relevant information, thereby extracting temporal features.
[0079] BP (Back Propagation) neural network is a multi-layer forward neural network based on the error back propagation algorithm. It is one of the most widely used neural network models because of its simple topological structure, good nonlinear mapping ability, self-learning and adaptive ability.
[0080] The main defect of BP neural network is that it is easy to fall into local minimum. Although current scholars have proposed various optimization methods to make up for the defects of BP neural network, the effect of improving the algorithm is not ideal. The initial weights and bias values of BP neural network algorithm have a great influence on the results of network training, but there is no scientific theory to guide how to accurately select the values. Relying solely on experience is too subjective and takes a lot of time for trial and error. Therefore, an algorithm with global search capability is needed to be used in conjunction with the BP neural network model to solve the problem of limited optimization effect of a single BP neural network and improve system performance.
[0081] The Bat Algorithm (BA) is a swarm intelligence optimization algorithm inspired by the bat echolocation mechanism and belongs to the prior art. The algorithm optimizes the objective function by simulating the process of bats using sound waves to search, locate prey and control flight direction in a complex environment. With a bat as the basic unit of the population, the algorithm can search the space by updating the frequency, speed, loudness, etc. of the bats in an iterative process until the global optimal solution is found. The present application improves the BA algorithm, mainly in the speed update method, fitness function, and pulse emission frequency update method.
[0082] Based on this, this embodiment proposes to use an improved BA algorithm to optimize the weights and bias values of the BP neural network, and establish a classification model based on the improved BA-BP neural network. The idea of this model is to utilize the excellent global search capability of the improved BA algorithm to ensure the optimal solution output to the greatest extent, obtain the optimal initial values of the weights and bias values of the BP neural network, improve the random defects of the BP network structure in determining the weights and bias values, and improve the stability of the algorithm.
[0083] Specifically, refer to Figure 6As shown in the improved BA-BP neural network algorithm flow chart, step S3 of this embodiment includes:
[0084] Step S31, dividing the feature data extracted by the LSTM network into a training set and a test set, wherein the training set data is used to solve the optimal weight and bias value of the BP neural network, and the test set data does not participate in any training process and is used to verify the final test effect of the model;
[0085] Step S32, normalize the data of the training set and the test set; the parameters in a feature vector often have different data ranges and units of measurement. If the data range is too large, the network converges slowly. Therefore, the data needs to be uniformly transformed into unitless data within a uniform range, thereby eliminating the adverse effects of singular samples on the training results. In addition, since the nodes of the hidden layer and output layer of the neural network all use sigmoid (logarithmic S-shaped function), and the S-shaped activation function is very flat outside the [0,1] interval, the discrimination is too small, so the range of the input data and the output data results are required to be limited to the [0,1] interval. Therefore, the input parameters and output parameters of the data set need to be normalized to the [0,1] interval to ensure the quantitative uniformity between the data.
[0086] Step S33, determine the topological structure of the BP neural network; that is, determine the number of input and output layer nodes of the BP neural network, and the optimal number of hidden layer nodes.
[0087] Step S34, initializing the improved BA algorithm; initialization includes initializing the parameters, population, fitness of the BA algorithm, and determining the current optimal individual bat position, etc.
[0088] Step S35, establishing a classification model based on an improved BA-BP neural network, that is, using an improved BA algorithm to search for optimal weights and bias values of the BP neural network;
[0089] Step S36, using the test set data to test the classification model based on the improved BA-BP neural network;
[0090] Step S37: output the test set classification result.
[0091] Specifically, in step S35 of this embodiment, each bat in the improved BA algorithm represents a set of weights and bias values of the BP neural network, and step S35 includes:
[0092] Step S351, after the improved BA algorithm is initialized, the bat speed is updated using an improved speed update method according to the current position and the optimal individual position, and the new bat position is calculated. Inspired by the improved method of the PSO (Particle Swarm Optimization) algorithm, this embodiment introduces the inertia weight into the BA algorithm speed update formula. A larger inertia weight will give the bat a larger speed, thereby having a stronger exploration ability, that is, a global search ability; a smaller inertia weight will give the bat a smaller speed, thereby having a stronger development ability, that is, a local search ability. In this way, by adjusting the inertia weight, the purpose of adjusting the degree of influence of the memory item in the speed update formula on the current search behavior is achieved, so that the global search and local search capabilities of the algorithm are more balanced, and the diversity and flexibility of the group are increased.
[0093] Common inertia weight adjustment strategies include linear decreasing strategy, linear differential decreasing strategy, nonlinear decreasing strategy, adaptive strategy, etc. This embodiment chooses to add SIW (Stochastic inertia weight) strategy to the speed update equation. The SIW strategy obtains the inertia weight by random distribution, which can avoid the lack of local search ability in the early stage of iteration and the lack of global search ability in the late stage of iteration, so that the algorithm can quickly jump out of the local search, which is conducive to searching for the global optimal solution and improving the stability of the algorithm. The calculation formula of the SIW strategy is as follows:
[0094] w=μ min +(μ max -μ min )×rand()+σ×randn()
[0095] Among them, μ min is the minimum value of SIW; μ max is the maximum value of SIW; rand() is a random number between 0 and 1; randn() is a random number with standard normal distribution; σ is the standard deviation of SIW and its mean, which is used to control the degree of SIW dispersion; the adjusted speed update equation is as follows:
[0096] v n (t+1)=wv n (t)+(x n (t)-p k (t))·f n (t)
[0097] Among them, v n (t+1), v n (t) represents the speed of bat n at time t+1 and time t respectively; w represents the SIW value; x n(t) represents the position of bat n at time t; p k (t) represents the position of the best bat k in the bat group at time t; f n (t) represents the pulse emission frequency of bat n at time t.
[0098] Step S352, updating the bat pulse transmission frequency;
[0099] Step S353, calculate the fitness of all individuals in the group through the improved fitness function, and judge whether the bat position update condition is met according to the fitness value. For example, a fitness threshold can be set for comparison; if it is not met, return to the step S341. The algorithm basically does not require external information during operation, but a fitness function is needed to drive the position update of the bat group and evaluate the classification performance of the model, especially the performance of the trained model on new data. The main principle of designing a fitness function is to calculate a non-complex value that can be compared. Since the BA algorithm seeks the minimum value in the position update process, for the problem of seeking the minimum value of a non-negative objective function, it can be directly used as the fitness function itself. The smaller the value of the fitness function, the more accurate the training.
[0100] In this embodiment, the fitness function of the improved BA algorithm is designed as follows:
[0101]
[0102] Among them, acc0 is the accuracy of the training set; acc1 is the accuracy of the test set; f represents the fitness function value. The smaller the fitness function value, the more accurate the training is, and the better the prediction accuracy of the model is.
[0103] Step S354, when the bat position update conditions are met, the bat position and pulse loudness are updated, and at the same time, the bat pulse transmission frequency is updated using the improved pulse transmission frequency update method. In the early stage of the original BA algorithm, the pulse loudness value is large. At this time, the global search ability of the algorithm should be improved to find the optimal area; after searching near the optimal area in the later stage of the algorithm, a stronger local search ability is required to obtain an approximate solution for the extreme point of the area. However, the pulse transmission frequency of the original BA algorithm becomes larger and larger in the later stage of the algorithm, resulting in a smaller and smaller probability of local search. To this end, this embodiment proposes an adaptive curve decreasing strategy, which can adjust the decrease rate of the pulse transmission frequency with the change of the number of iterations, so that the algorithm can have more bats to perform global search operations in the early stage, and more local search operations in subsequent iterations. The adjusted pulse transmission frequency update formula is:
[0104]
[0105] Among them, t is the current iteration number; LG is the total number of algorithm iterations; β1 is the preset parameter used to adjust γ n (t) The changing trend of the update curve; y n (0) represents the original pulse emission frequency of bat n; γ n (t) represents the adjusted pulse emission frequency of bat n.
[0106] Step S345, calculate the fitness of all individuals in the group again and sort them, and determine whether the end condition is met, for example, whether the number of iterations is reached or whether the fitness meets the expectation; if so, output the weight and bias value of the optimal BP neural network, otherwise, return to the step S341
[0107] At the same time, the present application also proposes an AC contactor fault prediction system based on an improved BA-BP neural network, the system including an AC contactor, a sensor, and a computer, the sensor being used to collect the working signal data of the AC contactor and send it to the computer, and the computer being used to execute a computer program constructed according to the above-mentioned AC contactor fault prediction method based on the improved BA-BP neural network.
[0108] The present invention is described above by way of example in conjunction with the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-mentioned methods. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention; or the above concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.
Claims
1. The AC contactor fault prediction method based on the improved BA-BP neural network is characterized by: The method comprises the following steps: Step S1, collecting working signal data of the AC contactor through a sensor, and performing data selection and preprocessing based on the Mallat algorithm to obtain different fault data; Step S2: For the fault data, feature extraction is performed based on the LSTM network; Step S3: Establish a classification model based on the improved BA-BP neural network, and use the feature data extracted by the LSTM network for training and testing.
2. The AC contactor fault prediction method based on the improved BA-BP neural network according to claim 1 is characterized in that: The data selection and preprocessing process of step S1 includes: Step S11, collecting responses of the AC contactor under different working conditions and loads as working signal data through a sensor; Step S12, signal denoising is performed on the working signal data based on the Mallat algorithm; specifically, the input signal is first decomposed at different scales, and after decomposition, the noise signal is removed by filtering at different scales; finally, a valid signal is obtained by reconstruction transformation; the formula is expressed as follows: Decomposition process: f j,k (t)=2 -j / 2 ∑ k∈Z h k φ(2 -j tk) ψ j,k (t)=2 -j / 2 ∑ k∈Z g k ψ(2 -j tk) S(t)=∑ k∈Z c j,k φ j,k (t)+∑ k∈Z d j,k ψ j,k (t) Where t represents the time series; j represents the number of decomposition layers; S(t) represents the input signal; φ j,k (t) represents the scaling function; ψ j,k (t) represents the wavelet function; c j,k represents the kth scale coefficient on the jth scale; d j,k represents the wavelet function; h k represents a low-pass filter; g k represents a high-pass filter; Reconstruction process: Among them, c j,n represents the nth scale coefficient on the jth scale; Step S13: align the working signal data with the same timestamp through linear interpolation, merge them into a matrix, and classify and mark them according to different fault types to obtain different fault data, in preparation for the next step of processing.
3. The AC contactor fault prediction method based on improved BA-BP neural network according to claim 1 is characterized in that: In step S2, different fault data are used as input of the LSTM network, and respective LSTM autoencoders are trained to extract the time series features of the data; the LSTM autoencoder includes an input layer, an LSTM layer, a fully connected layer, and an output layer connected in sequence; wherein the fully connected layer maps and reduces the dimensions of the features learned by the LSTM layer, and the output layer outputs the features estimated by the final LSTM network.
4. The AC contactor fault prediction method based on improved BA-BP neural network according to claim 1 is characterized in that: The step S3 comprises: Step S31, dividing the feature data extracted by the LSTM network into a training set and a test set, wherein the training set data is used to solve the optimal weight and bias value of the BP neural network, and the test set data is used to verify the final test effect of the model; Step S32, normalizing the data of the training set and the test set; Step S33, determining the topological structure of the BP neural network; Step S34, initializing the improved BA algorithm; Step S35, establishing a classification model based on an improved BA-BP neural network, that is, using an improved BA algorithm to search for optimal weights and bias values of the BP neural network; Step S36, using the test set data to test the classification model based on the improved BA-BP neural network; Step S37: output the test set classification result.
5. The AC contactor fault prediction method based on improved BA-BP neural network according to claim 4 is characterized in that: In step S35, each bat in the improved BA algorithm represents a set of weights and bias values of the BP neural network, and step S35 includes: Step S351: After the improved BA algorithm is initialized, the bat speed is updated using an improved speed update method according to the current position and the optimal individual position, and a new bat position is calculated; Step S352, updating the bat pulse transmission frequency; Step S353, calculating the fitness of all individuals in the group through the improved fitness function, and judging whether the bat position update condition is met according to the fitness value; if not met, returning to the step S341; Step S354: when the bat position update condition is met, the bat position and pulse loudness are updated, and at the same time, the bat pulse transmission frequency is updated using an improved pulse transmission frequency update method; Step S345, calculate the fitness of all individuals in the group again and sort them, and determine whether the end condition is met; if met, output the weight and bias value of the optimal BP neural network, otherwise, return to the step S341.
6. The AC contactor fault prediction method based on improved BA-BP neural network according to claim 5 is characterized in that: In the step S351, the improvement of the speed update method includes: adding a SIW strategy to the speed update equation, the SIW strategy obtains the inertia weight by random distribution, and its calculation formula is as follows: w=μ min +(m max -m min )×rand()+σ×randn() Among them, μ min is the minimum value of SIW; μ max is the maximum value of SIW; rand() is a random number between 0 and 1; randn() is a random number with standard normal distribution; σ is the standard deviation of SIW and its mean, which is used to control the degree of SIW dispersion; the adjusted speed update equation is as follows: v n (t+1)=wv n (t)+(x n (t)-p k (t))·f n (t) Among them, v n (t+1), v n (t) represents the speed of bat n at time t+1 and time t respectively; w represents the SIW value; x n (t) represents the position of bat n at time t; p k (t) represents the position of the best bat k in the bat group at time t; f n (t) represents the pulse emission frequency of bat n at time t.
7. The AC contactor fault prediction method based on improved BA-BP neural network according to claim 5 or 6, characterized in that: In step S354, the improvement of the pulse transmission frequency update method includes: proposing an adaptive curve decreasing strategy so that the decreasing speed of the pulse transmission frequency is adjusted with the change of the number of iterations, and the pulse transmission frequency update formula after adjustment is: Among them, t is the current iteration number; LG is the total number of algorithm iterations; β1 is the preset parameter used to adjust γ n (t) The changing trend of the update curve; y n (0) represents the original pulse emission frequency of bat n; γ n (t) represents the adjusted pulse emission frequency of bat n.
8. The AC contactor fault prediction method based on improved BA-BP neural network according to claim 5 is characterized in that: In step S34, the improved BA algorithm uses a fitness function to drive the position update of the bat colony to evaluate the classification performance of the model; the fitness function of the improved BA algorithm is designed as follows: Among them, acc0 is the accuracy of the training set; acc1 is the accuracy of the test set; f represents the fitness function value.
9. The AC contactor fault prediction system based on the improved BA-BP neural network is characterized by: The system includes an AC contactor, a sensor, and a computer. The sensor is used to collect working signal data of the AC contactor and send it to the computer. The computer is used to execute a computer program constructed according to the AC contactor fault prediction method based on the improved BA-BP neural network according to any one of claims 1 to 8.