Fault diagnosis method and device of grating array sensor and storage medium

By building time series data sets and using prediction models and fault identification models, the problems of low accuracy and slow speed of grating array sensor fault diagnosis are solved, fast and accurate fault detection is achieved, and the reliability of sensors in high-speed environments is improved. .

CN119128735AActive Publication Date: 2024-12-13WUHAN FENGLI OPTOELECTRONICS TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411072481.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-13
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

Existing grating array sensor fault diagnosis methods have low accuracy and slow diagnosis speed, making it difficult to effectively detect faults in high-speed environments, which may lead to wrong decisions and serious consequences.

Method used

By constructing a time series data set, the prediction model and the fault identification model are used for diagnosis. The prediction model is based on the GRU network training outputs the prediction sequence data set, and the fault identification model is based on the GRU network training outputs the fault identification results of the CBAM attention module, combined with the residual data Set to make fault judgments.

Benefits of technology

It improves the accuracy and efficiency of fault detection of grating array sensors, can quickly and accurately determine whether there is a fault in the sensor, and enhances the fault detection capability in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128735A_ABST
    Figure CN119128735A_ABST
Patent Text Reader

Abstract

The invention relates to a fault diagnosis method and device for a grating array sensor and a storage medium, and belongs to the technical field of sensors, and the method comprises the steps: inputting a time sequence data set into a prediction model, and obtaining a prediction sequence data set outputted by the prediction model; the time sequence data set is constructed based on a measurement data set acquired by a grating array sensor; the prediction model is obtained based on training of a sample time sequence data set; inputting the residual data set into a fault recognition model to obtain a fault recognition result output by the fault recognition model; the fault identification model is obtained by training based on a sample residual data set; the residual data set is determined based on the tag corresponding to the time sequence data set and the prediction sequence data set. According to the fault diagnosis method of the grating array sensor, faults can be effectively detected and diagnosed from complex sensor data, and the accuracy and efficiency of fault detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of sensor technology, and in particular to a fault diagnosis method, device and storage medium for a grating array sensor. Background Art

[0002] In the field of smart transportation, intelligent sensors can accurately sense the service status of pavement structures and automatically analyze various internal and external status information such as the road environment, which is of great significance to the realization of intelligent road infrastructure. Among them, grating array sensors have great development prospects and application trends compared to traditional sensors due to their high sensitivity, high temperature resolution, fast response, and excellent corrosion resistance. However, because sensors need to be arranged along highways and have a harsh working environment, there is a possibility of sensor failure and malfunction. Once a failure occurs, erroneous feedback information may lead to wrong decisions and scheduling, especially in the field of transportation, which may cause serious loss of life and property.

[0003] Traditional sensor fault diagnosis methods are mainly divided into two categories: those based on analytical models and those based on signal processing. The former estimates the system output by constructing an observer and then compares it with the actual measurement value to obtain fault information. The accuracy of this method depends on the accuracy of the model, but the precise mathematical model of the grating array sensor system is generally difficult to obtain; the latter uses analysis methods such as correlation functions and spectra to extract characteristic values ​​such as signal variance, amplitude, and frequency to evaluate the structure and sensor performance. Although this method does not require a precise mathematical model, it is easily affected by interference signals and has a slow diagnostic speed. Summary of the invention

[0004] In view of this, it is necessary to provide a fault diagnosis method, device and storage medium for a grating array sensor to solve the problems of low accuracy and slow diagnosis speed of existing fault diagnosis methods.

[0005] In order to solve the above problems, the present invention provides a fault diagnosis method for a grating array sensor, comprising: Inputting a time series data set into a prediction model to obtain a prediction series data set output by the prediction model; the time series data set is constructed based on a measurement data set collected by a grating array sensor; the prediction model is obtained by training based on a sample time series data set; The residual data set is input into the fault recognition model to obtain the fault recognition result output by the fault recognition model; the fault recognition model is trained based on the sample residual data set; the residual data set is determined based on the label corresponding to the time series data set and the predicted sequence data set.

