Index data prediction method based on large time sequence model and related device

By modifying the large language model and utilizing the cross-attention mechanism and prompt word technology to align time series data with text data, the problem of insufficient prediction accuracy of traditional methods in complex nonlinear data is solved, and efficient and accurate time series prediction is achieved, which is suitable for a variety of application scenarios.

CN120654823APending Publication Date: 2025-09-16XIAN THERMAL POWER RES INST CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510738995.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing time series prediction methods lack accuracy when faced with complex, non-stationary, and nonlinear data, and the application of large language models in time series prediction is limited by insufficient computing power and data.

Method used

An indicator data prediction method based on a large time series model is adopted. The time series data and text data are aligned through the cross-attention mechanism, prompt words are generated and input into the large language model for prediction. This includes the patch method, position encoding and cross-attention mechanism transformation, and adapting the input and output layers of the large language model to process time series data.

Benefits of technology

Under limited computing power and data conditions, efficient and accurate time series prediction is achieved, prediction accuracy is improved, and the semantic understanding and generalization capabilities of the large language model are brought into play to adapt to various application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654823A_ABST
    Figure CN120654823A_ABST
Patent Text Reader

Abstract

The invention discloses an index data prediction method based on a time sequence large model and a related device, and belongs to the technical field of time sequence prediction. The method comprises the following steps: acquiring time sequence data and preprocessing the time sequence data to obtain a time sequence data D-dimensional vector; aligning the D-dimensional vector of the time sequence data through a cross attention mechanism to obtain an aligned time sequence data vector; generating a cue word with related information according to the D-dimensional vector of the time sequence data; converting the cue word into a D-dimensional vector, splicing the D-dimensional vector with the aligned time sequence data vector, and inputting the spliced vector into a pre-established large language model; and outputting predicted text data through the large language model, and converting and combining the text data to obtain a complete time sequence prediction data sequence. Under the practical constraints of insufficient computing power and insufficient fine adjustment data, efficient and accurate time sequence prediction is realized only through transformation of a large model, and the applicability of a time sequence prediction technology in different scenes is expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of time series prediction, and relates to an indicator data prediction method based on a time series large model and a related device. Background Art

[0002] In the field of data processing and forecasting, time series forecasting has always been a key research and application. With the acceleration of digitalization in various industries, the demand for accurate forecasting of time series data is extremely urgent.

[0003] Traditional time series forecasting is mostly based on statistical models, such as the Autoregressive Integrated Moving Average (ARIMA) model and its derivative, the Seasonal Autoregressive Integrated Moving Average (SARIMA) model. ARIMA models analyze the autocorrelation and moving average properties of data to construct a model to predict future values. However, these models rely on the assumption of data stationarity and therefore perform poorly with the large amount of non-stationary and nonlinear time series data found in reality.

[0004] With the rise of deep learning, neural network-based forecasting methods have become increasingly popular. Recurrent neural networks (RNNs) and their variants, long short-term memory (LSTM) and gated recurrent units (GRU), have been widely used. RNNs can process sequential data, capturing sequential dependencies through the recurrent structure of their hidden layers. However, they suffer from vanishing or exploding gradients, making it difficult to learn long-term dependencies when processing long sequences. The introduction of gating mechanisms in LSTMs and GRUs has improved performance somewhat, but their performance remains limited when dealing with extremely long or complex time series patterns. For example, when forecasting global climate change data, the complexity of the data and the length of the sequences make it difficult to achieve the required accuracy.

[0005] In recent years, the Transformer architecture, leveraging its self-attention mechanism, has achieved significant success in natural language processing and computer vision, and has also expanded into time series prediction. However, existing Transformer-based models are often limited to processing time series data, failing to fully leverage the powerful semantic understanding and reasoning capabilities of large language models when processing text data.

[0006] Large language models, such as the GPT series and BERT, are highly capable in natural language processing, understanding and generating high-quality text. However, they are primarily designed for text data, with input typically consisting of sequences of discrete text tokens. They struggle to directly process continuous numerical time series data and suffer from data format mismatches. Furthermore, in practical applications, they often face challenges with insufficient computing power and a lack of fine-tuning data. Traditionally, applying large language models to specific tasks requires extensive pre-training computing power and massive amounts of fine-tuning data. However, these requirements are unavailable in many scenarios, such as business forecasting for small and medium-sized enterprises and prediction of specialized niche data. This significantly limits the application of large language models in time series forecasting.

