An industrial fault prediction method, system, electronic device, and medium

CN116541675BActive Publication Date: 2026-08-14TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-04
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]在故障预测的架构过程中,存在两项需要考虑的关键问题:一是在不同的时间阶段应当使用不同的工作模型;二是不同的参数拥有不同的采样周期

Benefits of technology

[0041]本发明实施例提出了一种工业故障预测方法、系统、电子设备及介质,对于输入的目标工业数据,根据距离方法首先判断输入何种工作模式,随后将其输入到对应的故障预测模型中,得到相应的故障预测类别,其中,距离方法是采用在经典K-means聚类方法中加入时间维度来实现的,计算的距离为空间距离与时间距离之和,故障预测模型是在Transformer网络中引入状态转移模型实现的,保证了在不同的时间阶段使用不同的工作模型,解决了故障预测过程中参数处于不同采样周期的问题,有效提升了工业故障预测的预测精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116541675B_ABST
    Figure CN116541675B_ABST
Patent Text Reader

Abstract

This invention discloses an industrial fault prediction method, system, electronic device, and medium, relating to the field of fault prediction. The method includes: acquiring industrial data collected by industrial equipment at the current moment to obtain target industrial data; calculating the target distance between the target industrial data and each cluster center, the target distance being calculated based on the spatial and temporal distances between the target industrial data and each cluster center, with each cluster center corresponding to a working mode; determining the working mode corresponding to the cluster center with the smallest target distance among all target distances as the target working mode; inputting the target industrial data into a fault prediction model corresponding to the target working mode to obtain the fault prediction category at future moments; one working mode corresponds to one fault prediction model; the fault prediction model is constructed based on a Transformer network incorporating a state transition model. This invention can improve the prediction accuracy of industrial fault prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fault prediction, and in particular to an industrial fault prediction method, system, electronic device, and medium. Background Technology

[0002] With increasingly fierce competition in the process industry production market, improving production efficiency and reducing production losses are urgent problems for process industry production enterprises. Among them, failures are one of the important reasons why enterprises cannot effectively improve output and production efficiency. In order to optimize the operation process, improve product quality, and reduce failures, modern enterprises have used many advanced technologies, such as remote monitoring, centralized control, and process optimization. However, these technologies based on traditional sensors often fail to obtain truly real-time parameters due to problems such as harsh measurement environments, high computing costs, and high data latency. To solve this problem, failure prediction models based on big data have been widely used. By using machine learning methods, easily readable parameters are modeled with key real-time parameters that are difficult to obtain by traditional sensors during production operations. The model can effectively predict key parameters in the operation and provide important criteria for failure detection.

[0003] Generally speaking, fault prediction models can be divided into two different types: model-driven and data-driven. The former often uses theoretical mechanisms from physics and chemistry to build mathematical models, and then calculates the parameters of the model using partially sampled data; the latter directly builds models using a large amount of historical data. Due to the high complexity of actual working conditions, model-driven models often require extensive professional knowledge. However, with the continuous improvement of factory automation, data acquisition is often relatively simple. By employing machine learning methods, data-driven fault prediction models have been widely applied.

[0004] Fault prediction models typically employ methods including Principal Component Analysis (PCA), Canonical Correlation Analysis (CCA), Support Vector Machines (SVM), and Artificial Neural Networks (ANN). Currently, ANN is the most widely used method, with applications including Deep Belief Networks (DBN) and Stacked Autoencoders (SAE). However, these models often employ static network structures, assuming all data are independently and identically distributed. In real-world industrial activities, the vast amounts of data collected are closely correlated over time. Therefore, the dynamic correlations between industrial data are a crucial factor to consider when constructing fault prediction models. In the field of machine learning, models capable of transmitting information over time include Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTMs). Both types of neural networks can receive information from the past and transmit current information to the timeframes needed in the future. However, when the time span is large, general RNN structures can suffer from vanishing and exploding gradients, which can negatively impact model performance. LSTMs, on the other hand, can avoid this problem and often achieve superior performance compared to RNNs in practical applications.

