A statistical method for product data classification based on time series analysis

By combining density clustering and dynamic time warping algorithms, the problems of non-alignment and noise interference in time series data are solved, efficient classification of time series data recorded by multiple sensors is achieved, and the number of product categories on the production line is accurately determined, improving efficiency. Data mining efficiency and accuracy.

CN114491020BActive Publication Date: 2024-10-15SHANTOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111632434.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2024-10-15
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively deal with the problems of non-alignment, local deformation and noise interference in time series data, resulting in low statistical efficiency of time series data classification.

Method used

Adopt a method based on time series analysis, combine density clustering algorithm and dynamic time warping algorithm, extract time series features through preprocessing and cluster analysis, and use dynamic time warping algorithm to align time series and calculate similarity to achieve product data classification .

Benefits of technology

It achieves efficient classification of time series data recorded by multiple sensors, accurately determines the number of product types on the production line, supports data recording at different frequencies, and improves data mining efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491020B_ABST
    Figure CN114491020B_ABST
Patent Text Reader

Abstract

The present invention discloses a product data classification and statistics method based on time series analysis, comprising the steps of: storing the acquired product data set in a text file; performing preprocessing operations on the text file to obtain an analyzable time series data set, modulating the interval of the time series data set to realize single wave identification; performing cluster analysis on the two-dimensional array of the single wave identification using a density clustering algorithm, setting the parameters of the density clustering algorithm, giving a density threshold and a radius parameter value, and adjusting the radius parameter; performing alignment operations on a given time subsequence through a dynamic time warping algorithm, calculating the average cumulative shortest distance of the subsequences, the average cumulative shortest distance is regarded as the similarity between the subsequences, and completing classification using the similarity between each subsequence. By adopting the present invention, sensors with different recording frequencies on multiple production lines can be recorded simultaneously to obtain multiple time series data sets, which can be analyzed simultaneously to obtain the number of product types on each production line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial product classification statistics, and in particular to a product data classification statistics method based on time series analysis. Background Art

[0002] Time series data refers to a series of data recorded in chronological order, from which time series features are extracted as the basis for judging data similarity. Time series features are hidden in different time periods, and the time period data is displayed in the form of waveforms. The waveform variables of the time series can reflect its variable trends. However, not every time point in the time series can provide the required features. For example, the time series has problems such as non-alignment, local deformation, and noise interference. Therefore, the elastic measurement method of dynamic time warping is introduced. Through a stretching fitting strategy, a deformation path is found to minimize the distance between the two sequences, solving the problems of non-alignment and phase shift of the time series.

[0003] As the key to data mining, time series can be used to find the characteristics of different sequences through cluster analysis, and finally determine the category to which the sequence belongs. The density clustering algorithm does not need to specify the number of clusters in advance, that is, the number of final clusters is uncertain, which can meet the requirement of the present invention to analyze the number of categories from the data set. Summary of the invention

[0004] The technical problem to be solved by the embodiments of the present invention is to provide a product data classification and statistics method based on time series analysis. The time series data recorded by the production line can be simultaneously feature extracted, clustered, and analyzed to obtain the product categories present in the time series data. The method supports data recording of multiple sensors arranged on the production line at different frequencies, and ultimately determines the number of product types on each production line.

[0005] In order to solve the above technical problems, an embodiment of the present invention provides a product data classification and statistics method based on time series analysis, comprising the following steps:

[0006] S1: Store the acquired product dataset in a text file;

[0007] S2: performing a preprocessing operation on the text file to obtain an analyzable time series data set, modulating the interval of the time series data set to achieve single wave recognition;

[0008] S3: performing cluster analysis on the two-dimensional array of the single wave recognition by using a density clustering algorithm, setting parameters of the density clustering algorithm, giving a density threshold and a radius parameter value, and adjusting the radius parameter;

