Classification method and device, equipment and medium
By extracting the eigenvectors of the time series and inputting pre-fine-tuned large language model (LLM) for classification, the problem of low classification accuracy in the prior art is solved, and higher classification accuracy is achieved.
Patent Information
- Application Number
- CN202411985183.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
The accuracy of classification tasks in the prior art is low, mainly due to the problem of subjectivity, ambiguity or incomplete information in text-based description methods.
By obtaining the pressure data or temperature data collected at the set intervals within the preset time period, extracting the trend, seasonality and residuals of the time series, generating feature vectors, and inputting them into a pre-fine-tuned large language model (LLM) to obtain classification results.
It improves the accuracy of classification, avoids the problem of accuracy limitation caused by subjectivity, ambiguity or incomplete information, and enhances the accuracy of LLM during recognition.
Smart Images

Figure CN119903378A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of model technology, and in particular to a classification method, device, equipment and medium. Background Art
[0002] With the continuous advancement of technology, the recognition application of classification tasks is becoming more and more extensive, but the current mainstream technologies are mostly limited to relying on descriptive text for classification and recognition. For example, in the scenario of judging whether a device is faulty, it is usually based on a text description of the device usage. However, this text-based description method may be limited in accuracy due to factors such as subjectivity, ambiguity or incomplete information, which in turn affects the accuracy of the classification results. Summary of the invention
[0003] The embodiments of the present application provide a classification method, apparatus, device and medium for solving the problem of low classification accuracy in related technologies.
[0004] In a first aspect, an embodiment of the present application provides a classification method, the method comprising:
[0005] Acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, seasonality and residual into an encoder respectively, and acquire the trend vector, seasonal vector and residual vector output by the encoder; determine the first sum vector of the trend vector, seasonal vector and residual vector as a feature vector;
[0006] The time series and the feature vector are input into a pre-fine-tuned large language model (LLM) to obtain a classification result output by the LLM.
[0007] Furthermore, the step of inputting the time series and the feature vector into a pre-fine-tuned LLM to obtain a classification result output by the LLM includes:
[0008] Input the time series and the feature vector into a pre-fine-tuned LLM;
[0009] The memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
[0010] Furthermore, the obtaining of the key representation and value representation of each memory vector obtained through pre-training includes:
[0011] Get each memory vector obtained after pre-training;
[0012] For each memory vector, a key representation and a value representation of the memory vector are determined according to a dot product of a preset key matrix and a preset value matrix with the memory vector.
[0013] Further, determining the weight of each memory vector according to the key representation of each memory vector and the feature vector includes:
[0014] For each memory vector, determine a value obtained by multiplying the feature vector by the key representation of the memory vector, and determine that the value is a target value obtained by the function with a preset value as the base;
[0015] Determine the sum of the target values of each memory vector; and determine the ratio of the target value of each memory vector to the sum as the weight of the corresponding memory vector.
[0016] Furthermore, the gate mechanism layer of the LLM includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each of the encoding recognition layers includes a gated sublayer and a Transformer sublayer connected in sequence; and each of the encoding recognition layers is connected in sequence, the gated sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier;
[0017] The gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, including:
[0018] The Transformer layer encodes the time series to obtain a first output;
[0019] The gating sublayer in each of the coding recognition layers determines the second sum vector of the received input vector and the feature representation, and determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix according to the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training; determines the difference matrix between the preset matrix and the reset gate matrix, and determines the second cross product matrix of the difference matrix and the feature representation, and the third cross product matrix of the feature representation and the reset gate matrix; determines the second sum matrix of the second cross product matrix and the third cross product matrix as the second output; the Transformer sublayer of each of the coding recognition layers encodes the second output of the gating sublayer of the corresponding coding recognition layer to obtain the third output;
[0020] The fully connected layer of the gate mechanism layer of the LLM and the classifier determine the corresponding classification result according to the third output of the last encoding identifier.
[0021] Furthermore, the LLM is fine-tuned in the following ways:
[0022] Obtain any sample time series in a pre-saved sample set, a sample feature vector determined for the sample time series, and a labeled classification result saved for the sample time series;
[0023] Input the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtain the output classification result output by the LLM;
[0024] Based on the labeled classification result and the output classification result, the LLM is fine-tuned.
[0025] In a second aspect, an embodiment of the present application further provides a classification device, the device comprising:
[0026] An acquisition module, used to acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, seasonality and residual into an encoder respectively, and acquire the trend vector, seasonal vector and residual vector output by the encoder; determine the first sum vector of the trend vector, the seasonal vector and the residual vector as a feature vector;
[0027] The processing module is used to input the time series and the feature vector into a pre-fine-tuned LLM to obtain a classification result output by the LLM.
[0028] Furthermore, the processing module is specifically used to input the time series and the feature vector into a pre-fine-tuned LLM; the memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, and determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
[0029] Furthermore, the processing module is specifically used to obtain each memory vector obtained through pre-training; for each memory vector, the key representation and value representation of the memory vector are determined based on the dot product of a preset key matrix and a preset value matrix with the memory vector.
[0030] Furthermore, the processing module is specifically used to determine, for each memory vector, a value obtained by the dot product of the feature vector and the key representation of the memory vector, and determine a target value obtained by the function with a preset value as the base; determine the sum of the target values of each memory vector; and determine the ratio of the target value of each memory vector to the sum, which is the weight of the corresponding memory vector.
[0031] Furthermore, the gate mechanism layer of the LLM includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each of the encoding recognition layers includes a gated sublayer and a Transformer sublayer connected in sequence; and each of the encoding recognition layers is connected in sequence, the gated sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier;
[0032] The processing module is specifically used for the Transformer layer to encode the time series to obtain a first output; the gating sublayer in each of the coding recognition layers determines the second sum vector of the received input vector and the feature representation, and determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix according to the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training; determines the difference matrix between the preset matrix and the reset gate matrix, and determines the second cross product matrix of the difference matrix and the feature representation, and the third cross product matrix of the feature representation and the reset gate matrix; determines the second sum matrix of the second cross product matrix and the third cross product matrix as the second output; the Transformer sublayer of each of the coding recognition layers encodes the second output of the gating sublayer of the corresponding coding recognition layer to obtain a third output; the fully connected layer of the gate mechanism layer of the LLM and the classifier determine the corresponding classification result according to the third output of the last coding identifier.
[0033] Furthermore, the processing module is specifically used to fine-tune the LLM in the following manner: obtain any sample time series in a pre-saved sample set, a sample feature vector determined for the sample time series, and a labeled classification result saved for the sample time series; input the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtain an output classification result output by the LLM; and fine-tune the LLM based on the labeled classification result and the output classification result.
[0034] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0035] A memory for storing program instructions;
[0036] The processor is used to call the program instructions stored in the memory and execute the steps included in any of the above classification methods according to the obtained program instructions.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes a classification method as described in any one of the above items.
[0038] In the embodiment of the present application, the electronic device obtains each data collected at a set interval within a preset time period, and inputs the time series composed of each data into the LLM. Since the data exists objectively and does not have factors such as subjectivity, ambiguity or incomplete information, the accuracy of classification can be improved. In addition, the electronic device determines the characteristic vector of the time series based on the trend, seasonality and residual corresponding to the trend vector, season vector and residual vector of the time series composed of each data, and inputs the characteristic vector of the time series into the LLM together, thereby further improving the accuracy of LLM recognition, thereby improving the accuracy of classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A process diagram of a classification method provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of the overall method architecture provided by an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the structure of the door mechanism layer provided in the embodiment of the present application;
[0043] Figure 4 A structural diagram of a classification device provided in an embodiment of the present application;
[0044] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages 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 accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.
[0046] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0047] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0048] The words "connected", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. The terms "first", "second", "third" and the like involved in this application are merely used to distinguish similar objects, and do not represent a specific ordering of objects.
[0049] In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0050] In order to solve the problem of low classification accuracy in the related art, the embodiments of the present application provide a classification method, apparatus, device and medium.
[0051] The classification method includes: obtaining each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; obtaining the trend, seasonality and residual of the time series composed of each data; inputting the trend, seasonality and residual into an encoder respectively, and obtaining the trend vector, season vector and residual vector output by the encoder; determining the first sum vector of the trend vector, season vector and residual vector as a feature vector; inputting the time series and the feature vector into a pre-fine-tuned large language model LLM, and obtaining the classification result output by the LLM.
[0052] Embodiment 1:
[0053] Figure 1 A process diagram of a classification method provided in an embodiment of the present application, the process includes the following steps:
[0054] S101: Acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, the seasonality and the residual into an encoder respectively, and acquire the trend vector, the season vector and the residual vector output by the encoder; determine the first sum vector of the trend vector, the season vector and the residual vector as a feature vector.
[0055] The classification method provided in the embodiment of the present application is applied to an electronic device, which may be a smart device such as a PC or a server.
[0056] In order to accurately and effectively determine the classification results, the electronic device can obtain each data collected at a set interval within a preset time period, where the preset time period can be one day, one week or one month, etc., and the set interval can be one hour, thirty minutes, one minute, etc., and each data can be pressure data or temperature data, etc.
[0057] The electronic device can process each collected data based on statistical analysis tools to form a time series composed of data. Specifically, how to determine the time series composed of data is an existing technology and will not be repeated here. After obtaining the time series, the electronic device can use existing toolkits, such as Seasonal-Trend Decomposition using Loess (STL) using local regression smoothing, to determine the trend, seasonality, and residuals corresponding to the time series. The characteristics of these time series can guide LLM to generate correct responses. Trends help identify the long-term laws of multiple data changes over time, such as whether there is a gradual upward or downward trend, which is extremely important for predicting future states and adjusting operating strategies; by analyzing seasonality, it is possible to better understand the specific impact of these periodic changes on pipeline pressure and temperature, so as to formulate more reasonable maintenance plans and scheduling strategies; residuals are the difference between actual observed values and expected values obtained by fitting trend and seasonal components. By analyzing residuals, potential abnormalities can be discovered in a timely manner, such as sudden pressure drops or temperature increases, which often indicate possible pipeline leaks or other emergencies.
[0058] Utilizing the features of time series is crucial for LLM. In order to better utilize the features of time series and incorporate them into LLM, an embodiment of the present application proposes using an encoder corresponding to the features of the time series to extract their potential representations, wherein the encoder may be a Transformer encoder. The electronic device may input the acquired trends, seasonality, and residuals into the encoder respectively, and calculate the feature representations of the trends, seasonality, and residuals through the encoder, specifically, obtaining the trend vector, season vector, and residual vector output by the encoder.
[0059] Among them, the obtained trend vector, season vector and residual vector are:
[0060]
[0061] Among them, s t For trend, s For seasonality, r is the residual, is the trend vector, is the season vector, is the residual vector, f {KE} Represents the encoder.
[0062] The electronic device also determines a sum vector of the trend vector, the season vector, and the residual vector. For the sake of distinction, the sum vector may be referred to as a first sum vector and determined as a feature vector. The feature vector may reveal the intrinsic structure of the time series and help identify key features.
[0063] Specifically, the electronic device may determine the characteristic vector using the following formula:
[0064]
[0065] Among them, h {s} For this feature vector, is the trend vector, is the season vector, is the residual vector.
[0066] Among them, the feature extraction module of the memory plug-in of the electronic device can be used to obtain the potential feature vector of the time series feature.
[0067] S102: Input the time series and the feature vector into a pre-fine-tuned LLM to obtain a classification result output by the LLM.
[0068] In order to classify accurately and effectively, the electronic device pre-adjusts the LLM, and after obtaining the feature vector, inputs the time series and the obtained feature vector into the pre-adjusted LLM to obtain the classification result output by the LLM, which can be faulty, normal, etc. Among them, fault means that the corresponding device fails, and normal means that the corresponding device operates normally.
[0069] By using the method provided in the embodiment of the present application, the feature vector corresponding to a given time series can be determined, thereby helping LLM to predict the classification results of the time series. Based on the feature vector, LLM can classify the time series. LLM can effectively learn the features in the data in the time series, thereby improving the accuracy of classification, and can make differentiated analysis of the features in the time series data.
[0070] In the embodiment of the present application, the electronic device obtains each data collected at a set interval within a preset time period, and inputs the time series composed of each data into the LLM. Since the data exists objectively and does not have factors such as subjectivity, ambiguity or incomplete information, the accuracy of classification can be improved. In addition, the electronic device determines the characteristic vector of the time series based on the trend, seasonality and residual corresponding to the trend vector, season vector and residual vector of the time series composed of each data, and inputs the characteristic vector of the time series into the LLM together, thereby further improving the accuracy of LLM recognition, thereby improving the accuracy of classification.
[0071] Embodiment 2:
[0072] In order to improve the accuracy of classification, based on the above embodiment, in the embodiment of the present application, the time series and the feature vector are input into a pre-fine-tuned LLM to obtain the classification result output by the LLM, including:
[0073] Input the time series and the feature vector into a pre-fine-tuned LLM;
[0074] The memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
[0075] In order to improve the accuracy of classification, LLM includes a memory layer and a gate mechanism layer. The electronic device inputs the time series and the acquired feature vector into the pre-tuned LLM. The memory layer of LLM obtains the key representation and value representation of each memory vector obtained through pre-training.
[0076] The memory layer of LLM can determine the weight of each memory vector based on the key representation and feature vector of each memory vector. These memory vectors are trainable parameters that store the characteristic patterns of patterned time series. In a possible implementation, the memory layer of LLM can determine the dot product of the feature vector and the key representation of the memory vector for each memory vector. The normalized value of the dot product of each memory vector obtained is determined as the weight of the corresponding memory vector. After determining the weight corresponding to each memory vector, the memory layer of LLM can apply the weight to the corresponding value representation. Specifically, the feature representation of the time series can be determined based on the weight of each memory vector and the value representation of each memory vector. Specifically, the memory layer of LLM determines the vector corresponding to the product of the weight of each memory vector and the value representation of each memory vector, and determines the sum value vector of each vector obtained as the feature representation of the time series.
[0077] Specifically, the memory layer can use the following formula to determine the feature representation of the time series:
[0078] a S =sum(p {n} *v {n} )
[0079] Among them, a S is the characteristic representation of the time series, p {n} is the weight of the nth memory vector, v {n} is the value representation of the nth memory vector.
[0080] Through this process, different memory vectors are assigned different weights according to the input feature vector. Therefore, the feature patterns of the time series that are critical for modeling the input receive higher weights than less important feature patterns. The feature representation of the weighted time series contains the key information for generating the input feature vector and is incorporated in the subsequent LLM processing.
[0081] The gate mechanism layer of LLM determines the corresponding classification result according to the time series and feature representation, and outputs the determined classification result.
[0082] The embodiment of the present application is equivalent to proposing a method for weighting different memory vectors based on the feature vector of the time series through a memory mechanism. The pattern of the time series features is stored through the memory mechanism. These specific patterns are used to classify the time series. By weighting different memory vectors, the importance of the pattern features of the time series is judged according to the input feature vector, and the pattern features of the important time series are selected to determine the corresponding classification results.
[0083] Figure 2 A schematic diagram of the overall method architecture provided in an embodiment of the present application.
[0084] Depend on Figure 2 It can be seen that a time series can be obtained, and the time series feature extraction module determines the feature vector of the time series. The memory layer of LLM determines the corresponding feature representation based on the feature vector, and the gate mechanism layer of LLM determines the corresponding classification result based on the time series and the feature representation.
[0085] Embodiment 3:
[0086] In order to accurately and effectively perform classification, based on the above embodiments, in the embodiment of the present application, the key representation and value representation of each memory vector obtained after pre-training are obtained, including:
[0087] Get each memory vector obtained after pre-training;
[0088] For each memory vector, a key representation and a value representation of the memory vector are determined according to a dot product of a preset key matrix and a preset value matrix with the memory vector.
[0089] In order to accurately and effectively perform classification, the memory layer of the LLM can obtain the key representation and value representation of each memory vector. Specifically, the memory layer of the LLM can obtain each memory vector obtained by pre-training, wherein each memory vector is a memory vector obtained by pre-training in the fine-tuned LLM. For each memory vector, the electronic device can use the preset key matrix and value matrix to extract the key representation and value representation after potential mapping.
[0090] The electronic device can determine the key representation and value representation of each memory vector using the following formula:
[0091] k {n} =W K ·m {n}
[0092] v {n} =W V ·m {n}
[0093] Among them, k {n} is the key representation, W K is the preset key matrix, m {n} is the nth memory vector, v {n} is the value, W V Indicates the preset value.
[0094] In order to determine the weight of each memory vector, based on the above embodiments, in the embodiment of the present application, the weight of each memory vector is determined according to the key representation of each memory vector and the feature vector, including:
[0095] For each memory vector, determine a value obtained by multiplying the feature vector by the key representation of the memory vector, and determine that the value is a target value obtained by the function with a preset value as the base;
[0096] Determine the sum of the target values of each memory vector; and determine the ratio of the target value of each memory vector to the sum as the weight of the corresponding memory vector.
[0097] In order to determine the weight of each memory vector, the memory layer of LLM can determine, for each memory vector, the value obtained by multiplying the key representation of the memory vector with the determined eigenvector, and determine the value determined with a preset value as the base as the target value obtained by the function, where the preset value can be e.
[0098] After determining the target value of each memory vector, the memory layer of the LLM can determine the sum of the target values of each memory vector, and for each memory vector, determine the ratio of the target value of the memory vector to the determined sum, and determine the ratio as the weight of the memory vector. Based on this approach, the weight of each memory vector can be determined. The method provided in the embodiment of the present application is equivalent to using the feature vector of the time series as a query, and calculating the weight of each memory vector based on their inner product.
[0099] Specifically, the weight of the memory vector can be determined using the following formula:
[0100]
[0101] Among them, p {n} is the weight of the nth memory vector, h {S} is the feature vector, k {n} is the key representation of the nth memory vector.
[0102] Embodiment 4:
[0103] In order to accurately and effectively perform classification, based on the above embodiments, in the embodiment of the present application, the gate mechanism layer of the LLM includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each of the encoding recognition layers includes a gating sublayer and a Transformer sublayer connected in sequence; and each of the encoding recognition layers is connected in sequence, the gating sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier;
[0104] The gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, including:
[0105] The Transformer layer encodes the time series to obtain a first output;
[0106] The gating sublayer in each of the coding recognition layers determines the second sum vector of the received input vector and the feature representation, and determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix according to the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training; determines the difference matrix between the preset matrix and the reset gate matrix, and determines the second cross product matrix of the difference matrix and the feature representation, and the third cross product matrix of the feature representation and the reset gate matrix; determines the second sum matrix of the second cross product matrix and the third cross product matrix as the second output; the Transformer sublayer of each of the coding recognition layers encodes the second output of the gating sublayer of the corresponding coding recognition layer to obtain the third output;
[0107] The fully connected layer of the gate mechanism layer of the LLM and the classifier determine the corresponding classification result according to the third output of the last encoding identifier.
[0108] Figure 3 A schematic diagram of the structure of the door mechanism layer provided in an embodiment of the present application.
[0109] Depend on Figure 3It can be seen that the gate mechanism layer includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each encoding recognition layer includes a gating sublayer and a Transformer sublayer connected in sequence; and each encoding recognition layer is connected in sequence, the gating sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier.
[0110] The Transformer layer of the gate mechanism layer of LLM encodes the time series to obtain the first output; the gating sublayer in each coding recognition layer determines the second sum vector of the received input vector and the feature representation, wherein the input vector received by the gating sublayer of the coding recognition layer connected to the Transformer layer in each coding recognition layer is the first output obtained by the Transformer layer; the input vector received by the gating sublayer of other coding recognition layers is the output of the Transformer sublayer of the previous connected coding recognition layer. The gating sublayer in each coding recognition layer determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix based on the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training. Specifically, it can be determined that when the input of the sigmoid function is the first sum matrix, the output of the sigmoid function is the reset gate matrix.
[0111] Specifically, the gating sublayer can use the following formula to determine the reset gate matrix:
[0112]
[0113] in, is the reset gate matrix determined by the gated sublayer in the lth encoding recognition layer, sigma is the sigmoid function, is the parameter matrix of the gated sublayer in the lth encoding recognition layer, is the input vector received by the gated sublayer in the lth encoding recognition layer, a S is the feature vector, is the parameter offset matrix of the gated sublayer in the lth coding recognition layer.
[0114] After determining the reset gate matrix, the gating sublayer may determine a difference matrix between a preset matrix and the reset gate matrix, wherein the preset matrix may have the same dimension as the reset gate matrix, and all values are 1. Furthermore, the gating sublayer may also determine a second cross product matrix between the difference matrix and the feature representation, and determine a third cross product matrix between the feature representation and the reset gate matrix; and determine a second sum matrix of the second cross product matrix and the third cross product matrix as a second output.
[0115] Specifically, the gating sublayer can use the following formula to determine the second output:
[0116]
[0117] in, is the second output determined by the gated sublayer in the lth encoding recognition layer, is the reset gate matrix determined by the gated sublayer in the lth encoding recognition layer, is the input vector received by the gated sublayer in the lth encoding recognition layer, 1 is the preset matrix, a S is the feature vector.
[0118] in, The information is input to the Transformer sublayer of the next coding recognition layer. In the embodiment of the present application, it is equivalent to balancing the information and knowledge information in the LLM based on the reset gate matrix.
[0119] The Transformer sublayer of each encoding recognition layer encodes the second output of the gating sublayer of the corresponding encoding recognition layer to obtain a third output.
[0120] The fully connected layer of the gate mechanism layer of the LLM processes according to the third output of the connected Transformer sublayer, and inputs the processing result into the classifier, and the classifier determines the corresponding classification result, wherein the classifier can be a normalized exponential function (softmax) classifier.
[0121] This gate mechanism layer can also be called LLM decoding with knowledge. It should be noted that the hint of LLM has a significant impact on the performance of LLM. Therefore, once the time series features are encoded and weighted, how to incorporate the resulting knowledge representation into LLM plays an important role in guiding LLM to generate responses. Intuitively, the contribution of time series feature representations in different contexts may be different. For example, when LLM has learned the knowledge, the time series feature representation obtained from the memory module may not be so important. Therefore, it is crucial to balance the contribution of the feature representation of the time series when incorporating it into the LLM. The embodiment of the present application proposes to use a gate mechanism layer to control the flow of information when incorporating the feature representation of the time series into the LLM.
[0122] The embodiment of the present application is equivalent to providing a large model time series classification method based on a memory mechanism. It should be noted that the application of LLM in the field of time series analysis has made significant progress. LLM learns language representation through pre-training, and then adapts to specific time series tasks such as classification, prediction, and anomaly detection through fine-tuning or direct query methods. Although it is challenging to train a new general time series model from scratch, existing studies have shown that pre-trained LLM can effectively capture complex dependencies in time series data and apply it to different fields, such as finance, medical care, and transportation. LLM usually tokenizes the input time series, designs targeted prompts, and fine-tunes strategies to enable it to better understand and predict time series data. In addition, combined with contextual knowledge in specific fields, these LLMs can not only provide more accurate predictions, but also play an important role in multimodal data processing and explanatory analysis.
[0123] In an embodiment of the present application, the memory plug-in uses a feature extraction module to obtain a potential representation of the features of a time series, that is, to obtain a feature vector, and then uses the memory layer of the LLM to weight these encoded feature representations according to their contribution to the memory vector; the gate mechanism layer of the large model uses the feature representation of the time series and the weighted time series to generate an output classification result.
[0124] Embodiment 5:
[0125] In order to classify accurately and effectively, based on the above embodiments, in the embodiment of the present application, the LLM is fine-tuned in the following manner:
[0126] Obtain any sample time series in a pre-saved sample set, a sample feature vector determined for the sample time series, and a labeled classification result saved for the sample time series;
[0127] Input the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtain the output classification result output by the LLM;
[0128] Based on the labeled classification result and the output classification result, the LLM is fine-tuned.
[0129] In order to achieve fine-tuning of the LLM, a sample set for fine-tuning is stored in the electronic device, and the sample set includes multiple sample time series, wherein the multiple sample time series are time series composed of data of different types of devices in different time periods.
[0130] In order to facilitate fine-tuning of LLM, the sample set also stores the corresponding sample feature vector and labeled classification results for each sample time series. The method for determining the sample feature vector corresponding to each sample time series is the same as the method for determining the feature vector in this application, and the specific method for determining it will not be repeated here.
[0131] The electronic device can obtain any sample time series in the pre-saved sample set, and obtain the sample feature vector saved for the sample time series, and the labeled classification result saved for the sample time series. The electronic device inputs the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtains the output of the LLM, which is the output classification result.
[0132] The electronic device may fine-tune the LLM according to the labeled classification result and the output classification result.
[0133] The LLM is fine-tuned in the above manner, and when the preset conditions are met, a fine-tuned LLM is obtained. The preset conditions may be that the number of sample time series in the sample set whose output classification results are consistent with the labeled classification results after passing through the LLM to be fine-tuned is greater than a set number; or the number of iterations of fine-tuning the LLM reaches the set maximum number of iterations, etc. Specifically, the embodiments of the present application do not limit this.
[0134] Embodiment 6:
[0135] Based on the same inventive concept, the present application embodiment provides a classification device, please refer to Figure 4 , the device comprises:
[0136] The acquisition module 401 is used to acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, seasonality and residual into an encoder respectively, and acquire the trend vector, seasonal vector and residual vector output by the encoder; determine the first sum vector of the trend vector, the seasonal vector and the residual vector as a feature vector;
[0137] The processing module 402 is used to input the time series and the feature vector into a pre-fine-tuned LLM to obtain a classification result output by the LLM.
[0138] In a possible implementation, the processing module 402 is specifically used to input the time series and the feature vector into a pre-fine-tuned LLM; the memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, and determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
[0139] In a possible implementation, the processing module 402 is specifically used to obtain each memory vector obtained through pre-training; for each memory vector, the key representation and value representation of the memory vector are determined based on the dot product of a preset key matrix and a preset value matrix with the memory vector.
[0140] In one possible implementation, the processing module 402 is specifically used to determine, for each memory vector, a value obtained by the dot product of the feature vector and the key representation of the memory vector, and determine a target value obtained by the function with a preset value as the base; determine the sum of the target values of each memory vector; and determine a ratio of the target value of each memory vector to the sum, which is the weight of the corresponding memory vector.
[0141] In a possible implementation, the gate mechanism layer of the LLM includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each of the encoding recognition layers includes a gating sublayer and a Transformer sublayer connected in sequence; and each of the encoding recognition layers is connected in sequence, the gating sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier;
[0142] The processing module 402 is specifically used for the Transformer layer to encode the time series to obtain a first output; the gating sublayer in each of the coding recognition layers determines the second sum vector of the received input vector and the feature representation, and determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix according to the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training; determines the difference matrix between the preset matrix and the reset gate matrix, and determines the second cross product matrix of the difference matrix and the feature representation, and the third cross product matrix of the feature representation and the reset gate matrix; determines the second sum matrix of the second cross product matrix and the third cross product matrix as the second output; the Transformer sublayer of each of the coding recognition layers encodes the second output of the gating sublayer of the corresponding coding recognition layer to obtain a third output; the fully connected layer of the gate mechanism layer of the LLM and the classifier determine the corresponding classification result according to the third output of the last coding identifier.
[0143] In a possible implementation, the processing module 402 is specifically used to fine-tune the LLM in the following manner: obtain any sample time series in a pre-saved sample set, a sample feature vector determined for the sample time series, and a labeled classification result saved for the sample time series; input the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtain an output classification result output by the LLM; and fine-tune the LLM based on the labeled classification result and the output classification result.
[0144] Embodiment 7:
[0145] Based on the same inventive concept, the present application embodiment provides an electronic device, which can realize the functions classified in the above text, please refer to Figure 5 The device includes a processor 501, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.
[0146] The memory 503 stores a computer program. When the program is executed by the processor 501, the processor 501 performs the following steps:
[0147] Acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, seasonality and residual into an encoder respectively, and acquire the trend vector, seasonal vector and residual vector output by the encoder; determine the first sum vector of the trend vector, seasonal vector and residual vector as a feature vector;
[0148] The time series and the feature vector are input into a pre-fine-tuned LLM to obtain a classification result output by the LLM.
[0149] In a possible implementation, inputting the time series and the feature vector into a pre-fine-tuned LLM to obtain a classification result output by the LLM includes:
[0150] Input the time series and the feature vector into a pre-fine-tuned LLM;
[0151] The memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
[0152] In a possible implementation manner, obtaining the key representation and value representation of each memory vector obtained through pre-training includes:
[0153] Get each memory vector obtained after pre-training;
[0154] For each memory vector, a key representation and a value representation of the memory vector are determined according to a dot product of a preset key matrix and a preset value matrix with the memory vector.
[0155] In a possible implementation, determining the weight of each memory vector according to the key representation of each memory vector and the feature vector includes:
[0156] For each memory vector, determine a value obtained by multiplying the feature vector by the key representation of the memory vector, and determine that the value is a target value obtained by the function with a preset value as the base;
[0157] Determine the sum of the target values of each memory vector; and determine the ratio of the target value of each memory vector to the sum as the weight of the corresponding memory vector.
[0158] In a possible implementation, the gate mechanism layer of the LLM includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each of the encoding recognition layers includes a gating sublayer and a Transformer sublayer connected in sequence; and each of the encoding recognition layers is connected in sequence, the gating sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier;
[0159] The gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, including:
[0160] The Transformer layer encodes the time series to obtain a first output;
[0161] The gating sublayer in each of the coding recognition layers determines the second sum vector of the received input vector and the feature representation, and determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix according to the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training; determines the difference matrix between the preset matrix and the reset gate matrix, and determines the second cross product matrix of the difference matrix and the feature representation, and the third cross product matrix of the feature representation and the reset gate matrix; determines the second sum matrix of the second cross product matrix and the third cross product matrix as the second output; the Transformer sublayer of each of the coding recognition layers encodes the second output of the gating sublayer of the corresponding coding recognition layer to obtain the third output;
[0162] The fully connected layer of the gate mechanism layer of the LLM and the classifier determine the corresponding classification result according to the third output of the last encoding identifier.
[0163] In one possible implementation, the LLM is fine-tuned in the following manner:
[0164] Obtain any sample time series in a pre-saved sample set, a sample feature vector determined for the sample time series, and a labeled classification result saved for the sample time series;
[0165] Input the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtain the output classification result output by the LLM;
[0166] Based on the labeled classification result and the output classification result, the LLM is fine-tuned.
[0167] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0168] The communication interface 502 is used for communication between the electronic device and other devices.
[0169] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0170] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0171] Embodiment 8:
[0172] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device. When the program runs on the electronic device, the electronic device implements the following steps when executing:
[0173] Acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, seasonality and residual into an encoder respectively, and acquire the trend vector, seasonal vector and residual vector output by the encoder; determine the first sum vector of the trend vector, seasonal vector and residual vector as a feature vector;
[0174] The time series and the feature vector are input into a pre-fine-tuned LLM to obtain a classification result output by the LLM.
[0175] In a possible implementation, inputting the time series and the feature vector into a pre-fine-tuned LLM to obtain a classification result output by the LLM includes:
[0176] Input the time series and the feature vector into a pre-fine-tuned LLM;
[0177] The memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
[0178] In a possible implementation manner, obtaining the key representation and value representation of each memory vector obtained through pre-training includes:
[0179] Get each memory vector obtained after pre-training;
[0180] For each memory vector, a key representation and a value representation of the memory vector are determined according to a dot product of a preset key matrix and a preset value matrix with the memory vector.
[0181] In a possible implementation, determining the weight of each memory vector according to the key representation of each memory vector and the feature vector includes:
[0182] For each memory vector, determine a value obtained by multiplying the feature vector by the key representation of the memory vector, and determine that the value is a target value obtained by the function with a preset value as the base;
[0183] Determine the sum of the target values of each memory vector; and determine the ratio of the target value of each memory vector to the sum as the weight of the corresponding memory vector.
[0184] In a possible implementation, the gate mechanism layer of the LLM includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each of the encoding recognition layers includes a gating sublayer and a Transformer sublayer connected in sequence; and each of the encoding recognition layers is connected in sequence, the gating sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier;
[0185] The gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, including:
[0186] The Transformer layer encodes the time series to obtain a first output;
[0187] The gating sublayer in each of the coding recognition layers determines the second sum vector of the received input vector and the feature representation, and determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix according to the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training; determines the difference matrix between the preset matrix and the reset gate matrix, and determines the second cross product matrix of the difference matrix and the feature representation, and the third cross product matrix of the feature representation and the reset gate matrix; determines the second sum matrix of the second cross product matrix and the third cross product matrix as the second output; the Transformer sublayer of each of the coding recognition layers encodes the second output of the gating sublayer of the corresponding coding recognition layer to obtain the third output;
[0188] The fully connected layer of the gate mechanism layer of the LLM and the classifier determine the corresponding classification result according to the third output of the last encoding identifier.
[0189] In one possible implementation, the LLM is fine-tuned in the following manner:
[0190] Obtain any sample time series in a pre-saved sample set, a sample feature vector determined for the sample time series, and a labeled classification result saved for the sample time series;
[0191] Input the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtain the output classification result output by the LLM;
[0192] Based on the labeled classification result and the output classification result, the LLM is fine-tuned.
[0193] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0194] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0195] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0197] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A classification method, characterized in that: The method comprises: Acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, seasonality and residual into an encoder respectively, and acquire the trend vector, seasonal vector and residual vector output by the encoder; determine the first sum vector of the trend vector, seasonal vector and residual vector as a feature vector; The time series and the feature vector are input into a pre-fine-tuned large language model LLM to obtain a classification result output by the LLM.
2. The method according to claim 1, characterized in that The step of inputting the time series and the feature vector into a pre-fine-tuned LLM to obtain a classification result output by the LLM includes: Input the time series and the feature vector into a pre-fine-tuned LLM; The memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
3. The method according to claim 2, characterized in that The step of obtaining the key representation and value representation of each memory vector obtained through pre-training includes: Get each memory vector obtained after pre-training; For each memory vector, a key representation and a value representation of the memory vector are determined according to a dot product of a preset key matrix and a preset value matrix with the memory vector.
4. The method according to claim 2, characterized in that: Determining the weight of each memory vector according to the key representation of each memory vector and the feature vector comprises: For each memory vector, determine a value obtained by multiplying the feature vector by the key representation of the memory vector, and determine that the value is a target value obtained by the function with a preset value as the base; Determine the sum of the target values of each memory vector; and determine the ratio of the target value of each memory vector to the sum as the weight of the corresponding memory vector.
5. The method according to claim 2, characterized in that: The gate mechanism layer of the LLM includes a Transformer layer, multiple encoding recognition layers, a fully connected layer and a classifier; each of the encoding recognition layers includes a gated sublayer and a Transformer sublayer connected in sequence; and each of the encoding recognition layers is connected in sequence, the gated sublayer of the first encoding recognition layer is connected to the Transformer layer; the Transformer sublayer of the last encoding recognition layer is connected to the fully connected layer; the other end of the fully connected layer is connected to the classifier; The gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, including: The Transformer layer encodes the time series to obtain a first output; The gating sublayer in each of the coding recognition layers determines the second sum vector of the received input vector and the feature representation, and determines the first cross product matrix of the parameter matrix of the gating sublayer obtained by pre-training and the second sum vector, and determines the reset gate matrix according to the first cross product matrix and the first sum matrix of the parameter offset matrix of the gating sublayer obtained by pre-training; determines the difference matrix between the preset matrix and the reset gate matrix, and determines the second cross product matrix of the difference matrix and the feature representation, and the third cross product matrix of the feature representation and the reset gate matrix; determines the second sum matrix of the second cross product matrix and the third cross product matrix as the second output; the Transformer sublayer of each of the coding recognition layers encodes the second output of the gating sublayer of the corresponding coding recognition layer to obtain the third output; The fully connected layer of the gate mechanism layer of the LLM and the classifier determine the corresponding classification result according to the third output of the last encoding identifier.
6. The method according to claim 1, characterized in that The LLM is fine-tuned in the following ways: Obtain any sample time series in a pre-saved sample set, a sample feature vector determined for the sample time series, and a labeled classification result saved for the sample time series; Input the sample time series and the sample feature vector into the LLM to be fine-tuned, and obtain the output classification result output by the LLM; Based on the labeled classification result and the output classification result, the LLM is fine-tuned.
7. A classification device, characterized in that: The device comprises: An acquisition module, used to acquire each data collected at a set interval within a preset time period; wherein the data is pressure data or temperature data; acquire the trend, seasonality and residual of the time series composed of each data; input the trend, seasonality and residual into an encoder respectively, and acquire the trend vector, seasonal vector and residual vector output by the encoder; determine the first sum vector of the trend vector, the seasonal vector and the residual vector as a feature vector; The processing module is used to input the time series and the feature vector into a pre-fine-tuned large language model LLM to obtain a classification result output by the LLM.
8. The device according to claim 7, characterized in that The processing module is specifically used to input the time series and the feature vector into a pre-fine-tuned LLM; the memory layer of the LLM obtains the key representation and value representation of each memory vector obtained through pre-training, and determines the weight of each memory vector according to the key representation of each memory vector and the feature vector; determines the feature representation of the time series according to the weight of each memory vector and the value representation of each memory vector; the gate mechanism layer of the LLM determines the corresponding classification result according to the time series and the feature representation, and outputs it.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in the classification method according to any one of claims 1 to 6 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps included in the classification method according to any one of claims 1 to 6.