[0006] In a possible implementation, the measurement data set includes a first data set, a second data set and a third data set; the first data set is determined based on data collected by a target sensor in a grating array sensor; the second data set is determined based on data collected by a first sensor adjacent to the target sensor; the third data set is determined based on data collected by a second sensor adjacent to the target sensor; The time series dataset is determined in the following way: In the first data set, select consecutive m data, select the first m+k data, select the first m+k data, construct the data in the subset; wherein the number of the subsets is nm ; The value range of k is [1, nm ]; n Indicates the number of data in the first data set; In the first dataset, select m+k data, as labels in the subset; Based on the data in the subset and the label, obtaining the subset; Based on the subset, the time series dataset is constructed.

[0007] In a possible implementation, the expression of the subset is as follows:

[0008] in, Indicates k subsets, Indicates the first data set k data, Indicates the first m+k data, Indicates the third data set m+k data, Represents the label, which is the first m+k data.

[0009] In a possible implementation, the prediction model is trained in the following manner: Based on a sample time series data set, determining a first training set and a first test set; the sample time series data set includes a first sample label; In each training process, the first training set is input into the first network to obtain a first prediction value output by the first network; the first network is a GRU network; Based on the mean square error between the first sample label and the first predicted value, updating the parameters of the first network to obtain an updated first network; After each training session, input the first test set into the updated first network to obtain a second prediction value output by the updated first network, and calculate the mean absolute error between the first sample label and the second prediction value; When the preset number of training times is reached, the network corresponding to the minimum mean absolute error is used as the prediction model.

[0010] In a possible implementation, the fault identification model is trained in the following manner: Determining a second training set and a second test set based on a sample residual data set, wherein the sample residual data set includes a second sample label; In each training process, the second training set is input into the second network to obtain a third prediction value output by the second network; the second network is a GRU network including a CBAM attention module; Based on the cross entropy between the second sample label and the third predicted value, updating the parameters of the second network to obtain an updated second network; After each training, input the second test set into the updated second network, obtain a fourth prediction value output by the updated second network, and calculate an F1 score between the second sample label and the fourth prediction value; When the preset number of training times is reached, the network corresponding to the maximum F1 score is used as the fault recognition model.

[0011] In a possible implementation manner, after obtaining the fault identification result output by the fault identification model, the method further includes: When it is determined based on the fault identification result that the measurement data set has a fault, the measurement data set is compensated based on the prediction sequence data set.

[0012] In a possible implementation, after constructing the time series data set based on the subset, the method further includes: The time series data set is normalized and standardized.

[0013] The present invention also provides a fault diagnosis device for a grating array sensor, comprising: A prediction module is used to input a time series data set into a prediction model to obtain a prediction series data set output by the prediction model; the time series data set is constructed based on a measurement data set collected by a grating array sensor; the prediction model is obtained by training based on a sample time series data set; The identification module is used to input the residual data set into the fault identification model to obtain the fault identification result output by the fault identification model; the fault identification model is trained based on the sample residual data set; the residual data set is determined based on the label corresponding to the time series data set and the predicted sequence data set.

[0014] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the fault diagnosis method of the grating array sensor described in any of the above implementations.

[0015] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the fault diagnosis method for the grating array sensor described in any of the above implementations is implemented.

[0016] The beneficial effects of the present invention are as follows: the fault diagnosis method, device and storage medium of the grating array sensor provided by the present invention construct a time series data set according to the measurement data sets collected by multiple sensors in the grating array sensor, and the prediction model can output the prediction sequence data set according to the time series data set, thereby determining the residual data set according to the label corresponding to the time series data set and the prediction sequence data set, and the residual data set can reflect the difference or error between the prediction sequence data set and the time series data set, so that the fault identification model can analyze the residual data set to determine whether the time series data set is abnormal and obtain a fault identification result, thereby judging whether the grating array sensor has a fault, and can effectively detect and diagnose faults from complex sensor data, thereby improving the accuracy and efficiency of fault detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A method flow chart of an embodiment of a fault diagnosis method for a grating array sensor provided by the present invention; Figure 2 A method flow chart of an embodiment of the fault diagnosis and data compensation method of the grating array sensor provided by the present invention; Figure 3A schematic structural diagram of an embodiment of a fault diagnosis device for a grating array sensor provided by the present invention; Figure 4 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0020] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0021] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.

