Online filling method for continuous missing of time series data based on multi-periodicity

Through fast Fourier transform and multi-period data regression technology, combined with multi-time granular time-sequence data regeneration, the problem of online filling of continuous time-sequence data is solved, and efficient and accurate data filling is achieved, which is suitable for a variety of practical application scenarios.

CN119312032AInactive Publication Date: 2025-01-14UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411352920.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively solve the problem of online filling of continuous timing data, especially when facing the lack of real-time data caused by factors such as network delay and external interference, the existing methods have large data volume, high calculation cost, and no adaptability. abilities and other problems are mostly used for offline filling of intermittent missing loss, which cannot meet the actual needs of continuous missing.

Method used

The core period set of the sequence to be filled is obtained based on the fast Fourier transform, and multi-period data regression is performed by combining historical data to generate pre-filled sequences, and regenerate multi-time granular time sequence data to reconstruct the filled sequences and complete it with auxiliary fillers. Fill the effect evaluation and algorithm self-training to realize adaptive hyperparameter update.

Benefits of technology

It improves the accuracy and efficiency of continuous missing data filling, and can achieve high-precision online filling without the assistance of other data. It is suitable for weather forecasting, agricultural production, traffic command and other fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312032A_ABST
    Figure CN119312032A_ABST
Patent Text Reader

Abstract

The invention discloses a time series data continuous missing online filling method based on multi-periodicity, and belongs to the technical field of data filling, the method comprises the following steps: obtaining a core period set of a sequence to be filled based on fast Fourier transform; performing multi-cycle data regression on missing data based on the core cycle set in combination with historical data to obtain a regression sequence; filling the to-be-filled sequence based on the regression sequence to obtain a pre-filled sequence; carrying out multi-time granularity time sequence data regeneration on the pre-filled sequence by utilizing multiple periodicity, and reconstructing to obtain a filled sequence; and generating a filling result of the to-be-filled sequence by using an auxiliary filling device, completing filling effect evaluation, and realizing algorithm self-training and adaptive hyper-parameter updating. According to the scheme of the invention, pre-filling is carried out based on the adaptive method of fast Fourier transform, time sequence feature extraction and data generation are carried out by using multiple periodicities, and the precision and efficiency of data filling are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data filling, and in particular to an online filling method for continuous missing of time series data based on multi-periodicity. Background Art

[0002] With the improvement of digitalization and networking of modern sensors, the collection of time series data in fields such as weather and traffic, which traditionally relied on manual work, has also achieved high-precision automation. Therefore, high-precision and high-real-time time series data has been widely used in weather forecasting, agricultural production, traffic control and business decision-making.

[0003] The original time series data often comes from high-real-time and high-precision sensors. The raw data collected by the sensors needs to go through processing, transmission, fusion and other steps to finally obtain reasonable measurements of the corresponding physical quantities. However, in this process, real-time data loss due to network delays, external interference, sensor failures, line failures and other reasons often occurs. Moreover, some time series data sensors are located in harsh production or operating environments and are more susceptible to external influences such as temperature, pressure, flow rate, and electromagnetic interference, making the loss of real-time time series data more common. For intermittent and temporary real-time data loss, such as missing 1 to 2 data values, it can generally be simply filled by the nearest neighbor filling, historical average filling and other methods. The above methods have been widely and effectively applied in engineering. However, there is no large-scale application case in engineering applications for continuous real-time data filling, that is, filling data within a period of time. In this regard, the use of time series data analysis methods for continuous time series data filling is the key technology.

[0004] At present, there are many methods for filling time series data, which solve the problems of accuracy, efficiency and reliability of some data filling. Among them, methods such as generative adversarial network (GAN), temporal convolutional network (TCN), and self-attention mechanism are widely used. Generative adversarial network uses two modules: the generative model and the discriminative model compete with each other to produce output. Generally, deep neural network is used as the generative model and the discriminative model. The purpose of the generative model is to generate real data as much as possible to deceive the discriminative model; while the purpose of the discriminative model is to determine whether a data is real or generated. The two models reach Nash equilibrium in the dynamic game. GAN is often used for unsupervised learning, and data filling is naturally in line with GAN's advantage field, so GAN has been widely used in various data filling fields. However, since the game model needs to reach equilibrium, the training process of GAN is relatively random, and it is difficult to ensure the stability of training. At the same time, since GAN extracts features completely implicitly, some characteristics of the time series data itself (such as multi-periodicity) are not considered. TCN uses causal convolution and dilated convolution to analyze time series. On the basis of considering the temporal nature of the sequence, it uses the hollow characteristics of dilated convolution to expand the network's field of view, so that it can use information for a longer period of time. TCN has the characteristics of simple structure and stable training, but TCN parameters are relatively fixed and it is difficult to process variable-length sequences. The self-attention mechanism is a sequence analysis method derived from natural language processing. It enables the model to consider all positions in the input sequence at the same time, allowing the model to assign different attention weights according to different parts of the input sequence, so as to better capture semantic relationships. The self-attention mechanism has a wide field of view and strong sequence compatibility, but the network structure is complex, the computational cost is high, and the amount of data required for training is large.

