A method, apparatus and device for pattern recognition of time series data

CN117972447BActive Publication Date: 2026-09-08CYBERINSIGHT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410148718.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-02
Publication Date
2026-09-08
Estimated Expiration
2044-02-02

AI Technical Summary

Benefits of technology

[0022] The pattern recognition method, apparatus, and device for time-series data provided in this application, by establishing recognition models corresponding to various preset time-series patterns, enable each preset time-series pattern recognition model to learn different features or rules, reducing overfitting of the recognition model to specific samples, mitigating the risk of overfitting, and improving recognition accuracy. Furthermore, by performing sliding window slicing on the target data to obtain multiple window data points and plotting the waveform corresponding to each window data point, and then processing the waveforms according to a preset image processing method to obtain the image data corresponding to each window data point, thus, firstly, through sliding window slicing, better control... Firstly, temporal resolution reduces data loss. Secondly, image data not only preserves the temporal information of time-series data but also solves the problem of different data amplitudes not being on the same scale in one-dimensional time-series data. In other words, by converting one-dimensional time-series data into image data, the problem of model failure caused by the mismatch between data amplitude and time scale during the recognition process can be avoided, thus improving the accuracy of recognition. It can efficiently and accurately identify patterns in time-series data, and then guide fault diagnosis and health management based on the recognition results, discover early faults, realize predictive maintenance, and ultimately improve the production efficiency and service life of chemical equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117972447B_ABST
    Figure CN117972447B_ABST
Patent Text Reader

Abstract

The application provides a mode recognition method, device and equipment for time series data. The mode recognition method, device and equipment for time series data provided by the application can better control the time resolution and reduce data loss information through a sliding window slicing. In addition, the image data can not only retain the time sequence information of the time series data, but also solve the problem that the data amplitude of different types in the one-dimensional time series data is not in the same scale. In other words, by converting the one-dimensional time series data into image data, the problem that the model is invalid due to the mismatch between the data amplitude and the time scale of different types of data in the identification process can be avoided, the accuracy of identification can be improved, the mode of the time series data can be efficiently and accurately identified, and then the fault diagnosis and health management can be guided based on the identification result, early faults can be found, and predictive maintenance can be achieved, thereby improving the production efficiency and service life of the chemical equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of fault diagnosis technology, and in particular to a method, apparatus and device for pattern recognition of time-series data. Background Technology

[0002] With the continuous increase in production demand and the improvement of industrialization, various industrial sectors such as manufacturing, energy, chemical, pharmaceutical, food, and metallurgy are facing increasingly complex operational and management challenges. Against this backdrop, research on prognostics and health management (PHM) of industrial equipment has become one of the key means to ensure safe production and improve equipment reliability in the industry.

[0003] Currently, most industrial equipment possesses basic automated control and data monitoring capabilities, meaning that most equipment has implemented a Distributed Control System (DCS). This allows for fault diagnosis and health management using DCS data (time-series data). When using DSC data for fault diagnosis and health management, it is often necessary to identify the time-series patterns in the DCS data. Therefore, there is an urgent need to provide a pattern recognition method for time-series data to efficiently and accurately identify patterns. Summary of the Invention

[0004] In view of this, this application provides a method, apparatus and device for pattern recognition of time series data, which can efficiently and accurately identify patterns in time series data, and then discover early fault signs based on the recognition results to achieve predictive maintenance.

[0005] Specifically, this application is implemented through the following technical solution:

[0006] A first aspect of this application provides a pattern recognition method for time-series data, the method comprising:

[0007] The time series data to be identified is used as the target data. According to the preset window size, the target data is sliced ​​by sliding window to obtain multiple window data.

[0008] Draw the waveform corresponding to each window data, and perform image processing on the waveform according to a preset image processing method to obtain the image data corresponding to each window data;

[0009] The multiple image data corresponding to the multiple window data are input into the pre-trained recognition model corresponding to various preset time sequence patterns, so that the recognition model can identify the similarity between each image data in the multiple image data and the preset time sequence pattern, and determine the image data with the highest similarity as the image data in the preset time sequence pattern.

[0010] The target image data with the highest similarity is found from the image data under various preset time series models, and the target window data corresponding to the target image data and the preset time series mode to which the target image data belongs are determined as the recognition result of this pattern recognition.

[0011] The target data is segmented using the target window data to obtain multiple segmented fragments;

[0012] For a target segment outside the target window data among the multiple segmented segments, if the length of the target segment is greater than the preset window size, the target segment is used as the target data, and the sliding window slicing process is performed on the target data again.

[0013] A second aspect of this application provides a pattern recognition device for time-series data, the device comprising a processing module, a determination module, and a segmentation module; wherein...

[0014] The processing module is used to take the time series data to be identified as the target data, and perform sliding window slicing processing on the target data according to a preset window size to obtain multiple window data.

[0015] The processing module is also used to draw the waveform corresponding to each window data, and to perform image processing on the waveform according to a preset image processing method to obtain the image data corresponding to each window data;

[0016] The determining module is used to input multiple image data corresponding to the multiple window data into a pre-trained recognition model corresponding to various preset time-series patterns, so that the recognition model can identify the similarity between each image data in the multiple image data and the preset time-series pattern, and determine the image data with the highest similarity as the image data in the preset time-series pattern.