[0022] Figure 1 A method flow chart of an embodiment of a fault diagnosis method for a grating array sensor provided by the present invention is shown in FIG. Figure 1 As shown, the fault diagnosis method of the grating array sensor includes: S101, inputting a time series data set into a prediction model to obtain a prediction series data set output by the prediction model; the time series data set is constructed based on a measurement data set collected by a grating array sensor; the prediction model is obtained by training based on a sample time series data set; S102, inputting the residual data set into the fault recognition model to obtain the fault recognition result output by the fault recognition model; the fault recognition model is trained based on the sample residual data set; the residual data set is determined based on the label corresponding to the time series data set and the predicted sequence data set.

[0023] It should be noted that a grating array sensor is a system comprising multiple sensors, which are organized into an array and can detect or measure multiple targets simultaneously or sequentially.

[0024] In this embodiment, a plurality of sensors in the grating array sensor can simultaneously acquire temporally continuous data to obtain a measurement data set. A time series data set is constructed based on the measurement data set. The time series data set includes a plurality of subsets, each subset including measurement data extracted from the measurement data set, and including the measurement data extracted from the measurement data set as a label.

[0025] The prediction model is trained based on the sample time series data set, which can be determined based on the historical data obtained by the grating array sensor. By inputting the time series data set into the trained prediction model, the prediction sequence data set output by the prediction model can be obtained.

[0026] Subtract the labels in the predicted sequence dataset from those in the time series dataset to obtain the residual dataset . And the residual data set By inputting it into the trained fault identification model, the fault identification result output by the fault identification model can be obtained, thereby judging whether there is a fault in the measurement data set. The result output by the fault identification model is a judgment on whether there is a fault, which can be a binary output (for example, yes or no) or a probability score of the fault. The fault identification model is trained based on the sample residual data set, and the sample residual data set can be determined based on the historical data obtained by the grating array sensor.

[0027] Compared with the prior art, the fault diagnosis method for a grating array sensor provided in an embodiment of the present invention constructs a time series data set based on measurement data sets collected by multiple sensors in the grating array sensor. The prediction model can output a prediction sequence data set based on the time series data set, thereby determining a residual data set based on the label corresponding to the time series data set and the prediction sequence data set. The residual data set can reflect the difference or error between the prediction sequence data set and the time series data set, so that the fault identification model can analyze the residual data set to determine whether the time series data set is abnormal and obtain a fault identification result, thereby judging whether the grating array sensor has a fault, and can effectively detect and diagnose faults from complex sensor data, thereby improving the accuracy and efficiency of fault detection.

[0028] In some embodiments of the present invention, the measurement data set includes a first data set, a second data set and a third data set; the first data set is determined based on data collected by a target sensor in a grating array sensor; the second data set is determined based on data collected by a first sensor adjacent to the target sensor; the third data set is determined based on data collected by a second sensor adjacent to the target sensor; The time series dataset is determined in the following way: In the first data set, select consecutivem data, select the first m+k data, select the first m+k data, construct the data in the subset; wherein the number of the subsets is nm ; k The value range is [1, nm ]; n Indicates the number of data in the first data set; In the first dataset, select m+k data, as labels in the subset; Based on the data in the subset and the label, obtaining the subset; Based on the subset, the time series dataset is constructed.

[0029] In some embodiments of the present invention, the expression of the subset is as follows:

[0030] in, Indicates k subsets, Indicates the first data set k data, Indicates the first m+k data, Indicates the third data set m+k data, Represents the label, which is the first m+k data.

[0031] It is understandable that the target sensor can be any sensor in the grating array sensor, and the target sensor can obtain temporally continuous n data, build the first data set for( , , … , ).

[0032] The first sensor and the second sensor are related sensors of the target sensor, and are determined by spatial influence. If there are several sensors in space that affect the current target sensor, there will be several related sensors. They can be configured according to actual conditions and can be multiple.

[0033] The first sensor is one or more sensors adjacent to the target sensor, for example, a sensor adjacent to the left or above the target sensor in the grating array sensor. n data, construct the second data set for( , , … , ).

[0034] The second sensor is one or more sensors adjacent to the target sensor, for example, a sensor adjacent to the right or below the target sensor in the grating array sensor. n data, construct the third data set for( , , … , ).

[0035] Thus, a time series data set is constructed based on the first data set, the second data set and the third data set. The specific process is as follows: Select consecutive m Data, select nm Group Continuous m data, select the m+k data, select the m+k data, construct the data in the subset. And select the m+k data as labels in the subset.