[0005] In summary, the existing methods for filling time series data have problems such as large data volume requirements, need for auxiliary data, high computational cost, and lack of adaptive capabilities. In addition, the above methods are mostly used for offline filling of intermittent missing data. For time series data with continuous missing data, the filling effect of the above methods is not ideal and cannot meet actual needs. Therefore, there is currently no online filling technology solution in the industry to solve the problem of continuous missing data. Summary of the invention

[0006] The present invention provides a method for online filling of continuous missing time series data based on multi-periodicity, so as to solve the problem of online filling of time series data with continuous missing.

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

[0008] On the one hand, the present invention provides an online filling method for continuous missing of time series data based on multi-periodicity, and the online filling method for continuous missing of time series data based on multi-periodicity comprises:

[0009] Acquire a core period set of the sequence to be filled based on fast Fourier transform; wherein the core period set refers to a key period set extracted from the sequence to be filled by fast Fourier transform;

[0010] Based on the core period set and in combination with the historical data in the sequence to be filled, multi-period data regression is performed on the missing data in the sequence to be filled to obtain a regression value of each missing data in the sequence to be filled, and a regression sequence is formed by the regression values ​​corresponding to all the missing data in the sequence to be filled;

[0011] Filling the sequence to be filled based on the regression sequence to obtain a pre-filled sequence;

[0012] Based on the core period set, the pre-filled sequence is regenerated using multi-periodicity to perform multi-time granularity time series data to reconstruct a filled sequence;

[0013] A preset auxiliary filler is used to generate a filling result of the sequence to be filled, which is recorded as an auxiliary filling sequence. The auxiliary filling sequence is used to complete the filling effect evaluation of the filled sequence. According to the filling effect evaluation result of the filled sequence currently obtained, algorithm self-training and adaptive hyperparameter updating are realized.

[0014] Furthermore, the step of obtaining a core period set of a sequence to be filled based on a fast Fourier transform includes:

[0015] Applying fast Fourier transform to the historical data in the sequence to be filled to obtain a frequency domain sequence of the sequence to be filled; wherein the historical data refers to the non-missing data in the sequence to be filled;

[0016] Filter out the l elements with the largest amplitude in the frequency domain sequence, record the period and amplitude corresponding to each element in the l elements with the largest amplitude, and form a core period set; wherein the element in the core period set represents the period and amplitude corresponding to one element in the l elements with the largest amplitude; the calculation formula is:

[0017]

[0018] Where h represents the length of the historical data in the sequence to be filled; z j Indicates the value of the jth element in the frequency domain sequence; || indicates the absolute value operation; max j {z j} represents the value of the element with the largest amplitude in the frequency domain sequence.

[0019] Furthermore, the calculation formula of the regression value of the missing data is:

[0020]

[0021] Among them, x reg,i represents the regression value of the i-th missing data in the sequence to be filled; l is the length of the missing data in the sequence to be filled; Indicates the ipth in the sequence to be filled j The value of historical data, p j is the period value recorded for the jth element in the frequency domain sequence; a j is the amplitude recorded for the jth element in the frequency domain sequence; a g is the amplitude recorded for the gth element in the frequency domain sequence.

[0022] Further, filling the sequence to be filled based on the regression sequence to obtain a pre-filled sequence includes:

[0023] If there is no measured value after the missing data of the sequence to be filled, the elements in the regression sequence are sequentially filled into the missing data part of the sequence to be filled to obtain a pre-filled sequence;

[0024] If there are measured values ​​after the missing data of the sequence to be filled, the elements in the regression sequence are corrected based on the measured values ​​after the missing data to obtain a corrected regression sequence, and the elements in the corrected regression sequence are sequentially filled into the missing data part of the sequence to be filled to obtain a pre-filled sequence.

[0025] Furthermore, the formula for correcting the elements in the regression series based on the measured values ​​after the missing data is:

[0026] x col,i =x reg,i +β i (x t+k -x reg,t+k )

[0027]

[0028] Among them, x reg,i represents the regression value of the i-th missing data in the sequence to be filled; x col,i Represents x reg,i Corrected value; x t+k represents the first measured value after the missing data of the sequence to be filled; x reg,t+k represents the regression value of the t+kth missing data in the sequence to be filled, k is the missing length of the sequence to be filled; e is a natural constant; β i is the adaptive correction coefficient; b is the parameter of the correction coefficient, and its value range is (0, 1).

