Data sample processing method, data sample classification method, data sample model training method and electronic equipment

By dynamically determining the sample window length to intercept and fill time series data samples, the problem of information loss caused by the uniform length of time series data samples in the existing technology is solved, and the accuracy of the neural network model in classifying time series data is improved.

CN118760923APending Publication Date: 2024-10-11Z-ONE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410785517.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The method of unifying the sample lengths of time series data samples in the prior art may lead to a large amount of information loss, resulting in inaccurate results of time series data classification by the neural network model.

Method used

By dynamically determining the sample window length, time series data samples are intercepted and filled, and the amount of data information in the data set is comprehensively considered to reduce information loss and improve the accuracy of classification results.

Benefits of technology

It effectively reduces the loss of information during the interception or filling process of time series data samples, and improves the accuracy of the neural network model in classifying time series data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760923A_ABST
    Figure CN118760923A_ABST
Patent Text Reader

Abstract

The invention provides a data sample processing method, a data sample classification method, a data sample model training method and electronic equipment, and the data sample processing method comprises the steps: determining the data information amount of a first data set which comprises a plurality of initial samples, and each initial sample is time series data; determining a corresponding sample window length according to the data information amount and a preset corresponding relationship between the data information amount and the sample window length; and intercepting or filling the initial sample according to the sample window length so as to adjust the sample length of the initial sample and obtain a target sample. Therefore, the sample window length for intercepting and filling the sample length is determined according to the data information amount of the data set. The sample window length is used to intercept and fill the sample length, so that the loss of sample information can be effectively reduced, and the accuracy of the neural network model obtained by training and the accuracy of the result of classifying the time series data samples according to the neural network model are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a data sample processing, classification, model training method and electronic equipment. Background Art

[0002] All industries generate a large amount of time series data. Through methods such as data mining and machine learning, time series data can be effectively classified and important information can be extracted.

[0003] At present, a large amount of time series data is collected to generate a training data set, and the neural network model corresponding to the data mining, machine learning and other methods is trained to obtain a trained neural network model, which can be used to classify the time series data. During the training of the neural network model, for the training data set composed of time series data, the sample length of each time series data sample included in it should be the same. However, due to the complex source of the collected time series data, the sample length of the time series data samples will not be exactly the same, and the developer needs to unify the sample length of the time series data samples.

[0004] In the prior art, the method for unifying sample lengths is to preset a standard length, cut off time series data samples whose sample lengths are longer than the standard length, and fill in time series data samples whose sample lengths are shorter than the standard length (such as adding zeros or duplicating). However, this method of unifying sample lengths is based on a standard length established in advance. Directly cutting off and filling time series data samples using the standard length may cause a large amount of information contained in the time series data samples to be lost, thus making the trained neural network model and the results of classifying time series data samples based on the neural network model inaccurate. Summary of the invention

[0005] The purpose of the present invention is to solve the problem that the method of unifying the sample length of time series data samples in the prior art is to preset a standard length, truncate the time series data samples whose sample length is greater than the standard length, and fill the time series data samples whose sample length is less than the standard length, which may cause a large amount of information loss contained in the time series data samples, thereby making the trained neural network model and the results of classifying the time series data samples according to the neural network model inaccurate. The present invention provides a data sample processing method, which can dynamically determine the sample window length for truncation and filling processing of the sample length according to the amount of data information in the data set, which can effectively reduce the loss of sample information during the truncation or filling process of the time series data samples, thereby improving the accuracy of the trained neural network model and the results of classifying the time series data samples according to the neural network model.

[0006] To solve the above technical problems, an embodiment of the present invention discloses a data sample processing method, which includes: determining the data information amount of a first data set, the first data set includes multiple initial samples, each initial sample is time series data; determining the sample window length corresponding to the data information amount according to the data information amount, and a preset correspondence between the data information amount and the sample window length; and performing truncation or padding processing on the initial sample according to the sample window length to adjust the sample length of the initial sample to obtain a target sample.

[0007] By adopting the above technical scheme, after obtaining a first data set containing multiple initial samples of time series data, the data information amount of the first data set is first determined, and then the sample window length for truncation and padding of the sample length is determined according to the data information amount and the correspondence between the preset data information amount and the sample window length, and the sample length of the initial sample is adjusted according to the sample window length to obtain the target sample. Therefore, in the process of truncation and padding of the time series data sample length contained in the data set, the data information amount of the data set is comprehensively considered, and the sample window length for truncation and padding of the time series data sample length is determined according to the data information amount of the data set. Using the sample window length to truncate and pad the time series data sample length can effectively reduce the loss of time series data sample information, and retain the important information recorded by the time series data sample as much as possible, thereby effectively improving the accuracy of the trained neural network model and the classification results of the time series data samples according to the neural network model.

[0008] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a data sample processing method, which performs truncation or padding processing on the initial sample according to the sample window length, including: truncation processing on the first sample, and padding processing on the second sample, wherein the first sample is a sample in the initial sample whose sample length is greater than the sample window length, and the second sample is a sample in the initial sample whose sample length is less than the sample window length.