[0036] Understandably, the length of the subset is m +3, including m +2 measurements and 1 label.

[0037] For example, when k =1, the data selected in the first data set is ( , , … , ), the data selected in the second data set is , the data selected in the third data set are , and select the first m +1 data As a label, we get the first subset ( )for(( , , …, ), ).

[0038] when k =2, the data selected in the first data set is ( , , … , ), then the data selected in the second data set is , then the data selected in the third data set is , and select the first m +2 data As labels, we get the second subset ( )for(( , , …, ), ).

[0039] Understandably, k Subsets ( )for(( , , …, ), ).

[0040] Thus, according to the obtained nm Subsets, constructed time series dataset X for .

[0041] The fault diagnosis method for the grating array sensor provided by the embodiment of the present invention constructs a time series data set including measurement data collected by different sensors, and effectively utilizes the data of the target sensor and its adjacent sensors to construct the time series data set, thereby improving the prediction accuracy and reliability. It can comprehensively reflect the state of the target sensor and its surrounding environment, utilize the data of multiple sensors to enhance the generalization ability and sensitivity of the model, and help to more accurately analyze and predict the behavior and possible fault conditions of the target sensor.

[0042] In some embodiments of the present invention, after constructing the time series data set based on the subset, the method further includes: The time series data set is normalized and standardized.

[0043] The time series data set is preprocessed in sequence. The preprocessing may include normalization and standardization, as follows: (1) Normalization: convert the time series data set Normalized to the interval [0, 1], the output is ,Right now:

[0044] in, for The minimum value of for The maximum value of .

[0045] (2) Standardization: normalizing the data The Z-Score is standardized to satisfy the standard normal distribution, and the output is ,Right now:

[0046] in, , The normalized data are The mean and standard deviation of .

[0047] right Y Do the same process as above to get ,final( , ) is the time series dataset after all preprocessing.

[0048] The fault diagnosis method for the grating array sensor provided in the embodiment of the present invention can improve the convergence speed of model training and enhance the stability and generalization ability of the model for input data by normalizing and standardizing the time series data set.

[0049] In some embodiments of the present invention, the prediction model is trained in the following manner: Based on a sample time series data set, determining a first training set and a first test set; the sample time series data set includes a first sample label; In each training process, the first training set is input into the first network to obtain a first prediction value output by the first network; the first network is a GRU network; Based on the mean square error between the first sample label and the first predicted value, updating the parameters of the first network to obtain an updated first network; After each training session, input the first test set into the updated first network to obtain a second prediction value output by the updated first network, and calculate the mean absolute error between the first sample label and the second prediction value; When the preset number of training times is reached, the network corresponding to the minimum mean absolute error is used as the prediction model.

[0050] The preprocessed time series dataset Input the trained sequence prediction model and output the predicted sequence dataset output by the sequence prediction model .

[0051] The prediction model is a grating array sensor measurement data sequence prediction model, and the prediction model is obtained by training based on a sample time series data set.

[0052] The sample time series data set can be obtained based on the collected historical data, and is randomly divided into a first training set and a first test set in a ratio of 95:5. The first training set is used to train the model, and the first test set is used to evaluate the model effect, so as to select the optimal model.

[0053] In the embodiment of the present invention, the prediction model is composed of a GRU network, the number of GRU hidden layers is 4, the hidden layer dimension is 256, the loss function in the training process is the mean square error, the optimizer is Adam, the initial learning rate is 0.001, the number of training rounds is 100, and the evaluation index is the mean absolute error.

[0054] In each round of iteration, the first training set data is input into the first network (i.e., the GRU network), and the forward propagation is used to calculate the mean square error loss between the first prediction value output by the first network and the first sample label, as well as the gradient of the network node parameters. The Adam optimizer is used to calculate the gradient change, and the network node parameters are updated using back propagation.

[0055] After each round of iteration, the current network model is saved to obtain the updated first network. The first test set data is input into the updated first network, and the mean absolute error between the second predicted value output by the updated first network and the second sample label is calculated using forward propagation. At this time, the gradient is not calculated, back propagation is not performed, and the network node parameters are not updated.

[0056] When the preset number of training times is reached, for example, when the preset number of training times is 100 times, after 100 rounds of training are completed, the network model with the smallest mean absolute error corresponding to the first test set is used as the fully trained grating array sensor measurement data sequence prediction model.

