A time series data processing method, device, storage medium and program product

By performing window length expansion training on the language model, the agent is obtained to process time series data, and the problem of window length selection and information loss in the prior art is solved, achieving high-precision multi-task applicability.

CN119128121BActive Publication Date: 2025-04-29INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411623131.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-04-29
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

The existing time series data processing methods have the problem of information loss in window length selection, resulting in low processing results accuracy and cannot be applied to various time series data tasks other than prediction tasks.

Method used

By performing window length expansion training on the preset language model, the main agent and the secondary agent are obtained. The main agent decompose the question statement and allocate it to the corresponding secondary agent. The secondary agent looks for historical knowledge from the prompt word pool and generates time series data answers.

Benefits of technology

It improves the accuracy of time series data processing results, is suitable for various types of time series data tasks, has the ability to process complex and variable time series data, and realizes the multiplexing migration of time series data knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128121B_ABST
    Figure CN119128121B_ABST
Patent Text Reader

Abstract

The present invention discloses a time series data processing method, device, storage medium and program product, which relates to the field of artificial intelligence technology, including: receiving a question statement for time series data; using a main intelligent agent to decompose the question statement according to the question type, and assigning the sub-questions of each category obtained by the decomposition to the corresponding type of secondary intelligent agents; using each secondary intelligent agent to search for at least one time series of historical knowledge corresponding to the sub-question from the corresponding type of prompt word pool; using each secondary intelligent agent to generate the time series data answer corresponding to the received sub-question according to the historical knowledge found; wherein the main intelligent agent and each secondary intelligent agent are intelligent agents obtained by extending the window length of a preset language model. The present invention improves the accuracy of the time series data processing result and is suitable for various types of time series data tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a time series data processing method, device, computer-readable storage medium and computer program product. Background Art

[0002] Time series modeling and analysis are crucial in many practical applications, such as demand planning, anomaly detection, investment management, power load forecasting, weather forecasting, etc.

[0003] Currently, the models designed and trained based on time series data mainly generate prediction results based on a fixed previous observation window length. Since a smaller window length can capture local patterns but lacks perception of global trends, and a larger window length can capture more contextual information but may ignore detailed information, this time series data processing solution may cause information loss of complex time series patterns, affecting the accuracy of time series data processing results, and is limited to generating prediction results based on the previous observation window length, it cannot be applied to time series data tasks other than prediction task types.

[0004] In summary, how to effectively solve the problems of low accuracy of time series data processing results and inability to apply to time series data tasks other than prediction task types is an issue that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide a time series data processing method, which improves the accuracy of time series data processing results and is applicable to various types of time series data tasks; another purpose of the present invention is to provide a time series data processing device, equipment and computer-readable storage medium.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] A time series data processing method, comprising:

[0008] Receive a query statement about the time series data;

[0009] Decomposing the question statement by question type using the main agent, and assigning the sub-questions of each category obtained by the decomposition to the corresponding type of secondary agents;

[0010] Using each secondary agent to search for at least one temporal historical knowledge corresponding to the sub-problem from a prompt word pool of a corresponding type;

[0011] Each secondary agent generates a time series data answer corresponding to the received sub-question based on the historical knowledge found;

[0012] The main agent and each secondary agent are agents obtained by extending the window length of a preset language model.

[0013] In a specific implementation of the present invention, the question statement is decomposed by the main agent according to the question type, including:

[0014] The main intelligent agent is used to decompose the question sentences according to the question type using the thinking chain technology.

[0015] In a specific implementation of the present invention, each secondary agent is used to search for at least one temporal historical knowledge corresponding to the sub-question from a prompt word pool of a corresponding type, including:

[0016] Using each secondary agent to search for at least one time-series prompt word key vector corresponding to the sub-problem from a prompt word pool of corresponding type;

[0017] The prompt word value vector mapped by the prompt word key vector in the prompt word pool is determined as the historical knowledge.

[0018] In a specific implementation of the present invention, determining the prompt word value vector mapped by the prompt word key vector in the prompt word pool as the historical knowledge includes:

[0019] Searching the prompt word value vector mapped by the prompt word key vector from the prompt word pool and obtained by concatenating the trend value, the period value and the residual value;

[0020] The prompt word value vector is determined as the historical knowledge.

[0021] In a specific implementation of the present invention, determining the prompt word value vector as the historical knowledge includes:

[0022] Using the secondary agent to concatenate the prompt word value vectors corresponding to the sub-questions and each time sequence, to obtain a concatenated vector;

[0023] The concatenation vector is determined as the historical knowledge.

[0024] In a specific implementation of the present invention, determining the prompt word value vector mapped by the prompt word key vector in the prompt word pool as the historical knowledge includes:

[0025] When the number of the found prompt word key vectors is greater than 1, the matching degree between the sub-question and each prompt word key vector is calculated respectively;

[0026] Sort the key vectors of each prompt word by their matching degree to obtain a sorting result;

