A time series similarity determination method, device and electronic equipment
By decomposing the time series to extract seasonal, trend, and residual component sequences, and calculating the similarity of each component category, the problem of insufficient similarity accuracy in existing technologies is solved, and more accurate time series similarity determination is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, time series similarity determination methods rely on the similarity of overall numerical values, resulting in low similarity accuracy.
By decomposing the time series, seasonal, trend and residual component sequences are extracted, the similarity of each component category is calculated, and the overall similarity between time series is determined based on the component similarity.
It enables a more accurate measurement of the similarity between time series from an information perspective, improving the accuracy of similarity determination.
Smart Images

Figure CN115934805B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data mining technology, and in particular to a method, apparatus and electronic device for determining time series similarity. Background Technology
[0002] A time series is a set of data arranged in chronological order, such as the average monthly temperature data for a year: {-2, 10, 15, ..., 12, 5, -5}. Time series are widely used in fields such as finance, transportation, and power energy.
[0003] Measuring the similarity between time series is a fundamental function in time series applications, playing a crucial supporting role in time series classification, pattern mining, and other applications. Related technologies often measure the similarity between time series by the overall numerical similarity of the time series data.
[0004] Since the similarity of the overall values can only reflect the changes in the numerical dimension of the time series, using the similarity of the overall values for similarity measurement is rather one-sided, resulting in low accuracy of the final similarity determination. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, and electronic device for determining time series similarity, which can improve the accuracy of time series similarity determination. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide a method for determining time series similarity, the method comprising:
[0007] Obtain the first and second time series whose similarity needs to be determined;
[0008] Component sequences of at least one component category are extracted from the first time series and the second time series respectively to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series; the at least one component category includes at least one of the following: seasonal component category, trend component category and residual component category;
[0009] For each component category in the at least one component category, the component similarity between the first component sequence belonging to that component category and the second component sequence belonging to that component category is determined as the component similarity corresponding to that component category;
[0010] The similarity between the first time series and the second time series is determined based on the component similarity corresponding to each component category in the at least one component category.
[0011] Optionally, the at least one component category includes a seasonal component category; the first component sequence belonging to the seasonal component category is a first seasonal sequence; the second component sequence belonging to the seasonal component category is a second seasonal sequence.
[0012] Determining the component similarity between a first component sequence belonging to the component category and a second component sequence belonging to the component category includes:
[0013] Determine the periodic time segment in which the extreme values belonging to at least one extreme value type in the first seasonal sequence and the second seasonal sequence are located, and use it as the extreme value time segment corresponding to the at least one extreme value type;
[0014] For each of the at least one extreme value types, based on the sequence values of the first seasonal sequence and the second seasonal sequence located in the extreme value time period corresponding to the extreme value type, the extreme value feature values of the first seasonal sequence and the second seasonal sequence in each extreme value time period corresponding to the extreme value type are determined; the difference information between the extreme value feature values of the first seasonal sequence and the second seasonal sequence in each extreme value time period corresponding to the extreme value type is determined as the difference information of each extreme value time period corresponding to the extreme value type; based on the difference information of each extreme value time period corresponding to the extreme value type, the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type is determined;
[0015] Based on the overall difference information between the first seasonal sequence and the second seasonal sequence regarding each of the at least one extreme value type, the component similarity between the first seasonal sequence and the second seasonal sequence is determined.
[0016] Optionally, determining the extreme value feature value of the first seasonal sequence and the second positive sequence for each extreme time period corresponding to the extreme value type based on the sequence values of the first seasonal sequence and the second seasonal sequence within the extreme time period corresponding to the extreme value type includes:
[0017] For each extreme time period corresponding to the extreme value type, the sequence values of the first seasonal sequence and the second seasonal sequence that are located at a specified fractional position in each sequence value of the extreme time period are determined as the extreme value feature values of the first seasonal sequence and the second positive sequence in the extreme time period.
[0018] Optionally, determining the difference information between the extreme value feature values of the first seasonal sequence and the second seasonal sequence within each extreme value time period corresponding to the extreme value type, as the difference information for each extreme value time period corresponding to the extreme value type, includes:
[0019] For each extreme time period corresponding to the extreme value type, the difference or divergence value between the extreme value feature value of the first seasonal sequence and the extreme value feature value of the second seasonal sequence in the extreme time period is calculated as the difference information of the extreme time period.
[0020] Optionally, before determining the overall difference information between the first seasonal sequence and the second seasonal sequence regarding the extreme value type based on the difference information of each extreme value time period corresponding to the extreme value type, the method further includes:
[0021] Determine the probability that the first seasonal sequence will have an extreme value of that extreme value type in each extreme value time period corresponding to that extreme value type, and use it as the first weight of each extreme value time period corresponding to that extreme value type.
[0022] Determine the probability that the second seasonal sequence will have an extreme value of that extreme value type in each extreme value time period corresponding to that extreme value type, and use it as the second weight for each extreme value time period corresponding to that extreme value type.
[0023] The step of determining the overall difference information between the first seasonal sequence and the second seasonal sequence regarding the extreme value type based on the difference information of each extreme value time period corresponding to the extreme value type includes:
[0024] Based on the first and second weights of each extreme time period corresponding to the extreme value type, the difference information of each extreme time period corresponding to the extreme value type is weighted to obtain the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type.
[0025] Optionally, determining the component similarity between the first seasonal sequence and the second seasonal sequence based on the overall difference information between the first seasonal sequence and the second seasonal sequence regarding each of the at least one extreme value type includes:
[0026] Calculate the mean of the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to each of the at least one extreme value type, and use it as the average difference information;
[0027] Based on the average difference information, the component similarity between the first seasonal sequence and the second seasonal sequence is determined.
[0028] Optionally, the at least one component category includes a trend component category; a first component sequence belonging to the trend component category is a first trend sequence; and a second component sequence belonging to the trend component category is a second trend sequence.
[0029] The determination of the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category, as the component similarity corresponding to the component category, includes:
[0030] Determine the sequence value distance between each sequence value in the first trend sequence and the second trend sequence;
[0031] Based on the sequence value distance, the component similarity corresponding to the trend component category is determined.
[0032] Optionally, determining the sequence value distance between each sequence value in the first trend sequence and the second trend sequence includes:
[0033] For each sequence value in the first trend sequence, determine the numerical difference between that sequence value and each sequence value in the second trend sequence;
[0034] Based on the determined differences, construct a numerical difference matrix between the sequence values in the first trend sequence and the second trend sequence;
[0035] The diagonal path with the smallest sum of numerical differences among the diagonal paths of the numerical difference matrix is determined as the target diagonal path; wherein, the diagonal path is the path connecting the numerical difference at the top left corner of the numerical difference matrix to the numerical difference at the bottom right corner.
[0036] The sum of the differences between the values in the target diagonal path is taken as the sequence value distance between the sequence values in the first trend sequence and the second trend sequence.
[0037] Optionally, determining the component similarity corresponding to the trend component category based on the sequence value distance includes:
[0038] Calculate the ratio of the sequence value distance to the regularization factor to obtain the distance adjustment value;
[0039] Calculate the difference between the specified value and the distance adjustment value, and use it as the component similarity corresponding to the trend component category.
[0040] Optionally, the at least one component category includes a residual term component category; a first component sequence belonging to the residual term component category is a first residual term sequence; and a second component sequence belonging to the residual term component category is a second residual term sequence.
[0041] The step of determining the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category includes:
[0042] For each sequence value distribution interval in the preset sequence value distribution interval, the distribution probability of each sequence value in the first residual term sequence and the second residual term sequence in that sequence value distribution interval is determined respectively;
[0043] Determine the difference information between the probability distributions of each sequence value in the first residual term sequence and the second residual term sequence, within the distribution interval of each sequence value;
[0044] Based on the determined difference information, the component similarity between the first residual term sequence and the second residual term sequence is determined.
[0045] Optionally, determining the difference information between the probability distributions of each sequence value in the first residual term sequence and the second residual term sequence within the distribution interval of each sequence value includes:
[0046] Based on the distribution probability of the first residual term sequence in each sequence value distribution interval, a first distribution probability sequence is constructed;
[0047] Based on the distribution probability of the second residual term sequence in each sequence value distribution interval, a second distribution probability sequence is constructed;
[0048] Calculate the divergence value between the first probability distribution sequence and the second probability distribution sequence, as the difference information between the probability distributions of each sequence value in the first residual term sequence and the second residual term sequence within the distribution interval of each sequence value.
[0049] Optionally, the at least one component category includes: a seasonal component category, a trend component category, and a residual component category;
[0050] Determining the similarity between the first time series and the second time series based on the component similarity corresponding to each component category in the at least one component category includes:
[0051] Obtain the trend weights corresponding to the trend component categories, the seasonal weights corresponding to the seasonal component categories, and the residual weights corresponding to the residual component categories;
[0052] Based on the trend weight, the trend weight, and the residual weight, the component similarity corresponding to the trend component category, the component similarity corresponding to the seasonal component category, and the component similarity corresponding to the residual component category are weighted and summed to obtain the similarity between the first time series and the second time series.
[0053] Optionally, obtaining the trend weights corresponding to the trend component category, the seasonal weights corresponding to the seasonal component category, and the residual weights corresponding to the residual component category includes:
[0054] Variance perturbation analysis is performed on the first component sequence belonging to the seasonal component category, the first component sequence belonging to the trend component category, and the first component sequence belonging to the residual component category, respectively, to obtain the first seasonal variance value of the seasonal component category, the first trend variance value of the trend component category, and the first residual variance value of the residual component category.
[0055] The first seasonal variance, the first trend variance, and the first residual variance are normalized to obtain the first seasonal weight of the seasonal component category, the first trend weight of the trend component category, and the first residual weight of the residual component category.
[0056] Variance perturbation analysis is performed on the second component sequence belonging to the seasonal component category, the second component sequence belonging to the trend component category, and the second component sequence belonging to the residual component category, respectively, to obtain the second seasonal variance value of the seasonal component category, the second trend variance value of the trend component category, and the second residual variance value of the residual component category;
[0057] The second seasonal variance, the second trend variance, and the second residual variance are normalized to obtain the second seasonal weight of the seasonal component category, the second trend weight of the trend component category, and the second residual weight of the residual component category.
[0058] Based on the first seasonal weight and the second seasonal weight, the seasonal weight corresponding to the seasonal component category is determined;
[0059] Based on the first trend weight and the second trend weight, determine the trend weight corresponding to the trend component category;
[0060] Based on the first residual weight and the second residual weight, the residual item weight corresponding to the residual item component category is determined.
[0061] Optionally, the first seasonal variance value of the seasonal component category, the first trend variance value of the trend component category, and the first residual variance value of the residual component category are determined using the following formulas, wherein:
[0062]
[0063]
[0064]
[0065] in, The first seasonal variance value for the seasonal component category. The first trend variance value for the trend component category. S is the first residual variance value of the residual component category. 1 T is the first component sequence belonging to the seasonal component category. 1 R is the first component sequence belonging to the trend component category. 1 It is the first component sequence belonging to the category of residual component;
[0066] The first seasonal weight of the seasonal component category, the first trend weight of the trend component category, and the first residual weight of the residual component category are determined as follows, wherein:
[0067]
[0068]
[0069]
[0070] in, The first seasonal weight for the seasonal component category, The first trend weight for the trend component category, The first residual weight is the component category of the residual item.
[0071] Secondly, embodiments of this application provide a time series similarity determination apparatus, the apparatus comprising:
[0072] The sequence acquisition module is used to acquire the first and second time series whose similarity needs to be determined.
[0073] The component extraction module is used to extract component sequences of at least one component category from the first time series and the second time series respectively, to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series; the at least one component category includes at least one of the following: seasonal component category, trend component category and residual component category;
[0074] The first similarity determination module is used to determine, for each component category in the at least one component category, the component similarity between a first component sequence belonging to that component category and a second component sequence belonging to that component category, as the component similarity corresponding to that component category;
[0075] The second similarity determination module is used to determine the similarity between the first time series and the second time series based on the component similarity corresponding to each component category in the at least one component category.
[0076] Thirdly, embodiments of this application provide an electronic device, including:
[0077] Memory, used to store computer programs;
[0078] A processor, when executing a program stored in memory, implements any of the methods described in the first aspect.
[0079] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods described in the first aspect.
[0080] Beneficial effects of the embodiments in this application:
[0081] In a time series similarity determination method provided in this application embodiment, a first time series and a second time series whose similarity needs to be determined can be obtained. Component sequences of at least one component category are extracted from the first and second time series respectively to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series. The at least one component category includes at least one of: seasonal component category, trend component category, and residual term component category. For each component category, the component similarity between the first component sequence belonging to that component category and the second component sequence belonging to that component category is determined as the component similarity corresponding to that component category. Based on the component similarity corresponding to each component category, the similarity between the first and second time series is determined. Since at least one component category is extracted from the time series, and the component categories of the time series are essentially a decomposition of the time series from an information perspective, the extracted component sequences can well reflect the changes in the information dimension of the time series. Therefore, by determining the component similarity between the component sequences, the similarity between the time series is determined, realizing a measurement of the similarity between time series from an information perspective, thereby enabling a more accurate determination of the similarity between time series.
[0082] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0083] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0084] Figure 1 A flowchart illustrating a time series similarity determination method provided in an embodiment of this application;
[0085] Figure 2 Another flowchart of a time series similarity determination method provided in an embodiment of this application;
[0086] Figure 3 Another flowchart of a time series similarity determination method provided in an embodiment of this application;
[0087] Figure 4 Another flowchart of a time series similarity determination method provided in an embodiment of this application;
[0088] Figure 5 Another flowchart of a time series similarity determination method provided in an embodiment of this application;
[0089] Figure 6 This is a schematic diagram of the structure of a time series similarity determination device provided in an embodiment of this application;
[0090] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0091] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0092] To improve the accuracy of time series similarity determination, embodiments of this application provide a time series similarity determination method, apparatus, and electronic device.
[0093] It should be noted that, in specific applications, the embodiments of this application can be applied to various electronic devices, such as personal computers, servers, mobile phones, and other devices with data processing capabilities. Furthermore, the time series similarity determination method provided in the embodiments of this application can be implemented through software, hardware, or a combination of both.
[0094] The time series similarity determination method provided in this application embodiment may include:
[0095] Obtain the first and second time series whose similarity needs to be determined;
[0096] Component sequences of at least one component category are extracted from the first time series and the second time series respectively to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series; the at least one component category includes at least one of the following: seasonal component category, trend component category and residual component category;
[0097] For each component category in at least one component category, determine the component similarity between the first component sequence belonging to that component category and the second component sequence belonging to that component category, and use it as the component similarity corresponding to that component category;
[0098] The similarity between the first time series and the second time series is determined based on the component similarity corresponding to each component category in at least one component category.
[0099] In the above-described scheme of this application embodiment, since at least one component category is extracted from the time series, and the component category of the time series is essentially a decomposition of the time series from an information perspective, the extracted component sequence can well reflect the changes in the information dimension of the time series. Then, the similarity between time series is determined by determining the component similarity between the component sequences, thus realizing the measurement of the similarity between time series from an information perspective, thereby more accurately determining the similarity between time series.
[0100] The following will describe in detail, with reference to the accompanying drawings, a method for determining time series similarity provided in the embodiments of this application.
[0101] like Figure 1 As shown, this application provides a method for determining time series similarity, including steps S101-S104, wherein:
[0102] S101, Obtain the first and second time series whose similarity needs to be determined;
[0103] The first and second time series can be any type of time series, such as financial time series, meteorological time series, socio-economic time series, traffic flow data, local temperature data, subway station passenger flow data, stock market opening data, etc.
[0104] S102, extract component sequences of at least one component category from the first time series and the second time series respectively to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series;
[0105] The component category includes at least one of the following: a seasonal component category, a trend component category, and a residual component category. The component sequences of the seasonal component category primarily reflect the periodic changes in the time series, such as sequences that change according to seasonal cycles like days, weeks, or months. The component sequences of the trend component category primarily reflect the trend changes in the time series, such as sequences showing continuous growth or continuous decline. The component sequences of the residual component category are sequences composed of values that change in the time series due to additional factors, and can be obtained by directly subtracting the component sequences of the seasonal and trend component categories from the time series.
[0106] Optionally, a robust time series data decomposition algorithm can be used to decompose the first time series to obtain the first trend component sequence of the trend component category, the first seasonal component sequence of the seasonal component category, and the first residual component sequence of the residual component category.
[0107] Robust time series decomposition algorithms are typically used to extract trend and seasonal components from a time series while ignoring noise and outliers (residual components). They can be used to analyze various types of time series, including financial, meteorological, and socioeconomic data.
[0108] Similarly, a robust time series data decomposition algorithm can be used to decompose the second time series to obtain the second trend component sequence of the trend component category, the second seasonal component sequence of the seasonal component category, and the second residual component sequence of the residual component category.
[0109] For example, the first time series is TS 1 The second time series is TS 2 Then, robust time series data decomposition algorithms can be used to decompose the TS data separately. 1 and TS 2 Decomposition yields:
[0110] TS 1 =T 1 +S 1 +R 1
[0111] TS 2 =T 2+S 2 +R 2
[0112] Or, we get:
[0113] TS 1 =T 1 ×S 1 ×R 1
[0114] TS 2 =T 2 ×S 2 ×R 2
[0115] Among them, T 1 For the first trending component sequence, S 1 For the first seasonal component sequence, R 1 For the first residual term component sequence, T 2 For the second trend component sequence, S 2 For the second seasonal component sequence, R 2 This is the sequence of components for the second residual term.
[0116] The first component sequence mentioned above includes at least one of a first trend component sequence, a first seasonal component sequence, and a first residual component sequence. Similarly, the second component sequence mentioned above includes at least one of a second trend component sequence, a second seasonal component sequence, and a second residual component sequence.
[0117] In the embodiments of this application, after decomposing the first time series and the second time series, only one or two component categories from the obtained component categories can be selected as the component categories for subsequent applications. For example, only the trend component category can be selected, or only the seasonal component category can be selected, or only the trend component category and the seasonal component category can be selected. In one implementation, in order to more comprehensively compare the similarity between the first time series and the second time series, the seasonal component category, the trend component category, and the residual component category can all be used as the component categories for subsequent applications.
[0118] S103, for each component category in at least one component category, determine the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category, and use it as the component similarity corresponding to the component category;
[0119] The aforementioned at least one component category includes at least one of the following: seasonal component category, trend component category, and residual component category. Therefore, for each component category, the component similarity between the first component sequence belonging to that component category and the second component sequence belonging to that component category can be determined as the component similarity corresponding to that component category.
[0120] In one implementation, when at least one component category includes a seasonal component category, the component similarity between a first component sequence belonging to the seasonal component category and a second component sequence belonging to the seasonal component category can be determined as the component similarity corresponding to the seasonal component category.
[0121] In one implementation, when at least one component category includes a trend component category, the component similarity between a first component sequence belonging to the trend component category and a second component sequence belonging to the trend component category can be determined as the component similarity corresponding to the trend component category.
[0122] In one implementation, when at least one component category includes a residual component category, the component similarity between the first component sequence belonging to the residual component category and the second component sequence belonging to the residual component category can be determined as the component similarity corresponding to the residual component category.
[0123] The specific determination process will be described in detail in subsequent embodiments, and will not be repeated here in the embodiments of this application.
[0124] S104, Based on the component similarity corresponding to each component category in at least one component category, determine the similarity between the first time series and the second time series.
[0125] If at least one component category includes only a single component category, such as a trend component category, a seasonal component category, or a residual component category, then the component similarity corresponding to that component category can be directly used as the similarity between the first time series and the second time series.
[0126] In one implementation, at least one component category may simultaneously include a seasonal component category, a trend component category, and a residual component category.
[0127] In this scenario, one approach is to sum the component similarities corresponding to each component category to obtain the similarity between the first and second time series. Alternatively, a weighted sum of the component similarities corresponding to each component category can be performed to obtain the similarity between the first and second time series. In this case, the trend weights corresponding to trend component categories, the seasonal weights corresponding to seasonal component categories, and the residual weights corresponding to residual component categories can be obtained. Then, based on these trend weights, the component similarities corresponding to trend component categories, seasonal component categories, and residual component categories are weighted and summed to obtain the similarity between the first and second time series.
[0128] In one implementation, the trend weights corresponding to the trend component category, the seasonal weights corresponding to the seasonal component category, and the residual weights corresponding to the residual component category can be pre-specified. Alternatively, the trend weights corresponding to the trend component category, the seasonal weights corresponding to the seasonal component category, and the residual weights corresponding to the residual component category can be determined in real time, thereby obtaining adaptive weights and achieving adaptive fusion of the similarity corresponding to the three component categories.
[0129] At this point, obtaining the trend weights corresponding to the trend component categories, the seasonal weights corresponding to the seasonal component categories, and the residual weights corresponding to the residual component categories can include steps a1-a7, wherein:
[0130] Step a1: Perform variance perturbation analysis on the first component sequence belonging to the seasonal component category, the first component sequence belonging to the trend component category, and the first component sequence belonging to the residual component category, respectively, to obtain the first seasonal variance value of the seasonal component category, the first trend variance value of the trend component category, and the first residual variance value of the residual component category.
[0131] Optionally, the following formula can be used to perform variance perturbation analysis on the first component series belonging to the seasonal component category, the first component series belonging to the trend component category, and the first component series belonging to the residual component category, respectively, where:
[0132]
[0133]
[0134]
[0135] in, This represents the variance of the first trend. This represents the variance for the first season. The first residual variance value is represented by Var, where Var indicates the variance calculation.
[0136] Step a2: Normalize the first seasonal variance, the first trend variance, and the first residual variance to obtain the first seasonal weight of the seasonal component category, the first trend weight of the trend component category, and the first residual weight of the residual component category.
[0137] Optionally, the variance values of the first season, the first trend, and the first residual can be normalized using the following formulas:
[0138]
[0139]
[0140]
[0141] in, The first trend weight, Weighting for the first quarter, Let be the variance of the first residual.
[0142] Step a3: Perform variance perturbation analysis on the second component sequence belonging to the seasonal component category, the second component sequence belonging to the trend component category, and the second component sequence belonging to the residual component category, respectively, to obtain the second seasonal variance value of the seasonal component category, the second trend variance value of the trend component category, and the second residual variance value of the residual component category.
[0143] Optionally, the following formula can be used to perform variance perturbation analysis on the second component series belonging to the seasonal component category, the second component series belonging to the trend component category, and the second component series belonging to the residual component category, respectively, where:
[0144]
[0145]
[0146]
[0147] in, This represents the variance of the second trend. This represents the variance for the second season. This is the variance of the second residual.
[0148] Step a4: Normalize the second seasonal variance, the second trend variance, and the second residual variance to obtain the second seasonal weights of the seasonal component category, the second trend weights of the trend component category, and the second residual weights of the residual component category.
[0149] Optionally, the variance values of the second season, the second trend, and the second residuals can be normalized using the following formulas:
[0150]
[0151]
[0152]
[0153] in, As the second trend weight, For the second quarter weighting, Let be the variance of the second residual.
[0154] Step a5: Based on the first season weight and the second season weight, determine the seasonal weight corresponding to the seasonal component category; optionally, the seasonal weight corresponding to the seasonal component category can be determined using the following formula, including:
[0155]
[0156] Among them, W S Seasonal weighting.
[0157] Step a6: Based on the first trend weight and the second trend weight, determine the trend weight corresponding to the trend component category; optionally, the seasonal weight corresponding to the seasonal component category can be determined using the following formula, including:
[0158]
[0159] Among them, W T This is a trend-based weight.
[0160] Step a7: Determine the residual item weights corresponding to the residual item component categories based on the first residual weight and the second residual weight.
[0161] Optionally, the residual term weights corresponding to the residual term component categories can be determined using the following formulas, including:
[0162]
[0163] Among them, W R The weights are the residual terms.
[0164] In the above-described scheme of this application embodiment, since at least one component category is extracted from the time series, and the component category of the time series is essentially a decomposition of the time series from an information perspective, the extracted component sequence can well reflect the changes in the information dimension of the time series. Then, the similarity between time series is determined by determining the component similarity between the component sequences, thus realizing the measurement of the similarity between time series from an information perspective, thereby more accurately determining the similarity between time series.
[0165] In one embodiment, the at least one component category includes a seasonal component category; the first component sequence belonging to the seasonal component category is a first seasonal sequence; the second component sequence belonging to the seasonal component category is a second seasonal sequence.
[0166] In this case, based on Figure 1 Examples, such as Figure 2 As shown, another embodiment of this application provides a time series similarity determination method, wherein the above-mentioned S103 may include steps S201-S203:
[0167] S201, determine the periodic time segment in which the extreme value belonging to at least one extreme value type in the first seasonal sequence and the second seasonal sequence is located, and use it as the extreme value time segment corresponding to the at least one extreme value type;
[0168] Among them, seasonal sequences have seasonal cycles, and the cycle time period is the smallest time period within each seasonal cycle. For example, if the seasonal cycle of a seasonal sequence is weekly, then the cycle time period can be daily. Or, if the seasonal cycle is daily, then the cycle time period can be hourly.
[0169] For example, if the first time series and / or the second time series are intersection traffic flows counted hourly, then the seasonal period of the seasonal series of the first time series and / or the second time series is daily. Simply put, the intersection traffic flow changes periodically every day, and the period is every hour.
[0170] The aforementioned extreme value types include at least one of a maximum value type and a minimum value type, wherein the extreme value corresponding to the maximum value type is a maximum value, and the extreme value corresponding to the minimum value type is a minimum value. In this case, the extreme value time period corresponding to the aforementioned at least one extreme value type includes the extreme value time period corresponding to the maximum value type and / or the extreme value time period corresponding to the minimum value type.
[0171] To improve the efficiency of identifying extreme time periods, the first and second time series can be preprocessed. Optionally, the first and second time series can be compressed based on extreme values, such as compression based on maxima and / or compression based on minima.
[0172] The following section uses the first time series as an example to briefly introduce the process of compression based on maxima. The compression process based on minima is basically the same, only the determined values are different. Therefore, you can refer to the process of compression based on maxima.
[0173] Let the first time series be S1. Then the maximum values of each sequence value in the first time series can be determined. For example, if the first time series S1 is {-2,10,7,12,5,-5}, where the maximum values are 10 and 12, then the first time series after maximum compression is {10,12}.
[0174] After identifying at least one extreme value of an extreme value type in the first and second time series, the periodic time interval containing that extreme value can be defined as the extreme value period. Taking the above example as an illustration, if the identified maximum values are 10 and 12, then the periodic time interval containing the maximum values 10 and 12 will be defined as the extreme value period.
[0175] To give another example, the daily traffic flow at a certain intersection was statistically analyzed, and the seasonal series of the daily traffic flow time series is shown in Table 1 below:
[0176] Table 1
[0177] on Monday Tuesday Wednesday Thursday Friday Saturday Sunday 20 15 7 10 9 12 14 18 12 9 11 12 8 14 20 15 7 10 8 12 11
[0178] The first row, from Monday to Sunday, represents the periodic time of the seasonal sequence. By determining the maximum value in Table 1, we obtain Table 2:
[0179] Table 2
[0180] on Monday Tuesday Wednesday Thursday Friday Saturday Sunday 20 10 18 12 20 10 12
[0181] The extreme value type corresponds to the extreme value time periods of Monday, Thursday, Friday, and Saturday.
[0182] S202, for each of the at least one extreme value types, based on the sequence values of the first seasonal sequence and the second seasonal sequence located in the extreme value time period corresponding to the extreme value type, determine the extreme value feature value of the first seasonal sequence and the second seasonal sequence in each extreme value time period corresponding to the extreme value type; determine the difference information between the extreme value feature values of the first seasonal sequence and the second seasonal sequence in each extreme value time period corresponding to the extreme value type, as the difference information of each extreme value time period corresponding to the extreme value type; based on the difference information of each extreme value time period corresponding to the extreme value type, determine the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type;
[0183] After determining the extreme time period corresponding to at least one extreme value type, the extreme value feature value of the first seasonal sequence and the second seasonal sequence in each extreme time period corresponding to the extreme value type can be determined based on the sequence values of the first seasonal sequence in each extreme time period corresponding to the extreme value type. In simple terms, the extreme value feature value of the first seasonal sequence in each extreme time period corresponding to the extreme value type can be determined based on the sequence values of the first seasonal sequence in each extreme time period corresponding to the extreme value type, and the extreme value feature value of the second seasonal sequence in each extreme time period corresponding to the extreme value type can be determined based on the sequence values of the second seasonal sequence in each extreme time period corresponding to the extreme value type.
[0184] Taking Table 1 above as an example of the first seasonal series, the explanation follows the same logic for the second seasonal series, and will not be elaborated further here. The extreme value types correspond to the extreme value periods of Monday, Thursday, Friday, and Saturday. Therefore, based on the sequence values located on Monday, Thursday, Friday, and Saturday, the extreme value characteristic values for Monday, Thursday, Friday, and Saturday are determined respectively. Taking Monday as an example, the sequence values located on Monday are 20, 18, and 20, so the extreme value characteristic value for Monday can be determined based on 20, 18, and 20.
[0185] In one implementation, for each extreme time period corresponding to the extreme value type, the sequence values of the first seasonal sequence and the second seasonal sequence located at a specified fractional position within each sequence value of that extreme time period can be determined as the extreme value feature values of the first seasonal sequence and the second seasonal sequence within that extreme time period. In simpler terms, for each extreme time period corresponding to the extreme value type, the sequence value of the first seasonal sequence located at a specified fractional position within each sequence value of that extreme time period can be determined as the extreme value feature value of the first seasonal sequence within that extreme time period; and for each extreme time period corresponding to the extreme value type, the sequence value of the second seasonal sequence located at a specified fractional position within each sequence value of that extreme time period can be determined as the extreme value feature value of the second seasonal sequence within that extreme time period.
[0186] The specified fractional place can be determined according to the requirements, such as 75%, or it can be the maximum value, minimum value, average value, etc.
[0187] Taking the first seasonal series as an example, the second seasonal series can be explained in the same way, and will not be repeated here. Continuing with the example of the sequence values 20, 18, and 20 on Monday in the previous example, we can determine the sequence values of a specific fraction among 20, 18, and 20, such as a maximum value of 20 and a minimum value of 18.
[0188] After determining the extreme value characteristics of the first seasonal sequence and the second positive sequence for each extreme time period corresponding to the extreme value type, the difference information between the extreme value characteristics of the first seasonal sequence and the second seasonal sequence within each extreme time period corresponding to the extreme value type can be determined as the difference information for each extreme time period corresponding to the extreme value type.
[0189] In one implementation, for each extreme time period corresponding to the extreme value type, the difference or divergence value between the extreme value feature value of the first seasonal sequence in the extreme time period and the extreme value feature value of the second seasonal sequence in the extreme time period can be calculated as the difference information of the extreme time period.
[0190] Optionally, after determining the extreme value eigenvalues of the first and second seasonal sequences for each extreme time period corresponding to the extreme value type, eigenvalue sequence pairs can be constructed. For example, the extreme value eigenvalues of the first seasonal sequence for each extreme time period corresponding to the extreme value type are as follows: The extreme characteristic values of the second seasonal sequence for each extreme time period corresponding to this extreme value type are as follows: Then we can construct eigenvalue sequence pairs:
[0191] Then, the difference or divergence value of each eigenvalue sequence pair is calculated as the difference information during the extreme value time period corresponding to the eigenvalue sequence pair. Optionally, the above divergence value can be a KL (Kullback-Leibler, information entropy) divergence value.
[0192] After determining the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type based on the difference information of each extreme value time period corresponding to the extreme value type, the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type can be determined based on the difference information of each extreme value time period corresponding to the extreme value type.
[0193] In one implementation, the sum of the difference information for each extreme time period corresponding to the extreme value type can be directly calculated as the overall difference information between the first seasonal sequence and the second seasonal sequence with respect to the extreme value type.
[0194] Alternatively, in another implementation, before determining the overall difference information of the first and second seasonal sequences regarding the extreme value type based on the difference information of each extreme value time period corresponding to the extreme value type, the probability of the first seasonal sequence exhibiting an extreme value of that extreme value type in each extreme value time period corresponding to the extreme value type can be determined as a first weight for each extreme value time period corresponding to the extreme value type. Similarly, the probability of the second seasonal sequence exhibiting an extreme value of that extreme value type in each extreme value time period corresponding to the extreme value type can be determined as a second weight for each extreme value time period corresponding to the extreme value type. Then, based on the first and second weights of each extreme value time period corresponding to the extreme value type, the difference information of each extreme value time period corresponding to the extreme value type is weighted to obtain the overall difference information of the first and second seasonal sequences regarding the extreme value type.
[0195] Taking Table 1 above as an example of the first seasonal series, the second seasonal series follows the same pattern and will not be elaborated further here. For the extreme value period of Monday for the maximum value type, all series values on Monday are maximum values, so the probability of a maximum value type extreme value occurring on Monday is 1 (i.e., 100%). For the extreme value period of Thursday for the maximum value type, 2 / 3 of the series values on Thursday are maximum values, so the probability of a maximum value type extreme value occurring on Thursday is 2 / 3. For the extreme value periods of Friday and Saturday for the maximum value type, 1 / 3 of the series values on Friday and Saturday are maximum values, so the probability of a maximum value type extreme value occurring on Friday and Saturday is 1 / 3.
[0196] After obtaining the first weight and the second weight, the difference information of each extreme time period corresponding to the extreme value type can be weighted to obtain the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type.
[0197] S203, based on the overall difference information between the first seasonal sequence and the second seasonal sequence regarding each of the at least one extreme value type, determine the component similarity between the first seasonal sequence and the second seasonal sequence.
[0198] Optionally, the mean of the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to each of the at least one extreme value type can be calculated as the average difference information, and then the component similarity of the first seasonal sequence and the second seasonal sequence can be determined based on the average difference information.
[0199] Optionally, the ratio of the average difference information to the regularization factor is calculated to obtain a value in the range of 0 to 1. The difference between 1 and the ratio is further calculated as the component similarity between the first seasonal sequence and the second seasonal sequence.
[0200] In the above-described scheme of this application embodiment, since at least one component category is extracted from the time series, and the component category of the time series is essentially a decomposition of the time series from an information perspective, the extracted component sequence can well reflect the changes in the information dimension of the time series. Then, the similarity between time series is determined by determining the component similarity between the component sequences, thus realizing the measurement of the similarity between time series from an information perspective, thereby more accurately determining the similarity between time series.
[0201] In one embodiment, the at least one component category includes a trend component category; a first component sequence belonging to the trend component category is a first trend sequence; and a second component sequence belonging to the trend component category is a second trend sequence.
[0202] In this case, based on Figure 1 Examples, such as Figure 3 As shown, another embodiment of this application provides a time series similarity determination method, wherein the above-mentioned S103 may include steps S301-S302:
[0203] S301, determine the distance between sequence values in the first trend sequence and the second trend sequence;
[0204] Optionally, in one implementation, for each sequence value in the first trend sequence, the numerical difference between that sequence value and each sequence value in the second trend sequence can be determined. Then, based on the determined difference, a numerical difference matrix between each sequence value in the first trend sequence and the second trend sequence can be constructed. The diagonal path with the smallest sum of numerical differences among the diagonal paths of the numerical difference matrix can be determined as the target diagonal path. The diagonal path is the path connecting the numerical difference at the upper left corner of the numerical difference matrix to the numerical difference at the lower right corner. The sum of the numerical differences in the target diagonal path is taken as the sequence value distance between each sequence value in the first trend sequence and the second trend sequence.
[0205] S302, determine the component similarity corresponding to the trend component category based on the sequence value distance.
[0206] Optionally, in one implementation, the ratio of the sequence value distance to the regularization factor can be calculated to obtain a distance adjustment value, and then the difference between the specified value and the distance adjustment value can be calculated as the component similarity corresponding to the trend component category.
[0207] The regularization factor is a value that maps the sequence value distance to the range of 0 to 1, and the specified value can be 1.
[0208] In the above-described scheme of this application embodiment, since at least one component category is extracted from the time series, and the component category of the time series is essentially a decomposition of the time series from an information perspective, the extracted component sequence can well reflect the changes in the information dimension of the time series. Then, the similarity between time series is determined by determining the component similarity between the component sequences, thus realizing the measurement of the similarity between time series from an information perspective, thereby more accurately determining the similarity between time series.
[0209] In one embodiment, the at least one component category includes a residual term component category; a first component sequence belonging to the residual term component category is a first residual term sequence; and a second component sequence belonging to the residual term component category is a second residual term sequence.
[0210] In this case, based on Figure 1 Examples, such as Figure 4 As shown, another embodiment of this application provides a time series similarity determination method, wherein the above-mentioned S103 may include steps S401-S403:
[0211] S401, for each sequence value distribution interval in the preset sequence value distribution interval, determine the distribution probability of each sequence value in the first residual term sequence and the second residual term sequence in the sequence value distribution interval respectively;
[0212] The sequence value distribution interval is a pre-defined distribution interval for the distribution range of each sequence value in the time series. For example, if the distribution range of each sequence value in the time series is 0 to 100, it can be divided into 0 to 20, 20 to 40, 40 to 60, 60 to 80, and 80 to 100. Then, 0 to 20, 20 to 40, 40 to 60, 60 to 80, and 80 to 100 are the distribution intervals of each sequence value.
[0213] After obtaining the residual term sequence through decomposition, for each probability distribution, the probability of each sequence value in the first residual term sequence appearing in the sequence value distribution interval can be calculated as the probability distribution of each sequence value in the first residual term sequence in the sequence value distribution interval. Similarly, the probability of each sequence value in the second residual term sequence appearing in the sequence value distribution interval can be calculated as the probability distribution of each sequence value in the second residual term sequence in the sequence value distribution interval.
[0214] S402, determine the difference information between the probability distribution of each sequence value in the first residual term sequence and the second residual term sequence, within the distribution interval of each sequence value;
[0215] After obtaining the probability distribution of each sequence value in the first residual term sequence and the second residual term sequence within the sequence value distribution interval, a first probability distribution sequence can be constructed based on the probability distribution of the first residual term sequence within the sequence value distribution interval. Then, a second probability distribution sequence can be constructed based on the probability distribution of the second residual term sequence within the sequence value distribution interval. The divergence value between the first probability distribution sequence and the second probability distribution sequence is calculated as the difference information between the probability distribution of each sequence value in the first residual term sequence and the second residual term sequence within the sequence value distribution interval.
[0216] The above divergence value can be the KL divergence value. In this case, the KL divergence value can be calculated for the first probability distribution sequence and the second probability distribution sequence to obtain the difference information.
[0217] S403, Based on the determined difference information, determine the component similarity between the first residual term sequence and the second residual term sequence.
[0218] After obtaining the difference information between the probability distribution of each sequence value in the first residual term sequence and the second residual term sequence in the distribution interval of each sequence value, the ratio of this difference information to the regularization factor can be calculated to obtain the ratio in the range of 0 to 1. Then, 1 - this ratio is calculated as the difference information between the probability distribution of each sequence value in the first residual term sequence and the second residual term sequence in the distribution interval of each sequence value.
[0219] In the above-described scheme of this application embodiment, since at least one component category is extracted from the time series, and the component category of the time series is essentially a decomposition of the time series from an information perspective, the extracted component sequence can well reflect the changes in the information dimension of the time series. Then, the similarity between time series is determined by determining the component similarity between the component sequences, thus realizing the measurement of the similarity between time series from an information perspective, thereby more accurately determining the similarity between time series.
[0220] In one embodiment, this application also provides a method for determining time series similarity. The first time series can be a time series to be quality evaluated, and the second time series can be a time series containing complete sequence values pre-set for a downstream training task, wherein the downstream training task is to train a time series prediction model. In this case, after determining the similarity between the first and second time series, the quality evaluation result of the first time series can be further determined using the similarity between the first and second time series. The quality evaluation result can be a data integrity score, such as 70 or 80 points, in which case the specified quality requirement can be a quality score greater than a score threshold. Alternatively, the specified evaluation result can be an evaluation suitable for qualified data, such as qualified data or unqualified data, in which case the specified quality requirement can be a quality evaluation result of qualified data.
[0221] In one implementation, to provide a more comprehensive perspective on the quality assessment of the first time series and improve the accuracy of the assessment, the quality of the first time series can be further evaluated by combining the completeness assessment results of the first time series for the downstream training task. For example... Figure 5 As shown, another embodiment of this application provides a time series similarity determination method, which, after S104 above, may further include steps S501-S503:
[0222] S501, divide the first time series into multiple sample time series;
[0223] In this process, any sample time series is used to train the time series prediction model trained by the downstream training task. Each sample time series contains a first number of sample sequence values and a second number of predicted sequence values. The predicted sequence values in each sample time series are used as the annotation data for the sample sequence values in that sample time series.
[0224] The aforementioned downstream training task is to train a time-series prediction model, which is a model for predicting time series data. When the time series is traffic flow data, the aforementioned time-series prediction model can be used to predict traffic flow. When the time series is temperature data, the aforementioned time-series prediction model can be used to predict temperature data. When the time series is pedestrian flow data, the aforementioned time-series prediction model can be used to predict pedestrian flow. When the time series is stock market opening data, the aforementioned time-series prediction model can be used to predict stock market data.
[0225] For time series prediction models, the sample time series used in the training phase are of fixed length. That is, a fixed-length sample time series is constructed to train the time series prediction model, and then the trained time series prediction model is used for actual prediction. The aforementioned sample time series includes a first number of sample sequence values and a second number of predicted sequence values.
[0226] For example, each sample time series can be represented as:
[0227] x t-H ,x t-(H-1) …,x t ,…,x t+(P-1) ,x t+P
[0228] Where, x t-H ,x t-(H-1) …,x t x represents the first number of sample sequence values. t+1 ,…,x t+(P-1) ,x t+P This represents the second number of predicted sequence values.
[0229] The predicted sequence values in each sample time series are used as annotation data for the sample sequence values in that time series. Simply put, for any sample time series, the sample sequence values contained in that time series can be used as input to the time series prediction model to be trained. After the time series prediction model makes a prediction, the predicted sequence values contained in that sample time series are used as the calibration result, which, together with the prediction result of the time series prediction model, determines the loss function value of the time series prediction model. The loss function value is then used to adjust the parameters in the time series prediction model.
[0230] In one implementation, the first time series can be divided into multiple sample time series by sampling according to a first quantity plus a second quantity, or the first time series can be divided according to a first quantity plus a second quantity to obtain multiple sample time series. Both of these methods are acceptable.
[0231] S502, Based on the number of missing sample sequence values and predicted sequence values in each sample time series, determine the completeness assessment result of the first time series for the downstream training task;
[0232] In this context, the number of missing sample sequence values in any sample time series represents how many sample sequence values are missing. For example, if a complete sample time series contains H+1 sample sequence values, and the total number of sample sequence values in a sample time series is H, then the number of missing sample sequence values is 1. Similarly, the number of missing predicted sequence values in any sample time series represents how many predicted sequence values are missing. For example, if a complete sample time series contains P predicted sequence values, and the total number of sample sequence values in a sample time series is P-2, then the number of missing predicted sequence values is 2.
[0233] After determining the number of missing sample sequence values and the number of missing predicted sequence values in each sample time series, the completeness assessment result of the first time series for the downstream training task can be further determined based on the number of missing sample sequence values and predicted sequence values in each sample time series.
[0234] Optionally, for each missing number of samples in each sample missing number, based on the missing number of sample sequence values and predicted sequence values in each sample time series, the statistical information of the sample time series that is missing the number of sample time series values of that sample missing number can be determined as the statistical information corresponding to the missing number of samples. Then, based on the statistical information corresponding to the missing number of samples, the completeness evaluation result of the first time series for the downstream training task can be determined.
[0235] The number of missing samples in each sample includes every number less than or equal to the first number. For example, if the first number is 4, then the number of missing samples in each sample includes 0, 1, 2, 3, and 4. In this case, it is necessary to determine the corresponding statistical information for 0, 1, 2, 3, and 4 respectively.
[0236] In one implementation, the statistical information of the sample time series that is missing the number of sample time series values in each sample time series can be: the number of sample time series that is missing the number of sample time series values in each sample time series.
[0237] In one implementation, to ensure that the statistical information more accurately reflects the data completeness of the first time series for the downstream training task, the following steps can be used to determine the statistical information of the sample time series that is missing the number of sample time series values, including steps b1-b3:
[0238] Step b1: Based on the number of missing sample sequence values in each sample time series, determine the sample time series that is missing the number of sample time series values for that sample, and use it as the sample time series corresponding to that number of missing samples.
[0239] For example, the sample time series include time series 1, time series 2, time series 3, time series 4, and time series 5. In time series 1, 0 sample time series are missing and 1 predicted time series is missing; in time series 2, 1 sample time series and 1 predicted time series are missing; in time series 3, 1 sample time series and 2 predicted time series are missing; in time series 4, 1 sample time series and 1 predicted time series are missing; and in time series 5, 2 sample time series and 1 predicted time series are missing. If the number of missing samples is 1, then the sample time series corresponding to this number of missing samples include time series 2, time series 3, and time series 4.
[0240] Step b2: For each predicted missing number, based on the number of missing predicted sequence values in each sample time series, determine the third number of sample time series that are missing the predicted missing number of predicted time series values from each sample time series corresponding to the predicted missing number, and use it as the third number of the predicted missing number with respect to the predicted missing number; wherein, each predicted missing number includes each number less than or equal to the second number.
[0241] For example, if the second quantity is 2, then the predicted missing quantities include 0, 1, and 2. In this case, a third quantity needs to be determined for each of 0, 1, and 2. Using the example above, the sample time series corresponding to this number of missing samples include time series 2, time series 3, and time series 4. Therefore, for the predicted missing quantity 0, the corresponding third quantity for the missing quantity 1 is 0; for the predicted missing quantity 1, the corresponding third quantity is 1; for the predicted missing quantity 1, the corresponding third quantity is 2; and for the predicted missing quantity 2, the corresponding third quantity is 1.
[0242] In one implementation, steps b1 and b2 above can be achieved by constructing a sample-prediction missing matrix. In this case, the sample-prediction missing matrix of the first time series can be constructed based on the number of missing sample sequence values and the number of missing prediction sequence values in each sample time series.
[0243]
[0244] Among them, M sm This is a sample-predicted missing matrix, where H+1 is the first number of samples, P is the second number of samples, and any element n... h,p It shows a time series of n samples with h missing sample sequence values and p predicted sequence values.
[0245] Step b3: Use the third quantity corresponding to the number of missing samples for each of the predicted missing quantities to determine the statistical information corresponding to the number of missing samples.
[0246] Optionally, a weighted sum of the third quantities corresponding to each predicted missing quantity in the sample can be performed to obtain the statistical information corresponding to the sample missing quantity. The weight of each third quantity is determined based on the second quantity and the predicted missing quantity corresponding to that third quantity.
[0247] In one implementation, the weight of each third quantity is based on the difference between the predicted missing quantity and the second quantity. A statistical information sequence can be constructed based on the aforementioned sample-predicted missing quantity matrix.
[0248]
[0249] Among them, L sc For a statistical information sequence, any element of the statistical information sequence This provides statistical information corresponding to the number of missing samples, i.
[0250] In one implementation, after determining the statistical information corresponding to the number of missing samples for each sample, the statistical information corresponding to the number of missing samples for each sample can be weighted and summed according to the preset weight of the number of missing samples in each sample to obtain the completeness evaluation result of the first time series for the downstream training task.
[0251] Optionally, the statistical information corresponding to the number of missing samples i is as follows:
[0252]
[0253] Where P is the second quantity; any element n i,p It shows that there are n samples of time series data with i missing sample sequence values and p predicted sequence values;
[0254] At this point, a list of statistical information corresponding to the number of missing samples for each sample can be constructed:
[0255]
[0256] Among them, L sc This is a statistical information sequence, where H+1 is the first quantity;
[0257] Furthermore, the completeness evaluation result of the first time series for the downstream training task is calculated using the following formula, including:
[0258]
[0259]
[0260] Among them, C usage W represents the first time series' completeness evaluation results for the downstream training task. sc It includes a pre-defined weight for the number of missing samples in each sample.
[0261] S503, using the integrity assessment results and the determined similarity, determine the quality assessment results of the first time series.
[0262] After obtaining the integrity assessment results, in one implementation, the quality assessment results of the first time series can be determined based on the integrity assessment results.
[0263] In one implementation, to further improve the accuracy of time series data quality assessment, after obtaining the integrity assessment result, the quality assessment result of the first time series can be determined by combining the integrity assessment result and the determined similarity. Optionally, the integrity assessment result and the determined similarity can be weighted and fused, and the weights of the integrity assessment result and the determined similarity can be preset according to requirements.
[0264] In the above-described scheme of this application embodiment, the accuracy of time series similarity determination can be improved. Furthermore, by dividing the first time series into multiple sample time series, the first time series is decomposed according to the requirements of the downstream training task. Therefore, based on the number of missing sample sequence values and predicted sequence values in each sample time series, the integrity assessment result of the first time series for the downstream training task can be determined. This ensures that the determined integrity assessment result reflects the data integrity of the first time series for the downstream training task, thereby ensuring that the final quality assessment result more accurately reflects the information integrity of the first time series. Therefore, this scheme can also improve the accuracy of time series data quality assessment.
[0265] In one embodiment, after determining the quality assessment result of the first time series based on the integrity assessment result, it is also possible to determine whether the first time series is suitable as data for downstream training tasks based on the quality assessment result of the first time series, that is, to process the first time series based on the quality assessment result of the first time series.
[0266] Optionally, in one implementation, if the quality assessment result of the first time series meets the specified quality requirements, then the downstream training task is performed using the first time series.
[0267] The aforementioned quality assessment result can be a quality score, such as 70 or 80 points. In this case, the specified quality requirement can be a quality score greater than the score threshold. Alternatively, the aforementioned instruction assessment result can be an evaluation suitable for qualified data, such as qualified data or unqualified data. In this case, the specified quality requirement can be a quality assessment result of qualified data.
[0268] If the quality assessment result of the first time series meets the specified quality requirements, it means that the integrity of the first time series is guaranteed. At this time, the first time series can be used to perform the downstream training task, that is, to train the time series prediction model using the first time series.
[0269] In one implementation, if the quality assessment result of the first time series does not meet the specified quality requirements, the first time series is discarded or data repair is performed on the first time series. Specifically, if the quality assessment result of the first time series does not meet the specified quality requirements, it indicates that the integrity of the first time series is poor. In this case, the first time series can be discarded, or data repair can be performed. For example, for each missing sequence value in the first time series, its neighboring sequence values can be used to determine the value of that sequence value, which is then used as the value of the corresponding missing sequence value to complete the data repair.
[0270] The above-described scheme in this application embodiment can improve the accuracy of time series similarity determination and the accuracy of time series data quality assessment. Furthermore, if the quality assessment result meets the specified quality requirements, the first time series can be used to perform downstream training tasks; if the quality assessment result does not meet the specified quality requirements, the first time series can be discarded or data repair can be performed on the first time series. Therefore, the success rate of downstream training tasks can be improved.
[0271] Corresponding to the time series similarity determination method provided in the above embodiments of this application, such as Figure 6 As shown in the figure, this application embodiment also provides a time series similarity determination device, the device comprising:
[0272] The sequence acquisition module 601 is used to acquire a first time series and a second time series whose similarity needs to be determined.
[0273] The component extraction module 602 is used to extract component sequences of at least one component category from the first time series and the second time series respectively, to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series; the at least one component category includes at least one of the following: seasonal component category, trend component category and residual component category;
[0274] The first similarity determination module 603 is used to determine, for each component category in the at least one component category, the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category, as the component similarity corresponding to the component category;
[0275] The second similarity determination module 604 is used to determine the similarity between the first time series and the second time series based on the component similarity corresponding to each component category in the at least one component category.
[0276] Optionally, the at least one component category includes a seasonal component category; the first component sequence belonging to the seasonal component category is a first seasonal sequence; the second component sequence belonging to the seasonal component category is a second seasonal sequence.
[0277] The first similarity determination module includes:
[0278] The feature value determination submodule is used to determine, for the seasonal component category, at least one extreme value type of extreme feature value in each statistical time period within the seasonal cycle of the first seasonal sequence and the second seasonal sequence, respectively.
[0279] The feature value sequence combination submodule is used to combine, for each of the at least one extreme value types, the extreme value feature values belonging to that extreme value type in each statistical time period within the seasonal cycle of the first seasonal sequence and the second seasonal sequence, respectively, to obtain a first feature value sequence of the first seasonal sequence with respect to the extreme value type and a second feature value sequence of the second seasonal sequence with respect to the extreme value type; and determine the divergence value of the first feature value sequence and the second feature value sequence as the divergence value corresponding to the extreme value type;
[0280] The first similarity determination submodule is used to determine the component similarity corresponding to the seasonal component category based on the divergence value of the at least one extreme value type.
[0281] Optionally, the feature value determination submodule is specifically used to, for any one of the to-be-processed sequences in the first seasonal sequence and the second seasonal training, count the extreme values of at least one extreme value type within each statistical time period of the seasonal cycle; and for each statistical time period, determine the extreme value feature value of the at least one extreme value type based on the extreme value of the at least one extreme value type within that statistical time period.
[0282] Optionally, the feature value determination submodule is specifically used to determine, for each of the at least one extreme value types, a specified quantile of each extreme value of the extreme value type within the statistical time period, as the extreme value feature value of the extreme value type.
[0283] Optionally, the feature value sequence combination submodule is specifically used for each of the at least one extreme value types to determine, for each extreme value type, the probability that the extreme value belonging to that extreme value type in the first seasonal sequence is located within each statistical time period of the seasonal cycle, as the first distribution weight corresponding to that extreme value type; to determine the probability that the extreme value belonging to that extreme value type in the second seasonal sequence is located within each statistical time period of the seasonal cycle, as the second distribution weight corresponding to that extreme value type; to perform weighted processing on the first feature value sequence using the first distribution weight corresponding to that extreme value type to obtain a first weighted sequence; to perform weighted processing on the second feature value sequence using the second distribution weight corresponding to that extreme value type to obtain a second weighted sequence; and to calculate the divergence value of the first weighted sequence and the second weighted sequence as the divergence value corresponding to that extreme value type.
[0284] Optionally, the first similarity determination submodule is specifically used to, when there is only one extreme value type, use the divergence value of the at least one extreme value type as the component similarity corresponding to the seasonal component category; and when there are multiple extreme value types, calculate the mean of the divergence values of each extreme value type as the component similarity corresponding to the seasonal component category.
[0285] Optionally, the at least one component category includes a trend component category; a first component sequence belonging to the trend component category is a first trend sequence; and a second component sequence belonging to the trend component category is a second trend sequence.
[0286] The first similarity determination module includes:
[0287] The sequence value distance determination submodule is used to determine the sequence value distance between each sequence value in the first trend sequence and the second trend sequence for the trend component category;
[0288] The second similarity determination submodule is used to determine the component similarity corresponding to the trend component category based on the sequence value distance.
[0289] Optionally, the sequence value distance determination submodule is specifically used to determine the numerical difference between each value in the first trend sequence and each value in the second trend sequence for each value in the first trend sequence; construct a numerical difference matrix between the first trend sequence and the second trend sequence based on the determined differences; determine the diagonal path with the smallest sum of numerical differences among the diagonal paths of the numerical difference matrix as the target diagonal path; wherein the diagonal path is the path connecting the numerical difference at the upper left corner to the numerical difference at the lower right corner of the numerical difference matrix; and take the sum of the numerical differences in the target diagonal path as the sequence value distance between each sequence value in the first trend sequence and the second trend sequence.
[0290] Optionally, the second similarity determination submodule is specifically used to calculate the sequence value distance divided by a regularization factor to obtain a numerical difference adjustment value; and to calculate the sum of the negative value of the numerical difference adjustment value and a specified value as the component similarity corresponding to the trend component category.
[0291] Optionally, the at least one component category includes a residual term component category; a first component sequence belonging to the residual term component category is a first residual term sequence; and a second component sequence belonging to the residual term component category is a second residual term sequence.
[0292] The first similarity determination module includes:
[0293] The probability determination submodule is used to determine the distribution range of each value in the first residual term sequence and the second residual term sequence, and the probability of each distribution range, respectively, for the residual term component category.
[0294] The probability sequence construction submodule is used to construct probability sequences distributed in order of size of distribution intervals based on the distribution intervals of each value in the first residual term sequence and the probability of each distribution interval, respectively, to obtain the first probability sequence of the first residual term sequence and the second probability sequence of the second residual term sequence.
[0295] The third similarity determination submodule is used to determine the divergence value between the first probability sequence and the second probability sequence, which is used as the component similarity corresponding to the residual term component category.
[0296] Optionally, the at least one component category includes: a seasonal component category, a trend component category, and a residual component category;
[0297] The second similarity determination module includes:
[0298] The weight acquisition submodule is used to acquire the trend weights corresponding to the trend component category, the seasonal weights corresponding to the seasonal component category, and the residual weights corresponding to the residual component category.
[0299] The fourth similarity determination submodule is used to perform a weighted summation of the component similarity corresponding to the trend component category, the component similarity corresponding to the seasonal component category, and the component similarity corresponding to the residual component category based on the trend weight, the trend weight, and the residual term weight, to obtain the similarity between the first time series and the second time series.
[0300] Optionally, the weight acquisition submodule is specifically used to perform variance perturbation analysis on the first component sequence belonging to the seasonal component category, the first component sequence belonging to the trend component category, and the first component sequence belonging to the residual component category, respectively, to obtain the first seasonal variance value of the seasonal component category, the first trend variance value of the trend component category, and the first residual variance value of the residual component category; normalize the first seasonal variance value, the first trend variance value, and the first residual variance value to obtain the first seasonal weight of the seasonal component category, the first trend weight of the trend component category, and the first residual weight of the residual component category; and respectively perform variance perturbation analysis on the second component sequence belonging to the seasonal component category, the second component sequence belonging to the trend component category, and the first component sequence belonging to the residual component category. A variance perturbation analysis is performed on the second component sequence of the component category to obtain the second seasonal variance value of the seasonal component category, the second trend variance value of the trend component category, and the second residual variance value of the residual component category. The second seasonal variance value, the second trend variance value, and the second residual variance value are then normalized to obtain the second seasonal weight of the seasonal component category, the second trend weight of the trend component category, and the second residual weight of the residual component category. Based on the first seasonal weight and the second seasonal weight, the seasonal weight corresponding to the seasonal component category is determined. Based on the first trend weight and the second trend weight, the trend weight corresponding to the trend component category is determined. Based on the first residual weight and the second residual weight, the residual weight corresponding to the residual component category is determined.
[0301] Optionally, the weight acquisition submodule is specifically used to determine the first seasonal variance value of the seasonal component category, the first trend variance value of the trend component category, and the first residual variance value of the residual component category using the following formulas, wherein:
[0302]
[0303]
[0304]
[0305] Among them, among them, The first seasonal variance value for the seasonal component category. The first trend variance value for the trend component category. S is the first residual variance value of the residual component category. 1 T is the first component sequence belonging to the seasonal component category. 1 R is the first component sequence belonging to the trend component category. 1 It is the first component sequence belonging to the category of residual component;
[0306] And, the first seasonal weight of the seasonal component category, the first trend weight of the trend component category, and the first residual weight of the residual component category are determined as follows, wherein:
[0307]
[0308]
[0309]
[0310] in, The first seasonal weight for the seasonal component category, The first trend weight for the trend component category, The first residual weight is the component category of the residual item.
[0311] In the above-described scheme of this application embodiment, since at least one component category is extracted from the time series, and the component category of the time series is essentially a decomposition of the time series from an information perspective, the extracted component sequence can well reflect the changes in the information dimension of the time series. Then, the similarity between time series is determined by determining the component similarity between the component sequences, thus realizing the measurement of the similarity between time series from an information perspective, thereby more accurately determining the similarity between time series.
[0312] This application also provides an electronic device, such as... Figure 7 As shown, it includes:
[0313] Memory 701 is used to store computer programs;
[0314] When processor 702 executes a program stored in memory 701, it performs the following steps:
[0315] Obtain the first and second time series whose similarity needs to be determined;
[0316] Component sequences of at least one component category are extracted from the first time series and the second time series respectively to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series; the at least one component category includes at least one of the following: seasonal component category, trend component category and residual component category;
[0317] For each component category in the at least one component category, the component similarity between the first component sequence belonging to that component category and the second component sequence belonging to that component category is determined as the component similarity corresponding to that component category;
[0318] The similarity between the first time series and the second time series is determined based on the component similarity corresponding to each component category in the at least one component category.
[0319] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 702, the communication interface, and the memory 701 communicating with each other via the communication bus.
[0320] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0321] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0322] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0323] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0324] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described time series similarity determination methods.
[0325] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the time series similarity determination methods described in the above embodiments.
[0326] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0327] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0328] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for devices, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions of the method embodiments.
[0329] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A time series similarity determination method, characterized by, The method comprises: obtaining a first time sequence and a second time sequence to be determined similarity; respectively extracting component sequences of at least one component category from the first time sequence and the second time sequence to obtain at least one first component sequence of the first time sequence and at least one second component sequence of the second time sequence; the at least one component category comprises at least one of a seasonal component category, a trend component category and a residual term component category; for each component category in the at least one component category, determining the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category as the component similarity corresponding to the component category; determining the similarity between the first time sequence and the second time sequence based on the component similarity corresponding to each component category in the at least one component category; the at least one component category comprises a seasonal component category, the first component sequence belonging to the seasonal component category is a first seasonal sequence, and the second component sequence belonging to the seasonal component category is a second seasonal sequence; the determination of the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category comprises: determining the period time segment of the extreme value belonging to at least one extreme value type in the first seasonal sequence and the second seasonal sequence as the extreme value time segment corresponding to the at least one extreme value type; the period time segment is the minimum time segment in each seasonal period; for each extreme value type in the at least one extreme value type, respectively based on the sequence values of the first seasonal sequence and the second seasonal sequence located in the extreme value time segment corresponding to the extreme value type, determine the extreme value feature value of the first seasonal sequence and the second seasonal sequence in each extreme value time segment corresponding to the extreme value type; determine the difference information between the extreme value feature values of the first seasonal sequence and the second seasonal sequence in each extreme value time segment corresponding to the extreme value type as the difference information of each extreme value time segment corresponding to the extreme value type; based on the difference information of each extreme value time segment corresponding to the extreme value type, determine the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type; based on the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to each extreme value type in the at least one extreme value type, determine the component similarity of the first seasonal sequence and the second seasonal sequence.
2. The method of claim 1, wherein, the determination of the extreme value feature value of the first seasonal sequence and the second seasonal sequence in each extreme value time segment corresponding to the extreme value type based on the sequence values of the first seasonal sequence and the second seasonal sequence located in the extreme value time segment corresponding to the extreme value type comprises: for each extreme value time segment corresponding to the extreme value type, respectively determine the sequence value in the specified fraction of each sequence value of the first seasonal sequence and the second seasonal sequence located in the extreme value time segment as the extreme value feature value of the first seasonal sequence and the second seasonal sequence in the extreme value time segment.
3. The method of claim 1, wherein, The difference information between the extreme value feature values of the first seasonal sequence and the second seasonal sequence in each extreme value time period corresponding to the extreme value type is determined as the difference information of each extreme value time period corresponding to the extreme value type, including: For each extreme value time period corresponding to the extreme value type, the difference or divergence value between the extreme value feature value of the first seasonal sequence in the extreme value time period and the extreme value feature value of the second seasonal sequence in the extreme value time period is calculated as the difference information of the extreme value time period.
4. The method of claim 1, wherein, Before determining the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type based on the difference information of each extreme value time period corresponding to the extreme value type, the method further includes: The probability of the first seasonal sequence appearing the extreme value of the extreme value type in each extreme value time period corresponding to the extreme value type is determined as the first weight of each extreme value time period corresponding to the extreme value type; The probability of the second seasonal sequence appearing the extreme value of the extreme value type in each extreme value time period corresponding to the extreme value type is determined as the second weight of each extreme value time period corresponding to the extreme value type; The determination of the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type based on the difference information of each extreme value time period corresponding to the extreme value type includes: The difference information of each extreme value time period corresponding to the extreme value type is weighted based on the first weight and the second weight of each extreme value time period corresponding to the extreme value type, to obtain the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type.
5. The method of claim 1, wherein, The determination of the component similarity of the first seasonal sequence and the second seasonal sequence based on the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to each extreme value type in the at least one extreme value type includes: The mean value of the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to each extreme value type in the at least one extreme value type is calculated as the average difference information; The component similarity of the first seasonal sequence and the second seasonal sequence is determined based on the average difference information.
6. The method of claim 1, wherein, The at least one component category includes a trend component category; the first component sequence belonging to the trend component category is a first trend sequence; and the second component sequence belonging to the trend component category is a second trend sequence; The determination of the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category as the component similarity corresponding to the component category includes: The sequence value distance between each sequence value in the first trend sequence and the second trend sequence is determined; The component similarity corresponding to the trend component category is determined based on the sequence value distance.
7. The method of claim 6, wherein, The determination of the sequence value distance between each sequence value in the first trend sequence and the second trend sequence includes: For each sequence value in the first trend sequence, the numerical difference between the sequence value and each sequence value in the second trend sequence is determined; constructing a numerical difference matrix between each sequence value in the first trend sequence and the second trend sequence based on the determined difference values; determining a diagonal path with the smallest sum of numerical differences in each diagonal path in the numerical difference matrix as a target diagonal path, wherein the diagonal path is a path connecting from the top-left numerical difference to the bottom-right numerical difference in the numerical difference matrix; taking the sum of each numerical difference in the target diagonal path as a sequence value distance between each sequence value in the first trend sequence and the second trend sequence.
8. The method of claim 6, wherein, The determining of the component similarity corresponding to the trend component category based on the sequence value distance comprises: calculating a ratio of the sequence value distance and a regularization factor to obtain a distance adjustment value; calculating a difference between a specified numerical value and the distance adjustment value as the component similarity corresponding to the trend component category.
9. The method of claim 1, wherein, The at least one component category comprises a residual term component category; a first component sequence belonging to the residual term component category is a first residual term sequence; and a second component sequence belonging to the residual term component category is a second residual term sequence. The determining of the component similarity between the first component sequence belonging to the component category and the second component sequence belonging to the component category comprises: determining, for each sequence value distribution interval in a preset sequence value distribution interval, a distribution probability of each sequence value in the first residual term sequence and the second residual term sequence in the sequence value distribution interval; determining difference information between the distribution probabilities of each sequence value in the first residual term sequence and the second residual term sequence in the sequence value distribution interval; determining the component similarity between the first residual term sequence and the second residual term sequence based on the determined difference information.
10. The method of claim 9, wherein, The determining of the difference information between the distribution probabilities of each sequence value in the first residual term sequence and the second residual term sequence in the sequence value distribution interval comprises: constructing a first distribution probability sequence based on the distribution probability of the first residual term sequence in the sequence value distribution interval; constructing a second distribution probability sequence based on the distribution probability of the second residual term sequence in the sequence value distribution interval; calculating a divergence value between the first distribution probability sequence and the second distribution probability sequence as the difference information between the distribution probabilities of each sequence value in the first residual term sequence and the second residual term sequence in the sequence value distribution interval.
11. The method of claim 1, wherein, The at least one component category comprises a seasonal component category, a trend component category, and a residual term component category. The determining of the similarity between the first time sequence and the second time sequence based on the component similarity corresponding to each component category in the at least one component category comprises: obtaining a trend weight corresponding to the trend component category, a seasonal weight corresponding to the seasonal component category, and a residual term weight corresponding to the residual term component category; weighting and summing the component similarity corresponding to the trend component category, the component similarity corresponding to the seasonal component category, and the component similarity corresponding to the residual component category based on the trend weight, the trend weight, and the residual weight, to obtain the similarity between the first time series and the second time series.
12. The method of claim 11, wherein, The obtaining of the trend weight corresponding to the trend component category, the seasonal weight corresponding to the seasonal component category, and the residual weight corresponding to the residual component category comprises: performing variance perturbation analysis on the first component sequence belonging to the seasonal component category, the first component sequence belonging to the trend component category, and the first component sequence belonging to the residual component category respectively, to obtain a first seasonal variance value of the seasonal component category, a first trend variance value of the trend component category, and a first residual variance value of the residual component category; performing normalization processing on the first seasonal variance value, the first trend variance value, and the first residual variance value, to obtain a first seasonal weight of the seasonal component category, a first trend weight of the trend component category, and a first residual weight of the residual component category; performing variance perturbation analysis on the second component sequence belonging to the seasonal component category, the second component sequence belonging to the trend component category, and the second component sequence belonging to the residual component category respectively, to obtain a second seasonal variance value of the seasonal component category, a second trend variance value of the trend component category, and a second residual variance value of the residual component category; performing normalization processing on the second seasonal variance value, the second trend variance value, and the second residual variance value, to obtain a second seasonal weight of the seasonal component category, a second trend weight of the trend component category, and a second residual weight of the residual component category; determining the seasonal weight corresponding to the seasonal component category based on the first seasonal weight and the second seasonal weight; determining the trend weight corresponding to the trend component category based on the first trend weight and the second trend weight; determining the residual weight corresponding to the residual component category based on the first residual weight and the second residual weight.
13. The method of claim 12, wherein, The first seasonal variance value of the seasonal component category, the first trend variance value of the trend component category, and the first residual variance value of the residual component category are determined respectively by using the following formula, wherein: ; ; ; wherein, wherein, is a first seasonal variance value for the seasonal component category, is a first trend variance value for the trend component category, is a first residual variance value for the residual term component category, is a first component sequence belonging to the seasonal component category, is a first component sequence belonging to the trend component category, is a first component sequence belonging to the residual term component category; The first seasonal weight of the seasonal component category, the first trend weight of the trend component category, and the first residual weight of the residual component category are determined by using the following formula, wherein: ; ; ; wherein, is a first season weight for the seasonal component category, is a first trend weight for the trend component category, is a first residual weight for the residual term component category.
14. A time series similarity determination apparatus characterized by comprising: The device comprises: a sequence acquisition module configured to acquire a first time series and a second time series for which a similarity is to be determined; The component extraction module is used to extract component sequences of at least one component category from the first time series and the second time series respectively, to obtain at least one first component sequence of the first time series and at least one second component sequence of the second time series; the at least one component category includes at least one of the following: seasonal component category, trend component category and residual component category; The first similarity determination module is used to determine, for each component category in the at least one component category, the component similarity between a first component sequence belonging to that component category and a second component sequence belonging to that component category, as the component similarity corresponding to that component category; wherein, the at least one component category includes a seasonal component category, the first component sequence belonging to the seasonal component category is a first seasonal sequence, and the second component sequence belonging to the seasonal component category is a second seasonal sequence; determining the component similarity between the first component sequence belonging to that component category and the second component sequence belonging to that component category includes: determining the periodic time interval of the extreme values belonging to at least one extreme value type in the first seasonal sequence and the second seasonal sequence, as the extreme value time interval corresponding to the at least one extreme value type; the periodic time interval is the minimum time interval within each seasonal cycle; for the at least one extreme value category For each extreme value type in the model, based on the sequence values of the first seasonal sequence and the second seasonal sequence located in the extreme value time period corresponding to the extreme value type, the extreme value feature values of the first seasonal sequence and the second seasonal sequence in each extreme value time period corresponding to the extreme value type are determined; the difference information between the extreme value feature values of the first seasonal sequence and the second seasonal sequence in each extreme value time period corresponding to the extreme value type is determined as the difference information of each extreme value time period corresponding to the extreme value type; based on the difference information of each extreme value time period corresponding to the extreme value type, the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to the extreme value type is determined; based on the overall difference information of the first seasonal sequence and the second seasonal sequence with respect to each extreme value type in the at least one extreme value type, the component similarity of the first seasonal sequence and the second seasonal sequence is determined. The second similarity determination module is used to determine the similarity between the first time series and the second time series based on the component similarity corresponding to each component category in the at least one component category.
15. An electronic device, comprising: include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-13.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-13.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and storage medium
CN113657177A
Method and device for determining data similarity, electronic equipment and storage medium
CN114817363A