[0057] The fault diagnosis method for a grating array sensor provided in an embodiment of the present invention ensures that the prediction model can optimize the model parameters by minimizing the prediction error while retaining the characteristics of the time series data. The use of the GRU network provides sufficient capabilities to simulate complex time dependencies, while the use of the mean square error and the mean absolute error ensures that the model can achieve high accuracy and stability in both the training and testing stages.

[0058] In some embodiments of the present invention, the fault identification model is trained in the following manner: Determining a second training set and a second test set based on a sample residual data set, wherein the sample residual data set includes a second sample label; In each training process, the second training set is input into the second network to obtain a third prediction value output by the second network; the second network is a GRU network including a CBAM attention module; Based on the cross entropy between the second sample label and the third predicted value, updating the parameters of the second network to obtain an updated second network; After each training, input the second test set into the updated second network, obtain a fourth prediction value output by the updated second network, and calculate an F1 score between the second sample label and the fourth prediction value; When the preset number of training times is reached, the network corresponding to the maximum F1 score is used as the fault recognition model.

[0059] The prediction sequence dataset The labels in the input sequence dataset Subtract and get the residual data set E , the expression is as follows:

[0060] Thus, the residual data set E Input the trained fault recognition model, output the fault recognition result, and determine whether there is a fault in the current sequence data.

[0061] The fault recognition model, i.e., the grating array sensor measurement data fault recognition model, is obtained by training based on a sample residual data set. The sample residual data set is composed of residuals and fault labels (i.e., second sample labels), which can be obtained through manual labeling.

[0062] The sample residual data set is randomly divided into a second training set and a second test set in a ratio of 95:5. The second training set is used to train the model, and the second test set is used to evaluate the model effect, so as to select the optimal model.

[0063] The fault recognition model consists of a GRU network with a CBAM attention module. The number of GRU hidden layers is 2, the hidden layer dimension is 128, the loss function in the training process is the cross entropy loss, the optimizer is Adam, the initial learning rate is 0.001, the number of training rounds is 100, and the evaluation indicator is the F1 score.

[0064] In each round of iteration, the second training set data is input into the second network (i.e., the GRU network with the CBAM attention module added), and the cross entropy loss between the third predicted value output by the second network and the second sample label, as well as the gradient of the network node parameters, are calculated using forward propagation. The Adam optimizer is used to calculate the gradient change, and the network node parameters are updated using back propagation.

[0065] After each round of iteration, the current network model is saved to obtain the updated second network.

[0066] The second test set data is input into the updated second network, and the F1 score between the fourth prediction value output by the updated second network and the second sample label is calculated using forward propagation. At this time, the gradient is not calculated, back propagation is not performed, and the network node parameters are not updated.

[0067] When the preset number of training times is reached, for example, when the preset number of training times is 100 times, after 100 rounds of training are completed, the network model with the largest F1 score corresponding to the second test set is used as the fully trained grating array sensor measurement data fault recognition model.

[0068] The fault diagnosis method for a grating array sensor provided in an embodiment of the present invention improves classification performance by focusing on important features in the data through a GRU network including CBAM, while the use of cross entropy and F1 score ensures high accuracy and reliability of the model in identifying faults, and ensures that the fault identification model can effectively identify fault modes when processing residual data.

[0069] In some embodiments of the present invention, after obtaining the fault identification result output by the fault identification model, the method further includes: When it is determined based on the fault identification result that the measurement data set has a fault, the measurement data set is compensated based on the prediction sequence data set.

[0070] When it is determined according to the fault identification result that the measurement data set has a fault, the measurement data set is compensated by using the prediction sequence data set, otherwise no compensation is performed.

[0071] For example, when there is a fault, the prediction sequence dataset can be used Replace the time series dataset labels in the original sequence , that is, using the normal grating data related to the faulty grating to compensate for it.

[0072] The fault diagnosis method for a grating array sensor provided by the embodiment of the present invention can quickly and accurately diagnose the fault of the grating array sensor and use the normal grating data related to the faulty grating to perform data compensation.

