Equipment fault diagnosis method and device based on sparse dictionary combined with large language model
Through sparse dictionary encoding and LoRA algorithm fine-tuning the large language model, the problem of high cost and low accuracy in equipment fault diagnosis is solved, and more efficient and accurate fault diagnosis is achieved.
Patent Information
- Application Number
- CN202510346477.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-04-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing equipment fault diagnosis methods are costly and have low accuracy, and the large language model has a large calculation overhead when processing high-frequency original signals, and the information loss is serious.
The equipment fault diagnosis method based on sparse dictionary combined with large language models is adopted. The equipment signal is preprocessed through sparse dictionary encoding, the data dimension is reduced, and the large language model is fine-tuned by using the LoRA algorithm to optimize the model's performance in fault diagnosis.
It improves the accuracy of fault identification, reduces the cost of fault diagnosis, avoids information loss, and achieves more efficient computing and storage resource utilization.
Smart Images

Figure CN119862965A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of equipment fault diagnosis, and in particular to an equipment fault diagnosis method and device based on a sparse dictionary combined with a large language model. Background Art
[0002] Equipment fault diagnosis is a vital link in modern industry, energy, transportation and other fields. Its main purpose is to timely discover potential faults or abnormal conditions of equipment by analyzing various signals (such as vibration, sound, current, voltage, etc.) during the operation of the equipment, so as to take effective maintenance measures, reduce downtime and maintenance costs, and improve the reliability and service life of the equipment. In recent years, large models have made breakthrough progress in many fields, especially in signal processing, image recognition, speech processing and other fields, showing great potential. Equipment fault diagnosis also benefits from the powerful capabilities of large models, especially when dealing with complex patterns and high-dimensional data, it has more advantages than traditional methods.
[0003] However, the current application of large language models in equipment fault diagnosis mainly focuses on fine-tuning training based on text or structured data, such as using equipment operation logs, expert knowledge bases, fault descriptions and other information, combined with natural language processing (NLP) technology for analysis and reasoning. Although such methods have certain value in knowledge fusion and intelligent question answering, they do not fully utilize the rich information contained in the original sensor signals and cannot bring out the full potential of large models in deep feature extraction.
[0004] Traditional device signal processing methods usually rely on manual feature extraction, such as time domain, frequency domain, or time-frequency domain analysis. However, such methods are highly subjective, and the extracted features may not fully express the subtle differences in complex signals. In addition, since device sensor signals usually have high sampling rates and large data volumes, directly inputting the original signals into a large language model for fine-tuning training poses huge challenges in terms of computational and storage overhead. Existing methods often require dimensionality reduction or compression of data to reduce computational costs, but this may result in the loss of some key information, thereby affecting diagnostic accuracy.
[0005] Therefore, the applicant has developed a device fault diagnosis method based on a sparse dictionary combined with a large language model to solve the above problems. Summary of the invention
[0006] The present invention proposes an equipment fault diagnosis method based on a sparse dictionary combined with a large language model to solve the problems of high cost and low accuracy of existing equipment fault diagnosis methods.
[0007] The present invention achieves the above-mentioned purpose through the following technical solutions: The present invention provides a device fault diagnosis method based on a sparse dictionary combined with a large language model, comprising: Acquiring information, wherein the information is a real-time status signal of the device and a historical status signal of the device; Normalizing and segmenting the information to obtain processed real-time status signals and historical status signals; Training a dictionary to be learned according to the processed historical state signal to obtain a sparse dictionary, and encoding the processed historical state signal according to the sparse dictionary to obtain a historical sparse coefficient; According to the historical sparse coefficient, fine-tune and train the preset large language model based on the LoRA algorithm to obtain an optimized large language model; According to the sparse dictionary, the preprocessed real-time state signal is encoded to obtain a real-time sparse coefficient; The real-time sparse coefficients are input into the optimized large language model, and the equipment fault diagnosis result is output.
[0008] Furthermore, the information is normalized and segmented, including: Based on min-max normalization, the real-time status signal of the device and the historical status signal of the device are respectively normalized, wherein the status signal of the device includes the status signal of the device collected in real time by the vibration sensor, the temperature sensor, and the sound sensor; The high-frequency vibration signal in the normalized result is segmented using a sliding window with a length of 2048 points and 50% overlap; Segment the temperature or lower sample rate signals from the normalized results using sliding windows of length 256 or 512 points with 25% or 50% overlap.
[0009] Furthermore, the sparse dictionary is expressed as:
[0010] Among them, x i represents the i-th training sample, a i represents the i-th sparse representation coefficient, that is, x i The sparse representation under the dictionary D to be learned, is the number of training samples, represents sparsity, Indicates a i Contains no more than K non-zero elements, D is the dictionary to be learned, each column of the dictionary to be learned is an atom, and the reconstruction error is minimized is the optimization target of the training process of the dictionary to be learned.
[0011] Further, signal encoding the processed historical state signal according to the sparse dictionary includes: Encoding the processed historical state signal into a sparse linear combination of the sparse dictionary to obtain a sparse code; During the encoding process, the historical state signal is projected into the dictionary space of the sparse dictionary and stored in the form of a sparse vector.
[0012] Further, according to the historical sparse coefficient, the preset large language model is fine-tuned and trained based on the LoRA algorithm to obtain an optimized large language model, including: Build the large language model Llama3; Insert a low-rank adapter into the weight matrix of each Transformer layer of the large language model Llama3; Fine-tune and train the low-rank adapter according to the processed historical state signal; The loss function is optimized during training using the standard Adam or AdamW optimization algorithm.
[0013] The present invention provides a device for diagnosing equipment faults based on a sparse dictionary combined with a large language model, comprising: An acquisition module, the acquisition module is used to acquire information, the information being a real-time status signal of a device and a historical status signal of the device; A processing module, the processing module is used to perform normalization processing and segmentation processing on the information to obtain a processed real-time status signal and a historical status signal; An encoding module, the encoding module is used to train a dictionary to be learned according to the processed historical state signal to obtain a sparse dictionary, and to perform signal encoding on the processed historical state signal according to the sparse dictionary to obtain a historical sparse coefficient; A training module, wherein the training module is used to fine-tune and train a preset large language model based on the LoRA algorithm according to the historical sparse coefficient to obtain an optimized large language model; According to the sparse dictionary, the preprocessed real-time state signal is encoded to obtain a real-time sparse coefficient; The real-time sparse coefficients are input into the optimized large language model, and the equipment fault diagnosis result is output.
[0014] Furthermore, the processing module includes: A normalization module, wherein the normalization module is used to perform normalization processing on the real-time status signal of the device and the historical status signal of the device based on min-max normalization, wherein the status signal of the device includes the status signal of the device collected in real time by the vibration sensor, the temperature sensor, and the sound sensor; A first segmentation module, the first segmentation module is used to segment the high-frequency vibration signal in the normalized result by using a sliding window with a length of 2048 points and a 50% overlap; The second segmentation module is used to segment the temperature or lower sampling rate signal in the normalized result by using a sliding window with a length of 256 or 512 points and a 25% or 50% overlap.
[0015] Furthermore, the sparse dictionary is expressed as:
[0016] Among them, x i represents the i-th training sample, a i represents the i-th sparse representation coefficient, that is, x i The sparse representation under the dictionary D to be learned, is the number of training samples, represents sparsity, Indicates a i Contains no more than K non-zero elements, D is the dictionary to be learned, each column of the dictionary to be learned is an atom, and the reconstruction error is minimized is the optimization target of the training process of the dictionary to be learned.
[0017] Furthermore, the encoding module includes: A sparse coding module, the sparse coding module is used to encode the processed historical state signal into a sparse linear combination of the sparse dictionary to obtain a sparse code; A storage module is used for projecting the historical state signal into the dictionary space of the sparse dictionary and storing it in the form of a sparse vector during the encoding process.
[0018] Furthermore, the training module includes: A building module, wherein the building module is used to build a large language model Llama3; An insertion module, the insertion module being used to insert a low-rank adapter into a weight matrix of each Transformer layer of the large language model Llama3; A fine-tuning training module, the fine-tuning training module is used to fine-tune and train the low-rank adapter according to the processed historical state signal; The optimization module is used to optimize the loss function using the standard Adam or AdamW optimization algorithm during the training process.
[0019] The beneficial effects of the present invention are: The equipment fault diagnosis method based on sparse dictionary combined with large language model proposed in the present invention avoids information loss, improves fault identification accuracy and reduces fault diagnosis cost through the effective combination of sparse dictionary coding and large language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flow chart of the device fault diagnosis method based on a sparse dictionary combined with a large language model in this application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0024] In the description of the present invention, it should be understood that the terms "upper", "lower", "inside", "outside", "left", "right", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention is usually placed when in use, or are directions or positional relationships commonly understood by those skilled in the art. These directions or positional relationships are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0025] Furthermore, the terms “first”, “second”, etc. are merely used for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0026] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms such as "setting" and "connection" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0027] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.
[0028] like Figure 1 As shown, the present invention provides a device fault diagnosis method based on a sparse dictionary combined with a large language model, comprising: Acquiring information, wherein the information is a real-time status signal of the device and a historical status signal of the device; Normalizing and segmenting the information to obtain processed real-time status signals and historical status signals; Training a dictionary to be learned according to the processed historical state signal to obtain a sparse dictionary, and encoding the processed historical state signal according to the sparse dictionary to obtain a historical sparse coefficient; According to the historical sparse coefficient, fine-tune and train the preset large language model based on the LoRA algorithm to obtain an optimized large language model; According to the sparse dictionary, the preprocessed real-time state signal is encoded to obtain a real-time sparse coefficient; The real-time sparse coefficients are input into the optimized large language model, and the equipment fault diagnosis result is output.
[0029] During operation, the device will collect device status signals in real time through various sensors (such as vibration sensors, temperature sensors, sound sensors, etc.). These signals are usually high-frequency, high-dimensional time series data, containing various information about the operation of the device. At this stage, the signal will undergo certain preprocessing, mainly including: Normalization: min-max normalization is used to unify multi-channel and multi-type signals to a comparable scale, reducing the impact of amplitude and dimension differences; Segmentation processing: For high-frequency vibration signals, a sliding window with a length of 2048 points and 50% overlap is used for segmentation; for example, at a sampling rate of 5 kHz, about 5 data windows can be obtained per second in theory, and each data window covers about 0.4 seconds of signal; For temperature or lower sampling rate signals, a longer window length (such as 256 or 512 points) can be used, and the overlap ratio (such as 25% or 50%) can be adjusted accordingly to obtain smoother timing characteristics.
[0030] In some embodiments, the information is normalized and segmented, including: Based on min-max normalization, the real-time status signal of the device and the historical status signal of the device are respectively normalized, wherein the status signal of the device includes the status signal of the device collected in real time by the vibration sensor, the temperature sensor, and the sound sensor; The high-frequency vibration signal in the normalized result is segmented using a sliding window with a length of 2048 points and 50% overlap; Segment the temperature or lower sample rate signals from the normalized results using sliding windows of length 256 or 512 points with 25% or 50% overlap.
[0031] The window length setting needs to ensure that signals with different sampling frequencies are aligned in time. High-frequency signals use longer windows, while low-frequency signals use shorter windows. The sparse dictionary coding process includes dictionary learning, signal coding, In some embodiments, the sparse dictionary is represented as:
[0032] Among them, x i represents the i-th training sample, a i represents the i-th sparse representation coefficient, that is, x i The sparse representation under the dictionary D to be learned, is the number of training samples, represents sparsity, Indicates a i Contains no more than K non-zero elements, D is the dictionary to be learned, each column of the dictionary to be learned is an atom, minimizing the reconstruction error is the optimization target of the training process of the dictionary to be learned.
[0033] During the training process, the dictionary to be learned will be automatically adjusted through the optimization algorithm K-SVD to minimize the signal reconstruction error while ensuring the sparsity of the elements of the dictionary to be learned. It can be adjusted according to the signal complexity and computing resources, such as setting the number of atoms in the dictionary to be learned to 256, 512 or 1024 (512 is commonly used), and matching the length of a single atom with the window length (for example, 2048 points, or block processing). In the K-SVD process, set the target sparsity (such as the number of sparse coefficients of each signal in the dictionary to be learned does not exceed 5 to 10) or use a penalty term to minimize the reconstruction error.
[0034] After the sparse dictionary is established, the original data is represented by a linear combination of the elements in the sparse dictionary. Specifically, the matching pursuit algorithm is used to gradually select sparse dictionary atoms and construct different linear combinations, so that the reconstruction error is gradually reduced until the set sparsity threshold is met or the predetermined maximum number of iterations is reached. Finally, the sparse vector of the linear combination is the sparse code of the original data.
[0035] In some embodiments, encoding the processed historical state signal according to the sparse dictionary includes: Encoding the processed historical state signal into a sparse linear combination of the sparse dictionary to obtain a sparse code; During the encoding process, the historical state signal is projected into the dictionary space of the sparse dictionary and stored in the form of a sparse vector.
[0036] After obtaining the optimized sparse dictionary, the signal encoding stage is responsible for representing the input signal as a sparse linear combination of the sparse dictionary, that is, finding the appropriate sparse coefficients by solving the sparse representation problem. During the encoding process, the signal is projected into the dictionary space and stored in the form of a sparse vector. This process can not only effectively remove redundant information, but also retain the main features of the signal, greatly reducing the data dimension, thereby improving the efficiency of subsequent processing (such as classification, recognition, and compression).
[0037] After sparse coding is completed, the sparse coefficient is the signal feature, which is usually 256 to 1024 in length, and contains the core information of the signal, and removes irrelevant or redundant parts. When the sparse dictionary has been established in this application, the sparse dictionary can be directly used to perform sparse coding on the subsequently collected signals in real time to obtain sparse coefficients without repeated training.
[0038] In some embodiments, according to the historical sparse coefficient, the preset large language model is fine-tuned and trained based on the LoRA algorithm to obtain an optimized large language model, including: Build the large language model Llama3; Insert a low-rank adapter into the weight matrix of each Transformer layer of the large language model Llama3; Fine-tune and train the low-rank adapter according to the processed historical state signal; The loss function is optimized during training using the standard Adam or AdamW optimization algorithm.
[0039] In some embodiments, the pre-training part uses the pre-trained open source large language model Llama3 20B version, which has been trained on a large number of general data sets, has powerful feature extraction capabilities, and can recognize multi-level patterns in natural language.
[0040] Input feature vector: The encoded signal feature vector is used as the input of the large language model for deep feature learning. The large language model uses its powerful representation ability to capture the timing patterns and potential fault characteristics in the signal.
[0041] Fine-tuning and training the preset large language model based on the LoRA algorithm includes: Fine-tuning and training: In the technical solution of this application, the application adopts the LoRA method to perform fine-tuning efficiently. LoRA performs low-rank decomposition of the parameters in the large language model and only trains a part of the parameters of the model, which greatly reduces the consumption of computing resources and makes the fine-tuning process more efficient. The advantage of LoRA is that there is no need to retrain the entire pre-trained model, but to adjust some layers by adding low-rank adapters to quickly adapt to new tasks.
[0042] LoRA fine-tuning steps: Freeze the parameters of the pre-trained layer: When using LoRA fine-tuning, keep most of the weight parameters of the large language model frozen, and only train the added low-rank adapter (LoRA layer). This ensures that the original general ability of the model is preserved and the computational burden of fine-tuning is significantly reduced.
[0043] Training of low-rank adapters: The LoRA method inserts low-rank adapters into the weight matrix of each Transformer layer and uses the parameters of these adapters as fine-tuning objects. In this process, the adapters will learn how to adjust the output of the model on a dataset of a given device fault diagnosis task without changing the structure of the large language model itself.
[0044] Fine-tuning dataset: The dataset used for fine-tuning comes from the historical signal data of the equipment. These data are processed by sparse dictionary encoding to form feature vectors. The fine-tuning dataset contains the normal operating status of the equipment and various types of failure modes (such as lubrication system failure, bearing wear, electrical problems, etc.).
[0045] Fine-tuning optimization: During the fine-tuning process, the LoRA method usually uses a lower learning rate (e.g., 1e-5 to 5e-5) to ensure that only the parameters of the low-rank adapter are updated to reduce the impact on the original model. The training process uses a standard optimization algorithm (such as Adam or AdamW) to optimize the loss function, which is usually a cross entropy loss for fault diagnosis of multi-classification problems.
[0046] The large language model that has been trained and fine-tuned can realize fault diagnosis and prediction of the equipment operation status. The specific diagnosis process includes: The feature vector encoded by the sparse dictionary is input into the fine-tuned model to classify and identify the fault mode. Through fast reasoning, the model can accurately determine whether the equipment is in a fault state and output key information such as fault type, location, and severity.
[0047] In some embodiments, the present invention provides a device fault diagnosis apparatus based on a sparse dictionary combined with a large language model, comprising: An acquisition module, the acquisition module is used to acquire information, the information being a real-time status signal of a device and a historical status signal of the device; A processing module, the processing module is used to perform normalization processing and segmentation processing on the information to obtain a processed real-time status signal and a historical status signal; An encoding module, the encoding module is used to train a dictionary to be learned according to the processed historical state signal to obtain a sparse dictionary, and to perform signal encoding on the processed historical state signal according to the sparse dictionary to obtain a historical sparse coefficient; A training module, wherein the training module is used to fine-tune and train a preset large language model based on the LoRA algorithm according to the historical sparse coefficient to obtain an optimized large language model; According to the sparse dictionary, the preprocessed real-time state signal is encoded to obtain a real-time sparse coefficient; The real-time sparse coefficients are input into the optimized large language model, and the equipment fault diagnosis result is output.
[0048] In some embodiments, the processing module includes: A normalization module, wherein the normalization module is used to perform normalization processing on the real-time status signal of the device and the historical status signal of the device based on min-max normalization, wherein the status signal of the device includes the status signal of the device collected in real time by the vibration sensor, the temperature sensor, and the sound sensor; A first segmentation module, the first segmentation module is used to segment the high-frequency vibration signal in the normalized result by using a sliding window with a length of 2048 points and a 50% overlap; The second segmentation module is used to segment the temperature or lower sampling rate signal in the normalized result by using a sliding window with a length of 256 or 512 points and a 25% or 50% overlap.
[0049] In some embodiments, the sparse dictionary is represented as:
[0050] Among them, x i represents the i-th training sample, a i represents the i-th sparse representation coefficient, that is, x i The sparse representation under the dictionary D to be learned, is the number of training samples, represents sparsity, Indicates a i Contains no more than K non-zero elements, D is the dictionary to be learned, each column of the dictionary to be learned is an atom, minimizing the reconstruction error is the optimization target of the training process of the dictionary to be learned.
[0051] In some embodiments, the encoding module includes: A sparse coding module, the sparse coding module is used to encode the processed historical state signal into a sparse linear combination of the sparse dictionary to obtain a sparse code; A storage module is used for projecting the historical state signal into the dictionary space of the sparse dictionary and storing it in the form of a sparse vector during the encoding process.
[0052] In some embodiments, the training module includes: A building module, wherein the building module is used to build a large language model Llama3; An insertion module, the insertion module being used to insert a low-rank adapter into a weight matrix of each Transformer layer of the large language model Llama3; A fine-tuning training module, the fine-tuning training module is used to fine-tune and train the low-rank adapter according to the processed historical state signal; The optimization module is used to optimize the loss function using the standard Adam or AdamW optimization algorithm during the training process.
[0053] The advantages of the present invention compared to the prior art are: 1. Solved the information loss problem of signal feature extraction This application introduces a combination of sparse dictionary coding and a large language model to automatically extract features from original device signals, eliminating the subjectivity of manual feature extraction, allowing the fault diagnosis model to more accurately capture complex patterns in the signal and improve the accuracy and robustness of fault diagnosis.
[0054] 2. Solved the limitation that large language models cannot directly process high-frequency raw signals The application of existing large language models in equipment fault diagnosis usually relies on natural language data or manually extracted features, but fails to fully explore the deep information of the original sensor signal. The original signal usually contains a lot of useful diagnostic information, but due to the high frequency, complexity and large amount of data of the signal, directly using a large language model for fine-tuning training is not only computationally burdensome, but may also ignore the detailed features contained in the signal.
[0055] This application combines sparse dictionary coding with a large language model to first sparsely represent and compress the original signal, and then input it into the large language model for feature extraction and fine-tuning training, so as to make full use of the information in the original signal, avoid information loss, maximize the feature learning ability of the large model, and improve diagnostic accuracy.
[0056] 3. Alleviate the computing resource bottleneck during training Since device signals usually contain a large amount of high-frequency data, traditional deep learning methods often face huge computing resource consumption and time overhead during the training process. Even with a large language model, this problem still exists, especially for large-scale equipment fault diagnosis systems, where the computing pressure during training may make it impossible to process data in real time. This application pre-processes the signal through sparse dictionary learning, converting high-dimensional data into low-dimensional sparse representation, greatly reducing computing resource consumption and storage requirements. After testing, model fine-tuning can be completed on a graphics card with 24GB of memory, making the model more efficient in the training and reasoning stages, so that fault diagnosis can be performed faster and in real time.
[0057] This application has been applied to the PHM device of the locomotive power main engine, and has performed engine fault diagnosis, engine lubrication system fault diagnosis and engine power unit fault diagnosis. Under different gear speeds and load conditions, the diagnostic accuracy rate has reached more than 80%, reaching a relatively high level.
[0058] Application scenarios and hardware environment Sensor layout: 12 sensors are arranged at key parts of the locomotive engine, including vibration sensors, pressure sensors and temperature sensors.
[0059] Sampling rate and data size: The sampling rate of the vibration sensor is set to 5 kHz, and the sampling rates of the pressure and temperature sensors are 100 Hz and 10 Hz respectively. A single engine can generate several GB of raw data in a typical operation cycle (about 4 to 6 hours).
[0060] Edge computing hardware: The present invention is deployed on a locomotive power host PHM device for real-time data processing and fault diagnosis.
[0061] Data In this project, more than 300 hours of engine operation data were recorded, of which about 20 hours covered typical faults under different gears, speeds and load conditions (such as lubrication system blockage, combustion abnormalities, cylinder head failure, etc.). Experts annotated the fault types and time points to form training and test data sets.
[0062] Implementation Effect Improved fault diagnosis accuracy: Sparse dictionary coding effectively compresses and retains key features in the original signal. Combined with the deep representation capabilities of the large language model, it can accurately capture complex fault modes in high-dimensional signals and perform detailed identification of engine lubrication system faults, combustion anomalies, cylinder head faults, etc.
[0063] Strong robustness and adaptability: Under changing operating conditions (such as different speeds, loads and environmental noise conditions), traditional methods often find it difficult to maintain stable performance. However, this model effectively enhances its adaptability to various operating environments through adaptive dictionary learning and fine-tuning mechanisms of large language models, and the diagnostic accuracy remains above 80%.
[0064] System versatility: After the successful application in the engine field, this solution can be replicated to other mechanical equipment scenarios, proving the scalability and stability of sparse dictionary coding and large language model technology in high-dimensional time series signal analysis.
[0065] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A device fault diagnosis method based on a sparse dictionary combined with a large language model, characterized in that: include: Acquiring information, wherein the information is a real-time status signal of the device and a historical status signal of the device; Normalizing and segmenting the information to obtain processed real-time status signals and historical status signals; Training a dictionary to be learned according to the processed historical state signal to obtain a sparse dictionary, and encoding the processed historical state signal according to the sparse dictionary to obtain a historical sparse coefficient; According to the historical sparse coefficient, fine-tune and train the preset large language model based on the LoRA algorithm to obtain an optimized large language model; According to the sparse dictionary, the preprocessed real-time state signal is encoded to obtain a real-time sparse coefficient; The real-time sparse coefficients are input into the optimized large language model, and the equipment fault diagnosis result is output.
2. According to claim 1, a device fault diagnosis method based on a sparse dictionary combined with a large language model is characterized in that: The information is normalized and segmented, including: Based on min-max normalization, the real-time status signal of the device and the historical status signal of the device are respectively normalized, wherein the status signal of the device includes the status signal of the device collected in real time by the vibration sensor, the temperature sensor, and the sound sensor; The high-frequency vibration signal in the normalized result is segmented using a sliding window with a length of 2048 points and 50% overlap; Segment the temperature or lower sample rate signals from the normalized results using sliding windows of length 256 or 512 points with 25% or 50% overlap.
3. The device fault diagnosis method based on sparse dictionary combined with large language model according to claim 1 is characterized in that: The sparse dictionary is represented as: , Among them, x i represents the i-th training sample, a i represents the i-th sparse representation coefficient, that is, x i The sparse representation under the dictionary D to be learned, is the number of training samples, represents sparsity, Indicates a i Contains no more than K non-zero elements, D is the dictionary to be learned, each column of the dictionary to be learned is an atom, and the reconstruction error is minimized is the optimization target of the training process of the dictionary to be learned.
4. The device fault diagnosis method based on sparse dictionary combined with large language model according to claim 1 is characterized in that: The method further comprises: encoding the processed historical state signal according to the sparse dictionary, comprising: Encoding the processed historical state signal into a sparse linear combination of the sparse dictionary to obtain a sparse code; During the encoding process, the historical state signal is projected into the dictionary space of the sparse dictionary and stored in the form of a sparse vector.
5. The device fault diagnosis method based on sparse dictionary combined with large language model according to claim 1 is characterized in that: According to the historical sparse coefficient, the preset large language model is fine-tuned and trained based on the LoRA algorithm to obtain an optimized large language model, including: Build the large language model Llama3; Insert a low-rank adapter into the weight matrix of each Transformer layer of the large language model Llama3; Fine-tune and train the low-rank adapter according to the processed historical state signal; The cross entropy loss function is optimized during training using the standard Adam or AdamW optimization algorithm.
6. A device fault diagnosis apparatus based on a sparse dictionary combined with a large language model, characterized in that: include: An acquisition module, the acquisition module is used to acquire information, the information being a real-time status signal of a device and a historical status signal of the device; A processing module, the processing module is used to perform normalization processing and segmentation processing on the information to obtain a processed real-time status signal and a historical status signal; An encoding module, the encoding module is used to train a dictionary to be learned according to the processed historical state signal to obtain a sparse dictionary, and to perform signal encoding on the processed historical state signal according to the sparse dictionary to obtain a historical sparse coefficient; A training module, wherein the training module is used to fine-tune and train a preset large language model based on the LoRA algorithm according to the historical sparse coefficient to obtain an optimized large language model; According to the sparse dictionary, the preprocessed real-time state signal is encoded to obtain a real-time sparse coefficient; The real-time sparse coefficients are input into the optimized large language model, and the equipment fault diagnosis result is output.
7. The device for diagnosing equipment faults based on a sparse dictionary combined with a large language model according to claim 6, characterized in that: The processing module comprises: A normalization module, wherein the normalization module is used to perform normalization processing on the real-time status signal of the device and the historical status signal of the device based on min-max normalization, wherein the status signal of the device includes the status signal of the device collected in real time by the vibration sensor, the temperature sensor, and the sound sensor; A first segmentation module, the first segmentation module is used to segment the high-frequency vibration signal in the normalized result by using a sliding window with a length of 2048 points and a 50% overlap; The second segmentation module is used to segment the temperature or lower sampling rate signal in the normalized result by using a sliding window with a length of 256 or 512 points and a 25% or 50% overlap.
8. The device for diagnosing equipment faults based on a sparse dictionary combined with a large language model according to claim 6, characterized in that: The sparse dictionary is represented as: , Among them, x i represents the i-th training sample, a i represents the i-th sparse representation coefficient, that is, x i The sparse representation under the dictionary D to be learned, is the number of training samples, represents sparsity, Indicates a i Contains no more than K non-zero elements, D is the dictionary to be learned, each column of the dictionary to be learned is an atom, and the reconstruction error is minimized is the optimization target of the training process of the dictionary to be learned.
9. The device for diagnosing equipment faults based on a sparse dictionary combined with a large language model according to claim 6, characterized in that: The encoding module comprises: A sparse coding module, the sparse coding module is used to encode the processed historical state signal into a sparse linear combination of the sparse dictionary to obtain a sparse code; A storage module is used for projecting the historical state signal into the dictionary space of the sparse dictionary and storing it in the form of a sparse vector during the encoding process.
10. The device for diagnosing equipment faults based on a sparse dictionary combined with a large language model according to claim 6, characterized in that: The training module includes: A building module, wherein the building module is used to build a large language model Llama3; An insertion module, the insertion module being used to insert a low-rank adapter into a weight matrix of each Transformer layer of the large language model Llama3; A fine-tuning training module, the fine-tuning training module is used to fine-tune and train the low-rank adapter according to the processed historical state signal; The optimization module is used to optimize the loss function using the standard Adam or AdamW optimization algorithm during the training process.
Citation Information
Patent Citations
A method of transformer fault identification based on hybrid intelligent algorithm
CN109214500A
Method for rapidly capturing and intelligently complementing substation automation system information
CN113555962A
Transformer vibration signal sparse decomposition method
CN115062647A
Motor bearing small sample fault diagnosis method based on Markov transfer field and Swin transfer former
CN119004199A
Fault diagnosis method of wind driven generator based on multi-mode large language model
CN119474974A