[0017] The determining module is also used to find the target image data with the highest similarity from the image data under various preset time series models, and to determine the target window data corresponding to the target image data and the preset time series mode to which the target image data belongs as the recognition result of this pattern recognition.

[0018] The segmentation module is used to segment the target data using the target window data to obtain multiple segmented segments;

[0019] The processing module is further configured to, for target segmentation segments other than the target window data among the plurality of segmentation segments, when the length of the target segmentation segment is greater than the preset window size, treat the target segmentation segment as target data and perform sliding window slicing processing on the target data again.

[0020] A third aspect of this application provides a pattern recognition device for time-series data, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the methods provided in the first aspect of this application.

[0021] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods provided in the first aspect of this application.

[0022] The pattern recognition method, apparatus, and device for time-series data provided in this application, by establishing recognition models corresponding to various preset time-series patterns, enable each preset time-series pattern recognition model to learn different features or rules, reducing overfitting of the recognition model to specific samples, mitigating the risk of overfitting, and improving recognition accuracy. Furthermore, by performing sliding window slicing on the target data to obtain multiple window data points and plotting the waveform corresponding to each window data point, and then processing the waveforms according to a preset image processing method to obtain the image data corresponding to each window data point, thus, firstly, through sliding window slicing, better control... Firstly, temporal resolution reduces data loss. Secondly, image data not only preserves the temporal information of time-series data but also solves the problem of different data amplitudes not being on the same scale in one-dimensional time-series data. In other words, by converting one-dimensional time-series data into image data, the problem of model failure caused by the mismatch between data amplitude and time scale during the recognition process can be avoided, thus improving the accuracy of recognition. It can efficiently and accurately identify patterns in time-series data, and then guide fault diagnosis and health management based on the recognition results, discover early faults, realize predictive maintenance, and ultimately improve the production efficiency and service life of chemical equipment. Attached Figure Description

[0023] Figure 1 A flowchart of an embodiment of the pattern recognition method for time-series data provided in this application;

[0024] Figure 2 Waveform diagrams of various timing modes illustrated in an exemplary embodiment of this application;

[0025] Figure 3A schematic diagram illustrating the implementation principle of segmented target data as an exemplary embodiment of this application;

[0026] Figure 4 A flowchart of Embodiment 2 of the pattern recognition method for time-series data provided in this application;

[0027] Figure 5 A flowchart of Embodiment 3 of the pattern recognition method for time-series data provided in this application;

[0028] Figure 6 A schematic diagram of the generator structure shown in an exemplary embodiment of this application;

[0029] Figure 7 This is a schematic diagram of the structure of a discriminator shown in an exemplary embodiment of this application;

[0030] Figure 8 A schematic diagram of a twin network shown in an exemplary embodiment of this application;

[0031] Figure 9 A hardware structure diagram of a pattern recognition device for time-series data, provided in this application;

[0032] Figure 10 A schematic diagram of the structure of a pattern recognition device for time-series data provided in this application, according to Embodiment 1. Detailed Implementation

[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0034] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0035] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0036] As a pillar industry of the national economy, the chemical industry faces increasingly complex operational and management challenges due to rising production demands and improved industrialization. Against this backdrop, research on fault diagnosis and health management of chemical equipment has become one of the key means to ensure safe production and improve equipment reliability in the industry.

[0037] Currently, the vast majority of chemical equipment possesses automated control and data monitoring capabilities, meaning that most equipment utilizes Distributed Control Systems (DCS). This allows for fault diagnosis and health management using DCS data (time-series data). For example, mechanistic models based on expert experience primarily extract fault characteristics from chemical equipment using high-frequency vibration data, then design relevant alarm thresholds for fault diagnosis. This method relies excessively on expert knowledge and experience, requires customized design and configuration for different equipment, and necessitates the use of high-frequency vibration data sources outside the DCS data scope, requiring additional sensors and acquisition equipment. This results in high data acquisition costs, high modeling costs, and cumbersome configuration. On the other hand, data-driven approaches build classification or detection models based on large amounts of data combined with machine learning techniques. This method has already been widely applied in the chemical industry. However, for classification models, such as SVM, random forest, and KNN, there is a problem of over-reliance on sample data. In real production environments, there are almost no full negative samples to support classification modeling. For detection models, such as 3sigma, isolated forest, and principal component analysis (PCA), they are often based on distance, correlation, and other information for modeling. These modeling methods have relatively strict requirements on boundary conditions and data distribution. If the threshold is not set properly, false negatives and false positives will often occur.

[0038] The methods described above focus more on the distribution, boundaries, or thresholds of data, ignoring changes in the form or pattern of the data. In actual production, some data features may not exceed the set thresholds or boundaries, but their form or pattern may deviate from the normal level. Such phenomena contain equipment fault information. Therefore, it is very necessary to perform time-series pattern recognition on the data and then perform fault diagnosis based on the recognition results.

[0039] Common time-series data pattern recognition methods include symbol-based methods such as PAA and SAX, distance-based methods such as 1NN and DTW, and shapelets-based methods based on similarity analysis. These methods often have obvious requirements on time and numerical scale, can only be used for specific analysis of a certain type of data, lack versatility, and are difficult to apply in actual production.

[0040] Therefore, there is an urgent need to provide a method, apparatus, and device for pattern recognition of time-series data in order to efficiently and accurately identify patterns in time-series data.

