Fault diagnosis method based on time-decay position encoding, electronic device
By employing temporal decay position encoding and a multi-scale time-aware attention mechanism, the problem of deep learning models being unable to distinguish between short-term and long-term faults in elevator fault diagnosis is solved, achieving higher fault detection accuracy and early fault warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING SPECIAL EQUIP TESTING & RES INST (CHONGQING SPECIAL EQUIP ACCIDENT EMERGENCY INVESTIGATION & PROCESSING CENT)
- Filing Date
- 2026-05-22
- Publication Date
- 2026-07-21
AI Technical Summary
Existing deep learning models cannot adaptively capture the temporal characteristics of elevator faults in elevator fault diagnosis, and it is difficult to distinguish between short-term and long-term faults.
A temporal decay position coding method is adopted. By calculating the adaptive decay coefficient and multi-scale time-aware attention mechanism, combined with a temporal Transformer network, short-term and long-term fault features in elevator operation data are extracted.
It improves the accuracy of elevator fault differentiation and detection, can adapt to different working conditions, effectively captures short-term and long-term fault characteristics, and provides early fault diagnosis and maintenance suggestions.
Smart Images

Figure CN122241444B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fault detection technology, and more specifically, to a fault diagnosis method and electronic device based on time-series decay position coding. Background Technology
[0002] Elevators are an essential component of modern residential, commercial, and industrial buildings, making their safety and reliability paramount. In particular, faults in the stator windings of elevator traction machines, if not detected early, can lead to a rapid deterioration in elevator performance or even complete burnout, causing unplanned outages and resulting in safety hazards and economic losses. Existing diagnostic methods employ deep learning models combined with temporal features to analyze and detect elevator faults.
[0003] CN117435997A discloses an elevator early warning and on-demand maintenance method based on Transformer and temporal compression mechanism. The method first collects raw data from IoT elevators, cleans the raw data, and converts it into multimodal temporal features. It then uses a partial autocorrelation function (PACF) to analyze the correlation between features and selects features highly correlated with elevator faults. These features and their corresponding PACF values are processed and concatenated through an embedding layer to form a comprehensive vector feature. After relative position encoding of the comprehensive vector feature, it is input into a Transformer model. In the model, a self-attention mechanism is used to extract and cross-reference the comprehensive vector features, while convolutional pooling layers are used for temporal compression to reduce data complexity. A fully connected layer maps the compressed features to prediction results. During model training, optimization algorithms are used to improve performance. When predicting maintenance needs, the prediction results are refined through multi-layer convolutional blocks based on fault type and probability distribution to generate specific maintenance requirements.
[0004] The aforementioned invention patent employs position encoding, but the encoding value remains unchanged at the same location, making it difficult to adjust based on real-time elevator operation data. This results in a weak capture of the temporal characteristics of elevator malfunctions and difficulty in distinguishing between short-term and long-term elevator faults. Therefore, the deep learning model in the aforementioned invention, which relies on temporal features to differentiate and detect elevator malfunctions, has shortcomings. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a fault diagnosis method and electronic device based on temporal decay position coding, which can solve the problem that when a deep learning model distinguishes and detects elevator faults based on temporal features, it cannot adaptively capture the temporal features of elevator faults and has difficulty distinguishing between short-term and long-term elevator faults.
[0006] To achieve the above technical objectives, the technical solution adopted in this application is as follows:
[0007] In a first aspect, embodiments of this application provide a fault diagnosis method based on timing decay position coding, the method comprising:
[0008] Acquire time-series data characterizing the changes in traction machine current and vibration signals over time during elevator operation;
[0009] Based on a preset strategy, the time series data is preprocessed to obtain a time series tensor. The preprocessing is used to split the time series data into equal lengths and then concatenate them along the same dimension to obtain the time series tensor.
[0010] Based on the time series tensor, an adaptive decay coefficient is calculated using a time series decay model. The time series decay model is used to characterize the degree to which the temporal correlation between different time points decays as the interval increases.
[0011] The temporal decay position encoding used to characterize the feature correlation between different time steps is obtained based on the adaptive decay coefficient;
[0012] The temporal tensor and the temporal decay position encoding are input into a deep learning model. The deep learning model processes the temporal tensor and the temporal decay position encoding into fused temporal features, and obtains a fault judgment result based on the fused temporal features. The fault judgment result is used to diagnose the fault type.
[0013] According to the first aspect, calculating the adaptive decay coefficient based on the time-series tensor using a time-series decay model includes:
[0014] Based on the temporal tensor, the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi) of the temporal tensor are calculated.
[0015] ,
[0016] ,
[0017] Where, x i This represents the i-th time series feature value. Let i represent the standard deviation of the sliding window centered at i, and W be the preset sliding window size. The standard deviation of all time series sequences of the time series tensor is represented, and L is the preset sequence length of the time series tensor. This represents the standard deviation of long-range segments in a time-series tensor. Let Δi represent the long-range segment mean, and let Δi represent the relative temporal distance between the i-th and j-th sampling points. i and j represent the temporal position indices, respectively;
[0018] Based on the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi), the adaptive attenuation coefficient α(Δi) is obtained.
[0019] ,
[0020] Wherein, γ1(i) is the local scaling factor, and γ2(i,Δi) is the long-range scaling factor.
[0021] According to the first aspect, obtaining the temporal decay position code for characterizing the feature correlation between different time steps based on the adaptive decay coefficient includes: calculating the relative temporal decay factor τ(Δi) based on the adaptive decay coefficient α(Δi).
[0022] ,
[0023] Where L is the preset sequence length of the time series tensor, and exp represents the natural exponential function;
[0024] Based on the relative temporal decay factor τ(Δi), the temporal decay position code P, used to characterize the feature correlation between different time steps, is obtained.
[0025] ,
[0026] ,
[0027] ,
[0028] Where, p i (2k) represents the even-dimensional positional encoding, p i (2k+1) represents odd-dimensional positional encoding, where wk is the frequency term representing the normalized frequency of the sequence length. k represents the embedded dimension index, and d represents the preset dimension.
[0029] According to the first aspect, the deep learning model includes a temporal Transformer network, which includes a feature extraction module, a multi-scale time-aware attention module, and a gated fusion module. The deep learning model encodes the temporal tensor and the temporal decay position to form fused temporal features, including:
[0030] The temporal tensor is subjected to feature extraction through a one-dimensional convolutional layer in the feature extraction module to obtain temporal features;
[0031] The time-series features are fused with the time-series decay position encoding to obtain basic time-series features that characterize the relationship between fault features and time-series positions in the time-series data;
[0032] Through the multi-scale feature extraction network in the multi-scale time-aware attention module, based on the basic temporal features, global temporal features representing long-term faults and local temporal features representing short-term faults are obtained.
[0033] The gating fusion module performs gating weighted fusion of the global temporal features and the local temporal features to obtain the fused temporal features.
[0034] According to the first aspect, the multi-scale feature extraction network includes a global feature extraction network for extracting global temporal features and a local feature extraction network for extracting local temporal features. The step of obtaining global temporal features representing long-term faults and local temporal features representing short-term faults based on the basic temporal features through the multi-scale feature extraction network in the multi-scale time-aware attention module includes:
[0035] The multi-scale time-aware attention module performs a linear projection on the basic temporal features to obtain the query matrix Q, the key matrix K, and the value matrix V.
[0036] ,
[0037] ,
[0038] ,
[0039] ,
[0040] Where Q represents the query matrix, K represents the key matrix, V represents the value matrix, and W represents the value matrix. Q W K、 W V Let X represent the projection matrices of the query matrix Q, the key matrix K, and the value matrix V, respectively. pos X represents the basic time-series feature. emb This represents the temporal characteristics;
[0041] Based on the query matrix Q and the key matrix K, the value matrix V is weighted and summed to obtain the attention-enhanced feature Att.
[0042] ,
[0043] Where, d k The feature dimension of the preset single-head attention is represented, and τ(Δi) represents the relative temporal decay factor;
[0044] The attention enhancement features are input into the global feature extraction network to obtain the global temporal feature Att. glo ,
[0045]
[0046] The attention enhancement feature is input into the local feature extraction network. A one-dimensional convolutional layer in the local feature extraction network performs a convolution operation on the attention enhancement feature to extract fault features, thus obtaining the local temporal feature Att. loc
[0047] ,
[0048] Where Conv1D represents a one-dimensional convolutional layer, and Att represents the attention-enhancing feature. This represents three different lengths of one-dimensional convolution kernels.
[0049] According to the first aspect, the global temporal features and the local temporal features are gated and weighted and fused through the gated fusion module to obtain the fused temporal features, including:
[0050] ,
[0051] ,
[0052] Where g(Δi) represents the gated fusion coefficient, α(Δi) represents the adaptive decay coefficient, Sigmoid represents the activation function, and W g b represents the learnable gating weight parameter. g Att represents the learnable bias parameter, ⊙ represents the Hadamard product, and Att represents the Hadamard product. loc Att represents the local temporal features. glo The global temporal features are represented by the learnable gating weight parameter W. g With the learnable bias parameter b g , which are the trainable parameters of the deep learning model. During the model training process, the trainable parameters participate in backpropagation and are iteratively updated. After training is completed, they are used as fixed model parameters.
[0053] According to the first aspect, the preprocessing of the time-series data based on a preset strategy to obtain a time-series tensor includes:
[0054] The three-phase current signal and vibration signal in the time series data are synchronized and aligned according to the timestamp to obtain the aligned time series data.
[0055] The four signal channels composed of the three-phase current signal and the vibration signal in the aligned time series data are normalized respectively to obtain normalized time series data.
[0056] The normalized time series data is split into several time series sequences of length L by a preset sequence length L.
[0057] The time series tensor is obtained by stacking and splicing the several time series segments of length L.
[0058] According to the first aspect, obtaining the fault judgment result based on the fused timing features includes:
[0059] The fused temporal features are input into the standard pooling layer in the deep learning model. The standard pooling layer compresses the dimensionality of the fused temporal features to obtain the fused temporal feature vector.
[0060] The fused temporal feature vector is input into the fully connected layer of the deep learning model. The fully connected layer performs classification mapping on the fused temporal feature vector and outputs the corresponding classification feature vector.
[0061] The classification feature vector is transformed by the softmax function to obtain the corresponding fault probability distribution, and the fault judgment result used to diagnose the fault type is obtained based on the fault probability distribution.
[0062] According to the first aspect, prior to acquiring the timing data during elevator operation, the method further includes:
[0063] Acquire historical time-series data of the traction machine's historical current and historical vibration signals over time, representing the operation of multiple elevators, as well as historical real fault classification results;
[0064] Based on a preset strategy, the historical time series data is preprocessed to obtain a historical time series tensor. The preprocessing is used to split the historical time series data into equal lengths and then concatenate them along the same dimension to obtain the historical time series tensor.
[0065] Based on the historical time series tensor, an adaptive decay coefficient is calculated through a time series decay model. The time series decay model is used to characterize the degree to which the temporal correlation between different time points decays as the interval increases.
[0066] Based on the adaptive decay coefficient, a historical temporal decay position code is obtained to characterize the temporal correlation pattern of the feature correlation between different time steps;
[0067] The historical time series tensor, the historical time series decay position encoding, and the historical real fault classification results are integrated into training data.
[0068] A deep learning model is initialized based on the training data. During the training process, the trainable parameters participate in backpropagation and are iteratively updated. After training, they are used as fixed model parameters so that after the temporal tensor and the temporal decay position encoding are input into the deep learning model, the deep learning model outputs the fault judgment result.
[0069] Secondly, embodiments of this application also provide an electronic device, the electronic device including a processor and a memory coupled to each other, the memory storing a computer program, and when the computer program is executed by the processor, causing the electronic device to perform the method as described in the first aspect.
[0070] The invention employing the above technical solution has the following advantages:
[0071] In the technical solution provided in this application, an adaptive attenuation coefficient is calculated using a time-series attenuation function, enabling adaptive changes to the trends of short-term and long-term faults. Based on the adaptive attenuation coefficient, a time-series attenuation location code is obtained to characterize the time-series correlation pattern. This code is effectively combined with the fault time-series pattern, and the code changes with the elevator's operating state and fault type, adapting to different operating conditions. The introduction of a multi-scale time-aware attention mechanism effectively captures both short-term and long-term fault characteristics, thereby improving the accuracy of elevator fault differentiation and detection. Attached Figure Description
[0072] This application can be further illustrated by the non-limiting embodiments given in the accompanying drawings. It should be understood that the following drawings only illustrate some embodiments of this application and should not be considered as limiting the scope. For those skilled in the art, other related drawings can be obtained from these drawings without any inventive effort.
[0073] Figure 1 A flowchart of a fault diagnosis method based on timing decay position coding provided in an embodiment of this application. Detailed Implementation
[0074] The present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that similar or identical parts are referred to by the same reference numerals in the drawings or description. Implementations not shown or described in the drawings are forms known to those skilled in the art. In the description of this application, terms such as "first" and "second" are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0075] Please refer to Figure 1This application provides a fault diagnosis method based on time-decayed location coding, which can be applied to electronic devices and can be executed or implemented by the electronic device. The electronic device can be, but is not limited to, personal computers, smartphones, and other electronic devices. The fault diagnosis method based on time-decayed location coding may include the following steps:
[0076] S10 acquires time-series data characterizing the changes in traction machine current and vibration signals over time during elevator operation;
[0077] S20 preprocesses the time series data based on a preset strategy to obtain a time series tensor. The preprocessing is used to split the time series data into equal lengths and then concatenate them along the same dimension to obtain the time series tensor.
[0078] S30 calculates an adaptive decay coefficient based on the time series tensor using a time series decay model. The time series decay model is used to characterize the degree to which the time series correlation between different time points decays as the interval increases.
[0079] S40 obtains a temporal decay position code to characterize the feature correlation between different time steps based on the adaptive decay coefficient;
[0080] S50 inputs the temporal tensor and the temporal decay position encoding into a deep learning model. The deep learning model processes the temporal tensor and the temporal decay position encoding into fused temporal features, and obtains a fault judgment result based on the fused temporal features. The fault judgment result is used to diagnose the fault type.
[0081] This application provides another fault diagnosis method based on time-decayed location coding for fault detection and classification of elevators under all operating conditions. By incorporating time-decayed location coding based on elevator time-series signals into a deep learning model, the multi-scale time-aware attention module in the deep learning model architecture can effectively extract short-term fault features and long-term fault evolution features. Through training this network model, elevator fault detection and classification based on time-series data can be achieved. This provides data reference for equipment maintenance personnel, enabling them to detect elevator fault characteristics early and rationally plan maintenance cycles.
[0082] The following is a detailed explanation of each step in the fault diagnosis method based on time-decrease position coding:
[0083] In S10, sensors can collect three-phase current signals and vibration signals throughout the elevator's entire operation. The three-phase current signals include real-time power frequency current data from the U, V, and W phases of the elevator traction machine's stator windings. The vibration signals include time-series data of mechanical vibration acceleration during elevator traction machine operation. The peak values and timing fluctuations of brief impact vibrations in the vibration signals can reflect short-term faults such as instantaneous deformation of elevator mechanical components. Variations in the amplitude of the three-phase current signals can, to some extent, reflect long-term faults such as stator winding insulation aging or inter-turn deterioration. Both are combined as collected time-series data, serving as the basis for subsequent elevator fault detection.
[0084] In S20, the preprocessing of the time-series data based on a preset strategy to obtain a time-series tensor includes:
[0085] S21 synchronizes the three-phase current signal and vibration signal in the timing data according to the timestamp to obtain the aligned timing data.
[0086] S22 performs normalization processing on the four signal channels composed of the three-phase current signal and the vibration signal in the aligned time series data to obtain normalized time series data.
[0087] S23 splits the normalized time series data into several time series sequences of length L using a preset sequence length L;
[0088] S24 stacks and concatenates the several time-series segments of length L to obtain the time-series tensor. In S21, timestamps are marked based on the same time axis according to the sampling points of the three-phase current signal and vibration signal. All signals are resampled at the same sampling rate, and missing or duplicate values are discarded or filled with a sliding window. All signals are aligned so that the data of the four signal channels of three-phase current and vibration are time-aligned at the same time.
[0089] In S22, the mean and standard deviation of each of the four channels are calculated, and standard score normalization is used. Extreme value normalization can also be used; the normalization method is not limited here. The four normalized results for the four channels are then used as normalized time series data.
[0090] In S23 and S24, the preset sequence length L can be 512 or 1024 consecutive sampling points, splitting the normalized time series data into equal-length segments. The preset function is a tensor stacking function, which can be torch.stack() or np.stack(), used to stack each segment of the time series. There are no restrictions on the stacking function here. The stacking generates a time series tensor (N, L, 4), where the contents of the time series tensor are in the same dimension, where N is the total number of time series segments, L is the preset time series length, and 4 is the number of signal channels.
[0091] In S30, the calculation of the adaptive decay coefficient based on the time-series tensor using a time-series decay model specifically includes:
[0092] Based on the temporal tensor, the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi) of the temporal tensor are calculated.
[0093] ,
[0094] ,
[0095] Where, x i This represents the i-th time series feature value. Let i represent the standard deviation of the sliding window centered at i, and W be the preset sliding window size. The standard deviation of all time series sequences of the time series tensor is represented, and L is the preset sequence length of the time series tensor. This represents the standard deviation of long-range segments in a time-series tensor. Let Δi represent the long-range segment mean, and let Δi represent the relative temporal distance between the i-th and j-th sampling points. i and j represent the temporal position indices, respectively;
[0096] Based on the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi), the adaptive attenuation coefficient α(Δi) is obtained.
[0097]
[0098] Wherein, γ1(i) is the local scaling factor, and γ2(i,Δi) is the long-range scaling factor.
[0099] In S31, take a time-series tensor X = [x1, x2, ... x...]. i …x L Let the sliding window W be 5 centered at i. Let the relative temporal distance Δi be Δi = |ij|. Δi represents the time interval between two time points, not a static sequence number. Feature attenuation based on temporal distance effectively limits the judgment of fault features by invalid sequences over long distances, thereby strengthening valid fault features, allocating more weight for calculation, and improving fault detection efficiency.
[0100] ,
[0101] in, The local window data is generated by capturing two points before and after the sliding window W, capturing short-term local fluctuations near the elevator's current position. The standard deviation of the local window data is calculated; a larger standard deviation indicates more severe local fluctuations, and thus a greater likelihood of short-term malfunctions. Specifically represented as This sequence is used as a global baseline sequence to reflect global signal fluctuations and to subsequently measure the intensity of local fluctuations relative to subsequent global sequences. The standard deviation of the global baseline sequence is calculated, and the local scaling factor γ1(i) is obtained from the two standard deviations.
[0102] ,
[0103] in, This represents a long-range segment sequence with length Δi starting from time i, characterizing the temporal characteristics of long-range faults such as elevator aging or wear, and reflecting the long-term operating trend of the elevator within Δi steps from the current time i. The mean and standard deviation of the long-range segment sequence are calculated, and the coefficient of variation (CV) is then calculated as the long-range scaling factor γ2(i,Δi). By using Δi to control different time interval lengths, calculations can be performed on time series of different lengths, avoiding interference from invalid signal fluctuations in a single time interval for long-range fault detection.
[0104] In S32, when calculating the adaptive attenuation coefficient α(Δi), a preset parameter of 0.2 is used as a calculation term to prevent the situation where there is no attenuation at any time step when calculating the relative time-series attenuation factor τ(Δi), thus ensuring continuous attenuation.
[0105] Furthermore, in an optional embodiment, limiting coefficients η and β can be set according to the elevator type and signal characteristics, i.e. ,
[0106] η represents the preset short-term scaling factor, and β is the long-term scaling factor. The preset value can be adjusted according to the standard deviation of the elevator signal to ensure that α(Δi) is within the range of [0, 1.5], avoiding excessively fast or slow attenuation. Based on the adaptive attenuation factor α(Δi), the relative time-series attenuation factor τ(Δi) is calculated through an exponential function, controlling τ(Δi) in the interval of (0, 1].
[0107] In S40, obtaining the temporal decay position code for characterizing the feature correlation between different time steps based on the adaptive decay coefficient specifically includes:
[0108] S41 calculates the relative time-series attenuation factor τ(Δi) based on the adaptive attenuation coefficient α(Δi).
[0109] ,
[0110] Where L is the preset sequence length of the time series tensor, and exp represents the natural exponential function;
[0111] Based on the relative temporal decay factor τ(Δi), S42 obtains the temporal decay position code P, which characterizes the feature correlation between different time steps.
[0112] ,
[0113] ,
[0114] ,
[0115] Where, p i (2k) represents the even-dimensional positional encoding, p i (2k+1) represents odd-dimensional positional encoding, where wk is the frequency term representing the normalized frequency of the sequence length. k represents the embedded dimension index, and d represents the preset dimension.
[0116] In S41, when the elevator is operating normally, the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi) remain at low values, the adaptive attenuation coefficient α(Δi) remains around 0.2, and the time-series attenuation rate is moderate. When a short-term fault occurs at time i, the local scaling factor γ1(i) increases, while the long-range scaling factor γ2(i,Δi) changes little, and the adaptive attenuation coefficient α(Δi) increases. If Δi gradually increases and the time interval gradually becomes longer, τ(Δi) decreases faster, and the time-series attenuation rate is faster. When a long-range fault develops from time i, the long-range scaling factor γ2(i,Δi) decreases, while the local scaling factor γ1(i) changes little, and the adaptive attenuation coefficient α(Δi) decreases. If Δi gradually increases and the time interval gradually becomes longer, τ(Δi) decreases slower, and the time-series attenuation rate is slower. When the elevator experiences significant signal fluctuations throughout its journey, and the fault intensity is high, such as when the guide rails are loose or the joints are misaligned, the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi) both increase simultaneously. τ(Δi) decays faster as Δi increases, which is a strong impact fault among long-range faults.
[0117] In step S42, the frequency term wk is calculated based on the preset dimension d and the preset sequence length L, thus representing the order and relative position of time steps in the form of trigonometric functions. Finally, the even-dimensional and odd-dimensional encoded components of the same dimension are concatenated to generate a complete temporal decay position encoding matrix.
[0118] Since the triangular position coding in conventional coding methods uses fixed static values that only represent the sequence of time steps, the relative temporal decay factor τ(Δi) is added to the sine and cosine function calculations. This corrects the static position coding to a temporally decaying position coding with adaptive temporal characteristics. This causes the position coding amplitude to vary according to the principle that the amplitude increases in closer time steps and decreases in farther time steps, enhancing the coding's ability to express fault features and improving the efficiency of subsequent fault feature capture.
[0119] In S50, the deep learning model includes a temporal Transformer network, which comprises a feature extraction module, a multi-scale time-aware attention module, and a gated fusion module. The deep learning model encodes the temporal tensor and the temporal decay position into fused temporal features, including:
[0120] S51 extracts features from the temporal tensor through the one-dimensional convolutional layer in the feature extraction module to obtain temporal features;
[0121] S52 fuses the timing features with the timing decay position encoding to obtain basic timing features characterizing the relationship between fault features and timing positions in the timing data;
[0122] S53 uses the multi-scale feature extraction network in the multi-scale time-aware attention module to obtain global temporal features representing long-term faults and local temporal features representing short-term faults based on the basic temporal features.
[0123] S54 uses the gated fusion module to perform gated weighted fusion of the global temporal features and the local temporal features to obtain the fused temporal features.
[0124] In S51 and S52, the preprocessed temporal tensor is input into a one-dimensional convolutional layer. The one-dimensional convolutional layer uses four convolutional kernels with a stride of 1 and sizes of 3, 5, and 7 to perform convolution calculations, extracting the temporal features of the elevator running sequence signal, and obtaining the temporal feature X. emb The basic temporal feature X is obtained by linearly superimposing the temporal features with the temporal decay position codes. pos , By attaching time decay-related information to the fault features in the time series information, the resulting basic time series features contain both fault feature information and time series location information.
[0125] In S53, the multi-scale feature extraction network in the multi-scale time-aware attention module obtains global temporal features representing long-term faults and local temporal features representing short-term faults based on the basic temporal features, including:
[0126] The multi-scale time-aware attention module performs a linear projection on the basic temporal features to obtain the query matrix Q, the key matrix K, and the value matrix V.
[0127] ,
[0128] ,
[0129] ,
[0130] ,
[0131] Where Q represents the query matrix, K represents the key matrix, V represents the value matrix, and W represents the value matrix. Q W K、 W V Let X represent the projection matrices of the query matrix Q, the key matrix K, and the value matrix V, respectively. pos X represents the basic time-series characteristic. emb This represents the temporal characteristics.
[0132] By calculating the query matrix Q, key matrix K, and value matrix V, attention is focused on the time-series fault features that are strongly correlated with the current time i, reducing the attention paid to irrelevant time-series background noise, and reconstructing the basic time-series features into attention-enhanced features.
[0133] In calculating the query matrix Q and the key matrix K, temporal decay position encoding is introduced into the calculation, affecting the attention weights and imposing adaptive temporal decay constraints. When a short-term fault occurs, the magnitude of P decreases, leading to a decrease in the similarity between Q and the distant (larger Δi) K. This causes more attention weights to be allocated to the nearby time steps (smaller Δi), and the model focuses more on fault features within the local neighborhood. When a long-term fault occurs, the magnitude of P increases, resulting in a higher similarity between Q and the distant K. Attention is focused on features of the global sequence, making it easier to focus on long-term fault features. When the magnitude of P further decreases, the similarity between Q and the distant K further decreases, and the model focuses on each local feature, filtering out interference in long-term temporal sequences.
[0134] In S53, the value matrix V is weighted and summed based on the query matrix Q and the key matrix K to obtain the attention-enhanced feature Att.
[0135] ,
[0136] Where, d k The feature dimension of the preset single-head attention is represented, and τ(Δi) represents the relative temporal decay factor;
[0137] The attention enhancement features are input into the global feature extraction network to obtain the global temporal feature Att. glo ,
[0138] ,
[0139] The attention enhancement feature is input into the local feature extraction network. A one-dimensional convolutional layer in the local feature extraction network performs a convolution operation on the attention enhancement feature to extract fault features, thus obtaining the local temporal feature Att. loc
[0140] ,
[0141] Where Conv1D represents a one-dimensional convolutional layer, and Att represents the attention-enhancing feature. This represents three different lengths of one-dimensional convolution kernels.
[0142] In calculating the global time series feature Att glo In this case, a relative temporal decay factor τ(Δi) is introduced to reduce the global feature extraction network's excessive focus on long-range fault features, which could lead to the inclusion of irrelevant long-range background noise during feature extraction. This allows the global feature extraction network to make reasonable use of long-range correlations and limits the correlation strength, preventing global features from being contaminated by background noise. For short-term faults, τ(Δi) is smaller, weakening the extraction of long-range global features and preventing the output of too many irrelevant long-range features. For long-range faults, τ(Δi) is larger, preserving the extraction of long-range global features. The working principle is similar to the variation law of the temporal decay factor τ(Δi) under different fault types in S31, and will not be elaborated here. Feature extraction is performed using a dual-branch global feature extraction network and a local feature extraction network, respectively targeting long-range faults and short-term faults, to obtain global temporal features and local temporal features.
[0143] In S54, the gated fusion module performs gated weighted fusion of the global temporal features and the local temporal features to obtain the fused temporal features, including:
[0144] ,
[0145] ,
[0146] Where g(Δi) represents the gated fusion coefficient, α(Δi) represents the adaptive decay coefficient, Sigmoid represents the activation function, and W g b represents the learnable gating weight parameter. g Att represents the learnable bias parameter, ⊙ represents the Hadamard product, and Att represents the Hadamard product. loc Att represents the local temporal features.glo The global temporal features are represented by the learnable gating weight parameter W. g With the learnable bias parameter b g , which are the trainable parameters of the deep learning model, obtained by synchronous optimization during model training.
[0147] An adaptive attenuation coefficient α(Δi) is introduced into the gated fusion process, allowing the gated fusion coefficient g(Δi) to change with the temporal features. A larger α(Δi) indicates that the fused temporal features are more biased towards local temporal features, while a smaller α(Δi) indicates that the fused temporal features are more biased towards global temporal features. The learnable gated weight parameter W... g With the learnable bias parameter b g These are the network parameters that participate in backpropagation and iterative updates along with the entire model. The introduction of the adaptive decay coefficient α(Δi) enables both to be optimized and learned according to the elevator timing fault pattern, thereby obtaining the optimal parameters and reducing the unordered learning time.
[0148] In S50, obtaining the fault judgment result based on the fused timing features specifically includes:
[0149] The process of obtaining fault judgment results based on the fused timing features includes:
[0150] The fused temporal features are input into the standard pooling layer in the deep learning model. The standard pooling layer compresses the dimensionality of the fused temporal features to obtain the fused temporal feature vector.
[0151] The fused temporal feature vector is input into the fully connected layer of the deep learning model. The fully connected layer performs classification mapping on the fused temporal feature vector and outputs the corresponding classification feature vector.
[0152] The classification feature vector is transformed by the softmax function to obtain the corresponding fault probability distribution, and the fault judgment result used to diagnose the fault type is obtained based on the fault probability distribution.
[0153] The preset time series length L represents L time steps. The arithmetic mean of each feature dimension of the fused temporal features is taken over the entire time series length to achieve dimensionality compression. Random noise in the time series is smoothed to avoid overfitting, and the feature information scattered across the L time steps is aggregated into a fixed-length vector, i.e., the fused temporal feature vector. This fused temporal feature vector is input into a fully connected layer. Through linear transformation and nonlinear activation, the fused temporal feature vector is mapped to the class space to obtain a classification feature vector. The classification feature vector is then input into a softmax function, which performs an exponential transformation and normalization on each element, outputting a fault probability distribution. The category corresponding to the maximum value in the fault probability distribution is taken as the fault judgment result. Fault judgment results include: no fault, short-term fault, long-term fault, and a mixture of short-term and long-term faults. Short-term faults can include door jamming, elevator entrapment, and short-term overspeed. These faults are short in duration and fluctuate significantly in certain areas. Long-term faults can include guide rail wear and bearing aging. These faults have a longer duration and change more gradually. A combination of short-term and long-term faults is caused by permanent damage to the elevator due to a long-term fault. During elevator operation, the short-term faults resulting from this permanent damage can include wear on the shoe liner causing the car to impact during operation.
[0154] Before acquiring the timing data during elevator operation, the method further includes:
[0155] Acquire historical time-series data of the traction machine's historical current and historical vibration signals over time, representing the operation of multiple elevators, as well as historical real fault classification results;
[0156] Based on a preset strategy, the historical time series data is preprocessed to obtain a historical time series tensor. The preprocessing is used to split the historical time series data into equal lengths and then concatenate them along the same dimension to obtain the historical time series tensor.
[0157] Based on the historical time series tensor and preset parameters, an adaptive decay coefficient is calculated through a time series decay model. The time series decay model is used to characterize the degree to which the temporal correlation between different time points decays as the interval increases.
[0158] Based on the adaptive decay coefficient, a historical temporal decay position code is obtained to characterize the temporal correlation pattern of the feature correlation between different time steps;
[0159] The historical time series tensor, the historical time series decay position encoding, and the historical real fault classification results are integrated into training data.
[0160] A deep learning model is initialized based on the training data. During the training process, the trainable parameters participate in backpropagation and are iteratively updated. After training, they are used as fixed model parameters so that after the temporal tensor and the temporal decay position encoding are input into the deep learning model, the deep learning model outputs the fault judgment result.
[0161] The loss function during training can be expressed as:
[0162] ,
[0163] This represents the total loss value;
[0164] Represents the predicted value of a deep learning model Corresponding historical real-world fault classification results The mean squared error is calculated. In this embodiment, firstly, historical time-series data and corresponding historical real fault classification results are collected from multiple elevator operation processes. Based on a preset strategy, the historical time-series data is preprocessed to obtain a historical time-series tensor. Subsequently, based on the historical time-series tensor and preset parameters, an adaptive decay coefficient is calculated using a time-series decay function. The historical time-series decay position code, used to characterize the time-series correlation pattern, is obtained based on the adaptive decay coefficient. The historical time-series tensor, the historical time-series decay position code, and the historical real fault classification results are used together as input features to construct a training dataset, which is then used as a supervision signal. After initializing the deep learning model, a loss function containing the historical real fault classification results is used for training. The historical real fault classification results can be the maximum value in the fault probability distribution during model training. After training is completed, in the testing phase, only the time-series data of the elevator operation process needs to be input, and the model can directly output the fault judgment result.
[0165] During the backpropagation process of each training round, the mean squared error calculated based on the loss function is backpropagated from the output layer to the gated fusion module, where the loss function is calculated with respect to the learnable gated weight parameters W. g With the learnable bias parameter b g The gradient is calculated and updated using the Adam optimizer. When training reaches a certain number of iterations, W... g and b g It converges to a stable value. During training, W g Gradually increase the sensitivity to changes in α(Δi), b gThe overall shift occurs based on the change of α(Δi). After training, the time-series data of the elevator operation is input into the trained model to obtain the global time-series features and the local time-series features, W... g and b g As a fixed parameter, it participates in the gating fusion calculation to obtain the fused temporal features. In this embodiment, the collected training dataset is divided into a training set and a test set in an 8:2 ratio, with 80% of the data used for model training and the remaining 20% used for testing.
[0166] This application provides an electronic device that may include a processing module and a memory. The memory stores a computer program, which, when executed by the processor, enables the electronic device to perform the corresponding steps in the aforementioned fault diagnosis method based on timing decay position coding.
[0167] In this embodiment, the processor can be an integrated circuit chip with signal processing capabilities. For example, the processor can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0168] The memory can be, but is not limited to, random access memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, etc.
[0169] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the electronic device described above can be referred to the corresponding steps in the aforementioned method, and will not be elaborated further here.
[0170] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A fault diagnosis method based on time-series decay position coding, characterized in that, The method includes: Acquire time-series data characterizing the changes in traction machine current and vibration signals over time during elevator operation; Based on a preset strategy, the time series data is preprocessed to obtain a time series tensor. The preprocessing is used to split the time series data into equal lengths and then concatenate them along the same dimension to obtain the time series tensor. Based on the aforementioned temporal tensor, an adaptive decay coefficient is calculated using a temporal decay model. This model characterizes the degree to which the temporal correlation between different time points decays as the interval increases, and specifically includes: Based on the temporal tensor, the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi) of the temporal tensor are calculated. , , Where, x i This represents the i-th time series feature value. Let i represent the standard deviation of the sliding window centered at i, and W be the preset sliding window size. The standard deviation of all time series sequences of the time series tensor is represented, and L is the preset sequence length of the time series tensor. This represents the standard deviation of long-range segments in a time-series tensor. Let Δi represent the long-range segment mean, and let Δi represent the relative temporal distance between the i-th and j-th sampling points. i and j represent the temporal position indices, respectively; Based on the local scaling factor γ1(i) and the long-range scaling factor γ2(i,Δi), the adaptive attenuation coefficient α(Δi) is obtained. Wherein, γ1(i) is the local scaling factor, and γ2(i,Δi) is the long-range scaling factor; The temporal decay position encoding used to characterize the feature correlation between different time steps is obtained based on the adaptive decay coefficient; The temporal tensor and the temporal decay position encoding are input into a deep learning model. The deep learning model processes the temporal tensor and the temporal decay position encoding into fused temporal features, and obtains a fault judgment result based on the fused temporal features. The fault judgment result is used to diagnose the fault type.
2. The method according to claim 1, characterized in that, The step of obtaining the temporal decay position code for characterizing the feature correlation between different time steps based on the adaptive decay coefficient includes: calculating the relative temporal decay factor τ(Δi) based on the adaptive decay coefficient α(Δi). , Where L is the preset sequence length of the time series tensor, and exp represents the natural exponential function; Based on the relative temporal decay factor τ(Δi), the temporal decay position code P, used to characterize the feature correlation between different time steps, is obtained. , , , Where, p i (2k) represents the even-dimensional positional encoding, p i (2k+1) represents odd-dimensional positional encoding, where wk is the frequency term representing the normalized frequency of the sequence length. k represents the embedded dimension index, and d represents the preset dimension.
3. The method according to claim 2, characterized in that, The deep learning model includes a temporal Transformer network, which comprises a feature extraction module, a multi-scale time-aware attention module, and a gated fusion module. The deep learning model encodes the temporal tensor and the temporal decay position to form fused temporal features, including: The temporal tensor is subjected to feature extraction through a one-dimensional convolutional layer in the feature extraction module to obtain temporal features; The time-series features are fused with the time-series decay position encoding to obtain basic time-series features that characterize the relationship between fault features and time-series positions in the time-series data; Through the multi-scale feature extraction network in the multi-scale time-aware attention module, based on the basic temporal features, global temporal features representing long-term faults and local temporal features representing short-term faults are obtained. The gating fusion module performs gating weighted fusion of the global temporal features and the local temporal features to obtain the fused temporal features.
4. The method according to claim 3, characterized in that, The multi-scale feature extraction network includes a global feature extraction network for extracting global temporal features and a local feature extraction network for extracting local temporal features. The process of obtaining global temporal features representing long-term faults and local temporal features representing short-term faults based on the basic temporal features through the multi-scale feature extraction network in the multi-scale time-aware attention module includes: The multi-scale time-aware attention module performs a linear projection on the basic temporal features to obtain the query matrix Q, the key matrix K, and the value matrix V. , , , , Where Q represents the query matrix, K represents the key matrix, V represents the value matrix, and W represents the value matrix. Q W K、 W V Let X represent the projection matrices of the query matrix Q, the key matrix K, and the value matrix V, respectively. pos X represents the basic time-series feature. emb This represents the temporal characteristics; Based on the query matrix Q and the key matrix K, the value matrix V is weighted and summed to obtain the attention-enhanced feature Att. , Where, d k The feature dimension of the preset single-head attention is represented, and τ(Δi) represents the relative temporal decay factor; The attention enhancement features are input into the global feature extraction network to obtain the global temporal feature Att. glo , , The attention enhancement feature is input into the local feature extraction network. A one-dimensional convolutional layer in the local feature extraction network performs a convolution operation on the attention enhancement feature to extract fault features, thus obtaining the local temporal feature Att. loc , Where Conv1D represents a one-dimensional convolutional layer, and Att represents the attention-enhancing feature. This represents three different lengths of one-dimensional convolution kernels.
5. The method according to claim 4, characterized in that, The gating fusion module performs gating weighted fusion of the global temporal features and the local temporal features to obtain the fused temporal features, including: , , Where g(Δi) represents the gated fusion coefficient, α(Δi) represents the adaptive decay coefficient, Sigmoid represents the activation function, and W g b represents the learnable gating weight parameter. g Att represents the learnable bias parameter, ⊙ represents the Hadamard product, and Att represents the Hadamard product. loc Att represents the local temporal features. glo The global temporal features are represented by the learnable gating weight parameter W. g With the learnable bias parameter b g , which are the trainable parameters of the deep learning model. During the model training process, the trainable parameters participate in backpropagation and are iteratively updated. After training is completed, they are used as fixed model parameters.
6. The method according to claim 1, characterized in that, The preprocessing of the time-series data based on a preset strategy to obtain a time-series tensor includes: The three-phase current signal and vibration signal in the time series data are synchronized and aligned according to the timestamp to obtain the aligned time series data. The four signal channels composed of the three-phase current signal and the vibration signal in the aligned time series data are normalized respectively to obtain normalized time series data. The normalized time series data is split into several time series sequences of length L by a preset sequence length L. The time series tensor is obtained by stacking and splicing the several time series segments of length L.
7. The method according to claim 1, characterized in that, The process of obtaining fault judgment results based on the fused timing features includes: The fused temporal features are input into the standard pooling layer in the deep learning model. The standard pooling layer compresses the dimensionality of the fused temporal features to obtain the fused temporal feature vector. The fused temporal feature vector is input into the fully connected layer of the deep learning model. The fully connected layer performs classification mapping on the fused temporal feature vector and outputs the corresponding classification feature vector. The classification feature vector is transformed by the softmax function to obtain the corresponding fault probability distribution, and the fault judgment result used to diagnose the fault type is obtained based on the fault probability distribution.
8. The method according to claim 5, characterized in that, Before acquiring the timing data during elevator operation, the method further includes: Acquire historical time-series data of the traction machine's historical current and historical vibration signals over time, representing the operation of multiple elevators, as well as historical real fault classification results; Based on a preset strategy, the historical time series data is preprocessed to obtain a historical time series tensor. The preprocessing is used to split the historical time series data into equal lengths and then concatenate them along the same dimension to obtain the historical time series tensor. Based on the historical time series tensor, an adaptive decay coefficient is calculated through a time series decay model. The time series decay model is used to characterize the degree to which the temporal correlation between different time points decays as the interval increases. Based on the adaptive decay coefficient, a historical temporal decay position code is obtained to characterize the temporal correlation pattern of the feature correlation between different time steps; The historical time series tensor, the historical time series decay position encoding, and the historical real fault classification results are integrated into training data. A deep learning model is initialized based on the training data. During the training process, the trainable parameters participate in backpropagation and are iteratively updated. After training, they are used as fixed model parameters so that after the temporal tensor and the temporal decay position encoding are input into the deep learning model, the deep learning model outputs the fault judgment result.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory coupled together, the memory storing a computer program that, when executed by the processor, causes the electronic device to perform the method as described in any one of claims 1 to 8.