[0009] By adopting the above technical solution, the length of the time series data samples in the data set is unified according to the sample window length, which can effectively reduce the loss of time series data sample information and make the data set more conducive to the training and prediction of the neural network model, thereby effectively improving the accuracy of the trained neural network model and the classification results of the time series data samples based on the neural network model.

[0010] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a data sample processing method, which performs interception processing on a first sample, including: determining the information value density of data points contained in the first sample; and intercepting data points in the first sample whose information value density is less than an information value density threshold.

[0011] Using the above technical solution, since the sample length of the first sample is greater than the sample window length, the first sample needs to be truncated. During the truncation process of the first sample, the data points in the first sample whose information value density is less than the information value density threshold are truncation-processed. This truncation processing method comprehensively considers the information value density of the data points included in the first sample, and can effectively reduce the loss of time series data sample information when the time series data sample length is truncation-processed.

[0012] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a data sample processing method, which performs filling processing on the second sample, including: copying the data points contained in the second sample, filling the copied data points into corresponding positions of the data points in the second sample to obtain a third sample; determining the information value density of the data points contained in the third sample; and intercepting the data points in the third sample whose information value density is less than an information value density threshold.

[0013] With the above technical solution, since the sample length of the second sample is less than the sample window length, the second sample needs to be padded. In the process of padded, the data points included in the second sample are first copied, and the copied data points are padded to the corresponding positions of the middle data points of the second sample, and the sample length of the original second sample is increased to obtain the third sample. Then, the third sample is intercepted according to the information value density of the data points included in the third sample to complete the padded processing of the second sample. This padded processing method comprehensively considers the information value density of the data points included in the third sample, and can better retain the original information of the time series data sample compared to the existing simple zero addition or copying method.

[0014] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a data sample processing method, which also includes determining the information value density of target data points contained in the sample in the following manner, where the target data points are data points with the same and continuous data values: based on the time series of the target data points, determining the information value density of the target data points, wherein the information value density of the target data points in the earlier time series is greater than the information value density of the target data points in the later time series.

[0015] Using the above technical solution, in general, the information value density of data refers to the value contained in the unit data, that is, the larger the amount of data, the lower the corresponding information value density. Therefore, data points with the same and continuous data values ​​are selected as target data points, and the information value density of the target data points in the previous time series is determined to be greater than the information value density of the target data points in the later time series, so that among the data points with the same and continuous data values, the information value density of the data points in the later time series is smaller. In the process of time series data sample length truncation processing, data points with low information value density are truncated, thereby effectively reducing the loss of time series data sample information.

[0016] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a data sample processing method, which also includes obtaining a first data set by: acquiring an initial time series data packet; parsing the initial time series data packet to obtain initial time series data; segmenting the initial time series data according to a timestamp corresponding to the initial time series data to obtain an initial sample; and generating a first data set based on the initial sample.

[0017] An embodiment of the present invention also discloses a data sample processing model training method, which includes: determining a second data set and an initial data sample processing model, the second data set including multiple target samples, and the target samples are obtained based on the aforementioned data sample processing method; training the initial data sample processing model according to the second data set to obtain a target data sample processing model.

[0018] By adopting the above-mentioned technical solution, during the training process of the data sample processing model, the target samples in the second data set used for data sample processing model training are first intercepted and filled using the aforementioned data sample processing method, which can effectively reduce the loss of time series data sample information during the sample interception or filling process, thereby reducing the loss of information in the second data set and improving the accuracy of the trained target data sample processing model.

[0019] An embodiment of the present invention also discloses a data sample classification method, which includes: determining time series data to be classified; inputting the time series data to be classified into a data sample feature extraction model for feature extraction processing to obtain an output result of the middle layer of the data sample feature extraction model, the data sample feature extraction model is trained based on the aforementioned data sample processing model training method, and the middle layer of the data sample feature extraction model is constructed based on a self-attention mechanism; inputting the output result into a data sample classification model to obtain a classification result of the time series data to be classified; the data sample classification model is trained based on the aforementioned data sample processing model training method.

[0020] By adopting the above technical solution, the data sample feature extraction model and the data sample classification model are trained based on the aforementioned data sample processing model training method, which can more accurately classify the time series data samples in the data set. Furthermore, in the neural network, the feature output of the intermediate layer constructed based on the self-attention mechanism is usually more representative than the input and output, and can capture more advanced feature information of the samples in the data set. Therefore, the output result of the intermediate layer of the data sample feature extraction model is used as the input of the data sample classification model, so that the classification result of the samples of the time series data to be classified is more accurate.

[0021] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a data sample classification method, and the classification result of the time series data to be classified includes: a sample correlation classification result.

[0022] By adopting the above technical solution, a more accurate classification result of the correlation of the time series data samples to be classified can be obtained, which facilitates the analysis of the correlation of the time series data samples.