[0041] This application provides a method, apparatus, and device for pattern recognition of time-series data, which can efficiently and accurately identify patterns in time-series data, and then discover early signs of faults based on the recognition results to achieve predictive maintenance.

[0042] The pattern recognition method, apparatus, and device for time-series data provided in this application, by establishing recognition models corresponding to various preset time-series patterns, enable each preset time-series pattern recognition model to learn different features or rules, reducing overfitting of the recognition model to specific samples, mitigating the risk of overfitting, and improving recognition accuracy. Furthermore, by performing sliding window slicing on the target data to obtain multiple window data points and plotting the waveform corresponding to each window data point, and then processing the waveforms according to a preset image processing method to obtain the image data corresponding to each window data point, thus, firstly, through sliding window slicing, better control... Firstly, temporal resolution reduces data loss. Secondly, image data not only preserves the temporal information of time-series data but also solves the problem that the amplitudes of different types of data in one-dimensional time-series data are not on the same scale. In other words, by converting one-dimensional time-series data into image data, the problem of model failure caused by the mismatch between the amplitude and time scale of different types of data during the recognition process can be avoided, which can improve the accuracy of recognition. It can efficiently and accurately identify the patterns of time-series data, and then guide fault diagnosis and health management based on the recognition results, discover early faults, realize predictive maintenance, and thus improve the production efficiency and service life of chemical equipment.

[0043] The following specific embodiments are given to illustrate the technical solution of this application in detail.

[0044] Figure 1 A flowchart of an embodiment of the pattern recognition method for time-series data provided in this application. Please refer to... Figure 1 The method provided in this embodiment may include:

[0045] S101. The time series data to be identified is used as the target data. According to the preset window size, the target data is sliced ​​by sliding window to obtain multiple window data.

[0046] Specifically, time-series data refers to a set of data arranged in chronological order, where each data point carries time information. In this embodiment, the time-series data can be DSC data from chemical equipment.

[0047] In practice, the target data can be sliced ​​using a sliding window according to a preset window size and a preset sliding step size.

[0048] It should be noted that the preset window size refers to the number of time steps contained in the target data, and the preset sliding step size refers to the step size of each slide. The preset window size and preset sliding step size are set according to actual needs; in this embodiment, the specific values ​​of the preset window size and preset sliding step size are not limited. For example, in one embodiment, the preset window size is j, and the preset sliding step size is k.

[0049] It should be noted that, with a preset window size of j and a preset sliding step of k, after performing sliding window slicing on the target data, multiple window data are obtained. Each window data can be represented as x_smooth. (i,j,k) , where (i,j,k) is the window information of the window data, i is the number of slides (i is an integer, i.e., i is 0, 1, 2, 3, ...), j is the preset window size, and k is the preset slide step size.

[0050] Optionally, in one possible implementation of this application, before performing sliding window slicing on the target data, the method further includes:

[0051] The target data is then smoothed.

[0052] Specifically, the smoothing method is set according to actual needs, and this embodiment does not limit it. For example, in one embodiment, the target data can be smoothed by local weighted regression.

[0053] The method provided in this application can reduce or eliminate noise, fluctuations, or irregularities in target data by smoothing the target data, making the data smoother and more stable.

[0054] S102. Draw the waveform corresponding to each window data, and perform image processing on the waveform according to a preset image processing method to obtain the image data corresponding to each window data.

[0055] In practice, for each window of data, the waveform corresponding to that window's data can be plotted with the data volume on the x-axis and the amplitude on the y-axis.

[0056] Furthermore, the preset image processing method is set according to actual needs, and this embodiment does not limit it. For example, in one possible implementation, the preset image processing method includes at least one of the following image processing methods: grayscale conversion, binarization, sharpening, and smoothing.

[0057] Grayscale conversion preserves the brightness information of an image, reducing its complexity when color information is not needed. Binarization transforms an image into a black-and-white format, enhancing edge details. Sharpening enhances image clarity and detail. Smoothing makes images smoother and more stable.

[0058] Specifically, image processing of the waveform yields a processed image. Furthermore, based on the processed image, image data corresponding to each window can be obtained. It should be noted that the image data corresponding to each window can be represented by a two-dimensional matrix. For example, when the size of the processed image is m*n, the image data corresponding to that window can be represented as Tij, which is an m*n two-dimensional matrix. The element Tij in this matrix represents the pixel value corresponding to the pixel in the i-th row and j-th column of the processed image.

[0059] Furthermore, referring to the preceding description, for ease of explanation, the image data corresponding to each window's data is denoted as imag. (i,j,k) The image data is then stored in `imag_group`, while retaining the window information. It should be noted that after the above processing, one-dimensional time-series data is transformed into two-dimensional image data, which not only preserves the morphological information of the time-series data but also solves the problem that different types of data amplitudes are not on the same scale in one-dimensional time-series data.

[0060] S103. Input the multiple image data corresponding to the multiple window data into the pre-trained recognition model corresponding to various preset time sequence patterns, so that the recognition model can identify the similarity between each image data in the multiple image data and the preset time sequence pattern, and determine the image data with the highest similarity as the image data in the preset time sequence pattern.

[0061] Referring to the preceding description, for ease of explanation, for example, in one embodiment, based on the target data, the obtained multiple window data include Q window data (for ease of explanation, these Q window data are sequentially labeled A, B, C, ... Q), and the image data corresponding to each window data is an m*n matrix. Then, the multiple image data corresponding to the multiple window data is an m*n*Q matrix. In this step, the m*n*Q matrix is ​​input into the pre-trained recognition model corresponding to various preset temporal patterns.