[0007] In summary, existing time series prediction methods have problems such as low prediction accuracy and difficulty in effectively utilizing the advantages of large language models when faced with complex and changeable data and actual scenarios with limited computing power and data. Therefore, a new method is urgently needed to solve these problems. Summary of the Invention

[0008] The purpose of the present invention is to provide an indicator data prediction method and related devices based on a time series large model to solve the technical problem in the prior art that traditional time series prediction models have insufficient prediction accuracy when processing complex, non-stationary and nonlinear data.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions:

[0010] In a first aspect, the present invention provides an indicator data prediction method based on a time series large model, comprising the following steps:

[0011] Obtain time series data and preprocess it to obtain a D-dimensional vector of time series data;

[0012] Align the D-dimensional vector of the time series data through the cross-attention mechanism to obtain the aligned time series data vector;

[0013] Generate prompt words with relevant information based on the D-dimensional vector of time series data;

[0014] Convert the prompt word into a D-dimensional vector and concatenate it with the aligned time series data vector. Input the concatenated vector into the pre-established large language model.

[0015] The predicted text data is output by the large language model, and the text data is converted and combined to obtain a complete time series prediction data sequence.

[0016] Furthermore, the step of acquiring time series data and preprocessing it to obtain a D-dimensional vector of the time series data specifically includes:

[0017] The patch method is used to divide the entire time series data sequence into multiple overlapping time period patches according to the set length P; the overlapping length is set between adjacent patches;

[0018] Project each patch into a high-dimensional space through a linear transformation matrix W, converting a patch of length P into a D-dimensional vector; the dimension of the linear transformation matrix W is P×D;

[0019] A position code is added to each of the D-dimensional vectors to obtain a D-dimensional vector of time series data.

[0020] Furthermore, the step of adding a position code to each of the D-dimensional vectors specifically includes:

[0021] The position encoding method based on trigonometric functions is used to embed the time step position information into the vector. The specific calculation formula is:

[0022] PE (pos,2i) =sin(pos / 10000 2i / D )

[0023] PE (pos,2i+1) =cos(pos / 10000 2i / D )

[0024] Where pos represents the position of the time step and i represents the vector dimension index.

[0025] Furthermore, the step of aligning the D-dimensional vector of the time series data through the cross-attention mechanism to obtain the aligned time series data vector specifically includes:

[0026] Build a cross-attention layer and use the D-dimensional vector of the time series data as the query vector Q; obtain the D-dimensional vector of the token in the large language model vocabulary after the embedding layer conversion as the key vector K and value vector V;

[0027] The dot product of the query vector Q and the key vector K is calculated by matrix multiplication to obtain the attention score matrix. The specific calculation formula is:

[0028] Attention(Q,K)=QK T

[0029] Where Q represents the query vector; K represents the key vector;

[0030] Divide the attention score matrix by Normalize and then use the Softmax function to get the attention weight matrix;

[0031] Multiply the attention weight matrix and the value vector V and add them together to obtain the aligned time series data vector. The specific calculation formula is:

[0032]

[0033] Where V represents the value vector.

[0034] Furthermore, the step of generating prompt words with relevant information based on the D-dimensional vector of the time series data specifically includes:

[0035] Perform statistical analysis on the D-dimensional vector of time series data to obtain the basic mathematical characteristics of the data;

[0036] Use time series analysis methods to determine the data trend and seasonality of time series data;

[0037] In combination with the prediction task type, a prompt word is generated; the relevant information of the prompt word includes at least data type, data characteristics, data trend and prediction task information.

[0038] Furthermore, the establishment of the large language model specifically includes:

[0039] Modify the input layer of the large language model based on the Transformer architecture and add a channel for receiving time series data; the channel includes a data parsing module and a format conversion module;

[0040] A linear layer is added to the output layer of the large language model based on the Transformer architecture to map the output of the last hidden layer of the large language model to a space consistent with the dimension of the predicted time series data.