[0023] An embodiment of the present invention also discloses a data sample processing device, including: a first processing module, used to determine the data information amount of a first data set, the first data set includes multiple initial samples, each initial sample is time series data; a second processing module, used to determine the sample window length corresponding to the data information amount according to the data information amount and a preset correspondence between the data information amount and the sample window length; a third processing module, used to cut or fill the initial sample according to the sample window length to adjust the sample length of the initial sample to obtain the target sample.

[0024] An embodiment of the present invention also discloses a data sample processing model training device, including: a fourth processing module, determining a second data set and an initial data sample processing model, the second data set including multiple target samples, and the target samples are obtained based on the aforementioned data sample processing method; a fifth processing module, training the initial data sample processing model according to the second data set to obtain a target data sample processing model.

[0025] An embodiment of the present invention also discloses a data sample classification device, including: a sixth processing module, used to determine the time series data to be classified; a seventh processing module, used to input the time series data to be classified into a data sample feature extraction model for feature extraction processing, and obtain the output result of the middle layer of the data sample feature extraction model, the data sample feature extraction model is trained based on the aforementioned data sample processing model training method, and the middle layer of the data sample feature extraction model is constructed based on the self-attention mechanism; an eighth processing module, used to input the output result into a data sample classification model, and obtain the classification result of the time series data to be classified; the data sample classification model is trained based on the aforementioned data sample processing model training method.

[0026] An embodiment of the present invention also discloses an electronic device, comprising: a memory for storing a computer program, the computer program comprising program instructions; a processor for executing the program instructions so that the electronic device executes the aforementioned data sample processing method, or the aforementioned data sample processing model training method, or the aforementioned data sample classification method.

[0027] An embodiment of the present invention also discloses a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and the program instructions are executed by an electronic device to execute the aforementioned data sample processing method, or the aforementioned data sample processing model training method, or the aforementioned data sample classification method.

[0028] An embodiment of the present invention further discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the aforementioned data sample processing method, or the aforementioned data sample processing model training method, or the aforementioned data sample classification method. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a flow chart of a data sample processing method provided by an embodiment of the present invention;

[0030] Figure 2 is a schematic diagram of a flow chart of intercepting a first sample provided by an embodiment of the present invention;

[0031] Figure 3 is a schematic diagram of performing interception processing on a first sample according to a sample window length provided by an embodiment of the present invention;

[0032] Figure 4 is a schematic diagram of a flow chart of filling processing of a second sample provided by an embodiment of the present invention;

[0033] Figure 5 is a schematic diagram of performing padding processing on a second sample according to a sample window length provided by an embodiment of the present invention;

[0034] Figure 6 is a schematic diagram of a process for obtaining a first data set provided by an embodiment of the present invention;

[0035] Figure 7 is another schematic diagram of a process for obtaining a first data set provided by an embodiment of the present invention;

[0036] Figure 8 It is a flow chart of a data sample processing model training method provided by an embodiment of the present invention;

[0037] Fig. 9 is a flow chart of a data sample classification method provided by an embodiment of the present invention;

[0038] Fig.10 is a schematic diagram of a training data sample feature extraction model and a data sample classification model provided by an embodiment of the present invention;

[0039] Fig.11 is a schematic diagram of a sample correlation classification result provided by an embodiment of the present invention;

[0040] Fig.12 is a structural schematic diagram of a data sample processing device provided by an embodiment of the present invention;

[0041] Fig.13 It is a structural schematic diagram of a data sample processing model training device provided by an embodiment of the present invention;

[0042] Fig.14 is a structural schematic diagram of a data sample classification device provided by an embodiment of the present invention;

[0043] Fig.15 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] As mentioned above, in the prior art, the method for unifying the sample length of time series data samples is to preset a standard length, cut off the part of the time series data sample that exceeds (i.e. is greater than) the standard length, and fill (such as adding zeros or duplicating) the part that is insufficient (i.e. is less than) the standard length. However, this method of unifying the length of time series data samples is based on a standard length established in advance. After directly cutting off and filling the time series data samples using the standard length, a large amount of information contained in the time series data samples may be lost, thereby making the trained neural network model and the results of classifying the time series data samples based on the neural network model inaccurate.

[0045] Based on this, the present invention provides a data sample processing, classification, model training method and electronic device, first determining the amount of data information corresponding to the data set, then determining the sample window length according to the amount of data information, and performing interception or padding processing on the initial sample according to the sample window length to adjust the sample length of the initial sample to obtain the target sample, thereby achieving the unification of the sample length of the data set. It can effectively reduce the loss of time series data sample information during the sample interception or padding process, thereby improving the accuracy of the trained neural network model and the results of classifying the time series data samples according to the neural network model.

[0046] Next, in conjunction with the accompanying drawings, the steps of the data sample processing method provided by the present invention are first described in detail.

[0047] like Figure 1 As shown, the data sample processing method provided by the present invention comprises the following steps:

[0048] S100: Determine the data information amount of a first data set, where the first data set includes a plurality of initial samples, each of which is time series data.