[0029] Further, based on the core period set, the pre-filled sequence is regenerated with multi-time granularity time series data by using multi-periodicity to reconstruct the filled sequence, including:

[0030] The pre-filled sequence is reorganized according to the core cycle set to define a matrix The calculation formula is as follows:

[0031]

[0032] Among them, p j is the period value recorded for the jth element in the frequency domain sequence; l p Indicates the length of the pre-filled sequence; M j Represents the j-th matrix defined; in M j middle, x n represents the nth element in the pre-filled sequence, R represents a real matrix, represents rounding up;

[0033] For each matrix, convolution operations are performed using convolution kernels of three different sizes to extract features of different time granularities. The results are averaged to obtain a new feature matrix. The calculation formula is as follows:

[0034]

[0035] Among them, T j Indicates M j The corresponding feature matrix; Indicates a convolution operation with a convolution kernel parameter of θ1 and a convolution kernel size of 1x3; It represents a convolution operation with a kernel parameter of θ2 and a kernel size of 3x5. It represents a convolution operation with a kernel parameter of θ3 and a kernel size of 5x7.

[0036] The l characteristic matrices are reversely reorganized according to the core period set to form a characteristic sequence with the same length as the pre-filled sequence, and the characteristic sequence is summed with the pre-filled sequence to obtain a filled sequence.

[0037] Furthermore, the auxiliary filling sequence is used to complete the filling effect evaluation of the filled sequence, and according to the filling effect evaluation result of the filled sequence currently obtained, the algorithm self-training and adaptive hyperparameter update are realized, including:

[0038] Calculating a filling performance index of the filled sequence using the auxiliary filling sequence;

[0039] The padding performance index is used as the loss, back-propagated to each convolution operation when calculating the feature matrix, and the corresponding parameters of the convolution kernel in each convolution operation are updated to achieve algorithm self-training and adaptive hyperparameter update.

[0040] Furthermore, the preset auxiliary filler is a long short-term memory network.

[0041] Furthermore, the calculation formula of the filling performance index is:

[0042]

[0043] in, represents the calculated value of the filling performance index; k1, k2, k3 are all weight coefficients; l p Indicates the length of the pre-filled sequence; y i Represents the value of the i-th element in the filled sequence; Represents the value of the i-th element in the auxiliary filling sequence; express The average value of .

[0044] Furthermore, when implementing algorithm self-training and adaptive hyperparameter updating, the method further includes:

[0045] Update the learning rate according to the filling performance index, the formula is as follows:

[0046]

[0047] Among them, η new Represents the learning rate of the next round; η old Represents the learning rate of this round; q represents the proportional coefficient; it is used to control the learning rate update speed; e is a natural constant; r represents the currently calculated filling performance index.

[0048] On the other hand, the present invention further provides an electronic device, comprising a processor and a memory; wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the above method.

[0049] In yet another aspect, the present invention further provides a computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the above method.

[0050] The beneficial effects brought about by the technical solution provided by the present invention include at least:

[0051] The present invention obtains the core period set of the sequence to be filled based on fast Fourier transform; based on the core period set, combined with historical data, multi-period data regression is performed on the missing data to obtain a regression sequence; based on the regression sequence, the sequence to be filled is filled to obtain a pre-filled sequence; the pre-filled sequence is used to regenerate multi-time granularity time series data using multi-periodicity to reconstruct the filled sequence; an auxiliary filler is used to generate the filling result of the sequence to be filled, the filling effect evaluation is completed, and the algorithm self-training and adaptive hyperparameter update are realized. Therefore, the pre-filling is performed based on the adaptive method of fast Fourier transform, and the time series feature extraction and data generation are performed using multi-periodicity, which is conducive to improving the accuracy and efficiency of filling the continuous missing data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0053] Figure 1 It is a schematic diagram of the execution flow of a method for online filling of continuous missing time series data based on multi-periodicity provided by an embodiment of the present invention;

[0054] Figure 2 It is a schematic diagram of the implementation principle of the method for online filling of continuous missing time series data based on multi-periodicity provided by an embodiment of the present invention;

[0055] Figure 3 It is a schematic diagram of obtaining a core cycle set provided by an embodiment of the present invention;

[0056] Figure 4 It is a schematic diagram of generating a multi-period regression sequence provided by an embodiment of the present invention;

[0057] Figure 5 Schematic diagram of a bidirectional padding adaptive error correction method provided by an embodiment of the present invention;