[0041] Furthermore, the step of outputting predicted text data through the large language model, converting and combining the text data, and obtaining a complete time series prediction data sequence specifically includes:

[0042] Convert the output predicted text data into a numerical vector by reverse mapping with the vocabulary;

[0043] According to the patch division and position encoding information, the numerical vectors are reassembled into a complete time series prediction data sequence.

[0044] In a second aspect, the present invention provides an indicator data prediction system based on a time series large model, comprising:

[0045] The preprocessing module is used to obtain time series data and preprocess it to obtain a D-dimensional vector of time series data;

[0046] The alignment module is used to align the D-dimensional vector of time series data through the cross-attention mechanism to obtain the aligned time series data vector;

[0047] A prompt word generation module is used to generate prompt words with relevant information based on the D-dimensional vector of time series data;

[0048] The splicing input module is used to convert the prompt word into a D-dimensional vector, splice it with the aligned time series data vector, and input the spliced ​​vector into the pre-established large language model;

[0049] The prediction output module is used to output the predicted text data through the large language model, convert and combine the text data to obtain a complete time series prediction data sequence.

[0050] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for predicting indicator data based on a large time series model are implemented.

[0051] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the indicator data prediction method based on a time series large model are implemented.

[0052] Compared with the prior art, the present invention has the following beneficial effects:

[0053] The present invention discloses an indicator data prediction method and related devices based on a large time series model. By aligning time series data with text data, the large language model can deeply explore the complex semantics and logical relationships behind the data. Targeted modifications are made to the large language model based on the Transformer architecture, and a channel for receiving time series data is added to the input layer, including a data parsing module and a format conversion module, so that the model can directly process time series data without the need for additional data conversion steps, thereby improving data processing efficiency. At the same time, a linear layer is added to the output layer to map the model output to a space consistent with the dimension of the predicted time series data, ensuring that the model output matches the prediction task requirements. In actual application scenarios, the present invention only needs to make innovative modifications to the large language model. Through clever patch methods, cross-attention mechanisms, and prompt word engineering, efficient and accurate time series prediction can be achieved under limited computing power conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0055] Figure 1 is a flow chart of the method of the present invention;

[0056] Figure 2 This is a diagram of the indicator data prediction system architecture based on the time series large model of the present invention;

[0057] Figure 3 This is a schematic diagram of processing time series data using the Patch method according to an embodiment of the present invention;

[0058] Figure 4 Schematic diagram of the cross-attention mechanism principle of an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.

[0060] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise indicated, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present invention.

[0061] See also Figure 1 and Figure 2 The embodiment of the present invention discloses a method for predicting indicator data based on a time series large model, comprising the following steps:

[0062] S1, see Figure 3 , obtain time series data and preprocess it to obtain a D-dimensional vector of time series data;

[0063] S101, Patch Partitioning: Use the patch method to process time series data. The entire time series data sequence is divided into multiple overlapping time periods (patches) of a set length P. A certain overlap length is set between adjacent patches to ensure data continuity and local feature integrity. For example, the patch length P is set to 10 time steps and the overlap length is set to 2 time steps. This partitioning helps preserve the local features of the time series data while reducing computational complexity.

[0064] S102, Linear Projection: Each patch is projected into a higher-dimensional space using a trainable linear transformation matrix W, converting the P-length patch into a D-dimensional vector. The linear transformation matrix W has dimensions of P × D. During training, the parameters of W are continuously optimized using a backpropagation algorithm, ensuring that the projected vector effectively retains the key information in the patch.

[0065] S103, position coding addition: Add position coding to each projected D-dimensional vector to preserve the time sequence information. Use a position coding method based on trigonometric functions to embed the time step position information into the vector. The specific calculation formula is:

[0066] PE (pos,2i) =sin(pos / 10000 2i / D )

[0067] PE (pos,2i+1) =cos(pos / 10000 2i / D )

[0068] Where pos represents the position of the time step and i represents the vector dimension index.

[0069] S2, see Figure 4 , align the D-dimensional vector of the time series data through the cross attention mechanism to obtain the aligned time series data vector;

[0070] S201: Build a cross-attention layer and use the D-dimensional vector of the time series data as the query vector Q; obtain the D-dimensional vector of the token in the large language model vocabulary after conversion in the embedding layer as the key vector K and value vector V;