[0009] S4: Through the dynamic time warping algorithm, the given time subsequences are aligned, and the average cumulative shortest distance of the subsequences is calculated. The average cumulative shortest distance is regarded as the similarity between the subsequences, and the classification is completed using the similarity between the subsequences.

[0010] Furthermore, the step S2 specifically includes:

[0011] S21: Read the text data, remove the first line of prompt information and the label of each line of the text, and obtain an operable data set;

[0012] S22: retaining the floating-point data in the operable data set by rounding up, and outputting an analyzable time series data set;

[0013] S23: Mark the modulation interval of the analyzable time series data set with 0 to separate waves and complete single wave identification;

[0014] S24: All data in a wave are grouped into an array, and the final analyzable time series data set is output in the form of a two-dimensional array, where rows represent the changes in wave values ​​within a wave and columns represent different waves.

[0015] Furthermore, the step S3 specifically includes:

[0016] S31: input the two-dimensional array data set and the given density threshold and radius parameter value for clustering, calculate the cluster number to which each value in the data set belongs, and return the output cluster number sequence, clustering them into cluster 1 and cluster 0 respectively according to the value size of the result;

[0017] S32: Set the density threshold to 2.0, set the radius range to [0.001, 1], and the step size to 0.05, cluster the input subarray, save the clustering results to a custom result object, and save all the results as an array, filter out the result objects with more than 1 clusters from the array, and take the largest radius parameter as the result of parameter adjustment.

[0018] S33: Execute the density clustering algorithm in a loop, count the number of clusters, the number of noise points, and the number of samples in each cluster obtained after clustering analysis of the two-dimensional array of single wave recognition, and finally write the above parameter values ​​into the array.

[0019] Furthermore, the step S4 specifically includes:

[0020] S41: Obtain the cluster number sequences corresponding to the two subsequences, and convert the cluster number sequences into cluster number sequence strings;

[0021] S42: comparing two longest common subsequences of two cluster number sequence strings, if the two longest common subsequences are not aligned, using a dynamic time warping elastic measurement method to perform dynamic time warping calculation on the sequences;

[0022] S43: Compress two time series of unequal lengths through a dynamic time rule algorithm to obtain two subsequences of the same length after compression, calculate the average cumulative shortest distance during the compression process, obtain the similarity between rows in the two-dimensional array data set of the single wave identification in step 2, and obtain the similarity between single waves.

[0023] S44: Count the similarity values ​​obtained, and analyze based on all similarity values. For example, set the similarity threshold to 2.5, that is, if the similarity is less than 2.5, it is considered to be the same type of product, otherwise it is considered to be two products. Finally, count the number of product types.

[0024] Furthermore, the dynamic time warping includes: aligning the time series to compress the length of the longer time series to be consistent with the shorter time series; assuming that the lengths of the two time series are n and m, constructing a matrix grid with a length of n and a width of m, the matrix element (i, j) represents the distance from the i point on the time series with a length of n to the j point on the time series with a length of m. The smaller the distance, the higher the similarity. The purpose is to find a path along which the accumulated distance reaches the minimum value.

[0025] By implementing the embodiment of the present invention, sensors with different recording frequencies can be used to simultaneously record on multiple production lines to obtain multiple time series data sets, which can be analyzed simultaneously to ultimately determine the number of product types on each production line. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram of a production line product data statistical classification method based on time series analysis according to the present invention;

[0027] Figure 2 A schematic diagram of using a density clustering algorithm to calculate the cluster number to which a value belongs in one embodiment of the present invention;

[0028] Figure 3 This is a diagram showing the effect of using a dynamic time warping algorithm to implement similarity analysis in one embodiment of the present invention. DETAILED DESCRIPTION

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

[0030] The embodiment of the present invention provides a method for statistical classification of production line product data based on time series analysis, which can quickly extract the time series data of production line products and simultaneously analyze and process them to obtain the number of product categories on each production line. In this embodiment, the method is implemented by the following steps.