[0027] According to the sorting result, a preset number of prompt word key vectors are selected from the end with a high matching degree;

[0028] The prompt word value vectors mapped to the prompt word key vectors selected from the prompt word pool are determined as the historical knowledge.

[0029] In a specific implementation of the present invention, the secondary agent is used to concatenate the sub-questions and the prompt word value vectors corresponding to each time sequence, including:

[0030] The secondary agent is used to concatenate the sub-questions and the prompt word value vectors mapped to the selected prompt word key vectors.

[0031] In a specific embodiment of the present invention, after using each secondary agent to generate the time series data answer corresponding to the received sub-question according to the found historical knowledge, it also includes:

[0032] Using each secondary agent to return each time series data answer to the main agent;

[0033] The master agent is used to return the answers to the time series data to the question sending end that sent the question statement.

[0034] In a specific embodiment of the present invention, the training process of each secondary agent is also included. The training process of each secondary agent includes:

[0035] The window length of the initial pre-trained language model is expanded through the window length self-expansion technology to obtain the language model after window expansion;

[0036] Obtain the time series data sets corresponding to each category of time series data tasks;

[0037] The window-expanded language model is trained with fine-tuning instructions using each time series data set to obtain each secondary agent.

[0038] In a specific implementation of the present invention, each time series data set is used to perform instruction fine-tuning training on the window-expanded language model, including:

[0039] The window-expanded language model is trained by efficiently fine-tuning parameters using each time series data set.

[0040] In a specific embodiment of the present invention, after obtaining each secondary agent, the method further includes:

[0041] Add a preset percentage of random masks to the time series data sets corresponding to each category of time series data tasks to obtain the added time series data sets;

[0042] Each secondary agent is trained for binary classification prediction using each added time series dataset.

[0043] In a specific implementation of the present invention, obtaining time series data sets corresponding to time series data tasks of each category includes:

[0044] Obtain the time series data sets corresponding to the time series data prediction task, time series data classification task, time series data detection task, and time series data completion task respectively.

[0045] A time series data processing device, comprising:

[0046] Memory for storing computer programs;

[0047] A processor is used to implement the steps of the time series data processing method as described above when executing the computer program.

[0048] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the time series data processing method described above are implemented.

[0049] A computer program product comprises a computer program, which implements the steps of the time series data processing method as described above when executed by a processor.

[0050] The time series data processing method provided by the present invention receives a question statement about time series data; uses a main intelligent agent to decompose the question statement according to the question type, and distributes the sub-questions of each category obtained by the decomposition to secondary intelligent agents of corresponding types; uses each secondary intelligent agent to search for at least one time series of historical knowledge corresponding to the sub-question from a prompt word pool of corresponding type; uses each secondary intelligent agent to generate a time series data answer corresponding to the received sub-question based on the historical knowledge found; wherein the main intelligent agent and each secondary intelligent agent are intelligent agents obtained by expanding the window length of a preset language model.

[0051] It can be seen from the above technical solution that the main agent and multiple secondary agents are obtained through window length expansion training. The question statement is decomposed by the main agent, and the sub-questions of each category obtained by the decomposition are assigned to the corresponding type of secondary agents. The corresponding type of prompt word pool is deployed in advance for each secondary agent, and the prompt word pool contains historical knowledge of multiple time series. Each secondary agent is used to generate the time series data answer corresponding to the received sub-question based on the historical knowledge found. The problem of selecting the window length for time series data modeling is solved by window length expansion. By setting a prompt word pool containing historical knowledge corresponding to multiple time series, historical knowledge is effectively utilized, and the reuse and migration of time series data knowledge is realized. It effectively improves the field of view of data analysis and improves the accuracy of time series data processing results. By using multiple secondary agents to handle sub-questions of different categories respectively, it has the ability to handle complex and changeable time series data, so it is suitable for various types of time series data tasks.

[0052] Correspondingly, the present invention also provides a time series data processing device, equipment and computer-readable storage medium corresponding to the above-mentioned time series data processing method, which have the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 A flowchart of a time series data processing method according to an embodiment of the present invention;

[0055] Figure 2 Another implementation flow chart of the time series data processing method in the embodiment of the present invention;

[0056] Figure 3 This is an overall framework diagram of a time series data processing system in an embodiment of the present invention;

[0057] Figure 4 is a structural block diagram of a time series data processing device in an embodiment of the present invention;

[0058] Figure 5 is a structural block diagram of a time series data processing device in an embodiment of the present invention;

