Time sequence processing method and device
By detecting and aggregating the changing periods in the time series, combining the optimal model and prediction of the period, the problem of low prediction accuracy in the prior art is solved, and the prediction accuracy and stability are improved.
Patent Information
- Application Number
- CN202411053192.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, the time series prediction accuracy based on the original time step is low, which mainly due to the fine granularity of the time step, resulting in poor time series stability.
By detecting the change period in the time series to be processed, the sequence values are aggregated to form an aggregated time series with the change period as time step, and a predetermined discriminant model is used for testing to determine the optimal model and period for prediction. , and finally split the predicted value into the target predicted value of the corresponding original time step.
The stability and prediction accuracy of the time series are improved, and more accurate prediction values are obtained through the verification and weight calculation of the optimal model and period.
Smart Images

Figure CN119128417A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a time series processing method and device. Background Art
[0002] In some scenarios, it is necessary to predict future values based on historical sequence values in a time series, for example, predicting the daily sales of a certain item in the future based on its daily sales in the past. In the prior art, time series based on the original time step are generally used directly for prediction. For example, in the above example, the original time series with a one-day step is directly used for prediction. Since the granularity of the original time step is fine, the sequence value changes more drastically, resulting in poor stability of the time series, which is easy to affect the prediction accuracy. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a time series processing method and device, which can aggregate time series based on the change period, thereby improving the prediction accuracy of time series.
[0004] To achieve the above objective, according to one aspect of the present invention, a time series processing method is provided.
[0005] The time series processing method of the embodiment of the present invention includes: detecting at least one change cycle of the sequence value in the time series to be processed; performing ordered aggregation based on any change cycle on the sequence value in the time series to be processed to form an aggregated time series with the change cycle as the time step; performing a test based on a preset prediction indicator on any discriminant model among a plurality of predetermined discriminant models and the aggregated time series corresponding to any change cycle, determining the discriminant model corresponding to the optimal test result as the target model, and determining the change cycle corresponding to the optimal test result as the target cycle; predicting the sequence value of the future period based on the aggregated time series corresponding to the target cycle and the target model, and splitting the predicted sequence value into target prediction values corresponding to the original time steps of the time series to be processed.
[0006] Optionally, ordered aggregation based on any change period is performed on the sequence values in the time series to be processed, including: segmenting the time series to be processed according to any change period to form multiple aggregation ranges with the change period as the time step; the time span of each aggregation range is equal to the change period; and the sequence values of the same aggregation range in the segmented time series to be processed are added as a sequence value of the aggregation time series with the change period as the time step.
[0007] Optionally, a test based on preset prediction indicators is performed on any discriminant model among a plurality of predetermined discriminant models and an aggregate time series corresponding to any change period, including: obtaining a test value from the sequence value of the aggregate time series; predicting the position of the test value in the aggregate time series corresponding to any change period using any discriminant model, and determining the test result based on the preset prediction indicator corresponding to the discriminant model and the change period according to the predicted value and the test value.
[0008] Optionally, the predicted sequence value is split into target prediction values corresponding to the original time steps of the time series to be processed, including: for the aggregated time series corresponding to the target period, obtaining the weight ratio of each position based on the original time step in the aggregation range of the aggregated time series; multiplying the predicted sequence value by the weight ratio of each position to obtain the target prediction value.
[0009] Optionally, the weight ratio of each position based on the original time step in the aggregation range of the aggregated time series is obtained, including: obtaining the statistical results of the sequence values of the same position based on the original time step in each aggregation range; dividing the statistical result of any position by the sum of the statistical results of each position to obtain the weight ratio of any position.
[0010] Optionally, the variation period is an integer multiple of the original time step of the time series to be processed.
[0011] To achieve the above objective, according to another aspect of the present invention, a time series processing device is provided.
[0012] The time series processing device of the embodiment of the present invention may include: a period detection unit, a sequence aggregation unit, a model verification unit and a prediction splitting unit.
[0013] Among them, the period detection unit is used to detect at least one change period of the sequence value in the time series to be processed; the sequence aggregation unit is used to perform ordered aggregation based on any change period on the sequence values in the time series to be processed, so as to form an aggregated time series with the change period as the time step; the model verification unit is used to perform a test based on a preset prediction indicator on any discriminant model among a plurality of predetermined discriminant models and the aggregated time series corresponding to any change period, determine the discriminant model corresponding to the optimal test result as the target model, and determine the change period corresponding to the optimal test result as the target period; the prediction splitting unit is used to predict the sequence value of the future period based on the aggregated time series corresponding to the target period and the target model, and split the predicted sequence value into target prediction values corresponding to the original time steps of the time series to be processed.
[0014] Optionally, the sequence aggregation unit is further used to: split the time series to be processed according to any change period to form multiple aggregation ranges with the change period as the time step; the time span of each aggregation range is equal to the change period; the sequence values of the same aggregation range in the split time series to be processed are added as a sequence value of the aggregated time series with the change period as the time step; the model verification unit is further used to: obtain a test value from the sequence value of the aggregated time series; use any discriminant model to predict the position of the test value in the aggregated time series corresponding to any change period, and determine the test result corresponding to the discriminant model and the change period based on a preset prediction indicator according to the predicted value and the test value.
[0015] Optionally, the prediction splitting unit is further used to: for the aggregated time series corresponding to the target period, obtain the weight ratio of each position based on the original time step in the aggregation range of the aggregated time series; multiply the predicted sequence value by the weight ratio of each position to obtain the target prediction value.
[0016] Optionally, the prediction splitting unit is further used to: obtain the statistical results of the sequence values of the same position based on the original time step in each aggregation range; divide the statistical result of any position by the sum of the statistical results of each position to obtain the weight ratio of any position.
[0017] Optionally, the variation period is an integer multiple of the original time step of the time series to be processed.
[0018] To achieve the above objective, according to another aspect of the present invention, an electronic device is provided.
[0019] An electronic device of the present invention comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the time series processing method provided by the present invention.
[0020] To achieve the above objective, according to yet another aspect of the present invention, a computer-readable storage medium is provided.
[0021] A computer-readable storage medium of the present invention stores a computer program, and when the program is executed by a processor, the time series processing method provided by the present invention is implemented.
[0022] To achieve the above objective, according to yet another aspect of the present invention, a computer program product is provided.
[0023] A computer program product of the present invention includes a computer program, and when the computer program is executed by a processor, the time series processing method provided by the present invention is implemented.
[0024] According to the technical solution of the present invention, the embodiments of the above invention have the following advantages or beneficial effects: First, the server detects at least one change cycle of the sequence value in the time series to be processed, and performs ordered aggregation based on any change cycle on the sequence value in the time series to be processed, forming an aggregated time series with the change cycle as the time step; thereafter, the server performs a test based on a preset prediction index on any discriminant model among multiple discriminant models and the aggregated time series corresponding to any change cycle, and determines the discriminant model and change cycle corresponding to the optimal test result as the target model and target cycle respectively to perform the prediction of the sequence value for the future period; finally, the server splits the predicted sequence value into the target prediction value corresponding to the original time step according to the weight proportion of each position of the original time step. In this way, the time step granularity of the time series is improved by detecting the change cycle of the time series to be processed and based on the aggregation of the change cycle, thereby improving the stability of the time series and helping to improve the prediction accuracy; the target model and target cycle with the best prediction effect are obtained through the model verification process to perform prediction, and the target prediction value of the original time step is obtained from the target cycle prediction value through the prediction splitting method based on weight calculation, and the reasonable prediction value corresponding to the original time step is obtained by using the discriminant model and change cycle with the highest matching degree, so as to further improve the prediction accuracy.
[0025] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Figure 1 Schematic diagram of the main steps of the time series processing method in an embodiment of the present invention; Figure 2 is a schematic diagram of specific execution steps of the time series processing method in an embodiment of the present invention; Figure 3 is a schematic diagram of time series aggregation according to an embodiment of the present invention; Figure 4 It is a schematic diagram of components of a time series processing device in an embodiment of the present invention; Figure 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied; Figure 6 It is a schematic diagram of the structure of an electronic device used to implement the time series processing method in the embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0028] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0029] Figure 1 It is a schematic diagram of the main steps of the time series processing method in an embodiment of the present invention.
[0030] like Figure 1 As shown, the time series processing method of the embodiment of the present invention can be executed by a server, and the specific execution steps are as follows: Step S101: Detect at least one change cycle of a sequence value in a time series to be processed.
[0031] In an embodiment of the present invention, the time series to be processed may be a sequence formed by any variable that progresses over time, such as a sales volume sequence, an application volume sequence, and the like. The sequence values in the time series may be time-periodic, for example, the sales volume of each day in the sales volume sequence may show a regularity with a cycle of one week, such as lower sales volume from Tuesday to Friday, and higher sales volume on Saturday, Sunday, and Monday, and this cycle is the variation cycle. The time series may also present a situation where multiple variation cycles exist at the same time, for example, a sales volume sequence with a cycle of one week may also have a monthly cycle and a quarterly cycle. In this step, the server may detect one or more variation cycles in the time series to be processed by a known algorithm. In addition, the time unit of the time series to be processed itself is the original time step, that is, the time span between two adjacent sequence values, and the original time step may be of any duration, such as one day, one week, one month, and the like.
[0032] Step S102: performing ordered aggregation based on any change period on the sequence values in the time series to be processed, to form an aggregated time series with the change period as the time step.
[0033] Since the granularity of the original time step is relatively fine, the sequence value changes more drastically and the stability of the time series is relatively low. Therefore, this step aggregates the sequence values of the time series in an orderly manner based on the previously detected change cycle, increases its time step, and thus improves the stability of the time series, which helps to ultimately improve the prediction accuracy.
[0034] Step S103: Perform a test based on preset prediction indicators on any discriminant model among the predetermined multiple discriminant models and the aggregated time series corresponding to any change period, determine the discriminant model corresponding to the optimal test result as the target model, and determine the change period corresponding to the optimal test result as the target period.
[0035] Since there may be multiple change cycles, and there are multiple known discriminant models for performing time series prediction in practical applications, in this step, testing can be performed on any discriminant model and any change cycle to determine the target model and target cycle with the best prediction effect.
[0036] Step S104: predicting the sequence values of the future period according to the aggregated time series corresponding to the target period and the target model, and splitting the predicted sequence values into target prediction values corresponding to the original time steps of the time series to be processed.
[0037] In this step, the server uses the target model and target period to perform forecasts for the future period. After obtaining the forecast value with the target period as the time step, each forecast value can be split into the target forecast value based on the original time step to obtain the best forecast result.
[0038] Through the above steps, high-precision target prediction values can be obtained based on time series aggregation, test verification of the optimal model and the optimal change period, and prediction value splitting, which solves the problem of low prediction accuracy caused by the fine granularity of the original time step in the prior art.
[0039] Figure 2 is a schematic diagram of specific execution steps of the time series processing method in an embodiment of the present invention, see Figure 2 .
[0040] Step S201: The server detects at least one change period of the time series to be processed. In this step, the server can automatically detect one or more change periods of the time series to be processed using known algorithms such as autocorrelation function, periodogram method, trend decomposition algorithm, etc. In some embodiments, the server can also directly receive the change period determined based on manual experience. It can be understood that the time span of the change period is an integer multiple of the time span of the original time step of the time series to be processed.
[0041] Step S202: The server aggregates the time series to be processed based on any change cycle to form an aggregated time series with the change cycle as the time step. Preferably, the server can perform time series aggregation in the following manner: the server can segment the time series to be processed based on any change cycle to form multiple aggregation ranges with the change cycle as the time step; the time span of each aggregation range is equal to the change cycle; thereafter, the sequence values of the same aggregation range in the segmented time series to be processed are added together as a sequence value of the aggregated time series with the change cycle as the time step, thereby forming an aggregated time series with the corresponding change cycle as the time step.
[0042] For example, the following is a time series to be processed with one day as the original time step: 1, 3, 4, 2, 7, 6, 8, 8, 3, 5, 5, 9, 2. If a detected change cycle is two days, the way to form an aggregated time series is that the server first divides the time series to be processed according to the change cycle (two days) to form multiple aggregation ranges with the change cycle (two days) as the time step, and the time span of each aggregation range is equal to the change cycle (two days). The time series to be processed after division is: (2, 7), (6, 8), (8, 3), (5, 5), (9, 2). Among them, a sequence value in a bracket is an aggregation range. In the same aggregation range, there are multiple positions based on the original time step (the number of such positions in an aggregation range is equal to the ratio between the change cycle and the original time step). For example, there are two positions based on the original time step in the aggregation range (2, 7). The original sequence value of position 1 is 2, and the original sequence value of position 2 is 7. After that, the server adds the sequence values of the same aggregation range in the segmented time series to be processed as a sequence value of the aggregated time series with the change period as the time step, thereby forming an aggregated time series with the corresponding change period as the time step. For example, the sequence values in the brackets are added to obtain an aggregated time series with two days as the time step: 9, 14, 11, 10, 11.
[0043] In another optional manner, the server may perform the following steps to generate an aggregated time series. First, the server divides the change period by the original time step to obtain the single selection number of sequence values in the time series to be processed. Then, the server selects the sequence values of the single selection number from the beginning to the end (one selection determines an aggregation range), and adds the sequence values selected once to obtain a sequence value of the aggregated time series. The above steps are repeated until the time series to be processed is traversed to form an aggregated time series with the corresponding change period as the time step.
[0044] For a schematic diagram of the time series before and after aggregation, see Figure 3 , Figure 3The horizontal axis is time and the vertical axis is the sequence value. The lower figure is the time series with one day as the time step before aggregation, and the upper figure is the time series with four days (four days is the change period) as the time step after aggregation. It can be seen that the time series after aggregation has higher stability.
[0045] Step S203: The server obtains multiple discriminant models. In this step, multiple known discriminant models may be obtained, such as a k-order moving average model, a spatial state model, an autoregressive moving average model, a discontinuous model, an XG boost model, a neural network, and the like.
[0046] Step S204: The server combines any discriminant model with the aggregated time series corresponding to any change period. In this step, the server prepares to perform a test on any discriminant model and the aggregated time series corresponding to any change period.
[0047] Step S205: The server tests the prediction capability of any discriminant model and any change period.
[0048] In this step, the server performs a prediction capability test for any discriminant model and the aggregated time series corresponding to any change period. A preferred testing method is as follows: the server first determines one or more test values from the sequence value of the aggregated time series, and then uses any discriminant model to predict the position of the test value in the aggregated time series corresponding to any change period, that is, predicts the sequence value of the time point corresponding to the test value. In one embodiment, the discriminant model can perform predictions based on multiple sequence values that occur before the predicted value. Finally, the server determines the test results corresponding to the discriminant model and the change period based on the preset prediction indicators according to the predicted value and the test value. Exemplarily, the above prediction indicators can be known prediction accuracy, prediction deviation rate, prediction availability and other indicators, and the calculation method of the test results is determined by the specific definition of the test indicators.
[0049] Step S206: The server obtains the target model and target period corresponding to the optimal test result. In this step, the server determines the optimal test result from the test results corresponding to each discriminant model and each change period, determines the discriminant model corresponding to the optimal test result as the target model, and determines the change period corresponding to the optimal test result as the target period.
[0050] Step S207: The server performs prediction based on the target model and the target period. In this step, the server uses the target model and the aggregated time series corresponding to the target period to perform prediction for the future period, and obtains the prediction value with the target period as the step.
[0051] Step S208: The server calculates the weight proportion of each position in the aggregation range based on the original time step.
[0052] In this step, the server uses the sequence value of the time series to be processed to calculate the weight ratio of each position of the original time step in the aggregation range. The above original time step position refers to a sequence value of the aggregated time series (that is, the sequence value obtained by adding within the aggregation range) corresponding to each time point of the original time step. For example, the original time step is one day, and the corresponding change of the aggregated time series is four days. Then, a sequence value of the aggregated time series corresponds to the four sequence values of the sequence before aggregation (that is, the time series to be processed): the sequence value of the first day in the aggregation range, the sequence value of the second day, the sequence value of the third day, and the sequence value of the fourth day. The first day, the second day, the third day, and the fourth day above are the original time step positions. This step is used to calculate the weight ratio of each original time step position of each aggregation range.
[0053] Preferably, the weight ratio is calculated as follows: the server first obtains the statistical results of the sequence values at the same position based on the original time step in each aggregation range, and illustratively, the above statistical results are the average value or the sum of the sequence values. Thereafter, the server divides the statistical results of any position by the sum of the statistical results of each position to obtain the weight ratio of any position.
[0054] Step S209: The server splits the predicted value according to the weight ratio. In this step, the server can split the predicted value based on the change period into the predicted value based on the original time step according to the weight ratio of each original time step position. Specifically, the server can multiply the predicted sequence value based on the change period by the weight ratio of each position to obtain the target predicted value.
[0055] Step S210: The server obtains the target prediction value and completes the prediction based on the original time.
[0056] In the technical solution of the embodiment of the present invention, the time step granularity of the time series is improved based on the aggregation of the change period by detecting the change period of the time series to be processed, thereby improving the stability of the time series and helping to improve the prediction accuracy; the target model and target period with the best prediction effect are obtained through the model verification process to execute the prediction, and the target prediction value of the original time step is obtained from the target period prediction value through the prediction splitting method based on weight calculation, and the reasonable prediction value corresponding to the original time step is obtained using the discriminant model and change period with the highest matching degree, thereby further improving the prediction accuracy.
[0057] It should be noted that the collection, collection, update, analysis, processing, use, transmission, storage and other aspects of user personal information that may be involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0058] For the above-mentioned method embodiments, for the convenience of description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, and some steps can actually be performed in other orders or simultaneously. In addition, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary to implement the present invention.
[0059] In order to better implement the above-mentioned solution of the embodiment of the present invention, relevant devices for implementing the above-mentioned solution are also provided below.
[0060] See also Figure 4 As shown, the time series processing device 400 provided by the embodiment of the present invention may include: a period detection unit 401, a sequence aggregation unit 402, a model verification unit 403 and a prediction splitting unit 404.
[0061] Among them, the period detection unit 401 is used to detect at least one change period of the sequence value in the time series to be processed; the sequence aggregation unit 402 is used to perform ordered aggregation based on any change period on the sequence value in the time series to be processed, so as to form an aggregated time series with the change period as the time step; the model verification unit 403 is used to perform a test based on a preset prediction indicator on any discriminant model among a plurality of predetermined discriminant models and the aggregated time series corresponding to any change period, determine the discriminant model corresponding to the optimal test result as the target model, and determine the change period corresponding to the optimal test result as the target period; the prediction splitting unit 404 is used to predict the sequence value of the future period based on the aggregated time series corresponding to the target period and the target model, and split the predicted sequence value into target prediction values corresponding to the original time step of the time series to be processed.
[0062] In an embodiment of the present invention, the sequence aggregation unit 402 is further used to: divide the time series to be processed according to any change period to form multiple aggregation ranges with the change period as the time step; the time span of each aggregation range is equal to the change period; the sequence values of the same aggregation range in the divided time series to be processed are added as a sequence value of the aggregated time series with the change period as the time step; the model verification unit 403 is further used to: obtain a test value from the sequence value of the aggregated time series; use any discriminant model to predict the test value position in the aggregated time series corresponding to any change period, and determine the test result corresponding to the discriminant model and the change period based on the preset prediction indicator according to the predicted value and the test value.
[0063] As a preferred solution, the prediction splitting unit 404 is further used to: for the aggregated time series corresponding to the target period, obtain the weight ratio of each position based on the original time step in the aggregation range of the aggregated time series; multiply the predicted sequence value by the weight ratio of each position to obtain the target prediction value.
[0064] Preferably, the prediction splitting unit 404 is further used to: obtain the statistical results of the sequence values of the same position based on the original time step in each aggregation range; divide the statistical result of any position by the sum of the statistical results of each position to obtain the weight ratio of any position.
[0065] In addition, in the embodiment of the present invention, the variation period is an integer multiple of the original time step of the time series to be processed.
[0066] According to the technical solution of the embodiment of the present invention, the time step granularity of the time series is improved by detecting the change period of the time series to be processed based on the aggregation of the change period, thereby improving the stability of the time series, which helps to improve the prediction accuracy; through the model verification process, a target model and a target period with the best prediction effect are obtained to execute the prediction, and the target prediction value of the original time step is obtained from the target period prediction value through a prediction splitting method based on weight calculation, and the reasonable prediction value corresponding to the original time step is obtained using the discriminant model and change period with the highest matching degree, thereby further improving the prediction accuracy.
[0067] Figure 5 An exemplary system architecture 500 is shown to which the time series processing method or the time series processing apparatus according to the embodiment of the present invention can be applied.
[0068] like Figure 5As shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 504 is used to provide a medium for a communication link between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0069] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various client applications can be installed on terminal devices 501, 502, 503, such as time series prediction applications, etc. (only as an example).
[0070] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0071] The server 505 may be a server that provides various services, such as a backend server (only an example) that provides support for time series prediction applications operated by users using the terminal devices 501, 502, and 503. The backend server may process the received prediction request and feed back the processing result (such as the target prediction value - only an example) to the terminal devices 501, 502, and 503.
[0072] It should be noted that the time series processing method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the time series processing device is generally disposed in the server 505 .
[0073] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0074] The present invention also provides an electronic device. The electronic device of the embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the time series processing method provided by the present invention.
[0075] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of an electronic device suitable for implementing an embodiment of the present invention. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0076] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0077] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.
[0078] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the main step diagram. In the above embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit 601, the above functions defined in the system of the present invention are executed.
[0079] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0080] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0081] The units involved in the embodiments of the present invention may be implemented in software or hardware. The units described may also be provided in a processor, for example, may be described as: a processor including: a cycle detection unit, a sequence aggregation unit, a model verification unit, and a prediction splitting unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the cycle detection unit may also be described as a "unit that provides a change cycle to the sequence aggregation unit".
[0082] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the steps executed by the device include: detecting at least one change cycle of the sequence value in the time series to be processed; performing ordered aggregation based on any change cycle on the sequence value in the time series to be processed to form an aggregated time series with the change cycle as the time step; performing a test based on a preset prediction index on any discriminant model among a plurality of pre-determined discriminant models and the aggregated time series corresponding to any change cycle, determining the discriminant model corresponding to the optimal test result as the target model, and determining the change cycle corresponding to the optimal test result as the target cycle; predicting the sequence value of the future period according to the aggregated time series corresponding to the target cycle and the target model, and splitting the predicted sequence value into the target prediction value corresponding to the original time step of the time series to be processed.
[0083] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the time series processing method provided by the present invention is implemented.
[0084] In the technical solution of the embodiment of the present invention, the time step granularity of the time series is improved based on the aggregation of the change period by detecting the change period of the time series to be processed, thereby improving the stability of the time series and helping to improve the prediction accuracy; the target model and target period with the best prediction effect are obtained through the model verification process to execute the prediction, and the target prediction value of the original time step is obtained from the target period prediction value through the prediction splitting method based on weight calculation, and the reasonable prediction value corresponding to the original time step is obtained using the discriminant model and change period with the highest matching degree, thereby further improving the prediction accuracy.
[0085] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A time series processing method, characterized in that: include: Detecting at least one change cycle of the sequence value in the time series to be processed; Performing ordered aggregation based on any change period on the sequence values in the time series to be processed to form an aggregated time series with the change period as the time step; Performing a test based on a preset prediction indicator on any discriminant model among a plurality of pre-determined discriminant models and an aggregate time series corresponding to any change period, determining the discriminant model corresponding to the best test result as the target model, and determining the change period corresponding to the best test result as the target period; The sequence values of the future period are predicted based on the aggregated time series corresponding to the target period and the target model, and the predicted sequence values are split into target prediction values corresponding to the original time steps of the time series to be processed.
2. The method according to claim 1, characterized in that The performing ordered aggregation based on any change period on the sequence values in the to-be-processed time series includes: The time series to be processed is segmented according to any change cycle to form a plurality of aggregation ranges with the change cycle as the time step; the time span of each aggregation range is equal to the change cycle; The sequence values of the same aggregation range in the segmented time series to be processed are added together to serve as a sequence value of the aggregation time series with the change period as the time step.
3. The method according to claim 1, characterized in that The performing of a test based on a preset prediction indicator on any discriminant model among a plurality of predetermined discriminant models and an aggregate time series corresponding to any change period includes: Obtaining a test value from the sequence value of the aggregated time series; Any discriminant model is used to predict the test value position in the aggregated time series corresponding to any change period, and the test result corresponding to the discriminant model and the change period based on the preset prediction index is determined according to the predicted value and the test value.
4. The method according to claim 2, characterized in that: The step of splitting the predicted sequence values into target predicted values corresponding to the original time steps of the time series to be processed includes: For the aggregated time series corresponding to the target period, obtaining the weight proportion of each position based on the original time step in the aggregated range of the aggregated time series; The predicted sequence value is multiplied by the weight proportion of each position to obtain the target predicted value.
5. The method according to claim 4, characterized in that The obtaining of the weight proportion of each position based on the original time step in the aggregation range of the aggregated time series includes: Obtaining statistical results of sequence values at the same position based on the original time step in each aggregation range; The statistical result of any position is divided by the sum of the statistical results of all positions to obtain the weight ratio of the any position.
6. The method according to claim 1, characterized in that The variation period is an integer multiple of the original time step of the time series to be processed.
7. A time series processing device, characterized in that: include: A cycle detection unit, used to detect at least one change cycle of the sequence value in the time series to be processed; A sequence aggregation unit, used for performing ordered aggregation based on any change period on the sequence values in the time series to be processed, to form an aggregated time series with the change period as the time step; A model verification unit, used to perform a test based on a preset prediction indicator on any discriminant model among a plurality of pre-determined discriminant models and an aggregate time series corresponding to any change period, determine the discriminant model corresponding to the best test result as the target model, and determine the change period corresponding to the best test result as the target period; The prediction splitting unit is used to predict the sequence value of the future period according to the aggregated time series corresponding to the target period and the target model, and split the predicted sequence value into target prediction values corresponding to the original time steps of the time series to be processed.
8. The device according to claim 7, characterized in that The sequence aggregation unit is further used to: segment the time series to be processed according to any change cycle to form multiple aggregation ranges with the change cycle as the time step; the time span of each aggregation range is equal to the change cycle; the sequence values of the same aggregation range in the segmented time series to be processed are added together as a sequence value of the aggregated time series with the change cycle as the time step. The model verification unit is further used to: obtain a test value from the sequence value of the aggregated time series; use any discriminant model to predict the test value position in the aggregated time series corresponding to any change cycle, and determine the test result corresponding to the discriminant model and the change cycle based on the preset prediction index according to the predicted value and the test value.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