[0049] The first data set is an initial data set composed of time series data. The sample lengths of multiple initial samples included in the data set may be the same or different. If the first data set is used for model training, the sample lengths of the time series data samples in the first data set need to be unified to facilitate subsequent model training.

[0050] In the implementation of the present invention, the data information volume of the first data set is first determined. The data information volume is a measure of the amount of information in the data. Assuming that the information source has m types of messages and each message is generated with equal probability, the information volume of the information source can be expressed as I=logm. That is, if the first data set has m samples, the data information volume of the data set can be I=logm, where I is the data information volume.

[0051] S200: Determine the sample window length corresponding to the data information amount according to the data information amount and the preset corresponding relationship between the data information amount and the sample window length.

[0052] The preset correspondence between the amount of data information and the sample window length may be obtained in advance through a large number of experiments, and different amounts of data information may correspond to different sample window lengths. The preset correspondence between the amount of data information and the sample window length may be that the larger the amount of data information, the longer the sample window length, or that a certain range of data information corresponds to a sample window length, or that the smaller the amount of data information, the longer the sample window length, and the sample window length will be used to unify the sample lengths of the time series data samples in the data set. The specific correspondence between the preset amount of data information and the sample window length can be set as needed.

[0053] S300: performing a truncation process or a padding process on the initial sample according to the sample window length to adjust the sample length of the initial sample to obtain a target sample.

[0054] The sample window length is determined according to the amount of data information of the first data set, that is, different sample window lengths can be determined for different data sets according to the sample conditions of the actual data sets. For each data set, the sample window length can be dynamically adjusted to truncate or pad the sample length of the time series data samples in the data set. There is no need to truncate or pad all samples included in all data sets to a uniform length according to a predetermined standard length, thereby avoiding the loss of a large amount of time series data sample information.

[0055] After obtaining a first data set containing multiple initial samples of time series data, the present application first determines the data information volume of the first data set, and then determines the sample window length for truncating and filling the sample length according to the data information volume and the corresponding relationship between the preset data information volume and the sample window length, and adjusts the sample length of the initial sample according to the sample window length to obtain the target sample. Therefore, in the process of truncating and filling the time series data sample length contained in the data set, the data information volume of the data set is comprehensively considered, and the sample window length for truncating and filling the time series data sample length is determined according to the data information volume of the data set. Using the sample window length to truncate and fill the time series data sample length can effectively reduce the loss of time series data sample information, and retain the important information of the time series data sample record as much as possible, thereby effectively improving the accuracy of the trained neural network model and the classification results of the time series data samples according to the neural network model.

[0056] In one embodiment of the present invention, the initial sample is truncated or padded according to the sample window length, including: truncating the first sample and padding the second sample, wherein the first sample is a sample in the initial sample whose sample length is greater than the sample window length, and the second sample is a sample in the initial sample whose sample length is less than the sample window length.

[0057] That is, the sample lengths of the initial samples in the first data set are unified, and based on the sample window length, the samples whose sample lengths in the initial samples are greater than the sample window length are truncated, and the samples whose sample lengths in the initial samples are less than the sample window length are filled.

[0058] In one embodiment of the present invention, Figure 2 As shown, the first sample is intercepted and processed, including the following steps:

[0059] S310: Determine the information value density of the data points included in the first sample.

[0060] S320: Cut off the data points in the first sample whose information value density is less than the information value density threshold.

[0061] In one embodiment of the present invention, the information value density of the target data points included in the sample is determined in the following manner, where the target data points are data points with the same and continuous data values: the information value density of the target data points is determined based on the time sequence of the target data points. The information value density of the target data points in the earlier time sequence is greater than the information value density of the target data points in the later time sequence.

[0062] For example, Figure 3 As shown, the original data is also the first sample, and the first sample is 12222333333452. The observed value is also the target sample, which is the data obtained after the sample length is truncated on the original data, and is 1222333452. First, the sample window length can be determined to be 10 based on the amount of data information in the data set. Then the information value density of each data point contained in the sample is determined. It should be noted that for data points that appear less frequently and are discontinuous, their information value density is generally relatively large. These data points are generally not truncated. This embodiment only needs to determine the corresponding information value density according to the set method. For data points with the same and continuous data values, the more times the data point appears, the smaller the information value that can be generated for the analysis of the data sample. Therefore, in the process of truncating the sample length of the sample, these data points will be truncated. For Figure 3 For the raw data shown in the figure, we first determine the target data points with the same and continuous data values, such as 2222, 333333. The information value density of the first 2 is greater than that of the second 2, and the same is true for 3. According to the sample window length, the final required sample length can be determined, and then Figure 3 In the manner shown, data points with relatively small information value density are intercepted from target data points with the same and continuous data values. Here, after window statistics, 1 2 and 3 3 are intercepted, and then the target sample 1222333452 with a sample length of 10 is obtained. Of course, since the target data points are continuous, the information value density of the data points can also be that the information value density of the target data points in the later time series is greater than the information value density of the target data points in the earlier time series, and the final intercepted data points and the number of data points are the same.

