Time series prediction model construction and apparatus, time series prediction method and apparatus, and device and medium
By dividing the prediction task into sub-tasks and training the same model, the problems of high cost and error accumulation in existing technologies are solved, and efficient and accurate time series prediction is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2025-07-10
- Publication Date
- 2026-04-23
AI Technical Summary
Existing technologies require the construction of N different prediction models to predict the next N days, resulting in high business costs and accumulated errors, which affects prediction accuracy.
The prediction task is divided into multiple sub-tasks, and the same preset model is trained based on these sub-tasks to obtain the target prediction model, which is used to predict features within the target time period.
It reduces model building costs, improves prediction accuracy, avoids error accumulation, and enhances model performance and management efficiency.
Smart Images

Figure CN2025107846_23042026_PF_FP_ABST
Abstract
Description
Time series forecasting model construction and time series forecasting methods, devices, equipment and media Technical Field
[0001] This application relates to the field of time series forecasting technology, specifically to a time series forecasting model construction and a time series forecasting method, apparatus, equipment and medium. Background Technology
[0002] In time-series forecasting scenarios, it's common practice to focus on and extract recent time-specific information, such as historical data like yesterday's and the day before's sales, to capture time dependencies and trend changes in the data, thereby making accurate predictions. However, for scenarios where business operations require forecasting over a period of time, such as predicting daily sales for the next 14 days, it's not always possible to collect sales data for at least one day prior to the forecast date, which may lead to poor forecasting results.
[0003] In related technologies, for scenarios that predict the next N days, N different prediction models are built for the first N days to the last N days, and predictions are made for each of the next N days, which results in high business costs. Summary of the Invention
[0004] Based on the defects and shortcomings of the existing technology, this application proposes a time series prediction model construction and time series prediction method, device, equipment and medium, which can train the same preset model based on the prediction sub-tasks obtained by dividing the prediction task and combining sample data to obtain a target prediction model that can predict the features of each sub-time period within the target time period, thus solving the problems of long time consumption and difficulty in ensuring the accuracy of prediction results when predicting the next N days.
[0005] According to a first aspect of the embodiments of this application, a method for constructing a time series prediction model is provided, comprising:
[0006] The prediction task is divided into multiple prediction sub-tasks. The prediction task is to predict features within the target time period, and the prediction sub-tasks are to predict features within sub-time periods of the target time period.
[0007] A target prediction model is obtained by training the same preset model with multiple prediction sub-tasks and sample data. The target prediction model is used to perform prediction tasks.
[0008] According to a second aspect of the embodiments of this application, a time series prediction method is provided, including:
[0009] The current prediction task is divided into multiple current prediction sub-tasks. The current prediction task is to predict the features within the target time period after the current time, and the current prediction sub-tasks are to predict the features within the target time period.
[0010] The current prediction subtask and historical features are input into the same target prediction model to obtain features within the target time period. The target prediction model is used to execute the current prediction task, and the historical features are features within a preset time period before the current time.
[0011] According to a third aspect of the embodiments of this application, a time series prediction model construction apparatus is provided, comprising:
[0012] The segmentation module is used to divide the prediction task into multiple prediction sub-tasks. The prediction task is to predict features within the target time period, and the prediction sub-tasks are to predict features within sub-time periods of the target time period.
[0013] The training module is used to train the same preset model based on multiple prediction sub-tasks and sample data to obtain a target prediction model, which is used to perform prediction tasks.
[0014] According to a fourth aspect of the embodiments of this application, a timing prediction apparatus is provided, comprising:
[0015] The partitioning module is used to divide the current prediction task into multiple current prediction sub-tasks. The current prediction task is to predict features within the target time period after the current time, and the current prediction sub-tasks are to predict features within the target time period.
[0016] The prediction module is used to input the current prediction subtask and historical features into the same target prediction model to obtain features within the target time period. The target prediction model is used to execute the current prediction task, and the historical features are features within a preset time period before the current time.
[0017] According to a fifth aspect of the embodiments of this application, an electronic device is provided, including a memory and a processor;
[0018] The memory is connected to the processor and is used to store programs;
[0019] The processor is used to implement the timing prediction model construction method as described in the first aspect, or the timing prediction method as described in the second aspect, by running a program in memory.
[0020] According to a sixth aspect of the embodiments of this application, a storage medium is provided, on which a computer program is stored. When the computer program is run by a processor, it implements the time series prediction model construction method as described in the first aspect, or the time series prediction method as described in the second aspect.
[0021] In the aforementioned time series prediction model construction and time series prediction method, device, equipment and medium, the prediction task of predicting features within the target time period is divided into multiple prediction sub-tasks that predict features within sub-time periods of the target time period. Then, the same preset model is trained based on multiple prediction sub-tasks and sample data to obtain a target prediction model for performing the prediction task. In this way, predicting features of each sub-time period within the target time period based on the target prediction model can effectively reduce the model construction cost, and prediction based on actual data can ensure the accuracy of model prediction. Attached Figure Description
[0022] Figure 1 is a flowchart illustrating a method for constructing a time series prediction model according to an embodiment of this application;
[0023] Figure 2 is a flowchart illustrating a time series prediction method according to an embodiment of this application;
[0024] Figure 3 is a schematic diagram of a time series prediction model construction device according to an embodiment of this application;
[0025] Figure 4 is a schematic diagram of the structure of a timing prediction device proposed in an embodiment of this application;
[0026] Figure 5 is a schematic diagram of the structure of an electronic device proposed in an embodiment of this application. Detailed Implementation
[0027] Overview
[0028] As described in the background section, in related technologies, for scenarios involving predicting the next N days, N different prediction models are constructed for the first to the Nth day of the future. Based on these N different models, predictions are made for each of the next N days, resulting in high business costs.
[0029] Based on this, the inventors further discovered that by dividing the prediction task of features within the target time period into multiple prediction sub-tasks for features within the sub-time periods of the target time period, and then training the same preset model based on multiple prediction sub-tasks and sample data, a target prediction model is obtained to perform the prediction task, i.e., predicting features within the target time period. In this way, there is no need to build more models; the prediction task can be achieved through this target prediction model, which can effectively reduce the business cost of prediction.
[0030] Based on the above concept, this specification provides a time series forecasting model construction and time series forecasting method. The time series forecasting model construction and time series forecasting method will be described exemplarily below with reference to the accompanying drawings.
[0031] Exemplary methods
[0032] Referring to Figure 1, in an exemplary embodiment, a method for constructing a time series prediction model is provided, applicable to any electronic device. As shown in Figure 1, the method for constructing a time series prediction model includes steps S101-S102:
[0033] S101: Divide the prediction task into multiple prediction subtasks.
[0034] The prediction task is to predict features within the target time period, and the prediction subtask is to predict features within a sub-time period of the target time period.
[0035] It should be noted that there is no overlap between the sub-time periods that different prediction sub-tasks are to predict.
[0036] Optionally, the prediction task can be divided based on the target time period to obtain multiple prediction sub-tasks.
[0037] Specifically, the target time period is divided into multiple sub-time periods, and based on these sub-time periods, multiple prediction sub-tasks are determined. Different prediction sub-tasks correspond to different sub-time periods of the target time period, and there is no overlap between different sub-time periods.
[0038] More specifically, the target time period is divided into multiple sub-time periods based on a preset time length. At this time, the time length of these multiple sub-time periods is the same, which is the preset time length.
[0039] More specifically, based on multiple sub-time periods, for each sub-time period, a corresponding prediction sub-task is determined to predict the features of that sub-time period.
[0040] The starting time of the target time period is the prediction reference time. Data before the prediction reference time is used to predict the features within the target time period starting from the prediction reference time.
[0041] For example, taking the prediction task as predicting the total sales volume of goods within 7 days from the prediction base time as an example, the target time period is 7 days. If the preset time length is 1 day, the target time period is divided into 7 sub-time periods, namely the 1st to the 7th day from the prediction base time; the prediction task is divided into 7 prediction sub-tasks, which are used to predict the features of the i-th day from the prediction base time, 1<=i<=7.
[0042] S102: Train the same preset model based on multiple prediction sub-tasks and sample data to obtain a target prediction model.
[0043] The target prediction model is used to perform the above prediction task and predict the features within the target time period.
[0044] We acquire business data from time-series scenarios as sample data. Each business data point is a sample in the sample data, including time, sales point, product information, and sales volume.
[0045] Of course, after obtaining business data in a time-series scenario, the obtained business data can be preprocessed, such as deleting missing values and filtering, and then the preprocessed business data can be used as sample data.
[0046] For example, a sample may include items such as SKU, date, store, and label, where SKU represents the product category, date represents the date, store represents the sales point, and label represents the sales volume. For instance, a sample may be the sales volume S of product A at sales point a on March 24, 2024.
[0047] In this embodiment, by dividing the prediction task of features within the target time period, multiple prediction sub-tasks are obtained, each predicting features within a sub-time period of the target time period. Then, based on these multiple prediction sub-tasks and sample data, the same preset model is trained to obtain a target prediction model for performing the prediction tasks. In this way, a single target prediction model can be used to predict features within each sub-time period of the target time period, effectively reducing prediction time and model construction costs.
[0048] In some embodiments, the aforementioned feature refers to a feature on a target dimension within a preset time period, where the target dimension is at least one of multiple dimensions of the feature.
[0049] For example, the above feature is the sales volume of the target dimension, wherein the multiple dimensions of the feature include sales point and product type, and the target dimension includes at least one of sales point and product type.
[0050] Understandably, time can also be a dimension of features, but since the prediction task involves predicting features within a target time period, time is a dimension that must be considered. Therefore, given that the features are already defined as those within the target time period, this embodiment no longer considers time as a target dimension.
[0051] Depending on the actual working conditions, the multiple dimensions of the feature may include more or fewer dimensional items, and the dimensional items in the target dimension to be predicted will also differ.
[0052] For example, if the target dimension is sales point a, then the above feature is the total sales volume of goods at sales point a within the target time period; if the target dimension is product category A, then the above feature is the total sales volume of product category A within the target time period.
[0053] The target dimension can be determined based on actual forecasting needs.
[0054] Specifically, the actual predicted demand can be determined by the user, or it can be determined by analyzing the actual working conditions based on certain rules.
[0055] In this embodiment, the feature refers to the sales volume of the target dimension. The target dimension is determined based on the actual forecasting needs and includes at least one of the sales points and product types. Therefore, the dimension of the feature can be limited differently based on different actual forecasting needs, so as to obtain a target forecasting model that meets the actual forecasting needs.
[0056] Compared to using multiple models, single-target prediction models offer superior performance in parameter tuning, feature optimization, and other aspects, providing greater convenience. For routine prediction tasks, such as predicting features for the next 28 days, the model's performance and management efficiency can be improved by up to 28 times, and the efficiency of model optimization experiments can also be significantly enhanced.
[0057] In addition, related technologies may also predict each day in the next N (N>1) days sequentially in a serial manner. That is, based on the prediction results from the prediction base time to the (M-1)th day, the prediction for the Mth day is made, where M<=N, until the prediction result for the Nth day is obtained. However, when predicting the Mth day based on the prediction results of the previous M-1 days, error accumulation may occur, affecting the prediction accuracy, and the serial prediction method is time-consuming. In this embodiment, when constructing the target prediction model to perform the prediction task, the prediction of features within the target time period can be directly achieved based on actual data through the target prediction model. This method is less time-consuming and avoids error accumulation, thus better ensuring prediction accuracy.
[0058] To ensure that the target prediction model accurately predicts features within any sub-time period of the target time period, in some embodiments, when the same preset model is trained based on multiple prediction sub-tasks and sample data to obtain a target prediction model, the preset model can be trained separately based on each prediction sub-task to obtain the target prediction model.
[0059] Optionally, a training dataset is first established based on multiple prediction sub-tasks and sample data. Then, for each prediction sub-task, a preset model is trained based on the training dataset to obtain the target prediction model.
[0060] Specifically, for each prediction subtask, a preset model is trained based on the training dataset until all prediction subtasks are traversed, and the final trained model is determined as the target prediction model.
[0061] More specifically, for any one of the multiple prediction sub-tasks, a preset model is trained based on the training dataset to obtain the trained preset model. It is then determined whether model training has been performed for each prediction sub-task. If so, the trained preset model is determined as the target prediction model. If not, the trained preset model is trained again based on other prediction sub-tasks.
[0062] The training data in the training dataset corresponds to multiple prediction subtasks, with different prediction subtasks requiring different training data. When training the model for each prediction subtask, the training data corresponding to that prediction subtask in the training dataset must be used.
[0063] In this embodiment, a training dataset is first established based on multiple prediction sub-tasks and sample data. Then, for each prediction sub-task, a preset model is trained on the training dataset to obtain the target prediction model. Since the importance of short-term features varies for prediction targets at different time intervals (i.e., features within different sub-time periods to be predicted), generally, predicting features in sub-time periods farther from the prediction reference time results in more noise when using short-term features as a reference compared to predicting features in sub-time periods closer to the prediction reference time. Longer intervals may introduce more other interfering factors, leading to feature changes. By training the same preset model on the training dataset for each prediction sub-task, the model's ability to learn features under different noise levels is strengthened, and the robustness of the resulting target prediction model is also stronger. This effectively ensures the prediction performance of the target prediction model, enabling it to accurately predict features within any sub-time period of the target time period.
[0064] In order to train the preset model separately for different prediction sub-tasks, in some embodiments, when building a training dataset based on multiple prediction sub-tasks and sample data, a correspondence is established between the training data in the training dataset and the multiple prediction sub-tasks. In this way, when training the same preset model based on the training dataset for each prediction sub-task, the training data corresponding to that prediction sub-task can be used to train the preset model.
[0065] Optionally, the sample data is assigned to multiple prediction subtasks to obtain the sample data corresponding to each prediction subtask. Then, a training dataset is constructed based on the multiple prediction subtasks and their corresponding sample data.
[0066] Specifically, sample data can be randomly assigned to multiple prediction subtasks. Generally, the difference in the number of samples assigned to different prediction subtasks does not exceed a preset threshold, meaning that the number of samples assigned to different prediction subtasks is basically the same.
[0067] More specifically, when dividing the prediction subtasks, a scenario identifier is assigned to each prediction subtask.
[0068] For example, the prediction task is divided into 7 prediction subtasks, and scene identifiers 1-7 are assigned to these 7 prediction subtasks respectively.
[0069] For example, taking a sample data containing 7000 samples as an example, for the 7 prediction sub-tasks obtained by dividing the prediction task, which correspond to scene identifiers 1-7 respectively, these 7000 samples can be randomly assigned to these 7 prediction sub-tasks. Generally, each prediction sub-task can be assigned 1000 samples, that is, the scene identifier corresponding to these 1000 samples is the scene identifier corresponding to that prediction sub-task.
[0070] Specifically, after allocating the sample data to multiple prediction subtasks, the correspondence between the sample data and the multiple prediction subtasks can be determined based on the allocation of the sample data, and the sample data corresponding to each prediction subtask can be determined based on this correspondence.
[0071] In this embodiment, when building the training dataset based on multiple prediction sub-tasks and sample data, samples from the sample data are randomly assigned to multiple prediction sub-tasks to obtain sample data corresponding to each prediction sub-task. Then, a training dataset is constructed based on these multiple prediction sub-tasks and the sample data corresponding to each prediction sub-task. In this way, although short-term features such as short-term sales have a significant impact on the prediction results, the relationship between short-term sales and the prediction results is not complex. The preset model only needs to learn the relationship. The preset model can learn this relationship sufficiently without a large number of samples. Randomly assigning samples from the sample data to multiple prediction sub-tasks allows the sample data to cover the prediction scenario corresponding to each prediction sub-task. Based on the training dataset constructed using multiple prediction sub-tasks and their corresponding sample data, the preset model can achieve the effect of learning for the scenario corresponding to each prediction sub-task, thereby obtaining a target prediction model that can accurately predict.
[0072] Regarding the relationships that the above model needs to learn, if it refers to linear relationships, for example, for periodic features, the previous periodic features and the current features are linearly correlated, and for trend features, the recent features and the current features are linearly correlated, then by training the linear regression model with periodic sales and short-term sales, a target prediction model that can make accurate predictions can be obtained.
[0073] In some embodiments, when constructing a training dataset based on multiple prediction subtasks and their corresponding sample data, for each prediction subtask, sample features and sample labels are extracted from its corresponding sample data, and the training dataset is constructed based on all the extracted sample features and sample labels, combined with multiple prediction subtasks.
[0074] Optionally, for each prediction subtask, based on the sub-time period predicted by that prediction subtask, sample features and sample labels are extracted from the sample data corresponding to the prediction subtask. The sample features are those prior to the target time period, and the sample labels are those within the sub-time period.
[0075] Specifically, for each prediction subtask, based on the sub-time period predicted by the prediction subtask, the features of the sample data corresponding to the prediction subtask before the target time period are extracted as sample features, and the features within the sub-time period are extracted as sample labels.
[0076] More specifically, when extracting sample features, the features of the sample within a preset time period before the target time period are used as sample features.
[0077] The preset time period can be adjusted based on actual working conditions.
[0078] For example, the prediction task is to predict sales for the next N days starting from the prediction baseline time, with a preset time period of M days. The prediction task is divided into N prediction sub-tasks, each corresponding to one of the next N days. For the prediction sub-task of predicting sales for day 1, the sales for days 1 to M prior to day 1 are extracted as sample features, and the sales for day 1 of the next day are extracted as sample labels; for the prediction sub-task of predicting sales for day 2, the sales for days 2 to M+1 prior to day 2 are extracted as sample features, and the sales for day 2 of the next day are extracted as sample labels; for the prediction sub-task of predicting sales for day N, the sales for days N to M+N-1 prior to day N are extracted as sample features, and the sales for day N of the next day are extracted as sample labels.
[0079] It is understandable that the sales figures for days 1 to M before day 1, days 2 to M+1 before day 2, and days N to M+N-1 before day N are all actually sales figures for days 1 to M before the baseline time. The different wording is due to the different time periods being predicted.
[0080] More specifically, if the features of the sample on day M-1 before the prediction baseline are missing, the features of day 1 to M-2 and day M+1 before the prediction baseline can be extracted as sample features. It is even possible to extract the features of more than 2M days before the prediction baseline as sample features.
[0081] Specifically, a training dataset is constructed based on the sample features and sample labels extracted for each prediction subtask, as well as multiple prediction subtasks.
[0082] More specifically, a training dataset is constructed based on the sample features and labels of each sample in the sample data, as well as the scene identifier of the prediction subtask assigned to each sample.
[0083] In this way, by training the same preset model using the training dataset and evaluating the model's performance, the trained preset model can be determined as the target prediction model after passing the performance evaluation.
[0084] In this embodiment, when constructing the training dataset based on multiple prediction sub-tasks and their corresponding sample data, for each prediction sub-task, features prior to the target time period are extracted from the sample data corresponding to the prediction sub-time period as sample features, and features within the predicted sub-time period are extracted as sample labels. Then, based on the sample features and labels extracted for each prediction sub-task, and the multiple prediction sub-tasks, the training dataset is constructed. Since, for a single sample, apart from short-term features, the relationship between other information and labels does not increase or change with sample copying, traditional methods often result in a large amount of redundant information when a copied sample is used multiple times. This can even lead to a decrease in the performance of the trained model. Therefore, directly using samples from the sample data for model training, without copying samples, can better ensure the performance of the trained model, reduce model construction costs, and guarantee the accuracy of model predictions.
[0085] Referring to Figure 2, in an exemplary embodiment, a timing prediction method is provided, applicable to any electronic device. As shown in Figure 2, the timing prediction method includes steps S201-S202:
[0086] S201: Divide the current prediction task into multiple current prediction subtasks.
[0087] The current prediction task is the prediction task to be performed at the current moment, which is to predict the features within the target time period after the current moment. The current prediction subtask is the multiple prediction subtasks to be performed at the current moment, which are to predict the features within the sub-time periods of the target time period.
[0088] After obtaining the prediction task to be executed at the current moment, the prediction task is divided into multiple prediction subtasks to be executed at the current moment. The division method is the same as that in step S101 above, and will not be repeated here.
[0089] S202: Input the current prediction subtask and historical features into the same target prediction model to obtain features within the target time period.
[0090] The target prediction model is constructed based on the above-mentioned time series prediction model construction method and is used to perform the current prediction task, that is, to predict the features in the target time period after the current time.
[0091] Historical features are those within a preset time period prior to the current moment.
[0092] Specifically, features within the preset time period before the current moment are extracted from historical data, i.e., business data within the preset time period before the current moment. The identifiers of each prediction sub-task and the extracted historical features are input into the same target prediction model. The target prediction model determines the features within the sub-time period corresponding to each prediction sub-task and the historical features, thereby determining the features within the preset time period.
[0093] Extracting features from historical data within a preset time period before the current moment, that is, extracting features from the historical data actually obtained that are located before the sub-time period to be predicted.
[0094] In this embodiment, after obtaining the current prediction task, the current prediction task for predicting features within the target time period after the current moment is first divided into multiple current prediction sub-tasks for predicting features within the sub-time periods of the target time period. The current prediction sub-tasks and historical features, i.e. features within the preset time period before the current moment, are input into a single target prediction model to execute the current prediction task, thereby quickly and accurately predicting features within the preset time period after the current moment.
[0095] Exemplary device
[0096] As shown in Figure 3, this application embodiment also provides a time series prediction model construction device, including a partitioning module 301 and a training module 302.
[0097] The segmentation module 301 is used to divide the prediction task into multiple prediction sub-tasks. The prediction task is to predict features within the target time period, and the prediction sub-tasks are to predict features within sub-time periods of the target time period.
[0098] The training module 302 is used to train the same preset model based on multiple prediction sub-tasks and sample data to obtain a target prediction model, which is used to perform prediction tasks.
[0099] The time series prediction model construction apparatus provided in this embodiment belongs to the same application concept as the time series prediction model construction method provided in the above embodiments of this application. It can execute the method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the specific processing content of the time series prediction model construction method provided in the above embodiments of this application, and will not be repeated here.
[0100] The functions implemented by the partitioning module 301 and the training module 302 can be implemented by the same or different processors calling software, and this application embodiment does not limit this.
[0101] As shown in Figure 4, this application embodiment also provides a time series prediction model construction device, including a partitioning module 401 and a prediction module 402.
[0102] The partitioning module 401 is used to partition the current prediction task to obtain multiple current prediction sub-tasks. The current prediction task is to predict the features within the target time period after the current time, and the current prediction sub-tasks are to predict the features within the sub-time periods of the target time period.
[0103] The prediction module 402 is used to input the current prediction subtask and historical features into the same target prediction model to obtain features within the target time period. The target prediction model is used to execute the current prediction task, and the historical features are features within a preset time period before the current time.
[0104] The timing prediction apparatus provided in this embodiment belongs to the same concept as the timing prediction method provided in the above embodiments of this application. It can execute the method provided in any embodiment of this application and has the corresponding functional modules and beneficial effects. Technical details not described in detail in this embodiment can be found in the specific processing content of the timing prediction method provided in the above embodiments of this application, and will not be repeated here.
[0105] The functions implemented by the division module 401 and the prediction module 402 can be implemented by the same or different processors calling software, and this application embodiment does not limit this.
[0106] Furthermore, it is clear that the above-mentioned time series forecasting model construction method and the time series forecasting method belong to the same concept, so it will not be elaborated here.
[0107] Exemplary electronic devices
[0108] Another embodiment of this application also proposes an electronic device, as shown in FIG5, which includes a memory 500 and a processor 510.
[0109] The memory 500 is connected to the processor 510 and is used to store programs;
[0110] The processor 510 is configured to implement the time series prediction model construction method or time series prediction method disclosed in any of the above embodiments by running the program stored in the memory 500.
[0111] Specifically, the electronic device may also include: a bus, a communication interface 520, an input device 530, and an output device 540.
[0112] The processor 510, memory 500, communication interface 520, input device 530 and output device 540 are interconnected via a bus.
[0113] A bus can include a pathway for transmitting information between various components of a computer system.
[0114] The processor 510 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0115] The processor 510 may include a main processor, as well as a baseband chip, modem, etc.
[0116] The memory 500 stores a program for executing the technical solution of this application, and may also store an operating system and other critical business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 500 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0117] Input device 530 may include a device for receiving data and information input by a user, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0118] Output device 540 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0119] The communication interface 520 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0120] The processor 510 executes the program stored in the memory 500 and calls other devices, which can be used to implement any of the steps of the time series prediction model construction method provided in the above embodiments of this application, or to implement any of the steps of the time series prediction method provided in the above embodiments of this application.
[0121] Those skilled in the art will understand that the structure shown in Figure 5 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0122] This application also proposes a chip, which includes a processor and a data interface. The processor reads and runs a program stored in the memory through the data interface to execute the timing prediction model construction or timing prediction method described in any of the above embodiments. For the specific processing procedure and its beneficial effects, please refer to the embodiments of the timing prediction model construction or timing prediction method described above.
[0123] In addition to the methods and apparatus described above, embodiments of this application provide a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the timing prediction model construction or timing prediction method according to various embodiments of this application as described in the "Exemplary Methods" section of this specification.
[0124] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0125] Furthermore, embodiments of this application also propose a storage medium storing a computer program, which is executed by a processor in the steps of the timing prediction model construction or timing prediction method according to various embodiments of this application as described in the "Exemplary Methods" section above.
[0126] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner.
[0127] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.
[0128] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A method for constructing a time series prediction model, characterized in that, The method includes: The prediction task is divided into multiple prediction sub-tasks. The prediction task is to predict features within a target time period, and the prediction sub-tasks are to predict the features within a sub-time period of the target time period. The same preset model is trained based on the multiple prediction sub-tasks and sample data to obtain a target prediction model, which is used to perform the prediction task.
2. The method for constructing a time series prediction model according to claim 1, characterized in that, The feature is sales volume in the target dimension, which is determined based on actual predicted demand and includes at least one of the following: sales point and product type.
3. The method for constructing a time series prediction model according to claim 1 or 2, characterized in that, The prediction task is divided into multiple prediction sub-tasks, including: The target time period is divided into multiple sub-time periods based on a preset time length; Based on the multiple sub-time periods, the multiple prediction sub-tasks are determined.
4. The method for constructing a time series prediction model according to any one of claims 1 to 3, characterized in that, The step of training the same preset model based on the multiple prediction sub-tasks and sample data to obtain a target prediction model includes: A training dataset is established based on the multiple prediction sub-tasks and the sample data; For each prediction subtask, the preset model is trained based on the training dataset to obtain the target prediction model.
5. The method for constructing a time series prediction model according to claim 4, characterized in that, The step of establishing a training dataset based on the multiple prediction sub-tasks and the sample data includes: The samples in the sample data are randomly assigned to the plurality of prediction sub-tasks to obtain the sample data corresponding to each prediction sub-task. The training dataset is constructed based on the multiple prediction sub-tasks and their corresponding sample data.
6. The method for constructing a time series prediction model according to claim 5, characterized in that, The construction of the training dataset based on the multiple prediction sub-tasks and their corresponding sample data includes: For each prediction subtask, based on the sub-time period predicted by the prediction subtask, sample features and sample labels are extracted from the sample data corresponding to the prediction subtask. The sample features are features before the target time period, and the sample labels are features within the sub-time period. The training dataset is constructed based on the sample features and sample labels extracted for each prediction subtask, as well as the multiple prediction subtasks.
7. A time series prediction method, characterized in that, The method includes: The current prediction task is divided into multiple current prediction sub-tasks. The current prediction task is to predict the features within the target time period after the current time. The current prediction sub-tasks are to predict the features within the sub-time periods of the target time period. The current prediction subtask and historical features are input into the same target prediction model to obtain the features within the target time period. The target prediction model is used to execute the current prediction task, and the historical features are the features within a preset time period before the current time.
8. A time series prediction model construction device, characterized in that, The device includes: The segmentation module is used to divide the prediction task into multiple prediction sub-tasks. The prediction task is to predict features within a target time period, and the prediction sub-tasks are to predict the features within a sub-time period of the target time period. The training module is used to train the same preset model based on the multiple prediction sub-tasks and sample data to obtain a target prediction model, which is used to perform the prediction task.
9. A time series prediction device, characterized in that, The device includes: The partitioning module is used to partition the current prediction task to obtain multiple current prediction sub-tasks. The current prediction task is to predict features within a target time period after the current time, and the current prediction sub-task is to predict the features within a sub-time period of the target time period. The prediction module is used to input the current prediction subtask and historical features into the same target prediction model to obtain features within the target time period. The target prediction model is used to execute the current prediction task, and the historical features are the features within a preset time period before the current time.
10. An electronic device, characterized in that, Including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the time series prediction model construction method as described in any one of claims 1 to 6, or the time series prediction method as described in claim 7, by running the program in the memory.
11. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the time series prediction model construction method as described in any one of claims 1 to 6, or the time series prediction method as described in claim 7.
Citation Information
Patent Citations
Industrial raw material consumption prediction method based on multi-task time sequence learning
CN114186711A
Method and device for determining sales quota
CN115841343A
Labor demand prediction method and device and electronic equipment
CN116187704A
Product sales volume data prediction method and device, computer equipment and storage medium
CN117291653A
Prediction model training method, data monitoring method, apparatuses, device and medium
WO2019056499A1