[0005] In the architecture of fault prediction, two key issues need to be considered: first, different working models should be used at different time stages; second, different parameters have different sampling periods. For the former, K-means clustering is often used to distinguish different working models; however, K-means only considers clustering in the spatial dimension and does not consider the time variable. For the latter, the dual sampling period problem, LSTM networks can be used to predict future quality based on previous true quality variables, which greatly improves prediction accuracy. However, these fault prediction models based on conventional LSTM often require the same sampling period for different variables, but in reality, the sampling periods for equipment parameters that are difficult to collect are often different from those for easily collected parameters. Therefore, current industrial fault prediction methods still cannot solve these key problems, resulting in low accuracy in industrial fault prediction. Summary of the Invention

[0006] Based on this, embodiments of the present invention provide an industrial fault prediction method, system, electronic device, and medium to improve the prediction accuracy of industrial fault prediction.

[0007] To achieve the above objectives, embodiments of the present invention provide the following solutions:

[0008] An industrial failure prediction method, comprising:

[0009] Acquire target industrial data; the target industrial data is the industrial data collected by the industrial equipment at the current moment;

[0010] The spatial distance between the target industrial data and each cluster center is calculated to obtain multiple target spatial distances. The temporal distance between the current time and the time corresponding to each cluster center is calculated to obtain multiple target temporal distances. Each cluster center corresponds to a working mode. The cluster centers are determined based on the K-means algorithm using training sample data. The training sample data includes industrial data collected by industrial equipment in historical time periods.

[0011] Add the target spatial distance and the corresponding target temporal distance to obtain multiple target distances;

[0012] The working mode corresponding to the cluster center with the smallest distance value among all target distances is determined as the target working mode; the target working mode is the working mode of the industrial equipment at the current moment.

[0013] The target industrial data is input into the fault prediction model corresponding to the target working mode to obtain the fault prediction category of the industrial equipment at future time.

[0014] In this context, one working mode corresponds to one fault prediction model; the fault prediction model is obtained by training the Transformer state transition network using the training sample set of the corresponding working mode; one training sample set includes: data of one working mode and the corresponding fault category label in the training sample data; the Transformer state transition network is a Transformer network that incorporates a state transition model.

[0015] Optionally, the method for determining the fault prediction model is as follows:

[0016] Obtain the original training set; the original training set includes training sample data and corresponding fault category labels;

[0017] K sample points are randomly selected from the training sample data as initial cluster centers; each sample point corresponds to one working mode.

[0018] Select any sample point in the training sample data as the target sample point, calculate the spatial distance between the target sample point and each initial cluster center to obtain K training spatial distances, calculate the temporal distance between the collection time of the target sample point and each collection time in the historical period to obtain K training temporal distances, add the training spatial distances and the corresponding training temporal distances to obtain K training distances of the target sample point, and determine the initial cluster center with the smallest distance value among all training distances as the initial cluster center to which the target sample point belongs;

[0019] After assigning each sample point in the training sample data to its corresponding initial cluster center, the feature average value of all sample points in each initial cluster center is calculated to obtain K feature average values, and the feature average values ​​are used as the final cluster centers; the original training set is divided into K training sample sets according to the cluster centers.

[0020] The K training sample sets are input one-to-one into the K Transformer state transition networks for training, resulting in K trained Transformer state transition networks.

[0021] Each trained Transformer state transition network is defined as a fault prediction model.

[0022] Optionally, the K training sample sets are input one-to-one into the K Transformer state transition networks for training, resulting in K trained Transformer state transition networks, specifically including:

[0023] Construct K Transformer state transition networks, each Transformer state transition network comprising: a Transformer encoder and a state transition model connected in sequence; a self-attention mechanism is introduced into the Transformer encoder;

[0024] The training sample set is used as the input of the Transformer encoder in the Transformer state transition network. The state transition model outputs the corresponding fault prediction category. K Transformer state transition networks are trained with the goal of minimizing the total prediction loss value of the loss function to obtain K trained Transformer state transition networks. The total prediction loss value includes the prediction loss at all times in all operating modes.

[0025] Optionally, the formula for calculating the target distance is:

[0026]