[0059] Figure 6 A schematic diagram of the specific structure of a time series data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] Time series modeling and analysis are crucial in many practical applications, such as demand planning, anomaly detection, investment management, power load forecasting, weather forecasting, etc. However, the difficulties in time series data, such as high dimensionality, nonlinearity, sparsity, distribution drift, etc., significantly increase the difficulty of analysis and modeling. To solve the challenges in these time series modeling tasks, rich professional domain knowledge and specially designed neural network architectures are generally required. In recent years, unlike the network architectures designed for different time series modeling tasks, the basic pre-trained large language models (LLMs) have strong generalization and logical reasoning capabilities, and have good results on many natural language processing (NLP) tasks, which provides new ideas for time series modeling. These large language models can quickly adapt to new tasks and perform well with the help of few sample instances or domain fine-tuning.

[0061] In order to reduce the deployment and inference cost of large language models and improve the efficiency of modeling, many small-scale pretrained language models (SLMs) have received widespread attention. However, compared with those large language models, smaller-scale pretrained language models may have problems with insufficient reasoning and generalization capabilities. Large models designed and trained based on time series data mainly generate prediction results based on a fixed historical observation window length. This modeling scheme may cause information loss of complex time series patterns, thereby affecting the accuracy of modeling. Smaller window lengths can capture local patterns but lack the perception of global trends. Larger window lengths can capture more contextual information but may ignore detailed information.

[0062] To this end, the time series data processing method provided in the present invention improves the accuracy of time series data processing results and is applicable to various types of time series data tasks.

[0063] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0064] See also Figure 1 , Figure 1 This is a flow chart of an implementation of a time series data processing method in an embodiment of the present invention. The method may include the following steps:

[0065] S101: receiving a question statement regarding time series data.

[0066] When it is necessary to perform prediction, classification, detection, completion and other tasks on time series data, a corresponding question statement is generated and sent to the time series data processing center, which receives the question statement on the time series data.

[0067] The time series data processing center may be a processor including a main agent that generates answers corresponding to question statements and multiple secondary agents.

[0068] The question statements may be question statements in related fields such as power load prediction, traffic flow prediction, and weather forecast.

[0069] S102: Using the main agent to decompose the question statement according to the question type, and assigning the sub-questions of each category obtained by the decomposition to the secondary agents of the corresponding type.

[0070] The main agent is obtained by performing window length expansion training on the preset language model, thereby improving the long-context processing capability of the preset language model, so that the preset language model can handle long-term dependencies without reducing performance. After receiving the question statements for time series data, the time series data processing center uses the main agent to decompose the question statements according to the question type, such as the question statements can be decomposed according to the problem types of prediction, classification, detection, completion, etc. The corresponding secondary agents are deployed in advance for each type of sub-problem to answer the questions, and the sub-problems of each category obtained by decomposition are assigned to the corresponding type of secondary agents.

[0071] S103: Using each secondary agent to search for at least one temporal historical knowledge corresponding to the sub-problem from a prompt word pool of a corresponding type.

[0072] Each sub-agent is obtained by performing window length expansion training on the preset language model. A corresponding prompt word pool is constructed in advance for each type of sub-agent, and the prompt word pool stores one or more time-series historical knowledge corresponding to the corresponding type of sub-problem, such as the historical knowledge of the same time of the previous week, the same time of the previous month, the same time of the previous quarter, and the same time of the previous year corresponding to the corresponding type of sub-problem. Key-value pairs of domain and task-related knowledge can be stored in each prompt word pool, each key represents a specific time-series pattern (such as seasonality, periodicity, and sporadicity, etc.), and each value represents the historical detail information contained in the pattern. After the sub-problems of each category obtained by decomposition are assigned to the corresponding type of sub-agent, each sub-agent is used to search for at least one time-series historical knowledge corresponding to the sub-problem from the corresponding type of prompt word pool.

[0073] It should be noted that the preset language model used to train the main agent and the preset language model used to train the secondary agent can be the same model or different models, and the embodiment of the present invention does not limit this.

[0074] It should also be noted that the window extension length of the preset language model used to train the main intelligent agent and the window extension length of the preset language model used to train the secondary intelligent agent can be the same or different, and the embodiment of the present invention does not limit this.

[0075] S104: Using each secondary agent to generate a time series data answer corresponding to the received sub-question based on the historical knowledge found.

[0076] Among them, the main agent and each secondary agent are agents obtained by expanding the window length of the preset language model.

[0077] After using each secondary agent to find at least one time series of historical knowledge corresponding to the sub-question from the corresponding type of prompt word pool, each secondary agent is used to generate the time series data answer corresponding to the received sub-question based on the historical knowledge found. By adopting a hierarchical agent retrieval augmented generation (RAG) scheme, the problem is decomposed by using the step-by-step thinking chain technology, and the secondary agent is called to complete the modeling task in combination with the problem type. It has the ability to handle complex and changeable time series data, so it is suitable for various types of time series data tasks. By setting up a prompt word pool containing historical knowledge corresponding to multiple time series, historical knowledge is effectively utilized, and the reuse and migration of time series data knowledge is realized. It effectively improves the vision of data analysis and the accuracy of time series data processing results.