[0062] Specifically, the preset time series patterns involved in the pre-trained recognition models corresponding to various preset time series patterns are set according to actual needs, and this embodiment does not limit them. In one possible implementation, the preset time series patterns include at least the following two time series patterns: upward trend, downward trend, periodic trend, upward step trend, downward step trend, and stationary trend. Correspondingly, the pre-trained recognition models corresponding to various preset time series patterns include at least the following two recognition models: recognition model corresponding to upward trend, recognition model corresponding to downward trend, recognition model corresponding to periodic trend, recognition model corresponding to upward step trend, recognition model corresponding to downward step trend, and recognition model corresponding to stationary trend. The following explanation uses the following example to illustrate the pre-trained recognition models corresponding to various preset time series patterns, which include recognition model 1 corresponding to upward trend, recognition model 2 corresponding to downward trend, recognition model 3 corresponding to periodic trend, recognition model 4 corresponding to upward step trend, recognition model 5 corresponding to downward step trend, and recognition model 6 corresponding to stationary region.

[0063] It should be noted that, Figure 2 Waveform diagrams of various preset timing modes illustrated in an exemplary embodiment of this application. Please refer to... Figure 2 , Figure 2 Figure A in the graph shows the waveform corresponding to an upward trend. Figure 2 As shown in Figure A, the upward trend refers to the gradual increase in the data amplitude over time. Figure 2 Figure B in the graph shows the waveform corresponding to the downward trend. Figure 2 As shown in Figure B, the downward trend refers to the gradual decrease in data amplitude over time. Figure 2 Figure C in the diagram is the waveform corresponding to the upward step trend. Figure 2 As shown in Figure C, the upward step trend refers to the data amplitude first stagnating over time and then rising rapidly. Figure 2 The D-graph in the diagram is the waveform corresponding to the downward step trend. Figure 2 As shown in Figure D, the downward step trend refers to the data amplitude first stagnating over time and then rapidly decreasing. Figure 2 The E-chart in the diagram represents the waveform corresponding to a periodic trend. Figure 2 As shown in Figure E, a periodic trend refers to the periodic increase or decrease of data amplitude over time. Figure 2 The F-chart in the diagram represents the waveform corresponding to a stable trend. Figure 2 As shown in the F-chart, a steady trend means that the data amplitude does not change significantly over time.

[0064] In practical implementation, referring to the example above, this step involves inputting multiple image data into the recognition model 1 corresponding to the upward trend. Following the previous example, Q image data corresponding to Q window data are input into recognition model 1 (i.e., an m*n*Q matrix is ​​input into recognition model 1). Furthermore, recognition model 1 outputs Q similarity scores, where one of these similarity scores represents the similarity between an image data point and the upward trend. It should be noted that recognition model 1 also identifies the image data with the highest similarity among these Q similarity scores as the image data under the upward trend. For example, in one embodiment, referring to the previous example, recognition model 1 identifies image data A as the image data with the highest similarity among the Q image data points; in this case, image data A is determined to be the image data under the upward trend.

[0065] Similarly, further, after identifying multiple image data corresponding to multiple window data through identification models 2, 3, 4, 5 and 6 respectively, image data B is determined to be image data under a downward trend, image data C is determined to be image data under a periodic trend, image data D is determined to be image data under an upward step trend, image data E is determined to be image data under a downward step trend, and image data F is determined to be image data under a stationary trend.

[0066] S104. Find the target image data with the highest similarity from the image data under various preset time series models, and determine the target window data corresponding to the target image data and the preset time series mode to which the target image data belongs as the recognition result of this pattern recognition.

[0067] Specifically, referring to the example above, this step involves searching for the target image data with the highest similarity among image data A, image data B, image data C, image data D, image data E, and image data F. For example, in one embodiment, if the found target image data is image data B, then the target window data x_smooth corresponding to image data B is... (i1,j1,k1) The downward trend of image data B is determined as the recognition result of this pattern recognition. In other words, the recognition result of this pattern recognition is: window data x_smooth (i1,j1,k1) The time series pattern shows a downward trend.

[0068] It should be noted that, as described above, the image data corresponding to each window retains window information. When the target image data is found, the corresponding target window data can be determined based on the window information of the target image data (the window information of the target window data is consistent with the window information of the target image data).

[0069] S105. The target data is segmented using the target window data to obtain multiple segmented segments.

[0070] Specifically, Figure 3 This is a schematic diagram illustrating the implementation principle of segmented target data, as shown in an exemplary embodiment of this application. Please refer to... Figure 3 ,exist Figure 3 In the example shown, when segmenting target data using target window data, the start and end points of the target window data can be used as segmentation points to divide the target data into multiple segments. For example, in Figure 3 In the example shown, after segmenting the target data using the target window data, the target data is divided into three segments: segment 1, target window data, and segment 2.

[0071] S106. For the target segment outside the target window data among the multiple segmented segments, when the length of the target segment is greater than the preset window size, the target segment is taken as the target data, and the sliding window slicing process is performed on the target data again.

[0072] It should be noted that, as described above, for each segment, since the temporal pattern of the target window data has been determined, it is necessary to further determine the temporal pattern of other segment segments. Therefore, in this step, the temporal pattern of the target segment other than the target window data among the multiple segment segments is further determined.

