Trusted time sequence prediction method based on big language model fusion knowledge graph
By integrating large language models and knowledge graphs, a time series prediction model is constructed to model uncertainty, solving the problems of generalization and noise impact in time series prediction and achieving reliable time series prediction.
Patent Information
- Application Number
- CN202511442525.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-10-10
AI Technical Summary
Existing time series forecasting methods lack uncertainty estimation, making it difficult to generalize effectively in diverse application scenarios. Furthermore, they are susceptible to random noise and outliers, leading to overconfidence and erroneous predictions.
We adopt a method based on large language model and knowledge graph fusion. By constructing a normalization module, a feature extraction module and a knowledge graph module, and combining the normal inverse gamma distribution parameters to model uncertainty, we optimize the time series prediction model.
It improves the accuracy and reliability of time series forecasting, captures the changes in different components of time series data, provides reliable forecast results, and reduces the impact of random fluctuations.
Smart Images

Figure CN120910484A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multi-disciplinary intersection of time series prediction, large language model and knowledge graph, and particularly relates to a credible time series prediction method based on large language model fusion knowledge graph. BACKGROUND
[0002] Time series prediction plays a crucial role in many fields, including weather forecasting, energy systems, traffic management, and medical analysis, which brings many opportunities such as reducing costs, improving efficiency and enhancing competitiveness. The core is to predict future time changes based on historical observation data of time series. Therefore, it is very important to develop a deep learning-based time series prediction method, which has great practical value and academic research value.
[0003] However, the time series prediction task faces three major challenges: first, time series have different components, and how to accurately capture the changes of different components is a major problem of time series prediction. Second, each time series prediction task requires specialized domain knowledge and task-specific design to achieve accurate prediction. However, due to the fact that time series in different fields often exhibit completely different time patterns, these specific task models are difficult to effectively generalize in diverse application scenarios. Large language models have shown excellent performance in a variety of natural language processing tasks and computer vision tasks, but time series data inherently have strong spatiotemporal dependence, which is significantly different from the semantic structure in natural language. Therefore, how to use its prior knowledge in semantic understanding to enhance the adaptability of large language models to time series prediction tasks has become a key problem in current research. Finally, time series data are often affected by random noise, outliers and unexpected events, making it difficult for the model to generate accurate point predictions.
[0004] However, existing time series prediction methods generally lack uncertainty estimation, and when data drift or insufficient training samples occur, the model often makes overconfident and incorrect predictions. SUMMARY
[0005] In view of the above situation, the main purpose of the present application is to provide a credible time series prediction method and system based on large language model fusion knowledge graph to solve the above technical problems.
[0006] The present application provides a credible time series prediction method based on large language model fusion knowledge graph, which comprises the following steps: Step 1, a normalization module is constructed based on a reversible normalization method, a feature extraction module is constructed based on an additive trend seasonal decomposition method and a linear mapping layer, a knowledge graph construction module is constructed based on a two-layer edge connection strategy, and a time series prediction model is formed by using the normalization module, the feature extraction module and the knowledge graph construction module; Step 2, the original time series data is obtained, and the normalization module is used to normalize the original time series data to obtain normalized time series data; Step 3, the feature extraction module is used to extract features from the normalized time series data to obtain time series embedding; Step 4, the linear mapping layer is used to linearly map the word embedding of the pre-trained large language model to obtain time series semantic anchor points, the knowledge graph construction module is used to process the time series semantic anchor points to obtain a time series knowledge graph, the prefix prompt sequence is selected from the time series knowledge graph, and the time series embedding is spliced to obtain an enhanced time series embedding; Step 5, the enhanced time series embedding is input into the pre-trained large language model for processing to obtain normal inverse gamma distribution parameters, and inverse standardization processing is performed to obtain a prediction value; the normal inverse gamma distribution parameters are used to calculate the accidental uncertainty and the cognitive uncertainty respectively; the uncertainty loss function is constructed based on the normal inverse gamma distribution parameters, the mean square error loss function is constructed based on the prediction value, the uncertainty loss function and the mean square error loss function are used to optimize the time series prediction model, and the optimized time series prediction model is obtained; the original time series data is input into the optimized time series prediction model for processing to obtain a final prediction result.
[0007] Compared with the prior art, the beneficial effects of the present application are: The present application fuses the time series knowledge graph and aligns it with the input time series data to improve the time series prediction capability of the large language model; the accidental uncertainty and the cognitive uncertainty of the time series prediction result are modeled to provide a reliable prediction result; the different components of the time series data are decomposed and modeled to capture the subtle changes of the different components of the time series data; and experiments have verified that the present application performs well on multiple time series data sets.
[0008] Additional aspects and advantages of the present application will be partially given in the following description, partially become obvious from the following description, or be understood by embodiments of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0009] Figure 1 A step flowchart of a reliable time series prediction method based on a large language model fused with a knowledge graph is proposed in the present application; Figure 2A general framework diagram of a trusted time series prediction method based on a large language model and knowledge graph is proposed for the present application. Figure 3 The construction process of the time series knowledge graph is for the present application. DETAILED DESCRIPTION
[0010] Embodiments of the present application will be described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application.
[0011] These and other aspects of embodiments of the present application will become apparent from the following description and the accompanying drawings. In these descriptions and drawings, some specific implementations of embodiments of the present application are specifically disclosed to represent some ways of implementing the principles of embodiments of the present application, but it should be understood that the scope of embodiments of the present application is not limited thereto.
[0012] Referring to Figure 1 The present embodiment provides a trusted time series prediction method based on a large language model and knowledge graph, which comprises the following steps: Step 1, a normalization module is constructed based on a reversible normalization method, a feature extraction module is constructed based on an additive trend season decomposition method and a linear mapping layer, a knowledge graph construction module is constructed based on a two-layer edge connection strategy, and a time series prediction model is constructed using the normalization module, the feature extraction module and the knowledge graph construction module.
[0013] Step 2, the original time series data is obtained, and the normalization module is used to normalize the original time series data to obtain normalized time series data.
[0014] Referring to Figure 2 In step 2, the original time series data is obtained, and the normalization module is used to normalize the original time series data to obtain normalized time series data, and the following relationship exists in the corresponding process: ; Wherein, denotes the normalized time series data, and both denote trainable parameters, denotes the original time series data, denotes the mean of the original time series data, denotes the variance of the original time series data, denotes a small constant added to prevent division by zero.
[0015] Step 3, feature extraction is performed on the normalized time series data by using a feature extraction module to obtain time series embedding.
[0016] In step 3, feature extraction is performed on the normalized time series data by using a feature extraction module to obtain time series embedding, which includes the following sub-steps: Based on the additive trend season decomposition method, the average pooling layer is used to move on the time axis to extract the trend component of the normalized time series data to obtain the trend component of the time series data, and the following relationship exists in the process: ; wherein, represents the trend component of the time series data, represents a pre-set trend length parameter, represents the value of the normalized time series data at time ; The normalized time series data is subtracted by the trend component of the time series data to obtain the time series data with the trend component removed, and the following relationship exists in the process: ; wherein, represents the time series data with the trend component removed; Based on the pre-set season length parameter, the season period is determined, and the average value of the time series data with the trend component removed is calculated within the season period to obtain the season component of the time series data, and the following relationship exists in the process: ; wherein, represents a set of data points in the time series with phase , represents the index position of the time series data, represents the remainder, represents a pre-set season length parameter, represents the phase position in the season period, represents the season component of the time series data; The normalized time series data is subtracted by the time series data with the trend component removed and the season component of the time series data to obtain the residual component of the time series data, and the following relationship exists in the process: ; wherein, represents the residual component of the time series data; The trend component, seasonal component, and residual component of the time series data are decomposed and then concatenated to obtain the concatenated time series block sequence. The following relationship exists in the corresponding process: ; in, This represents the concatenated sequence of time blocks. This indicates the trend components of the time series data after it has been segmented. This represents the seasonal component of the time-series data after it has been segmented. This represents the residual components of the time-series data after it has been divided into blocks; A linear mapping layer is used to perform linear mapping on the spliced time series block sequence to obtain the time series embedding.
[0017] Step 4: Use a linear mapping layer to perform linear mapping on the word embeddings of the pre-trained large language model to obtain time-series semantic anchors; use the knowledge graph construction module to process the time-series semantic anchors to obtain a time-series knowledge graph; select prefix prompt sequences from the time-series knowledge graph and concatenate them with the time-series embeddings to obtain the enhanced time-series embeddings.
[0018] Please see Figure 3 In step 4, a linear mapping layer is used to perform linear mapping processing on the word embeddings of the pre-trained large language model to obtain time-series semantic anchors; the knowledge graph construction module is used to process the time-series semantic anchors to obtain a time-series knowledge graph; prefix prompt sequences are selected from the time-series knowledge graph and concatenated with the time-series embeddings to obtain the enhanced time-series embeddings. Specifically, this includes the following sub-steps: A linear mapping layer is used to perform linear mapping on the word embeddings of the pre-trained large language model to obtain time series semantic anchors. The following relationship exists in the mapping process: ; in, Represents the i-th after linear mapping A semantic anchor point, Indexes representing semantic anchors Indicates the total number of word embeddings. Index representing word embeddings, Indicates the first The semantic anchor point and the first Mapping weights between word embeddings Indicates the first Word embedding; Based on a two-layer edge connection strategy, keyword edges between time-series semantic anchors are constructed using a mapping weight matrix from word embeddings to time-series semantic anchors. The following relationship exists in the correspondence process: ; wherein, denotes the number of shared keywords between the th semantic anchor and the th semantic anchor, denotes the number of overlapping keywords between two inputs with high mapping weight, denotes a pre-set keyword threshold parameter, denotes whether the keyword edge exists or not; It should be noted that when denotes that there is a keyword edge between the th semantic anchor and the th semantic anchor, and when denotes that there is no keyword edge between the th semantic anchor and the th semantic anchor.
[0019] The cosine similarity between the time series semantic anchors is calculated to obtain the semantic similarity between the time series semantic anchors, and there is a relationship formula in the corresponding process as follows: ; wherein, denotes the semantic similarity between the th semantic anchor and the th semantic anchor, denotes the cosine similarity calculation; When the semantic similarity between two time series semantic anchors exceeds the threshold , a semantic similarity edge is added, otherwise, it is not added; wherein, denotes a pre-set semantic similarity threshold; Based on the time series semantic anchors, keyword edges and semantic similarity edges, a knowledge graph is constructed; From the knowledge graph, a prefix prompt sequence is screened out, the prefix prompt sequence is spliced with the time series embedding to obtain an enhanced time series embedding ; wherein, denotes the prefix prompt sequence, denotes the enhanced time series embedding, denotes the time series embedding.
[0020] Further, the prefix prompt sequence is screened out from the knowledge graph, which specifically includes the following sub-steps: From the knowledge graph, the node with the highest semantic similarity with the time series embedding is selected As a starting point, and will be related to the nodes All directly connected nodes are added to the candidate node sequence; in, This represents the node with the highest semantic similarity to the time series embedding; S401. If the number of nodes in the candidate node sequence is still lower than the threshold. Then it will be with Directly connected nodes are added to the candidate node sequence; among them, Is with The nodes that are directly connected and have the highest semantic similarity; in, This indicates a pre-set node threshold. Repeat step S401 iteratively until the number of nodes in the candidate node sequence reaches a threshold. To obtain the prefix hint sequence.
[0021] It should be noted that, in Figure 3 middle, Both represent semantic anchors for time series.
[0022] Step 5: The enhanced time series data is embedded into a pre-trained large language model for processing to obtain the normal inverse gamma distribution parameters, and inverse standardization is performed to obtain the predicted values. Random uncertainty and cognitive uncertainty are calculated using the normal inverse gamma distribution parameters. An uncertainty loss function is constructed based on the normal inverse gamma distribution parameters, and a mean squared error loss function is constructed based on the predicted values. The uncertainty loss function and the mean squared error loss function are used to optimize the time series prediction model, resulting in an optimized time series prediction model. The original time series data is input into the optimized time series prediction model for processing to obtain the final prediction results. In step 5, the enhanced time series data is embedded into a pre-trained large language model for processing to obtain the normal inverse gamma distribution parameters, and inverse standardization is performed to obtain the predicted values. Random uncertainty and cognitive uncertainty are calculated using the normal inverse gamma distribution parameters. An uncertainty loss function is constructed based on the normal inverse gamma distribution parameters, and a mean squared error loss function is constructed based on the predicted values. The time series prediction model is optimized using the uncertainty loss function and the mean squared error loss function to obtain the optimized time series prediction model. The original time series data is input into the optimized time series prediction model for processing to obtain the final prediction result. Specifically, this includes the following sub-steps: The enhanced time series data is embedded into a pre-trained large language model for prediction to obtain a predictive representation. The prediction representation is divided into three equal parts to obtain the representation of the trend component, the representation of the seasonal component, and the representation of the residual component, respectively. The representation of the trend component, the representation of the seasonal component and the representation of the residual component are spliced and input into a linear mapping layer for processing to obtain a parameter set, and the following relationship exists in the corresponding process: ; wherein, represents the spliced feature, represents the representation of the trend component, represents the representation of the seasonal component, represents the representation of the residual component, represents transposition, represents the parameter set, and ; all represent parameters in the parameter set, represents a weight matrix, represents a bias term; S501, three components of the parameter are added to obtain the parameter of the normal inverse gamma distribution, and the following relationship exists in the corresponding process: ; wherein, represents the parameter of the normal inverse gamma distribution, represents the trend component of the parameter , represents the seasonal component of the parameter , represents the residual component of the parameter ; The parameter is repeated in the step of S501 respectively to obtain the parameter of the normal inverse gamma distribution respectively; wherein, all represent the parameter of the normal inverse gamma distribution; It should be noted that after the representation of the trend component, the representation of the seasonal component and the representation of the residual component are spliced and input into a linear mapping layer for processing, a prediction result containing the three components of trend, season and residual will be output, and distribution parameters for estimating the uncertainty of each component will also be output, such as the trend output component . Next, to restore the predicted time series and model the uncertainty thereof, the output parameters of each component are added to obtain the parameter of the normal inverse gamma distribution; wherein, represents the trend component of the parameter , represents the trend component of the parameter , represents the trend component of the parameter trend component.
[0023] parameters of inverse normal-gamma distribution inverse normalization is performed to obtain the prediction value, and the following relationship exists in the corresponding process: ; wherein, denotes the prediction value; Suppose that the target label is subject to Gaussian distribution, the distribution of the target label is approximated by using the parameters of inverse normal-gamma distribution, and the accidental uncertainty and the cognitive uncertainty are calculated respectively, and the following relationship exists in the corresponding process: ; wherein, denotes the parameter high-order conjugate prior, denotes the parameter of Gaussian distribution, and ; denotes the parameter of inverse normal-gamma distribution, and ; denotes the mean of the target label, denotes the variance of the target label, denotes the gamma function, denotes the exponential function, denotes the accidental uncertainty, denotes the mathematical expectation of the variance , denotes the cognitive uncertainty, denotes the square difference of the mean ; The uncertainty loss function is constructed based on the parameters of inverse normal-gamma distribution, and the following relationship exists in the corresponding process: ; wherein, denotes the negative logarithm of model evidence, denotes taking logarithm, denotes the total evidence amount of evidence distribution, and ; denotes the target label, denotes the evidence regularization term, denotes the uncertainty loss, denotes the regularization coefficient, which is used to balance the uncertainty inflation and the model fitting performance; The mean square error loss function is constructed based on the prediction value, and the following relationship exists in the corresponding process: ; wherein, denotes the mean square error loss, denotes the prediction length, represents the future prediction value of the time step, represents the future label of the time step; The time series prediction model is optimized by using the uncertainty loss function and the mean square error loss function to obtain an optimized time series prediction model; and the original time series data is input into the optimized time series prediction model for processing to obtain a final prediction result.
[0024] Further, the total training loss is: ; Wherein, represents the total training loss.
[0025] It should be noted that by modeling uncertainty, the random fluctuations caused by inherent noise of data and the prediction limitations caused by insufficient model cognition are accurately quantified, the prediction result is reduced from unreliable prediction interference, and a truly robust and reliable result is provided for time series prediction.
[0026] In order to verify the effectiveness of the present application, the method of the present application is tested, and the test results are as follows: Table 1 and Table 2 are objective performance evaluation of the method (LANet) of the present application on the lesion detection task and the performance evaluation of a variety of mainstream segmentation models on two data sets, and Table 3 is the performance evaluation of the knowledge graph in short-term prediction.
[0027] Table 1 Evaluation of each method MSE index on time series data set
[0028] Wherein, TIME-KGNU represents a baseline method fused with a knowledge graph module; Table 2 Evaluation of each method MAE index on time series data set
[0029] Table 3 Performance evaluation of the knowledge graph module on the M4 data set
[0030] It should be understood that, although the steps in the flowcharts of the embodiments of the present application are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other sequences. Moreover, at least some of the steps in the embodiments can include a plurality of sub-steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0031] It should be understood that the parts of the present application can be realized by hardware, software, firmware or a combination thereof. In the above-described embodiments, a plurality of steps or methods can be realized by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if realized by hardware, as in another embodiment, any one or a combination of the following technologies known in the art can be used: discrete logic circuit with logic gate circuit for implementing logic functions on data signals, application specific integrated circuit with suitable combination logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA), etc.
[0032] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0033] The above-described embodiments only express several implementation manners of the present application, which are described in detail and specifically, but cannot be understood as limiting the scope of the patent of the present application. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, which are all within the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A trusted time series prediction method based on large language model fusion knowledge graph, characterized in that, The method comprises the following steps: Step 1, constructing a normalization module based on a reversible normalization method, and constructing a feature extraction module based on an additive trend seasonal decomposition method and a linear mapping layer; Constructing a knowledge graph construction module based on a two-layer edge connection strategy, and using the normalization module, the feature extraction module and the knowledge graph construction module to constitute a time series prediction model; Step 2, obtaining original time series data, and using the normalization module to normalize the original time series data to obtain normalized time series data; Step 3, using the feature extraction module to extract features from the normalized time series data to obtain time series embeddings; Step 4, using the linear mapping layer to linearly map the word embeddings of the pre-trained large language model to obtain time series semantic anchor points; using the knowledge graph construction module to process the time series semantic anchor points to obtain a time series knowledge graph; filtering the prefix prompt sequence from the time series knowledge graph, and splicing it with the time series embedding to obtain an enhanced time series embedding; Step 5, inputting the enhanced time series embedding into the pre-trained large language model for processing to obtain normal inverse gamma distribution parameters, and performing inverse standardization processing to obtain a prediction value; Using the normal inverse gamma distribution parameters to calculate the accidental uncertainty and the cognitive uncertainty respectively; constructing an uncertainty loss function based on the normal inverse gamma distribution parameters, constructing a mean square error loss function based on the prediction value, and optimizing the time series prediction model using the uncertainty loss function and the mean square error loss function to obtain an optimized time series prediction model; inputting the original time series data into the optimized time series prediction model for processing to obtain a final prediction result.
2. The method of claim 1, wherein the method comprises: In the step 2, the original time series data is obtained, and the normalization module is used to normalize the original time series data to obtain normalized time series data, and the following relationship exists in the corresponding process: ; wherein, denotes the normalized time series data, denotes the normalized time series data, denotes the trainable parameters, denotes the original time series data, denotes the mean of the original time series data, denotes the variance of the original time series data, denotes a small constant added to prevent division by zero.
3. The method of claim 2, wherein the method further comprises: In the step 3, the feature extraction module is used to extract features from the normalized time series data to obtain time series embeddings, which specifically includes the following substeps: Based on the additive trend seasonal decomposition method, the average pooling layer is used to move on the time axis to extract the trend component of the normalized time series data to obtain the trend component of the time series data; Subtract the trend component of the time series data from the normalized time series data to obtain the time series data without trend component; Determine the seasonal period based on the pre-set seasonal length parameter, and calculate the average value of the time series data without trend component in the seasonal period to obtain the seasonal component of the time series data; Subtract the time series data without trend component and the seasonal component of the time series data from the normalized time series data to obtain the residual component of the time series data; Decompose the trend component of the time series data, the seasonal component of the time series data and the residual component of the time series data, and splice them to obtain the spliced time series block sequence; Using the linear mapping layer to linearly map the spliced time series block sequence to obtain the time series embedding.
4. The method according to claim 3, wherein, In the step of moving the average pooling layer on the time axis to extract the trend component of the normalized time series data to obtain the trend component of the time series data based on the additive trend seasonal decomposition method, the following relationship exists: ; wherein, represents a trend component of the time series data, represents a pre-set trend length parameter, represents a value of the normalized time series data at time point . In the step of subtracting the trend component of the time series data from the normalized time series data to obtain the time series data with the trend component removed, the following relationship exists: ; wherein, denotes the time series data with the trend component removed; In the step of determining the seasonal period based on the pre-set seasonal length parameter, calculating the average value of the time series data with the trend component removed within the seasonal period to obtain the seasonal component of the time series data, the following relationship exists: ; wherein, represents a set of data points in the time series with all position phases , represents an index position of the time series data, represents a modulo operation, represents a pre-set seasonality length parameter, represents a phase position in the season cycle, represents a seasonal component of the time series data; In the step of subtracting the time series data with the trend component removed and the seasonal component of the time series data from the normalized time series data to obtain the residual component of the time series data, the following relationship exists: ; wherein represents the residual component of the time series data; In the step of decomposing the trend component of the time series data, the seasonal component of the time series data, and the residual component of the time series data, and splicing to obtain the spliced time series block sequence, the following relationship exists: ; wherein, denotes the sequence of concatenated time series blocks, denotes the trend component of the segmented time series data, denotes the seasonal component of the segmented time series data, denotes the residual component of the segmented time series data.
5. The method according to claim 4, wherein, In the step 4, the word embedding of the pre-trained large language model is linearly mapped by using a linear mapping layer to obtain a time series semantic anchor point; the time series semantic anchor point is processed by using a knowledge graph construction module to obtain a time series knowledge graph; a prefix prompt sequence is selected from the time series knowledge graph, and is spliced with the time series embedding to obtain an enhanced time series embedding, which specifically includes the following sub-steps: The word embedding of the pre-trained large language model is linearly mapped by using a linear mapping layer to obtain a time series semantic anchor point; Based on a two-layer edge connection strategy, a mapping weight matrix from the word embedding to the time series semantic anchor point is used to construct a keyword edge between the time series semantic anchor points; The cosine similarity between the time series semantic anchor points is calculated to obtain the semantic similarity between the time series semantic anchor points; when the semantic similarity between two time series semantic anchor points exceeds a threshold value a semantic similarity edge is added, otherwise not. wherein, represents a pre-set semantic similarity threshold value; A knowledge graph is constructed based on the time series semantic anchor points, the keyword edge, and the semantic similarity edge; prefix prompt sequence is filtered from the knowledge graph the prefix prompt sequence is concatenated with the time sequence embedding to obtain an enhanced time sequence embedding ; wherein, denotes a prefix hint sequence, both denote a time-series semantic anchor related to a time-series embedding, denotes an enhanced time-series embedding, denotes a time-series embedding.
6. The method of claim 5, wherein the method is characterized by, In the step of linearly mapping the word embedding of the pre-trained large language model by using a linear mapping layer to obtain a time series semantic anchor point, the following relationship exists: ; wherein, represents the i-th semantic anchor after linear mapping, represents the i-th semantic anchor, represents the index of the semantic anchor, represents the total number of word embeddings, represents the index of the word embedding, represents the i-th semantic anchor, represents the i-th word embedding, represents the mapping weight between the i-th semantic anchor and the j-th word embedding, represents the i-th word embedding, represents the j-th word embedding; In the step of constructing a keyword edge between the time series semantic anchor points based on a two-layer edge connection strategy, using a mapping weight matrix from the word embedding to the time series semantic anchor point, the following relationship exists: ; wherein, represents the number of shared keywords between the first semantic anchor and the second semantic anchor, represents the number of overlapping keywords between the two inputs that have a high mapping weight, represents a pre-set keyword threshold parameter, represents whether the keyword edge exists; In the step of calculating the cosine similarity between the time series semantic anchor points to obtain the semantic similarity between the time series semantic anchor points, the following relationship exists: ; wherein, represents the semantic similarity of the first semantic anchor point and the second semantic anchor point, represents the semantic similarity of the first semantic anchor point and the second semantic anchor point, represents the semantic similarity of the first semantic anchor point and the second semantic anchor point, represents the cosine similarity calculation.
7. The method according to claim 6, wherein, The prefix prompt sequence is selected from the knowledge graph, which specifically includes the following sub-steps: selecting from the knowledge graph the node with the highest semantic similarity to the time series embedding as a starting point, and adding to the candidate node sequence all nodes directly connected to the node all directly connected nodes are added to the candidate node sequence; wherein, represents the node with the highest semantic similarity to the time series embedding; S401、If the number of nodes in the candidate node sequence is still lower than the threshold value , then add the node directly connected with to the candidate node sequence; wherein, is the node directly connected with and having the highest semantic similarity degree; wherein, represents a pre-set node threshold value; The step of S401 is repeated in an iterative form until the number of nodes in the candidate node sequence reaches a threshold value to obtain the prefix prompt sequence.
8. The method of claim 7, wherein the method is characterized by, In the step 5, the enhanced time series embedding is input into the pre-trained large language model for processing to obtain a normal inverse gamma distribution parameter, and inverse standardization processing is performed to obtain a prediction value; The normal inverse gamma distribution parameter is used to calculate the accidental uncertainty and the cognitive uncertainty, respectively, an uncertainty loss function is constructed based on the normal inverse gamma distribution parameter, and a mean square error loss function is constructed based on the prediction value, which specifically includes the following sub-steps: The enhanced time series is input into a pre-trained large language model for prediction to obtain a predicted representation; The predicted representation is processed in three equal parts to obtain a representation of a trend component, a representation of a seasonal component, and a representation of a residual component, respectively; The representation of the trend component, the representation of the seasonal component and the representation of the residual component are spliced and input into a linear mapping layer for processing to obtain a parameter set ; wherein denotes a parameter set, each denotes a parameter in the parameter set; S501, add the three components of the parameter of the normal inverse gamma distribution ; wherein denote parameters of the inverse normal-gamma distribution; The parameters The steps of S501 are repeated to obtain the parameters of the inverse gamma distribution respectively. wherein both denote parameters of a normal inverse gamma distribution; Parameterizing inverse-gamma distributions inverse normalization is performed to obtain a predicted value; Supposing that the target label follows a Gaussian distribution, the distribution of the target label is approximated by normal inverse gamma distribution parameters, and accidental uncertainty and cognitive uncertainty are calculated, respectively; An uncertainty loss function is constructed based on the normal inverse gamma distribution parameters; A mean square error loss function is constructed based on the predicted value.
9. The method of claim 8, wherein the method further comprises: In the step of splicing the representation of the trend component, the representation of the seasonal component, and the representation of the residual component, and inputting them into a linear mapping layer for processing to obtain a parameter set, the following relationship exists: ; wherein, denotes a representation of the concatenated features, denotes a representation of the trend component, denotes a representation of the seasonal component, denotes a representation of the residual component, denotes a transpose, denotes a weight matrix, denotes a bias term; In a step of adding the three components of the parameter to obtain the parameter of the inverse normal gamma distribution, the following relation holds: ; wherein, denotes a trend component of the parameter , denotes a seasonal component of the parameter , denotes a residual component of the parameter ; In the case of the inverse normal gamma distribution, the parameters In the step of performing inverse normalization to obtain the predicted value, the following relationship exists: ; wherein represents a predicted value; In the step of supposing that the target label follows a Gaussian distribution, approximating the distribution of the target label by normal inverse gamma distribution parameters, and calculating accidental uncertainty and cognitive uncertainty, respectively, the following relationship exists: ; wherein denote parameters high-order conjugate prior, denote parameters of a Gaussian distribution, and ; denote parameters of a Normal-Inverse-Gamma distribution, denote the mean of the target label, denote the variance of the target label, denote the gamma function, denote the exponential function, denote the accidental uncertainty, denote the mathematical expectation of the variance , denote the cognitive uncertainty, denote the squared difference of the mean . In the step of constructing an uncertainty loss function based on the normal inverse gamma distribution parameters, the following relationship exists: ; wherein, denotes the negative log of the model evidence, denotes taking the log, denotes the total evidence quantity of the evidence distribution, and ; denotes the target label, denotes the evidence regularization term, denotes the uncertainty loss, denotes the regularization coefficient; In the step of constructing a mean square error loss function based on the predicted value, the following relationship exists: ; wherein, denotes the mean squared error loss, denotes the prediction length, denotes the predicted values for the future time steps, denotes the labels for the future time steps.
Citation Information
Patent Citations
Federal learning-based time series model uncertainty correction method and system
CN118410082A
Technical trend prediction method and system based on multi-layer fine tuning of large language model
CN119807393A
Enterprise time sequence knowledge graph entity alignment method and system
CN119886143A
Multi-modal enhanced satellite telemetry data multi-task processing system and method
CN120508760A
Method and system for multi-modal time-series retrieval through latent space projections
US20250181596A1
Cited By
Training method of time series data classification model, data classification method and related equipment
CN121301942A
Method for training time series data classification model, data classification method and related equipment
CN121301942B