[0063] In one embodiment of the present invention, Figure 4 As shown, the second sample is filled, including the following steps:

[0064] S301: Copy the data points included in the second sample, and fill the copied data points into corresponding positions of the data points in the second sample to obtain a third sample.

[0065] S302: Determine the information value density of the data points included in the third sample.

[0066] S303: intercepting data points in the third sample whose information value density is less than the information value density threshold.

[0067] Filling the second sample may also be referred to as enriching the second sample. Figure 5 As shown, the original data, i.e., the second sample 1223333, is first enriched. Specifically, the data value of each data point in the original data is copied, and the copied new data points are filled into the adjacent positions of each data point (as an example of the corresponding positions of the data points in the second sample), and a new third sample 11222233333333 is generated. The sample length of the third sample is twice the sample length of the initial sample. Then, as mentioned above, the target data points with the same and continuous data values ​​contained in the third sample are determined, such as 11, 2222, 33333333, and the sample window length is determined according to the data information amount of the data set to determine the information value density of the continuous data points. The data points with relatively small information value density among the target data points with the same and continuous data values ​​are intercepted. Here, after window statistics, 4 3s are intercepted, and then the target sample 1122223333 with a sample length of 10 is obtained.

[0068] In other embodiments of the present invention, the copied data points are filled into corresponding positions of data points in the second sample. The corresponding positions may also be other positions. For example, the entire second sample is copied and all the copied data points are filled after the last data point, or all the copied data points are filled before the first data point (i.e., 1223333 is copied to obtain 12233331223333), or the filling positions of other data points may be specified as needed.

[0069] The data enrichment method, which fills the corresponding positions of each data point by copying the obtained data points, has a better fitting effect for slowly changing time series data.

[0070] Furthermore, the first data set in the present invention may be related signal timing data generated by the vehicle-mounted service, such as Figure 6 As shown in the figure, the raw data (i.e., raw time series data) collected and processed based on the dynamic acquisition function is generally in the format of a data packet, and the data packet needs to be expanded into signal data during the analysis process. In addition, during the data acquisition process, a set of data may have multiple power-on cycles and needs to be segmented according to the time series. Moreover, the number of samples of different time series data is not constant, so a window needs to be defined to specify the number for subsequent model design and training.

[0071] Of course, the first data set in the present invention may also be other types of signal timing data, such as data generated by mobile phone operation, cluster operation, etc.

[0072] In one embodiment of the present invention, Figure 7 As shown, the first data set is obtained by the following steps:

[0073] S110: Acquire an initial time series data packet (ie, a data packet of original data) based on the dynamic sampling function.

[0074] S120: parse and process the initial time series data packet to obtain initial time series data (ie, signal data).

[0075] S130: According to the timestamps corresponding to the initial time series data, the initial time series data is segmented to obtain initial samples (i.e., the segmented time series data). For example, multiple collected initial time series data are aligned according to the timestamps, and then the initial signal data is segmented according to the same time dimension to obtain samples that are more conducive to model training.

[0076] S140: Generate a first data set according to the initial samples, that is, organize, preprocess, and specify windows for the initial samples to form a data set containing multiple samples for subsequent model training and prediction.

[0077] In one embodiment of the present invention, a data sample processing model training method is also provided. Figure 8 As shown, the steps include:

[0078] S10: Determine a second data set and an initial data sample processing model.

[0079] The second data set includes a plurality of target samples, and the plurality of target samples can be obtained by the aforementioned data sample processing method.

[0080] S20: Training an initial data sample processing model according to the second data set to obtain a target data sample processing model.

[0081] The data sample processing model may be any model that can perform corresponding processing on the data samples, such as performing feature extraction, classification, clustering, etc. on the data samples.

[0082] Therefore, the samples in the second data set used for training the data sample processing model are intercepted and filled through the aforementioned data sample processing method, which can effectively reduce the loss of time series data sample information during the sample interception or filling process, thereby reducing the loss of information in the second data set and improving the accuracy of the target data sample processing model obtained through training.

[0083] In one embodiment of the present invention, a data sample classification method is also provided. Fig. 9 As shown, the steps include:

[0084] S101: Determine time series data to be classified. The time series data to be classified may be one time series data or multiple time series data, which constitute a time series data set to be classified.

[0085] S102: Input the time series data to be classified into the data sample feature extraction model for feature extraction processing to obtain the output result of the middle layer of the data sample feature extraction model, and the middle layer of the data sample feature extraction model is constructed based on the self-attention mechanism.

[0086] Among them, the data sample feature extraction model can be trained based on the aforementioned data sample processing model training method.

[0087] S103: Input the output result into the data sample classification model to obtain the classification result of the time series data to be classified.

[0088] Among them, the data sample classification model is trained based on the aforementioned model training method.