[0073] In practice, for each target segment, if the length of the target segment is less than or equal to the preset window size, then because the target segment is too short to analyze its temporal pattern, it is not processed. Furthermore, if the length of the target segment is greater than the preset window size, then the target segment can be used as target data, and the sliding window slicing process can be performed again on the target data to further determine the temporal pattern.

[0074] Specifically, referring to the example above, in this step, for segment 1 and segment 2, the target segment with a length greater than the preset window size is found to be segment 1. In this step, segment 1 is used as the target data, and the sliding window slicing process is performed again.

[0075] The pattern recognition method for time-series data provided in this embodiment establishes recognition models corresponding to various preset time-series patterns. This allows each preset time-series pattern's recognition model to learn different features or rules, reducing overfitting of the recognition model to specific samples and lowering the risk of overfitting, thus improving recognition accuracy. Furthermore, by performing sliding window slicing on the target data to obtain multiple window data points and plotting the waveform for each window, and then processing the waveforms according to a preset image processing method, image data corresponding to each window is obtained. Firstly, sliding window slicing allows for better control of time resolution and reduces data loss. Secondly, image data not only preserves the temporal information of the time-series data but also solves the problem of different data types having different amplitudes on different scales in one-dimensional time-series data. In other words, by converting one-dimensional time-series data into image data, the problem of model failure due to mismatch between data amplitude and time scale during the recognition process can be avoided, improving recognition accuracy. This method can efficiently and accurately identify patterns in time-series data, and based on the recognition results, guide fault diagnosis and health management, detect early faults, achieve predictive maintenance, and ultimately improve the production efficiency and service life of chemical equipment.

[0076] Figure 4 The flowchart is for Embodiment 2 of the pattern recognition method for time-series data provided in this application. Please refer to... Figure 4 The method provided in this embodiment, based on the above embodiments, includes the following training process for the recognition model corresponding to each preset time-series pattern:

[0077] S401. Using the sample generation model, generate sample data corresponding to each preset time series pattern.

[0078] Specifically, the sample generation model can generate sample data for different preset time series patterns, producing sample data corresponding to each preset time series pattern. For example, based on the above example, the sample generation model can generate sample data corresponding to an upward trend, thus obtaining sample dataset 1 for an upward trend; the sample generation model can generate sample data corresponding to a downward trend, thus obtaining sample dataset 2 for a downward trend; the sample generation model can generate sample data corresponding to an upward step trend, thus obtaining sample data 3 for an upward step trend; the sample generation model can generate sample data corresponding to a downward step trend, thus obtaining sample dataset 4 for a downward step trend; the sample generation model can generate sample data corresponding to a periodic trend, thus obtaining sample data 5 for a periodic trend; and the sample generation model can generate sample data corresponding to a stationary trend, thus obtaining sample dataset 6 for a stationary trend.

[0079] For example, in one embodiment, the sample generation model can be a model built based on generative adversarial networks, variational autoencoders, autoregressive models, autoencoders, etc. This embodiment does not limit its scope.

[0080] Optionally, in one possible implementation of this application, specifically, Figure 5 The flowchart for Embodiment 3 of the pattern recognition method for time-series data provided in this application is shown below. Please refer to... Figure 5 The method provided in this embodiment, based on the above embodiments, includes the following step: generating sample data corresponding to each preset time series pattern using a sample generation model.

[0081] S501. For each type of preset timing pattern, obtain the real data corresponding to that type of preset timing pattern; wherein, the timing pattern of the real data is that type of preset timing pattern.

[0082] Specifically, referring to the examples above, the preset time series patterns include upward trend, downward trend, cyclical trend, upward step trend, downward step trend, and stationary trend. This step defines the basic forms of various preset time series patterns and obtains the corresponding real data. It should be noted that the time series pattern of the real data is the preset time series pattern of this type. This real data can be actual data obtained or virtual data simulated by simulation software; this embodiment does not limit this.

[0083] S502. The generator in the generative adversarial network is trained using the real data through an adversarial game mechanism. When the discriminator in the generative adversarial network determines that the data generated by the generator meets the evaluation criteria, the generative adversarial network is used as a sample generation model for generating sample data corresponding to the preset time series pattern.