[0071] A cross-attention layer is inserted before the large language model's encoder. This cross-attention layer consists of a query, key, and value matrix operation module, as well as an attention weight calculation and aggregation module. The two input vectors are the D-dimensional vector of the patched and positionally encoded time series data (the query vector Q), and the D-dimensional vector of the tokens in the large language model's vocabulary after transformation in the embedding layer (the key and value vectors K and V).

[0072] S202, calculate the dot product of the query vector Q and the key vector K through matrix multiplication to obtain the attention score matrix. The specific calculation formula is:

[0073] Attention(Q,K)=QK T

[0074] Where Q represents the query vector; K represents the key vector;

[0075] S203, divide the attention score matrix by the dimension of K Normalization is performed to prevent the dot product result from being too large, which will cause the Softmax function gradient to disappear. Then, the Softmax function is applied to the result for normalization to obtain the attention weight matrix.

[0076] S204: Multiply the attention weight matrix and the value vector V and add them together to obtain the aligned time series data vector. The specific calculation formula is:

[0077]

[0078] Where V represents the value vector.

[0079] Through the back-propagation algorithm, the parameters in the cross-attention layer (including the weight matrix in the query, key and value matrix operation modules) are trained and optimized using the prediction loss function (such as the mean square error loss function MSE), so that the alignment effect of time series data and text data is continuously improved.

[0080] S3, generating prompt words with relevant information based on the D-dimensional vector of time series data;

[0081] S301, performing statistical analysis on the D-dimensional vector of the time series data to obtain the basic mathematical characteristics of the data;

[0082] S302, determining the data trend and seasonality of the time series data by using a time series analysis method;

[0083] S303: Generate prompt words based on the prediction task type; the relevant information of the prompt words includes at least data type, data characteristics, data trend and prediction task information.

[0084] This step automatically generates prompt words based on the characteristics of the input time series data. The data analysis module is used to perform statistical analysis on the time series data to obtain basic characteristics such as mean, variance, and periodicity, and the data trend and seasonality are determined through time series analysis methods (such as autocorrelation function ACF and partial autocorrelation function PACF). Combined with the forecasting task type (such as short-term forecasting, long-term forecasting, anomaly detection, etc.), prompt words containing information such as data type, data characteristics, data trend, and forecasting task are generated. For example, for a set of sales data with obvious seasonality, the forecasting task is to forecast sales for the next week. The generated prompt word may be "This set of data is the sales data of a certain product, which has seasonal characteristics. It is currently in the peak sales season and sales are on an upward trend. The sales are predicted for the next week."

[0085] S4, convert the prompt word into a D-dimensional vector, concatenate it with the aligned time series data vector, and input the concatenated vector into the pre-established large language model;

[0086] The generated prompt word is converted into a D-dimensional vector through the text embedding layer of the large language model and concatenated with the time series data vector aligned using the cross-attention mechanism. At the input layer of the large language model, the concatenated vector is passed as new input data to the subsequent Transformer block for processing.

[0087] The establishment of the large language model specifically includes:

[0088] Base model selection: Choose a large language model based on the Transformer architecture. This type of model has been pre-trained on large amounts of text data and has strong semantic understanding and generation capabilities.

[0089] Input layer adaptation: Modify the input layer of the selected large language model. Because the original large language model input is a sequence of text tokens, while time series data is a sequence of numbers, a dedicated time series data input channel is required. This channel includes data parsing and format conversion modules. The data parsing module is responsible for reading time series data files in common formats (such as CSV and JSON); the format conversion module converts the read time series data into a tensor form suitable for subsequent processing. For example, converting a one-dimensional time series data sequence into a two-dimensional tensor, where the first dimension represents the time step and the second dimension represents the data feature dimension.

[0090] Output Layer Adjustment: Based on the output requirements of the time series prediction task, the output layer of the large language model is appropriately adjusted. The prediction task is to output specific numerical values ​​for future time steps. This requires converting the output structure of the large language model, originally designed for text generation, into a form capable of outputting numerical sequences. By adding a linear layer, the output of the last hidden layer of the large language model is mapped to a space consistent with the dimensions of the predicted time series data.