[0089] The data sample feature extraction model and data sample classification model trained based on the aforementioned data sample processing model training method can more accurately classify the time series data samples to be classified. Furthermore, in the neural network, the feature output of the intermediate layer constructed based on the self-attention mechanism is usually more representative than the input and output, and can capture more advanced feature information of the samples in the data set. Therefore, the output result of the intermediate layer of the data sample feature extraction model is used as the input of the data sample classification model, so that the classification result of the time series data samples to be classified is more accurate.

[0090] Currently, for data sets with clear features, cluster analysis can be performed directly based on the feature data. It can reduce the complexity of the data by mapping high-dimensional data to low-dimensional space and retain important information in the original data.

[0091] In one embodiment of the present invention, Fig.10 As shown, a design and training process of a data sample feature extraction model and a data sample classification model is provided. The data sample feature extraction model is a multi-layer neural network, in which the middle layer is a self-attention layer, and the data sample classification model is used to perform cluster analysis on feature data.

[0092] In the process of training the model, the data sample feature extraction model and the data sample classification model can be trained jointly, that is, the training signal value is input into the data sample feature extraction model, i.e., the multi-layer neural network, and then the feature data output by the self-attention layer of the multi-layer neural network is obtained, and then the feature data is input into the data sample classification model for cluster analysis to obtain the classification result, and the data sample feature extraction model and the data sample classification model are optimized for supervised learning parameters according to the classification result and the loss function. Of course, in the process of training the model, the multi-layer neural network can also be tuned separately, that is, the multi-layer neural network is used to obtain the training data prediction signal, and then the multi-layer neural network is optimized for supervised learning parameters according to the prediction signal to obtain the final trained data sample feature extraction model and data sample classification model.

[0093] In one embodiment of the present invention, the classification result of the time series data to be classified includes: a sample correlation classification result.

[0094] Specifically, multiple time series data samples are input into the data sample feature extraction model and the data sample classification model, and the correlation classification of the output time series data samples can be as follows: Fig.11 As shown, according to the waveform structure represented by each time series data corresponding to the signal data window, the signal category is obtained by classification according to the correlation. For example, according to the waveform, it can be observed that the waveforms of the signals classified as 72 are similar, so the correlation is relatively large, and they are classified into one category, category 72; for another example, the waveforms of the signals classified as 81 are similar, so the correlation is relatively large, and they are classified into one category, category 81. Classifying signals according to correlation makes it easier to group messy signals, which is more conducive to signal analysis.

[0095] The implementation mode of the present invention constructs a universal model, which solves the problems of huge and disordered original signal data and unclear signal service lineage, and can be used to study signal correlation, assist services in quickly identifying related signals, and conduct business analysis.

[0096] Specifically, the embodiments of the present invention define a window method for raw signal data of irregular length to implement data preprocessing and facilitate the use of subsequent models. For signal data (such as vehicle signal data), the self-attention mechanism is introduced into the neural network to enhance the perception of feature data. Using the middle layer of the neural network as the feature input of signal clustering analysis can more completely express the characteristics of the raw data.

[0097] The embodiments of the present invention select a suitable preprocessing method for vehicle signal data to reduce the interference of invalid information, introduce a self-attention layer on the basis of a general neural network model, and train the model parameters through supervised learning. The output of the model middle layer is used as the feature input of cluster analysis to identify signal correlation.

[0098] It effectively solves the problem that the time series values ​​of signals of indefinite length cannot be universally calculated, solves the problem that the original data characteristics are unclear and cannot be applied for analysis, realizes the function of identifying signal characteristics through data, and realizes the calculation method of signal correlation determination.

[0099] The content of the present invention is to construct a recognition window to mark the signal time series values ​​of indefinite length, to build a neural network based on the self-attention model to train the signal time series values ​​(that is, time series data), to extract feature vectors through the training model (that is, the data sample processing model), and to use the clustering method of unsupervised learning to realize the correlation identification of different signals.

[0100] The embodiment of the present invention further discloses a data sample processing device, such as Fig.12 As shown, including:

[0101] The first processing module is used to determine the data information volume of the first data set, where the first data set includes a plurality of initial samples, each of which is time series data.

[0102] The second processing module is used to determine the sample window length corresponding to the data information amount according to the data information amount and the preset corresponding relationship between the data information amount and the sample window length.

[0103] The third processing module is used to perform truncation or padding processing on the initial sample according to the sample window length to adjust the sample length of the initial sample to obtain the target sample.

[0104] For specific operations that can be performed by the first processing module to the third processing module, please refer to the above Figure 1 Corresponding data sample processing method. Moreover, according to the specific operation steps of the above data sample processing method, the data sample processing device may include more or fewer processing modules for processing the content of the above data sample processing method.

[0105] The embodiment of the present invention also discloses a data sample processing model training device, such as Fig.13 As shown, including:

[0106] The fourth processing module determines a second data set and an initial data sample processing model, wherein the second data set includes a plurality of target samples, and the target samples are obtained based on the aforementioned data sample processing method.

[0107] The fifth processing module trains the initial data sample processing model according to the second data set to obtain the target data sample processing model.