[0084] Specifically, a generative adversarial network consists of a generator and a discriminator. Figure 6 This is a schematic diagram of the generator structure shown in an exemplary embodiment of this application. Figure 7 This is a schematic diagram illustrating the structure of a discriminator as shown in an exemplary embodiment of this application. Please refer to... Figure 6 The generator includes an input layer ( Figure 6 In this context, `dense_1_input` represents the input layer and `hidden_layer_1`. Figure 6 In the text, dense_1 represents hidden layer 1 and hidden layer 2. Figure 6 In this context, dense_2 represents hidden layer 2 and output layer 2. Figure 6 In this context, dense_3 represents the output layer.

[0085] The input layer is a fully connected (dense) layer with one neuron, receiving an input vector of dimension 1. Hidden layer 1 is a fully connected layer with 256 neurons, using the LeakyReLU activation function to introduce a non-linear relationship. Hidden layer 2 is a fully connected layer with 512 neurons, also using the LeakyReLU activation function. The output layer is a fully connected layer with one neuron, using a linear activation function (not shown in the diagram).

[0086] For further details, please refer to Figure 7 The discriminator includes an input layer ( Figure 7 In this context, `dense_4_input` represents the input layer and `hidden_layer_1`. Figure 7 In the text, dense_4 represents hidden layer 1 and hidden layer 2. Figure 7 In this context, dense_5 represents hidden layer 2 and output layer 2. Figure 7 In this context, dense_6 represents the output layer.

[0087] The input layer is a fully connected layer with one neuron, receiving an input vector of dimension 1. Hidden layer 1 is a fully connected layer with 512 neurons, using the LeakyReLU activation function to introduce a non-linear relationship. Hidden layer 2 is a fully connected layer with 256 neurons, also using the LeakyReLU activation function. The output layer is a fully connected layer with one neuron, using the Sigmoid activation function (not shown in the diagram).

[0088] In practice, the generator and discriminator are stacked sequentially using a linear stacking method, with the discriminator set to be non-trainable. Real data is used as the actual input samples, and noisy data with a mean of 0 and a standard deviation of 0.05 following a normal distribution is introduced as noise samples. The training iterations are set to 100 times, with a training stride of 64. The discriminator and generative adversarial network are compiled, using a binary cross-entropy loss function and the Adam optimizer. During training, the generator learns to generate sample data from the noise samples, and the discriminator learns to distinguish between real data and the generator-generated sample data, striving to classify the generator-generated sample data as real data as possible.

[0089] S503. Generate sample data corresponding to the preset time series pattern using the sample generation model.

[0090] Specifically, once the model is trained, sample data can be generated based on the model. For example, in one possible implementation, 100 sets of sample data are generated for each preset time series pattern to obtain the sample dataset corresponding to that preset time series pattern.

[0091] The method provided in this application utilizes sample data generated by adversarial neural networks, which not only ensures that the sample data follows a consistent distribution with the real data, but also improves the diversity of the data, expands the original dataset, and reduces the labeling cost.

[0092] Optionally, in one possible implementation of this application, the generative adversarial network can be replaced with a network structure such as a variational autoencoder or an autoregressive model, which can also achieve the purpose of generating sample data corresponding to the preset data pattern.

[0093] S402. Draw the waveform corresponding to the sample data, and perform image processing on the waveform corresponding to the sample data according to the preset image processing method to obtain the training samples corresponding to each preset time series model.

[0094] In practice, for each sample data, the waveform corresponding to that sample data can be plotted with the data volume as the horizontal axis and the amplitude as the vertical axis.

[0095] Furthermore, referring to the preceding description, the preset image processing method includes at least one of the following image processing methods: grayscale conversion, binarization, sharpening, and smoothing.

[0096] Specifically, after image processing of the waveform corresponding to the sample data, a processed waveform is obtained. Based on the processed waveform, the corresponding training samples can be obtained. As mentioned earlier, each training sample is a two-dimensional matrix, and each element of this two-dimensional matrix is ​​the pixel value of each pixel in the processed waveform.

[0097] S403. For each type of preset time sequence pattern, use the training samples corresponding to that type of preset time sequence pattern as positive samples and use the training samples corresponding to other types of preset time sequence patterns as negative samples to train the recognition model corresponding to that type of preset time sequence pattern, and obtain the trained recognition model corresponding to that type of preset time sequence pattern; wherein, the number of training samples contained in the positive samples is the same as the number of training samples contained in the negative samples.

[0098] Specifically, the number of training samples included in the positive and negative samples is set according to actual needs, and this embodiment does not limit this. For example, in one embodiment, the number of training samples included in both the positive and negative samples is 100.

[0099] For example, in one possible implementation, for a downward trend, in this step, 100 training samples corresponding to the downward trend are taken as positive samples, and 100 training samples are randomly selected from the training samples corresponding to the upward trend, cyclical trend, upper step trend, lower step trend and stationary trend as negative samples.

[0100] In practical implementation, when training the recognition model using positive and negative samples, a Siamese network can be selected as the initial recognition model. For example, the SiameseNetwork model can be used as the initial recognition model for training. It should be noted that... Figure 8 This is a schematic diagram illustrating a twin network as shown in an exemplary embodiment of this application. Please refer to... Figure 8 The network comprises a feature extraction layer, an Euclidean distance calculation layer, and an output layer (not shown in the figure). The feature extraction layer uses the VGG16 model to extract features from the input, mapping positive input samples to a one-dimensional feature vector f0 and negative input samples to a one-dimensional feature vector f1. The Euclidean distance calculation layer calculates the Euclidean distance between f1 and f0, where the Euclidean distance represents the difference between the two vectors, denoted as distance. Finally, the output layer is implemented through a fully connected layer, which uses the sigmoid function to process the distance and output the similarity score.

[0101] It should be noted that during training, contrastive loss is used as the loss function. This loss function pushes similar samples closer together in the feature space by minimizing the Euclidean distance or cosine similarity between them, while maximizing the distance between dissimilar samples.

[0102] It should be noted that the initial recognition model can also be a transformation learning model, a matching network, etc., but this embodiment does not limit it.

[0103] Furthermore, training a recognition model for each predefined temporal pattern using contrastive learning offers an advantage over training a multi-class temporal pattern recognition model. Contrastive learning emphasizes the differences between categories by comparing the similarity between samples. In contrast, multi-class temporal pattern recognition models may encounter difficult decision boundaries between categories, leading to inaccurate classification of new samples. Training a recognition model for each predefined temporal pattern using contrastive learning reduces the risk of overfitting. Each model may learn different features or rules during training, thus reducing overfitting to specific samples. Integrating the recognition results of multiple models allows for the combined advantages of each, improving the model's generalization performance. Additionally, contrastive learning is better suited for imbalanced datasets. For datasets with fewer samples in certain categories, training a single multi-class temporal pattern recognition model may result in poor recognition performance for these minority categories. Contrastive learning can learn the differences between different categories by comparing similarities, thereby balancing the distribution of training samples between different categories. Contrastive learning can easily support online learning, that is, when defining a new temporal pattern, only new sample pairs and their corresponding models need to be built, without retraining the entire model. This is very useful for online learning or when existing models need to be applied in different domains.

[0104] Corresponding to the aforementioned embodiment of a pattern recognition method for time-series data, this application also provides an embodiment of a pattern recognition device for time-series data.

[0105] The embodiments of the time-series data pattern recognition device provided in this application can be applied to time-series data pattern recognition devices. The device embodiments can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of the time-series data pattern recognition device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 9 The diagram shown is a hardware structure diagram of a time-series data pattern recognition device, where the time-series data pattern recognition device provided in this application is located. (Except for...) Figure 9 In addition to the processor, memory, network interface, and non-volatile memory shown, the pattern recognition device for the time-series data in the embodiment may also include other hardware depending on the actual function of the pattern recognition device for the time-series data, which will not be described in detail here.

[0106] Figure 10 A schematic diagram of the structure of a pattern recognition device for time-series data provided in this application, according to Embodiment 1. Please refer to... Figure 10The apparatus provided in this embodiment includes a processing module 1010, a determining module 1020, and a segmentation module 1030; wherein,

[0107] The processing module 1010 is used to take the time series data to be identified as the target data, and perform sliding window slicing processing on the target data according to a preset window size to obtain multiple window data.

[0108] The processing module 1010 is also used to draw the waveform corresponding to each window data, and to perform image processing on the waveform according to a preset image processing method to obtain the image data corresponding to each window data.

[0109] The determining module 1020 is used to input multiple image data corresponding to the multiple window data into a pre-trained recognition model corresponding to various preset time-series patterns, so that the recognition model can identify the similarity between each image data in the multiple image data and the preset time-series pattern, and determine the image data with the highest similarity as the image data in the preset time-series pattern.

[0110] The determining module 1020 is further configured to search for the target image data with the highest similarity from image data under various preset time series models, and determine the target window data corresponding to the target image data and the preset time series mode to which the target image data belongs as the recognition result of this pattern recognition.

[0111] The segmentation module 1030 is used to segment the target data using the target window data to obtain multiple segmented segments;

[0112] The processing module 1010 is further configured to, for a target segment outside the target window data among the plurality of segmented segments, when the length of the target segment is greater than the preset window size, treat the target segment as target data and perform sliding window slicing processing on the target data again.

[0113] The apparatus provided in this embodiment can be used to perform... Figure 1 The steps of the method embodiment shown are similar in principle and process, and will not be repeated here.

[0114] Optionally, the training process for the recognition model corresponding to each preset time-series pattern includes:

[0115] Using a sample generation model, sample data corresponding to each preset time series pattern is generated;

[0116] Draw the waveform corresponding to the sample data, and perform image processing on the waveform corresponding to the sample data according to the preset image processing method to obtain the training samples corresponding to each preset time series model.

[0117] For each preset time sequence pattern, the training samples corresponding to that preset time sequence pattern are used as positive samples, and the training samples corresponding to other preset time sequence patterns are used as negative samples to train the recognition model corresponding to that preset time sequence pattern, thus obtaining the trained recognition model corresponding to that preset time sequence pattern; wherein, the number of training samples contained in the positive samples is the same as the number of training samples contained in the negative samples.

[0118] Optionally, the step of using a sample generation model to generate sample data corresponding to each preset time series pattern includes:

[0119] For each preset timing pattern, obtain the real data corresponding to that preset timing pattern; wherein, the timing pattern of the real data is that preset timing pattern.

[0120] The generator in the generative adversarial network is trained using the real data through an adversarial game mechanism. When the discriminator in the generative adversarial network determines that the data generated by the generator meets the evaluation criteria, the generative adversarial network is used as a sample generation model for generating sample data corresponding to the preset time series pattern.

[0121] The sample generation model is used to generate sample data corresponding to the preset time series pattern.

[0122] Optionally, the processing module is further configured to smooth the target data before performing sliding window slicing processing on the target data.

[0123] Optionally, the preset image processing method includes at least one of the following image processing methods: grayscale conversion, binarization, sharpening, and smoothing.

[0124] Optionally, the pre-trained recognition models corresponding to various preset time series patterns include at least the following two recognition models: recognition model corresponding to an upward trend, recognition model corresponding to a downward trend, recognition model corresponding to a periodic trend, recognition model corresponding to an upward step trend, recognition model corresponding to a downward step trend, and recognition model corresponding to a steady trend.

[0125] Please continue to refer to Figure 9 This application also provides a pattern recognition device for time-series data, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of any of the methods provided in the first aspect of this application.

[0126] Furthermore, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods provided in the first aspect of this application.

[0127] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0128] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0129] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A pattern recognition method for time-series data, characterized in that, The method includes: The time series data to be identified is used as the target data. According to the preset window size, the target data is sliced ​​by sliding window to obtain multiple window data. Draw the waveform corresponding to each window's data, and perform image processing on the waveform according to a preset image processing method to obtain the image data corresponding to each window's data; The multiple image data corresponding to the multiple window data are input into the pre-trained recognition model corresponding to various preset time sequence patterns, so that the recognition model can identify the similarity between each image data in the multiple image data and the preset time sequence pattern, and determine the image data with the highest similarity as the image data in the preset time sequence pattern. The target image data with the highest similarity is found from the image data under various preset time series models, and the target window data corresponding to the target image data and the preset time series mode to which the target image data belongs are determined as the recognition result of this pattern recognition. The target data is segmented using the target window data to obtain multiple segmented fragments; For a target segment outside the target window data among the multiple segmented segments, if the length of the target segment is greater than the preset window size, the target segment is taken as the target data, and the sliding window slicing process is performed on the target data again. The training process for the recognition model corresponding to each preset time sequence pattern includes: Using a sample generation model, sample data corresponding to each preset time series pattern is generated; Draw the waveform corresponding to the sample data, and perform image processing on the waveform corresponding to the sample data according to the preset image processing method to obtain the training samples corresponding to each preset time series model. For each preset time sequence pattern, the training samples corresponding to that preset time sequence pattern are used as positive samples, and the training samples corresponding to other preset time sequence patterns are used as negative samples to train the recognition model corresponding to that preset time sequence pattern, thus obtaining the trained recognition model corresponding to that preset time sequence pattern; wherein, the number of training samples contained in the positive samples is the same as the number of training samples contained in the negative samples. The step of using a sample generation model to generate sample data corresponding to each preset time series pattern includes: For each preset timing pattern, obtain the real data corresponding to that preset timing pattern; wherein, the timing pattern of the real data is that preset timing pattern. The generator in the generative adversarial network is trained using the real data through an adversarial game mechanism. When the discriminator in the generative adversarial network determines that the data generated by the generator meets the evaluation criteria, the generative adversarial network is used as a sample generation model for generating sample data corresponding to the preset time series pattern. The sample generation model is used to generate sample data corresponding to the preset time series pattern.