[0027] Where, d i,k Indicates the distance to the target; Represents the spatial distance to the target; η[sigmoid((t i -t k ) 2 [)-τ] represents the target time; u i Indicates target industrial data; c k Represents the k-th cluster center; η represents the weight of temporal distance in the calculation of target distance; sigmoid represents the activation function; t i Indicates the current time; t k τ represents the time corresponding to the k-th cluster center; τ represents the time distance offset.

[0028] Optionally, the loss function is:

[0029]

[0030] Where Loss represents the total prediction loss; N represents the number of sample points in the training sample data; Loss i This represents the predicted loss value for the i-th sample point; This represents the fault prediction category of the i-th sample point at time t. Let represent the fault category label of the i-th sample point at time t, and T represent the total number of times corresponding to all times in the original training set.

[0031] The present invention also provides an industrial fault prediction system, comprising:

[0032] The data acquisition module is used to acquire target industrial data; the target industrial data is the industrial data collected by the industrial equipment at the current moment.

[0033] The first distance calculation module is used to calculate the spatial distance between the target industrial data and each cluster center to obtain multiple target spatial distances, and to calculate the temporal distance between the current time and the time corresponding to each cluster center to obtain multiple target temporal distances; wherein, each cluster center corresponds to a working mode; the cluster center is determined based on the K-means algorithm using training sample data; the training sample data includes: industrial data collected by industrial equipment in historical time periods;

[0034] The second distance calculation module is used to add the target spatial distance and the corresponding target temporal distance to obtain multiple target distances;

[0035] The working mode determination module is used to determine the working mode corresponding to the cluster center with the smallest distance value among all target distances as the target working mode; the target working mode is the working mode of the industrial equipment at the current moment.

[0036] The fault prediction module is used to input the target industrial data into the fault prediction model corresponding to the target working mode to obtain the fault prediction category of the industrial equipment at future time.

[0037] In this context, one working mode corresponds to one fault prediction model; the fault prediction model is obtained by training the Transformer state transition network using the training sample set of the corresponding working mode; one training sample set includes: data of one working mode and the corresponding fault category label in the training sample data; the Transformer state transition network is a Transformer network that incorporates a state transition model.

[0038] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the above-described industrial fault prediction method.

[0039] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described industrial fault prediction method.

[0040] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0041] This invention proposes an industrial fault prediction method, system, electronic device, and medium. For input target industrial data, the system first determines the input operating mode based on a distance method, and then inputs it into the corresponding fault prediction model to obtain the corresponding fault prediction category. The distance method is implemented by adding a time dimension to the classic K-means clustering method, and the calculated distance is the sum of spatial distance and temporal distance. The fault prediction model is implemented by introducing a state transition model in a Transformer network, which ensures that different operating models are used at different time stages, solves the problem of parameters being in different sampling periods during the fault prediction process, and effectively improves the prediction accuracy of industrial fault prediction. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 A flowchart of an industrial fault prediction method provided in an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of the Transformer state transition network.

[0045] Figure 3 This is a schematic diagram of the structure of an industrial fault prediction system provided in an embodiment of the present invention. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] Based on the shortcomings of current related technologies, the technical problems to be solved by this invention are: 1) how to use both spatial and temporal dimensions simultaneously to make the clustering results more reasonable; 2) how to solve the problem of different parameter sampling periods while maintaining high prediction accuracy. To solve these problems, this invention is based on temporal-dimensional clustering and multi-model time-series prediction, thereby effectively improving the prediction accuracy of industrial fault prediction.

[0048] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0049] Example 1

[0050] See Figure 1 The industrial fault prediction method of this embodiment includes:

[0051] Step 101: Acquire target industrial data; the target industrial data is the industrial data collected by the industrial equipment at the current moment.

[0052] Step 102: Calculate the spatial distance between the target industrial data and each cluster center to obtain multiple target spatial distances. Calculate the temporal distance between the current time and the time corresponding to each cluster center to obtain multiple target temporal distances.

[0053] Wherein, one cluster center corresponds to one type of working mode; the cluster center is determined based on the K-means algorithm and using training sample data; the training sample data includes: industrial data collected by industrial equipment in historical periods.

[0054] Step 103: Add the target spatial distance and the corresponding target temporal distance to obtain multiple target distances. The formula for calculating the target distance is:

[0055]