[0073] Figure 2 A method flow chart of an embodiment of the fault diagnosis and data compensation method of the grating array sensor provided by the present invention, as shown in FIG. Figure 2 As shown, the fault diagnosis and data compensation method of the grating array sensor includes: S201, obtaining measurement data of a time-continuous grating array sensor and its related sensors, and constructing a measurement data set, wherein the related sensors are determined by spatial influence and can be configured according to actual conditions.

[0074] In step S201, obtainn Continuous grating array sensor measurement data to construct a measurement data set for( , , … , ), in this embodiment, the relevant sensors are determined to be the sensors adjacent to the current grating sensor on the left and right, and their measurement data sets are and .

[0075] S202: Based on the measurement data set, construct a time series data set, including samples and labels.

[0076] In step S202, a time series data set is constructed based on the measurement data set in step S201, where the sample length is m +2, label length is 1, construction logic is measurement data set Center front m elements, and the first subsequent element is the corresponding label. At the same time, the current data elements of the sensors adjacent to the current grating sensor are combined, and the data set is finally concentrated. k Elements ( )for(( , , …, ), ),in k =1, 2, …, nm .

[0077] S203: Preprocess the time series data set.

[0078] In step S203, the time series data set in step S202 is normalized and standardized in sequence, as follows: (1) Normalization: convert the time series data set Normalized to the interval [0, 1], the output is ,Right now:

[0079] in for The minimum value of for The maximum value of .

[0080] (2) Standardization: normalizing the data The Z-Score is standardized to satisfy the standard normal distribution, and the output is ,Right now:

[0081] in, , The normalized data are The mean and standard deviation of .

[0082] right Y Do the same process as above to get ,final( , ) is the time series dataset after all preprocessing.

[0083] S204, inputting the time series data set into a fully trained grating array sensor measurement data sequence prediction model, and outputting a predicted sequence data set.

[0084] In step S204, the data samples processed in step S203 are Input the trained grating array sensor measurement data sequence prediction model and output the prediction sequence dataset .

[0085] Among them, the grating array sensor measurement data sequence prediction model is trained based on the time series data set, which is randomly divided into a training set and a test set in a ratio of 95:5. The training set is used to train the model, and the test set is used to evaluate the model effect and select the optimal model. The model is composed of a GRU network with 4 hidden layers and 256 hidden layer dimensions. The loss function in the training process is the mean square error, the optimizer is Adam, the initial learning rate is 0.001, the number of training rounds is 100, and the evaluation index is the mean absolute error.

[0086] In each round of iteration, the training set data is input into the network, and the forward propagation is used to calculate the mean square error loss between the network output and the label, as well as the gradient of the network node parameters. The Adam optimizer is used to calculate the gradient change, and the network node parameters are updated using back propagation. After each round of iteration, the current network model is saved. The test set data is input into the network, and the mean absolute error between the network output and the label is calculated using forward propagation. At this time, the gradient is not calculated, back propagation is not performed, and the network node parameters are not updated. After 100 rounds of training, the network model with the smallest mean absolute error of the test set is the fully trained grating array sensor measurement data sequence prediction model.

[0087] S205 , subtract the labels in the predicted sequence dataset from those in the input sequence dataset to obtain a residual dataset.

[0088] In step S205, the residual data set is obtained E , prediction sequence dataset Labels with time series datasets Difference, that is:

[0089] S206 , inputting the residual data set into a fully trained grating array sensor measurement data fault recognition model, and outputting whether the current sequence data has a fault.

[0090] In step S206, the residual data set in step S205 is E Input the fully trained grating array sensor measurement data fault recognition model and output whether the current sequence data has a fault.

[0091] Among them, the fault recognition model of grating array sensor measurement data is trained based on the residual data set. The residual data set is composed of residuals and fault labels, which are manually labeled and randomly divided into training sets and test sets in a ratio of 95:5. The training set is used to train the model, and the test set is used to evaluate the model effect and select the optimal model. The model consists of a GRU network with a CBAM attention module. The number of GRU hidden layers is 2, the hidden layer dimension is 128, the loss function in the training process is cross entropy loss, the optimizer is Adam, the initial learning rate is 0.001, the number of training rounds is 100, and the evaluation index is F1 score.