[0078] It can be seen from the above technical solution that the main agent and multiple secondary agents are obtained through window length expansion training. The question statement is decomposed by the main agent, and the sub-questions of each category obtained by the decomposition are assigned to the corresponding type of secondary agents. The corresponding type of prompt word pool is deployed in advance for each secondary agent, and the prompt word pool contains historical knowledge of multiple time series. Each secondary agent is used to generate the time series data answer corresponding to the received sub-question based on the historical knowledge found. The problem of selecting the window length for time series data modeling is solved by window length expansion. By setting a prompt word pool containing historical knowledge corresponding to multiple time series, historical knowledge is effectively utilized, and the reuse and migration of time series data knowledge is realized. It effectively improves the field of view of data analysis and improves the accuracy of time series data processing results. By using multiple secondary agents to handle sub-questions of different categories respectively, it has the ability to handle complex and changeable time series data, so it is suitable for various types of time series data tasks.

[0079] It should be noted that, based on the above embodiment, the embodiment of the present invention also provides corresponding improved solutions. In the subsequent embodiments, the same steps or corresponding steps as those in the above embodiment can be referenced to each other, and the corresponding beneficial effects can also be referenced to each other, which will not be repeated one by one in the following improved embodiments.

[0080] See also Figure 2 , Figure 2 Another implementation flow chart of the time series data processing method in an embodiment of the present invention is shown. The method may include the following steps:

[0081] S201: Receive a question statement regarding time series data.

[0082] S202: Using the main intelligent agent to decompose the question statement according to the question type using the thinking chain technology, and assign the sub-questions of each category obtained by the decomposition to the corresponding type of secondary intelligent agents.

[0083] After receiving the question statement about the time series data, the main agent uses the step-by-step thinking chain technology to decompose the question statement according to the question type, and assigns the sub-questions of each category obtained by the decomposition to the corresponding type of secondary agents. By using the step-by-step thinking chain technology to decompose the problem, the problem decomposition efficiency is improved and the problem decomposition process is simplified.

[0084] S203: Utilize each secondary agent to search for at least one temporal prompt word key vector corresponding to the sub-problem from a prompt word pool of the corresponding type.

[0085] The prompt word pool includes one or more time-series key-value pairs consisting of a prompt word key vector and a prompt word value vector. After the sub-problems of each category obtained by decomposition are assigned to the corresponding type of secondary agents, each secondary agent is used to search for at least one time-series prompt word key vector corresponding to the sub-problem from the prompt word pool of the corresponding type.

[0086] Assume prompt word pool Contains M key-value pairs . represents the key of the mth prompt word, Represents the corresponding prompt word value matrix, l represents the length, and d represents the dimension. In order to retrieve and sequence data from the prompt word pool The most relevant prompt word, t represents the time dimension index of the data series, represents the length of the time series data, i represents the spatial dimension index of the time series data, and first linearly maps it to a d-dimensional vector Then use the cosine similarity function To calculate the matching degree between the input time series data vector and each prompt word key vector,

[0087] ;

[0088] And select the top K prompt words with the highest similarity scores, where ,set up Represents the K retrieved prompt word key vectors, and then concatenates the retrieved prompt word value vector and the input time series data vector to form the input vector ,in , Represents the prompt word value vector mapped to the prompt word key vector retrieved from the pool. Finally, Linear mapping to d-dimensional vector ,in is a learnable parameter matrix.

[0089] S204: Determine the prompt word value vector mapped by the prompt word key vector in the prompt word pool as historical knowledge.

[0090] The input time series data is standardized so that the mean of the sequence data is 0 and the variance is 1. The time series data is divided into sliding windows with a predetermined length (such as 512) to obtain a time series subsequence data set, and each prompt word value vector is obtained. The generation time corresponding to each time series subsequence data set is determined as the prompt word key vector corresponding to the prompt word value vector. By standardizing the input time series data, the generation efficiency of prompt words in the prompt word pool is improved. By dividing the input time series data into fixed lengths, the consistency of the data length of the prompt word key value pairs in the prompt word pool is guaranteed, which facilitates the management of the data in the prompt word pool.

[0091] After using each secondary agent to find at least one time-series prompt word key vector corresponding to the sub-question from the prompt word pool of the corresponding type, the prompt word value vector mapped by the prompt word key vector in the prompt word pool is determined as historical knowledge. Thus, fast and accurate search of historical knowledge is achieved through key-value pair search.

[0092] S205: Using each secondary agent to generate a time series data answer corresponding to the received sub-question based on the historical knowledge found.

[0093] S206: Use each secondary agent to return the answers to each time series data to the main agent.

[0094] After using each secondary agent to generate the time series data answer corresponding to the received sub-question based on the historical knowledge found, each secondary agent is used to return the time series data answer to the main agent, thereby realizing the automatic feedback of the generated time series data answer.

[0095] S207: Use the main agent to return the answers to each time series data to the question sender that sent the question statement.

