A method for mining full-length frequent patterns in time series data based on DTW distance
Through the full-length frequent mode mining method of time series data based on DTW distance, the STAMP algorithm and the lower bound function optimize the calculation order, the problem of inefficiency of frequent mode mining of different lengths in the prior art is solved, and efficient and accurate frequent mode mining is achieved, which is suitable for outdoor temperature timing data.
Patent Information
- Application Number
- CN202311066879.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-08-23
AI Technical Summary
The existing algorithms based on dynamic time regularization are difficult to meet the effectiveness and efficiency requirements in the mining process of frequent modes of different lengths at the same time. Especially in outdoor temperature timing data, algorithms with preset mode lengths are difficult to discover all potential frequent modes.
The full-length frequent mode mining method of time series data based on DTW distance is adopted, and the subsequence pairs are extracted through the STAMP algorithm and the DTW distance is calculated. Combined with the lower bound function and the optimal lower bound calculation method, the frequent mode location is gradually expanded and updated, and the calculation sequence is optimized using prior information and heuristic methods to achieve efficient mining of frequent modes of different lengths.
It improves the efficiency and effectiveness of frequent mode mining, can obtain the optimal frequent mode of all lengths in a short time, and even provides approximate solutions when resources are limited, significantly improving the running speed of the algorithm and the accuracy of the results.
Smart Images