2. The method according to claim 1, characterized in that, Before performing sliding window slicing on the target data, the method further includes: The target data is then smoothed.

3. The method according to claim 1, characterized in that, The preset image processing method includes at least one of the following image processing methods: grayscale conversion, binarization, sharpening, and smoothing.

4. The method according to claim 1, characterized in that, The pre-trained recognition models corresponding to various preset time series patterns include at least the following two recognition models: recognition model corresponding to an upward trend, recognition model corresponding to a downward trend, recognition model corresponding to a periodic trend, recognition model corresponding to an upward step trend, recognition model corresponding to a downward step trend, and recognition model corresponding to a steady trend.

5. A pattern recognition device for time-series data, characterized in that, The device includes a processing module, a determining module, and a segmentation module; wherein... The processing module is used to take the time series data to be identified as the target data, and perform sliding window slicing processing on the target data according to a preset window size to obtain multiple window data. The processing module is also used to draw the waveform corresponding to each window data, and to perform image processing on the waveform according to a preset image processing method to obtain the image data corresponding to each window data; The determining module is used to input multiple image data corresponding to the multiple window data into a pre-trained recognition model corresponding to various preset time-series patterns, so that the recognition model can identify the similarity between each image data in the multiple image data and the preset time-series pattern, and determine the image data with the highest similarity as the image data in the preset time-series pattern. The determining module is also used to find the target image data with the highest similarity from the image data under various preset time series models, and to determine the target window data corresponding to the target image data and the preset time series mode to which the target image data belongs as the recognition result of this pattern recognition. The segmentation module is used to segment the target data using the target window data to obtain multiple segmented segments; The processing module is further configured to, for target segmentation segments other than the target window data among the plurality of segmentation segments, when the length of the target segmentation segment is greater than the preset window size, treat the target segmentation segment as target data and perform the sliding window slicing process on the target data again; The training process for the recognition model corresponding to each preset time sequence pattern includes: Using a sample generation model, sample data corresponding to each preset time series pattern is generated; Draw the waveform corresponding to the sample data, and perform image processing on the waveform corresponding to the sample data according to the preset image processing method to obtain the training samples corresponding to each preset time series model. For each preset time sequence pattern, the training samples corresponding to that preset time sequence pattern are used as positive samples, and the training samples corresponding to other preset time sequence patterns are used as negative samples to train the recognition model corresponding to that preset time sequence pattern, thus obtaining the trained recognition model corresponding to that preset time sequence pattern; wherein, the number of training samples contained in the positive samples is the same as the number of training samples contained in the negative samples. The step of using a sample generation model to generate sample data corresponding to each preset time series pattern includes: For each preset timing pattern, obtain the real data corresponding to that preset timing pattern; wherein, the timing pattern of the real data is that preset timing pattern. The generator in the generative adversarial network is trained using the real data through an adversarial game mechanism. When the discriminator in the generative adversarial network determines that the data generated by the generator meets the evaluation criteria, the generative adversarial network is used as a sample generation model for generating sample data corresponding to the preset time series pattern. The sample generation model is used to generate sample data corresponding to the preset time series pattern.

6. A pattern recognition device for time-series data, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1-4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Time sequence data template self-adaptive abnormal mode identification method and system

    CN117093944A