[0091] S5, outputs the predicted text data through the large language model, converts and combines the text data to obtain a complete time series prediction data sequence.

[0092] S501: The large language model generates predicted text data based on its pre-trained knowledge and understanding of the input data. For example, in the scenario of predicting power load, the generated text data may be text describing the future power load value.

[0093] S502: The text data generated by the large language model prediction is converted into numerical vectors by reverse mapping with the vocabulary. Then, based on the previous patch division and position encoding information, these numerical vectors are recombined into a complete time series prediction data sequence.

[0094] The advantages of the present invention are as follows:

[0095] 1. Prediction Accuracy: Traditional prediction methods often struggle to accurately capture subtle changes and underlying patterns in complex, non-stationary, and nonlinear time series data due to limitations in their models. This invention aligns time series data with text data, enabling large language models to deeply explore the complex semantics and logical relationships underlying the data.

[0096] 2. Computing Power and Data: In practical application scenarios, especially those in small and medium-sized enterprises or niche applications in specific fields, there is often a dilemma of limited computing resources and insufficient available fine-tuning data. Traditional methods, to achieve high-precision predictions, typically require large-scale computing power support and massive amounts of fine-tuning data for model training. However, this invention only requires innovative modifications to large language models. Through a clever patching method, cross-attention mechanism, and prompt word engineering, it can achieve efficient and accurate time series prediction under limited computing power conditions.

[0097] 3. Versatility and Adaptability: This method leverages the extensive knowledge and powerful generalization capabilities of large language models by converting time series data into textual data that can be understood by large language models. This makes the method of this invention not limited to specific fields or types of time series data prediction.

[0098] 4. Scalability: With the rapid development of large language model technology, large language models with improved performance, larger parameters, or new features are constantly emerging. Since the core of this invention is to adapt large language models to process time series data, when new large language models emerge, only targeted adjustments to the modified parts are required to easily integrate the new models into the system, further improving prediction performance.

[0099] The embodiment of the present invention discloses an indicator data prediction system based on a time series large model, which includes a preprocessing module, an alignment module, a prompt word generation module, a splicing input module and a prediction output module.

[0100] The preprocessing module is used to obtain time series data and preprocess it to obtain a D-dimensional vector of time series data;

[0101] Specifically, time series data is acquired from data sources, such as databases, sensor devices, and file systems. The raw time series data is cleaned to remove outliers, missing values, and other noisy data. Missing values ​​can be filled using methods such as mean filling, linear interpolation, and machine learning-based predictive filling. The data is then normalized, mapping it to a specific interval such as [0, 1] or [-1, 1] to accelerate model convergence and improve prediction accuracy. Common normalization methods include min-max normalization and z-score normalization.

[0102] The alignment module is used to align the D-dimensional vector of time series data through the cross-attention mechanism to obtain the aligned time series data vector;

[0103] Specifically, a cross-attention layer is constructed, and the D-dimensional vector of the time series data after patch processing and position encoding is used as the query vector. In the cross-attention layer, the dot product of the query vector and the key vector is first calculated to obtain the attention score matrix, which is Attention(Q,K)=QK T . Then divide the attention score matrix by Normalize the data and apply the Softmax function to obtain the attention weight matrix. Finally, multiply the attention weight matrix with the value vector and add them together to obtain the aligned vector. Then, use the backpropagation algorithm and the prediction loss function to train and optimize the parameters of the cross-attention layer to better align the time series data with the text data.

[0104] A prompt word generation module is used to generate prompt words with relevant information based on the D-dimensional vector of time series data;

[0105] Specifically, n patches are grouped together, and each set of time series data is analyzed. Statistical analysis is used to obtain data characteristics such as mean, variance, and trend, and time series analysis methods are used to determine the data's periodicity, seasonality, and other characteristics. Prompt words are generated in conjunction with prediction tasks, such as predicting future values ​​and predicting outliers. For example, for a set of seasonally fluctuating power load data, the load value for the next 24 hours is predicted. The generated prompt word is "This set of data is power load data, characterized by seasonal fluctuations. The current electricity consumption season is peak, and the load is on an upward trend. The power load value for the next 24 hours is predicted."