[0056] Where, d i,k Indicates the distance to the target; Represents the spatial distance to the target; η[sigmoid((t i -t k ) 2 [)-τ] represents the target time; u i Indicates target industrial data; c k Represents the k-th cluster center; η represents the weight of temporal distance in the calculation of target distance, reflecting the ratio of target temporal distance to target spatial distance; sigmoid represents the activation function; t i Indicates the current time; t k τ represents the time corresponding to the k-th cluster center; τ represents the time distance offset, used to control the range of time distance.

[0057] Step 104: Determine the working mode corresponding to the cluster center with the smallest distance value among all target distances as the target working mode; the target working mode is the working mode of the industrial equipment at the current moment.

[0058] Step 105: Input the target industrial data into the fault prediction model corresponding to the target working mode to obtain the fault prediction category of the industrial equipment at future times.

[0059] In this context, one working mode corresponds to one fault prediction model; the fault prediction model is obtained by training the Transformer state transition network using the training sample set of the corresponding working mode; one training sample set includes: data of one working mode and the corresponding fault category label in the training sample data; the Transformer state transition network is a Transformer network that incorporates a state transition model.

[0060] Specifically, the method for determining the fault prediction model is as follows:

[0061] 1) Obtain the original training set; the original training set includes training sample data and corresponding fault category labels.

[0062] 2) Randomly select K sample points from the training sample data as initial cluster centers; one sample point corresponds to one working mode.

[0063] 3) Select any sample point in the training sample data as the target sample point, calculate the spatial distance between the target sample point and each initial cluster center to obtain K training spatial distances, calculate the temporal distance between the collection time of the target sample point and each collection time in the historical period to obtain K training temporal distances, add the training spatial distances and the corresponding training temporal distances to obtain K training distances of the target sample point, and determine the initial cluster center with the smallest distance value among all training distances as the initial cluster center to which the target sample point belongs.

[0064] The calculation method for training distance is similar to that for target distance, and will not be repeated here.

[0065] 4) After assigning each sample point in the training sample data to its corresponding initial cluster center, calculate the feature average of all sample points in each initial cluster center to obtain K feature averages, and use the feature averages as the final cluster centers; the original training set is divided into K training sample sets according to the cluster centers.

[0066] 5) Input the K training sample sets one-to-one into the K Transformer state transition networks for training, resulting in K trained Transformer state transition networks. Specifically:

[0067] Construct K Transformer state transition networks, each Transformer state transition network comprising: a Transformer encoder and a state transition model connected in sequence; the Transformer encoder incorporates a self-attention mechanism.

[0068] The training sample set is used as the input of the Transformer encoder in the Transformer state transition network. The state transition model outputs the corresponding fault prediction category. K Transformer state transition networks are trained with the goal of minimizing the total prediction loss value of the loss function to obtain K trained Transformer state transition networks. The total prediction loss value includes the prediction loss at all times in all operating modes.

[0069] The loss function is:

[0070]

[0071] Where Loss represents the total prediction loss; N represents the number of sample points in the training sample data; Loss i This represents the predicted loss value for the i-th sample point; This represents the fault prediction category of the i-th sample point at time t. Let represent the fault category label of the i-th sample point at time t, and T represent the total number of times corresponding to all times in the original training set.

[0072] 6) Each trained Transformer state transition network is identified as a fault prediction model.

[0073] The industrial fault prediction method in this embodiment is based on time-dimensional clustering and multi-model time-series prediction. By adding a time dimension to the classic K-means clustering method, the clustering results are made more reasonable. Subsequently, a state transition model is introduced into the Transformer network to address the issue of parameters being in different sampling periods during fault prediction. By combining these two methods and designing the overall network prediction loss, the fault prediction accuracy of time-series data can be effectively improved.

[0074] In practical applications, a more specific implementation process of the industrial fault prediction method described in the above embodiments is as follows:

[0075] Step 1: Obtaining the multi-model dataset.

[0076] Data acquisition in industrial fault prediction relies on the coordinated use of sensor hardware and computer software. Taking current data as an example, during the acquisition process, front-end current sensors collect current intensity data at different times, and the collected current signals are transmitted to the computer software for quantification. Intuitively, for a given type of industrial fault prediction data, its dimensions include two dimensions: the horizontal axis typically represents the acquisition frequency or acquisition time, and the vertical axis typically represents the numerical value at that acquisition frequency or time, such as current intensity. Overall, by using sensors to collect the same type of data and corresponding fault labels across multiple time periods, a fault prediction dataset can be obtained.

[0077] Step 2: Apply K-means clustering with a time dimension to the multi-model data:

[0078] In industrial fault prediction, clustering algorithms can help researchers distinguish different types of fault modes or fault types. Data clustering is an unsupervised classification method that aims to create groups of data samples where data samples within the same group are very similar, while data samples in different groups are quite different. Specifically, K-means is a typical data clustering algorithm that continuously optimizes cluster centers by minimizing the sum of distances between sample points and sample centers, thereby achieving the goal of similar samples clustering around the same cluster centers. First, the feature vectors of data samples in a specific dimension and the cluster center vectors with the same dimension as the sample feature vectors are located. The number of cluster centers is determined by the categories to be clustered, and the midpoint of the sample is randomly selected as the cluster center. The distances of other samples in the sample to these cluster centers are calculated, and these samples are assigned to the group with the nearest cluster center. The feature average is calculated for each category to obtain the new cluster centers. The above iterative process of clustering centers is repeated many times until the model converges, and the clustered data samples are obtained. However, traditional K-means clustering only considers the spatial distance between feature vectors, lacking modeling of the time dimension in time series. In reality, most modern industrial process data are highly sensitive to time-related characteristics. Data generated within the same industrial system, if sample points are close in time, often indicate similar operating or failure modes. If the operating conditions change several times within a period, the operating or failure mode will also change several times. Therefore, incorporating a new time dimension of distance is of profound significance for determining operating or failure modes in industrial production.

[0079] In theory, the K-means clustering algorithm with the added time dimension works as follows: First, define the data samples by adding a time dimension to the original feature dimensions. Correspondingly, the feature vectors of the cluster centers also gain a time dimension. Next, define a distance calculation method to quantify the distance between the data samples and the cluster centers, taking into account both spatial and temporal dimensions. Assign sample points to the cluster centers closest to them. For a given cluster center, recalculate the cluster center by averaging the features of its surrounding samples. Repeat this process until the sample centers no longer change.