[0058] Figure 6 It is a schematic diagram of 1D-2D reorganization of a time series provided by an embodiment of the present invention;

[0059] Figure 7 Schematic diagram of multi-time-scale rectangular kernel convolution provided by an embodiment of the present invention;

[0060] Figure 8 is a schematic diagram of an online filling effect provided by an embodiment of the present invention;

[0061] Fig. 9 It is a system block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0063] First of all, it should be noted that in the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplarily" is intended to present the concept in a concrete way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0064] First embodiment

[0065] In view of the fact that there is no technical solution to solve the problem of online filling of continuity loss in the industry, this embodiment provides a method for online filling of continuous loss of time series data based on multi-periodicity to solve the problem of online filling of time series data with continuity loss; the method can be implemented by an electronic device, which can be a terminal or a server. The execution process of the method is as follows Figure 1 As shown, the following steps are included:

[0066] S1, obtaining a core period set of a sequence to be filled based on fast Fourier transform; wherein the core period set refers to a key period set extracted from the sequence to be filled by fast Fourier transform;

[0067] Specifically, for the sequence to be filled, this embodiment uses fast Fourier transform to process the historical data part, and solves the core period set of the sequence to be filled according to the Fourier transform result, such as Figure 2 and Figure 3 As shown, the process of obtaining the core period set of the sequence to be filled based on the fast Fourier transform in this embodiment includes:

[0068] S11, obtain the sequence to be filled; it is known that the sequence to be filled X={x t-h. ,x t-h+1 ,…,x t-1 ,x t ,x t+1 ,x t-h+1 ,…,x t+k-1 ,(x t+k )}, where t is the time sequence number of the start of the missing, h is the length of the historical data, and k is the missing length. The last item x t+kIf it does not exist, it means that the length of the entire sequence is h+k, of which the length to be filled is k, and the last item in the sequence is the item to be filled; if the last item exists, it means that the length of the entire sequence is h+k+1, of which the length to be filled is k, and the last item in the sequence is a known item. The problem to be filled is abstracted as follows: Given a sequence X to be filled, where {x t-h. ,x t-h+1 ,…,x t-1} value (one-way filling) or if {x t-h. ,x t-h+1 ,…,x t-1 ,x t+k+1} (bidirectional filling), find the value of {x t ,x t+1 ,x t-h+1 ,…,x t+k-1}The values ​​of all elements.

[0069] S12, applying fast Fourier transform to the historical data part of the sequence to be filled, and obtaining the frequency domain sequence Z of the sequence to be filled = {z1., z2,…, z h}=FFT({x t-h. ,x t-h+1 ,…,x t-1}).

[0070] S13, calculating the length of the core period set based on the sequence Z, the so-called core period set is a set of periods that best represent the sequence to be filled. The calculation formula of the core period set length l is as follows:

[0071]

[0072] Where h represents the length of the historical data in the sequence to be filled; z j Indicates the value of the jth element in the frequency domain sequence; || indicates the absolute value operation; max j {z j} represents the value of the element with the largest amplitude in the frequency domain sequence.

[0073] S14, according to the length l of the core period set, select the l elements with the largest amplitude in Z, record the period p and amplitude a corresponding to each selected element, and form a core period set P = {(p1, a1), (p2, a2), ..., (p l ,a l )}, where the calculation formula of the variable is as follows:

[0074]

[0075] Among them, max i Indicates the i-th largest value, arg max i Represents the dependent variable corresponding to the i-th largest value. It means that for j∈{0,1,2,…,}, the i-th largest z j The amplitude of It means that for j∈{0,1,2,…,}, the i-th largest z j The period corresponding to the amplitude.

[0076] So far, we have obtained the core cycle set C, which will play an important role in the following S2 and S4.

[0077] S2, based on the core period set and in combination with the historical data in the sequence to be filled, performing multi-period data regression on the missing data in the sequence to be filled, obtaining a regression value for each missing data in the sequence to be filled, and forming a regression sequence from the regression values ​​corresponding to all the missing data in the sequence to be filled;

[0078] Specifically, see Figure 4 In this embodiment, based on the weight of the core period set, the missing area in the sequence to be filled is subjected to multi-period regression using historical data to solve the regression sequence; for the sequence to be filled X, the core period set C is known, and the multi-period data regression is performed on the sequence to be filled. The calculation formula is as follows:

[0079] For each x i ∈{x t ,x t+1 ,…,x t+k-1 ,(x t+k )}, the regression value is calculated as:

[0080]

