A door body fault detection method, device, equipment and storage medium
Patent Information
- Application Number
- CN202311473353.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-11-07
AI Technical Summary
[0005]本申请实施例提供一种门体的故障检测方法、装置、设备及存储介质,能够解决门体故障检测准确率低的问题,提升门体故障检测的准确率
[0087]本申请实施例通过预设模型对不同状态下的工况序列数据进行局部特征提取处理、旋转位置编码处理、编码处理和解码处理,得到门体移动位移序列数据对应的第一预测序列和门体移动速度序列数据对应的第二预测序列,根据第一预测序列和第二预测序列进行损失值计算处理,得到损失误差值,根据损失误差值和预设阈值的比较结果确定门体的故障状态。采用上述技术手段,可以通过损失误差值与预设阈值的比较结果确定门体的故障状态,以此可避免门体故障检测准确率低的问题,通过预设模型的学习,减少工况变化或环境干扰对故障检测结果的影响,从而提高门体故障检测的准确率。
Smart Images

Figure CN117516971B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fault detection technology, and in particular to a fault detection method, device, equipment and storage medium for a door. Background Technology
[0002] Subway platform screen doors are devices installed at the edge of station platforms to separate the platform area from the train travel area. With the rapid development of urban rail transit in my country in recent years, passenger safety has always been a primary focus in all subway construction projects. As a crucial subsystem directly related to passenger safety, the reliability and safety of platform screen doors are naturally one of the key concerns for subway operators.
[0003] As a crucial passageway separating and connecting trains and platforms, the proper functioning of subway platform screen doors is vital not only to subway operational efficiency but also to passenger safety. If a platform screen door malfunctions and is not detected and resolved promptly, it can significantly impact subway safety operations and may even lead to accidents endangering passenger safety. Therefore, effective fault detection of subway platform screen doors is of paramount importance for subway safety operations.
[0004] Currently, subway platform screen door testing methods typically rely on threshold judgment. When a sensor signal (such as motor current) exceeds a threshold, the platform screen door is considered faulty. However, given the numerous devices in a subway platform screen door system, the frequent changes in operating conditions, and the generally high noise levels, the existing method of judging the fault status of the door by comparing sensor signals with thresholds is easily affected by changes in operating conditions and environmental interference, resulting in inaccurate test results. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for detecting door faults, which can solve the problem of low accuracy in door fault detection and improve the accuracy of door fault detection.
[0006] In a first aspect, embodiments of this application provide a method for detecting faults in a door, comprising:
[0007] The system collects operating condition sequence data of the gate system under different states, including motor current sequence data, gate movement displacement sequence data, and gate movement speed sequence data.
[0008] The working condition sequence data is input into a preset model. Local feature extraction and rotational position encoding are performed on the working condition sequence data in the preset model to obtain a feature matrix. The feature matrix includes a first feature matrix corresponding to the motor current sequence data, a second feature matrix corresponding to the door movement displacement sequence data, and a third feature matrix corresponding to the door movement speed sequence data.
[0009] The first feature matrix is encoded by an encoder to obtain the first working condition sequence;
[0010] The second feature matrix and the first operating condition sequence are decoded by the first decoder to obtain the first prediction sequence; and the third feature matrix and the first operating condition sequence are decoded by the second decoder to obtain the second prediction sequence.
[0011] The loss error value is obtained by calculating the loss value based on the first prediction sequence and the second prediction sequence.
[0012] The loss error value is compared with a preset threshold, and the fault status of the door is determined based on the comparison result.
[0013] Furthermore, the step of inputting the operating condition sequence data into a preset model, and performing local feature extraction and rotational position encoding on the operating condition sequence data in the preset model to obtain a feature matrix includes:
[0014] The working condition sequence data is input into a preset model. In the preset model, the motor current sequence data, the door movement displacement sequence data, and the door movement speed sequence data are respectively input into the first feature extraction module, the second feature extraction module, and the third feature extraction module for local feature extraction processing to obtain the first local feature vector, the second local feature vector, and the third local feature vector.
[0015] The first local feature vector, the second local feature vector, and the third local feature vector are respectively subjected to rotation position encoding processing to obtain the first feature matrix, the second feature matrix, and the third feature matrix.
[0016] Furthermore, the step of inputting the operating condition sequence data into a preset model involves inputting the motor current sequence data, the door movement displacement sequence data, and the door movement speed sequence data into a first feature extraction module, a second feature extraction module, and a third feature extraction module, respectively, for local feature extraction processing to obtain a first local feature vector, a second local feature vector, and a third local feature vector, including:
[0017] The operating condition sequence data is input into a preset model. In the preset model, the motor current sequence data is segmented to obtain the first sub-sequence.
[0018] The first subsequence is input into the first feature extraction module for local feature extraction processing to obtain the first local feature vector;
[0019] In the preset model, the door movement displacement sequence data is segmented to obtain a second sub-sequence;
[0020] The second subsequence is input into the second feature extraction model for local feature extraction processing to obtain the second local feature vector;
[0021] In the preset model, the door movement speed sequence data is segmented to obtain a third sub-sequence;
[0022] The third subsequence is input into the third feature extraction model for local feature extraction processing to obtain the third local feature vector.
[0023] The step of performing rotational position encoding processing on the first local feature vector, the second local feature vector, and the third local feature vector respectively to obtain the first feature matrix, the second feature matrix, and the third feature matrix includes:
[0024] A first positional encoding is added to the first local feature vector based on the number of the first subsequences to obtain a first feature matrix. The first positional encoding includes absolute positional encoding and relative positional encoding.
[0025] A second positional encoding is added to the second local feature vector based on the number of the second subsequences to obtain a second feature matrix. The second positional encoding includes absolute positional encoding and relative positional encoding.
[0026] A third positional encoding is added to the third local feature vector based on the number of the third subsequences to obtain a third feature matrix. The third positional encoding includes absolute positional encoding and relative positional encoding.
[0027] Furthermore, the step of inputting the first sub-sequence into the first feature extraction module for feature extraction processing to obtain the first local feature vector includes:
[0028] The first subsequence is input into the first feature extraction module. In the first feature extraction module, local feature extraction is performed through three convolutional layers to obtain the first local feature vector.
[0029] Each convolutional layer is processed by the first formula x. out =relu(conv(w i ,x in Perform convolution processing using x + b), where x out Represents the output of the convolutional layer, relu(.) represents the activation function, conv(.) represents the convolution computation, and w i Represents the number of convolution kernels, x in 'b' represents the input to the convolutional layer, and 'b' represents the bias term.
[0030] Furthermore, the step of encoding the first feature matrix using an encoder to obtain the first working condition sequence includes:
[0031] The first feature matrix is input into the encoder, and in the encoder, the second formula is used. Perform self-attention calculations to obtain the output of the self-attention layer;
[0032] Where Q, K, and V all represent the input matrices of the self-attention layer of the encoding model, (W m Q) and (W) n K) represents the first feature matrix of the rotation position encoding process. The scaling factor is softmax(.), which represents the self-attention coefficients calculated for each of the first subsequences and other subsequences, and Attention(Q,K,V) represents the output of the self-attention layer.
[0033] The output of the self-attention layer is processed through a residual connection and a normalization layer, and then through a feedforward fully connected layer to obtain the first working condition sequence.
[0034] Furthermore, the step of calculating the loss value based on the first prediction sequence and the second prediction sequence to obtain the loss error value includes:
[0035] Based on the predicted values in the first prediction sequence and the actual values of the corresponding working condition sequence data, the loss value is calculated to obtain the first mean squared error loss value and the first cosine similarity loss value.
[0036] The first loss value is obtained by summing the first mean square error loss value and the first cosine similarity loss value.
[0037] Based on the predicted values in the second prediction sequence and the actual values of the corresponding working condition sequence data, the loss value is calculated to obtain the second mean squared error loss value and the second cosine similarity loss value.
[0038] The second loss value is obtained by summing the second mean square error loss value and the second cosine similarity loss value.
[0039] The first loss value and the second loss value are summed to obtain the loss error value.
[0040] Furthermore, the step of calculating the loss value based on the predicted value in the first prediction sequence and the actual value of the corresponding working condition sequence data to obtain the first mean squared error loss value and the first cosine similarity loss value includes:
[0041] Through the third formula The calculation process yields the first mean squared error loss value, where Loss mes1 y represents the first mean squared error loss value, n represents the number of sequences, and y represents the first mean squared error loss value. i f(x) represents the true value corresponding to the i-th sequence. i ) represents the predicted value corresponding to the i-th sequence;
[0042] Loss through the fourth formula cos1 =1-cos(y i ,f(x i The calculation process is performed to obtain the first cosine similarity loss value, where Loss cos1 Represents the first cosine similarity loss value, cos(y i ,f(x i )) represents y i and f(x) i The cosine value of ).
[0043] The step of summing the first mean squared error loss value and the first cosine similarity loss value to obtain the first loss value includes:
[0044] Loss through Formula 5 total1 = (1-μ)·Loss mes1 +μ·Loss cos1 Perform a summation calculation to obtain the first loss value;
[0045] Among them, Loss total1 Represents the first loss value, Loss mes1 Represents the first mean squared error loss value, Loss cos1 represents the first cosine similarity loss value, and μ represents a hyperparameter between 0 and 1.
[0046] In a second aspect, embodiments of this application provide a door fault detection device, comprising:
[0047] The data acquisition module is used to collect the operating condition sequence data of the gate system under different states. The operating condition sequence data includes motor current sequence data, gate movement displacement sequence data, and gate movement speed sequence data.
[0048] The feature extraction module is used to input the working condition sequence data into a preset model, and perform local feature extraction and rotational position encoding processing on the working condition sequence data in the preset model to obtain a feature matrix. The feature matrix includes a first feature matrix corresponding to the motor current sequence data, a second feature matrix corresponding to the door movement displacement sequence data, and a third feature matrix corresponding to the door movement speed sequence data.
[0049] The encoding module is used to encode the first feature matrix through an encoder to obtain the first working condition sequence;
[0050] The decoding module is used to decode the second feature matrix and the first operating condition sequence through a first decoder to obtain a first prediction sequence; and to decode the third feature matrix and the first operating condition sequence through a second decoder to obtain a second prediction sequence.
[0051] The loss calculation module is used to perform loss value calculation processing based on the first prediction sequence and the second prediction sequence to obtain the loss error value;
[0052] The fault diagnosis module is used to compare the loss error value with a preset threshold and determine the fault status of the door based on the comparison result.
[0053] Furthermore, the feature extraction module includes a feature extraction unit and a position encoding unit;
[0054] The feature extraction unit is used to input the working condition sequence data into a preset model. In the preset model, the motor current sequence data, the door movement displacement sequence data, and the door movement speed sequence data are respectively input into the first feature extraction module, the second feature extraction module, and the third feature extraction module for local feature extraction processing to obtain the first local feature vector, the second local feature vector, and the third local feature vector.
[0055] The position encoding unit is used to perform rotation position encoding processing on the first local feature vector, the second local feature vector and the third local feature vector respectively, to obtain the first feature matrix, the second feature matrix and the third feature matrix.
[0056] Furthermore, the feature extraction unit includes a segmentation subunit and an extraction subunit;
[0057] The segmentation subunit is used to input the operating condition sequence data into a preset model, and in the preset model, the motor current sequence data is segmented to obtain a first subsequence;
[0058] The extraction subunit is used to input the first subsequence into the first feature extraction module for local feature extraction processing to obtain a first local feature vector.
[0059] The segmentation subunit is used to segment the door movement displacement sequence data in a preset model to obtain a second subsequence;
[0060] The extraction subunit is used to input the second subsequence into the second feature extraction model for local feature extraction processing to obtain the second local feature vector.
[0061] The segmentation subunit is used to segment the door movement speed sequence data in a preset model to obtain a third subsequence;
[0062] The extraction subunit is used to input the third subsequence into the third feature extraction model for local feature extraction processing to obtain the third local feature vector.
[0063] The position coding unit includes a first position coding subunit, a second position coding subunit, and a third position coding subunit;
[0064] The first position encoding subunit is used to add a first position encoding to the first local feature vector according to the number of the first subsequences to obtain a first feature matrix. The first position encoding includes absolute position encoding and relative position encoding.
[0065] The second positional encoding subunit is used to add a second positional encoding to the second local feature vector according to the number of the second subsequences to obtain a second feature matrix. The second positional encoding includes absolute positional encoding and relative positional encoding.
[0066] The third position encoding subunit is used to add a third position encoding to the third local feature vector according to the number of the third subsequences to obtain a third feature matrix. The third position encoding includes absolute position encoding and relative position encoding.
[0067] Furthermore, the extraction sub-unit is also used to input the first sub-sequence into the first feature extraction module, in which local feature extraction processing is performed through three convolutional layers to obtain the first local feature vector;
[0068] Each convolutional layer is processed by the first formula x. out =relu(conv(w i ,x in Perform convolution processing using x + b), where x out Represents the output of the convolutional layer, relu(.) represents the activation function, conv(.) represents the convolution computation, and w i Represents the number of convolution kernels, x in 'b' represents the input to the convolutional layer, and 'b' represents the bias term.
[0069] Furthermore, the encoding module is also used to input the first feature matrix into the encoder, and in the encoder, use a second formula... Perform self-attention calculations to obtain the output of the self-attention layer;
[0070] Where Q, K, and V all represent the input matrices of the self-attention layer of the encoding model, (Wm Q) and (W) n K) represents the first feature matrix of the rotation position encoding process. The scaling factor is softmax(.), which represents the self-attention coefficients calculated for each of the first subsequences and other subsequences, and Attention(Q,K,V) represents the output of the self-attention layer.
[0071] The output of the self-attention layer is processed through a residual connection and a normalization layer, and then through a feedforward fully connected layer to obtain the first working condition sequence.
[0072] Furthermore, the loss calculation module includes a first calculation unit and a second calculation unit;
[0073] The first calculation unit is used to perform loss value calculation processing based on the predicted value in the first prediction sequence and the actual value of the corresponding working condition sequence data to obtain the first mean square error loss value and the first cosine similarity loss value.
[0074] The first loss value is obtained by summing the first mean square error loss value and the first cosine similarity loss value.
[0075] The second calculation unit is used to perform loss value calculation processing based on the predicted value in the second prediction sequence and the actual value of the corresponding working condition sequence data to obtain the second mean square error loss value and the second cosine similarity loss value.
[0076] The second loss value is obtained by summing the second mean square error loss value and the second cosine similarity loss value.
[0077] The first loss value and the second loss value are summed to obtain the loss error value.
[0078] Furthermore, the first calculation unit is also used to calculate using a third formula. The calculation process yields the first mean squared error loss value, where Loss mes1 y represents the first mean squared error loss value, n represents the number of sequences, and y represents the first mean squared error loss value. i f(x) represents the true value corresponding to the i-th sequence. i ) represents the predicted value corresponding to the i-th sequence;
[0079] Loss through the fourth formula cos1 =1-cos(y i ,f(x i The calculation process is performed to obtain the first cosine similarity loss value, where Loss cos1 Represents the first cosine similarity loss value, cos(yi ,f(x i )) represents y i and f(x) i The cosine value of ).
[0080] Loss through Formula 5 total1 = (1-μ)·Loss mes1 +μ·Loss cos1 Perform a summation calculation to obtain the first loss value;
[0081] Among them, Loss total1 Represents the first loss value, Loss mes1 Represents the first mean squared error loss value, Loss cos1 represents the first cosine similarity loss value, and μ represents a hyperparameter between 0 and 1.
[0082] In a third aspect, embodiments of this application provide a door fault detection device, comprising:
[0083] Memory and one or more processors;
[0084] The memory is used to store one or more programs;
[0085] When the one or more programs are executed by the one or more processors, the one or more processors implement the door fault detection method as described in the first aspect.
[0086] In a fourth aspect, embodiments of this application provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the door fault detection method as described in the first aspect.
[0087] This application embodiment uses a preset model to perform local feature extraction, rotational position encoding, encoding, and decoding processing on operating condition sequence data under different states. This yields a first predicted sequence corresponding to the gate's displacement sequence data and a second predicted sequence corresponding to the gate's speed sequence data. Loss value calculation is performed based on the first and second predicted sequences to obtain a loss error value. The gate's fault state is determined by comparing the loss error value with a preset threshold. By employing the above techniques, the gate's fault state can be determined through the comparison of the loss error value with a preset threshold, thus avoiding the problem of low gate fault detection accuracy. Furthermore, by learning the preset model, the impact of changes in operating conditions or environmental interference on the fault detection results is reduced, thereby improving the accuracy of gate fault detection. Attached Figure Description
[0088] Figure 1 This is a flowchart of a door fault detection method provided in an embodiment of this application;
[0089] Figure 2 This is a schematic diagram of the connection of some devices in a gate system provided in an embodiment of this application;
[0090] Figure 3 This is a schematic diagram of a preset model structure provided in an embodiment of this application;
[0091] Figure 4 This is a schematic diagram of the structure of a door fault detection device provided in an embodiment of this application;
[0092] Figure 5 This is a structural schematic diagram of a door fault detection device provided in an embodiment of this application. Detailed Implementation
[0093] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0094] The door fault detection method, apparatus, device, and storage medium provided in this application aim to calculate a loss error value by performing loss value processing on a first predicted sequence corresponding to the door's displacement sequence data and a second predicted sequence corresponding to the door's speed sequence data during door fault detection. The fault state of the door is then determined based on a comparison between the loss error value and a preset threshold. This reduces the impact of changes in operating conditions or environmental interference on the fault detection results and improves the accuracy of door fault detection. Compared to traditional door fault detection methods, which typically determine the presence of a fault by comparing sensor signals with a threshold, the existing method of determining the fault state based on the numerous devices in the door system, frequent changes in operating conditions, and high overall noise is susceptible to changes in operating conditions and environmental interference, resulting in inaccurate detection results. Therefore, this application provides a door fault detection method to address the problem of low accuracy in existing door fault detection methods.
[0095] Figure 1 A flowchart of a door fault detection method provided in this application embodiment is given. The door fault detection method provided in this embodiment can be executed by a door fault detection device, which can be implemented by software and / or hardware. The door fault detection device can be composed of two or more physical entities, or it can be composed of a single physical entity. Generally, the door fault detection device can be a terminal device, such as a computer device.
[0096] The following description uses a computer device as the main component in a fault detection method. (Refer to...) Figure 1 The specific fault detection method for this door includes:
[0097] S101. Collect the operating condition sequence data of the gate system under different states. The operating condition sequence data includes motor current sequence data, gate movement displacement sequence data, and gate movement speed sequence data.
[0098] The door system in public rail transit systems such as subways includes equipment such as motors and doors. When a door malfunctions, the corresponding motor current, door displacement, and door speed will change. Therefore, it is possible to collect motor current sequence data, door displacement sequence data, and door speed sequence data under different conditions to obtain operating condition sequence data. This operating condition sequence data can then be analyzed and processed to determine the fault status of the door.
[0099] Figure 2 This is a schematic diagram of the connection of some devices in a gate system provided in an embodiment of this application, with reference to... Figure 2The gate system includes a motor 10, a gate 11, a controller 12, a first sensor 13, and a second sensor 14. The motor 10 is connected to the controller 12, the first sensor 13, and the gate 11. The controller 12 sends adjustment signals to the motor 10 to control its operation, and the motor 10 controls the movement of the gate 11. The first sensor 13 detects the motor current of the motor 10 to obtain motor current sequence data under different states. The gate 11 is connected to the second sensor 14, which detects the gate's displacement and speed to obtain door displacement sequence data and door speed sequence data under different states. The gate 11 is affected by external environmental and operating conditions, causing fluctuations in its displacement and speed, thus resulting in changes in its movement state. The second sensor 14 is connected to the controller 12. The second sensor 14 transmits the collected door movement status to the controller 12. The controller 12 is used to adjust the adjustment signal according to the door movement status to adjust the operating status of the motor 10, thereby controlling the door movement status to minimize fluctuations and reduce the impact of external environmental factors and operating conditions on the door movement status.
[0100] S102. Input the working condition sequence data into the preset model, and perform local feature extraction and rotational position encoding processing on the working condition sequence data in the preset model to obtain the feature matrix. The feature matrix includes the first feature matrix corresponding to the motor current sequence data, the second feature matrix corresponding to the door movement displacement sequence data, and the third feature matrix corresponding to the door movement speed sequence data.
[0101] The initial model is trained using a large amount of normal operating condition sequence data to obtain a preliminary model that can distinguish between normal and abnormal states of the gate. Then, a small amount of labeled fault condition sequence data is used for fine-tuning the model to obtain the final model suitable for fault detection. This final model can also distinguish the actual fault category of the gate. The final model has anomaly detection and fault diagnosis functions. The anomaly detection function distinguishes whether the gate is in a normal or abnormal state, while the fault diagnosis function identifies the specific fault category, such as a gate warped position. The collected operating condition sequence data under different operating conditions are input into the model. The model performs local feature extraction and rotational position encoding on the operating condition sequence data to obtain a first feature matrix corresponding to the motor current sequence data, a second feature matrix corresponding to the gate displacement sequence data, and a third feature matrix corresponding to the gate speed sequence data.
[0102] Figure 3 This is a schematic diagram of a preset model structure provided in an embodiment of this application, with reference to... Figure 3The preset model includes a first feature extraction module, a second feature extraction module, and a third feature extraction module, all of which are used for local feature extraction processing. The operating condition sequence data is input into the preset model. In the preset model, the operating condition sequence data is first segmented to obtain corresponding sub-sequences. Then, each sub-sequence is input into its corresponding feature extraction module for local feature extraction processing.
[0103] In the preset model, the motor current sequence data is segmented to obtain a first sub-sequence. This first sub-sequence is then input into the first feature extraction module for local feature extraction, yielding a first local feature vector. Within the first feature extraction module, local feature extraction is performed using three convolutional layers to obtain the first local feature vector. The last two convolutional layers in the first feature extraction module are 1×1 convolutional layers, used to extract deeper features from the sub-sequence. Each convolutional layer employs the ReLU activation function to perform a non-linear transformation on the convolution calculation result, thereby improving the non-linearity of the preset model. Each convolutional layer is processed using the first formula x... out =relu9conv9w i ,x in Perform convolution with x + b), where x out Represents the output of the convolutional layer, relu(.) represents the activation function, conv(.) represents the convolution computation, and w i Represents the number of convolution kernels, x in 'b' represents the input to the convolutional layer, and 'b' represents the bias term. It should be noted that the number of convolutional kernels in the first formula of the three convolutional layers is different, and the corresponding bias terms are also different. The bias term in each convolutional layer is determined by model training.
[0104] After obtaining the first local feature vector through the first feature extraction model, the first local feature vector is subjected to rotational position encoding to obtain the first feature matrix. A first positional encoding is added to the first local feature vector according to the number of the first sub-sequences to obtain the first feature matrix. The first positional encoding includes absolute positional encoding and relative positional encoding. In the self-attention layer, absolute positional information is injected into the query matrix and key matrix before self-attention calculation. Then, the updated query matrix and key matrix are used for self-attention calculation to introduce relative positional information, thus completing the rotational encoding process. Rotational encoding allows the introduction of absolute and relative positional information between sequences. Compared to the traditional fixed absolute positional encoding method, this embodiment uses rotational encoding to enable the preset model to know the absolute and relative positions between sequences, improving the accuracy of model prediction and thus improving the accuracy of subsequent door fault detection.
[0105] In the preset model, the door movement speed sequence data is segmented to obtain a second sub-sequence. This second sub-sequence is then input into the second feature extraction module for local feature extraction, yielding a second local feature vector. Within the second feature extraction module, local feature extraction is performed using three convolutional layers to obtain the second local feature vector. The last two convolutional layers in the second feature extraction module are 1×1 convolutional layers, used to extract deeper features from the sub-sequence. Each convolutional layer employs the ReLU activation function to perform a non-linear transformation on the convolution calculation result, thereby improving the non-linearity of the preset model. Each convolutional layer is processed using the first formula x... out =relu(conv(w i ,x in Perform convolution with x + b), where x out Represents the output of the convolutional layer, relu(.) represents the activation function, conv(.) represents the convolution computation, and w i Represents the number of convolution kernels, x in 'b' represents the input to the convolutional layer, and 'b' represents the bias term. It should be noted that the number of convolutional kernels in the first formula of the three convolutional layers is different, and the corresponding bias terms are also different. The bias term in each convolutional layer is determined by model training.
[0106] After obtaining the second local feature vector through the second feature extraction model, the second local feature vector is subjected to rotational position encoding to obtain the second feature matrix. A second positional encoding is added to the second local feature vector according to the number of second sub-sequences to obtain the second feature matrix. The second positional encoding includes absolute positional encoding and relative positional encoding. In the self-attention layer, absolute positional information is injected into the query matrix and key matrix before self-attention calculation. Then, the updated query matrix and key matrix are used for self-attention calculation to introduce relative positional information, thus completing the rotational encoding process. Rotational encoding allows the introduction of absolute and relative positional information between sequences. Compared to the traditional fixed absolute positional encoding method, this embodiment uses rotational encoding to enable the preset model to know the absolute and relative positions between sequences, improving the accuracy of model prediction and thus improving the accuracy of subsequent door fault detection.
[0107] In the preset model, the door movement speed sequence data is segmented to obtain a third sub-sequence. This third sub-sequence is then input into the third feature extraction module for local feature extraction, yielding a third local feature vector. Within this module, three convolutional layers are used for local feature extraction to obtain the third local feature vector. The last two convolutional layers in the third feature extraction module are 1×1 layers, used to extract deeper features from the sub-sequence. Each convolutional layer employs the ReLU activation function to perform a non-linear transformation on the convolution calculation result, thereby improving the non-linearity of the preset model. Each convolutional layer is processed using the first formula x... out =relu(conv(w i ,x in Perform convolution with x + b), where x out Represents the output of the convolutional layer, relu(.) represents the activation function, conv(.) represents the convolution computation, and w i Represents the number of convolution kernels, x in 'b' represents the input to the convolutional layer, and 'b' represents the bias term. It should be noted that the number of convolutional kernels in the first formula of the three convolutional layers is different, and the corresponding bias terms are also different. The bias term in each convolutional layer is determined by model training.
[0108] After obtaining the third local feature vector through the third feature extraction model, the third local feature vector is subjected to rotational position encoding to obtain the third feature matrix. A third positional encoding is added to the third local feature vector according to the number of third sub-sequences to obtain the third feature matrix. The third positional encoding includes absolute positional encoding and relative positional encoding. In the self-attention layer, absolute positional information is injected into the query matrix and key matrix before self-attention calculation. Then, the updated query matrix and key matrix are used for self-attention calculation to introduce relative positional information, thus completing the rotational encoding process. Rotational encoding allows the introduction of absolute and relative positional information between sequences. Compared to the traditional fixed absolute positional encoding method, this embodiment uses rotational encoding to enable the preset model to know the absolute and relative positions between sequences, improving the accuracy of model prediction and thus improving the accuracy of subsequent door fault detection.
[0109] As described above, by inputting the working condition sequence data into a preset model, the preset model performs local feature extraction and rotational position encoding on the working condition sequence data. Compared with the existing traditional models that rely on a vocabulary for information extraction, the local feature extraction process does not require a vocabulary, and the feature information is more comprehensive, improving the convenience and accuracy of feature extraction. Furthermore, the rotational encoding process enables the preset model to know the absolute and relative positions between sequences, improving the accuracy of model prediction, and thus improving the accuracy of subsequent door failure detection.
[0110] S103. The first feature matrix is encoded by an encoder to obtain the first working condition sequence.
[0111] The first feature matrix is input into the encoder, and in the encoder, the second formula is used. Self-attention computation is performed to obtain the output of the self-attention layer; where Q, K, and V represent the input matrices of the self-attention layer of the encoding model, namely the query matrix, key matrix, and value matrix, respectively. m Q) and (W) n K) represents the first feature matrix after rotational position encoding, i.e., the query matrix and key matrix after rotational position encoding. is the scaling factor, softmax(.) represents the self-attention coefficients calculated for each first subsequence and other subsequences, and Attention(Q,K,V) represents the output of the self-attention layer. The output of the self-attention layer is processed through a residual connection and a normalization layer, and then through a feedforward fully connected layer to obtain the first working condition sequence.
[0112] Reference Figure 3 In the encoder, encoding processing is performed through N encoding modules, each including a first multi-head attention layer, a first residual connection and normalization layer, a first feedforward fully connected layer, and a second residual connection and normalization layer. The first multi-head attention layer is connected to the first residual connection and normalization layer, which in turn is connected to the first feedforward fully connected layer, which is also connected to the second residual connection and normalization layer. In the encoder, the first feature matrix is input into the first multi-head attention layer for data processing, and then sequentially processed through the first residual connection and normalization layer, the first feedforward fully connected layer, and the second residual connection and normalization layer to obtain the first operating condition sequence. By encoding the first feature matrix through the encoder, the first operating condition sequence corresponding to the motor current sequence data can be obtained, allowing for subsequent decoding processing based on the first operating condition sequence to predict the gate's fault state.
[0113] S104. The second feature matrix and the first working condition sequence are decoded by the first decoder to obtain the first prediction sequence; and the third feature matrix and the first working condition sequence are decoded by the second decoder to obtain the second prediction sequence.
[0114] Since both the second feature matrix corresponding to the door movement displacement sequence data and the third feature matrix corresponding to the door movement speed sequence data are affected by the motor current sequence data, based on the first operating condition sequence corresponding to the motor current sequence data obtained above, the first operating condition sequence and the second feature matrix, as well as the combination of the first operating condition sequence and the third feature matrix, are combined for corresponding decoding processing to obtain the first predicted sequence corresponding to the door movement displacement sequence data and the second predicted sequence corresponding to the door movement speed sequence data. The second feature matrix and the first operating condition sequence can be decoded using a first decoder to obtain the first predicted sequence; and the third feature matrix and the first operating condition sequence can be decoded using a second decoder to obtain the second predicted sequence. By combining the first operating condition sequence and the second feature matrix, as well as the combination of the first operating condition sequence and the third feature matrix, and obtaining the first and second predicted sequences, the door fault state can be comprehensively considered from three aspects: motor current, door movement position, and door movement speed. This allows for comprehensive encoding and decoding processing based on the correlation of various influencing factors in door fault detection, thereby improving the accuracy of door fault detection.
[0115] In one embodiment, reference is made to Figure 3 Both the first and second decoders include multiple decoding modules. Each decoding module includes a masked multi-head attention layer, a third residual connection and normalization layer, a second multi-head attention layer, a fourth residual connection and normalization layer, a second feedforward fully connected layer, and a fifth residual connection and normalization layer. Within each decoding module, the masked multi-head attention layer is connected to the third residual connection and normalization layer, which in turn is connected to the second multi-head attention layer, which is connected to the fourth residual connection and normalization layer, which is connected to the second feedforward fully connected layer, and finally, the second feedforward fully connected layer is connected to the fifth residual connection and normalization layer. The first operating condition sequence and the second feature matrix, as well as the first operating condition sequence and the third feature matrix, are input to the masked multi-head attention layer in each decoding module for data processing. Then, the data sequentially passes through the third residual connection and normalization layer, the second multi-head attention layer, the fourth residual connection and normalization layer, the second feedforward fully connected layer, and the fifth residual connection and normalization layer to output the corresponding prediction sequence, thereby obtaining either the first prediction sequence or the second prediction sequence.
[0116] S105. Calculate the loss value based on the first prediction sequence and the second prediction sequence to obtain the loss error value.
[0117] The first and second prediction sequences are input into the result output module. The anomaly detection and fault diagnosis submodules within the result output module perform corresponding anomaly detection and fault diagnosis processing, outputting the corresponding anomaly detection and fault diagnosis results. Loss value calculation can be performed based on the first and second prediction sequences to obtain a loss error value, which can then be used to determine the corresponding gate fault state.
[0118] The loss values are calculated based on the predicted values in the first prediction sequence and the actual values in the corresponding working condition sequence data, resulting in a first mean squared error loss value and a first cosine similarity loss value. These two loss values are then summed to obtain the first loss value. Similarly, the loss values are calculated based on the predicted values in the second prediction sequence and the actual values in the corresponding working condition sequence data, resulting in a second mean squared error loss value and a second cosine similarity loss value. These two loss values are then summed to obtain the second loss value. Finally, the first and second loss values are summed to obtain the loss error value. In summary, the first and second mean squared error losses measure the distance difference between the actual and predicted values, focusing on the correctness of each predicted value in both sequences. The cosine similarity between the actual working condition data and the predicted sequence is calculated using the first and second cosine similarity losses to assess the shape similarity between the two vectors; a higher cosine value indicates a higher similarity. By combining the first mean squared error loss value and the first cosine similarity loss value, and by combining the second mean squared error loss value and the second cosine similarity loss value, the numerical accuracy and shape similarity of the predicted sequence can be considered simultaneously, further improving the fitting ability of the preset model, and thus improving the accuracy of subsequent detection of door faults.
[0119] In one embodiment, through the third formula The calculation process yields the first mean squared error loss value, where Loss mes1 y represents the first mean squared error loss value, n represents the number of sequences, and y represents the first mean squared error loss value. i f(x) represents the true value corresponding to the i-th sequence. i () represents the predicted value corresponding to the i-th sequence. The fourth formula, Loss... cos1 =1-cos(y i ,f(x i The calculation process is performed to obtain the first cosine similarity loss value, where Loss cos1 Represents the first cosine similarity loss value, cos(y i ,f(x i )) represents y i and f(x) i The cosine value of ).
[0120] in, therefore Where m represents the length of the sequence, ij represents the j-th value in the i-th sequence, and y ij f(x) represents the j-th true value in the i-th sequence. ij () represents the j-th predicted value in the i-th sequence. The fifth formula, Loss... total1 = (1-μ)·Loss mes1 +μ·Loss cos1 The summation calculation is performed to obtain the first loss value; where Loss total1 Represents the first loss value, Loss mes1 Represents the first mean squared error loss value, Loss cos1 represents the first cosine similarity loss value, and μ represents a hyperparameter between 0 and 1.
[0121] In one embodiment, through the sixth formula The calculation process yields the second mean squared error loss value, where Loss mes2 y represents the second mean squared error loss value, n represents the number of sequences, and y represents the second mean squared error loss value. i f(x) represents the true value corresponding to the i-th sequence. i () represents the predicted value corresponding to the i-th sequence. This is calculated using the seventh formula, Loss. cos2 =1-cos(y i ,f(x i The calculation process is performed to obtain the second cosine similarity loss value, where Loss cos2 Represents the second cosine similarity loss value, cos(y i ,f(x i )) represents y i and f(x) i The cosine value of ).
[0122] in, therefore Where m represents the length of the sequence, ij represents the j-th value in the i-th sequence, and y ij f(x) represents the j-th true value in the i-th sequence. ij () represents the j-th predicted value in the i-th sequence. The loss is calculated using the eighth formula. total2 = (1-μ)·Loss mes2 +μ·Loss cos2 The second loss value is obtained by performing a summation calculation; where Loss total2 Represents the second loss value, Loss mes2 Represents the second mean squared error loss value, Loss cos2represents the second cosine similarity loss value, and μ represents a hyperparameter between 0 and 1.
[0123] In one embodiment, Loss is achieved through the ninth formula. total =Loss total1 +Loss total2 The calculation process is performed to obtain the loss error value, where Loss total Loss represents the loss error value. total1 Represents the first loss value, Loss total2 This represents the second loss value.
[0124] As described above, by calculating the loss value of the first predicted sequence corresponding to the door movement displacement sequence data and the second predicted sequence corresponding to the door movement speed sequence data, the corresponding loss error value is obtained. This allows for subsequent judgment of the corresponding door's fault state based on the loss error value. This enables the judgment of the door's fault state to consider both the door's movement displacement and door movement speed, and to combine the influence of the motor current to comprehensively judge the door's fault state. This increases the factor dimensions of door fault detection and avoids the low accuracy caused by relying solely on a single factor's sensor signal for judgment. This embodiment improves the accuracy of door fault detection.
[0125] S106. Compare the loss error value with the preset threshold, and determine the fault status of the door based on the comparison result.
[0126] The loss error value is compared with a preset threshold. If the loss error value is greater than the preset threshold, the anomaly detection submodule outputs an anomaly detection result indicating an anomaly exists. If the loss error value is less than or equal to the preset threshold, the anomaly detection submodule outputs an anomaly detection result indicating no anomaly exists. If the loss error value is greater than the preset threshold, the fault diagnosis submodule processes the first and second prediction sequences and outputs the corresponding fault diagnosis result as the specific fault type. By comparing the loss error value with the preset threshold and determining the gate's fault state based on the comparison result, the system comprehensively analyzes and processes motor current sequence data, gate displacement sequence data, and gate speed sequence data. Through data processing and judgment using a preset model, the corresponding gate fault state is obtained, improving the accuracy of gate fault diagnosis.
[0127] In one embodiment, before training the preset model, data acquisition and preprocessing are performed. This involves collecting motor current sequence data, door displacement sequence data, and door speed sequence data for each opening and closing process of the door (e.g., a subway platform screen door) during operation. The data types include a large amount of normal state (i.e., healthy state) data and a small amount of abnormal state data when the equipment malfunctions. Based on the work order submission and end times in the fault work order record table, data during the abnormal state period is extracted. For data with a clear fault type, fault labels are added; for data with an unclear fault type, it is classified as abnormal data. A large amount of data was collected during equipment operation, with normal samples accounting for 98.92%, labeled fault samples accounting for 0.3%, and unlabeled abnormal samples accounting for 0.78%. By dividing the data into normal and abnormal data, adding fault labels to data with clear fault types, and subsequently training the model, the preset model is trained based on a large amount of normal data and a small amount of abnormal data. Normal data is easier to obtain, thus improving the efficiency of model training.
[0128] In one embodiment, during training, the preset model receives inputs including motor current sequence data, door displacement sequence data, and door speed sequence data under normal conditions. The motor current sequence data under normal conditions is input to the encoder, while the door displacement sequence data and door speed sequence data under normal conditions are input to the corresponding decoder as prediction data. Before being input to the encoder and decoder, each sequence data is divided into several sub-sequences. Each sub-sequence is input to a different feature extraction module for local feature extraction processing, yielding corresponding local feature vectors. Positional encoding is added based on the number of sub-sequences and the dimension of the obtained feature vectors. The feature matrix with added positional encoding is sequentially input to the encoder and decoder for corresponding encoding and decoding processing, yielding the corresponding feature matrix and prediction sequence. The obtained feature matrix is input to the anomaly detection module in the result module. The loss error value is calculated based on the prediction sequence and the actual sequence, and then the gradient is calculated to update the parameters of each layer of the model. These steps are repeated until a predetermined number of iterations is reached, resulting in a trained anomaly detection sub-model. The pre-trained anomaly detection sub-model is reloaded, and a small amount of labeled fault data and an equal amount of normal data are input into the pre-set model for data processing. The resulting feature matrix is then input into the fault diagnosis sub-model to obtain the predicted class labels. The classification loss value is calculated based on the predicted and actual class labels, and the gradient is calculated based on the loss value to fine-tune the parameters of each layer of the fault diagnosis sub-model. This process is repeated until the model's diagnostic accuracy reaches a preset value, at which point training ends, resulting in the fault diagnosis sub-model. Finally, the pre-set model is obtained by combining the trained anomaly detection sub-model and fault diagnosis sub-model.
[0129] During the construction of the preset model, some parameters need to be pre-set; these parameters that need to be manually set in advance are called hyperparameters. This embodiment uses a network search method to optimize hyperparameters. Network search refers to considering all possible combinations within a specified hyperparameter search range and selecting the optimal combination based on evaluation metrics. The hyperparameters designed in this embodiment include the number of subsequences n, the dimension d of position encoding, the head of the multi-head attention layer head, the number of encoder and decoder layers num, and the coefficients μ in the loss function, etc.
[0130] As described above, by training the model with a large amount of normal data, the resulting preset model can accurately distinguish between normal and abnormal body states. To further verify the performance of the preset model, data under various working conditions over a long period of time was collected for testing. The results show that the model maintains high detection accuracy even under changes in working conditions or interference from external environmental factors. The preset model provided in this embodiment has good versatility and generalization ability. By fine-tuning the anomaly detection sub-model using a small amount of labeled data, the preset model is obtained. Compared with other existing deep learning models, the sample data required for fine-tuning is greatly reduced, while maintaining the same diagnostic accuracy, significantly reducing the difficulty of data collection and the cost of model training.
[0131] The preset model provided in this embodiment, as described above, combines the high accuracy of supervised learning with the high data utilization of unsupervised learning, and requires no in-depth understanding of professional mechanisms, thus improving the model's versatility and generalization. The preset model is trained using a large amount of unlabeled data and fine-tuned using a small amount of labeled data. The final model possesses the ability to diagnose known faults and detect anomalies in unknown faults.
[0132] The above describes a process where a preset model is used to perform local feature extraction, rotational position encoding, encoding, and decoding on the working condition sequence data under different conditions. This yields a first predicted sequence corresponding to the gate's displacement sequence data and a second predicted sequence corresponding to the gate's speed sequence data. Loss values are then calculated based on these two predicted sequences to obtain a loss error value. The gate's fault state is determined by comparing the loss error value with a preset threshold. This technique allows for the determination of the gate's fault state through the comparison of the loss error value with a preset threshold, thus avoiding the problem of low gate fault detection accuracy. Furthermore, the learning process of the preset model reduces the impact of changes in working conditions or environmental interference on the fault detection results, thereby improving the accuracy of gate fault detection.
[0133] Based on the above embodiments, Figure 4 This is a schematic diagram of a door fault detection device provided in an embodiment of this application. (Reference) Figure 4 The fault detection device for the door provided in this embodiment specifically includes: a data acquisition module 21, a feature extraction module 22, an encoding module 23, a decoding module 24, a loss calculation module 25, and a fault diagnosis module 26.
[0134] Among them, the data acquisition module 21 is used to collect the working condition sequence data of the gate system under different states. The working condition sequence data includes motor current sequence data, gate movement displacement sequence data and gate movement speed sequence data.
[0135] The feature extraction module 22 is used to input the working condition sequence data into the preset model, and perform local feature extraction and rotational position encoding processing on the working condition sequence data in the preset model to obtain a feature matrix. The feature matrix includes a first feature matrix corresponding to the motor current sequence data, a second feature matrix corresponding to the door movement displacement sequence data, and a third feature matrix corresponding to the door movement speed sequence data.
[0136] Encoding module 23 is used to encode the first feature matrix through an encoder to obtain the first working condition sequence;
[0137] Decoding module 24 is used to decode the second feature matrix and the first working condition sequence through the first decoder to obtain the first prediction sequence; and to decode the third feature matrix and the first working condition sequence through the second decoder to obtain the second prediction sequence.
[0138] Loss calculation module 25 is used to calculate the loss value based on the first prediction sequence and the second prediction sequence to obtain the loss error value;
[0139] The fault diagnosis module 26 is used to compare the loss error value with a preset threshold and determine the fault status of the door based on the comparison result.
[0140] In one embodiment, the feature extraction module 22 includes a feature extraction unit and a position encoding unit;
[0141] The feature extraction unit is used to input the working condition sequence data into the preset model. In the preset model, the motor current sequence data, the door movement displacement sequence data, and the door movement speed sequence data are respectively input into the first feature extraction module 22, the second feature extraction module 22, and the third feature extraction module 22 for local feature extraction processing to obtain the first local feature vector, the second local feature vector, and the third local feature vector.
[0142] The position encoding unit is used to perform rotation position encoding processing on the first local feature vector, the second local feature vector, and the third local feature vector respectively, so as to obtain the first feature matrix, the second feature matrix, and the third feature matrix.
[0143] In one embodiment, the feature extraction unit includes a segmentation subunit and an extraction subunit;
[0144] The segmentation sub-unit is used to input the operating condition sequence data into the preset model. In the preset model, the motor current sequence data is segmented to obtain the first sub-sequence.
[0145] The extraction sub-unit is used to input the first sub-sequence into the first feature extraction module for local feature extraction processing to obtain the first local feature vector;
[0146] The segmentation sub-unit is used to segment the door movement displacement sequence data in the preset model to obtain the second sub-sequence;
[0147] Extracting sub-units is used to input the second sub-sequence into the second feature extraction model for local feature extraction processing to obtain the second local feature vector;
[0148] The segmentation sub-unit is used to segment the door movement speed sequence data in the preset model to obtain a third sub-sequence;
[0149] Extraction sub-units are used to input the third sub-sequence into the third feature extraction model for local feature extraction processing to obtain the third local feature vector;
[0150] The position coding unit includes a first position coding subunit, a second position coding subunit, and a third position coding subunit;
[0151] The first position encoding subunit is used to add a first position encoding to the first local feature vector according to the number of the first subsequence to obtain a first feature matrix. The first position encoding includes absolute position encoding and relative position encoding.
[0152] The second position encoding subunit is used to add a second position encoding to the second local feature vector according to the number of the second subsequences to obtain the second feature matrix. The second position encoding includes absolute position encoding and relative position encoding.
[0153] The third positional encoding subunit is used to add a third positional encoding to the third local feature vector according to the number of third subsequences to obtain the third feature matrix. The third positional encoding includes absolute positional encoding and relative positional encoding.
[0154] In one embodiment, the extraction sub-unit is further configured to input the first sub-sequence into the first feature extraction module, in which local feature extraction processing is performed through three convolutional layers to obtain the first local feature vector;
[0155] Each convolutional layer is processed by the first formula x. out =relu(conv(w i ,xin Perform convolution with x + b), where x out Represents the output of the convolutional layer, relu(.) represents the activation function, conv(.) represents the convolution computation, and w i Represents the number of convolution kernels, x in 'b' represents the input to the convolutional layer, and 'b' represents the bias term.
[0156] In one embodiment, the encoding module 23 is further configured to input the first feature matrix into the encoder, and in the encoder, pass the second formula... Perform self-attention calculations to obtain the output of the self-attention layer;
[0157] Where Q, K, and V all represent the input matrices of the self-attention layer of the encoding model, (W m Q) and (W) n K) represents the first feature matrix of the rotation position encoding process. The scaling factor is softmax(.), which represents the self-attention coefficients calculated for each first subsequence and other subsequences, and Attention(Q,K,V) represents the output of the self-attention layer.
[0158] The output of the self-attention layer is processed through a residual connection and a normalization layer, and then through a feedforward fully connected layer to obtain the first working condition sequence.
[0159] In one embodiment, the loss calculation module 25 includes a first calculation unit and a second calculation unit;
[0160] The first calculation unit is used to perform loss value calculation processing based on the predicted value in the first prediction sequence and the real value of the corresponding working condition sequence data to obtain the first mean square error loss value and the first cosine similarity loss value.
[0161] The first loss value is obtained by summing the first mean square error loss value and the first cosine similarity loss value.
[0162] The second calculation unit is used to calculate the loss value based on the predicted value in the second prediction sequence and the actual value of the corresponding working condition sequence data, and to obtain the second mean square error loss value and the second cosine similarity loss value.
[0163] The second loss value is obtained by summing the second mean square error loss value and the second cosine similarity loss value.
[0164] The first loss value and the second loss value are summed to obtain the loss error value.
[0165] In one embodiment, the first calculation unit is further configured to use a third formula The calculation process yields the first mean squared error loss value, where Loss mes1 y represents the first mean squared error loss value, n represents the number of sequences, and y represents the first mean squared error loss value. i f(x) represents the true value corresponding to the i-th sequence. i ) represents the predicted value corresponding to the i-th sequence;
[0166] Loss through the fourth formula cos1 =1-cos(y i ,f(x i The calculation process is performed to obtain the first cosine similarity loss value, where Loss cos1 Represents the first cosine similarity loss value, cos(y i ,f(x i )) represents y i and f(x) i The cosine value of ).
[0167] Loss through Formula 5 total1 = (1-μ)·Loss mes1 +μ·Loss cos1 Perform a summation calculation to obtain the first loss value;
[0168] Among them, Loss total1 Represents the first loss value, Loss mes1 Represents the first mean squared error loss value, Loss cos1 represents the first cosine similarity loss value, and μ represents a hyperparameter between 0 and 1.
[0169] The above describes a process where a preset model is used to perform local feature extraction, rotational position encoding, encoding, and decoding on operating condition sequence data under different conditions. This yields a first predicted sequence corresponding to the gate's displacement sequence data and a second predicted sequence corresponding to the gate's speed sequence data. Loss values are then calculated based on these two predicted sequences to obtain a loss error value. The gate's fault state is determined by comparing the loss error value with a preset threshold. This technique allows for the determination of the gate's fault state through the comparison of the loss error value with a preset threshold, thus avoiding the problem of low gate fault detection accuracy. Furthermore, the learning process of the preset model reduces the impact of changes in operating conditions or environmental interference on the fault detection results, thereby improving the accuracy of gate fault detection.
[0170] The door fault detection device provided in this application embodiment can be used to execute the door fault detection method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0171] This application provides a fault detection device for a door, referring to... Figure 5 The fault detection device for the gate includes: a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The number of processors and the number of memories in the fault detection device can be one or more. The processor, memory, communication module, input device, and output device of the fault detection device can be connected via a bus or other means.
[0172] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the door fault detection method in any embodiment of this application (e.g., data acquisition module, feature extraction module, encoding module, decoding module, loss calculation module, and fault diagnosis module in the door fault detection device). The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0173] The communication module 33 is used for data transmission.
[0174] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory, thereby realizing the above-mentioned door fault detection method.
[0175] Input device 34 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 35 may include display devices such as a display screen.
[0176] The fault detection device for the door provided above can be used to execute the fault detection method for the door provided in the above embodiments, and has corresponding functions and beneficial effects.
[0177] This application embodiment also provides a storage medium for storing computer-executable instructions. When executed by a computer processor, these computer-executable instructions are used to execute a door fault detection method. The door fault detection method includes: collecting operating condition sequence data of a door system under different states, the operating condition sequence data including motor current sequence data, door displacement sequence data, and door speed sequence data; inputting the operating condition sequence data into a preset model, performing local feature extraction and rotational position encoding processing on the operating condition sequence data in the preset model to obtain a feature matrix, the feature matrix including a first feature matrix corresponding to the motor current sequence data, a second feature matrix corresponding to the door displacement sequence data, and a third feature matrix corresponding to the door speed sequence data; encoding the first feature matrix using an encoder to obtain a first operating condition sequence; decoding the second feature matrix and the first operating condition sequence using a first decoder to obtain a first prediction sequence; and decoding the third feature matrix and the first operating condition sequence using a second decoder to obtain a second prediction sequence; calculating a loss value based on the first prediction sequence and the second prediction sequence to obtain a loss error value; comparing the loss error value with a preset threshold, and determining the fault state of the door based on the comparison result.
[0178] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0179] Of course, the computer-executable instructions stored in the storage medium provided in the embodiments of this application are not limited to the door fault detection method described above, but can also execute related operations in the door fault detection method provided in any embodiment of this application.
[0180] The door fault detection device, storage medium, and door fault detection equipment provided in the above embodiments can execute the door fault detection method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the door fault detection method provided in any embodiment of this application.
[0181] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application. The scope of this application is determined by the scope of the claims.
Claims
1. A method for detecting faults in a door, characterized in that, include: The system collects operating condition sequence data of the gate system under different states, including motor current sequence data, gate movement displacement sequence data, and gate movement speed sequence data. The working condition sequence data is input into a preset model. Local feature extraction and rotational position encoding are performed on the working condition sequence data in the preset model to obtain a feature matrix. The feature matrix includes a first feature matrix corresponding to the motor current sequence data, a second feature matrix corresponding to the door movement displacement sequence data, and a third feature matrix corresponding to the door movement speed sequence data. The first feature matrix is encoded by an encoder to obtain the first working condition sequence; The second feature matrix and the first operating condition sequence are decoded by the first decoder to obtain the first prediction sequence; and the third feature matrix and the first operating condition sequence are decoded by the second decoder to obtain the second prediction sequence. The loss error value is obtained by calculating the loss value based on the first prediction sequence and the second prediction sequence. The loss error value is compared with a preset threshold, and the fault status of the door is determined based on the comparison result.
2. The method according to claim 1, characterized in that, The step involves inputting the operating condition sequence data into a preset model, and performing local feature extraction and rotational position encoding on the operating condition sequence data within the preset model to obtain a feature matrix, including: The working condition sequence data is input into a preset model. In the preset model, the motor current sequence data, the door movement displacement sequence data, and the door movement speed sequence data are respectively input into the first feature extraction module, the second feature extraction module, and the third feature extraction module for local feature extraction processing to obtain the first local feature vector, the second local feature vector, and the third local feature vector. The first local feature vector, the second local feature vector, and the third local feature vector are respectively subjected to rotation position encoding processing to obtain the first feature matrix, the second feature matrix, and the third feature matrix.
3. The method according to claim 2, characterized in that, The process involves inputting the operating condition sequence data into a preset model. Within this model, the motor current sequence data, the door movement displacement sequence data, and the door movement speed sequence data are respectively input into a first feature extraction module, a second feature extraction module, and a third feature extraction module for local feature extraction processing, resulting in a first local feature vector, a second local feature vector, and a third local feature vector, including: The operating condition sequence data is input into a preset model. In the preset model, the motor current sequence data is segmented to obtain the first sub-sequence. The first subsequence is input into the first feature extraction module for local feature extraction processing to obtain the first local feature vector; In the preset model, the door movement displacement sequence data is segmented to obtain a second sub-sequence; The second subsequence is input into the second feature extraction model for local feature extraction processing to obtain the second local feature vector; In the preset model, the door movement speed sequence data is segmented to obtain a third sub-sequence; The third subsequence is input into the third feature extraction model for local feature extraction processing to obtain the third local feature vector. The step of performing rotational position encoding processing on the first local feature vector, the second local feature vector, and the third local feature vector respectively to obtain the first feature matrix, the second feature matrix, and the third feature matrix includes: A first positional encoding is added to the first local feature vector based on the number of the first subsequences to obtain a first feature matrix. The first positional encoding includes absolute positional encoding and relative positional encoding. A second positional encoding is added to the second local feature vector based on the number of the second subsequences to obtain a second feature matrix. The second positional encoding includes absolute positional encoding and relative positional encoding. A third positional encoding is added to the third local feature vector based on the number of the third subsequences to obtain a third feature matrix. The third positional encoding includes absolute positional encoding and relative positional encoding.
4. The method according to claim 3, characterized in that, The step of inputting the first sub-sequence into the first feature extraction module for feature extraction processing to obtain the first local feature vector includes: The first subsequence is input into the first feature extraction module. In the first feature extraction module, local feature extraction is performed through three convolutional layers to obtain the first local feature vector. Each convolutional layer is processed by the first formula x. out =relu(conv(w i ,x in Perform convolution with x + b), where x out Represents the output of the convolutional layer, relu(.) represents the activation function, conv(.) represents the convolution computation, and w i Represents the number of convolution kernels, x in 'b' represents the input to the convolutional layer, and 'b' represents the bias term.
5. The method according to claim 3, characterized in that, The step of encoding the first feature matrix using an encoder to obtain the first working condition sequence includes: The first feature matrix is input into the encoder, and in the encoder, the second formula is used. Perform self-attention calculations to obtain the output of the self-attention layer; Where Q, K, and V all represent the input matrices of the self-attention layer of the encoding model, (W m Q) and (W) n K) represents the first feature matrix of the rotation position encoding process. The scaling factor is softmax(.), which represents the self-attention coefficients calculated for each of the first subsequences and other subsequences, and Attention(Q,K,V) represents the output of the self-attention layer. The output of the self-attention layer is processed through a residual connection and a normalization layer, and then through a feedforward fully connected layer to obtain the first working condition sequence.
6. The method according to claim 1, characterized in that, The step of calculating the loss value based on the first prediction sequence and the second prediction sequence to obtain the loss error value includes: Based on the predicted values in the first prediction sequence and the actual values of the corresponding working condition sequence data, the loss value is calculated to obtain the first mean squared error loss value and the first cosine similarity loss value. The first loss value is obtained by summing the first mean square error loss value and the first cosine similarity loss value. Based on the predicted values in the second prediction sequence and the actual values of the corresponding working condition sequence data, the loss value is calculated to obtain the second mean squared error loss value and the second cosine similarity loss value. The second loss value is obtained by summing the second mean square error loss value and the second cosine similarity loss value. The first loss value and the second loss value are summed to obtain the loss error value.
7. The method according to claim 6, characterized in that, The step of calculating the loss value based on the predicted value in the first prediction sequence and the actual value of the corresponding working condition sequence data to obtain the first mean squared error loss value and the first cosine similarity loss value includes: Through the third formula The calculation process yields the first mean squared error loss value, where Loss mes1 y represents the first mean squared error loss value, n represents the number of sequences, and y represents the first mean squared error loss value. i f(x) represents the true value corresponding to the i-th sequence. i ) represents the predicted value corresponding to the i-th sequence; Loss through the fourth formula cos1 =1-cos(y i ,f(x i The calculation process is performed to obtain the first cosine similarity loss value, where Loss cos1 Represents the first cosine similarity loss value, cos(y i ,f(x i )) represents y i and f(x) i The cosine value of ). The step of summing the first mean squared error loss value and the first cosine similarity loss value to obtain the first loss value includes: Loss through Formula 5 total1 = (1-μ)·Loss mes1 +μ·Loss cos1 Perform a summation calculation to obtain the first loss value; Among them, Loss total1 Represents the first loss value, Loss mes1 Represents the first mean squared error loss value, Loss cos1 represents the first cosine similarity loss value, and μ represents a hyperparameter between 0 and 1.
8. A fault detection device for a door, characterized in that, include: The data acquisition module is used to collect the operating condition sequence data of the gate system under different states. The operating condition sequence data includes motor current sequence data, gate movement displacement sequence data, and gate movement speed sequence data. The feature extraction module is used to input the working condition sequence data into a preset model, and perform local feature extraction and rotational position encoding processing on the working condition sequence data in the preset model to obtain a feature matrix. The feature matrix includes a first feature matrix corresponding to the motor current sequence data, a second feature matrix corresponding to the door movement displacement sequence data, and a third feature matrix corresponding to the door movement speed sequence data. The encoding module is used to encode the first feature matrix through an encoder to obtain the first working condition sequence; The decoding module is used to decode the second feature matrix and the first operating condition sequence through a first decoder to obtain a first prediction sequence; and to decode the third feature matrix and the first operating condition sequence through a second decoder to obtain a second prediction sequence. The loss calculation module is used to perform loss value calculation processing based on the first prediction sequence and the second prediction sequence to obtain the loss error value; The fault diagnosis module is used to compare the loss error value with a preset threshold and determine the fault status of the door based on the comparison result.
9. A fault detection device for a door, characterized in that, include: Memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a processor, are used to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Refrigeration system load prediction method based on sequence-to-sequence model
CN115982567A
Fault diagnosis method and device, electronic equipment and storage medium
CN116380438A