A reliable temporal prediction method based on large language model fusion knowledge graph
By integrating large language models and knowledge graphs, the components of time series data are decomposed and modeled. The model is optimized using normal inverse gamma distribution parameters, which solves the uncertainty problem in time series prediction and achieves more accurate and reliable predictions.
Patent Information
- Application Number
- CN202511442525.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-10-10
Smart Images

Figure CN120910484B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the multidisciplinary field of time series prediction, large language models, and knowledge graphs, and particularly to a reliable time series prediction method based on large language models and knowledge graphs. Background Technology
[0002] Time series forecasting plays a crucial role in numerous fields, including weather forecasting, energy systems, traffic management, and medical analytics. These applications offer many opportunities, such as cost reduction, efficiency improvement, and enhanced competitiveness. At its core, it uses historical observational data to predict future temporal changes. Therefore, developing deep learning-based time series forecasting methods is of great importance, possessing significant practical and academic research value.
[0003] However, time series prediction tasks face three major challenges: First, time series have different components, and accurately capturing the changes in these different components is a major challenge for time series prediction. Second, each time series prediction task requires specialized domain knowledge and task-specific design to achieve accurate predictions. However, because time series from different domains often exhibit drastically different temporal patterns, these task-specific models struggle to generalize effectively across diverse application scenarios. Large language models have demonstrated superior performance in various natural language processing and computer vision tasks, but time series data inherently possesses strong spatiotemporal dependencies, which differ significantly from the semantic structure of natural language. Therefore, leveraging their prior knowledge in semantic understanding to enhance the adaptability of large language models to time series prediction tasks has become a key research issue. Finally, time series data is often affected by random noise, outliers, and sudden fluctuations caused by unexpected events, making it difficult for models to generate accurate point predictions.
[0004] However, existing time series forecasting methods generally lack uncertainty estimation. When data drift or insufficient training samples occur, the models often make overconfident and incorrect predictions. Summary of the Invention
[0005] In view of the above situation, the main objective of this invention is to propose a reliable time series prediction method and system based on a large language model fused with a knowledge graph, so as to solve the above-mentioned technical problems.
[0006] This invention proposes a reliable time-series prediction method based on a large language model fused with a knowledge graph. The method includes the following steps:
[0007] Step 1: Construct a normalization module based on the reversible normalization method; construct a feature extraction module based on the additive trend seasonal decomposition method and linear mapping layer; construct a knowledge graph construction module based on a two-layer edge connection strategy; and use the normalization module, feature extraction module, and knowledge graph construction module to form a time series prediction model.
[0008] Step 2: Obtain the raw time series data and use the normalization module to normalize the raw time series data to obtain normalized time series data.
[0009] Step 3: Use the feature extraction module to extract features from the normalized time series data to obtain the time series embedding;
[0010] 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.
[0011] Step 5: Embed the enhanced time series data into a pre-trained large language model for processing to obtain the normal inverse gamma distribution parameters, and perform inverse standardization to obtain the predicted values. Calculate the random uncertainty and cognitive uncertainty using the normal inverse gamma distribution parameters. Construct an uncertainty loss function based on the normal inverse gamma distribution parameters and a mean squared error loss function based on the predicted values. Optimize the time series prediction model using the uncertainty loss function and the mean squared error loss function to obtain the optimized time series prediction model. Input the original time series data into the optimized time series prediction model for processing to obtain the final prediction results.
[0012] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0013] This invention integrates a temporal knowledge graph and aligns it with the input temporal data to improve the temporal prediction capability of a large language model; it models the temporal prediction results for accidental and cognitive uncertainties, thereby providing credible and reliable prediction results; it decomposes the different components of the time series data and models them, thereby capturing subtle changes in the different components of the time series data; experimental verification shows that this invention performs well on multiple time series datasets.
[0014] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by means of embodiments of the invention. Attached Figure Description
[0015] Figure 1This is a flowchart illustrating the steps of a reliable time-series prediction method based on a large language model fused with a knowledge graph, as proposed in this invention.
[0016] Figure 2 This is a diagram illustrating the overall framework of a reliable temporal prediction method based on a large language model and knowledge graph proposed in this invention.
[0017] Figure 3 This describes the construction process of the temporal knowledge graph of this invention. Detailed Implementation
[0018] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0019] These and other aspects of the embodiments of the present invention will become clear from the following description and accompanying drawings. In these descriptions and drawings, some specific embodiments of the present invention are specifically disclosed to illustrate some ways of implementing the principles of the embodiments of the present invention; however, it should be understood that the scope of the embodiments of the present invention is not limited thereto.
[0020] Please see Figure 1 This embodiment provides a reliable time series prediction method based on a large language model fused with a knowledge graph. The method includes the following steps:
[0021] Step 1: Construct a normalization module based on the reversible normalization method; construct a feature extraction module based on the additive trend seasonal decomposition method and linear mapping layer; construct a knowledge graph construction module based on a two-layer edge connection strategy; and use the normalization module, feature extraction module, and knowledge graph construction module to form a time series prediction model.
[0022] Step 2: Obtain the raw time series data and use the normalization module to normalize the raw time series data to obtain normalized time series data.
[0023] Please see 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. The following relationship exists in the corresponding process:
[0024] ;
[0025] in, This represents the normalized time series data. and All of these represent trainable parameters. Represents the original time series data. This represents the mean of the original time series data. This represents the variance of the original time series data. This represents a small constant added to prevent division by zero.
[0026] Step 3: Use the feature extraction module to extract features from the normalized time series data to obtain the time series embedding.
[0027] In step 3, the feature extraction module is used to extract features from the normalized time series data to obtain the time series embedding. This includes the following sub-steps:
[0028] Based on the additive trend seasonal decomposition method, the trend components of normalized time series data are extracted by moving an average pooling layer along the time axis. The following relationship exists in the process:
[0029] ;
[0030] in, This indicates the trend component of time series data. This indicates a pre-set trend length parameter. This indicates that the normalized time series data is at time [time]. The value;
[0031] The trend component of the normalized time series data is subtracted to obtain the trend-removed time series data. The following relationship exists in this process:
[0032] ;
[0033] in, This represents time-series data after removing trend components;
[0034] The seasonal cycle is determined based on a pre-set seasonal length parameter. Within the seasonal cycle, the average value of the time series data after removing trend components is calculated to obtain the seasonal component of the time series data. The following relationship exists in the corresponding process:
[0035] ;
[0036] in, This indicates that the phase of all positions in the time series is The set of data points Indicates the index position of the time series data. Indicates the remainder. This indicates a pre-set seasonal length parameter. Indicates the phase position in the seasonal cycle. This indicates the seasonal component of time-series data;
[0037] Subtracting the trend-removed time series data and the seasonal component of the time series data from the normalized time series data yields the residual components of the time series data. The following relationship exists in this process:
[0038] ;
[0039] in, Represents the residual components of time-series data;
[0040] 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:
[0041] ;
[0042] in, This represents the concatenated sequence of time blocks. This represents 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;
[0043] A linear mapping layer is used to perform linear mapping on the spliced time series block sequence to obtain the time series embedding.
[0044] 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.
[0045] 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:
[0046] 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:
[0047] ;
[0048] 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;
[0049] 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:
[0050] ;
[0051] in, Indicates the first The semantic anchor point and the first The number of shared keywords among semantic anchors This indicates the calculation of the number of overlapping keywords with high mapping weights between two inputs. This represents the pre-set keyword threshold parameter. Indicates whether a keyword edge exists;
[0052] It should be noted that when Time indicates the first The semantic anchor point and the first There are keyword edges between semantic anchors, when Time indicates the first The semantic anchor point and the first There are no keyword edges between the semantic anchors.
[0053] The cosine similarity between time series semantic anchors is calculated to obtain the semantic similarity between them. The following relationship exists in the process:
[0054] ;
[0055] in, Indicates the first The semantic anchor point and the first Semantic similarity of semantic anchors This indicates that the cosine similarity has been calculated.
[0056] When the semantic similarity between two time series semantic anchors exceeds a threshold Add semantic similarity edges when the condition is met; otherwise, do not add them.
[0057] in, This represents a pre-set semantic similarity threshold;
[0058] A knowledge graph is constructed based on time-series semantic anchors, keyword edges, and semantic similarity edges.
[0059] Prefix hint sequences were obtained by filtering from the knowledge graph. The prefix cue sequence is concatenated with the time series embedding to obtain the enhanced time series embedding. ;
[0060] in, Indicates a prefix hint sequence, This represents the enhanced time series embedding. This indicates a time series embedding.
[0061] Furthermore, the prefix hint sequence is obtained by filtering from the knowledge graph, specifically including the following sub-steps:
[0062] Select the node with the highest semantic similarity to the time series embedding from the knowledge graph. As a starting point, and will be related to the nodes All directly connected nodes are added to the candidate node sequence;
[0063] in, This represents the node with the highest semantic similarity to the time series embedding;
[0064] 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;
[0065] in, This indicates a pre-set node threshold.
[0066] Repeat step S401 iteratively until the number of nodes in the candidate node sequence reaches a threshold. To obtain the prefix hint sequence.
[0067] It should be noted that, in Figure 3 middle, Both represent semantic anchors for time series.
[0068] 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.
[0069] 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:
[0070] The enhanced time series data is embedded into a pre-trained large language model for prediction to obtain a predictive representation.
[0071] 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.
[0072] The representations of the trend component, seasonal component, and residual component are concatenated and input into a linear mapping layer for processing to obtain a parameter set. The following relationship exists in the corresponding process:
[0073] ;
[0074] in, Indicates the features after splicing. The representation of trend components, Characterization of seasonal components, Characterization of residual components, Indicates transpose. Represents the parameter set, and ; All of these represent parameters in the parameter set. Represents the weight matrix. Indicates the bias term;
[0075] S501, Parameters The three components are added together to obtain the parameters of the normal inverse gamma distribution. The following relationship exists in the correspondence process:
[0076] ;
[0077] in, The parameters representing the inverse normal gamma distribution, Indicates parameters The trend components, Indicates parameters Seasonal ingredients, Indicates parameters The residual components;
[0078] parameters Repeat steps S501 to obtain the parameters of the normal inverse gamma distribution. ;
[0079] in, All represent parameters of the normal inverse gamma distribution;
[0080] It should be noted that concatenating the representations of the trend component, seasonal component, and residual component before inputting them into the linear mapping layer will output a prediction result containing the three components of trend, seasonality, and residual. It will also output distribution parameters used to estimate the uncertainty of each component, such as the trend output component. Next, in order to reconstruct the predicted time series and model its uncertainty, the output parameters of each component are summed to obtain the parameters of the normal inverse gamma distribution.
[0081] in, Indicates parameters The trend components, Indicates parameters The trend components, Indicates parameters The trend component.
[0082] The parameters of the normal inverse gamma distribution Inverse standardization is performed to obtain the predicted value, and the following relationship exists in the process:
[0083] ;
[0084] in, Indicates the predicted value;
[0085] Assuming the target labels follow a Gaussian distribution, the distribution of the target labels is approximated using the parameters of the inverse normal gamma distribution. The random uncertainty and cognitive uncertainty are calculated separately, and the following relationship exists in the corresponding process:
[0086] ;
[0087] in, Indicates parameters Higher-order conjugate priors Let represent the parameters of the Gaussian distribution, and ; Let represent the parameters of the normal inverse gamma distribution, and ; This represents the mean of the target labels. Represents the variance of the target label. Represents the gamma function. Represents an exponential function. Indicates randomness and uncertainty. Variance The mathematical expectation, This indicates cognitive uncertainty. Mean The difference of squares;
[0088] An uncertainty loss function is constructed based on the parameters of the normal inverse gamma distribution, and the following relationship exists in the corresponding process:
[0089] ;
[0090] in, The negative logarithm represents the model's evidence. Indicates taking the logarithm. The total amount of evidence representing the distribution of evidence, and ; Indicates the target label, This represents the evidence regularization term. Indicates loss due to uncertainty. This represents the regularization coefficient, used to balance uncertainty inflation with model fitting performance;
[0091] The mean squared error loss function is constructed based on the predicted values, and the following relationship exists in the corresponding process:
[0092] ;
[0093] in, This represents the mean squared error loss. Indicates the predicted length. Indicates the future The predicted value at each time step, Indicates the future A label for each time step;
[0094] 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 then input into the optimized time series prediction model for processing to obtain the final prediction result.
[0095] Furthermore, the total training loss is:
[0096] ;
[0097] in, This represents the total training loss.
[0098] It should be noted that by modeling uncertainty, the random fluctuations caused by inherent noise in the data and the limitations of prediction due to insufficient model cognition can be accurately quantified, thereby reducing the interference of unreliable predictions and providing truly robust and reliable results for time series forecasting.
[0099] To verify the effectiveness of the present invention, the method of the present invention was tested, and the test results are as follows:
[0100] Tables 1 and 2 respectively show the objective performance evaluation of the method (LANet) of this invention on the lesion detection task and various mainstream segmentation models on two datasets. Table 3 shows the performance evaluation of knowledge graph in short-term prediction.
[0101] Table 1. Evaluation of MSE metrics for each method on time-series datasets.
[0102]
[0103] Among them, TIME-KGNU represents the baseline method fusion knowledge graph module;
[0104] Table 2. Evaluation results of MAE metrics for various methods on time-series datasets.
[0105]
[0106] Table 3 shows the performance evaluation of the knowledge graph module on the M4 dataset.
[0107]
[0108] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0109] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0110] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0111] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by 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, constructing a feature extraction module based on an additive trend seasonality decomposition method and a linear mapping layer; Based on the two-layer edge connection strategy, a knowledge graph construction module is constructed, and the normalization module, the feature extraction module and the knowledge graph construction module are used to constitute a time series prediction model; Step 2, obtaining original time series data, and normalizing the original time series data by using the normalization module 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 anchors; using the knowledge graph construction module to process the time series semantic anchors 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; 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, and 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; the original time series data is input into the optimized time series prediction model for processing to obtain a final prediction result; In step 4, the linear mapping layer is used to linearly map 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; the prefix prompt sequence is filtered from the time series knowledge graph, and is spliced with the time series embedding to obtain an enhanced time series embedding, which comprises the following substeps: The linear mapping layer is used to linearly map the word embeddings of the pre-trained large language model to obtain time series semantic anchors; Based on the two-layer edge connection strategy, the mapping weight matrix from the word embedding to the time series semantic anchor is used to construct the key word edges between the time series semantic anchors; The cosine similarity between the time series semantic anchors is calculated to obtain the semantic similarity between the time series semantic anchors; 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; Based on the time series semantic anchors, the key word edges and the semantic similarity edges, a knowledge graph is constructed; 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.
2. The method of claim 1, wherein the method is characterized by, 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, 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 is characterized by, In step 3, the feature extraction module is used to extract features from the normalized time series data to obtain time series embeddings, which comprises the following substeps: 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. The normalized time series data is subtracted from the trend component of the time series data to obtain the time series data without the trend component. Based on the pre-set seasonal length parameter, the seasonal period is determined, and the average value of the time series data without the trend component is calculated within the seasonal period to obtain the seasonal component of the time series data. The normalized time series data is subtracted from the time series data without the trend component and the seasonal component of the time series data to obtain the residual component of the time series data. 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 are decomposed and spliced to obtain the spliced time series block sequence. The linear mapping layer is used to perform linear mapping processing on 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 based on the additive trend season decomposition method to obtain the trend component of the time series data, 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 without the trend component, 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 and calculating the average value of the time series data without the trend component 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 without the 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, 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 of claim 1, wherein the method is characterized by, In the step of performing linear mapping processing on the word embedding of the pre-trained large language model using the linear mapping layer to obtain the 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 the keyword edge between the time series semantic anchor points based on the two-layer edge connection strategy using the 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.
6. The method of claim 5, wherein the method further comprises: The prefix prompt sequence is selected from the knowledge graph, which 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.
7. The method according to claim 6, characterized in that, In step 5, the enhanced time series embedding is input into the pre-trained large language model for processing to obtain the normal inverse gamma distribution parameters, and inverse standardization processing is performed to obtain the predicted value. The normal inverse gamma distribution parameters are used to calculate the accidental uncertainty and cognitive uncertainty, respectively, and the uncertainty loss function is constructed based on the normal inverse gamma distribution parameters, and the mean square error loss function is constructed based on the predicted value, which 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 normal 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.
8. The method of claim 7, 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