[0092] In each round of iteration, the training set data is input into the network, and the cross entropy loss between the network output and the label, as well as the gradient of the network node parameters, are calculated using forward propagation. The Adam optimizer is used to calculate the gradient change, and the network node parameters are updated using back propagation. After each round of iteration, the current network model is saved. The test set data is input into the network, and the F1 score of the network output and the fault label is calculated using forward propagation. At this time, the gradient is not calculated, back propagation is not performed, and the network node parameters are not updated.

[0093] After 100 rounds of training, the network model with the largest F1 score on the test set is the fully trained grating array sensor measurement data fault recognition model.

[0094] S207: If a fault exists, the original measurement data set is compensated using the predicted sequence data set, otherwise no compensation is performed.

[0095] In step S207, if there is a fault, the original measurement data set is compensated by using the predicted sequence data set. Replace the time series dataset labels in the original sequence ; otherwise no compensation will be made.

[0096] The grating array sensor fault diagnosis and data compensation method and system provided by the present invention are used to quickly and accurately diagnose faults of the grating array sensor and to perform data compensation on the grating array sensor using normal grating data related to the faulty grating, thereby providing underlying protection for its application in the field of smart transportation.

[0097] In order to better implement the fault diagnosis method of the grating array sensor in the embodiment of the present invention, based on the fault diagnosis method of the grating array sensor, the embodiment of the present invention further provides a fault diagnosis device for the grating array sensor. Figure 3 A schematic diagram of the structure of an embodiment of a fault diagnosis device for a grating array sensor provided by the present invention is shown in FIG. Figure 3 As shown, the fault diagnosis device 300 of the grating array sensor includes: Prediction module 310, used for inputting a time series data set into a prediction model to obtain a prediction series data set output by the prediction model; the time series data set is constructed based on a measurement data set collected by a grating array sensor; the prediction model is obtained by training based on a sample time series data set; The identification module 320 is used to input the residual data set into the fault identification model to obtain the fault identification result output by the fault identification model; the fault identification model is trained based on the sample residual data set; the residual data set is determined based on the label corresponding to the time series data set and the predicted sequence data set.

[0098] The grating array sensor fault diagnosis device 300 provided in the above embodiment can implement the technical solution described in the above grating array sensor fault diagnosis method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the grating array sensor fault diagnosis method embodiment, which will not be repeated here.

[0099] like Figure 4 As shown, the present invention also provides an electronic device 400. The electronic device 400 includes a processor 401, a memory 402 and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0100] In some embodiments, the processor 401 may be a central processing unit (CPU), a microprocessor or other data processing chip, and is used to run program codes or process data stored in the memory 402, such as the fault diagnosis method of the grating array sensor in the present invention.

[0101] In some embodiments, processor 401 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, processor 401 may be local or remote. In some embodiments, processor 401 may be implemented in a cloud platform. In some embodiments, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0102] In some embodiments, the memory 402 may be an internal storage unit of the electronic device 400, such as a hard disk or memory of the electronic device 400. In other embodiments, the memory 402 may also be an external storage device of the electronic device 400, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 400.

[0103] Furthermore, the memory 402 may include both an internal storage unit of the electronic device 400 and an external storage device. The memory 402 is used to store application software installed in the electronic device 400 and various data.

[0104] In some embodiments, the display 403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, etc. The display 403 is used to display information on the electronic device 400 and to display a visual user interface. The components 401-403 of the electronic device 400 communicate with each other via a system bus.

[0105] In one embodiment, when the processor 401 executes the fault diagnosis program of the grating array sensor in the memory 402, the following steps may be implemented: Inputting a time series data set into a prediction model to obtain a prediction series data set output by the prediction model; the time series data set is constructed based on a measurement data set collected by a grating array sensor; the prediction model is obtained by training based on a sample time series data set; The residual data set is input into the fault recognition model to obtain the fault recognition result output by the fault recognition model; the fault recognition model is trained based on the sample residual data set; the residual data set is determined based on the label corresponding to the time series data set and the predicted sequence data set.

[0106] It should be understood that: when the processor 401 executes the fault diagnosis program of the grating array sensor in the memory 402, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.

[0107] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 400 mentioned, and the electronic device 400 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 400 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0108] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions of the fault diagnosis method of the grating array sensor provided in the above-mentioned method embodiments can be implemented.