Figure CN117009419B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of outdoor temperature time series data mining, and in particular to a method for mining full-length frequent patterns of time series data based on DTW distance. Background Art
[0002] In recent years, frequent pattern discovery based on dynamic time warping distance has been recognized as a key component of time series data mining due to its ability to reveal potential unknown patterns in time series. Specifically, for a time series S, frequent pattern discovery aims to identify subsequences within S that exhibit high similarity. Because frequent patterns in time series are not unique in type or length, designing an effective algorithm for efficiently discovering these patterns is crucial.
[0003] Existing frequent pattern discovery algorithms are based on a filtering and verification process. In this approach, a large number of lower-bound functions are used to verify candidates for possible frequent patterns in time series data. These lower-bound functions form a lower-bound hierarchy, and each candidate is tested against a sequence of lower-bound functions in an attempt to exclude the candidate sequence from further computation. This iterative process continues until all functions in the lower-bound hierarchy have been exhausted, or a lower-bound function proves that the candidate cannot be a frequent pattern in the time series.
[0004] Dynamic Time Warping (DTW) is considered to be a similarity measure that is better than Euclidean distance in real-valued time series data. Given two sequences X = (x1, x2, ..., x L ) and Q=(q1,q2,…,q L ), Dynamic Time Warping finds a feasible alignment for them and reports the distance as the Euclidean distance between their sequences, as follows:
[0005]
[0006] in
[0007] However, existing algorithms based on dynamic time warping require a precise frequent pattern length as input, thus focusing only on frequent patterns with a predetermined length. This presents several drawbacks. First, when faced with unknown time series data, selecting an appropriate length for the algorithm is challenging because it is unknown in advance what potential frequent patterns may exist within the data. Second, because the length of frequent patterns is not fixed, algorithms with a predetermined pattern length cannot discover all potential frequent patterns within the time series data. For example, outdoor temperature time series data contains a variety of frequent patterns of varying lengths across different regions. These patterns include daily patterns arising from the alternation of day and night, annual patterns resulting from seasonal variations, and even longer patterns influenced by variations in the Earth's orbit and solar activity. Therefore, algorithms with a predetermined pattern length do not achieve effective results in discovering frequent patterns in this time series data.
[0008] Currently, the most advanced and effective frequent pattern mining algorithm based on dynamic time programming can only mine and search for frequent patterns of a fixed length L. If we use this method to forcibly mine frequent patterns in time series data with a length range of [L min ,L max ], the algorithm needs to be called as many as L max -L min +1 times, calculating the frequent patterns at each length separately. However, this traversal method is very expensive in actual calculations and is therefore impractical. Therefore, existing algorithms based on dynamic time warping are difficult to simultaneously meet the requirements of effectiveness and efficiency in the algorithm mining process of frequent patterns of different lengths. Summary of the Invention
[0009] The purpose of the present invention is to solve the problem that it is difficult to simultaneously meet the effectiveness and efficiency requirements of the algorithm mining process of frequent patterns of different lengths in the existing dynamic time warping-based algorithms, and to provide a full-length frequent pattern mining method, device and storage medium for time series data based on DTW distance.
[0010] The technical solution of this application is:
[0011] Solution 1: A full-length frequent pattern mining method for time series data based on DTW distance, used for batch processing of outdoor temperature time series data S, including:
[0012] S1: Get time series data based on outdoor temperature s=(s1,s2,…,s n ), and determine the length interval of the frequent pattern specified by the user [L min ,L max], using the STAMP algorithm to extract multiple subsequence pairs whose subsequence distance is not higher than the threshold under the Euclidean distance metric from the time series data S; calculate the dynamic time warping (DTW) distance between all the extracted subsequence pairs, and take the pair of subsequences with the smallest DTW distance among all the extracted subsequence pairs as the optimal value, and put them into fir_min[L min ] and sec_min[L min ];fir_min[L min ] and sec_min[L min ] are vectors that record the locations of frequent patterns;
[0013] described is a set of real numbers, n is the dimension;
[0014] The length interval L max ≤n;L min ≥1;
[0015] S2: Calculate the length interval [L min ,L max ] All lengths L are L min The key value of the lower bound function corresponding to the frequent pattern, and according to the key value of the lower bound function, each pair of length L min The length of the subsequence is L min Expanded to L min +1,L min +2,…,L max When , the upper limit of the DTW distance lower bound function offset corresponding to each pair of subsequences after expansion is calculated.
[0016] The extension operation will be of length L min Subsequence pairs Expand to length L min +K subsequence operation, where It is represented as the length of the i-th position in the time series data S as the starting point is L min subsequence of It is represented as the length L of the time series data S starting from the jth position min The DTW distance lower bound function is a distance function, hereinafter referred to as the lower bound function;
[0017] S3: Calculate the length interval [L min ,L max ] corresponds to the optimal frequent patterns of all lengths within the calculation length interval [L min ,L maxThe optimal frequent pattern method corresponding to the length L in ] includes the following steps:
[0018] S3.1: Calculate the length interval [L min ,L max ] is the optimal frequent pattern lower bound corresponding to the inner length L;
[0019] First, all subsequence pairs of length L in the time series data S are regarded as candidates, and the set of candidate items is Θ. Then, the optimal lower bound calculation method is used to calculate each candidate item to obtain the optimal frequent pattern lower bound corresponding to the current length L;
[0020] The optimal lower bound calculation method comprises the following steps:
[0021] S3.1.1: Calculate the lower bound function of the frequent pattern of length L corresponding to the current candidate and the lower bound function of the frequent pattern of length L corresponding to the current candidate The difference between them and the DTW distance of the current optimal frequent pattern is determined Is it greater than or equal to this difference? If the condition is met, skip calculating the DTW distance lower bound of the current L-length candidate and discard the current candidate. If the condition is not met, retain it. After judging all candidates in the set Θ, go to S3.1.2;
[0022] The current optimal frequent pattern is obtained within a length of L+K; and Represents the subsequence pair of the current optimal frequent pattern;
[0023] S3.1.2: Let Θ' be the set of candidates that were not discarded in S3.1.1. Calculate the DTW distance lower bound for all candidates in Θ' to obtain the optimal frequent pattern lower bound for the current length L.
[0024] S3.2: Based on the lower bound of the optimal frequent pattern of the current length L, check all candidates using the dynamic time warping method to obtain the optimal frequent pattern of length L, and then update the optimal value based on the DTW distance of the optimal frequent pattern of length L;
[0025] S3.3: Store the position of each subsequence pair in the optimal frequent pattern of length L in the vector fir_min[L] and the vector sec_min[L] respectively;
[0026] S3.4: Determine the length interval [L min ,L max ] are all the optimal frequent patterns of lengths within the range [1] completed. If so, proceed to S4; otherwise, proceed to S3.5.
[0027] S3.5: Update the length L of the currently discovered frequent pattern to L+1. After the update is complete, return to S3.1.
[0028] S4: Get the length interval [L min ,L max ]The vector fir_min and vector sec_min of the optimal frequent pattern positions of all lengths within .
[0029] Solution 2: Another method for mining full-length frequent patterns of time series data at any time based on DTW distance is used to process time series data S of any outdoor temperature. The steps include:
[0030] S1: Get time series data based on outdoor temperature S = (s1, s2, ..., s n ), and determine the length interval of the frequent pattern specified by the user [L min ,L max ], using the STAMP algorithm to extract multiple subsequence pairs whose subsequence distance is not higher than the threshold under the Euclidean distance metric from the time series data S; calculate the dynamic time warping (DTW) distance between all the extracted subsequence pairs, and take the pair of subsequences with the smallest DTW distance among all the extracted subsequence pairs as the optimal value, and put them into fir_min[L min ] and sec_min[L min ];fir_min[L min ] and sec_min[L min ] are vectors that record the locations of frequent patterns;
[0031] described is a set of real numbers, n is the dimension;
[0032] The length interval L max ≤n;L min ≥1;
[0033] S1.1: For all lengths L∈[L min ,L max ], initialize the vector that records the position of the frequent pattern. The specific process is: for all lengths L, initialize the value of fir_min[L] to 1, initialize the value of sec_min[L] to L max ;
[0034] S1.2: Use the DTW distance lower bound calculation method to calculate the length L of the time series data S min The lower bound of the DTW distance between all subsequence pairs is calculated based on the size of the DTW lower bound between the subsequence pairs, for each pair of length L minSubsequences are given priority, where the subsequence pair with a smaller DTW distance lower bound has a higher priority;
[0035] S2: Calculate the length interval [L min ,L max ] All lengths L are L min The key value of the lower bound function corresponding to the frequent pattern, and according to the key value of the lower bound function, each pair of length L min The length of the subsequence is L min Expanded to L min +1,L min +2,…,L max When , the upper limit of the DTW distance lower bound function offset corresponding to each pair of subsequences after expansion is calculated.
[0036] The extension operation will be of length L min Subsequence pairs Expand to length L min +K subsequence operation, where It is represented as the length of the i-th position in the time series data S as the starting point is L min subsequence of It is represented as the length L of the time series data S starting from the jth position min The DTW distance lower bound function is a distance function, hereinafter referred to as the lower bound function;
[0037] S2.1: Call the subsequence pair with the highest priority among the current candidates. The subsequence pair with the highest priority is recorded as
[0038] The candidates are subsequence pairs that have not yet been examined;
[0039] S3: According to the subsequence with the highest priority The corresponding length L is L min Expanded to L min +1,L min +2,…,L max Time subsequence pair The DTW distance between them is used to update the vectors fir_min[L] and sec_min[L] of the frequent pattern positions with a record length of L;
[0040] The specific method includes the following steps:
[0041] S3.1: Use the optimal lower bound calculation method to calculate the subsequence of length L Calculate and get the current length L subsequence The DTW distance lower bound is:
[0042] S3.1.1: Calculate the lower bound function of the frequent pattern of length L corresponding to the current candidate and the lower bound function of the frequent pattern of length L corresponding to the current candidate The difference between them and the DTW distance of the current optimal frequent pattern is determined Is it greater than or equal to this difference? If the condition is met, skip calculating the update of the frequent pattern of the current length L and go to S4, otherwise go to S3.2;
[0043] S3.1.2: Compute the optimal lower bound of the frequent pattern of the current length L using the method that is determined to be the best possible lower bound based on prior information;
[0044] S3.2: Based on the obtained lower bound of the optimal frequent pattern of the current length L, the dynamic time warping method is used to obtain a frequent pattern of length L. The DTW distance of the current frequent pattern of length L is compared with the DTW distance between the current optimal frequent pattern recorded by fir_min[L] and sec_min[L]. The specific method is as follows:
[0045]
[0046] If so, update the values of fir_min[L] and sec_min[L] to i and j respectively, that is, update the optimal value of the DTW distance of the frequent pattern with the current length L, where It is expressed as the DTW distance between the best frequent patterns obtained on a subsequence of length L+K;
[0047] S4: Determine whether all candidates have been checked and calculated. If so, proceed to S5. Otherwise, further determine whether the current result exceeds the set value. If so, output the current result and proceed to S5. Otherwise, call the subsequence pair with the highest priority among the candidates and return to S3.
[0048] S5: Get the length interval [L min ,L max ]The vector fir_min and vector sec_min of the optimal frequent pattern positions of all lengths within .
[0049] Solution 3: A device for mining full-length frequent patterns of time series data based on DTW distance, the device comprising a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the above-mentioned method for mining full-length frequent patterns of time series data.
[0050] Solution 4: A computer storage medium, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned method for mining full-length frequent patterns of time series data.
[0051] Compared with the prior art, this application has the following effects:
[0052] This paper proposes a method, device, and storage medium for mining full-length frequent patterns in time series based on dynamic time warping. This method can calculate frequent patterns of varying lengths for time series data. By reusing previously obtained lower bounds, initializing the best value to date, and continuously updating the best value, the validity of the lower bound is ensured.
[0053] By reusing the lower bound value obtained by calculating the previous length of a frequent pattern within a length interval, the optimal lower bound is selected to assist in the calculation of frequent patterns of the current length. After the calculation is complete, the best value to date is updated, and potential frequent patterns are stored in a vector based on their starting position. This allows for rapid batch computation of time series data and returns the exact solution after the program completes, greatly improving the efficiency of discovering frequent patterns of all lengths. After examining all candidates, the optimal frequent pattern of length L is stored. Because frequent patterns of length L are inherently correlated with frequent patterns of length L+1, the positions of frequent patterns of length L are used to initialize the best value to date for frequent patterns of length L+1, enabling the subsequent heuristic calculation of frequent patterns of length L+1. Ultimately, upon completion of the algorithm, the optimal frequent patterns of all lengths are obtained, addressing the need for both effectiveness and efficiency in mining frequent patterns of varying lengths.
[0054] On the other hand, while proposing a batch processing algorithm for exact solutions, the present invention also proposes an anytime algorithm for approximate solutions, so that users with limited resources can also obtain a feasible solution under limited resource conditions. It can also solve the problem of simultaneously meeting the effectiveness and efficiency requirements in the algorithm mining process of frequent patterns of different lengths.
[0055] The present invention also conducted experiments on public, real-world datasets and achieved excellent results. The public datasets used in the experiments were HOUSE, Cricket, FEED, and EPG, with designed length intervals of [200, 400], [400, 600], and [600, 800]. The experiments were conducted on a server equipped with an Intel i7 CPU and 128GB of RAM. Ultimately, the experimental results show that the proposed solution 1 is 13.06 times faster than the baseline algorithm. Solution 2 can achieve relatively satisfactory results after calculating only 5% of the candidates. Solution 2 is slightly slower in obtaining the exact solution, but is still 7.07 times faster than the baseline algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 This is a flow chart of a method for mining full-length frequent patterns in time series data based on DTW distance according to a first embodiment of the present invention;
[0057] Figure 2 This is a flow chart of a method for mining full-length frequent patterns in time series data based on DTW distance according to a second specific embodiment of the present invention. DETAILED DESCRIPTION
[0058] Specific implementation method 1: Combination Figure 1 To illustrate this embodiment, the time series data for outdoor temperature contains various frequent patterns of varying lengths in certain regions. These patterns include daily patterns resulting from the alternation of day and night, annual patterns resulting from seasonal changes, and even longer patterns influenced by Earth's orbital variations and solar activity. Therefore, using algorithms with predefined pattern lengths to discover frequent patterns in this time series data is difficult to achieve effective results.
[0059] A batch processing method for mining full-length frequent patterns of time series data based on DTW distance in this embodiment
[0060] S1: Get time series data based on outdoor temperature S = (s1, s2, ..., s n ), and determine the length interval of the frequent pattern specified by the user [L min ,L max ], using the STAMP algorithm to extract multiple subsequence pairs whose subsequence distance is not higher than the threshold under the Euclidean distance metric from the time series data S; calculate the dynamic time warping (DTW) distance between all the extracted subsequence pairs, and take the pair of subsequences with the smallest DTW distance among all the extracted subsequence pairs as the optimal value, and put them into fir_min[L min ] and sec_min[L min ];fir_min[L min ] and sec_min[Lmin ] are vectors that record the locations of frequent patterns;
[0061] described is a set of real numbers, n is the dimension;
[0062] The length interval L max ≤n;L min ≥1;
[0063] S2: Calculate the length interval [L min ,L max ] All lengths L are L min The key value of the lower bound function corresponding to the frequent pattern, and according to the key value of the lower bound function, each pair of length L min The length of the subsequence is L min Expanded to L min +1,L min +2,…,L max When , the upper limit of the DTW distance lower bound function offset corresponding to each pair of subsequences after expansion is calculated.
[0064] The extension operation will be of length L min Subsequence pairs Expand to length L min +K subsequence operation, where It is represented as the length of the i-th position in the time series data S as the starting point is L min subsequence of It is represented as the length L of the time series data S starting from the jth position min The DTW distance lower bound function is a distance function, hereinafter referred to as the lower bound function;
[0065] S3: Calculate the length interval [L min ,L max ] corresponds to the optimal frequent patterns of all lengths within the calculation length interval [L min ,L max The optimal frequent pattern method corresponding to the length L in ] includes the following steps:
[0066] S3.1: Calculate the length interval [L min ,L max ] is the optimal frequent pattern lower bound corresponding to the inner length L;
[0067] First, all subsequence pairs of length L in the time series data S are regarded as candidates, and the set of candidate items is Θ. Then, the optimal lower bound calculation method is used to calculate each candidate item to obtain the optimal frequent pattern lower bound corresponding to the current length L;
[0068] The optimal lower bound calculation method comprises the following steps:
[0069] S3.1.1: Calculate the lower bound function of the frequent pattern of length L corresponding to the current candidate and the lower bound function of the frequent pattern of length L corresponding to the current candidate The difference between them and the DTW distance of the current optimal frequent pattern is determined Is it greater than or equal to this difference? If the condition is met, skip calculating the DTW distance lower bound of the current L-length candidate and discard the current candidate. If the condition is not met, retain it. After judging all candidates in the set Θ, go to S3.1.2;
[0070] The current optimal frequent pattern is obtained within a length of L+K; and Represents the subsequence pair of the current optimal frequent pattern;
[0071] S3.1.2: Let Θ' be the set of candidates that were not discarded in S3.1.1. Calculate the DTW lower bound for all candidates in Θ'. Using the method that is determined to be the best lower bound based on prior information, calculate the optimal frequent pattern lower bound for the current length L.
[0072] S3.2: Based on the lower bound of the optimal frequent pattern of the current length L, check all candidates using the dynamic time warping method to obtain the optimal frequent pattern of length L, and then update the optimal value based on the DTW distance of the optimal frequent pattern of length L;
[0073] S3.3: Store the position of each subsequence pair in the optimal frequent pattern of length L in the vector fir_min[L] and the vector sec_min[L] respectively;
[0074] S3.4: Determine the length interval [L min ,L max ] are all the optimal frequent patterns of lengths within the range [1] completed. If so, proceed to S4; otherwise, proceed to S3.5.
[0075] S3.5: Update the length L of the currently discovered frequent pattern to L+1. After the update is complete, return to S3.1.
[0076] S4: Get the length interval [L min ,L max]The vector fir_min and vector sec_min of the optimal frequent pattern positions of all lengths within .
[0077] After inputting time series data and determining the length interval, the algorithm uses the STAMP algorithm to calculate frequent items based on Euclidean distance and calculates the dynamic time warping distance (DTW distance) between them to initialize the best value to date. The DTW distance of frequent patterns refers to the similarity distance between frequent patterns calculated using the DTW algorithm, helping to quantify their degree of similarity in the time series and find the most representative and important frequent patterns. Using Euclidean distance as the similarity metric, the optimal pattern is determined by comparing the DTW distances between frequent patterns.
[0078] The best value so far is the closest distance between any pair of subsequences observed so far. Then, the algorithm will calculate M = L + K. These values are used to help subsequent calculations skip lower bound calculations. The algorithm then uses the previously calculated lower bound to try to see if it can be calculated quickly. If this attempt fails, it is forced to calculate the lower bound. However, the algorithm uses the predicted optimal lower bound instead of calculating them one by one.
[0079] The predicted optimal lower bound described in S3.1.2 is a calculation method that uses prior information to determine the possible optimal lower bound. This means that when predicting the lower bound, a lower bound is calculated as the possible limit of the current optimal solution based on known information and prior knowledge. Among them, some prior information is generated. A common prior information used to determine the possible optimal lower bound is to define a loose threshold based on the difference between the upper bound and the lower bound. This threshold is used to determine whether each data point in the subsequence has potential importance. If a data point exceeds this threshold, it is considered that the data point may have an important impact on the optimal lower bound. This lower bound is used as a reference to evaluate the pros and cons of the current solution and to guide subsequent search or optimization processes.
[0080] The lower bound estimation function has two important characteristics: first, the validity of the lower bound, which refers to the closeness between the lower bound value and the true distance between subsequences. An effective lower bound helps to avoid unnecessary calculations. This method ensures the validity of the lower bound by initializing the best value so far and continuously updating the best value. Second, the computational overhead of the lower bound is that the process of calculating the lower bound function takes a lot of computing time. A faster lower bound can directly improve the efficiency of the algorithm.
[0081] The method of the present invention selects the optimal lower bound by reusing the lower bound value obtained by calculating the frequent pattern of the previous length within the length interval to assist in the calculation of the frequent pattern of the current length. After the calculation is completed, the best value to date is updated, and the potential frequent patterns are stored in a vector based on the starting position of the frequent pattern. It can quickly calculate the time series data in batches and return the exact solution after the program ends.
[0082] After checking all candidates, the optimal frequent pattern of length L is stored. Because the frequent pattern of length L is somewhat correlated with the frequent pattern of length L+1, we use the position of the frequent pattern of length L to initialize the best value so far for the frequent pattern of length L+1, so as to subsequently heuristically calculate the frequent pattern of length L+1. Ultimately, when the algorithm is completed, the optimal frequent patterns of all lengths can be obtained.
[0083] This invention also achieved excellent results through experiments on publicly available real-world datasets. The experiments used public datasets for HOUSE, Cricket, FEED, and EPG, with designed length intervals of [200, 400], [400, 600], and [600, 800]. The experiments were conducted on a server equipped with an Intel i7 CPU and 128GB of RAM. Ultimately, the experimental results show that this implementation is 13.06 times faster than the baseline algorithm.
[0084] Specific implementation method 2: Combination Figure 2 The following describes a method for mining full-length frequent patterns in time series data based on DTW distance in this embodiment:
[0085] For a given frequent pattern length L and step size K, the key values of the lower bound function described in S2 include:
[0086] Key Values It can be calculated using the following formula:
[0087]
[0088] Key Values It can be calculated using the following formula:
[0089]
[0090] Key Values It can be calculated using the following formula:
[0091]
[0092] Wherein, when the length of the subsequence pair is L, represents a subsequence of length L starting from the i-th position in the sequence S, represents a subsequence of length L starting from the jth position in the sequence S, Represents a subsequence The tth element in Represents a subsequence The tth element in Represents a subsequence The tth element in the subsequence U=(u1,u2,…,u L ) and subsequence V=(v1,v2,…,v L ) is obtained from the time series data S according to LB Keogh Envelope generated by the method; Subsequence represents a subsequence of length L starting from the i-th position in the subsequence U. Subsequence represents a subsequence of length L starting from the i-th position in the subsequence V; Represents a subsequence The standard deviation of Represents a subsequence The standard deviation of Represents a subsequence The mean of Represents a subsequence The mean of , * indicates scalar multiplication.
[0093] The LB Keogh The method is a lower bound function, the lower bound function LB Keogh The (X,Q) formula is as follows:
[0094]
[0095] Among them, u t For the subsequence {q t-w ,q t-w+1 ,…,q t+w-1 ,q t+w}, v t For the subsequence {q t-w ,q t-w+1 ,…,q t+w-1 ,q t+w}, the minimum value in x t ∈(x1,…,x L ) represents the tth element in the time series X, q t ∈(q1,…,q L ) represents the tth element in the time series Q; the time series X=(x1,…,x L ) and Q=(q1,…,qL ) is a subsequence of the time series data S.
[0096] The other steps are the same as those in the first embodiment.
[0097] Specific implementation method three: Combination Figure 1 The following describes a method for mining full-length frequent patterns of time series data based on DTW distance in this embodiment: The calculation formula is as follows
[0098] in, express The sequence from the 1st element to the Lth element is The sum of the squares of the differences between corresponding elements in the sequence is the square of the corresponding Euclidean distance. express The subsequence from the 1st element to the Lth element and The sum of squared differences between corresponding elements in the subsequence, express The subsequence from the 1st element to the Lth element and The sum of squared differences between corresponding elements in the subsequence; Subsequence represents a subsequence of length L starting from the i-th position in the subsequence U. Subsequence represents a subsequence of length L starting from the i-th position in the subsequence V;
[0099] Among them, the subsequence U=(u1,u2,…,u L ) and subsequence V=(v1,v2,…,v L ) is from the subsequence Generated envelope; subsequence U'=(u'1,u'2,…,u' L ), and subsequence V'=(v'1,v'2,…,v' L ) is from the subsequence The generated envelope, u t ∈(u1,…,u L ) represents the tth element in the subsequence U, v t ∈(v1,…,v L ) represents the tth element in the subsequence V, u' t ∈(u'1,u'2,…,u' L ) represents the tth element in the subsequence U', v' t ∈(v'1,v'2,…,v' L ) the tth element in the subsequence V';
[0100]
[0101] Where t∈{1,2,…,L}; Representation sequence The tth element in Representation sequence The tth element in LB Keogh It is a method for quickly calculating the lower bound of the dynamic time warping (DTW) distance, which speeds up the calculation process by defining a lower bound. In the lower bound calculation, it is used to determine the maximum possible offset of the lower bound calculated last time in this calculation. If the maximum offset is small enough, then we can speed up the frequent pattern calculation by reusing the result of the last DTW distance lower bound calculation. The other steps are the same as the second specific implementation method.
[0102] Specific implementation method four: Combination Figure 1 , describing a method for mining full-length frequent patterns of time series data based on DTW distance in this embodiment:
[0103] S3.1.1 calculates the lower bound function of the frequent pattern of length L corresponding to the current candidate and the corresponding lower bound function when the current candidate length is L The difference between them is used to determine the DTW distance of the current optimal frequent pattern, i.e. Is it greater than or equal to this difference? Specifically expressed as:
[0104]
[0105] Among them, For subsequence The normalized form of LB KeoghD LB Keogh The downsampling variant of any sampling factor D is It is expressed as the DTW distance of the best frequent pattern obtained on a subsequence of length L + K. It is the best value before the update.
[0106] Using the lower bound function to offset the upper limit The calculation results and the use of LB Keogh The lower bound results obtained by computing or any downsampling variant are used to assist in computing the lower bound in the optimal frequent pattern corresponding to the current length L to reduce the computation time.
[0107] This embodiment can not only reuse LB KeoghThe calculated lower bound can also utilize the variant of the result obtained by downsampling. Since a large amount of computing time is used in the calculation of the lower bound function, by reusing the previously obtained results, the computing cost can be greatly reduced and the efficiency of discovering full-length frequent patterns can be greatly improved. For those candidates who cannot reuse the results obtained by previous calculations to speed up the calculation speed, the present invention adopts the method of predicting the optimal lower bound, which also effectively avoids the large time loss caused by trying the lower bound function one after another. The other steps are the same as those in the third specific implementation method.
[0108] Specific implementation method five: Combination Figure 2 A method for mining full-length frequent patterns in time series data according to this embodiment is described below:
[0109] A method for mining full-length frequent patterns of time series data at any time based on DTW distance, characterized by:
[0110] S1: Get time series data based on outdoor temperature S = (s1, s2, ..., s n ), and determine the length interval of the frequent pattern specified by the user [L min ,L max ], using the STAMP algorithm to extract multiple subsequence pairs whose subsequence distance is not higher than a threshold under the Euclidean distance metric from the time series data S; calculating the dynamic time warping (DTW) distance between all the extracted subsequence pairs, and taking the smallest DTW distance among all the extracted subsequence pairs as the initial optimal value; the is a set of real numbers, n is the dimension;
[0111] S1.1: For all lengths L∈[L min ,L max ], initialize the vector that records the position of the frequent pattern. The specific process is: for all lengths L, initialize the value of fir_min[L] to 1, initialize the value of sec_min[L] to L max ;
[0112] S1.2: Use the DTW distance lower bound calculation method to calculate the length L of the time series data S min The lower bound of the DTW distance between all subsequence pairs is calculated based on the size of the DTW lower bound between the subsequence pairs, for each pair of length L min Subsequences are given priority, where the subsequence pair with a smaller DTW distance lower bound has a higher priority;
[0113] S2: Calculate the length interval [L min ,L max ] All lengths L are L minThe key value of the lower bound function corresponding to the frequent pattern, and according to the key value of the lower bound function, calculate each pair of length L min A subsequence whose length is L min Expanded to L min +1,L min +2,…,L max The corresponding DTW distance lower bound function offset upper limit The extension operation is to have a length of L min Subsequence pairs Expand to length L min +K subsequence The operation, where It is represented as the length of the i-th position in the time series data S as the starting point is L min subsequence of It is represented as the length L of the time series data S starting from the jth position min The DTW distance lower bound function is a distance function, hereinafter referred to as the lower bound function;
[0114] S2.1: Call the subsequence pair with the highest priority among the current candidates. The subsequence pair with the highest priority is recorded as
[0115] The candidates are subsequence pairs that have not yet been examined;
[0116] S3: According to the subsequence with the highest priority The length L of the corresponding frequent item is L min Expanded to L min +1,L min +2,…,L max Time subsequence pair The DTW distance between them is updated, and the vectors fir_min[L] and sec_min[L] of the frequent pattern positions with a record length of L are updated.
[0117] The specific method includes the following steps:
[0118] S3.1: Use the optimal lower bound calculation method to calculate the subsequence of frequent item length L Calculate and get the current length L subsequence The DTW distance lower bound is:
[0119] S3.1.1: Calculate the length L corresponding to the current candidate min The lower bound function of the frequent pattern and the candidate item with the current length L correspond to The difference between them is calculated, and the DTW distance of the current optimal frequent pattern is determined to be greater than or equal to the difference. If the condition is met, the update of the frequent pattern of the current length L is skipped and the process goes to S4. Otherwise, the process goes to S3.2.
[0120] S3.1.2: Compute the optimal lower bound of the frequent pattern of the current length L using the method that is determined to be the best possible lower bound based on prior information;
[0121] S3.2: Based on the optimal lower bound of the current frequent pattern of length L, the dynamic time warping method is used to obtain a frequent pattern of length L. The DTW distance of the frequent pattern of length L is compared with the DTW distance between the frequent patterns recorded by fir_min[L] and sec_min[L]. The specific method is as follows:
[0122]
[0123] If so, update the values of fir_min[L] and sec_min[L] to i and j respectively, and update the DTW distance of the frequent pattern with the current length L to the optimal value, where It is expressed as the DTW distance between the best frequent patterns obtained so far on a subsequence of length L+K, that is, the best value before the update;
[0124] S4: Determine whether all candidates have been checked and calculated. If so, enter S5. Otherwise, further determine whether the current result exceeds the set value. If it exceeds the set value, output the current result and enter S5. Otherwise, call the subsequence pair with the highest priority among the candidates and return to S3.
[0125] S5: Get the length interval [L min ,L max ]The vector fir_min and vector sec_min of the optimal frequent pattern positions of all lengths within .
[0126] When the time series data is input and the length interval is determined, the algorithm uses a heuristic method to arrange the order of candidates to be checked, that is, in the order of joining. The lower bound values are used to sort the candidates. The principle is that candidates with smaller lower bounds are more likely to become frequent patterns. Finally, an anytime algorithm for finding approximate solutions was proposed, which enables users with limited resources to obtain a feasible solution under limited resource conditions. The anytime algorithm will give priority to checking subsequences that may become frequent patterns.
[0127] This approach allows us to obtain an approximate result by only browsing a small fraction of all candidates. The remainder of the arbitrary time algorithm is somewhat similar to the batch algorithm, and will subsequently attempt to avoid the calculation of the lower bound. Since the frequent pattern of length L itself has a certain correlation with the frequent pattern of length L+1, we use the position of the frequent pattern of length L to initialize the best value so far for the length L+1 frequent pattern, so as to subsequently heuristically calculate the frequent pattern of length L+1. If the algorithm does not stop midway to output an approximate solution, when the program ends, the frequent pattern motifs of all lengths will also be stored.
[0128] This invention also conducted experiments on publicly available real-world datasets, achieving excellent results. The datasets used were HOUSE, Cricket, FEED, and EPG, with designed length intervals of [200, 400], [400, 600], and [600, 800]. The experiments were conducted using MATLAB on a server equipped with an Intel i7 CPU, 128GB of RAM, and the Windows 10 operating system. Ultimately, the experimental results show that this implementation achieves relatively satisfactory results after calculating only 5% of the candidates, and is 7.07 times faster than the baseline algorithm. All other steps are the same as in Specific Implementation 1.
[0129] Specific implementation method six: combination Figure 2 A method for mining full-length frequent patterns in time series data based on DTW distance in this embodiment is described: The key values of the lower bound function in S2 include: For a given frequent pattern length L and step size K:
[0130] Key Values It can be calculated using the following formula:
[0131]
[0132] Key Values It can be calculated using the following formula:
[0133]
[0134] Key Values It can be calculated using the following formula:
[0135]
[0136] Among them, when the length of the subsequence corresponding to the frequent item is L, represents a subsequence of length L starting from the i-th position in the sequence S, represents a subsequence of length L starting from the jth position in the sequence S, Represents a subsequence The tth element in Represents a subsequence The tth element in Represents a subsequence The tth element in the subsequence U=(u1,u2,…,u L ) and subsequence V=(v1,v2,…,v L ) is obtained from the time series data S according to LB Keogh Envelope generated by the method; Subsequence represents a subsequence of length L starting from the i-th position in the subsequence U. Subsequence represents a subsequence of length L starting from the i-th position in the subsequence V; Represents a subsequence The standard deviation of Represents a subsequence The standard deviation of Represents a subsequence The mean of Represents a subsequence The mean of , * indicates scalar multiplication.
[0137] Specific implementation method seven: combination Figure 2 The following describes a method for mining full-length frequent patterns of time series data based on DTW distance in this embodiment: The calculation formula is as follows
[0138] in, express The sequence from the 1st element to the Lth element is The sum of the squares of the differences between corresponding elements in the sequence is the square of the corresponding Euclidean distance. express The subsequence from the 1st element to the Lth element and The sum of squared differences between corresponding elements in the subsequence, express The subsequence from the 1st element to the Lth element and The sum of squared differences between corresponding elements in the subsequence; Subsequence represents a subsequence of length L starting from the i-th position in the subsequence U. Subsequence represents a subsequence of length L starting from the i-th position in the subsequence V;
[0139] Among them, the subsequence U=(u1,u2,…,u L ) and subsequence V=(v1,v2,…,vL ) is from the subsequence Generated envelope; subsequence U'=(u'1,u'2,…,u' L ), and subsequence V'=(v'1,v'2,…,v' L ) is from the subsequence The generated envelope, u t ∈(u1,…,u L ) represents the tth element in the subsequence U, v t ∈(v1,…,v L ) represents the tth element in the subsequence V, u' t ∈(u'1,u'2,…,u' L ) represents the tth element in the subsequence U', v' t ∈(v'1,v'2,…,v' L ) the tth element in the subsequence V';
[0140]
[0141] Where t∈{1,2,…,L}; Representation sequence The tth element in Representation sequence The tth element in LB Keogh It is a method for quickly calculating the lower bound of the dynamic time warping (DTW) distance, which speeds up the calculation process by defining a lower bound. In the lower bound calculation, it is used to determine the maximum possible offset of the lower bound calculated last time in this calculation. If the maximum offset is small enough, then we can speed up the frequent pattern calculation by reusing the result of the last DTW distance lower bound calculation. The other steps are the same as the second specific implementation method.
[0142] The other steps are the same as those in the sixth embodiment.
[0143] Specific implementation method eight: combination Figure 2 A method for mining full-length frequent patterns of time series data based on DTW distance in this embodiment is described: A method for mining full-length frequent patterns of time series data based on DTW distance in this embodiment is described:
[0144] S3.1.1 calculates the lower bound function of the frequent pattern of length L corresponding to the current candidate and the corresponding lower bound function when the current candidate length is L The difference between them is used to determine the DTW distance of the current optimal frequent pattern, i.e. Is it greater than or equal to this difference? Specifically expressed as:
[0145]
[0146] Among them, For subsequence The normalized form of LB KeoghD LB Keogh The downsampling variant of any sampling factor D is It is expressed as the DTW distance of the best frequent pattern obtained on a subsequence of length L + K. It is the best value before the update.
[0147] Using the lower bound function to offset the upper limit The calculation results and the use of LB Keogh The lower bound results obtained by computing or any downsampling variant are used to assist in computing the lower bound in the optimal frequent pattern corresponding to the current length L to reduce the computation time.
[0148] This embodiment can not only reuse LB Keogh The calculated lower bound can also utilize the variant of the result obtained by downsampling. Since a large amount of computing time is used in the calculation of the lower bound function, by reusing the previously obtained results, the computing cost can be greatly reduced and the efficiency of discovering full-length frequent patterns can be greatly improved. For those candidates who cannot reuse the results obtained by previous calculations to speed up the calculation speed, the present invention adopts the method of predicting the optimal lower bound, which also effectively avoids the large time loss caused by trying the lower bound function one after another. The other steps are the same as those in the specific implementation method seven.
[0149] Specific embodiment nine: This embodiment is a device for mining full-length frequent patterns of time series data, which includes a processor and a memory. It should be understood that it includes any device including a processor and a memory described in the present invention. The device may also include other units and modules that perform display, interaction, processing, control, and other functions through signals or instructions; at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement a method for mining full-length frequent patterns of time series data described in specific embodiments one to eight.
[0150] Specific embodiment ten: This embodiment is a computer storage medium, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement a method for mining full-length frequent patterns in time series data as described in specific embodiments one to eight. It should be understood that the instructions include computer program products, software or computerized methods corresponding to any method described in the present invention; the instructions can be used to program a computer system or other electronic device. The computer storage medium may include a readable medium on which instructions are stored, which may include but is not limited to a magnetic storage medium, an optical storage medium; the magneto-optical storage medium includes a read-only memory ROM, a random access memory RAM, an erasable programmable memory (for example, EPROM and EEPROM) and a flash memory layer, or other types of media suitable for storing electronic instructions.
[0151] The above only describes the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the above-mentioned specific implementation methods. Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical content disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent replacements and improvements made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A method for mining full-length frequent patterns in time series data based on DTW distance, characterized by: The batch processing of time series data S based on outdoor temperature includes the following steps: S1: Get time series data based on outdoor temperature s=(s1,s2,…,s n ), and determine the length interval of the frequent pattern specified by the user [L min ,L max ], using the STAMP algorithm to extract multiple subsequence pairs whose subsequence distance is not higher than the threshold under the Euclidean distance metric from the time series data S; calculate the dynamic time warping (DTW) distance between all the extracted subsequence pairs, and take the pair of subsequences with the smallest DTW distance among all the extracted subsequence pairs as the optimal value, and put them into fir_min[L min ] and sec_min[L min ]; where fir_min[L min ] and sec_min[L min ] are vectors that record the locations of frequent patterns; described is a set of real numbers, n is the dimension; The length interval L max ≤n;L min ≥1; S2: Calculate the length interval [L min ,L max ] All lengths L are L min The key value of the lower bound function corresponding to the frequent pattern, and according to the key value of the lower bound function, each pair of length L min The length of the subsequence is L min Expanded to L min +1,L min +2,…,L max When , the upper limit of the DTW distance lower bound function offset corresponding to each pair of subsequences after expansion is calculated. The extension operation will be of length L min Subsequence pairs Expand to length L min +K subsequence operation, where It is represented as the length of the i-th position in the time series data S as the starting point is L min subsequence of It is represented as the length L of the time series data S starting from the jth position min The DTW distance lower bound function is a distance function, hereinafter referred to as the lower bound function; S3: Calculate the length interval [L min ,L max ] corresponds to the optimal frequent patterns of all lengths within the calculation length interval [L min ,L max The optimal frequent pattern method corresponding to the length L in ] includes the following steps: S3.1: Calculate the length interval [L min ,L max ] is the optimal frequent pattern lower bound corresponding to the inner length L; First, all subsequence pairs of length L in the time series data S are regarded as candidates, and the set of candidate items is Θ. Then, the optimal lower bound calculation method is used to calculate each candidate item to obtain the optimal frequent pattern lower bound corresponding to the current length L; The optimal lower bound calculation method comprises the following steps: S3.1.1: Calculate the lower bound function of the frequent pattern of length L corresponding to the current candidate and the lower bound function of the frequent pattern of length L corresponding to the current candidate The difference between them and the DTW distance of the current optimal frequent pattern is determined Is it greater than or equal to this difference? If the condition is met, skip calculating the DTW distance lower bound of the current L-length candidate and discard the current candidate. If the condition is not met, retain it. After judging all candidates in the set Θ, go to S3.1.2; The current optimal frequent pattern is obtained within a length of L+K; and Represents the subsequence pair of the current optimal frequent pattern; S3.1.2: Let Θ' be the set of candidates that were not discarded in S3.1.
1. Calculate the DTW distance lower bound for all candidates in Θ' to obtain the optimal frequent pattern lower bound for the current length L. S3.2: Based on the lower bound of the optimal frequent pattern of the current length L, check all candidates using the dynamic time warping method to obtain the optimal frequent pattern of length L, and then update the optimal value based on the DTW distance of the optimal frequent pattern of length L; S3.3: Store the position of each subsequence in the L-optimal frequent pattern of length L in the vector fir_min and the [L] vector sec_min[L] respectively; S3.4: Determine the length interval [L min ,L max ] are all the optimal frequent patterns of lengths within the range [1] completed. If so, proceed to S4; otherwise, proceed to S3.
5. S3.5: Update the length L of the currently discovered frequent pattern to L+1. After the update is complete, return to S3.
1. S4: Get the length interval [L min ,L max ]The vector fir_min and vector sec_min of the optimal frequent pattern positions of all lengths within .
2. The method for mining full-length frequent patterns in time series data based on DTW distance according to claim 1, characterized in that: For a given frequent pattern length L and step size K, the key values of the lower bound function described in S2 include: Key Values It can be calculated using the following formula: Key Values It can be calculated using the following formula: Key Values It can be calculated using the following formula: Wherein, when the length of the subsequence pair is L, represents a subsequence of length L starting from the i-th position in the sequence S, represents a subsequence of length L starting from the jth position in the sequence S, Represents a subsequence The tth element in Represents a subsequence The tth element in Represents a subsequence The tth element in the subsequence U=(u1,u2,…,u L ) and subsequence V=(v1,v2,…,v L ) is obtained from the time series data S according to LB Keogh Envelope generated by the method; Subsequence represents a subsequence of length L starting from the i-th position in the subsequence U. Subsequence represents a subsequence of length L starting from the i-th position in the subsequence V; Represents a subsequence The standard deviation of Represents a subsequence The standard deviation of Represents a subsequence The mean of Represents a subsequence The mean of , * indicates scalar multiplication.
3. The method for mining full-length frequent patterns in time series data based on DTW distance according to claim 2, characterized in that: S2 calculates the length of each pair as L min The upper limit of the DTW distance lower bound function offset corresponding to the subsequence The calculation formula is as follows:
4. The method for mining full-length frequent patterns in time series data based on DTW distance according to claim 3, characterized in that: S3.1.1 calculates the lower bound function of the frequent pattern of length L corresponding to the current candidate and the corresponding lower bound function when the current candidate length is L The difference between them is used to determine the DTW distance of the current optimal frequent pattern, i.e. Is it greater than or equal to this difference? Specifically expressed as: Among them, For subsequence The normalized form of LB KeoghD LB Keogh The downsampling variant of any sampling factor D is It is expressed as the DTW distance of the optimal frequent pattern obtained on a subsequence of length L+K.
5. A method for mining full-length frequent patterns in time series data based on DTW distance, characterized by: The process for processing arbitrary time series data S based on outdoor temperature includes the following steps: S1: Get time series data based on outdoor temperature s=(s1,s2,…,s n ), and determine the length interval of the frequent pattern specified by the user [L min ,L max ], using the STAMP algorithm to extract multiple subsequence pairs whose subsequence distance is not higher than the threshold under the Euclidean distance metric from the time series data S; calculate the dynamic time warping (DTW) distance between all the extracted subsequence pairs, and take the pair of subsequences with the smallest DTW distance among all the extracted subsequence pairs as the optimal value, and put them into fir_min[L min ] and sec_min[L min ];fir_min[L min ] and sec_min[L min ] are vectors that record the locations of frequent patterns; described is a set of real numbers, n is the dimension; The length interval L max ≤n;L min ≥1; S1.1: For all lengths L∈[L min ,L max ], initialize the vector that records the position of the frequent pattern. The specific process is: for all lengths L, initialize the value of fir_min[L] to 1, initialize the value of sec_min[L] to L max ; S1.2: Use the DTW distance lower bound calculation method to calculate the length L of the time series data S min The lower bound of the DTW distance between all subsequence pairs is calculated based on the size of the DTW lower bound between the subsequence pairs, for each pair of length L min Subsequences are given priority, where the subsequence pair with a smaller DTW distance lower bound has a higher priority; S2: Calculate the length interval [L min ,L max ] All lengths L are L min The key value of the lower bound function corresponding to the frequent pattern, and according to the key value of the lower bound function, each pair of length L min The length of the subsequence is L min Expanded to L min +1,L min +2,…,L max When , the upper limit of the DTW distance lower bound function offset corresponding to each pair of subsequences after expansion is calculated. The extension operation will be of length L min Subsequence pairs Expand to length L min +K subsequence operation, where It is represented as the length of the i-th position in the time series data S as the starting point is L min subsequence of It is represented as the length L of the time series data S starting from the jth position min The DTW distance lower bound function is a distance function, hereinafter referred to as the lower bound function; S2.1: Call the subsequence pair with the highest priority among the current candidates. The subsequence pair with the highest priority is recorded as The candidates are subsequence pairs that have not yet been examined; S3: According to the subsequence with the highest priority The corresponding length L is L min Expanded to L min +1,L min +2,…,L max Time subsequence pair The DTW distance between them is used to update the vectors fir_min[L] and sec_min[L] of the frequent pattern positions with a record length of L; The specific method includes the following steps: S3.1: Use the optimal lower bound calculation method to calculate the subsequence of length L Calculate and get the current length L subsequence The DTW distance lower bound is: S3.1.1: Calculate the lower bound function of the frequent pattern of length L corresponding to the current candidate and the lower bound function of the frequent pattern of length L corresponding to the current candidate The difference between them and the DTW distance of the current optimal frequent pattern is determined Is it greater than or equal to this difference? If the condition is met, skip calculating the update of the frequent pattern of the current length L and go to S4, otherwise go to S3.2; S3.1.2: Calculate the optimal frequent pattern lower bound of the current length L; S3.2: Based on the obtained lower bound of the optimal frequent pattern of the current length L, the dynamic time warping method is used to obtain a frequent pattern of length L. The DTW distance of the current frequent pattern of length L is compared with the DTW distance between the current optimal frequent pattern recorded by fir_min[L] and sec_min[L]. The specific method is as follows: If so, update the values of fir_min[L] and sec_min[L] to i and j respectively, that is, update the optimal value of the DTW distance of the frequent pattern with the current length L, where It is expressed as the DTW distance between the best frequent patterns obtained on a subsequence of length L+K; S4: Determine whether all candidates have been checked and calculated. If so, proceed to S5. Otherwise, further determine whether the current result exceeds the set value. If so, output the current result and proceed to S5. Otherwise, call the subsequence pair with the highest priority among the candidates and return to S3. S5: Get the length interval [L min ,L max ]The vector fir_min and vector sec_min of the optimal frequent pattern positions of all lengths within .
6. The method for mining full-length frequent patterns in time series data based on DTW distance according to claim 5, characterized in that: For a given frequent pattern length L and step size K, the key values of the lower bound function described in S2 include: Key Values It can be calculated using the following formula: Key Values It can be calculated using the following formula: Key Values It can be calculated using the following formula: Among them, when the length of the subsequence corresponding to the frequent item is L, represents a subsequence of length L starting from the i-th position in the sequence S, represents a subsequence of length L starting from the jth position in the sequence S, Represents a subsequence The tth element in Represents a subsequence The tth element in Represents a subsequence The tth element in the subsequence U=(u1,u2,…,u L ) and subsequence V=(v1,v2,…,v L ) is obtained from the time series data S according to LB Keogh Envelope generated by the method; Subsequence represents a subsequence of length L starting from the i-th position in the subsequence U. Subsequence represents a subsequence of length L starting from the i-th position in the subsequence V; Represents a subsequence The standard deviation of Represents a subsequence The standard deviation of Represents a subsequence The mean of Represents a subsequence The mean of , * indicates scalar multiplication.
7. The method for mining full-length frequent patterns in time series data based on DTW distance according to claim 6, characterized in that: The upper limit of the DTW distance lower bound function offset corresponding to each pair of subsequences after S2 expansion The calculation formula is as follows:
8. The method for mining full-length frequent patterns in time series data based on DTW distance according to claim 7, characterized in that: S3.1.1 The lower bound function of the frequent pattern with a length of L and the corresponding frequent item with a length of L The difference between them and the DTW distance of the current optimal frequent pattern is determined Whether it is greater than or equal to this difference is specifically expressed as: in For subsequence The normalized form of LB KeoghD LB Keogh The downsampling variant of any sampling factor D is represents the DTW distance between the best frequent patterns obtained on a subsequence of length L+K.
9. A device for mining full-length frequent patterns of time series data based on DTW distance, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a method for mining full-length frequent patterns of time series data based on DTW distance as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the full-length frequent pattern mining method of time series data based on DTW distance as described in any one of claims 1 to 8.
Citation Information
Patent Citations
An uncertain data classification method based on direct discriminant sequence mining
CN109447138A
Hydrological time sequence motif mining method based on numerical feature clustering
CN114647679A