[0108] The specific operations that the fourth processing module and the fifth processing module can perform refer to the above Figure 8 Corresponding data sample processing model training method. In addition, according to the specific operation steps of the above data sample processing model training method, the data sample processing model training device may include more or fewer processing modules for processing the content of the above data sample processing model training method.

[0109] The embodiment of the present invention also discloses a data sample classification device, such as Fig.14 As shown, including:

[0110] The sixth processing module is used to determine the time series data to be classified.

[0111] The seventh processing module is used to input the time series data to be classified into the data sample feature extraction model for feature extraction processing to obtain the output result of the middle layer of the data sample feature extraction model. The data sample feature extraction model is trained based on the aforementioned data sample processing model training method, and the middle layer of the data sample feature extraction model is constructed based on the self-attention mechanism.

[0112] The eighth processing module is used to input the output result into the data sample classification model to obtain the classification result of the time series data to be classified; the data sample classification model is trained based on the aforementioned data sample processing model training method.

[0113] The specific operations that can be performed by the sixth processing module to the eighth processing module are shown above. Fig. 9 Corresponding data sample classification method. Moreover, according to the specific operation steps of the above data sample classification method, the data sample classification device may include more or fewer processing modules for processing the content of the above data sample classification method.

[0114] See also Fig.15 , Fig.15 The electronic device may include one or more processors 1002, a system control logic 1008 connected to at least one of the processors 1002, a system memory 1004 connected to the system control logic 1008, a non-volatile memory (NVM) 1006 connected to the system control logic 1008, and a network interface 1010 connected to the system control logic 1008.

[0115] The processor 1002 may include one or more single-core or multi-core processors. The processor 1002 may include any combination of a general-purpose processor and a dedicated processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). In the implementation of this document, the processor 1002 may be configured to execute the aforementioned data sample processing method, or the aforementioned data sample processing model training method, or the aforementioned data sample classification method.

[0116] In some implementations, the system control logic 1008 may include any suitable interface controller to provide any suitable interface to at least one of the processors 1002 and / or any suitable device or component in communication with the system control logic 1008 .

[0117] In some implementations, the system control logic 1008 may include one or more memory controllers to provide an interface to the system memory 1004. The system memory 1004 may be used to load and store data and / or instructions. In some implementations, the system memory 1004 of the electronic device may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).

[0118] NVM / memory 1006 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some implementations, NVM / memory 1006 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as a hard disk drive (HDD), a compact disc (CD) drive, and a digital versatile disc (DVD) drive.

[0119] NVM / storage 1006 may include a portion of storage resources installed on a device of an electronic device, or it may be accessible by the device but not necessarily a portion of the device. For example, NVM / storage 1006 may be accessed over a network via network interface 1010 .

[0120] In particular, the system memory 1004 and the NVM / storage 1006 may include: a temporary copy and a permanent copy of the instruction 1020, respectively. The instruction 1020 may include: an instruction that causes the electronic device to implement the aforementioned data sample processing method, or the aforementioned data sample processing model training method, or the aforementioned data sample classification method when executed by at least one of the processors 1002. In some implementations, the instruction 1020, hardware, firmware, and / or software components thereof may be additionally / alternatively placed in the system control logic 1008, the network interface 1010, and / or the processor 1002.

[0121] The network interface 1010 may include a transceiver for providing a radio interface for the electronic device, thereby communicating with any other suitable device (such as a front-end module, an antenna, etc.) through one or more networks. In some implementations, the network interface 1010 may be integrated with other components of the electronic device. For example, the network interface 1010 may be integrated with at least one of the processor 1002, the system memory 1004, the NVM / storage 1006, and a firmware device (not shown) having instructions. When at least one of the processors 1002 executes the instructions, the electronic device implements the aforementioned data sample processing method, or the aforementioned data sample processing model training method, or the aforementioned data sample classification method.

[0122] The network interface 1010 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 1010 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.

[0123] In one implementation, at least one of the processors 1002 may be packaged with logic for one or more controllers of the system control logic 1008 to form a system in a package (SiP). In one implementation, at least one of the processors 1002 may be integrated with logic for one or more controllers of the system control logic 1008 on the same die to form a system on chip (SoC).

[0124] The electronic device may further include: an input / output (I / O) device 1012. The I / O device 1012 may include a user interface that enables a user to interact with the electronic device; the design of the peripheral component interface enables the peripheral component to also interact with the electronic device. In some implementations, the electronic device further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device.

[0125] In some implementations, the peripheral component interface can include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.

[0126] In some implementations, the sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 1010 to communicate with components of a positioning network (e.g., Global Positioning System (GPS) satellites).

[0127] It is to be understood that the structure illustrated in the implementation of the present invention does not constitute a specific limitation on the electronic device. In other implementations of the present application, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0128] In another implementation of the present application, a computer-readable storage medium is also disclosed, which stores a computer program. The computer program includes program instructions, and the program instructions are executed by an electronic device to execute the aforementioned data sample processing method, or the aforementioned model training method, or the aforementioned data sample classification method.