[0080] Based on the above calculation process, the specific calculation process of the algorithm is as follows: Define u i ∈R q×1 For data samples, ut i ∈R (++1)×1 =[u i , t i This indicates that a feature vector with a time dimension has been added, with c as an example. i ∈R q×1 ct represents the original vector cluster centers. k ∈R (q+1)×1 =[ck , t k ] represents the vector cluster center after the time dimension has been added, ut i With CT k The distance is calculated as follows:

[0081]

[0082] Where sigmoid(x) = (1 + exp(-x)) -1 The sigmoid function is the activation function. The first part of the distance formula represents the spatial distance between a sample and its cluster center, while the second part represents the calculation of the temporal distance. The sigmoid function is used to adjust the distance over time. When performing K-means clustering with a time dimension, k cluster centers (ct) are first randomly selected. k And calculate any ut i With all CT k The distance, will ut i Classify it into the ct with the smallest distance. k In the process, the process is repeated until all sample points are assigned to a certain category, then the center of all sample points is recalculated and the ct is updated. k Repeat this process until the sample center no longer changes.

[0083] Step 3: Construct a Transformer network based on the state transition model to achieve time-series state updates of variables and fault type prediction. See also Figure 2 In this embodiment of the invention, the encoder in the Transformer structure (i.e., the Transformer encoder) is used as the method for extracting and initially updating time-series state variables. Then, the state transition model is applied to the state vector update and fault type prediction at each time step.

[0084] Specifically, the introduction of multi-head attention (MSA) in the Transformer architecture effectively models the temporal information in the sequence and updates the state of the feature vector at each time step. The update process considers the correlation and temporal relationship between state vectors at different time steps, aiming to achieve accurate prediction of the state vector at each time step. In summary, the Transformer encoder consists of structures such as a multi-head attention layer (MSA) and a feedforward neural network (FFN), and the computation process also involves operations such as layer normalization and residual connections.

[0085] Suppose that after clustering, the temporal state vector sequence input of a certain type of model can be represented as:

[0086] H = [h0, h1, h2, ..., h T ]

[0087] hi Let H represent the temporal state vector at time i. The temporal state vector sequence H first passes through a multi-head attention layer, and its calculation process is as follows:

[0088]

[0089] MSA stands for Multi-Head Self-Attention. Q, K, and V represent the input matrices. In this embodiment of the invention, the values ​​of Q, K, and V are all H. In this case, MSA is MSA(H). d represents the scaling factor, which is used to control the numerical range of the dot product operation in the numerator to avoid negatively affecting the network gradient.

[0090] After the multi-head self-attention mechanism, the state vector at each time step is updated. Through residual connection, the original state vector information is preserved while the attention information is combined to obtain an updated state vector with descriptive power.

[0091] H′=LN(H+MSA(H))

[0092] LN represents layer normalization. A feedforward neural network is then designed to continue updating the state vector. Residual connections and layer normalization are subsequently introduced to preserve as much effective information as possible during feature extraction.

[0093] FFN(H′)=W b ·σ(W a H′)

[0094] H ud =LN(H′)+FFN(H′)

[0095] H ud =[h ud(0) h ud(1) h ud(i) , ..., h ud(T) ] represents the updated temporal state vector sequence obtained after H passes through the Transformer encoder, H ud The state vector at each time step in H has the same feature dimension as W. a and W b This represents the weight matrix during the encoding process, and σ represents the sigmoid activation function.

[0096] In order to accurately predict the state vector at each time step, this invention combines the state transition model with the Transformer encoder to construct a temporal state prediction structure.

[0097] Specifically, the output of the Transformer encoder is connected to the input of the state transition model, and the state transition model updates the state vector sequence H. udThe state vector at each time step is used as input to achieve state vector updating and state prediction based on contextual temporal information. The purpose of introducing a state transition model is to simulate the change process of the state vector and emphasize the influence of state variables at similar times on the target state vector. In the state transition model, it is assumed that the state variable at time t is h. ud(t) The process variable is u t The fault prediction category at time t+j needs to be predicted as follows: The system model can then be represented as:

[0098]

[0099]

[0100] In this formula, the state variable at time t+j is determined by the state variable at time t and the process variables within the interval [t, t+j]. W1, W2, and W3 in the formula are weight matrices used in the state transition process. Using the known state variables and related process variables, the fault prediction type at any given time can be calculated.

[0101] The computation process of the state transition model mainly includes three parts: First, state initialization. In this process, the initial hidden vector h0 is calculated using the initial value y0 of the true fault category. At this point, the values ​​of all process variables u are known in the database. After state initialization, the state is updated using the Transformer encoder. Finally, the loss function is calculated. In order for the model to learn the relationship between the initial value y0 of the true fault category and its corresponding process variable u, the state transition Transformer network should ensure that the initial value y0 of the true fault category at each subsequent time step is equal to the initial value y0 of the true fault category. t With corresponding predicted fault prediction categories If the difference between the predicted and actual values ​​is within a certain accuracy range, the parameters in the network are updated by calculating the loss between the predicted and actual values. The formula for calculating the loss function will not be elaborated here.

[0102] The overall loss function is calculated by balancing the prediction losses of all sample points. The loss function for each sample point combines the prediction losses from all time points.

[0103] Step 4: Based on the methods in Step 2 and Step 3, the clustered data samples obtained in Step 2 are used as input to the state prediction network. For each cluster category, a Transformer structure for state transition is designed, and the prediction loss function in Step 3 is used to update the model parameters.

[0104] Specifically, the steps to achieve fault prediction are as follows:

[0105] First, for the training samples in the dataset, the K-means clustering algorithm with the added time dimension from step two is used to cluster data under different operating conditions. This step is trained separately, and the clustered data samples are then used in the next step.

[0106] Secondly, based on the data processing mode, the clustered data samples are input into different Transformer state transition structures. The network structure for this part is as follows: Figure 2 As shown, each data operation mode (fault clustering category) corresponds to a Transformer state transition network with independent parameters. Each state transition network can output the fault prediction category in that mode. The prediction results are compared with the actual fault labels in the dataset to calculate the prediction loss. The prediction loss at all times in all operation modes is considered during the calculation. The loss function of the overall network is obtained by summing the above losses.

[0107] Finally, after the model training is completed, during the testing phase, for the input data samples, the distance method is used to first determine the input mode, and then the data is input into the corresponding Transformer state transition module to obtain the corresponding fault prediction category.

[0108] The industrial fault prediction method in this embodiment has the following advantages: it effectively solves the fault diagnosis problem of various types of fault data under different sampling periods; the introduction of the time dimension in the original data clustering process makes the clustering results more accurate and reasonable; and the industrial fault prediction model based on time dimension clustering and multi-model time series prediction method improves the accuracy of fault prediction in industrial production process, which has practical significance.

[0109] Example 2

[0110] In order to implement the method corresponding to Embodiment 1 above and achieve the corresponding functions and technical effects, an industrial fault prediction system is provided below.

[0111] See Figure 3 The system includes:

[0112] The data acquisition module 301 is used to acquire target industrial data; the target industrial data is industrial data collected by industrial equipment at the current moment.

[0113] The first distance calculation module 302 is used to calculate the spatial distance between the target industrial data and each cluster center to obtain multiple target spatial distances, and to calculate the temporal distance between the current time and the time corresponding to each cluster center to obtain multiple target temporal distances; wherein, one cluster center corresponds to one type of working mode; the cluster center is determined based on the K-means algorithm and using training sample data; the training sample data includes: industrial data collected by industrial equipment in historical time periods.

[0114] The second distance calculation module 303 is used to add the target spatial distance and the corresponding target temporal distance to obtain multiple target distances.

[0115] The working mode determination module 304 is used to determine the working mode corresponding to the cluster center with the smallest distance value among all target distances as the target working mode; the target working mode is the working mode of the industrial equipment at the current moment.

[0116] The fault prediction module 305 is used to input the target industrial data into the fault prediction model corresponding to the target working mode to obtain the fault prediction category of the industrial equipment at a future time.

[0117] In this context, one working mode corresponds to one fault prediction model; the fault prediction model is obtained by training the Transformer state transition network using the training sample set of the corresponding working mode; one training sample set includes: data of one working mode and the corresponding fault category label in the training sample data; the Transformer state transition network is a Transformer network that incorporates a state transition model.

[0118] Example 3

[0119] This embodiment provides an electronic device, including a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the industrial fault prediction method of Embodiment 1.

[0120] Alternatively, the aforementioned electronic device may be a server.

[0121] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the industrial fault prediction method of Embodiment 1.

[0122] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0123] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An industrial fault prediction method, characterized in that, include: Acquire target industrial data; the target industrial data is the industrial data collected by the industrial equipment at the current moment; The spatial distance between the target industrial data and each cluster center is calculated to obtain multiple target spatial distances. The temporal distance between the current time and the time corresponding to each cluster center is calculated to obtain multiple target temporal distances. Each cluster center corresponds to a working mode. The cluster centers are determined based on the K-means algorithm using training sample data. The training sample data includes industrial data collected by industrial equipment in historical time periods. Add the target spatial distance and the corresponding target temporal distance to obtain multiple target distances; The working mode corresponding to the cluster center with the smallest distance value among all target distances is determined as the target working mode; the target working mode is the working mode of the industrial equipment at the current moment. The target industrial data is input into the fault prediction model corresponding to the target working mode to obtain the fault prediction category of the industrial equipment at future time. One working mode corresponds to one fault prediction model; the fault prediction model is obtained by training the Transformer state transition network using the training sample set of the corresponding working mode; one training sample set includes: data of one working mode and the corresponding fault category label in the training sample data; the Transformer state transition network is a Transformer network with a state transition model introduced. The method for determining the fault prediction model is as follows: Obtain the original training set; the original training set includes training sample data and corresponding fault category labels; K sample points are randomly selected from the training sample data as initial cluster centers; each sample point corresponds to one working mode. Select any sample point in the training sample data as the target sample point, calculate the spatial distance between the target sample point and each initial cluster center to obtain K training spatial distances, calculate the temporal distance between the collection time of the target sample point and each collection time in the historical period to obtain K training temporal distances, add the training spatial distances and the corresponding training temporal distances to obtain K training distances of the target sample point, and determine the initial cluster center with the smallest distance value among all training distances as the initial cluster center to which the target sample point belongs; After assigning each sample point in the training sample data to its corresponding initial cluster center, the feature average value of all sample points in each initial cluster center is calculated to obtain K feature average values, and the feature average values ​​are used as the final cluster centers; the original training set is divided into K training sample sets according to the cluster centers. The K training sample sets are input one-to-one into the K Transformer state transition networks for training, resulting in K trained Transformer state transition networks. Each trained Transformer state transition network is defined as a fault prediction model; The K training sample sets are input one-to-one into the K Transformer state transition networks for training, resulting in K trained Transformer state transition networks, specifically including: Construct K Transformer state transition networks, each Transformer state transition network comprising: a Transformer encoder and a state transition model connected in sequence; a self-attention mechanism is introduced into the Transformer encoder; The training sample set is used as the input of the Transformer encoder in the Transformer state transition network. The state transition model outputs the corresponding fault prediction category. K Transformer state transition networks are trained with the goal of minimizing the total prediction loss value of the loss function to obtain K trained Transformer state transition networks. The total prediction loss value includes the prediction loss at all times in all operating modes.