[0096] Among them, the main agent and each secondary agent are agents obtained by expanding the window length of the preset language model.

[0097] After each secondary agent returns the answer to each time series data to the main agent, the main agent returns the answer to each time series data to the question sender that sent the question statement. Thus, through the two-level return of the time series data answer, the accurate and fast return of the time series data answer is achieved.

[0098] See also Figure 3 , Figure 3 The figure is an overall framework diagram of a time series data processing system in an embodiment of the present invention. The hierarchical multi-agent time series data modeling framework mainly includes three modules: 1) the main agent, which receives questions input by users and performs routing and task assignment based on question types; 2) the secondary agent is constructed based on a smaller-scale pre-trained language model fine-tuned for various time series data modeling tasks (prediction, classification, completion or anomaly detection); 3) the secondary agent retrieves similar historical knowledge from the prompt word pool knowledge base it maintains, and completes the task in combination with the retrieved knowledge, and finally returns it to the main agent. After receiving the information returned by the secondary agent, the main agent returns it to the question sender as the answer to the final question.

[0099] In a specific implementation of the present invention, step S204 may include the following steps:

[0100] Step 1: Find the prompt word value vector mapped by the prompt word key vector from the prompt word pool, which is obtained by concatenating the trend value, the period value and the residual value;

[0101] Step 2: Determine the prompt word value vector as historical knowledge.

[0102] For the convenience of description, the above two steps can be combined for explanation.

[0103] The prompt word value vector corresponding to each prompt word key vector in the prompt word pool includes a trend value, a period value, and a residual value. The prompt word value vector obtained by concatenating the trend value, the period value, and the residual value mapped by the prompt word key vector is searched from the prompt word pool, and the prompt word value vector is determined as historical knowledge. By determining the prompt word value vector obtained by concatenating the trend value, the period value, and the residual value as historical knowledge, the comprehensiveness and referenceability of the historical knowledge found are greatly improved.

[0104] In a specific implementation of the present invention, determining the prompt word value vector as historical knowledge may include the following steps:

[0105] Step 1: Use the secondary agent to concatenate the prompt word value vectors corresponding to the sub-questions and each time series to obtain a concatenated vector;

[0106] Step 2: Determine the concatenated vector as historical knowledge.

[0107] For the convenience of description, the above two steps can be combined for explanation.

[0108] After obtaining the prompt word value vectors corresponding to each time series, the secondary agent is used to splice the prompt word value vectors corresponding to the sub-problem and each time series, such as using the secondary agent to splice the vector mapped to the sub-problem and the prompt word value vector corresponding to each time series to obtain a spliced ​​vector, and the spliced ​​vector is determined as historical knowledge. By splicing the prompt word value vectors corresponding to multiple time series to obtain historical knowledge, the reuse and migration of time series data knowledge is realized, which effectively improves the field of view of data analysis and improves the accuracy of time series data processing results.

[0109] In a specific implementation of the present invention, step S204 may include the following steps:

[0110] Step 1: When the number of found prompt word key vectors is greater than 1, calculate the matching degree between the sub-question and each prompt word key vector respectively;

[0111] Step 2: Sort the key vectors of each prompt word by their matching degree to obtain the sorting result;

[0112] Step 3: According to the sorting results, select a preset number of prompt word key vectors from the end with a high matching degree;

[0113] Step 4: Determine the prompt word value vectors mapped to the prompt word key vectors selected from the prompt word pool as historical knowledge.

[0114] For the convenience of description, the above four steps can be combined for explanation.

[0115] When the number of prompt word key vectors found is greater than 1, the matching degree between the sub-question and each prompt word key vector is calculated respectively, and each prompt word key vector is sorted by matching degree to obtain the sorting result. According to the sorting result, the first preset number of prompt word key vectors are selected from the end with high matching degree, and the prompt word value vectors mapped by each prompt word key vector selected from the prompt word pool are determined as historical knowledge. By sorting the results according to the matching degree, the prompt word value vectors mapped by the first preset number of prompt word key vectors with high matching degree are determined as historical knowledge, which greatly improves the relevance of historical knowledge.

[0116] In a specific implementation of the present invention, using a secondary agent to concatenate the sub-questions and the prompt word value vectors corresponding to each time sequence may include the following steps:

[0117] The secondary agent is used to concatenate the prompt word value vectors mapped to the sub-problems and the selected prompt word key vectors.

[0118] After sorting the results according to the matching degree and selecting the first preset number of prompt word key vectors with high matching degree, the secondary agent is used to splice the prompt word value vectors mapped to the sub-questions and the selected prompt word key vectors. By splicing only the prompt word value vectors mapped to the prompt word key vectors with high matching degree to obtain the splicing vector, the splicing vector is avoided from being too large, so that the limited window length of the secondary agent is fully utilized.

[0119] In a specific embodiment of the present invention, the method may further include a training process for each secondary agent, and the training process for each secondary agent may include the following steps:

[0120] Step 1: Expand the window length of the initial pre-trained language model through the window length self-expansion technology to obtain the language model after window expansion;

[0121] Step 2: Obtain the time series data sets corresponding to each category of time series data tasks;

[0122] Step 3: Use each time series data set to perform instruction fine-tuning training on the language model after window expansion to obtain each secondary agent.

[0123] For the convenience of description, the above three steps can be combined for explanation.

[0124] When training each secondary agent, the window length of the initial pre-trained language model is expanded through the window length self-expansion technology to obtain the window-expanded language model, and the time series data sets corresponding to each category of time series data tasks are obtained. The window-expanded language model is trained with instructions fine-tuned using each time series data set to obtain each secondary agent. The window-expanded language model is obtained through window length expansion, and then fine-tuned training is performed through instructions to obtain a secondary agent for processing different types of time series data tasks. By combining window self-expansion technology and instruction fine-tuning for secondary agent training, the ability of the trained secondary agent to handle the corresponding type of sub-problems is greatly improved.

[0125] In a specific implementation of the present invention, using each time series data set to perform instruction fine-tuning training on the language model after window expansion may include the following steps:

[0126] Each time series dataset is used to train the language model after window expansion through efficient parameter fine-tuning.

[0127] The language model after window expansion is trained by using parameter-efficient fine-tuning (PEFT) of each time series data set. For example, low-rank adaptation (LoRA) can be used to train the language model after window expansion. By using parameter-efficient fine-tuning to train the language model after window expansion, the training efficiency and accuracy of the secondary agent used to process different types of time series data tasks are improved.

[0128] In a specific embodiment of the present invention, after obtaining each secondary agent, the method may further include the following steps:

[0129] Step 1: Add a preset percentage of random masks to the time series data sets corresponding to each category of time series data tasks to obtain the added time series data sets;

[0130] Step 2: Use each added time series data set to perform binary classification prediction training on each secondary agent.

[0131] For the convenience of description, the above two steps can be combined for explanation.

[0132] After obtaining each sub-agent, a preset percentage of random mask is added to the time series data set corresponding to each category of time series data task. For example, a 50% random mask can be added to the time series data set corresponding to each category of time series data task to obtain the added time series data set, and each added time series data set is used to perform binary classification prediction training on each sub-agent. By adding a random mask to the time series data set and performing binary classification prediction training on each sub-agent, the pre-trained language model is adjusted through the Direct Preference Optimization (DPO) technology, so that its output adapts to the prediction results in the time series modeling task scenario, and improves the accuracy of the time series data processing results of each sub-agent obtained by training.

[0133] In a specific implementation of the present invention, obtaining time series data sets corresponding to time series data tasks of each category may include the following steps:

[0134] Obtain the time series data sets corresponding to the time series data prediction task, time series data classification task, time series data detection task, and time series data completion task respectively.

[0135] Obtain the time series data sets corresponding to the time series data prediction task, time series data classification task, time series data detection task and time series data completion task. By using the time series data sets corresponding to the time series data prediction task, time series data classification task, time series data detection task and time series data completion task to train the model, each sub-agent that can process the time series data prediction task, time series data classification task, time series data detection task and time series data completion task is obtained. By using multiple sub-agents to process different categories of sub-problems respectively, it has the ability to process complex and changeable time series data, and is therefore suitable for various types of time series data tasks.

[0136] Corresponding to the above method embodiment, the present invention further provides a time series data processing device. The time series data processing device described below and the time series data processing method described above can be referenced to each other.

[0137] See also Figure 4 , Figure 4 This is a structural block diagram of a time series data processing device in an embodiment of the present invention, and the device may include:

[0138] A question statement receiving module 41 is used to receive question statements about time series data;

[0139] A question assignment module 42 is used to decompose the question statement according to the question type by using the main agent, and assign the sub-questions of each category obtained by the decomposition to the secondary agents of the corresponding type;

[0140] A historical knowledge search module 43, used to use each secondary agent to search for at least one time-series historical knowledge corresponding to the sub-question from a prompt word pool of a corresponding type;

[0141] The answer search module 44 is used to generate time series data answers corresponding to the received sub-questions using each secondary agent according to the found historical knowledge;

[0142] Among them, the main agent and each secondary agent are agents obtained by expanding the window length of the preset language model.

[0143] It can be seen from the above technical solution that the main agent and multiple secondary agents are obtained through window length expansion training. The question statement is decomposed by the main agent, and the sub-questions of each category obtained by the decomposition are assigned to the corresponding type of secondary agents. The corresponding type of prompt word pool is deployed in advance for each secondary agent, and the prompt word pool contains historical knowledge of multiple time series. Each secondary agent is used to generate the time series data answer corresponding to the received sub-question based on the historical knowledge found. The problem of selecting the window length for time series data modeling is solved by window length expansion. By setting a prompt word pool containing historical knowledge corresponding to multiple time series, historical knowledge is effectively utilized, and the reuse and migration of time series data knowledge is realized. It effectively improves the field of view of data analysis and improves the accuracy of time series data processing results. By using multiple secondary agents to handle sub-questions of different categories respectively, it has the ability to handle complex and changeable time series data, so it is suitable for various types of time series data tasks.