[0031] Step 1: Multiple sensors record the products on the production line at different recording frequencies, obtain product data sets, and store them in text files.

[0032] Step 2: Preprocess the text file, remove invalid strings in the data set, read the text data and output it in array form, retain the floating point data in the data set using rounding technology, and complete the preprocessing to obtain an analyzable time series data set. Mark the modulation interval of the analyzable time series data set with 0, and output a two-dimensional array for single wave recognition.

[0033] Step 3: Adjust the minimum threshold and radius parameter values ​​in the density clustering algorithm, where the minimum threshold is a fixed value, and use the algorithm to perform cluster analysis on the two-dimensional array of single wave recognition.

[0034] Step 4: Compress two sequences of unequal length into subsequences of the same length through the dynamic time warping algorithm, calculate the average cumulative shortest distance of the subsequences, obtain the similarity of the subsequences, and use the similarity between the subsequences to complete the classification.

[0035] The above step 2 includes the following steps:

[0036] Step 1: Read the text data, remove the first line of prompt information and the labels of each line, and obtain an operational data set.

[0037] Step 2: The floating-point data in the operational data set is retained by rounding up, and an analyzable time series data set is output.

[0038] Step 3: For the analyzable time series data set, the modulation interval is marked with 0, that is, the number 0 is used to represent the end or beginning of a wave, so as to separate waves and complete single wave identification.

[0039] Step 4: All data in a wave are grouped into an array. The final analyzable time series data set is output in the form of a two-dimensional array, where rows represent the changes in wave values ​​within a wave and columns represent different waves.

[0040] The above step three includes the following steps:

[0041] Step 1: Input the two-dimensional array data set of single wave recognition and the above parameter value array for clustering, calculate the cluster number to which each value in the data set belongs, and return the output cluster number sequence. The larger value is clustered into cluster 1, and the smaller value is clustered into cluster 0.

[0042] Step 2: Use the two-dimensional array data set of single wave identification to adjust the parameters in the density clustering algorithm. Based on experience, set the density threshold to 2.0. Set the radius value range [0.001, 1] based on the characteristics of the data set, with a step size of 0.05, and cluster the input sub-array. Save the clustering results to a custom result object and save all the results as an array. Filter out the result objects with a cluster number greater than 1 from the array, and take the largest radius parameter as the result of the parameter adjustment.

[0043] Step 3: Loop through the density clustering algorithm to count the number of clusters, the number of noise points, and the number of samples in each cluster obtained after clustering analysis of the two-dimensional array of single-wave recognition, and finally write the above parameter values ​​into the array.

[0044] The above step 4 includes the following steps:

[0045] Step 1: Compress two sequences of unequal length into sequences of the same length using the dynamic time warping algorithm. Then obtain the cluster number sequences corresponding to the two sequences and convert the cluster number sequences into cluster number sequence strings.

[0046] Step 2: Compare the two longest common subsequences of the two cluster number sequence strings. If the two longest common subsequences are not aligned, use the elastic measurement method of dynamic time warping to perform dynamic time warping calculation on the sequences.

[0047] Among them, dynamic time warping is to align the time series, compressing the length of the longer time series to be consistent with the shorter time series. Suppose the lengths of the two time series are n and m, and construct a matrix grid with a length of n and a width of m. The matrix element (i, j) represents the distance from point i on the time series with a length of n to point j on the time series with a length of m. The smaller the distance, the higher the similarity. The purpose is to find a path along which the accumulated distance reaches the minimum value.

[0048] Step 3: Compress two time series of unequal lengths through the dynamic time rule algorithm to obtain two subsequences of the same length after compression. Calculate the average cumulative shortest distance during the compression process. This distance is the similarity between the two subsequences. From this, we can obtain the similarity between rows in the two-dimensional array data set of single wave identification in step 2, which is the similarity between single waves.