[0081] Among them, x reg,i is the regression value of the i-th missing data in the sequence to be filled. All such values ​​form a set called the regression sequence R, R = {x reg,t ,x reg,t+1 ,…,x reg,t+k-1 ,(x reg,t+k )}; l represents the length of the missing data in the sequence to be filled; is the ipth in the sequence to be filled j The value of historical data, p j Represents the period value recorded by the jth element in the frequency domain sequence; α j is the weight based on the corresponding amplitude of the period; a j Represents the amplitude recorded by the jth element in the frequency domain sequence; a g is the amplitude recorded for the gth element in the frequency domain sequence.

[0082] S3, filling the sequence to be filled based on the regression sequence to obtain a pre-filled sequence;

[0083] Specifically, when filling the sequence to be filled based on the regression sequence, this embodiment conducts a classification discussion based on whether there is a measured value after the missing area of ​​the sequence to be filled. For the sequence to be filled X, the regression sequence R is known, and it is divided into two cases according to whether the last value of the sequence to be filled is a measured value: (1) In the case where there is no measured value after the missing area of ​​the sequence to be filled, the regression sequence is filled into the sequence to be filled to form a pre-filled sequence. (2) In the case where there is a measured value after the missing area of ​​the sequence to be filled, the regression sequence is adaptively corrected using the measured value, and then the corrected regression sequence is filled into the sequence to be filled. The specific implementation process is as follows:

[0084] The last value of the sequence to be filled is the value to be filled, that is, X = {x t-h. ,x t-h+1 ,…,x t-1 ,x t ,x t+1 ,x t-h+1 ,…,x t+k-1}, at this time, since there is no measured value after the missing value of the sequence to be filled, there is no need to use the information of the measured data after the missing value, so no additional processing is performed in this step. Let the elements in the regression sequence R be filled into the sequence to be filled X in sequence, that is, let {x t-1 ,x t ,x t+1 ,x t-h+1 ,…,x t+k-1 ,(x reg,t+k )}={x reg,t ,x reg,t+1 ,…,x reg,t+k-1 ,(x reg,t+k )}, define the filled sequence as the pre-filled sequence P. Note that P no longer contains items to be filled.

[0085] like Figure 5 As shown, the last value of the sequence to be filled is the measured value, that is, X = {x t-h. ,x t-h+1 ,…,x t-1 ,x t ,x t+1 ,x t-h+1 ,…,x t+k-1 ,x t+k}, at this time, since there are measured values ​​after the missing values ​​of the sequence to be filled, it is necessary to use the information of the measured data after the missing values ​​for correction. The specific calculation process is as follows:

[0086] x col,i =x reg,i +β i (x t+k -x reg,t+k )

[0087]

[0088] Among them, x reg,i represents the regression value of the i-th missing data in the sequence to be filled; x col,i Represents x reg,i The corrected values, all of which form a set, are called filling the set into X in order to obtain the pre-filled sequence P; x t+k represents the first measured value after the missing data of the sequence to be filled; x reg,t+k represents the regression value of the t+kth missing data in the sequence to be filled; e is a natural constant; β i is the adaptive correction coefficient; b is the parameter of the correction coefficient, and its value range is (0,1).

[0089] Through the above formula, this embodiment corrects the elements in the regression sequence based on the measured values ​​after the missing data to obtain a corrected regression sequence, and fills the elements in the corrected regression sequence into the missing data part of the sequence to be filled in sequence, thereby obtaining a pre-filled sequence P.

[0090] At this point, the one-way and two-way filling are comprehensively considered through S2 and S3, and the pre-filling sequence is calculated.

[0091] S4, based on the core period set, regenerate the pre-filled sequence using multi-periodicity to perform multi-time granularity time series data, and reconstruct a filled sequence;

[0092] Specifically, Figure 6 As shown, this embodiment performs a 1D to 2D reorganization on the pre-filled sequence generated by S3 to form a sequence data matrix. Multi-scale convolution is performed on the sequence data matrix using rectangular convolution kernels of different sizes, and the feature matrix formed by the 2D convolution is de-reorganized according to the core period set. The de-reorganized feature sequence is summed with the original pre-filled sequence to obtain the filled sequence. The specific implementation process is as follows:

[0093] S41, given the pre-filled sequence P, since P is already a complete sequence without items to be filled, there is no need to discuss classification. Assume that the length of P is l p ,

[0094] S42, reorganize P according to C and define l matrices The calculation formula is as follows:

[0095]

[0096] Among them, M jrepresents the jth matrix defined; note that since the number of matrix elements exceeds l p , so the matrix finally replaces the original items with zero, that is, in M j middle, x n represents the nth element in the pre-filled sequence, R represents a real matrix, represents rounding up;

[0097] S43, for each M j Matrix, use three different sizes of convolution kernels to perform convolution operations, extract features of different time granularities, average the results, and obtain a new feature matrix of the same size. The calculation formula is as follows:

[0098]

[0099] Among them, T j Indicates M j The corresponding feature matrix; Indicates a convolution operation with a convolution kernel parameter of θ1 and a convolution kernel size of 1x3; It represents a convolution operation with a kernel parameter of θ2 and a kernel size of 3x5. It represents a convolution operation with a kernel parameter of θ3 and a kernel size of 5x7. Figure 7 Schematic diagram of multi-time-scale rectangular kernel convolution provided by an embodiment of the present invention.

[0100] S44, l T j The matrix is ​​de-reorganized according to the core period set C to form a characteristic sequence with the same length as the original pre-filled sequence P, and summed with the original filled sequence P to obtain the filled sequence Y, the formula is as follows:

[0101]

[0102] Among them, it should be noted that due to T j Same as M j The matrices have the same scale, so the elements with "'" are defined as T j In the matrix, M j Elements at the same position.

[0103] Based on the above, the online filling effect of the method of the embodiment of the present invention is as follows: Figure 8 shown.

[0104] S5, using a preset auxiliary filler to generate a filling result of the sequence to be filled, recorded as an auxiliary filling sequence, using the auxiliary filling sequence to complete the filling effect evaluation of the filled sequence, and according to the filling effect evaluation result of the filled sequence currently obtained, realize algorithm self-training and adaptive hyperparameter update;

[0105] Specifically, this embodiment uses the auxiliary filler constructed by the long short-term memory network to solve the auxiliary filling sequence, and solves the data filling performance index based on the auxiliary filling sequence and the filled sequence. The parameters of the convolution kernel in S4 are updated by back propagation based on the performance index to complete the algorithm self-training. The learning rate of the next round of training is updated using the performance index to complete the adaptive adjustment of the algorithm hyperparameters. The specific implementation process is as follows:

[0106] S51, input the sequence to be filled X into the auxiliary filler, the auxiliary filler is a long short-term memory network (LSTM) that has been fully trained using historical data, and the filling result of the auxiliary filler - the auxiliary filling sequence The data filling performance index r is calculated with the filled sequence, and the calculation formula is as follows:

[0107]

[0108] in, represents the calculated value of the filling performance index; k1, k2, k3 are all weight coefficients, and the value range of each weight coefficient is [0, 1], which is generally determined by experience; l p Indicates the length of the pre-filled sequence; y i Represents the value of the i-th element in the filled sequence; Represents the value of the i-th element in the auxiliary filling sequence; express The average value of .

[0109] S52, using the padding performance index as the loss, back-propagates to the convolution operation of S4 and updates the corresponding parameters of the convolution kernel, namely: Where η is the learning rate, It represents the gradient with θ1, θ2, and θ3 as independent variables. So far, the self-training of the online filling algorithm for time series data has been completed.

[0110] S53, further, in order to ensure the stability of the algorithm self-training, it is necessary to update the new learning rate according to the performance index. The formula is as follows:

[0111]

[0112] Among them, η new Represents the learning rate of the next round; η old Represents the learning rate of this round; q represents the proportional coefficient, and its value range is (0,1); it is used to control the learning rate update speed to avoid algorithm oscillation caused by too fast update.

[0113] Then return to S1 for the next iteration.

[0114] In summary, this embodiment provides a method for online filling of continuous missing time series data based on multi-periodicity. The method adopts three technical methods to improve the online filling effect of continuous missing time series data. First, fast Fourier transform and 2D convolution operation are used to obtain and multi-scale analyze the multi-periodicity of time series data, thereby improving the accuracy of data filling; second, a classification discussion method is adopted to organically combine bidirectional filling and unidirectional filling, thereby improving the adaptability of the filling algorithm; third, algorithm self-training and hyperparameter adjustment are realized based on the data filling performance index solution, thereby improving the stability of the algorithm. The present invention can be deployed at the sensor end or the detection algorithm front end, and provides a technical means for high-precision online filling of missing time series data without the need for other data assistance. It has a wide range of application scenarios and can be applied to weather forecasting, agricultural production, traffic control, and business decision-making.

[0115] Second embodiment

[0116] This embodiment provides an electronic device, such as Fig. 9 As shown, the electronic device includes: a processor and a memory; wherein the processor and the memory can be connected via a communication bus; the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method of the first embodiment. In addition, the electronic device may also include a transceiver, the processor and the transceiver can be connected via a communication bus, and the transceiver is used to communicate with other devices.

[0117] Next, combine Fig. 9 The following is a detailed introduction to the various components of the electronic device:

[0118] Among them, the processor is the control center of the electronic device, and the electronic device may include multiple processors, each of which may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may be a processor or a general term for multiple processing elements. For example, the processor is one or more central processing units (CPUs), or other general-purpose processors, application specific integrated circuits (ASICs), or one or more integrated circuits configured to implement an embodiment of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor may execute various functions of the electronic device by running or executing software programs stored in the memory and calling data stored in the memory.

[0119] In a specific implementation, as an embodiment, the processor may include one or more CPUs, such as Fig. 9 The CPU0 and CPU1 shown in the figure are, of course, only exemplary.

[0120] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.

[0121] Optionally, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor or exist independently and accessed through the interface circuit ( Fig. 9 (not shown) is coupled to the processor, which is not specifically limited in this embodiment of the present invention.

[0122] The transceiver may include a receiver and a transmitter ( Fig. 9 The receiver is used to implement the receiving function, and the transmitter is used to implement the sending function. The transceiver can be integrated with the processor or exist independently and communicate with the electronic device through the interface circuit ( Fig. 9 (not shown) is coupled to the processor, which is not specifically limited in this embodiment of the present invention.

[0123] In addition, it should be noted that Fig. 9 The structure of the electronic device shown in the figure does not constitute a limitation on the device, and the actual device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In addition, the technical effects achieved by the electronic device when executing the method of the first embodiment above can refer to the technical effects described in the first embodiment above, so they are not repeated here.

[0124] Third embodiment

[0125] This embodiment provides a computer-readable storage medium, which stores at least one instruction, and the instruction is loaded and executed by a processor to implement the method of the first embodiment. The computer-readable storage medium may be a ROM, a random access memory, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. The instructions stored therein may be loaded by a processor in a terminal to execute the method.

[0126] In addition, it should be noted that the present invention can be provided as a method, an apparatus or a computer program product. Therefore, the embodiment of the present invention can be in the form of a full or partial hardware embodiment, a full or partial software embodiment or an embodiment combining software and hardware. Moreover, when implemented using software, the embodiment of the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center containing one or more available media sets. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium. The semiconductor medium may be a solid state hard disk.

[0127] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0128] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0129] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements. In addition, the term "and / or" is only an association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, wherein A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding. "At least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can be represented by: a, b, c, ab, ac, bc or abc, where a, b, c can be single or plural.

[0130] In addition, it can be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0131] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0132] In several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of functional modules / units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0133] If the method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0134] Finally, it should be noted that the above is only a preferred embodiment of the present invention. It should be pointed out that although the preferred embodiment of the present invention has been described, for ordinary technicians in this technical field, once the basic creative concept of the present invention is known, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the protection scope of the present invention. Therefore, the attached claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the embodiments of the present invention.

Claims

1. A method for filling continuous missing time series data online based on multi-periodicity, characterized in that: include: Acquire a core period set of the sequence to be filled based on fast Fourier transform; wherein the core period set refers to a key period set extracted from the sequence to be filled by fast Fourier transform; Based on the core period set and in combination with the historical data in the sequence to be filled, multi-period data regression is performed on the missing data in the sequence to be filled to obtain a regression value of each missing data in the sequence to be filled, and a regression sequence is formed by the regression values ​​corresponding to all the missing data in the sequence to be filled; Filling the sequence to be filled based on the regression sequence to obtain a pre-filled sequence; Based on the core period set, the pre-filled sequence is regenerated using multi-periodicity to perform multi-time granularity time series data to reconstruct a filled sequence; A preset auxiliary filler is used to generate a filling result of the sequence to be filled, which is recorded as an auxiliary filling sequence. The auxiliary filling sequence is used to complete the filling effect evaluation of the filled sequence. According to the filling effect evaluation result of the filled sequence currently obtained, algorithm self-training and adaptive hyperparameter updating are realized.

2. The method for filling continuous missing time series data based on multi-periodicity as claimed in claim 1, characterized in that: The method of obtaining a core period set of a sequence to be filled based on fast Fourier transform includes: Applying fast Fourier transform to the historical data in the sequence to be filled to obtain a frequency domain sequence of the sequence to be filled; wherein the historical data refers to the non-missing data in the sequence to be filled; Filter out the l elements with the largest amplitude in the frequency domain sequence, record the period and amplitude corresponding to each element in the l elements with the largest amplitude, and form a core period set; wherein the element in the core period set represents the period and amplitude corresponding to one element in the l elements with the largest amplitude; the calculation formula is: Where h represents the length of the historical data in the sequence to be filled; z j Indicates the value of the jth element in the frequency domain sequence; || indicates the absolute value operation; max j {z j } represents the value of the element with the largest amplitude in the frequency domain sequence.