[0144] In a specific embodiment of the present invention, the question assignment module 42 is specifically a module that uses the main intelligent agent to decompose the question statement according to the question type using the thought chain technology.

[0145] In a specific implementation of the present invention, the historical knowledge search module 43 includes:

[0146] A key vector search submodule, used to use each secondary agent to search for at least one time-series prompt word key vector corresponding to the sub-problem from the prompt word pool of the corresponding type;

[0147] The historical knowledge determination submodule is used to determine the prompt word value vector mapped by the prompt word key vector in the prompt word pool as historical knowledge.

[0148] In a specific implementation of the present invention, the historical knowledge determination submodule includes:

[0149] A value vector search unit, used for searching the prompt word value vector mapped by the prompt word key vector from the prompt word pool and obtained by concatenating the trend value, the period value and the residual value;

[0150] The historical knowledge determination unit is used to determine the prompt word value vector as historical knowledge.

[0151] In a specific implementation of the present invention, the historical knowledge determination unit includes:

[0152] A splicing vector obtaining subunit is used to use the secondary agent to splice the prompt word value vectors corresponding to the sub-questions and each time sequence to obtain a splicing vector;

[0153] The historical knowledge determination subunit is used to determine the concatenated vector as historical knowledge.

[0154] In a specific implementation of the present invention, the historical knowledge determination submodule includes:

[0155] A matching degree calculation unit, used for respectively calculating the matching degree between the sub-question and each of the prompt word key vectors when the number of the found prompt word key vectors is greater than one;

[0156] A sorting result obtaining unit is used to sort the key vectors of each prompt word by their matching degree to obtain a sorting result;

[0157] A key vector selection unit, used to select a preset number of prompt word key vectors from the end with a high matching degree according to the sorting result;

[0158] The historical knowledge determination unit is used to determine the prompt word value vectors mapped to the prompt word key vectors selected from the prompt word pool as historical knowledge.

[0159] In a specific embodiment of the present invention, the splicing vector obtaining subunit is specifically a unit that uses a secondary agent to splice the sub-problems and the prompt word value vectors mapped to the selected prompt word key vectors.

[0160] In a specific embodiment of the present invention, the device may further include:

[0161] The first answer return module is used to use each secondary agent to return the answer of each time series data to the main agent;

[0162] The second answer returning module is used to use the main intelligent agent to return the answers to each time series data to the question sending end that sent the question statement.

[0163] In a specific embodiment of the present invention, the device may further include a secondary agent training module, the secondary agent training module including:

[0164] The window length expansion submodule is used to expand the window length of the initial pre-trained language model through the window length self-expansion technology to obtain the language model after the window expansion;

[0165] The time series data set acquisition submodule is used to obtain the time series data sets corresponding to each category of time series data tasks;

[0166] The instruction fine-tuning training submodule is used to perform instruction fine-tuning training on the language model after window expansion using each time series data set to obtain each secondary intelligent agent.

[0167] In a specific implementation of the present invention, the instruction fine-tuning training submodule is specifically a module that uses each time series data set to train the language model after window expansion through efficient parameter fine-tuning.

[0168] In a specific embodiment of the present invention, the device may further include:

[0169] A random mask adding module is used to add a preset percentage of random masks to the time series data sets corresponding to each category of time series data tasks after obtaining each secondary agent, so as to obtain the added time series data sets;

[0170] The binary classification prediction training module is used to perform binary classification prediction training on each secondary agent using each added time series data set.

[0171] In a specific embodiment of the present invention, the time series data set acquisition submodule is specifically a module for acquiring time series data sets corresponding to the time series data prediction task, the time series data classification task, the time series data detection task and the time series data completion task, respectively.

[0172] Corresponding to the above method embodiment, see Figure 5 , Figure 5 This is a schematic diagram of a time series data processing device provided by the present invention, and the device may include:

[0173] A memory 332, for storing computer programs;

[0174] The processor 322 is used to implement the steps of the time series data processing method of the above method embodiment when executing the computer program.

[0175] For details, please refer to Figure 6 , Figure 6A specific structural diagram of a time series data processing device provided for this embodiment, the time series data processing device may have relatively large differences due to different configurations or performances, and may include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the time series data processing device 301.

[0176] The time series data processing device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .

[0177] The steps in the time series data processing method described above can be implemented by the structure of a time series data processing device.

[0178] Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:

[0179] Receive a question statement about time series data; use a main agent to decompose the question statement according to the question type, and assign the sub-questions of each category obtained by the decomposition to secondary agents of the corresponding type; use each secondary agent to search for at least one time series of historical knowledge corresponding to the sub-question from a prompt word pool of the corresponding type; use each secondary agent to generate an answer to the time series data corresponding to the received sub-question based on the historical knowledge found; wherein the main agent and each secondary agent are agents obtained by expanding the window length of a preset language model.

[0180] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0181] For an introduction to the computer-readable storage medium provided by the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0182] Corresponding to the above method embodiment, the present invention also provides a computer program product, including a computer program, which implements the steps of the above time series data processing method when executed by a processor.

[0183] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device, computer-readable storage medium, and computer program product disclosed in the embodiment, since they correspond to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0184] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the technical solution and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A time series data processing method, characterized in that: include: Receive question statements about time series data; Using the main agent to decompose the question statement according to the question type, and assigning the sub-questions of each category obtained by the decomposition to the secondary agents of the corresponding type; Using each secondary agent to search for at least one temporal historical knowledge corresponding to the sub-problem from a corresponding type of prompt word pool; Each secondary agent generates the time series data answer corresponding to the received sub-question based on the historical knowledge found; The main agent and each secondary agent are agents obtained by extending the window length of a preset language model; It also includes the training process of each sub-agent, which includes: The window length of the initial pre-trained language model is expanded through the window length self-expansion technology to obtain the language model after window expansion; Obtain the time series data sets corresponding to each category of time series data tasks; The window-expanded language model is trained with fine-tuning instructions using each time series data set to obtain each secondary agent.

2. The time series data processing method according to claim 1, characterized in that: The main agent is used to decompose the question statement according to the question type, including: The main intelligent agent is used to decompose the question sentences according to the question type using the thinking chain technology.

3. The time series data processing method according to claim 1 or 2, characterized in that: Using each secondary agent to search for at least one temporal historical knowledge corresponding to the sub-problem from the corresponding type of prompt word pool, including: Using each secondary agent to search for at least one time-series prompt word key vector corresponding to the sub-problem from a prompt word pool of corresponding type; The prompt word value vector mapped by the prompt word key vector in the prompt word pool is determined as the historical knowledge.

4. The time series data processing method according to claim 3, characterized in that: Determining the prompt word value vector mapped to the prompt word key vector in the prompt word pool as the historical knowledge includes: Searching the prompt word value vector mapped by the prompt word key vector from the prompt word pool, which is obtained by concatenating the trend value, the period value and the residual value; The prompt word value vector is determined as the historical knowledge.

5. The time series data processing method according to claim 4, characterized in that: Determining the prompt word value vector as the historical knowledge includes: Using the secondary agent to concatenate the prompt word value vectors corresponding to the sub-problems and each time sequence to obtain a concatenated vector; The splicing vector is determined as the historical knowledge.

6. The time series data processing method according to claim 5, characterized in that: Determining the prompt word value vector mapped to the prompt word key vector in the prompt word pool as the historical knowledge includes: When the number of found prompt word key vectors is greater than 1, the matching degree between the sub-question and each prompt word key vector is calculated respectively; Sort the key vectors of each prompt word by their matching degree to obtain the sorting result; According to the sorting result, a preset number of prompt word key vectors are selected from the end with the highest matching degree; The prompt word value vectors mapped to the prompt word key vectors selected from the prompt word pool are determined as the historical knowledge.

7. The time series data processing method according to claim 6, characterized in that: The secondary agent is used to concatenate the prompt word value vectors corresponding to the sub-questions and each time sequence, including: The secondary agent is used to concatenate the sub-problems and the prompt word value vectors mapped to the selected prompt word key vectors.

8. The time series data processing method according to claim 1, wherein: After each secondary agent generates the time series data answer corresponding to the received sub-question based on the historical knowledge found, it also includes: Using each secondary agent to return each time series data answer to the main agent; The master agent is used to return the answers to the time series data to the question sending end that sent the question statement.

9. The time series data processing method according to claim 1, wherein: The window-expanded language model is trained for instruction fine-tuning using each time series dataset, including: The window-expanded language model is trained by efficiently fine-tuning parameters using each time series dataset.

10. The time series data processing method according to claim 1, wherein: After obtaining each sub-agent, it also includes: Add a preset percentage of random masks to the time series data sets corresponding to each category of time series data tasks to obtain the added time series data sets; Each secondary agent is trained for binary classification prediction using each added time series dataset.

11. The time series data processing method according to claim 1, wherein: Obtain the time series data sets corresponding to each category of time series data tasks, including: Obtain the time series data sets corresponding to the time series data prediction task, time series data classification task, time series data detection task, and time series data completion task respectively.

12. A time series data processing device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the time series data processing method according to any one of claims 1 to 11 when executing the computer program.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the time series data processing method according to any one of claims 1 to 11.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the time series data processing method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Method for establishing operation and maintenance knowledge base based on multiple agents

    CN117271767A

  • CCER smart question-answering method and device, electronic equipment and storage medium

    CN117874179A