2. The industrial fault prediction method according to claim 1, characterized in that, The formula for calculating the target distance is: ; in, Indicates the distance to the target; Indicates the spatial distance to the target; Indicate the target time; Indicates target industrial data; Indicates the first k Cluster centers; This indicates the weight of time distance in the process of calculating the target distance; Indicates the activation function; Indicates the current time; Indicates the first k The time corresponding to each cluster center; Indicates time-distance offset.

3. The industrial fault prediction method according to claim 1, characterized in that, The loss function is: ; in, Loss This represents the total predicted loss value; N This indicates the number of sample points in the training sample data; Indicates the first i The predicted loss value for each sample point; , Indicates the first i sample points t Fault prediction category at any time, Indicates the first i sample points t Fault category label at any time, T This represents the total number of all time points corresponding to the original training set.

4. An industrial fault prediction system, characterized in that, include: The data acquisition module is used to acquire target industrial data; the target industrial data is the industrial data collected by the industrial equipment at the current moment. The first distance calculation module is used to calculate the spatial distance between the target industrial data and each cluster center to obtain multiple target spatial distances, and to calculate the temporal distance between the current time and the time corresponding to each cluster center to obtain multiple target temporal distances; wherein, each cluster center corresponds to a working mode; the cluster center is determined based on the K-means algorithm using training sample data; the training sample data includes: industrial data collected by industrial equipment in historical time periods; The second distance calculation module is used to add the target spatial distance and the corresponding target temporal distance to obtain multiple target distances; The working mode determination module is used to determine the working mode corresponding to the cluster center with the smallest distance value among all target distances as the target working mode; the target working mode is the working mode of the industrial equipment at the current moment. The fault prediction module is used to input the target industrial data into the fault prediction model corresponding to the target working mode to obtain the fault prediction category of the industrial equipment at future time. One working mode corresponds to one fault prediction model; the fault prediction model is obtained by training the Transformer state transition network using the training sample set of the corresponding working mode; one training sample set includes: data of one working mode and the corresponding fault category label in the training sample data; the Transformer state transition network is a Transformer network with a state transition model introduced. The method for determining the fault prediction model is as follows: Obtain the original training set; the original training set includes training sample data and corresponding fault category labels; K sample points are randomly selected from the training sample data as initial cluster centers; each sample point corresponds to one working mode. Select any sample point in the training sample data as the target sample point, calculate the spatial distance between the target sample point and each initial cluster center to obtain K training spatial distances, calculate the temporal distance between the collection time of the target sample point and each collection time in the historical period to obtain K training temporal distances, add the training spatial distances and the corresponding training temporal distances to obtain K training distances of the target sample point, and determine the initial cluster center with the smallest distance value among all training distances as the initial cluster center to which the target sample point belongs; After assigning each sample point in the training sample data to its corresponding initial cluster center, the feature average value of all sample points in each initial cluster center is calculated to obtain K feature average values, and the feature average values ​​are used as the final cluster centers; the original training set is divided into K training sample sets according to the cluster centers. The K training sample sets are input one-to-one into the K Transformer state transition networks for training, resulting in K trained Transformer state transition networks. Each trained Transformer state transition network is defined as a fault prediction model; The K training sample sets are input one-to-one into the K Transformer state transition networks for training, resulting in K trained Transformer state transition networks, specifically including: Construct K Transformer state transition networks, each Transformer state transition network comprising: a Transformer encoder and a state transition model connected in sequence; a self-attention mechanism is introduced into the Transformer encoder; The training sample set is used as the input of the Transformer encoder in the Transformer state transition network. The state transition model outputs the corresponding fault prediction category. K Transformer state transition networks are trained with the goal of minimizing the total prediction loss value of the loss function to obtain K trained Transformer state transition networks. The total prediction loss value includes the prediction loss at all times in all operating modes.

5. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the industrial fault prediction method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the industrial fault prediction method as described in any one of claims 1 to 3.