3. The method for filling continuous missing time series data based on multi-periodicity as claimed in claim 1, characterized in that: The calculation formula for the regression value of the missing data is: Among them, x reg,i represents the regression value of the i-th missing data in the sequence to be filled; l is the length of the missing data in the sequence to be filled; Indicates the ipth in the sequence to be filled j The value of historical data, p j is the period value recorded for the jth element in the frequency domain sequence; a j is the amplitude recorded for the jth element in the frequency domain sequence; a g is the amplitude recorded for the gth element in the frequency domain sequence.

4. The method for filling continuous missing time series data based on multi-periodicity as claimed in claim 1, characterized in that: Filling the sequence to be filled based on the regression sequence to obtain a pre-filled sequence, including: If there is no measured value after the missing data of the sequence to be filled, the elements in the regression sequence are sequentially filled into the missing data part of the sequence to be filled to obtain a pre-filled sequence; If there are measured values ​​after the missing data of the sequence to be filled, the elements in the regression sequence are corrected based on the measured values ​​after the missing data to obtain a corrected regression sequence, and the elements in the corrected regression sequence are sequentially filled into the missing data part of the sequence to be filled to obtain a pre-filled sequence.

5. The method for online filling of continuous missing time series data based on multi-periodicity as claimed in claim 4, characterized in that: The formula for correcting the elements in the regression series based on the measured values ​​after missing data is: x col,i =x reg,i +β i (x t+k -x reg,t+k ) Among them, x reg,i represents the regression value of the i-th missing data in the sequence to be filled; x col,i Represents x reg,i Corrected value; x t+k represents the first measured value after the missing data of the sequence to be filled; x reg,t+k represents the regression value of the t+kth missing data in the sequence to be filled, k is the missing length of the sequence to be filled; e is a natural constant; β i is the adaptive correction coefficient; b is the parameter of the correction coefficient, and its value range is (0, 1).

6. The method for online filling of continuous missing time series data based on multi-periodicity as claimed in claim 2, characterized in that: Based on the core period set, the pre-filled sequence is regenerated using multi-periodicity to perform multi-time granularity time series data to reconstruct a filled sequence, including: The pre-filled sequence is reorganized according to the core cycle set to define a matrix The calculation formula is as follows: Among them, p j is the period value recorded for the jth element in the frequency domain sequence; l p Indicates the length of the pre-filled sequence; M j Represents the j-th matrix defined; in M j middle, x n represents the nth element in the pre-filled sequence, R represents a real matrix, represents rounding up; For each matrix, three convolution kernels of different sizes are used to perform convolution operations, extract features of different time granularities, and average the results to obtain a new feature matrix. The calculation formula is as follows: Among them, T j Indicates M j The corresponding feature matrix; It represents a convolution operation with a kernel parameter of θ1 and a kernel size of 1x3. It represents a convolution operation with a kernel parameter of θ2 and a kernel size of 3x5. It represents a convolution operation with a kernel parameter of θ3 and a kernel size of 5x7. The l characteristic matrices are reversely reorganized according to the core period set to form a characteristic sequence with the same length as the pre-filled sequence, and the characteristic sequence is summed with the pre-filled sequence to obtain a filled sequence.

7. The method for online filling of continuous missing time series data based on multi-periodicity as claimed in claim 6, characterized in that: The auxiliary filling sequence is used to complete the filling effect evaluation of the filled sequence, and according to the currently obtained filling effect evaluation result of the filled sequence, the algorithm self-training and adaptive hyperparameter update are realized, including: Calculating a filling performance index of the filled sequence using the auxiliary filling sequence; The padding performance index is used as the loss, back-propagated to each convolution operation when calculating the feature matrix, and the corresponding parameters of the convolution kernel in each convolution operation are updated to achieve algorithm self-training and adaptive hyperparameter update.

8. The method for filling continuous missing time series data based on multi-periodicity as claimed in claim 1, characterized in that: The preset auxiliary filler is a long short-term memory network.

9. The method for online filling of continuous missing time series data based on multi-periodicity as claimed in claim 7, characterized in that: The calculation formula of the filling performance index is: in, represents the calculated value of the filling performance index; k1, k2, k3 are all weight coefficients; l p Indicates the length of the pre-filled sequence; y i Represents the value of the i-th element in the filled sequence; Represents the value of the i-th element in the auxiliary filling sequence; express The average value of .

10. The method for filling continuous missing time series data based on multi-periodicity as claimed in claim 7, characterized in that: When implementing algorithm self-training and adaptive hyperparameter updating, the method further includes: Update the learning rate according to the filling performance index, the formula is as follows: Among them, η new Represents the learning rate of the next round; η old Represents the learning rate of this round; q represents the proportional coefficient; it is used to control the learning rate update speed; e is a natural constant; r represents the currently calculated filling performance index.