[0106] The splicing input module is used to convert the prompt word into a D-dimensional vector, splice it with the aligned time series data vector, and input the spliced ​​vector into the pre-established large language model;

[0107] Specifically, the generated prompt word is converted into a D-dimensional vector through the text embedding layer of the large language model and concatenated with the time series data vector aligned using the cross-attention mechanism. The concatenated vector is passed as the new input to the large language model. The large language model receives the processed input vector, uses its pre-trained knowledge and internal mechanisms to make predictions, and outputs the predicted text data.

[0108] Based on project requirements and performance evaluation, select an appropriate large language model, such as Tongyi Qianwen or Deepseek-V3. Deepseek-V3, for example, features a multi-layered Transformer architecture and excels in natural language processing tasks. However, this native model cannot directly process time series data.

[0109] The input layer of the large language model is modified to accept processed time series data. A dedicated channel for receiving time series data is added to the model's input interface. The preprocessed time series data is divided into multiple overlapping time segments (patches) using the patch method. Each patch has a length of P, and the overlap length between adjacent patches is set to 2. Each patch is linearly projected to convert it into a D-dimensional vector, and a positional encoding is added to preserve temporal order information.

[0110] Get the vocabulary of the large language model, and each token in the vocabulary is converted into a D-dimensional vector in the embedding layer. These vectors will serve as the key and value vectors in the cross-attention mechanism.

[0111] The prediction output module is used to output the predicted text data through the large language model, convert and combine the text data to obtain a complete time series prediction data sequence.

[0112] Specifically, the predicted text data is converted into numerical vectors through reverse mapping with the vocabulary. Based on the previous patch division and position encoding information, the numerical vectors are reassembled into a complete time series prediction data sequence. Finally, the prediction results are post-processed, such as denormalization, to restore the data to the original data level.

[0113] Example:

[0114] This embodiment takes into account the system's high requirements for data read and write speeds and selects a high-performance SSD as the primary storage medium. SSDs offer fast read and write speeds and excellent random access performance, enabling rapid loading of model files, storage and access of training data, intermediate calculation results, and prediction results.

[0115] Model file storage: Create a dedicated directory on the SSD to store large language model files, including model weight parameters, configuration files, etc. Categorize and store models by version and type for easy management and access.

[0116] Training data storage: Collected raw time series data and preprocessed data are stored separately. Raw data is organized by acquisition time and data source and stored in the " / data / raw" directory. A subdirectory is created for each data source, such as " / data / raw / sensor1" for raw data from sensor 1. Preprocessed data is stored in the " / data / preprocessed" directory and is also categorized by data source and processing time for easy access during subsequent model training.

[0117] Intermediate results storage: Intermediate results generated during model training and inference, such as patched time series data vectors and intermediate results from the cross-attention mechanism, are stored in the / intermediate_results directory. They are named according to the computation step and timestamp to facilitate tracking and debugging.

[0118] Prediction result storage: The final prediction results are stored in the " / predictions" directory, categorized by prediction task and time. A subdirectory is created for each prediction task, such as " / predictions / electric_load_prediction" to store the power load prediction results. The prediction result files in the subdirectory are named with a timestamp.

[0119] Data management and maintenance:

[0120] Data backup: Develop a regular data backup strategy to back up important data (such as model files, training data, prediction results, etc.) to other storage devices.

[0121] Data cleaning and recording: Regularly clean up expired intermediate results on the SSD to free up storage space. Historical data that has not been used for a long time can be archived.

[0122] In one embodiment of the present invention, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of an indicator data prediction method based on a large time series model.

[0123] The present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk storage. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the above-mentioned embodiment regarding a method for predicting indicator data based on a large time series model.

[0124] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0125] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 flowcharts and / or block diagrams. 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.

[0126] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work 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 1The function specified in one or more boxes.