[0109] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0110] The fault diagnosis method, device and storage medium of the grating array sensor provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A fault diagnosis method for a grating array sensor, It is characterized in that include: Inputting the time series data set into the prediction model to obtain the prediction sequence data set output by the prediction model; The time series data set is constructed based on the measurement data set collected by the grating array sensor; the prediction model is obtained by training based on the sample time series data set; Inputting the residual data set into the fault identification model to obtain the fault identification result output by the fault identification model; The fault identification model is obtained by training based on a sample residual data set; The residual data set is determined based on the label corresponding to the time series data set and the predicted sequence data set.

2. The fault diagnosis method of the grating array sensor according to claim 1, It is characterized in that The measurement data set includes a first data set, a second data set and a third data set; the first data set is determined based on data collected by a target sensor in a grating array sensor; the second data set is determined based on data collected by a first sensor adjacent to the target sensor; the third data set is determined based on data collected by a second sensor adjacent to the target sensor; The time series dataset is determined in the following way: In the first data set, select consecutive m data, select the first m+k data, select the first m+k data, construct the data in the subset; wherein the number of the subsets is n- m ; The value range of k is [1, nm ]; n Indicates the number of data in the first data set; In the first dataset, select m+k data, as labels in the subset; Based on the data in the subset and the label, obtaining the subset; Based on the subset, the time series dataset is constructed.

3. The fault diagnosis method of the grating array sensor according to claim 2, It is characterized in that The expression of the subset is as follows: in, Indicates k subsets, Indicates the first data set k data, Indicates the first m+k data, Indicates the third data set m+k data, Represents the label, which is the first m+k data.

4. The fault diagnosis method of the grating array sensor according to claim 2, It is characterized in that The prediction model is trained in the following way: Based on a sample time series data set, determining a first training set and a first test set; the sample time series data set includes a first sample label; In each training process, the first training set is input into the first network to obtain a first prediction value output by the first network; the first network is a GRU network; Based on the mean square error between the first sample label and the first predicted value, updating the parameters of the first network to obtain an updated first network; After each training session, input the first test set into the updated first network to obtain a second prediction value output by the updated first network, and calculate the mean absolute error between the first sample label and the second prediction value; When the preset number of training times is reached, the network corresponding to the minimum mean absolute error is used as the prediction model.

5. The fault diagnosis method of the grating array sensor according to claim 1, It is characterized in that The fault identification model is trained in the following way: Determining a second training set and a second test set based on a sample residual data set, wherein the sample residual data set includes a second sample label; In each training process, the second training set is input into the second network to obtain a third prediction value output by the second network; the second network is a GRU network including a CBAM attention module; Based on the cross entropy between the second sample label and the third predicted value, updating the parameters of the second network to obtain an updated second network; After each training, input the second test set into the updated second network, obtain a fourth prediction value output by the updated second network, and calculate an F1 score between the second sample label and the fourth prediction value; When the preset number of training times is reached, the network corresponding to the maximum F1 score is used as the fault recognition model.

6. The fault diagnosis method of the grating array sensor according to claim 1, It is characterized in that After obtaining the fault identification result output by the fault identification model, the method further includes: When it is determined based on the fault identification result that the measurement data set has a fault, the measurement data set is compensated based on the prediction sequence data set.

7. The fault diagnosis method of the grating array sensor according to claim 2, It is characterized in that After constructing the time series data set based on the subset, the method further includes: The time series data set is normalized and standardized.

8. A fault diagnosis device for a grating array sensor, It is characterized in that include: A prediction module is used to input a time series data set into a prediction model to obtain a prediction series data set output by the prediction model; the time series data set is constructed based on a measurement data set collected by a grating array sensor; the prediction model is obtained by training based on a sample time series data set; An identification module, used for inputting the residual data set into the fault identification model to obtain a fault identification result output by the fault identification model; The fault identification model is obtained by training based on a sample residual data set; The residual data set is determined based on the label corresponding to the time series data set and the predicted sequence data set.

9. An electronic device, It is characterized in that comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the fault diagnosis method for the grating array sensor as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the fault diagnosis method for a grating array sensor according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • System, method and computer program product for fault detection and location in power grid

    CN109844549A

  • Fault diagnosis method for furnace body temperature sensor of flash furnace

    CN115615578A

  • Power distribution network line icing fault prediction method and device, equipment and storage medium

    CN116021981A

  • Gas turbine sensor failure detection utilizing a sparse coding methodology

    WO2016040082A1