A method, apparatus, device and medium for predicting disk failure
Patent Information
- Application Number
- CN202311234826.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-09-22
AI Technical Summary
[0004]有鉴于此,本发明提出了一种磁盘故障预测的方法、装置、设备及介质,至少解决了基于浅层机器学习的方法和基于迁移学习的方法不适用于一些磁盘型号的有效数据较少,难以采集足够的训练数据的小规模数据场景以及依靠巡检或者监控的方式效率低下的问题
[0022]本发明至少具有以下有益效果:本发明提出一种磁盘故障预测的方法,通过对Transformer模型中的自注意力函数和位置编码中的位置常数进行改进,使之更关注靠近自己位置的信息,并保证运算速度。通过域对抗模型进行领域适应训练,减小较大规模数据集的源领域和较小规模数据集的目标领域之间的数据差异性,以适用于小规模数据集进行故障磁盘预测的场景,提高小规模数据集磁盘故障预测的准确性和效率。
Smart Images

Figure CN117407254B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for predicting disk failures. Background Technology
[0002] Disk failure is a common type of failure in data centers. It can lead to data loss, increased downtime, and even adverse effects on business operations. Therefore, it is necessary to predict disk failures in data centers in advance. Simply conducting inspections or monitoring of the data center cannot predict disk failures in a timely manner. Furthermore, as the amount of data in the data center continues to increase, relying on inspections or monitoring becomes inefficient and unable to handle disk failure detection with large data volumes.
[0003] In the field of disk failure prediction, shallow machine learning-based methods cannot effectively represent the relevant features of disks and cannot effectively learn the changes in the disk failure process over time. Transfer learning-based methods only consider the similarity of data. Both shallow machine learning-based and transfer learning-based methods are not suitable for small-scale data scenarios where there is little effective data for some disk models and it is difficult to collect enough training data. Summary of the Invention
[0004] In view of this, the present invention proposes a method, apparatus, device and medium for disk failure prediction, which at least solves the problems that shallow machine learning-based methods and transfer learning-based methods are not suitable for small-scale data scenarios with limited effective data for some disk models, making it difficult to collect enough training data, as well as the inefficiency of relying on inspection or monitoring methods.
[0005] To achieve the above objectives, one aspect of the present invention provides a method for disk failure prediction, comprising: obtaining a first dataset and a second dataset corresponding to a source domain and a target domain, respectively, based on disk failure labels; training a new Transformer model using the first dataset, based on an improved self-attention function of the Transformer model and a position constant in the position encoding of the disk, to predict the location of a disk failure in the source domain; training the new Transformer model using the first dataset and the second dataset based on a domain adversarial model to obtain training parameters suitable for training the new Transformer model on the second dataset; training the new Transformer model using the second dataset based on the training parameters and the new Transformer model to predict the location of a disk failure in the target domain; and performing disk failure prediction using the trained new Transformer model.
[0006] In some embodiments, the step of obtaining the first dataset and the second dataset corresponding to the source domain and the target domain respectively based on disk fault labels includes: continuously collecting a number of data based on disk fault labels for each disk in the source domain and the target domain and performing preprocessing to obtain the input sequences corresponding to each disk in the source domain and the target domain respectively as the first dataset and the second dataset.
[0007] In some embodiments, the step of training a new Transformer model based on the improved self-attention function of the Transformer model and the positional constant in the location encoding of the disk, using the first dataset, to predict the location of disk failures in the source domain includes: converting the input sequence corresponding to each disk in the source domain into a corresponding vector based on an attention mechanism; constructing a query vector, key vector, and value vector based on the vectors for calculating the attention weights corresponding to the disk; calculating the dot product of the query vector, key vector, and value vector to obtain the original self-attention function Attention1(Q,K,V) for calculating the attention weights of the disk, wherein the formula for the original self-attention function Attention1(Q,K,V) is as follows:
[0008]
[0009] Where Q is the query vector, K is the key vector, V is the value vector, and d k The length of the key vector. The attention score corresponding to the disk. The attention weights corresponding to the disk are defined; the parameters in the original attention function Attention1(Q,K,V) are deleted. The new self-attention function Attention 2(Q,K,V) is obtained, and its formula is as follows:
[0010] Attention 2(Q,K,V)=softmax(QK T V
[0011] Where Q is the query vector, K is the key vector, and V is the value vector, (QK T V is the attention score corresponding to the disk, and softmax(QK) T V represents the attention weight corresponding to the disk.
[0012] In some embodiments, the step of training a new Transformer model based on the self-attention function of the Transformer model and the position constant in the position encoding of the disk, using the first dataset, to predict the location of a disk failure in the source domain further includes: obtaining the location information of the disk among all disks in the source domain; performing position encoding on the location information to obtain the position encoding corresponding to the disk; and matching the position constant in the position encoding with the time period of the disk failure prediction, wherein the position encoding formula is as follows:
[0013]
[0014]
[0015] Where pos is the position of the disk among all disks in the source domain, i is the dimension of the position, and d model The dimension for output position encoding. Position coding based on sine functions of different frequencies, The position encoding is based on cosine functions of different frequencies, where C is a position constant and the actual value of C does not exceed 100.
[0016] In some embodiments, the step of training a new Transformer model based on the first dataset, which is derived by improving the self-attention function of the Transformer model and the position constant in the position encoding of the disk, to predict the location of the disk failure in the source domain further includes: obtaining a new Transformer model based on the new self-attention function Attention 2(Q,K,V) and the position encoding formula; and training the first dataset based on the new Transformer model to predict the location of the disk failure in the source domain.
[0017] In some embodiments, the step of training the second dataset based on the domain adversarial model using the first dataset and the second dataset to obtain training parameters suitable for training the second dataset based on the new Transformer model includes: inputting the first dataset and the second dataset into the domain discriminator in the domain adversarial model after gradient inversion to obtain common features between the first dataset and the second dataset; and obtaining training parameters suitable for training the second dataset based on the new Transformer model based on the common features.
[0018] In some embodiments, the step of continuously collecting several data points based on disk fault labels for each disk in the source and target domains and preprocessing them to obtain the input sequence corresponding to each disk in the source and target domains includes: continuously collecting several data points based on disk fault labels for each disk in the source and target domains; filling missing values in the data and performing normalization processing, and then filtering data that meets the correlation requirements with the disk fault labels to obtain the input sequence corresponding to each disk in the source and target domains.
[0019] In another aspect, this invention provides a disk failure prediction apparatus, comprising: a first module for obtaining a first dataset and a second dataset corresponding to a source domain and a target domain, respectively, based on disk failure labels; a second module for training a new Transformer model using the first dataset, based on an improved self-attention function of the Transformer model and a position constant in the disk's position encoding, to predict the location of a disk failure in the source domain; a third module for training a domain adversarial model using the first dataset and the second dataset to obtain training parameters suitable for training the new Transformer model on the second dataset; and a fourth module for training the second dataset based on the training parameters and the new Transformer model to predict the location of a disk failure in the target domain, and for performing disk failure prediction using the trained new Transformer model.
[0020] In another aspect of the present invention, an electronic device is provided, including at least one processor; and a memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the above-described method.
[0021] In another aspect of the present invention, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the method steps described above.
[0022] This invention offers at least the following advantages: It proposes a method for disk failure prediction by improving the self-attention function and positional constant in the positional encoding of the Transformer model, making them more attentive to information closer to their own location while maintaining computational speed. Furthermore, it utilizes a domain adversarial model for domain adaptation training, reducing the data disparity between the source domain of large-scale datasets and the target domain of smaller datasets. This makes it suitable for scenarios involving disk failure prediction on small-scale datasets, thereby improving the accuracy and efficiency of disk failure prediction on small datasets. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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 embodiments can be obtained based on these drawings without creative effort.
[0024] Figure 1 The flowchart shown is a method for disk failure prediction provided by an embodiment of the present invention;
[0025] Figure 2 The diagram shown is another flowchart for disk failure prediction provided in an embodiment of the present invention;
[0026] Figure 3 The diagram shown illustrates the process of training a disk failure prediction model provided in an embodiment of the present invention.
[0027] Figure 4 The diagram shown is a schematic representation of a disk failure prediction device provided in an embodiment of the present invention;
[0028] Figure 5 The diagram shown is a schematic representation of an electronic device provided in an embodiment of the present invention;
[0029] Figure 6 The diagram shown is a schematic representation of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation
[0030] The following describes embodiments of the present invention. However, it should be understood that the disclosed embodiments are merely examples, and other embodiments may take various alternative forms.
[0031] Furthermore, it should be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or apparatus that comprises a list of elements may include not only those elements but also elements not expressly listed or inherent to such process, method, article, or apparatus.
[0032] As data centers expand, the number of hard drives required increases. For some disk models, the data volume is too small to collect sufficient training data. Existing methods for disk failure prediction generally employ neural network algorithms and transfer learning algorithms, such as DNN (Deep Neural Networks), CNN (Convolutional Neural Networks), transfer learning algorithms, support vector machines, hybrid Naive Bayes sub-models and Naive Bayes classifiers, time-series prediction models, and gradient boosting trees.
[0033] Shallow machine learning methods fail to effectively represent disk-related features because disk data is continuous time-series data, and the occurrence of disk failures changes over time; shallow machine learning methods cannot learn these temporal characteristics. Transfer learning methods expand the training set by selecting similar data from large datasets, but they only consider the similarity of the data itself without considering the similarity of labeled data, resulting in similar data potentially having different labels.
[0034] Therefore, for small-scale data scenarios where there is limited effective data for certain disk models and it is difficult to collect enough training data, a suitable disk failure prediction method is needed to improve the accuracy and efficiency of disk failure prediction.
[0035] One or more embodiments of this application will now be described with reference to the accompanying drawings.
[0036] Based on the above objectives, the first aspect of the present invention provides an embodiment of a method for predicting disk failures. Figure 1 The flowchart shown is a method for disk failure prediction provided by an embodiment of the present invention, as illustrated below. Figure 1 As shown, a method for disk failure prediction includes:
[0037] S1. Obtain the first and second datasets corresponding to the source and target domains, respectively, based on disk fault labels;
[0038] S2. Based on the self-attention function of the Transformer model and the improved position constant in the position encoding of the disk, a new Transformer model is trained using the first dataset to predict the location of disk failure in the source domain.
[0039] S3. Based on the domain adversarial model, train using the first dataset and the second dataset to obtain training parameters suitable for training the new Transformer model on the second dataset;
[0040] S4. Based on the domain adversarial model, train using the first dataset and the second dataset to obtain training parameters suitable for training the new Transformer model on the second dataset, and use the trained new Transformer model to predict disk failures.
[0041] By improving the self-attention function and positional constant in the positional encoding of the Transformer model, it is made to pay more attention to information close to its own position while ensuring computational speed. Domain adaptation training is performed using a domain adversarial model to reduce the data disparity between the source domain of large-scale datasets and the target domain of smaller datasets, making it suitable for scenarios involving disk failure prediction on small datasets and improving the accuracy and efficiency of disk failure prediction on small datasets.
[0042] Figure 2 The following is another flowchart illustrating disk failure prediction provided by an embodiment of the present invention, such as... Figure 2 As shown, the actual disk failure prediction process includes: data collection, data cleaning, data normalization, feature selection, model training, model evaluation, and model deployment. Specifically, firstly, disk failure-related data is collected from the dataset; the collected data is cleaned, such as by filling in missing values and handling outliers, to obtain high-quality data; since there are multiple indicators related to disk failures, and these indicators vary significantly, data normalization is required after data cleaning to reduce the differences in the numerical ranges of the collected data for each indicator; principal component analysis is used to filter feature data from the normalized data, i.e., to select feature data with a high correlation to disk failures; then, the selected feature data is used to train a prediction model to predict disk failures. Preferably, in this embodiment, the prediction model is evaluated using test data, including metrics such as recall, F1 score, and false positive rate, to improve the performance of the prediction model. Finally, the trained prediction model is deployed to the actual production environment to predict disk failures and provide early warning information for administrators to handle in a timely manner.
[0043] According to several embodiments of the present invention, the steps of obtaining a first dataset and a second dataset corresponding to the source domain and the target domain, respectively, based on disk fault labels include: continuously collecting several data points based on disk fault labels for each disk in the source domain and the target domain, and performing preprocessing to obtain input sequences corresponding to each disk in the source domain and the target domain, respectively, as the first dataset and the second dataset. After preprocessing, data with high correlation to disk faults is obtained. Using these data to construct input sequences in the source domain and the target domain is beneficial for improving the performance of subsequent disk fault prediction.
[0044] According to several embodiments of the present invention, the step of continuously collecting several data points based on disk fault labels for each disk in the source and target domains and preprocessing them to obtain the input sequence corresponding to each disk in the source and target domains includes: continuously collecting several data points based on disk fault labels for each disk in the source and target domains; filling missing values in the data and performing normalization processing, and then filtering data that meets the correlation requirements with disk fault labels to obtain the input sequence corresponding to each disk in the source and target domains. Preprocessing the collected data through normalization processing and filling missing values helps to obtain input sequences with high correlation to disk faults.
[0045] According to several embodiments of the present invention, a new Transformer model, based on improvements to the self-attention function of the Transformer model and the positional constant in the disk location encoding, is trained using a first dataset to predict the location of disk failures in the source domain. The steps include: converting the input sequence corresponding to each disk in the source domain into a corresponding vector based on an attention mechanism; constructing a query vector, key vector, and value vector based on the vectors to calculate the attention weights corresponding to the disks; calculating the dot product of the query vector, key vector, and value vector to obtain the original self-attention function Attention1(Q,K,V) used to calculate the disk attention weights. The formula for the original self-attention function Attention1(Q,K,V) is as follows:
[0046]
[0047] Where Q is the query vector, K is the key vector, V is the value vector, and d is the value vector. k The length of the key vector. The attention score corresponding to the disk. The attention weights corresponding to the disk;
[0048] Remove the parameters from the original attention function Attention1(Q,K,V) The new self-attention function Attention 2(Q,K,V) is obtained, and its formula is as follows:
[0049] Attention 2(Q,K,V)=softmax(QK T (Formula 2)
[0050] Where Q is the query vector, K is the key vector, and V is the value vector, (QK T V represents the attention score corresponding to the disk, and softmax(QK) TV represents the attention weight corresponding to the disk.
[0051] By improving the self-attention function of the Transformer model and the position constant in the disk position encoding, it can be applied to the scenario of predicting disk failures on small datasets. It can make the points in the sequence that start to change (points where disk failures may occur) more prominent, which is beneficial to the accuracy of disk failure prediction on small datasets.
[0052] According to several embodiments of the present invention, the step of training a new Transformer model based on an improved self-attention function of the Transformer model and a position constant in the disk position encoding, using a first dataset, to predict the location of a disk failure in the source domain further includes: obtaining the location information of the disk among all disks in the source domain; performing position encoding on the location information to obtain the position code corresponding to the disk; and matching the position constant in the position code with the time period of the disk failure prediction. The position encoding formula is as follows:
[0053]
[0054] Where pos is the disk's position among all disks in the source domain, i is the dimension of the position, and d is the position of the disk. model The dimension for output position encoding. Position coding based on sine functions of different frequencies, This is a position encoding based on cosine functions of different frequencies, where C is a position constant, and the actual value of C does not exceed 100.
[0055] Since disk failure sequences are time-based, the sequence length for disk failure prediction is relatively short. Based on this, improvements to the position constants, such as reducing the value of the position constants in the position encoding, can effectively reduce the computational load and improve prediction efficiency.
[0056] According to several embodiments of the present invention, the step of training a new Transformer model based on an improved self-attention function of the Transformer model and a position constant in the position encoding of the disk, using a first dataset, to predict the location of a disk failure in the source domain further includes: obtaining a new Transformer model based on the new self-attention function Attention 2(Q,K,V) and the position encoding formula; and training the first dataset based on the new Transformer model to predict the location of a disk failure in the source domain.
[0057] According to several embodiments of the present invention, the step of obtaining training parameters suitable for training the second dataset based on a new Transformer model using a first dataset and a second dataset for training based on a domain adversarial model includes: inputting the first dataset and the second dataset into the domain discriminator in the domain adversarial model after gradient inversion to obtain common features between the first dataset and the second dataset; and obtaining training parameters suitable for training the second dataset based on the common features.
[0058] Figure 3 The diagram shown illustrates the training process of the disk failure prediction model provided in an embodiment of the present invention. Figure 3 As shown, the large-scale disk failure dataset serves as the source dataset for the domain adversarial model, while the small-scale disk failure dataset serves as the target dataset. The domain adversarial model comprises an encoder, a classifier, and a domain discriminator. The encoder and classifier learn knowledge from the large-scale disk failure dataset, while the discriminator performs domain adaptation by discriminating between the large and small datasets to reduce the discrepancies between them. The small-scale disk failure dataset extracts domain-independent features from the large-scale dataset using the domain adversarial model, and this knowledge is transferred to the disk failure prediction model by transferring the encoder's parameters, thereby enhancing the model's ability to model data on the small-scale disk failure dataset.
[0059] In this embodiment, the temporal information of the disk is encoded using a Transformer encoder, which is constructed based on self-attention. The disk data is selected from the previous n days as the feature sequence, and the input sequence is represented as x = (x1, x2, ..., x...). n In self-attention, each input sequence is transformed into a vector hx = (hx1, hx2, ..., hx...). n After that, it needs to be multiplied by three different weights w to obtain three different matrices: query (Q), key (K), and value (V). Each output is the result of the weighted sum of these three vectors, and the calculation is performed using dot-product attention. For a set of K and V, the calculation formula is as follows:
[0060] Attention(Q,K,V) = softmax(QK) T V (Formula 4)
[0061] In formula (1) d k It is the dimension of the matrix, making the vectors tend to be consistent. Since disk failure prediction requires finding the point where the disk sequence begins to change, it is not divided by in formula (1). It can make the points where changes begin in the sequence more prominent, making them easier to learn.
[0062] Furthermore, in multi-head attention mechanisms, multiple different heads compute simultaneously, each with a different weight matrix for the output. This results in multiple different weight matrices for multiple heads, allowing each head to learn a different representation space. For example, for the i-th head, the weight matrices corresponding to Q, K, and V are W... i Q W i K and W i V The attention of the i-th head is as follows:
[0063] head i =Attention(QW i Q ,KW i K VW i V )(Formula 5)
[0064] By concatenating multiple heads and multiplying them by a weight matrix, multiple heads can be obtained, as described below:
[0065] MultiHead(Q,K,V)=Concat(head1,…,head h W O (Formula 6)
[0066] Where h is the number of heads,
[0067] Because recurrent neural networks learn sequentially, the learning at the current time step depends on the output of the previous time step. To learn the sequence's order information, the Transformer encoder needs to incorporate the relative / absolute position information of the characters in the sequence into the input, and then add this position information to the input vector. In this embodiment, sine and cosine functions of different frequencies are used for position encoding. The position encoding formula is as follows:
[0068]
[0069] Where pos is the position, i is the dimension of the position, and d is the dimension of the position. model Let be the dimension of the output. Each dimension of the positional encoding corresponds to a sinusoidal signal with a wavelength ranging from 2π to C2π. For any fixed offset k, PE pos+k It can be represented as PE posThe linear function is used to enable the model to learn sequence information in a simple way, and attention can be used to focus on information at different positions. The position constant C in the position encoding formula is generally chosen to be 10000 to handle longer sequences. To be suitable for disk fault prediction in this embodiment, the position constant in the position encoding is matched with the time period of disk fault prediction. Since the disk fault prediction sequence is short, the amount of computation can be reduced and the prediction efficiency can be improved. Preferably, the position constant C in this embodiment is chosen to be 100 to reduce the amount of computation.
[0070] According to several embodiments of the present invention, after encoding by the Transformer encoder, each disk x = (x1, x2, ..., x...) can be... n The data is encoded into a vector H, and each vector H is then fed into the classifier and the domain discriminator, respectively. The classifier predicts disk failures. Before being input into the domain discriminator for classification, H passes through a gradient inversion layer. During backpropagation, this layer inverts the gradient, preventing the domain discriminator from distinguishing whether H originates from the source or target domain. This allows the classifier to learn domain-independent features, thus learning common features across both datasets and avoiding discrepancies caused by different datasets. In the domain adversarial model, the discriminator and classifier are jointly trained. The loss function Loss is calculated as follows during training:
[0071] Loss total =Loss c +βLoss domain (Formula 8)
[0072] β is a parameter used to adjust the weights, Loss total For the total loss function, Loss c Loss is the loss function corresponding to the classifier. domain This is the loss function corresponding to the domain discriminator. After training with the domain adversarial network, the obtained training parameters are transferred to a disk failure prediction model on a small dataset for model training and testing until the conditions are met. Then, training stops, and the model is deployed to the business system for predicting disk failures.
[0073] A second aspect of the present invention provides an apparatus for predicting disk failures. Figure 4 A schematic diagram of a disk failure prediction device provided by an embodiment of the present invention is shown, as follows: Figure 4As shown, it includes: a first module 011, used to obtain a first dataset and a second dataset corresponding to the source domain and the target domain respectively based on disk fault labels; a second module 012, used to train a new Transformer model based on the first dataset, which improves the self-attention function of the Transformer model and the position constant in the position encoding of the disk, to predict the location of disk faults in the source domain; a third module 013, used to train the new Transformer model based on the domain adversarial model using the first dataset and the second dataset to obtain training parameters suitable for training the new Transformer model on the second dataset; and a fourth module 014, used to train the new Transformer model based on the training parameters and the new Transformer model using the second dataset to predict the location of disk faults in the target domain, and to perform disk fault prediction using the trained new Transformer model.
[0074] A third aspect of the present invention provides an electronic device, Figure 5 The diagram shown is a schematic representation of an electronic device provided in an embodiment of the present invention. For example... Figure 5 As shown, an electronic device provided by an embodiment of the present invention includes the following modules: at least one processor 021; and a memory 022, the memory 022 storing computer instructions 023 that can be executed on the processor 021, the computer instructions 023 implementing the steps of the method described above when executed by the processor 021.
[0075] The present invention also provides a computer-readable storage medium. Figure 6 The diagram shown is a structural schematic of a computer-readable storage medium provided in an embodiment of the present invention. Figure 6 As shown, computer-readable storage medium 031 stores a computer program 032 that, when executed by a processor, performs the steps of the method described above. The method performed is the same as described above.
[0076] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program for setting system parameters can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The storage medium for the program can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The above computer program embodiments can achieve the same or similar effects as any of the corresponding foregoing method embodiments.
[0077] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it performs the functions defined in the method disclosed in the embodiments of the present invention.
[0078] Furthermore, the above-described method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to perform the functions of the above-described steps or units.
[0079] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.
[0080] In one or more exemplary designs, functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer. By way of example, and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, or any other medium that may be used to carry or store the required program code in the form of instructions or data structures and is accessible to a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. Furthermore, any connection may be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the aforementioned coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, disks and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0081] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0082] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0083] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0084] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0085] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A method for predicting disk failures, characterized in that, include: Based on disk failure labels, obtain the first and second datasets corresponding to the source and target domains, respectively; A new Transformer model, based on improvements to the self-attention function of the Transformer model and the positional constant in the disk's positional encoding, is trained using the first dataset to predict the location of disk failures in the source neighborhood, including: The input sequence corresponding to each disk in the source domain is converted into a corresponding vector based on an attention mechanism. Based on the vectors, construct query vectors, key vectors, and value vectors for calculating the attention weights corresponding to the disks; Calculate the dot product of the query vector, key vector, and value vector to obtain the original attention function used to calculate the disk attention weights. The original attention function The formula is as follows: Where Q is the query vector, K is the key vector, and V is the value vector. The length of the key vector. The attention score corresponding to the disk. The attention weights corresponding to the disks; Delete the original attention function Parameters in A new self-attention function is obtained. The new self-attention function The formula is as follows: Where Q is the query vector, K is the key vector, and V is the value vector. The attention score corresponding to the disk. The attention weights corresponding to the disks; Obtain the location information of the disk among all disks in the source domain; The location information is encoded to obtain the location code corresponding to the disk, and the location constant in the location code is matched with the time period of the disk failure prediction. The location encoding formula is as follows: Where pos is the position of the disk among all disks in the source domain, and i is the dimension of the position. The dimension for output position encoding. Position coding based on sine functions of different frequencies, The position encoding is based on cosine functions of different frequencies, where C is a position constant and the actual value of C does not exceed 100. Based on the domain adversarial model, the first dataset and the second dataset are used for training to obtain training parameters suitable for training the new Transformer model on the second dataset; Based on the training parameters and the new Transformer model, the system is trained using the second dataset to predict the location of disk failures in the target domain, and the trained new Transformer model is used to predict disk failures.
2. The method according to claim 1, characterized in that, The steps of obtaining the first and second datasets corresponding to the source and target domains based on disk fault labels include: Several data points based on disk fault labels are continuously collected from each disk in the source and target domains and preprocessed to obtain the input sequences corresponding to each disk in the source and target domains, which are respectively used as the first dataset and the second dataset.
3. The method according to claim 1, characterized in that, The step of training a new Transformer model based on the improved self-attention function of the Transformer model and the positional constant in the positional encoding of the disk, using the first dataset, to predict the location of disk failure in the source domain further includes: Based on the new self-attention function The new Transformer model is obtained through the position encoding formula. The first dataset is trained based on the new Transformer model to predict the location of disk failures in the source domain.
4. The method according to claim 1, characterized in that, The step of obtaining training parameters suitable for training the new Transformer model on the second dataset based on the domain adversarial model, using the first dataset and the second dataset for training, includes: The first dataset and the second dataset are inverted by gradient and then input into the domain discriminator in the domain adversarial model to obtain the common features between the first dataset and the second dataset. Based on the general features, training parameters suitable for training the second dataset using the new Transformer model are obtained.
5. The method according to claim 2, characterized in that, The step of continuously collecting several data points based on disk fault tags from each disk in the source and target domains and preprocessing them to obtain the input sequence corresponding to each disk in the source and target domains includes: For each disk in both the source and target domains, continuously collect several data points based on disk fault tags; After filling missing values and normalizing the data, data that meets the correlation requirements with the disk fault labels are selected to obtain the input sequence corresponding to each disk in the source domain and the target domain.
6. A device for predicting disk failures, characterized in that, include: The first module is used to obtain the first and second datasets corresponding to the source and target domains, respectively, based on disk fault labels; The second module is used to train a new Transformer model based on the first dataset, which is improved by modifying the self-attention function of the Transformer model and the position constant in the position encoding of the disk, in order to predict the location of disk failure in the source domain. The third module is used to train the new Transformer model based on the domain adversarial model using the first dataset and the second dataset, and obtain training parameters suitable for training the second dataset based on the new Transformer model. The fourth module is used to train the new Transformer model using the second dataset based on the training parameters and the new Transformer model, to predict the location of disk failures in the target domain, and to perform disk failure prediction using the trained new Transformer model. The third module is also used for: The input sequence corresponding to each disk in the source domain is converted into a corresponding vector based on an attention mechanism. Based on the vectors, construct query vectors, key vectors, and value vectors for calculating the attention weights corresponding to the disks; Calculate the dot product of the query vector, key vector, and value vector to obtain the original attention function used to calculate the disk attention weights. The original attention function The formula is as follows: Where Q is the query vector, K is the key vector, and V is the value vector. The length of the key vector. The attention score corresponding to the disk. The attention weights corresponding to the disks; Delete the original attention function Parameters in A new self-attention function is obtained. The new self-attention function The formula is as follows: Where Q is the query vector, K is the key vector, and V is the value vector. The attention score corresponding to the disk. The attention weights corresponding to the disks; Obtain the location information of the disk among all disks in the source domain; The location information is encoded to obtain the location code corresponding to the disk, and the location constant in the location code is matched with the time period of the disk failure prediction. The location encoding formula is as follows: Where pos is the position of the disk among all disks in the source domain, and i is the dimension of the position. The dimension for output position encoding. Position coding based on sine functions of different frequencies, The position encoding is based on cosine functions of different frequencies, where C is a position constant and the actual value of C does not exceed 100.
7. An electronic device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-5.
8. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-5.
Citation Information
Patent Citations
Aircraft fault diagnosis method and system based on improved Transform model
CN112947385A
Fall detection method based on improved Transform network
CN114913547A