[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A method for predicting index data based on a time series large model, characterized in that: The following steps are involved: Obtain time series data and preprocess it to obtain a D-dimensional vector of time series data; Align the D-dimensional vector of the time series data through the cross-attention mechanism to obtain the aligned time series data vector; Generate prompt words with relevant information based on the D-dimensional vector of time series data; Convert the prompt word into a D-dimensional vector and concatenate it with the aligned time series data vector. Input the concatenated vector into the pre-established large language model. The predicted text data is output by the large language model, and the text data is converted and combined to obtain a complete time series prediction data sequence.

2. The method for predicting index data based on a time series large model according to claim 1, characterized in that: The step of acquiring and preprocessing time series data to obtain a D-dimensional vector of the time series data specifically includes: The patch method is used to divide the entire time series data sequence into multiple overlapping time period patches according to the set length P; the overlapping length is set between adjacent patches; Project each patch into a high-dimensional space through a linear transformation matrix W, converting a patch of length P into a D-dimensional vector; the dimension of the linear transformation matrix W is P×D; A position code is added to each of the D-dimensional vectors to obtain a D-dimensional vector of time series data.

3. The method for predicting index data based on a time series large model according to claim 2, characterized in that: The step of adding a position code to each of the D-dimensional vectors specifically includes: The position encoding method based on trigonometric functions is used to embed the time step position information into the vector. The specific calculation formula is: ON ( pos,2i ) =sin(pos / 10000 2 and / D ) ON ( pos,2i +1) =cos(pos / 10000 2 and / D ) Where pos represents the position of the time step and i represents the vector dimension index.

4. The method for predicting index data based on a time series large model according to claim 1, characterized in that: The step of aligning the D-dimensional vector of the time series data through the cross-attention mechanism to obtain the aligned time series data vector specifically includes: Build a cross-attention layer and use the D-dimensional vector of the time series data as the query vector Q. Obtain the D-dimensional vector of the token in the large language model vocabulary after conversion in the embedding layer as the key vector K and value vector V. The dot product of the query vector Q and the key vector K is calculated by matrix multiplication to obtain the attention score matrix. The specific calculation formula is: Attention(Q,K)=QK T Where Q represents the query vector; K represents the key vector; Divide the attention score matrix by Normalize and then use the Softmax function to get the attention weight matrix; Multiply the attention weight matrix and the value vector V and add them together to obtain the aligned time series data vector. The specific calculation formula is: Where V represents the value vector.

5. The method for predicting index data based on a time series large model according to claim 1, characterized in that: The step of generating prompt words with relevant information based on the D-dimensional vector of time series data specifically includes: Perform statistical analysis on the D-dimensional vector of time series data to obtain the basic mathematical characteristics of the data; Use time series analysis methods to determine the data trend and seasonality of time series data; In combination with the prediction task type, a prompt word is generated; the relevant information of the prompt word includes at least data type, data characteristics, data trend and prediction task information.

6. The method for predicting index data based on a time series large model according to claim 1, characterized in that: The establishment of the large language model specifically includes: Modify the input layer of the large language model based on the Transformer architecture to add a channel for receiving time series data; the channel includes a data parsing module and a format conversion module; Add a linear layer to the output layer of the large language model based on the Transformer architecture to map the output of the last hidden layer of the large language model to a space consistent with the dimension of the predicted time series data.

7. The method for predicting index data based on a time series large model according to claim 1, characterized in that: The steps of outputting predicted text data through the large language model, converting and combining the text data, and obtaining a complete time series prediction data sequence specifically include: Convert the output predicted text data into a numerical vector by reverse mapping with the vocabulary; According to the patch division and position encoding information, the numerical vectors are reassembled into a complete time series prediction data sequence.

8. An indicator data prediction system based on a time series large model, characterized in that: include: The preprocessing module is used to obtain time series data and preprocess it to obtain a D-dimensional vector of time series data; The alignment module is used to align the D-dimensional vector of time series data through the cross-attention mechanism to obtain the aligned time series data vector; A prompt word generation module is used to generate prompt words with relevant information based on the D-dimensional vector of time series data; The splicing input module is used to convert the prompt word into a D-dimensional vector, splice it with the aligned time series data vector, and input the spliced ​​vector into the pre-established large language model; The prediction output module is used to output the predicted text data through the large language model, convert and combine the text data to obtain a complete time series prediction data sequence.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the indicator data prediction method based on a time series large model as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the indicator data prediction method based on a time series large model as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Power load prediction method and device based on large language model, and storage medium

    CN121052390A

  • Time sequence prediction method and device for performing multi-level text alignment by using large model

    CN121117525A