[0049] Step 4: Count the similarity values ​​obtained, and analyze based on all similarity values. For example, set the similarity threshold to 2.5, that is, if the similarity is less than 2.5, it is considered to be the same type of product, otherwise it is considered to be two products. Finally, count the number of product types.

[0050] The above disclosure is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A product data classification and statistical method based on time series analysis, characterized in that: The following steps are involved: S1: Store the acquired product dataset in a text file; S2: performing a preprocessing operation on the text file to obtain an analyzable time series data set, modulating the interval of the time series data set to achieve single wave recognition; S3: performing cluster analysis on the two-dimensional array of the single wave recognition by using a density clustering algorithm, setting parameters of the density clustering algorithm, giving a density threshold and a radius parameter value, and adjusting the radius parameter; S4: Perform alignment operations on given time subsequences through a dynamic time warping algorithm, calculate the average cumulative shortest distance of the subsequences, and regard the average cumulative shortest distance as the similarity between the subsequences. Classification is completed using the similarity between the subsequences, and the steps include: S41: compressing two sequences of unequal length into sequences of equal length using a dynamic time warping algorithm, then obtaining cluster number sequences corresponding to the two sequences, and converting the cluster number sequences into cluster number sequence strings; S42: comparing two longest common subsequences of two cluster number sequence strings, if the two longest common subsequences are not aligned, using a dynamic time warping elastic measurement method to perform dynamic time warping calculation on the sequences; S43: compressing two time series of unequal lengths by a dynamic time rule algorithm, obtaining two subsequences of the same length after compression, calculating the average cumulative shortest distance during the compression process, obtaining the similarity between rows in the two-dimensional array data set of the single wave identification in step 2, and obtaining the similarity between single waves; S44: Analyze the similarity values ​​obtained by statistics, and perform classification statistics by setting a similarity threshold.

2. The product data classification and statistical method based on time series analysis according to claim 1 is characterized in that: The step S2 specifically includes: S21: Read the text data, remove the first line of prompt information and the label of each line of the text, and obtain an operable data set; S22: retaining the floating-point data in the operable data set by rounding up, and outputting an analyzable time series data set; S23: Mark the modulation interval of the analyzable time series data set with 0 to separate waves and complete single wave identification; S24: All data in a wave are grouped into an array, and the final analyzable time series data set is output in the form of a two-dimensional array, where rows represent the changes in wave values ​​within a wave and columns represent different waves.

3. The product data classification and statistical method based on time series analysis according to claim 2 is characterized in that: The step S3 specifically includes: S31: input the two-dimensional array data set and the given density threshold and radius parameter value for clustering, calculate the cluster number to which each value in the data set belongs, and return the output cluster number sequence, clustering them into cluster 1 and cluster 0 respectively according to the value size of the result; S32: Set the density threshold to 2.0, set the radius range to [0.001, 1], and the step size to 0.05, cluster the input subarray, save the clustering results to a custom result object, and save all the results as an array, filter out the result objects with more than 1 clusters from the array, and take the largest radius parameter as the result of parameter adjustment. S33: Execute the density clustering algorithm in a loop, count the number of clusters, the number of noise points, and the number of samples in each cluster obtained after clustering analysis of the two-dimensional array of single wave recognition, and finally write the above parameter values ​​into the array.

4. The product data classification and statistical method based on time series analysis according to claim 1 is characterized in that: The dynamic time warping includes: aligning the time series to compress the length of the longer time series to be consistent with the shorter time series; assuming that the lengths of the two time series are n and m, constructing a matrix grid with a length of n and a width of m, the matrix element (i, j) represents the distance from the i point on the time series with a length of n to the j point on the time series with a length of m, the smaller the distance, the higher the similarity, and finding the path where the accumulated distance from point i to point j reaches the minimum value.

Citation Information

Patent Citations

  • Time series based topic development clustering analysis system and method

    CN108415910A

  • Equipment status monitoring method and apparatus

    JP5301717B1