[0129] In another implementation of the present application, it includes a computer program / instruction, which, when executed by a processor, implements the aforementioned data sample processing method, or the aforementioned model training method, or the aforementioned data sample classification method.

[0130] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purpose of the present application implementation, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0131] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described herein is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0132] It should be noted that, in addition to the implementation methods of the present invention described in the above-mentioned specific embodiments, those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Although the description of the present invention is introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to this implementation method. On the contrary, the purpose of introducing the invention in conjunction with the implementation method is to cover other options or modifications that may be extended based on the claims of the present invention. In order to provide a deep understanding of the present invention, the above description contains many specific details, and the present invention can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present invention, some specific details will be omitted in the description. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0133] It should be noted that in this specification, similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0134] The terms “first”, “second”, etc. are only used for distinguishing descriptions and should not be understood as indicating or implying relative importance.

[0135] In the description of this embodiment, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this embodiment can be understood according to specific circumstances.

[0136] Although the present invention has been illustrated and described with reference to certain preferred embodiments of the present invention, it should be understood by those skilled in the art that the above is a further detailed description of the present invention in conjunction with specific embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. Those skilled in the art may make various changes in form and details, including making several simple deductions or substitutions, without departing from the spirit and scope of the present invention.

Claims

1. A data sample processing method, characterized in that: The method comprises: Determine the data information amount of a first data set, wherein the first data set includes a plurality of initial samples, each of the initial samples being time series data; Determining the sample window length corresponding to the data information amount according to the data information amount and a preset correspondence relationship between the data information amount and the sample window length; The initial sample is truncated or padded according to the sample window length to adjust the sample length of the initial sample to obtain a target sample.

2. The data sample processing method according to claim 1, characterized in that: The initial sample is subjected to truncation or padding according to the sample window length, including: The first sample is truncated and the second sample is padded, wherein the first sample is a sample in the initial sample whose sample length is greater than the sample window length, and the second sample is a sample in the initial sample whose sample length is less than the sample window length.

3. The data sample processing method according to claim 2, characterized in that: The first sample is intercepted and processed, including: Determining the information value density of the data points included in the first sample; The data points in the first sample whose information value density is less than the information value density threshold are intercepted.

4. The data sample processing method according to claim 2, characterized in that: The second sample is filled, including: Copying the data points included in the second sample, and filling the copied data points into corresponding positions of the data points in the second sample to obtain a third sample; Determining the information value density of the data points included in the third sample; The data points in the third sample whose information value density is less than the information value density threshold are intercepted.

5. The data sample processing method according to claim 3 or 4, characterized in that: The method further includes determining the information value density of target data points included in the sample by the following method, wherein the target data points are data points with the same and continuous data values: Based on the time sequence of the target data points, the information value density of the target data points is determined, wherein the information value density of the target data points in the earlier time sequence is greater than the information value density of the target data points in the later time sequence.

6. The data sample processing method according to any one of claims 1 to 5, characterized in that: The method further comprises obtaining the first data set by: Get the initial time series data packet; Parsing the initial time series data packet to obtain initial time series data; According to the timestamp corresponding to the initial time series data, the initial time series data is segmented to obtain the initial sample; The first data set is generated according to the initial sample.

7. A data sample processing model training method, characterized in that: The method comprises: Determine a second data set and an initial data sample processing model, wherein the second data set includes a plurality of target samples, and the target samples are obtained based on the data sample processing method according to any one of claims 1 to 6; The initial data sample processing model is trained according to the second data set to obtain a target data sample processing model.

8. A data sample classification method, characterized in that: The method comprises: Determine the time series data to be classified; Input the time series data to be classified into a data sample feature extraction model for feature extraction processing to obtain an output result of the intermediate layer of the data sample feature extraction model, wherein the data sample feature extraction model is trained based on the data sample processing model training method according to claim 7, and the intermediate layer of the data sample feature extraction model is constructed based on a self-attention mechanism; The output result is input into a data sample classification model to obtain a classification result of the time series data to be classified; the data sample classification model is trained based on the data sample processing model training method described in claim 7.

9. The data sample classification method according to claim 8, characterized in that: The classification result of the time series data to be classified includes: a sample correlation classification result.

10. An electronic device, characterized in that: include: A memory for storing a computer program, wherein the computer program includes program instructions; A processor, used to execute program instructions so that the electronic device performs the data sample processing method as described in any one of claims 1 to 6, or the data sample processing model training method as described in claim 7, or the data sample classification method as described in claim 8 or 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. The program instructions are executed by an electronic device to execute the data sample processing method as described in any one of claims 1 to 6, or the data sample processing model training method as described in claim 7, or the data sample classification method as described in claim 8 or 9.

12. A computer program product, characterized in that It includes a computer program / instruction, which, when executed by a processor, implements the data sample processing method as described in any one of claims 1 to 6, or the data sample processing model training method as described in claim 7, or the data sample classification method as described in claim 8 or 9.