Fault prediction method, electronic equipment and storage medium
By shielding the fault code training of the fault prediction network, fault prediction is performed based on the statistical values of the mechanical equipment operating parameters, which solves the problems of low accuracy and poor generalization ability of mechanical equipment fault prediction in the existing technology, and achieves accurate fault prediction and safety improvement.
Patent Information
- Application Number
- CN202510813382.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-09-23
AI Technical Summary
In the existing technology, mechanical equipment fault prediction suffers from the problems of imbalanced positive and negative sample ratios and too low negative sample ratio, which leads to poor model generalization ability and low prediction accuracy.
A masked self-attention layer is used to mask fault codes. The initial fault prediction network is trained based on the statistical values of the operating parameters of the engineering machinery equipment. The target fault prediction network is constructed. The nonlinear mapping relationship before and after the fault occurs is learned through the back propagation algorithm to achieve accurate fault prediction.
It improves the accuracy and efficiency of mechanical equipment failure prediction, prevents potential failures in advance, and improves equipment operation safety.
Smart Images

Figure CN120687985A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of fault prediction, and in particular to a fault prediction method, electronic device, and storage medium. Background Art
[0002] If mechanical equipment fails during operation, it can affect project progress and even cause safety accidents. Predicting possible mechanical equipment failures in advance allows for early repairs and elimination of potential failures.
[0003] Currently, traditional deep learning models are typically trained using either operating data or fault data from mechanical equipment. Using operating data as training samples results in an imbalance in the ratio of positive to negative samples, with a low proportion of negative samples. This can easily cause the trained model to miss or misjudge faults when predicting faults. Using fault data as training samples also results in poor generalization and foresight. Furthermore, traditional deep learning models have weak fitting capabilities, impacting the accuracy of fault prediction.
[0004] Therefore, there are certain limitations in the failure prediction of mechanical equipment in the existing technology. Summary of the Invention
[0005] The purpose of this application is to provide a fault prediction method, electronic device and storage medium to address the practical needs of the existing technology, which has certain limitations in the fault prediction of mechanical equipment.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows: In a first aspect, an embodiment of the present application provides a fault prediction method, the method comprising: Acquiring first operating data of a plurality of sample devices within an operating cycle, the first operating data including statistical values of a plurality of first operating parameters and a plurality of fault codes generated within the operating cycle, the fault codes being used to indicate fault types of the sample devices; Training a pre-constructed initial fault prediction network according to the first operating data of each of the sample devices to obtain a target fault prediction network, wherein the initial fault prediction network includes at least a masked self-attention layer, and the masked self-attention layer is used to mask each of the fault codes; Collecting second operating data of the device under test during an operating cycle, the second operating data including statistical values of a plurality of second operating parameters; The target fault prediction network predicts a fault result of the device under test based on the second operating data, where the fault result includes at least one fault type and a fault probability of each fault type.
[0007] As an optional implementation manner, the training of a pre-built initial fault prediction network based on the first operation data of each of the sample devices to obtain a target fault prediction network includes: encoding the first operating data of each of the sample devices to obtain input vector sequences, wherein the input vector sequences include statistical value vectors of each of the first operating parameters and fault code vectors corresponding to each of the fault codes; The initial fault prediction network is trained according to each of the input vector sequences to obtain the target fault prediction network.
[0008] As an optional implementation manner, encoding the first operating data of each sample device to obtain each input vector sequence includes: determining a first coding dimension according to the number of types of statistical values of each first operating parameter in the first operating data and the number of types of the fault codes; encoding the statistical values of the first operating parameters and the fault codes according to the first coding dimension to obtain statistical value vectors of the first operating parameters and fault code vectors; The statistical value vectors of each of the first operating parameters and each of the fault code vectors are used as the input vector sequence, wherein the length of the input vector sequence is the same as the first encoding dimension.
[0009] As an optional implementation manner, the training of the initial fault prediction network according to each of the input vector sequences to obtain the target fault prediction network includes: Iteratively adjusting the model parameters of the initial fault prediction network in training rounds corresponding to a plurality of sample devices according to each of the input vector sequences, so that at the end of each training round, the predicted loss value of the initial fault prediction network meets a preset condition or the number of iterations corresponding to each training round reaches a preset number; The initial fault prediction network at the end of the last training round is used as the target fault prediction network.
[0010] As an optional implementation, the iteratively adjusting the model parameters of the initial fault prediction network in training rounds corresponding to a plurality of sample devices according to each of the input vector sequences includes: In the current training round, the training data of the current training round is retrieved from the input vector sequence of the current sample device; Forward inputting the training data of the current training round into the initial fault prediction network, masking each of the fault code vectors through the masked self-attention layer, and obtaining each fault prediction loss value of the initial fault prediction network in the current training round; Reversely inputting each of the fault prediction loss values into the initial fault prediction network, and adjusting the weights and biases of each layer of the network in the initial fault prediction network; Iterative execution is performed until the prediction loss value output by the initial fault prediction network meets the preset condition, or the number of iterations of the current training round reaches the preset number corresponding to the current training round, and then the next training round of the current training round is entered, and the steps of forward input, fault prediction loss value calculation and back propagation are repeated until the last training round corresponding to the last sample device is traversed and ended.
[0011] As an optional implementation manner, retrieving the training data of the current training round from the input vector sequence of the current sample device includes: Get the positive and negative sample ratios preset by the user; According to the positive-negative sample ratio, positive samples and negative samples are retrieved from the input vector sequence of the current sample device, and the positive samples and the negative samples are used as training data for the current training round.
[0012] As an optional implementation manner, the extracting positive samples and negative samples from the input vector sequence of the current sample device according to the positive-negative sample ratio includes: Determine a first quantity and a second quantity according to the positive-negative sample ratio, wherein the first quantity is the number of positive samples to be retrieved, and the second quantity is the number of negative samples to be retrieved; Taking the first number of statistical value vectors of the first operating parameters preceding the fault code vector in the input vector sequence of the current sample device as the positive samples; The statistical value vectors of the second number of first operating parameters following the fault code vector in the input vector sequence of the current sample device are used as the negative samples.
[0013] As an optional implementation manner, after the target fault prediction network predicts the fault result of the device under test according to the second operation data, the method further includes: Determine whether the failure probability of each failure type of the device under test is greater than the corresponding preset threshold; If so, a fault prompt is generated and reported based on the fault type whose fault probability is greater than the corresponding preset threshold.
[0014] In a second aspect, an embodiment of the present application provides a fault prediction device, comprising: an acquisition module, configured to acquire first operating data of a plurality of sample devices within an operating cycle, the first operating data comprising statistical values of a plurality of first operating parameters and a plurality of fault codes generated within the operating cycle, the fault codes being used to indicate fault types of the sample devices; a training module, configured to train a pre-constructed initial fault prediction network based on the first operating data of each of the sample devices to obtain a target fault prediction network, wherein the initial fault prediction network includes at least a masked self-attention layer, and the masked self-attention layer is configured to mask each of the fault codes; The acquisition module is further configured to collect second operating data of the device under test during an operating cycle, wherein the second operating data includes statistical values of a plurality of second operating parameters; A prediction module is configured to predict, by the target fault prediction network, a fault result of the device under test based on the second operating data, wherein the fault result includes at least one fault type and a fault probability of each fault type.
[0015] As an optional implementation, the training module is specifically used to: encoding the first operating data of each of the sample devices to obtain input vector sequences, wherein the input vector sequences include statistical value vectors of each of the first operating parameters and fault code vectors corresponding to each of the fault codes; The initial fault prediction network is trained according to each of the input vector sequences to obtain the target fault prediction network.
[0016] As an optional implementation, the training module is specifically used to: determining a first coding dimension according to the number of types of statistical values of each first operating parameter in the first operating data and the number of types of the fault codes; encoding the statistical values of the first operating parameters and the fault codes according to the first coding dimension to obtain statistical value vectors of the first operating parameters and fault code vectors; The statistical value vectors of each of the first operating parameters and each of the fault code vectors are used as the input vector sequence, wherein the length of the input vector sequence is the same as the first encoding dimension.
[0017] As an optional implementation, the training module is specifically used to: Iteratively adjusting the model parameters of the initial fault prediction network in training rounds corresponding to a plurality of sample devices according to each of the input vector sequences, so that at the end of each training round, the predicted loss value of the initial fault prediction network meets a preset condition or the number of iterations corresponding to each training round reaches a preset number; The initial fault prediction network at the end of the last training round is used as the target fault prediction network.
[0018] As an optional implementation, the training module is specifically used to: In the current training round, the training data of the current training round is retrieved from the input vector sequence of the current sample device; Forward inputting the training data of the current training round into the initial fault prediction network, masking each of the fault code vectors through the masked self-attention layer, and obtaining each fault prediction loss value of the initial fault prediction network in the current training round; Reversely inputting each of the fault prediction loss values into the initial fault prediction network, and adjusting the weights and biases of each layer of the network in the initial fault prediction network; Iterative execution is performed until the prediction loss value output by the initial fault prediction network meets the preset condition, or the number of iterations of the current training round reaches the preset number corresponding to the current training round, and then the next training round of the current training round is entered, and the steps of forward input, fault prediction loss value calculation and back propagation are repeated until the last training round corresponding to the last sample device is traversed and ended.
[0019] As an optional implementation, the training module is specifically used to: Get the positive and negative sample ratios preset by the user; According to the positive-negative sample ratio, positive samples and negative samples are retrieved from the input vector sequence of the current sample device, and the positive samples and the negative samples are used as training data for the current training round.
[0020] As an optional implementation, the training module is specifically used to: Determine a first quantity and a second quantity according to the positive-negative sample ratio, wherein the first quantity is the number of positive samples to be retrieved, and the second quantity is the number of negative samples to be retrieved; Taking the first number of statistical value vectors of the first operating parameters preceding the fault code vector in the input vector sequence of the current sample device as the positive samples; The statistical value vectors of the second number of first operating parameters following the fault code vector in the input vector sequence of the current sample device are used as the negative samples.
[0021] As an optional implementation, the fault prediction device further includes: a generation module; the generation module is configured to: Determine whether the failure probability of each failure type of the device under test is greater than the corresponding preset threshold; If so, a fault prompt is generated and reported based on the fault type whose fault probability is greater than the corresponding preset threshold.
[0022] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform the steps of the fault prediction method described in the first aspect above.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the fault prediction method described in the first aspect are executed.
[0024] The beneficial effects of this application are: The present application provides a fault prediction method, electronic device, and storage medium. Based on the type of sample devices, first operating data is obtained for multiple sample devices within an operating cycle, including statistical values of multiple first operating parameters and multiple fault codes generated within the operating cycle. The first operating parameters are physically related to the types of faults that are prone to occur with the device type. An initial fault prediction network is constructed based on the characteristics of the first operating data for each sample device and the fault prediction scenario for engineering machinery equipment. The initial fault prediction network is trained using a backpropagation algorithm based on each first operating data. Masked self-attention within the initial fault prediction network masks the locations of the fault codes in the first operating data, allowing the initial fault prediction network to perform fault predictions based solely on the statistical values of each first operating parameter. This prevents the initial fault prediction network from relying on the fault codes and affecting training results. The initial fault prediction network at the end of training is used as the target fault prediction network. Second operating data is obtained for a device under test of the same type as the sample device within an operating cycle, including statistical values of multiple second operating parameters. The target fault prediction network generates a fault result for the device under test based on the statistical values of each second operating parameter, including each fault type and the probability of each fault type occurring. Achieve early and accurate fault prediction of the equipment under test to prevent faults in advance and improve the safety of equipment operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 1 ; Figure 2Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 2 ; Figure 3 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 3 ; Figure 4 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 4 ; Figure 5 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 5 ; Figure 6 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 6 ; Figure 7 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 7 ; Figure 8 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 8 ; Figure 9 A module structure diagram of a fault prediction device provided in an embodiment of the present application; Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of illustration and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art, under the guidance of the contents of this application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0028] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0029] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0030] In the field of engineering machinery, in order to eliminate the potential failure risks of mechanical equipment, it is necessary to predict possible failures of mechanical equipment in advance. Currently, the operating data or fault data of mechanical equipment are usually used as training samples to train traditional deep learning models. When using the operating data of mechanical equipment as training samples, there are disadvantages such as an imbalance in the ratio of positive and negative samples and an excessively low ratio of negative samples, which can easily lead to the model missing faults or misjudging them when predicting faults. When using fault data as training samples, there are disadvantages such as poor generalization and foresight of the model. In addition, the fitting ability of traditional deep learning models is weak, which affects the accuracy of fault prediction. In other words, the fault prediction of mechanical equipment in the existing technology has certain limitations.
[0031] Based on the above-mentioned problems, an embodiment of the present application proposes a fault prediction method. Based on the data before and after the equipment failure, an initial fault prediction model is trained to obtain a trained target fault prediction network. The target fault prediction network predicts the probability of each type of failure occurring in each device under test, so as to eliminate the potential risks of the equipment in advance, improve the accuracy and efficiency of fault prediction, and thus improve the safety of equipment operation.
[0032] Figure 1 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 1 The execution subject of this method can be any electronic device with computing and processing capabilities. Figure 1 As shown, the method includes: S101. Acquire first operating data of a plurality of sample devices within an operating cycle, where the first operating data includes statistical values of a plurality of first operating parameters and a plurality of fault codes generated within the operating cycle, where the fault codes are used to indicate fault types of the sample devices.
[0033] Optionally, various operating condition data of multiple sample devices are collected during their operating cycles. The operating condition data includes various operating condition parameters corresponding to the sample device type and fault codes corresponding to the fault types generated by self-test when a fault occurs in the sample device during the operating cycle. For example, the fault type corresponding to fault code 001 is excessive oil temperature. Statistical values of various operating condition parameters corresponding to the sample device type are obtained through statistical value calculation, including the mean, mean square error, maximum value, minimum value, and maximum gradient of the operating condition parameters. The statistical values of various operating condition parameters corresponding to the sample device type are used as the statistical values of each first operating parameter, and the statistical values of each first operating parameter and each fault code generated during the operating cycle are used as the first operating data of the sample device during the operating cycle.
[0034] The multiple sample devices are engineering machinery of the same type that have experienced a fault. The operation cycle encompasses the entire operation process of the engineering machinery, from normal operation upon power-up, to abnormal operation upon the occurrence of the fault, to the end of operation upon power-down. That is, the first operating data of the sample devices within the operation cycle includes the operating conditions of the sample devices before, during, and after the fault.
[0035] Specifically, in the specific scenario of engineering machinery equipment failure prediction, based on the different types of engineering machinery equipment, various operating parameters corresponding to the type of engineering machinery equipment are collected. These operating parameters are physically related to the type of failure that is prone to occur in this type of engineering machinery equipment. For example, based on the prior knowledge of the equipment failure type, for power-type engineering machinery equipment, operating parameters such as engine speed, torque, throttle opening, oil temperature, and coolant temperature are collected. For hydraulic-type engineering machinery equipment, operating parameters such as pump pressure, solenoid valve opening, and hydraulic oil temperature are collected. For electrical-type engineering machinery equipment, operating parameters such as system voltage can be collected. For example, if the engineering machinery equipment is a crane, the lifting weight, which is a working parameter related to the equipment type of the crane, can be added to the working parameter type. If the engineering machinery equipment is an excavator, the crushing mode, which is a working parameter related to the equipment type of the excavator, can be added to the working parameter type.
[0036] S102. Train a pre-built initial fault prediction network based on the first operating data of each sample device to obtain a target fault prediction network, wherein the initial fault prediction network includes at least a masked self-attention layer, and the masked self-attention layer is used to mask each fault code.
[0037] Optionally, based on the characteristics of the first operating data of each sample device and the specific scenario of engineering machinery fault prediction, an initial fault prediction network is constructed. The initial fault prediction network is a variant of the Transformer network, retaining only the decoder portion of the Transformer network and removing the encoder portion, resulting in a lightweight initial fault prediction network. The initial fault prediction network also includes at least a mask self-attention layer.
[0038] Based on the first operating data of each sample device, the initial fault prediction network is trained using a backpropagation algorithm. During model training, the fault codes in the first operating data are actively masked using a masked self-attention layer, so that the initial fault prediction network performs fault predictions based solely on the statistical values of each first operating parameter in the first operating data. This prevents the initial fault prediction network from relying on the fault codes during training, which could affect the training effect of the initial fault prediction network. The initial fault prediction network is forced to deeply learn the nonlinear mapping relationship between the statistical values of each first operating parameter and the fault type indicated by the fault code. By actively masking the fault codes in the first operating data using a masked self-attention layer, the initial fault prediction network avoids performing statistical value predictions for the statistical values of each first operating parameter, outputting only the fault prediction results and training the initial fault prediction network based on the fault prediction results. By eliminating the predictions for the statistical values, model training efficiency is improved.
[0039] Furthermore, because the first operating data of the sample device within its operating cycle includes the operating conditions of the sample device before, during, and after a fault, when training the initial fault prediction network, the initial fault prediction network can learn the nonlinear mapping relationship between the statistical values of the first operating parameters before and after a fault occurs and the fault type indicated by the fault code. The initial fault prediction model extracts the sudden change comparison characteristics of the statistical values of each first operating parameter of the sample device before and after a fault occurs. The initial fault prediction network at the end of training is used as the target fault prediction network, allowing the target fault prediction network to accurately predict faults based on the statistical values of the operating parameters.
[0040] S103: Collect second operating data of the device under test within an operating cycle, where the second operating data includes statistical values of a plurality of second operating parameters.
[0041] Optionally, various operating condition data of the device under test during its operating cycle are collected, the operating condition data including various operating condition parameters corresponding to the device under test. The device under test and the sample device are of the same type of engineering machinery, and the device under test is a non-faulty piece of engineering machinery. Because the device under test and the sample device are of the same type, the types of the various operating condition parameters corresponding to the device under test are also the same as the types of the various operating condition parameters corresponding to the sample device.
[0042] Accordingly, statistical values are calculated for each operating parameter corresponding to the type of equipment under test, including the mean, mean square error, maximum value, minimum value, and maximum gradient of the operating parameters. The statistical values of each operating parameter corresponding to the type of equipment under test are used as the statistical values of each second operating parameter, and the statistical values of each second operating parameter are used as the second operating data for the equipment under test during the operating cycle. In other words, if the equipment under test is considered to be engineering machinery that has not experienced a fault, the second operating data does not include fault codes corresponding to the fault types generated by the equipment under test's self-test.
[0043] S104 : The target fault prediction network predicts a fault result of the device under test based on the second operating data. The fault result includes at least one fault type and a failure probability of each fault type.
[0044] Optionally, the target fault prediction network performs inference calculations based on the statistical values of each second operating parameter in the second operating data. By learning the nonlinear mapping relationship between the statistical values of the operating parameters before the fault occurs and the fault type indicated by the fault code, it extracts the sudden change comparison characteristics of the statistical values of the operating parameters before and after the fault of the device under test, and predicts and generates the fault results of the device under test, including each fault type and the probability of each fault type. This enables early and accurate fault prediction of the device under test, allowing operation and maintenance personnel to prevent the occurrence of this type of fault in advance based on the fault results of the device under test, avoiding safety hazards and losses caused by subsequent repairs.
[0045] Specifically, the target fault prediction network performs accurate fault prediction based on the statistical value of the second operating parameter, mines the association between the statistical value of the second operating parameter and the fault result, and obtains the fault probability of multiple fault types. For example, the target fault prediction network extracts the characteristics of temperature increase and speed fluctuation in the statistical value of the operating parameter, and predicts that there may be a risk of motor overload; the target fault prediction network extracts the characteristics of bearing tension stress change in the statistical value of the operating parameter, and predicts that there may be a risk of bearing wear. The target fault prediction network outputs the prediction result of the device under test: the types of faults that will occur in the device under test include motor overload fault and bearing wear fault, and the probability of motor overload fault is 75%, and the probability of bearing wear fault is 20%. Combined with the prediction results of the device under test output by the target fault prediction network, operation and maintenance personnel can inspect and maintain the motor and bearings of the device under test in advance before faults such as motor overload and bearing wear occur.
[0046] In this embodiment, based on the type of sample device, first operating data is obtained for multiple sample devices during their operating cycles, including statistical values of multiple first operating parameters and multiple fault codes generated during the operating cycles. The first operating parameters are physically related to the fault types that are most likely to occur with the device type. An initial fault prediction network is constructed based on the characteristics of the first operating data for each sample device and the fault prediction scenario for engineering machinery equipment. The initial fault prediction network is trained using a backpropagation algorithm based on each first operating data. Masked self-attention within the initial fault prediction network masks the locations of the fault codes in the first operating data, allowing the initial fault prediction network to perform fault predictions based solely on the statistical values of the first operating parameters. This prevents the initial fault prediction network from relying on fault codes and affecting training effectiveness. The initial fault prediction network at the end of training is used as the target fault prediction network. Second operating data is obtained for a device under test (DUT) of the same type as the sample device during its operating cycle, including statistical values of multiple second operating parameters. Based on the statistical values of the second operating parameters, the target fault prediction network predicts and generates fault results for the DUT, including each fault type and the probability of each fault type occurring. This enables accurate and early fault prediction for the DUT, preventing failures from occurring and improving equipment operational safety.
[0047] The following describes in detail the process of training a pre-built initial fault prediction network based on the first operating data of each sample device to obtain a target fault prediction network.
[0048] Figure 2 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 2 ,like Figure 2 As shown, in the above step S102, the pre-built initial fault prediction network is trained according to the first operation data of each sample device to obtain a target fault prediction network, including: S201 : Encode the first operating data of each sample device to obtain each input vector sequence, where the input vector sequence includes a statistical value vector of each first operating parameter and a fault code vector corresponding to each fault code.
[0049] Optionally, the first operating data of each sample device is encoded, and the statistical values of each first operating parameter and the fault code in each first operating data are converted into numerical vectors processable by the initial fault prediction network, thereby obtaining statistical value vectors corresponding to the statistical values of each first operating parameter and fault code vectors corresponding to each fault code. The statistical value vectors of each first operating parameter and the fault code vectors corresponding to each fault code are then combined into input vector sequences and uploaded to the cloud platform for storage in a database.
[0050] Specifically, the statistical values of each first operating parameter and the fault code in each first operating data are encoded in the same dimension, and padding values are introduced during encoding to obtain each input vector sequence of fixed length. Exemplarily, the padding value can be 0.
[0051] S202: Train the initial fault prediction network according to each input vector sequence to obtain a target fault prediction network.
[0052] Optionally, an initial fault prediction network is trained using a backpropagation algorithm based on each input vector sequence. The masked self-attention layer of the initial fault prediction network actively masks the location of each fault code vector in each input vector sequence using a mask matrix, forcing the initial fault prediction network to perform "blind" fault prediction based solely on the statistical value vectors of each first operating parameter in each input vector sequence, independent of the fault code vectors. This forces the initial fault prediction network to deeply learn the nonlinear mapping relationship between the statistical value vectors of each first operating parameter and the fault type indicated by the fault code. This also prevents the initial fault prediction network from predicting statistical values based on the statistical value vectors of each first operating parameter, thereby improving model training efficiency.
[0053] The initial fault prediction network at the end of training is used as the target fault prediction network. The target fault prediction network accurately learns the nonlinear mapping relationship between the statistical value vectors of each first operating parameter before and after a fault occurs and the fault type indicated by the fault code. This allows the target fault prediction network to extract the mutation comparison characteristics of the statistical value vectors of each first operating parameter before and after the failure of the sample device. This allows the target fault prediction network to subsequently perform accurate fault prediction based on the statistical value vectors of the operating parameters, improving fault prediction efficiency and accuracy.
[0054] In this embodiment, the first operating data of each sample device is encoded separately. The statistical values of each first operating parameter and the fault code in each first operating data are converted into statistical value vectors corresponding to the statistical values of each first operating parameter and fault code vectors corresponding to each fault code. These are then integrated to form input vector sequences. Based on each input vector sequence, an initial fault prediction network is trained using a backpropagation algorithm. The initial fault prediction network at the end of training serves as the target fault prediction network. This enables the target fault prediction network to accurately predict faults based on the statistical value vectors of the operating parameters, thereby improving fault prediction efficiency and accuracy.
[0055] The following describes in detail the process of encoding the first operating data of each sample device to obtain each input vector sequence.
[0056] Figure 3 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 3 ,like Figure 3As shown, in the above step S201, the first operation data of each sample device is encoded to obtain each input vector sequence, including: S301 : Determine a first coding dimension according to the number of types of statistical values of first operating parameters and the number of types of fault codes in first operating data.
[0057] Optionally, the number of types of statistical values of each first operating parameter and the number of types of fault codes in the first operating data are determined, and the first coding dimension is determined by rounding up the sum of the number of types of statistical values of each first operating parameter and the number of types of fault codes.
[0058] For example, if the statistical values include mean, mean square error, maximum, minimum, and maximum gradient, and the fault codes include 001, 002, and 003, the sum is 8, which is rounded up to obtain the first encoding dimension of 16. If the sum is greater than 16 and less than or equal to 32, the first encoding dimension is 32.
[0059] S302 : Encode the statistical value of each first operating parameter and each fault code according to the first coding dimension to obtain a statistical value vector of each first operating parameter and a fault code vector.
[0060] Optionally, according to the first coding dimension, the statistical values of each first operating parameter are vector-converted to statistical value vectors corresponding to the statistical values of each first operating parameter in the first coding dimension. Correspondingly, according to the first coding dimension, the fault codes are vector-converted to fault code vectors corresponding to each fault code in the first coding dimension.
[0061] For example, the statistical value of each first operating parameter is converted into a 16-dimensional statistical value vector of each first operating parameter, and each fault code is converted into a 16-dimensional fault code vector.
[0062] S303 : Taking the statistical value vectors of each first operating parameter and each fault code vector as an input vector sequence, wherein the length of the input vector sequence is the same as the first coding dimension.
[0063] Optionally, the statistical value vectors of each first operating parameter and each fault code vector are integrated into an input vector sequence to obtain an input vector sequence of fixed length, and the length of the input vector sequence is the same as the first encoding dimension.
[0064] For example, if the first encoding dimension is 16, the length of the input vector sequence is also fixed to 16. To unify the input sequence length, a padding value of 0 is introduced during encoding to align the input sequence lengths of each sample device and achieve standardized processing of the model input.
[0065] That is to say, the data is encoded and vectorized before being input into the initial fault prediction network. The encoded and vectorized data is directly input into the initial fault prediction network. There is no need for position encoding in the lightweight architecture of the initial fault prediction network, which improves the efficiency of model training.
[0066] In this embodiment, the first coding dimension is determined based on the number of types of statistical values of each first operating parameter and the number of types of fault codes in the first operating data. According to the first coding dimension, the statistical value of each first operating parameter is vectorized and converted into a statistical value vector corresponding to the statistical value of each first operating parameter of the first coding dimension. And according to the first coding dimension, each fault code is vectorized and converted into a fault code vector corresponding to each fault code of the first coding dimension. The statistical value vectors of each first operating parameter and each fault code vector are integrated into an input vector sequence to obtain an input vector sequence of fixed length, and the length of the input vector sequence is the same as the first coding dimension. The data is encoded and vectorized before being input into the initial fault prediction network, so that position encoding is not required in the initial fault prediction network with a lightweight architecture, thereby improving the efficiency of model training.
[0067] It is worth noting that, after collecting the second operating data of the device under test during the operating cycle, the second operating data of the device under test is encoded and processed to obtain a sequence of input vectors to be tested, and the sequence of input vectors to be tested includes a statistical value vector corresponding to the statistical value of the second operating parameter. Specifically, the second encoding dimension is determined by rounding up according to the number of types of statistical values of each second operating parameter in the second operating data. The second encoding dimension may be the same as the first encoding dimension. According to the second encoding dimension, the statistical value of each second operating parameter is vector-converted and converted into a statistical value vector corresponding to the statistical value of each second operating parameter of the second encoding dimension, and the statistical value vector corresponding to the statistical value of the second operating parameter is input as the sequence of input vectors to be tested into the target fault prediction network for fault prediction.
[0068] The following describes in detail the process of training the initial fault prediction network according to each input vector sequence to obtain the target fault prediction network.
[0069] Figure 4 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 4 ,like Figure 4 As shown, in the above step S202, the initial fault prediction network is trained according to each input vector sequence to obtain the target fault prediction network, including: S401. Iteratively adjust the model parameters of the initial fault prediction network in training rounds corresponding to multiple sample devices according to each input vector sequence, so that the prediction loss value of the initial fault prediction network at the end of each training round meets a preset condition or the number of iterations corresponding to each training round reaches a preset number.
[0070] Optionally, based on the input vector sequence of each sample device, the initial fault prediction network is recursively trained on devices of the same type through the training rounds corresponding to each sample device, so that the initial fault prediction network learns the common fault characteristics of devices of the same type during the recursive training of devices of the same type, rather than relying solely on the special fault characteristics of a single sample device.
[0071] Specifically, based on the input vector sequence of a single sample device, the initial fault prediction network is trained separately through the training round corresponding to the sample device, the prediction loss value of the initial fault prediction network is calculated, and the model parameters are adjusted based on the prediction loss value using the back propagation algorithm until the prediction loss value of the initial fault prediction network meets the preset conditions or the number of iterations corresponding to this training round reaches the preset number. This training round ends, indicating that the training of the initial fault prediction network for the single sample device is completed.
[0072] All sample devices of the same type are traversed. After each sample device is trained, its trained model parameters are used as the initialization parameters for the next sample device training. Transfer learning training is performed on the initial fault prediction network until the initial fault prediction network training for all sample devices of the same type is completed.
[0073] S402: Using the initial fault prediction network at the end of the last training round as the target fault prediction network.
[0074] Optionally, after the initial fault prediction network for all sample devices of the same type is trained, the initial fault prediction network at the end of the last training round is used as the target fault prediction network. Through recursive training on devices of the same type, the target fault prediction network learns the common fault characteristics of devices of the same type, avoiding overfitting to a single device and improving generalization capabilities.
[0075] In other words, the target fault prediction network can be used to accurately predict the fault type and failure probability of equipment of the same type. When the equipment type changes, it is necessary to predict the fault based on the new target fault prediction network corresponding to the new equipment type, thereby improving the specificity of the equipment type during fault prediction and thus improving the accuracy of fault prediction for equipment of the same type.
[0076] In this embodiment, based on the input vector sequence of each sample device, the initial fault prediction network is recursively trained for devices of the same type through training rounds corresponding to each sample device. The model parameters of the initial fault prediction network are iteratively adjusted in training rounds corresponding to multiple sample devices. During recursive training on devices of the same type, the initial fault prediction network learns the common fault characteristics of devices of the same type, avoiding reliance on the specific fault characteristics of a single sample device. All sample devices of the same type are traversed, and the model parameters trained after each sample device are trained are used as the initialization parameters for training the next sample device. Transfer learning training is performed on the initial fault prediction network until the initial fault prediction network is fully trained for all sample devices of the same type. The initial fault prediction network at the end of the last training round is used as the target fault prediction network. Through recursive training on devices of the same type, the target fault prediction network learns the common fault characteristics of devices of the same type, avoiding overfitting on a single device and improving generalization capabilities. This also improves the fault prediction accuracy of the target fault prediction network for devices of the same type.
[0077] The following describes in detail the process of iteratively adjusting the model parameters of the initial fault prediction network in training rounds corresponding to multiple sample devices according to each input vector sequence.
[0078] Figure 5 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 5 ,like Figure 5 As shown, in the above step S401, the model parameters of the initial fault prediction network are iteratively adjusted in the training rounds corresponding to the multiple sample devices according to each input vector sequence, including: S501 . In the current training round, retrieve the training data of the current training round from the input vector sequence of the current sample device.
[0079] Optionally, taking the current training round as an example, the training process of the initial fault prediction network of the current single sample device is described, and the training process of other training rounds is consistent with the training process of the current training round.
[0080] In the current training round, training data of the current training round is retrieved from the input vector sequence of the current sample device, wherein the training data is used to vectorize the operating conditions of the current sample device before and after a failure occurs.
[0081] S502: forward input the training data of the current training round into the initial fault prediction network, mask each fault code vector through the masked self-attention layer, and obtain each fault prediction loss value of the initial fault prediction network under the current training round.
[0082] Optionally, in the current training round, the training data of the current training round is forward input into the initial fault prediction network, and the masked self-attention layer in the initial fault prediction network temporarily masks the fault code vectors in the training data through a mask operation based on the mask matrix, and only retains the statistical value vectors of each first operating parameter in the training data.
[0083] When the fault code vector is masked, the initial fault prediction network predicts the fault probability of each fault type based solely on the statistical value vector of each first operating parameter in the training data. The difference between the predicted fault probability of each fault type and 1 is used as the fault prediction loss value of the initial fault prediction network in the current training round.
[0084] By masking each fault code vector through the mask matrix, the initial fault prediction network can be forced to learn fault prediction capabilities only from the statistical value of the first operating parameter, avoiding direct dependence on the fault code and improving the model's ability to capture and infer fault characteristics.
[0085] S503: Input each fault prediction loss value back into the initial fault prediction network, and adjust the weight and bias of each layer of the network in the initial fault prediction network.
[0086] Optionally, each fault prediction loss value is fed back into the initial fault prediction network. During the backpropagation process, the backpropagation algorithm is used to calculate the error gradients of each layer of the initial fault prediction network. Based on the error gradients, the weights and biases of each layer of the initial fault prediction network are adjusted.
[0087] Specifically, during the backpropagation process, the initial fault prediction network updates the weights and biases of each layer of the network according to the error gradient of each layer of the network, in the opposite direction of the error gradient, so that the loss value of each fault prediction is continuously reduced.
[0088] S504. Iterate until the prediction loss value output by the initial fault prediction network meets the preset conditions, or the number of iterations of the current training round reaches the preset number corresponding to the current training round, enter the next training round of the current training round, and repeat the steps of forward input, fault prediction loss value calculation and back propagation until the last training round corresponding to the last sample device is traversed and ends.
[0089] Optionally, in the current training round, the steps of forward input, prediction loss calculation, backpropagation, and model parameter adjustment are repeated to iteratively train the initial fault prediction network. Each iteration results in better model parameters for the initial fault prediction network and smaller prediction loss values for each fault output. This means that the predicted fault type with a higher probability is more similar to the fault type indicated by the fault code.
[0090] Whether to end the current training round is determined based on whether the fault prediction loss values output after each iteration in the current training round meet the preset conditions or whether the number of iterations of the current training round reaches the preset number corresponding to the current training round.
[0091] Specifically, when the prediction loss value output by the initial fault prediction network meets a preset condition, or the number of iterations of the current training round reaches the preset number corresponding to the current training round, the model training for the current sample device in the current training round is terminated to prevent overfitting. The next training round of the current training round is entered, and the model parameters of the initial fault prediction after the end of the current training round are used as the initialization parameters of the initial fault prediction in the next training round. The steps of forward input of training data for the next sample device, calculation of the fault prediction loss value, and backpropagation are repeated, traversing all sample devices of the same type until the last training round corresponding to the last sample device is reached.
[0092] Complete the recursive training of the initial fault prediction network for all sample devices of the same type, so that the target fault prediction network obtained at the end of the last training round can learn the common fault characteristics of devices of the same type, so that the target fault prediction network corresponding to the device type can accurately predict the fault results of the device under test of this device type.
[0093] In this embodiment, in the current training round, training data for the current training round is retrieved from the input vector sequence of the current sample device. The training data for the current training round is forward-inputted into the initial fault prediction network. Each fault code vector is masked through a masked self-attention layer to obtain the fault prediction loss values of the initial fault prediction network for the current training round and then reverse-inputted into the initial fault prediction network. The weights and biases of each layer of the initial fault prediction network are adjusted. When the prediction loss value output by the initial fault prediction network meets a preset condition or the number of iterations of the current training round reaches a preset number corresponding to the current training round, the current training round ends to prevent overfitting. The next training round is then entered, and the steps of forward-inputting training data for the next sample device, calculating the fault prediction loss value, and backpropagating are repeated, traversing all sample devices of the same type until the last training round corresponding to the last sample device is reached. By recursively training the initial fault prediction network for all sample devices of the same type, the target fault prediction network learns the common fault characteristics of devices of the same type, improving the prediction accuracy of the target fault prediction network.
[0094] The following describes in detail the process of retrieving the training data for the current training round from the input vector sequence of the current sample device.
[0095] Figure 6 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 6 ,like Figure 6 As shown, in the above step S501, the training data of the current training round is retrieved from the input vector sequence of the current sample device, including: S601: Obtain the positive and negative sample ratios preset by the user.
[0096] Optionally, the user pre-sets a balanced ratio of positive and negative samples based on the failure requirements corresponding to the type of sample device, wherein the positive samples are used to describe the operation of the sample device before the failure occurs, and the negative samples are used to describe the operation of the sample device after the failure occurs.
[0097] By obtaining the positive and negative sample ratios pre-set by the user, the balance of positive and negative samples can be ensured, thereby improving the detection rate of the model and the accuracy of fault prediction.
[0098] S602: According to the ratio of positive and negative samples, retrieve positive samples and negative samples from the input vector sequence of the current sample device, and use the positive samples and negative samples as training data for the current training round.
[0099] Optionally, positive samples and negative samples are extracted from the input vector sequence of the current sample device according to the positive and negative sample ratio preset by the user, and the positive samples and negative samples are used as training data for the current training round, that is, a training batch of the current training round.
[0100] By using positive samples of the fault-free operation conditions and negative samples of the faulty operation conditions based on the current sample equipment as the training data for the current training round, the initial fault prediction network includes comparative information of the operation conditions before and after the fault in the training data for the current training round, so that the initial fault prediction network can extract characteristic mutations before and after the fault occurs.
[0101] In this embodiment, a user-defined balanced ratio of positive and negative samples is obtained. Positive and negative samples are extracted from the input vector sequence of the current sample device according to this ratio, and these samples are used as training data for the current training round. This ensures that the initial fault prediction network includes comparative information about pre- and post-fault operating conditions in the training data for the current training round, allowing the initial fault prediction network to extract characteristic mutations before and after the fault occurs.
[0102] The following describes in detail the process of retrieving positive samples and negative samples from the input vector sequence of the current sample device according to the positive-negative sample ratio.
[0103] Figure 7 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 7 ,like Figure 7As shown, in the above step S602, according to the positive and negative sample ratio, the positive samples and negative samples are retrieved from the input vector sequence of the current sample device, including: S701. Determine a first quantity and a second quantity according to the ratio of positive and negative samples, wherein the first quantity is the number of positive samples to be retrieved, and the second quantity is the number of negative samples to be retrieved.
[0104] Optionally, the first number and the second number are determined based on the fault prediction requirements corresponding to the type of sample equipment and the ratio of positive and negative samples. The first number represents the number of positive samples to be retrieved. , the second number represents the number of negative samples to be retrieved Among them, the number of positive samples to be retrieved Related to the accuracy and foresight of the prediction results output by the initial fault prediction network. The number of negative samples to be retrieved depends on the user's balance between the foresight and accuracy of fault prediction. Depends on the proportion of negative samples and the number of positive samples to be retrieved .
[0105] Specifically, the number of positive samples to be retrieved When it is larger, the prediction is more forward-looking, but the accuracy is lower, that is, the fault type will be predicted earlier, but the prediction result may be less consistent with the actual situation. When it is smaller, the prediction is less forward-looking but more accurate, that is, the fault type will be predicted later, but the prediction result is more consistent with the actual situation.
[0106] S702 : Take a first number of statistical value vectors of first operating parameters preceding the fault code vector in the input vector sequence of the current sample device as positive samples.
[0107] Optionally, the position of the fault code vector is determined in the input vector sequence of the current sample device, and the statistical value vectors of the first number of first operating parameters before the fault code vector are used as positive samples, that is, the statistical value vectors of the first number of first operating parameters before the fault code vector are used as positive samples. The statistical value vector of the first operating parameter is retrieved as a positive sample.
[0108] S703 : Take a second number of statistical value vectors of the first operating parameters following the fault code vector in the input vector sequence of the current sample device as negative samples.
[0109] Optionally, the statistical value vectors of the second number of the first operating parameters following the fault code vector are taken as negative samples, that is, the statistical value vectors of the second number of the first operating parameters following the fault code vector are taken as negative samples. The statistical value vector of the first running parameter is retrieved as a negative sample.
[0110] In the training data of the current training round, including the fault code vector before The statistical value vector of the first operating parameter and the fault code vector The statistical value vector of the first operating parameter is used to enable the initial fault prediction network to learn the characteristic mutations before and after the fault of the current sample device in the current training round.
[0111] In this embodiment, the first quantity and the second quantity are determined based on the accuracy and foresight requirements of the fault prediction corresponding to the type of sample device and the ratio of positive and negative samples. The first quantity represents the number of positive samples to be retrieved, and the second quantity represents the number of negative samples to be retrieved. The number of positive samples to be retrieved depends on the user's trade-off between foresight and accuracy of fault prediction, and the number of negative samples to be retrieved depends on the ratio of positive and negative samples and the number of positive samples to be retrieved. The position of the fault code vector is determined in the input vector sequence of the current sample device, and the statistical value vectors of the first operating parameters of the first quantity before the fault code vector are used as positive samples, and the statistical value vectors of the second quantity after the fault code vector are used as negative samples. This allows the initial fault prediction network to learn the characteristic mutations before and after the fault of the current sample device based on the positive samples and negative samples in the current training round.
[0112] Figure 8 Schematic diagram of the process of the fault prediction method provided in the embodiment of the present application Figure 8 ,like Figure 8 As shown, after the step of obtaining the fault result of the device under test by the target fault prediction network according to the second operation data in the above step S104, the method further includes: S801: Determine whether the failure probability of each failure type of the device under test is greater than the corresponding preset threshold.
[0113] Optionally, the failure probability of each fault type output by the target fault prediction network is compared with a preset threshold corresponding to each fault type to determine whether the failure probability of each fault type of the device under test is greater than the corresponding preset threshold. The preset threshold corresponding to each fault type can be set to the same threshold, or it can be differentiated by fault severity and maintenance cost. The preset threshold corresponding to each fault type is set separately based on factors such as fault severity and maintenance cost, with the higher the fault severity and maintenance cost, the lower the preset threshold corresponding to the fault type.
[0114] For example, the preset threshold corresponding to the motor overload fault and the preset threshold corresponding to the bearing wear are both set to 50%. Alternatively, since the severity and maintenance cost of the motor overload fault are higher than those of the bearing wear, the preset threshold corresponding to the motor overload fault is set to 60%, and the preset threshold corresponding to the bearing wear fault is set to 70%.
[0115] S802: If yes, generate and report a fault prompt according to the fault type whose fault probability is greater than the corresponding preset threshold.
[0116] Optionally, if the failure probability of each fault type of the device under test is determined to be greater than a corresponding preset threshold, indicating a high probability of each type of fault occurring in the device under test, a fault warning is triggered, and a fault prompt is generated for each fault type whose failure probability is greater than the corresponding preset threshold. The generated fault prompt is reported to the Industrial Internet of Things platform, which then pushes the fault prompt to operations and maintenance personnel, prompting them to proactively address the equipment failure.
[0117] The fault prompt includes at least the device identifier, the name of the fault type, the fault probability, and recommended actions. For example, if the predicted probability of a motor overload fault is 75%, which is greater than the preset threshold for motor overload, a motor overload fault prompt is generated to alert maintenance personnel that the probability of an impending motor overload fault on device S1 is 75%, and to initiate an immediate shutdown inspection.
[0118] Accordingly, if the failure probability of each fault type in the device under test is determined to be less than or equal to the corresponding preset threshold, indicating that the probability of each type of fault in the device under test is low, there is no need to trigger a fault warning. For example, if the predicted failure probability of a bearing wear fault is 20%, which is less than the preset threshold for bearing wear, no bearing wear fault warning will be generated.
[0119] In this embodiment, the failure probability of each fault type output by the target fault prediction network is compared with the preset threshold corresponding to each fault type to determine whether the failure probability of each fault type of the device under test exceeds the corresponding preset threshold. Based on the comparison results, a determination is made as to whether a fault warning should be triggered. If the failure probability of each fault type of the device under test is determined to be greater than the corresponding preset threshold, a fault warning is triggered. Fault prompts are generated and reported for the fault types with a failure probability greater than the corresponding preset threshold. This prompts operations and maintenance personnel to proactively address impending faults in the device under test and eliminate potential risks.
[0120] Based on the same inventive concept, the embodiments of the present application also provide a fault prediction device corresponding to the fault prediction method. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the above-mentioned fault prediction method in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0121] Figure 9 This is a module structure diagram of the fault prediction device provided in the embodiment of the present application, such as Figure 9 As shown, the device includes: The acquisition module 901 is used to acquire first operation data of multiple sample devices within an operation cycle. The first operation data includes statistical values of multiple first operation parameters and multiple fault codes generated within the operation cycle. The fault codes are used to indicate the fault type of the sample devices.
[0122] The training module 902 is used to train the pre-constructed initial fault prediction network according to the first operating data of each sample device to obtain a target fault prediction network, wherein the initial fault prediction network includes at least a masked self-attention layer, and the masked self-attention layer is used to mask each fault code.
[0123] The acquisition module 901 is further configured to collect second operating data of the device under test during an operating cycle, where the second operating data includes statistical values of a plurality of second operating parameters.
[0124] The prediction module 903 is configured to predict, by the target fault prediction network, a fault result of the device under test based on the second operating data. The fault result includes at least one fault type and a failure probability of each fault type.
[0125] As an optional implementation, the training module 902 is specifically configured to: The first operating data of each sample device is encoded to obtain each input vector sequence, where the input vector sequence includes a statistical value vector of each first operating parameter and a fault code vector corresponding to each fault code.
[0126] According to each input vector sequence, the initial fault prediction network is trained to obtain the target fault prediction network.
[0127] As an optional implementation, the training module 902 is specifically configured to: The first coding dimension is determined according to the number of types of statistical values of each first operating parameter in the first operating data and the number of types of fault codes.
[0128] According to the first coding dimension, the statistical value of each first operating parameter and each fault code are respectively coded to obtain a statistical value vector of each first operating parameter and a fault code vector.
[0129] The statistical value vectors of each first operating parameter and each fault code vector are used as an input vector sequence, wherein the length of the input vector sequence is the same as the first encoding dimension.
[0130] As an optional implementation, the training module 902 is specifically configured to: According to each input vector sequence, the model parameters of the initial fault prediction network are iteratively adjusted in the training rounds corresponding to the multiple sample devices so that the prediction loss value of the initial fault prediction network at the end of each training round meets the preset conditions or the number of iterations corresponding to each training round reaches the preset number.
[0131] The initial fault prediction network at the end of the last training round is used as the target fault prediction network.
[0132] As an optional implementation, the training module 902 is specifically configured to: In the current training round, the training data of the current training round is retrieved from the input vector sequence of the current sample device.
[0133] The training data of the current training round is forward-inputted into the initial fault prediction network, and each fault code vector is masked through the masked self-attention layer to obtain the fault prediction loss value of the initial fault prediction network under the current training round.
[0134] The fault prediction loss values are inputted back into the initial fault prediction network, and the weights and biases of each layer of the network in the initial fault prediction network are adjusted.
[0135] Iterate until the prediction loss value output by the initial fault prediction network meets the preset conditions, or the number of iterations of the current training round reaches the preset number corresponding to the current training round, enter the next training round of the current training round, and repeat the steps of forward input, fault prediction loss value calculation and back propagation until the last training round corresponding to the last sample device is traversed and ends.
[0136] As an optional implementation, the training module 902 is specifically configured to: Get the positive and negative sample ratios preset by the user.
[0137] According to the ratio of positive and negative samples, positive samples and negative samples are retrieved from the input vector sequence of the current sample device, and the positive samples and negative samples are used as training data for the current training round.
[0138] As an optional implementation, the training module is specifically used to: According to the ratio of positive and negative samples, a first number and a second number are determined, wherein the first number is the number of positive samples to be retrieved, and the second number is the number of negative samples to be retrieved.
[0139] A first number of statistical value vectors of first operating parameters preceding the fault code vector in the input vector sequence of the current sample device are taken as positive samples.
[0140] A second number of statistical value vectors of the first operating parameters following the fault code vector in the input vector sequence of the current sample device are used as negative samples.
[0141] As an optional implementation, the fault prediction device further includes: a generation module 904. The generation module 904 is used to: Determine whether the failure probability of each failure type of the device under test is greater than the corresponding preset threshold.
[0142] If so, a fault prompt is generated and reported based on the fault type whose fault probability is greater than the corresponding preset threshold.
[0143] The present application also provides an electronic device, such as Figure 10 FIG. 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, comprising: a processor 101, a memory 102 and a bus 103. The memory 102 stores machine-readable instructions executable by the processor 101 (e.g., Figure 9 In the device, the acquisition module 901, the training module 902, the prediction module 903 and the execution instructions corresponding to the generation module 904 are obtained, etc.). When the electronic device is running, the processor 101 communicates with the memory 102 through the bus 103. When the machine-readable instructions are executed by the processor 101, the steps of the fault prediction method in the above embodiment are executed.
[0144] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the fault prediction method in the above embodiment are executed.
[0145] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0146] In addition, the functional units in the various embodiments of the present application can be integrated into a single processing unit, each unit can exist physically separately, or two or more units can be integrated into a single unit. If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0147] The above is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the protection scope of the present application.
Claims
1. A fault prediction method, characterized in that: include: Acquiring first operating data of a plurality of sample devices within an operating cycle, the first operating data including statistical values of a plurality of first operating parameters and a plurality of fault codes generated within the operating cycle, the fault codes being used to indicate fault types of the sample devices; Training a pre-constructed initial fault prediction network according to the first operating data of each of the sample devices to obtain a target fault prediction network, wherein the initial fault prediction network includes at least a masked self-attention layer, and the masked self-attention layer is used to mask each of the fault codes; Collecting second operating data of the device under test during an operating cycle, the second operating data including statistical values of a plurality of second operating parameters; The target fault prediction network predicts a fault result of the device under test based on the second operating data, where the fault result includes at least one fault type and a fault probability of each fault type.
2. The method according to claim 1, characterized in that The step of training a pre-built initial fault prediction network based on the first operating data of each of the sample devices to obtain a target fault prediction network includes: encoding the first operating data of each of the sample devices to obtain input vector sequences, wherein the input vector sequences include statistical value vectors of each of the first operating parameters and fault code vectors corresponding to each of the fault codes; The initial fault prediction network is trained according to each of the input vector sequences to obtain the target fault prediction network.
3. The method according to claim 2, characterized in that The encoding process is performed on the first operating data of each of the sample devices to obtain each input vector sequence, including: determining a first coding dimension according to the number of types of statistical values of each first operating parameter in the first operating data and the number of types of the fault codes; encoding the statistical values of the first operating parameters and the fault codes according to the first coding dimension to obtain statistical value vectors of the first operating parameters and fault code vectors; The statistical value vectors of each of the first operating parameters and each of the fault code vectors are used as the input vector sequence, wherein the length of the input vector sequence is the same as the first encoding dimension.
4. The method according to claim 2, characterized in that The training of the initial fault prediction network according to each of the input vector sequences to obtain the target fault prediction network includes: Iteratively adjusting the model parameters of the initial fault prediction network in training rounds corresponding to a plurality of sample devices according to each of the input vector sequences, so that at the end of each training round, the predicted loss value of the initial fault prediction network meets a preset condition or the number of iterations corresponding to each training round reaches a preset number; The initial fault prediction network at the end of the last training round is used as the target fault prediction network.
5. The method according to claim 4, characterized in that The iteratively adjusting the model parameters of the initial fault prediction network in training rounds corresponding to a plurality of sample devices according to each of the input vector sequences includes: In the current training round, the training data of the current training round is retrieved from the input vector sequence of the current sample device; Forward inputting the training data of the current training round into the initial fault prediction network, masking each of the fault code vectors through the masked self-attention layer, and obtaining each fault prediction loss value of the initial fault prediction network in the current training round; Reversely inputting each of the fault prediction loss values into the initial fault prediction network, and adjusting the weights and biases of each layer of the network in the initial fault prediction network; Iterative execution is performed until the prediction loss value output by the initial fault prediction network meets the preset condition, or the number of iterations of the current training round reaches the preset number corresponding to the current training round, and then the next training round of the current training round is entered, and the steps of forward input, fault prediction loss value calculation and back propagation are repeated until the last training round corresponding to the last sample device is traversed and ended.
6. The method according to claim 5, characterized in that The step of retrieving the training data of the current training round from the input vector sequence of the current sample device includes: Get the positive and negative sample ratios preset by the user; According to the positive-negative sample ratio, positive samples and negative samples are retrieved from the input vector sequence of the current sample device, and the positive samples and the negative samples are used as training data for the current training round.
7. The method according to claim 6, characterized in that The extracting positive samples and negative samples from the input vector sequence of the current sample device according to the positive-negative sample ratio includes: Determine a first quantity and a second quantity according to the positive-negative sample ratio, wherein the first quantity is the number of positive samples to be retrieved, and the second quantity is the number of negative samples to be retrieved; Taking the first number of statistical value vectors of the first operating parameters preceding the fault code vector in the input vector sequence of the current sample device as the positive samples; The statistical value vectors of the second number of first operating parameters following the fault code vector in the input vector sequence of the current sample device are used as the negative samples.
8. The method according to claim 1, characterized in that After the target fault prediction network predicts the fault result of the device under test according to the second operating data, the method further includes: Determine whether the failure probability of each failure type of the device under test is greater than the corresponding preset threshold; If so, a fault prompt is generated and reported based on the fault type whose fault probability is greater than the corresponding preset threshold.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the fault prediction method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the fault prediction method according to any one of claims 1 to 8 are executed.
Citation Information
Patent Citations
Fault detection model training method, equipment fault detection method and related device
CN117670848A
Equipment fault recognition model training and fault recognition method and device and electronic equipment
CN117992790A
Fault prediction method and device, terminal equipment and readable storage medium
CN120029233A
Training method for fault detection model, device fault detection method and related apparatus
US20250191164A1