Periodic detection method based on time sequence
By preprocessing and autocorrelation analysis of the time series, the problems of low signal-to-noise ratio and low efficiency and low accuracy of time series period detection with trend components in the prior art are solved, and the precise period detection and operation and maintenance information processing efficiency of these data are improved.
Patent Information
- Application Number
- CN202411601128.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-11
Smart Images

Figure CN119598209A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data information processing, and is applied to the field of railway intelligent operation and maintenance information data processing, and specifically relates to a periodicity detection method based on time series. Background Art
[0002] In modern railway transportation systems, intelligent operation and maintenance information data processing has gradually become a key link in improving operational efficiency and safety. As a core component, periodic testing can effectively improve the operational reliability of railway equipment. By regularly testing tracks, vehicles and related facilities, operation and maintenance personnel can promptly discover potential fault hazards and take appropriate preventive measures to avoid accidents. With the continuous advancement of technology, periodic testing will play a more important role in future railway operations.
[0003] With the development of data science and statistics, time series analysis has become an important tool for understanding and predicting dynamic systems. It is widely used in economics, finance, meteorology, environmental science and other fields. In the process of railway intelligent operation and maintenance information data processing, time series analysis can be used for efficient processing. Existing detection cycle methods include cycle detection algorithm (Cycle Detection), autocorrelation method (Autocorrelation) and fast Fourier transform (FFT) method, etc. These are only suitable for detecting periodic data with high signal-to-noise ratio. In particular, the cycle detection algorithm is only suitable for detecting periodic series without noise;
[0004] The autocorrelation method measures the correlation between the time series and its own lagged value by calculating the autocorrelation values at each level, taking the position of the peak as the period. When the data has large fluctuations, it is easy to cause a high false alarm rate due to the existence of false peaks, resulting in incorrect detection judgments and cycle lengths. The Fourier transform converts the sequence from the time domain form to the frequency domain form, reveals the frequency components in the data, and obtains the corresponding cycle value by identifying the peak. The Fourier transform method is generally only applicable to the detection of short-term and medium-term cycle values with less noise. For non-stationary time series or complex periodic patterns, the effect is not satisfactory, and when the data has large noise fluctuations, it is easy to obtain incorrect cycle values. At the same time, existing cycle detection methods such as cycle detection algorithms, autocorrelation methods, and fast Fourier transforms cannot handle data that covers both cycle and trend components well. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and to provide a time series-based periodicity detection method, which can solve the problems of low efficiency and low accuracy in periodicity detection of time series periods with low signal-to-noise ratio and trend components, thereby improving the efficiency and accuracy of operation and maintenance information processing.
[0006] The time series-based periodicity detection method provided by the present invention comprises the following steps performed in sequence:
[0007] (1) obtaining a time series, preprocessing the time series, and encrypting the preprocessed data according to the first method; respectively setting a noise threshold noise_threshold and a trend component weight threshold trend_threshold;
[0008] (2) Calculate the autocorrelation function of the original time series to obtain the autocorrelation sequence A;
[0009] (3) Calculating the similarity difference of each subsequence of the autocorrelation sequence A to obtain a similarity difference sequence;
[0010] (4) Based on the position of the minimum value of the similarity difference sequence M, the index is performed to obtain the period length T, the noise level noise_leυel and the trend component weight trend_leυel;
[0011] (5) Based on T and the original data, the noise level noise_leυel and the trend component ratio trend_leυel of the sequence are calculated, and the noise level noise_leυel and the trend component ratio trend_leυel are corrected based on the result of preprocessing the time series, and then encrypted according to the second method;
[0012] (6) The corrected noise level noise_leυel and trend component weight trend_leυel are respectively compared with the corresponding noise threshold noise_threshold and trend component weight threshold trend_threshold to obtain the period detection judgment result.
[0013] In a preferred embodiment, step (1) further comprises using a variable X to represent a time series, x t represents the t-th point in the sequence, t = 1, 2, 3, 4, 5, ..., N, N represents the length of the sequence X, then the time series: X = [x1, x2, x3, x4, ..., x n ].
[0014] In a preferred embodiment, the step (1) of obtaining a time series, preprocessing the time series, and encrypting the preprocessed data in a first manner specifically includes the following steps performed in sequence:
[0015] (1.1) Setting the signal threshold range, comparing the time data in the time series with the signal threshold range respectively, and clustering the data in the time series that exceeds the signal threshold range to form an excess value sequence group;
[0016] (1.2) Calculate the absolute value of the clustered time data that exceeds the threshold range, where the absolute value is the sum of the values exceeding the upper and lower limits of the threshold range;
[0017] (1.3) Sort the corresponding super-value sequence groups according to the calculated absolute values, and perform correlation processing on the corresponding time data in the super-value sequence groups in pairs based on the sorting to obtain correlation data;
[0018] (1.4) setting compression values for the corresponding time data in the super-value sequence group respectively based on the size of the correlation data;
[0019] (1.5) Perform encryption processing in the first manner on the sorted super-value sequence group to obtain an encrypted super-value sequence group.
[0020] In a preferred embodiment, in step (1.4), correlation processing is performed on the partial time data and the two time data adjacent to it in order, and the corresponding compression value is the average of the two compression values obtained from the two time data adjacent to it in order.
[0021] In a preferred embodiment, step (2) specifically comprises:
[0022] Calculate the autocorrelation coefficient:
[0023]
[0024] Calculate the autocorrelation coefficients of the time series at all levels:
[0025] A=[acf(X,1),acf(X,2),acf(X,3),…,acf(X,N-1)]=[a1,a2,a3,…,a n-1 ];
[0026] remember N / 2>=i>=1;
[0027] Among them, and is a subsequence of A, i is the length of the subsequence, then
[0028]
[0029] In a preferred embodiment, the step (3) specifically comprises:
[0030] Calculate subsequence and The similarity difference at each length is obtained to obtain a similarity difference sequence M.
[0031] In the preferred method, the subsequences are calculated using the amse similarity difference measurement method and The similarity difference at each length is:
[0032]
[0033] Among them, the absolute mean square error is:
[0034] In a preferred embodiment, the step (4) specifically includes: setting f(j)=m j , calculate the candidate period length of the sequence
[0035] In a preferred embodiment, the step (5) corrects the noise level noise_leυel and the trend component weight trend_leυel based on the result of preprocessing the time series, specifically including:
[0036] (5.1) Using the data in the corresponding sequence group containing excess values in the period length T, the corresponding compression values are respectively brought into the calculation for data compensation, and then the noise level noise_leυel and the trend component proportion trend_leυel are corrected;
[0037] (5.2) The corrected noise level noise_leυel and trend component proportion trend_leυe are encrypted using a second method, wherein the first and second methods are different encryption processing methods.
[0038] In a preferred embodiment, when noise_leυel<noise_threshold and trend_leυel<trend_threshold in step (5), the time series X is considered to be a periodic time series, and the period length of the sequence X is T.
[0039] Compared with the prior art, the time series-based periodicity detection method of the present invention can achieve:
[0040] (1) Complete the detection of accurate periodic series, and have better robustness for low signal-to-noise ratio series data with fluctuations and series data with trend components. The two indicators obtained at the same time: noise_leυel and trend_leυel respectively realize the quantitative description of the noise level and trend component proportion in the series data, which is convenient for users to screen periodic series data with different signal-to-noise ratios and different trend component proportions based on their needs;
[0041] (2) Based on the different effects of noise, the acquired time series is preprocessed, the obtained compression values are corrected and compensated, and the data is encrypted in different forms. The overall solution has a small amount of data calculation and high security, which improves the efficiency and accuracy of operation and maintenance information processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 Schematic diagram of the process of periodicity detection method based on time series.
[0043] Figure 2 This is a schematic diagram of the detection and period extraction results on data with low signal-to-noise ratio, high noise ratio and trend components in practical applications. DETAILED DESCRIPTION
[0044] The specific implementation of the present invention is described in detail below. It is necessary to point out that the following implementation is only used for further explanation of the present invention and cannot be understood as limiting the scope of protection of the present invention. Some non-essential improvements and adjustments made to the present invention by persons skilled in the art based on the above-mentioned content of the present invention still fall within the scope of protection of the present invention.
[0045] The present invention provides a periodicity detection method based on time series, and its specific implementation is as shown in the attached Figure 1 As shown. Figure 1 The flowchart of the periodicity detection method based on time series is shown in Figure 2. Figure 2 To provide a schematic diagram of the detection and period extraction results on data with low signal-to-noise ratio, high noise ratio and trend components in practical applications, the following is a detailed introduction to the process of periodicity detection method based on time series.
[0046] The present invention provides a periodicity detection method based on time series, and its specific implementation process is as shown in the attached Figure 1 As shown. Figure 1 As shown, the time series-based periodicity detection method provided by the present invention includes the following steps performed in sequence:
[0047] First, obtain the time series and preprocess the time series by setting the noise threshold noise_threshold and the trend component weight threshold trend_threshold. t represents the t-th point in the sequence, t = 1, 2, 3, 4, 5, ..., N, N represents the length of the sequence X, then the time series: X = [x1, x2, x3, x4, ..., x n ].
[0048] In practical applications, time series data is often interfered by various noises. Noise may come from measurement errors, changes in the external environment, or random fluctuations within the system. These noises will mask periodic signals and reduce the accuracy of periodic detection. Therefore, effectively processing noise and improving the robustness of periodic detection can improve the efficiency and accuracy of operation and maintenance information processing. A time series is a set of data points arranged in chronological order and observed at equal time intervals. Time series acquisition requires preprocessing, including steps such as removing missing values, processing outliers, and standardizing data. Noise is often different in different time stages, and its impact on periodic signals is also different. Therefore, in the specific implementation of obtaining time series and preprocessing the time series, it includes setting a signal threshold range (which can be set based on historical data or experience), comparing the time data in the time series with the signal threshold range respectively, clustering the data in the time series that exceeds the signal threshold range to form an overvalue sequence group, and calculating the absolute value of the clustered time data exceeding the threshold range, where the absolute value is the sum of the values exceeding the upper and lower limits of the threshold range. According to the calculated absolute value size, the corresponding super-value sequence group is sorted, and based on the sorting, the corresponding time data in the super-value sequence group are processed in pairs in sequence to obtain correlation data. Based on the size of the correlation data, compression values are set for the corresponding time data in the super-value sequence group in sequence, where some time data will be processed in correlation with the two time data that are close to its sorting, and the corresponding compression value is the average of the two compression values obtained by the two time data that are close to its sorting. In addition, the data security of operation and maintenance information affects the normal operation of the entire system. It contains a large amount of data information that needs to be kept confidential, and data security problems may cause serious consequences. In order to ensure data security and reduce workload, only relatively "random" encryption intervention is further performed on part of the time series to ensure the security of the overall data. Specifically, the sorted super-value sequence group is encrypted in the first way to obtain an encrypted super-value sequence group.
[0049] Secondly, the autocorrelation function of the original time series is calculated to obtain the autocorrelation sequence A, and the sequence mean μ = E(X). The autocorrelation function is used to measure the correlation between the observations at each time point in the time series. By calculating the autocorrelation function, the internal structure and pattern of the sequence can be evaluated.
[0050] The calculation of the autocorrelation coefficient is realized by using the existing calculation method, that is, the autocorrelation coefficient:
[0051]
[0052] Specifically, calculate the autocorrelation coefficients of each level of the time series:
[0053] A=[acf(X,1),acf(X,2),acf(X,3),...,acf(X,N-1)]=[a1,a2,a3,...,a n-1 ];
[0054] remember N / 2>=i>=1.
[0055] Among them, and is a subsequence of A, i is the length of the subsequence, then
[0056]
[0057] Then, the similarity difference of each subsequence of the autocorrelation sequence A is calculated to obtain a similarity difference sequence. The similarity difference can be calculated by a variety of methods, including the correlation coefficient, Euclidean distance, etc. The purpose of this process is to identify the behavior patterns between different intervals in the time series and quantify the differences between these patterns. Specifically, the subsequences are calculated. and The similarity difference at each length is used to obtain a similarity difference sequence M. In a preferred method, similarity difference measurement methods such as mse, amse, and dtw can be used. When the amse similarity difference measurement method is selected, then:
[0058]
[0059] Among them, the calculation of the absolute mean square error is realized by using the existing calculation method, that is, the absolute mean square error is:
[0060] Next, we index based on the position of the minimum value of the similarity difference sequence M to obtain the cycle length T, as well as the noise level ooise_leυel and the trend component weight trend_leυel. The cycle length usually corresponds to the periodic performance of repeated patterns in the time series. By analyzing the similarity difference sequence, local minima can be identified, which usually means that the volatility of the data decreases within a specific time interval, indicating that the changes tend to stabilize. After finding these local minima, we calculate their index differences in the time series to get the cycle length.
[0061] Specifically, let f(j)=m j ,calculate The calculated T represents the candidate period length of the sequence, such as:
[0062] Based on T and the original data (the original obtained time series), the noise degree noise_leυel and the trend component proportion trend_leυel of the sequence are calculated. Noise_leυel is used to describe the degree of noise on the sequence. The smaller the value, the smaller the noise and the more significant the cycle. Trend_leυel describes the degree of trend components on the sequence. The smaller the value, the fewer trend components and the more significant the cycle. In the preferred method, noise_leυel = 1-aT, trend_leυel = min(M).
[0063] In addition, this step also includes correcting the noise level noise_leυel and the trend component ratio trend_leυel based on the obtained cycle length T using the corresponding compression value. Preferably, in the correction process, the corresponding compression values are respectively brought into the calculation to perform data compensation using the data in the super-value sequence group corresponding to the cycle length T, and then the noise level noise_leυel and the trend component ratio trend_leυel are corrected. At the same time, the corrected noise level noise_leυel and the trend component ratio trend_leυel are encrypted in the second way, wherein the first and second ways are different encryption processing ways.
[0064] Finally, by comparing the noise level noise_leυel and the trend component weight trend_leυel with the corresponding noise threshold noise_threshold and the trend component weight threshold trend_threshold, we can get the period detection result, that is, noise_leυel<noise_threshold, and trend_leυel<trend_threshold. It is considered that the time series X is a periodic time series, and the period length of the sequence X is T. In practical applications, we detect data with low signal-to-noise ratio, high noise ratio and trend components respectively, and the detection and period extraction results are shown in the following figure. Figure 2 shown.
[0065] Although exemplary embodiments of the present invention have been described for the purpose of illustration, it will be understood by those skilled in the art that various modifications, additions and substitutions may be made in form and detail without departing from the scope and spirit of the invention disclosed in the appended claims, and all such changes shall fall within the scope of protection of the appended claims of the present invention, and the various steps in the various departments and methods of the products claimed by the present invention may be combined together in any combination. Therefore, the description of the embodiments disclosed in the present invention is not intended to limit the scope of the present invention, but is used to describe the present invention. Accordingly, the scope of the present invention is not limited by the above embodiments, but is defined by the claims or their equivalents.
Claims
1. A periodicity detection method based on time series, characterized in that: The method comprises the following steps in sequence: (1) obtaining a time series, preprocessing the time series, and encrypting the preprocessed data according to the first method; respectively setting a noise threshold noise_threshold and a trend component weight threshold trend_threshold; (2) Calculate the autocorrelation function of the original time series to obtain the autocorrelation sequence A; (3) Calculating the similarity difference of each subsequence of the autocorrelation sequence A to obtain a similarity difference sequence; (4) Based on the position of the minimum value of the similarity difference sequence M, the index is performed to obtain the period length T, the noise level noise_level and the trend component proportion trend_level; (5) Based on T and the original data, the noise level noise_level and the trend component ratio trend_level of the sequence are calculated, and based on the result of preprocessing the time series, the noise level noise_level and the trend component ratio trend_level are corrected and encrypted according to the second method; (6) The corrected noise level noise_level and trend component ratio trend_level are respectively compared with the corresponding noise threshold noise_threshold and trend component ratio threshold trend_threshold to obtain the period detection judgment result.
2. The method according to claim 1, characterized in that: The step (1) further includes using a variable X to represent a time series, x t represents the t-th point in the sequence, t=1,2,3,4,5,…,N,N represents the length of the sequence X, then the time series: X=[x1,x2,x3,x4,…,x n ].
3. The method according to claim 1 or 2, characterized in that: In the step (1), a time series is obtained, and the time series is preprocessed, and the preprocessed data is encrypted according to the first method, which specifically includes the following steps performed in sequence: (1.1) Setting the signal threshold range, comparing the time data in the time series with the signal threshold range respectively, and clustering the data in the time series that exceeds the signal threshold range to form an excess value sequence group; (1.2) Calculate the absolute value of the clustered time data that exceeds the threshold range, where the absolute value is the sum of the values that exceed the upper and lower limits of the threshold range; (1.3) Sort the corresponding super-value sequence groups according to the calculated absolute values, and perform correlation processing on the corresponding time data in the super-value sequence groups in pairs based on the sorting to obtain correlation data; (1.4) setting compression values for the corresponding time data in the super-value sequence group respectively based on the size of the correlation data; (1.5) Perform encryption processing in the first manner on the sorted super-value sequence group to obtain an encrypted super-value sequence group.
4. The method according to claim 3, characterized in that: In the step (1.4), correlation processing is performed on the partial time data and the two time data adjacent to it in the sorting order, and the corresponding compression value is the average value of the two compression values obtained from the two time data adjacent to it in the sorting order.
5. The method according to claim 1 or 4, characterized in that The step (2) specifically comprises: Calculate the autocorrelation coefficient: Calculate the autocorrelation coefficients of the time series at all levels: A=[acf(X,1),acf(X,2),acf(X,3),...,acf(X,N-1)]=[a1,a2,a3,...,a n-1 ]; remember Among them, and is a subsequence of A, i is the length of the subsequence, then 6. The method according to claim 5, characterized in that The step (3) specifically comprises: Calculate subsequence and The similarity difference at each length is obtained to obtain a similarity difference sequence M.
7. The method according to claim 6, characterized in that: Use the amse similarity difference measurement method to calculate subsequences and The similarity difference at each length is: Among them, the absolute mean square error is:
8. The method according to claim 7, characterized in that The step (4) specifically includes: setting f(j)=m j , calculate the candidate period length of the sequence 9. The method according to claim 8, characterized in that In the step (5), based on the result of preprocessing the time series, the noise level noise_level and the trend component proportion trend_level are corrected, specifically including: (5.1) Use the data in the corresponding super-value sequence group in the cycle length T, substitute the corresponding compression values into the calculation respectively for data compensation, and then correct the noise level noise_level and the trend component proportion trend_level. (5.2) Perform encryption processing on the corrected noise level noise_level and the trend component proportion trend_level in the second method, where the first and second methods are different encryption processing methods respectively.
10. The method according to claim 9, characterized in that In step (5), when noise_level < noise_threshold and trend_level < trend_threshold, the time series X is considered a periodic time series, and the cycle length of the series X is T.