Analysis method and device of time series data and storage medium
By extracting features from time-series data and selecting classification algorithms, the problem of inaccurate analysis in existing technologies has been solved, achieving the effect of personalized services.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies cannot accurately capture complex periodicity and irregular fluctuations in time series data analysis, making it impossible to provide personalized services to customers.
By extracting features from time series data, identifying trend characteristics, and selecting appropriate classification algorithms based on these characteristics, such as Naive Bayes, Support Vector Machine, Random Forest, Gradient Boosting Tree, and K-Nearest Neighbors, the service plan is adjusted to provide personalized services.
It enables the provision of more personalized service solutions to customers based on accurate time-series data analysis, thereby improving the accuracy and efficiency of services.
Smart Images

Figure CN121786641A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data analysis, and more specifically, to a method, apparatus, and storage medium for analyzing time series data. Background Technology
[0002] In civil aviation services and many other fields, the analysis and classification of time series data is increasingly becoming a key technology for improving operational efficiency and user experience. This type of data, with its inherent temporal sequence and complex fluctuations, records changing patterns in user behavior. However, while existing analytical methods rely on single feature extraction or pre-defined classification algorithms, this often leads to the neglect of data complexity. For example, some methods may focus only on the mean and variance of statistical data, ignoring the periodicity, trends, and non-linear variations that may exist in time series data. While this simplification may provide preliminary classification information in some cases, it fails to capture the full picture of the data, especially in the face of the complex periodicity and irregular fluctuations that may exist in civil aviation data. Furthermore, existing technologies often adopt a one-size-fits-all strategy when selecting classification algorithms, ignoring the impact of different trend characteristics on algorithm performance. For example, for time series exhibiting obvious periodicity, some algorithms may perform poorly because they cannot effectively capture the periodic patterns; for random fluctuations without obvious patterns, some algorithms may become distorted due to overfitting and fail to classify accurately.
[0003] There is currently no effective solution to the problem that inaccurate time series data analysis in related technologies cannot provide personalized services to customers. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, and storage medium for analyzing time series data, in order to solve the problem that inaccurate time series data analysis in related technologies cannot provide personalized services to customers.
[0005] To achieve the above objectives, according to one aspect of this application, a method for analyzing time series data is provided. The method includes: identifying time series data to be analyzed, wherein the time series data is a dataset formed based on user behavior operation records; extracting features from the time series data to obtain data features, wherein the data features include trend features; determining target features among the data features based on the trend features; determining a target classification algorithm based on the trend features; classifying the time series data according to the target features using the target classification algorithm to determine the category to which the time series data belongs; and analyzing user behavior based on the category to which the time series data belongs to in order to adjust the service plan provided to the user.
[0006] Optionally, feature extraction of time series data to obtain data features includes: calculating statistical domain index values based on time series data, generating statistical domain features based on statistical domain index values; analyzing the changing trends of time series data, generating trend features based on the changing trends; and obtaining data features based on statistical domain features and trend features.
[0007] Optionally, determining the target features in the data features based on trend characteristics includes: when the trend feature belongs to the first type of trend, using the standard deviation feature, interquartile range feature, and mean absolute error feature in the data features as target features, wherein the difference in change between data points in the first type of trend is less than a first preset difference; when the trend feature belongs to the second type of trend, using the standard deviation feature, mean absolute error feature, slope feature, and intercept feature in the data features as target features, wherein the change between data points in the second type of trend is linear; when the trend feature belongs to the third type of trend, using the histogram feature in the data features as target features, Kurtosis and the slope of the empirical distribution function are used as target features, where the changes between data points in the third type of trend are periodic. When the trend feature belongs to the fourth type of trend, the maximum value feature, minimum value feature, percentile feature of the higher-order empirical distribution function, and slope feature of the empirical distribution function are used as target features, where the difference between data points in the fourth type of trend is greater than a second preset difference. When the trend feature belongs to the fifth type of trend, the standard deviation feature, the mean absolute error feature, and the root mean square feature are used as target features, where the changes between data points in the fifth type of trend are irregular.
[0008] Optionally, the target classification algorithm is determined based on trend characteristics. The time series data is then classified according to the target characteristics using this algorithm to determine its category. This includes: if the trend characteristics belong to the first type of trend, the target classification algorithm is determined to be the Naive Bayes algorithm, which is used to classify the time series data based on the target characteristics to determine its category; if the trend characteristics belong to the second type of trend, the target classification algorithm is determined to be the Support Vector Machine (SVM) algorithm, which is used to classify the time series data based on the target characteristics to determine its category; and so on. If the trend belongs to the third type of trend, the target classification algorithm is determined to be the random forest algorithm. The random forest algorithm is used to classify the time series data according to the target features to determine the category to which the time series data belongs. If the trend belongs to the fourth type of trend, the target classification algorithm is determined to be the gradient boosting tree algorithm. The gradient boosting tree algorithm is used to classify the time series data according to the target features to determine the category to which the time series data belongs. If the trend belongs to the fifth type of trend, the target classification algorithm is determined to be the K-nearest neighbor algorithm. The K-nearest neighbor algorithm is used to classify the time series data according to the target features to determine the category to which the time series data belongs.
[0009] Optionally, if the trend feature belongs to the first type of trend, the target classification algorithm is determined to be the Naive Bayes algorithm. The Naive Bayes algorithm is used to classify the time series data according to the target features. The classification category of the time series data includes: converting the time series data, standard deviation feature, interquartile range feature, and mean absolute error feature into feature vectors; inputting the feature vectors into the Naive Bayes algorithm; estimating the degree of matching between the time series data and the feature distributions of different categories according to the Naive Bayes algorithm; and determining the classification category of the time series data according to the degree of matching between the time series data and the feature distributions of different categories.
[0010] Optionally, if the trend feature belongs to the second type of trend, the target classification algorithm is determined to be the support vector machine algorithm. The support vector machine algorithm classifies the time series data according to the target features. The classification category of the time series data is determined by: converting the standard deviation feature, the mean absolute error feature, the slope feature, the intercept feature, and the time series data into feature vectors; inputting the feature vectors into the support vector machine model; and calculating the distance between the feature vectors and the hyperplane through the support vector machine model to determine the classification category of the time series data. The hyperplane is used to distinguish the different categories of time series data.
[0011] Optionally, if the trend feature belongs to the third type of trend, the target classification algorithm is determined to be the random forest algorithm. The random forest algorithm classifies the time series data according to the target features. The classification category of the time series data is determined by: converting histogram features, kurtosis features, empirical distribution function slope features and time series data into feature vectors; inputting the feature vectors into the random forest algorithm, where each tree classifies the feature vectors based on decision rules to determine the classification category of the time series data.
[0012] To achieve the above objectives, according to another aspect of this application, an apparatus for analyzing time series data is provided. The apparatus includes: a first determining unit for determining time series data to be analyzed, wherein the time series data is a dataset formed based on user behavior operation records; an extraction unit for extracting features from the time series data to obtain data features, wherein the data features include trend features; a second determining unit for determining target features among the data features based on the trend features; a third determining unit for determining a target classification algorithm based on the trend features, classifying the time series data according to the target features using the target classification algorithm, and determining the category to which the time series data belongs; and an adjustment unit for analyzing user behavior based on the category to which the time series data belongs to in order to adjust the service plan provided to the user.
[0013] According to another aspect of this application, a computer-readable storage medium is provided, which includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform an analysis method for any time series data.
[0014] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a method for performing analysis of any kind of time series data.
[0015] According to another aspect of this application, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the time series data analysis method described above.
[0016] In this embodiment, by determining the time-series data to be analyzed, wherein the time-series data is a dataset formed based on user behavior operation records; feature extraction is performed on the time-series data to obtain data features, wherein the data features include trend features; target features are determined in the data features based on the trend features; a target classification algorithm is determined based on the trend features; the time-series data is classified according to the target features using the target classification algorithm to determine the category to which the time-series data belongs; and user behavior is analyzed based on the category to which the time-series data belongs to adjust the service plan provided to the user, thus solving the technical problem that inaccurate time-series data analysis cannot provide personalized services to customers. In this application, by determining the time-series data to be analyzed, feature extraction is performed on the time-series data to obtain data features including trend features; based on the extracted trend features, more representative and discriminative target features are determined; the most suitable target classification algorithm is determined based on the trend features; the time-series data is classified by the target classification algorithm in combination with the target features; and user behavior is analyzed based on the classification results to adjust the service plan, thus achieving the technical effect of providing more personalized service plans to customers based on accurate time-series data analysis. Attached Figure Description
[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 A hardware block diagram of a computer terminal for implementing a method for analyzing time series data is shown.
[0019] Figure 2 This is a flowchart of a time series data analysis method provided according to an embodiment of this application;
[0020] Figure 3 This is an execution flowchart for analyzing time series data provided in this embodiment;
[0021] Figure 4 This is a schematic diagram of the system architecture of the analysis method for time series data provided in the embodiments of this application;
[0022] Figure 5 This is a schematic diagram of a time series data analysis apparatus provided according to an embodiment of this application;
[0023] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] It should be noted that all relevant information (including but not limited to user personal information, user behavior information, etc.) and data (including but not limited to data used for classification, data used for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, if there is an interface between this system and the relevant user or organization, before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.
[0027] Example 1
[0028] According to an embodiment of this application, a method embodiment for analyzing time series data is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a method for analyzing time series data is shown. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0030] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0031] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the time series data analysis method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned time series data analysis method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0033] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0034] Under the aforementioned operating environment, this application provides the following: Figure 2 The method for analyzing time series data is shown. Figure 2 This is a flowchart of a time series data analysis method according to Embodiment 1 of this application.
[0035] Step S201: Determine the time series data to be analyzed, wherein the time series data is a dataset formed based on user behavior operation records.
[0036] Optionally, time series data can reflect the trend of user behavior changes over time. In the field of civil aviation services, time series data can come from user operation records on the system, such as queries, reservations, feedback, etc. These records are compiled into a dataset that reflects user activity patterns.
[0037] Step S202: Extract features from the time series data to obtain data features, including trend features.
[0038] Optionally, feature extraction involves extracting key indicators that describe the characteristics of the original time series data. This includes statistical domain feature extraction, which extracts features of the time series from a statistical perspective, such as mean, variance, maximum, minimum, skewness, and kurtosis; and time domain feature extraction, which extracts features from the time dimension, such as trend, volatility, and autocorrelation. The trend characteristics of time series data can be steep increases, steep decreases, disorder, linear trends, relative stability, upward and downward jumps, and periodic fluctuations. Trend characteristics can be divided into five categories: the first type of trend, where the difference in change between data points is less than a first preset difference; this trend is characterized by a constant mean with small fluctuations and no long-term trend or structural change; the second type of trend, where the change between data points is linear; this trend is characterized by a stable linear rate of change over time, a clear directionality, and stable residuals after detrending; the third type of trend, where the change between data points is linear; and the fourth type of trend, where the change between data points is linear. The first type of trend is characterized by periodic changes, which are regular and repetitive oscillation patterns. The second type of trend is characterized by changes between data points that are greater than the second preset difference, such as steep increases, steep decreases, upward jumps, and downward jumps. This trend is characterized by the presence of one or more structural abrupt changes, which lead to significant and rapid changes in the sequence level, prominent extreme values, obvious distribution tail characteristics, and large skewness. The third type of trend is characterized by irregular changes between data points. This trend is characterized by high randomness, with no obvious trend, periodicity, or structural regularity, and is similar to white noise or random walk.
[0039] Step S203: Determine the target feature in the data features based on the trend characteristics.
[0040] Optionally, after extracting trend features, target features that most accurately reflect the characteristics of the time series category can be further filtered. For example, for periodically changing time series, more attention is paid to the period length and amplitude; for linearly changing time series, more attention is paid to the slope and intercept.
[0041] Step S204: Determine the target classification algorithm based on trend characteristics, and classify the time series data according to the target characteristics using the target classification algorithm to determine the classification category to which the time series data belongs.
[0042] Optionally, based on the trend characteristics of the time series data, the most suitable classification algorithm can be selected, namely the target classification algorithm mentioned above. Different trend characteristics are suitable for different algorithms. For example, for data showing obvious periodicity, algorithms based on frequency domain analysis, neural network algorithms, or random forest algorithms can be used; for data with linear trends, linear regression models or support vector machines can be used.
[0043] Step S205: Analyze user behavior based on the classification category of the time series data to adjust the service plan provided to users.
[0044] Optionally, after determining the classification category of the time series data, the patterns and rules of user behavior can be analyzed based on the classification results, thereby providing users with more personalized service solutions, such as optimizing resource allocation, adjusting service time, or providing personalized recommendations.
[0045] For example, such as Figure 3 The diagram shows the execution flowchart for analyzing time series data according to this embodiment. First, the time series data is imported. Then, data features are extracted from the imported data. The extracted data features are used to classify the time series data, and finally, the classification results are displayed.
[0046] The time-series data analysis method provided in this application involves: determining the time-series data to be analyzed, wherein the time-series data is a dataset formed based on user behavior operation records; extracting features from the time-series data to obtain data features, including trend features; determining target features among the data features based on the trend features; determining a target classification algorithm based on the trend features; classifying the time-series data according to the target features using the target classification algorithm to determine the category to which the time-series data belongs; and analyzing user behavior based on the category to which the time-series data belongs to adjust the service plan provided to the user. This solves the technical problem that inaccurate time-series data analysis cannot provide personalized customer services. In this application, by determining the time-series data to be analyzed, extracting features from the time-series data to obtain data features including trend features, determining more representative and discriminative target features based on the extracted trend features, determining the most suitable target classification algorithm based on the trend features, classifying the time-series data by combining the target classification algorithm with the target features, and analyzing user behavior based on the classification results to adjust the service plan, the technical effect of providing more personalized customer service plans based on accurate time-series data analysis is achieved.
[0047] To accurately analyze the category of time series data, optionally, in the time series data analysis method provided in this application embodiment, feature extraction is performed on the time series data to obtain data features including:
[0048] The first step is to calculate the statistical domain index value based on the time series data, and then generate the statistical domain features based on the statistical domain index value.
[0049] Optionally, statistical domain characteristics are a quantitative description of data distribution, reflecting the central tendency, dispersion, shape characteristics, and the presence or absence of extreme values. They are an important means for the initial exploration and understanding of time series data. Mathematical statistical processing is performed on the collected time series data to calculate a series of statistical indicators, such as mean, median, standard deviation, maximum, minimum, skewness, and kurtosis.
[0050] The second step is to analyze the changing trends of the time series data and generate trend features based on these trends.
[0051] Alternatively, time series analysis techniques, such as moving averages, exponential smoothing, and autocorrelation analysis, can be used to identify trend features in time series data. Trend features can provide information about the patterns in data changes over time, which can help understand user behavior patterns, predict future behavior, and formulate strategies.
[0052] The third step is to obtain data characteristics based on statistical domain characteristics and trend characteristics.
[0053] Optionally, the extracted statistical domain features and trend features can be integrated to form a comprehensive data feature set, which includes the results of static statistical description and dynamic trend analysis of the data. This set can more comprehensively and three-dimensionally reflect the characteristics of time series data and provide rich information for subsequent classification and decision-making.
[0054] In summary, through the above steps, the calculation of statistical domain index values provides quantitative support for the initial understanding of the data, the analysis of changing trends further deepens the understanding of the dynamic patterns of the data, and finally, by integrating statistical domain features and trend features, a multi-level and comprehensive set of data features is constructed, providing a rich data foundation for determining the category of time series data.
[0055] To improve the accuracy of time series data analysis, optionally, in the time series data analysis method provided in this application embodiment, determining the target features among the data features based on trend characteristics includes:
[0056] The first step is to select the standard deviation, interquartile range, and mean absolute error features from the data features as target features when the trend features belong to the first type of trend. Among these features, the difference in change between data points in the first type of trend is less than the first preset difference.
[0057] Optionally, the first type of trend, i.e., the difference in variation between data points is less than a first preset difference, is characterized by a constant mean with small fluctuations and no long-term trend or structural change. In this case, the standard deviation feature is chosen to measure the dispersion of the data; the interquartile range feature can reflect the variation in the middle 50% of the data distribution range, which is particularly suitable for detecting outliers; the mean absolute error feature can be used to quantify the average distance of data points from the mean, which helps to understand the stability of the data. The first preset threshold is a quantitative standard used to define what degree of variation can be considered a first type of trend. For example, when analyzing flight query data of civil aviation managed services, it is found that the average number of queries per day is about 5,000, and the daily fluctuation range of this data is usually around ±100 times. The first preset difference can be set to 100 times, or 2% of the average number of queries can be used as the threshold, i.e., 100 times (for a daily average of 5,000 queries).
[0058] The second step is to take the standard deviation, mean absolute error, slope and intercept features of the data features as target features when the trend features belong to the second type of trend. Among them, the changes between data points in the second type of trend are linear.
[0059] Optionally, the second type of trend, where the changes between data points are linear, is characterized by a stable linear rate of change over time, a clear directionality, and stable residuals after detrending. In this case, slope and intercept features can accurately describe the rate of increase or decrease of data over time and the initial values, while standard deviation and mean absolute error features can be used to assess the tightness of the linear relationship and the distribution of data points, ensuring the reliability of the classification.
[0060] The third step is to take the histogram feature, kurtosis feature and empirical distribution function slope feature from the data features as target features when the trend features belong to the third type of trend. Among them, the data points in the third type of trend change periodically.
[0061] Alternatively, the third type of trend refers to the periodic variation among data points, characterized by regular, repetitive oscillation patterns. In this case, histogram features can represent the overall shape of the data distribution, kurtosis features can be used to measure the sharpness of the data distribution, and empirical distribution function slope features can capture the intensity and frequency of periodic changes. These features are crucial for identifying periodic patterns and regularities.
[0062] The fourth step is to select the maximum value feature, minimum value feature, percentile feature of higher-order empirical distribution function, and slope feature of empirical distribution function as target features when the trend feature belongs to the fourth type of trend. Among them, the difference in change between data points in the fourth type of trend is greater than the second preset difference.
[0063] Optionally, the fourth type of trend refers to trends where the difference in change between data points is greater than the second preset difference, such as steep increases, steep decreases, upward jumps, and downward jumps. This trend is characterized by one or more structural abrupt changes that cause significant and rapid changes in the sequence level, prominent extreme values, obvious tail characteristics, and high skewness. In this case, maximum and minimum value features can highlight these abrupt changes, higher-order empirical distribution function percentile features can be used to quantify the distribution of extreme values, and empirical distribution function slope features can help identify changes in the data distribution before and after the abrupt change. These features help capture abnormal fluctuations and extreme events in the data. The second preset difference is a quantitative standard used to define the degree of change that can be considered a fourth type of trend. For example, in civil aviation services, the focus is on the frequency of users calling the flight query interface. The second preset difference can be set to 20% of the average call frequency. Then, if there are data points in the time series data where the call frequency changes by more than 20% in a short period of time, the trend of the time series data will be considered a fourth type of trend.
[0064] Fifth, if the trend characteristics belong to the fifth type of trend, the standard deviation, mean absolute error, and root mean square characteristics in the data characteristics are used as target features. Among them, the data points in the fifth type of trend change irregularly.
[0065] Optionally, the fifth type of trend, characterized by irregular changes between data points, is highly random, lacking obvious trends, cycles, or structural patterns, resembling white noise or a random walk. In this case, choosing standard deviation, mean absolute error, and root mean square characteristics can quantify the degree of data fluctuation and instability, enabling the discovery of hidden statistical patterns in chaotic and disordered data.
[0066] In summary, by identifying various trend features and selecting the most suitable target features through the above steps, the subsequent classification algorithm can make full use of the key information in the data, thereby improving the accuracy and efficiency of determining the classification category of time series data.
[0067] To improve the accuracy of determining the classification category of time series data, optionally, in the time series data analysis method provided in this application embodiment, a target classification algorithm is determined based on trend characteristics, and the time series data is classified according to target characteristics using the target classification algorithm to determine the classification category of the time series data, including:
[0068] The first step is to determine the target classification algorithm as Naive Bayes when the trend feature belongs to the first type of trend. The Naive Bayes algorithm is then used to classify the time series data according to the target feature to determine the classification category of the time series data.
[0069] Optionally, for data points exhibiting small differences in variation and showing an overall stable state, the Naive Bayes algorithm can be chosen for target classification. Based on Bayes' theorem, the Naive Bayes algorithm assumes that features are independent of each other, making it suitable for datasets with strong feature independence. This allows the Naive Bayes algorithm to effectively identify and classify time-series data in this stable state.
[0070] The second step is to determine the target classification algorithm as the support vector machine algorithm when the trend feature belongs to the second type of trend. The support vector machine algorithm is used to classify the time series data according to the target feature to determine the classification category of the time series data.
[0071] Optionally, the data points of the second type of trend exhibit a stable linear rate of change over time, showing a clear directionality. In this case, the target classification algorithm can be a Support Vector Machine (SVM) algorithm. SVM algorithms can handle high-dimensional data, finding the optimal hyperplane for classification, and are particularly suitable for cases where the feature space is linearly separable or mapped to linear separability through kernel tricks. In the second type of trend, the linearity of the data allows SVM to effectively capture this trend and find the correct classification hyperplane through model training. For processing data with clear directionality, the SVM algorithm demonstrates good classification performance.
[0072] The third step is to determine the target classification algorithm as the random forest algorithm when the trend features belong to the third type of trend. The random forest algorithm is used to classify the time series data according to the target features to determine the classification category of the time series data.
[0073] Optionally, if the data points of the third type of trend exhibit regular, repetitive oscillation patterns, i.e., periodic changes, the target classification algorithm can be either a random forest algorithm or a neural network algorithm. The random forest algorithm, based on ensemble learning of multiple decision trees, can capture these complex periodic patterns by constructing multiple decision trees and determine the final classification result through a voting mechanism. For periodically changing time series, the random forest algorithm can improve the accuracy and stability of classification.
[0074] The fourth step is to determine the target classification algorithm as the gradient boosting tree algorithm when the trend feature belongs to the fourth type of trend. The gradient boosting tree algorithm is used to classify the time series data according to the target feature to determine the classification category of the time series data.
[0075] Optionally, the fourth type of trend data points contain one or more abrupt changes, causing significant and rapid changes in the sequence level. The target classification algorithm can be either the gradient boosting tree algorithm or the random forest algorithm. The gradient boosting tree algorithm iteratively trains multiple weak classifiers, gradually reducing prediction errors and ultimately forming a strong classifier. The gradient boosting tree algorithm can capture abrupt changes and progressively adjust the model to adapt to the abrupt changes in the sequence. Through the combination of multiple weak classifiers, the gradient boosting tree can more accurately identify and classify time series data containing abrupt changes.
[0076] The fifth step is to determine the target classification algorithm as the K-nearest neighbor algorithm when the trend feature belongs to the fifth type of trend. The K-nearest neighbor algorithm is used to classify the time series data according to the target feature to determine the classification category of the time series data.
[0077] Optionally, since the data points for the fifth trend change irregularly, the target classification algorithm can be either the K-nearest neighbor algorithm or the random forest algorithm. The K-nearest neighbor algorithm calculates the distance between the test sample and the samples in the training set, and selects the K nearest samples for classification. For dealing with irregular data, the K-nearest neighbor algorithm can determine the classification result by directly comparing sample features, and it shows good applicability in classifying irregularly changing time series data.
[0078] In summary, by following the steps described above and selecting the most suitable target classification algorithm based on time series data with different trend characteristics, the accuracy of time series data analysis can be improved.
[0079] To improve the accuracy of analyzing time series data of the first type of trend, optionally, in the time series data analysis method provided in this application embodiment, when the trend feature belongs to the first type of trend, the target classification algorithm is determined to be the Naive Bayes algorithm. The time series data is classified according to the target feature using the Naive Bayes algorithm, and the classification category to which the time series data belongs includes:
[0080] The first step is to convert the time series data, standard deviation features, interquartile range features, and mean absolute error features into feature vectors.
[0081] Optionally, converting time series data and its associated statistical domain features (standard deviation, interquartile range, mean absolute error) into feature vectors can integrate multiple features into a single vector representation. Using feature vectors, the Naive Bayes algorithm can perform direct computation, avoiding the complexity and inefficiency of directly processing raw time series data.
[0082] The second step is to input the feature vector into the Naive Bayes algorithm, and then estimate the degree of matching between the time series data and the feature distributions of different categories based on the Naive Bayes algorithm.
[0083] Optionally, the Naive Bayes algorithm is based on Bayes' theorem, assuming that the features are independent of each other. The constructed feature vector is input into the Naive Bayes classifier, which calculates the conditional probability distribution of the features under each category based on the training data, and then uses these probability distributions to estimate the probability that the feature vector of the current time series data belongs to each category.
[0084] The third step is to determine the classification category of the time series data based on the degree of matching between the time series data and the feature distributions of different categories.
[0085] Optionally, after obtaining the matching degree of feature vectors under different categories, the classification category to which the time series data is most likely to belong can be determined based on these matching degrees, and the category with the highest matching degree can be selected as the final classification result.
[0086] In summary, by following the steps outlined above, the Naive Bayes algorithm was selected as the target classification algorithm to classify time series data of the first type of trend. Through the construction of feature vectors and the calculation of classification probabilities, the most likely classification category of the time series data was finally determined, thus improving the accuracy of the analysis.
[0087] To improve the accuracy of analyzing time series data of the second type of trend, optionally, in the time series data analysis method provided in this application embodiment, when the trend feature belongs to the second type of trend, the target classification algorithm is determined to be the support vector machine algorithm. The time series data is classified according to the target feature using the support vector machine algorithm, and the classification category to which the time series data belongs includes:
[0088] The first step is to convert the standard deviation feature, the mean absolute error feature, the slope feature, the intercept feature, and the time series data into feature vectors.
[0089] Optionally, converting time series data and its associated statistical features such as standard deviation, mean absolute error, slope, and intercept into a feature vector can transform the complex structure of the original data into a numerical format that the algorithm can directly manipulate.
[0090] The second step is to input the feature vectors into the vector machine model, and then use the vector machine model to calculate the distance between the feature vectors and the hyperplane to determine the classification category of the time series data. The hyperplane is used to distinguish between different categories of time series data.
[0091] Optionally, the constructed feature vectors are input into a pre-trained support vector machine (SVM) model. The SVM algorithm can find an optimal hyperplane that maximizes the margin between samples of different classes. The SVM algorithm calculates the distance from the feature vector to each class hyperplane. The sign and magnitude of the distance determine the classification of the sample and its proximity to the classification boundary. The sample closest to a certain class hyperplane can be determined to belong to that class.
[0092] In summary, through the above steps, the Support Vector Machine (SVM) algorithm is selected as the target classification algorithm to classify the time series data of the second type of trend. The time series data and its statistical features are integrated into a feature vector. The distance from the feature vector to the classification hyperplane is calculated using the SVM model to evaluate the classification of the time series data. Finally, by comparing the distances, the most likely classification category of the time series data can be determined, thereby achieving accurate classification of linear trend data.
[0093] To improve the accuracy of analyzing time series data with a third type of trend, optionally, in the time series data analysis method provided in this application embodiment, when the trend feature belongs to the third type of trend, the target classification algorithm is determined to be the random forest algorithm. The random forest algorithm is used to classify the time series data according to the target feature, and the classification category to which the time series data belongs includes:
[0094] The first step is to convert histogram features, kurtosis features, empirical distribution function slope features, and time series data into feature vectors.
[0095] Optionally, converting time series data and related histogram features, kurtosis features, empirical distribution function slopes, etc., into feature vectors can provide the random forest algorithm with an input representation that integrates the statistical characteristics and periodic information of time series.
[0096] The second step is to input the feature vectors into the random forest algorithm. In the random forest algorithm, each tree classifies the feature vectors based on decision rules to determine the classification category of the time series data.
[0097] Alternatively, after the feature vector is input into the random forest algorithm, the random forest algorithm classifies the time series data by constructing multiple decision trees. During classification, each tree independently classifies the feature vector according to the decision rules learned during its training. The final classification category can then be determined by a majority voting mechanism or by averaging the prediction results.
[0098] In summary, through the above steps, the Random Forest algorithm was selected as the target classification algorithm to analyze the time series data of the third trend. By integrating the time series data and its statistical and periodic features into a feature vector, the Random Forest algorithm constructs multiple decision trees and improves the classification accuracy through random sampling and majority voting mechanisms. Finally, by integrating the classification results of each tree, the Random Forest can determine the classification category to which the time series data belongs.
[0099] Optionally, Figure 4 The diagram shows a system architecture of a time series data analysis method provided according to an embodiment of this application. It includes a data import module for importing time series data to be analyzed; a data feature extraction module for extracting data features from the time series data; a data feature selection model for selecting the most representative target features based on the trend characteristics of the time series data; a data classification module for selecting the most suitable target classification algorithm to determine the classification category of the time series data; and a classification result visualization module for visually displaying the classification category of the time series data.
[0100] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0101] Example 2
[0102] This application also provides a time series data analysis apparatus. It should be noted that the time series data analysis apparatus of this application can be used to execute the time series data analysis method provided in this application. The time series data analysis apparatus provided in this application will be described below.
[0103] According to embodiments of this application, an apparatus for implementing the above-described method for analyzing time series data is also provided, such as... Figure 5 As shown, the device includes: a first determining unit 501, an extraction unit 502, a second determining unit 503, a third determining unit 504, and an adjustment unit 505.
[0104] Specifically, the first determining unit 501 is used to determine the time series data to be analyzed, wherein the time series data is a dataset formed based on user behavior operation records;
[0105] The extraction unit 502 is used to extract features from time series data to obtain data features, including trend features.
[0106] The second determining unit 503 is used to determine the target feature in the data features based on the trend features;
[0107] The third determining unit 504 is used to determine the target classification algorithm based on trend characteristics, and to classify the time series data according to the target characteristics through the target classification algorithm to determine the classification category to which the time series data belongs.
[0108] Adjustment unit 505 is used to analyze user behavior based on the classification category of time series data in order to adjust the service plan provided to users.
[0109] The time-series data analysis apparatus provided in this application embodiment determines the time-series data to be analyzed by a first determining unit 501, wherein the time-series data is a dataset formed based on user behavior operation records; an extraction unit 502 extracts features from the time-series data to obtain data features, wherein the data features include trend features; a second determining unit 503 determines the target features in the data features based on the trend features; a third determining unit 504 determines a target classification algorithm based on the trend features, and classifies the time-series data according to the target features using the target classification algorithm to determine the category to which the time-series data belongs; and an adjustment unit 505 analyzes user behavior based on the category to which the time-series data belongs to adjust the service plan provided to the user. This solves the technical problem that inaccurate time-series data analysis cannot provide personalized services to customers, and achieves the technical effect of providing more personalized service plans to customers based on accurate time-series data analysis.
[0110] Optionally, in the time series data analysis apparatus provided in this application embodiment, the extraction unit 502 includes: a calculation module, used to calculate statistical domain index values based on time series data and generate statistical domain features based on the statistical domain index values; a generation module, used to analyze the changing trend of time series data and generate trend features based on the changing trend; and a first generation module, used to obtain data features based on the statistical domain features and trend features.
[0111] Optionally, in the time series data analysis apparatus provided in this application embodiment, the second determining unit 503 includes: a first determining module, configured to, when the trend feature belongs to a first type of trend, use the standard deviation feature, interquartile range feature, and mean absolute error feature among the data features as target features, wherein the difference in change between data points in the first type of trend is less than a first preset difference; a second determining module, configured to, when the trend feature belongs to a second type of trend, use the standard deviation feature, mean absolute error feature, slope feature, and intercept feature among the data features as target features, wherein the change between data points in the second type of trend is linear; and a third determining module, configured to, when the trend feature belongs to a third type of trend, use the standard deviation feature, mean absolute error feature, slope feature, and intercept feature among the data features as target features. The data features include histogram features, kurtosis features, and empirical distribution function slope features as target features, where the data points in the third type of trend exhibit periodic changes. The fourth determination module is used to determine the maximum value features, minimum value features, higher-order empirical distribution function percentile features, and empirical distribution function slope features as target features when the trend feature belongs to the fourth type of trend, where the difference in changes between data points in the fourth type of trend is greater than a second preset difference. The fifth determination module is used to determine the standard deviation features, mean absolute error features, and root mean square features as target features when the trend feature belongs to the fifth type of trend, where the changes between data points in the fifth type of trend are irregular.
[0112] Optionally, in the time series data analysis apparatus provided in this application embodiment, the third determining unit 504 includes: a sixth determining module, used to determine the target classification algorithm as Naive Bayes algorithm when the trend feature belongs to the first type of trend, and to classify the time series data according to the target feature using the Naive Bayes algorithm to determine the classification category to which the time series data belongs; a seventh determining module, used to determine the target classification algorithm as Support Vector Machine algorithm when the trend feature belongs to the second type of trend, and to classify the time series data according to the target feature using the Support Vector Machine algorithm to determine the classification category to which the time series data belongs; and an eighth determining module, used to determine the target classification algorithm as Support Vector Machine algorithm when the trend feature belongs to the third type of trend. In the case of a trend, the target classification algorithm is determined to be the Random Forest algorithm. The Random Forest algorithm is used to classify the time series data according to the target features to determine the category to which the time series data belongs. The ninth determination module is used to determine the target classification algorithm to be the Gradient Boosting Tree algorithm when the trend features belong to the fourth trend. The Gradient Boosting Tree algorithm is used to classify the time series data according to the target features to determine the category to which the time series data belongs. The tenth determination module is used to determine the target classification algorithm to be the K Nearest Neighbor algorithm when the trend features belong to the fifth trend. The K Nearest Neighbor algorithm is used to classify the time series data according to the target features to determine the category to which the time series data belongs.
[0113] Optionally, in the time series data analysis apparatus provided in this application embodiment, the sixth determining module includes: a first transformation submodule, used to convert time series data, standard deviation features, interquartile range features, and mean absolute error features into feature vectors; a first input submodule, used to input the feature vectors into a Naive Bayes algorithm, and estimate the degree of matching between the time series data and the feature distributions of different categories according to the Naive Bayes algorithm; and a determining submodule, used to determine the classification category to which the time series data belongs based on the degree of matching between the time series data and the feature distributions of different categories.
[0114] Optionally, in the time series data analysis apparatus provided in this application embodiment, the seventh determining module includes: a second transformation submodule, used to convert standard deviation features, absolute error mean features, slope features, intercept features, and time series data into feature vectors; and a second input submodule, used to input the feature vectors into a vector machine model, calculate the distance between the feature vectors and the hyperplane through the vector machine model, and determine the classification category to which the time series data belongs, wherein the hyperplane is used to distinguish time series data of different categories.
[0115] Optionally, in the time series data analysis device provided in the embodiments of this application, the eighth determining module includes: a third transformation submodule, used to convert histogram features, kurtosis features, empirical distribution function slope features and time series data into feature vectors; and a third input submodule, used to input the feature vectors into a random forest algorithm, in which each tree in the random forest algorithm classifies the feature vectors based on decision rules to determine the classification category to which the time series data belongs.
[0116] It should be noted that the first determining unit 501, the extraction unit 502, the second determining unit 503, the third determining unit 504, and the adjustment unit 505 mentioned above correspond to steps S201 to S205 in Embodiment 1. The five units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0117] Example 3
[0118] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.
[0119] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0120] In this embodiment, the computer terminal described above can execute the program code for the following steps in the time series data analysis method: determining the time series data to be analyzed, wherein the time series data is a dataset formed based on user behavior operation records; extracting features from the time series data to obtain data features, wherein the data features include trend features; determining the target features in the data features based on the trend features; determining the target classification algorithm based on the trend features, classifying the time series data according to the target features using the target classification algorithm, and determining the category to which the time series data belongs; and analyzing user behavior based on the category to which the time series data belongs to in order to adjust the service plan provided to the user.
[0121] Optionally, the computer terminal described above can execute program code for the following steps in the time series data analysis method: extracting features from the time series data to obtain data features, including: calculating statistical domain index values based on the time series data, generating statistical domain features based on the statistical domain index values; analyzing the changing trends of the time series data, generating trend features based on the changing trends; and obtaining data features based on the statistical domain features and trend features.
[0122] Optionally, the aforementioned computer terminal can execute program code for the following steps in the time series data analysis method: determining target features in the data features based on trend characteristics includes: when the trend characteristics belong to the first type of trend, using the standard deviation, interquartile range, and mean absolute error features in the data features as target features, wherein the difference in variation between data points in the first type of trend is less than a first preset difference; when the trend characteristics belong to the second type of trend, using the standard deviation, mean absolute error, slope, and intercept features in the data features as target features, wherein the variation between data points in the second type of trend is linear; when the trend characteristics belong to the third type of trend... In the case of a trend, histogram features, kurtosis features, and empirical distribution function slope features are used as target features, where the changes between data points in the third trend are periodic. In the case of a trend belonging to the fourth trend, maximum value features, minimum value features, higher-order empirical distribution function percentile features, and empirical distribution function slope features are used as target features, where the difference in changes between data points in the fourth trend is greater than a second preset difference. In the case of a trend belonging to the fifth trend, standard deviation features, mean absolute error features, and root mean square features are used as target features, where the changes between data points in the fifth trend are irregular.
[0123] Optionally, the aforementioned computer terminal can execute program code for the following steps in the time series data analysis method: determining a target classification algorithm based on trend characteristics, classifying the time series data according to the target characteristics using the target classification algorithm, and determining the classification category of the time series data, including: if the trend characteristics belong to the first type of trend, determining the target classification algorithm as the Naive Bayes algorithm, classifying the time series data according to the target characteristics using the Naive Bayes algorithm, and determining the classification category of the time series data; if the trend characteristics belong to the second type of trend, determining the target classification algorithm as the Support Vector Machine algorithm, classifying the time series data according to the target characteristics using the Support Vector Machine algorithm, and determining the classification category of the time series data. The time series data is classified into the following categories: If the trend characteristic belongs to the third category, the target classification algorithm is determined to be the Random Forest algorithm. The Random Forest algorithm is used to classify the time series data according to the target characteristic to determine its category. If the trend characteristic belongs to the fourth category, the target classification algorithm is determined to be the Gradient Boosting Tree algorithm. The Gradient Boosting Tree algorithm is used to classify the time series data according to the target characteristic to determine its category. If the trend characteristic belongs to the fifth category, the target classification algorithm is determined to be the K-Nearest Neighbors algorithm. The K-Nearest Neighbors algorithm is used to classify the time series data according to the target characteristic to determine its category.
[0124] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the time series data analysis method: When the trend feature belongs to the first type of trend, determine the target classification algorithm as the Naive Bayes algorithm; classify the time series data according to the target features using the Naive Bayes algorithm; determine the classification category of the time series data by: converting the time series data, standard deviation feature, interquartile range feature, and mean absolute error feature into feature vectors; inputting the feature vectors into the Naive Bayes algorithm; estimating the degree of matching between the time series data and the feature distributions of different categories according to the Naive Bayes algorithm; and determining the classification category of the time series data based on the degree of matching between the time series data and the feature distributions of different categories.
[0125] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the time series data analysis method: When the trend feature belongs to the second type of trend, determine the target classification algorithm as the support vector machine algorithm; classify the time series data according to the target features using the support vector machine algorithm; determine the classification category of the time series data by: converting the standard deviation feature, the mean absolute error feature, the slope feature, the intercept feature, and the time series data into feature vectors; inputting the feature vectors into the support vector machine model; calculating the distance between the feature vectors and the hyperplane using the support vector machine model; and determining the classification category of the time series data, where the hyperplane is used to distinguish different categories of time series data.
[0126] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the time series data analysis method: When the trend feature belongs to the third type of trend, determine the target classification algorithm as the random forest algorithm, and classify the time series data according to the target features using the random forest algorithm to determine the classification category of the time series data, including: converting histogram features, kurtosis features, empirical distribution function slope features, and time series data into feature vectors; inputting the feature vectors into the random forest algorithm, where each tree in the random forest algorithm classifies the feature vectors based on decision rules to determine the classification category of the time series data.
[0127] Optionally, Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 (Only one is shown) Processor 602, memory 604, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0128] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the time series data analysis method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned time series data analysis method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0129] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the time series data analysis method.
[0130] This application provides a scheme for analyzing time series data. It involves determining the time series data to be analyzed, where the time series data is a dataset formed based on user behavior operation records; extracting features from the time series data to obtain data features, including trend features; determining target features among the data features based on the trend features; determining a target classification algorithm based on the trend features; classifying the time series data according to the target features using the target classification algorithm to determine the category to which the time series data belongs; and analyzing user behavior based on the category to which the time series data belongs to adjust the service plan provided to the user. This solves the technical problem that inaccurate time series data analysis cannot provide personalized customer services. In this application, by determining the time series data to be analyzed, extracting features from the time series data to obtain data features including trend features, determining more representative and discriminative target features based on the extracted trend features, determining the most suitable target classification algorithm based on the trend features, classifying the time series data by combining the target classification algorithm with the target features, and analyzing user behavior based on the classification results to adjust the service plan, the technical effect of providing more personalized customer service plans based on accurate time series data analysis is achieved.
[0131] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 6 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.
[0132] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0133] Example 4
[0134] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the time series data analysis method provided in Embodiment 1.
[0135] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0136] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing steps of a method for analyzing time series data.
[0137] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0138] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0140] The units described as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.
[0141] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0142] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0143] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for analyzing time series data, characterized in that, include: The time series data to be analyzed is determined, wherein the time series data is a dataset formed based on user behavior operation records; Feature extraction is performed on the time series data to obtain data features, wherein the data features include trend features; Determine the target feature in the data features based on the trend characteristics; A target classification algorithm is determined based on the trend characteristics. The time series data is then classified according to the target characteristics using the target classification algorithm to determine the classification category to which the time series data belongs. Based on the classification category of the time series data, the user behavior is analyzed to adjust the service plan provided to the user.
2. The method according to claim 1, characterized in that, Feature extraction is performed on the time series data to obtain data features including: Calculate statistical domain index values based on the time series data, and generate statistical domain features based on the statistical domain index values; Analyze the changing trend of the time series data, and generate the trend feature based on the changing trend; The data features are obtained based on the statistical domain features and the trend features.
3. The method according to claim 1, characterized in that, Determining the target features in the data features based on the trend characteristics includes: When the trend feature belongs to the first type of trend, the standard deviation feature, interquartile range feature, and mean absolute error feature in the data features are used as the target features, wherein the difference in change between data points in the first type of trend is less than a first preset difference. When the trend feature belongs to the second type of trend, the standard deviation feature, the mean absolute error feature, the slope feature, and the intercept feature in the data features are used as the target features, wherein the data points in the second type of trend change linearly; When the trend feature belongs to the third type of trend, the histogram feature, kurtosis feature and empirical distribution function slope feature in the data features are taken as the target features, wherein the changes between data points in the third type of trend are periodic. When the trend feature belongs to the fourth type of trend, the maximum value feature, minimum value feature, percentile feature of higher-order empirical distribution function, and slope feature of empirical distribution function in the data features are taken as the target features, wherein the difference in change between data points in the fourth type of trend is greater than the second preset difference; When the trend feature belongs to the fifth type of trend, the standard deviation feature, the mean absolute error feature, and the root mean square feature among the data features are used as the target features, wherein the data points in the fifth type of trend change irregularly.
4. The method according to claim 3, characterized in that, Based on the trend characteristics, a target classification algorithm is determined. This algorithm then classifies the time series data according to the target characteristics, determining the classification category to which the time series data belongs. If the trend feature belongs to the first type of trend, the target classification algorithm is determined to be the Naive Bayes algorithm. The time series data is classified according to the target feature by the Naive Bayes algorithm to determine the classification category to which the time series data belongs. If the trend feature belongs to the second type of trend, the target classification algorithm is determined to be the support vector machine algorithm. The time series data is classified according to the target feature by the support vector machine algorithm to determine the classification category to which the time series data belongs. If the trend feature belongs to the third type of trend, the target classification algorithm is determined to be the random forest algorithm. The random forest algorithm is used to classify the time series data according to the target feature to determine the classification category of the time series data. If the trend feature belongs to the fourth type of trend, the target classification algorithm is determined to be the gradient boosting tree algorithm. The gradient boosting tree algorithm is used to classify the time series data according to the target feature to determine the classification category of the time series data. If the trend feature belongs to the fifth type of trend, the target classification algorithm is determined to be the K-nearest neighbor algorithm. The time series data is classified according to the target feature by the K-nearest neighbor algorithm to determine the classification category to which the time series data belongs.
5. The method according to claim 4, characterized in that, If the trend feature belongs to the first type of trend, the target classification algorithm is determined to be the Naive Bayes algorithm. The Naive Bayes algorithm is used to classify the time series data based on the target feature, and the classification category of the time series data is determined as follows: The time series data, the standard deviation feature, the interquartile range feature, and the mean absolute error feature are converted into feature vectors. The feature vector is input into the Naive Bayes algorithm, and the degree of matching between the time series data and the feature distribution of different categories is estimated according to the Naive Bayes algorithm. The classification category of the time series data is determined based on the degree of matching between the time series data and the feature distributions of different categories.
6. The method according to claim 4, characterized in that, If the trend feature belongs to the second type of trend, the target classification algorithm is determined to be the support vector machine algorithm. The time series data is classified using the support vector machine algorithm based on the target feature, and the classification category of the time series data is determined as follows: The standard deviation feature, the mean absolute error feature, the slope feature, the intercept feature, and the time series data are converted into feature vectors. The feature vector is input into a vector machine model, and the distance between the feature vector and the hyperplane is calculated by the vector machine model to determine the classification category of the time series data. The hyperplane is used to distinguish time series data of different categories.
7. The method according to claim 4, characterized in that, If the trend feature belongs to the third type of trend, the target classification algorithm is determined to be the random forest algorithm. The random forest algorithm is used to classify the time series data according to the target feature, and the classification category of the time series data is determined as follows: The histogram features, the kurtosis features, the empirical distribution function slope features, and the time series data are converted into feature vectors. The feature vector is input into the random forest algorithm, where each tree classifies the feature vector based on decision rules to determine the classification category to which the time series data belongs.
8. An analysis device for time series data, characterized in that, include: The first determining unit is used to determine the time series data to be analyzed, wherein the time series data is a dataset formed based on user behavior operation records; An extraction unit is used to extract features from the time series data to obtain data features, wherein the data features include trend features; The second determining unit is used to determine the target feature in the data features based on the trend features; The third determining unit is used to determine a target classification algorithm based on the trend characteristics, and to classify the time series data according to the target characteristics using the target classification algorithm to determine the classification category to which the time series data belongs; The adjustment unit is used to analyze the user behavior based on the classification category to which the time series data belongs, so as to adjust the service plan provided to the user.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the time series data analysis method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the method for analyzing time series data according to any one of claims 1 to 7.
11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the time series data analysis method according to any one of claims 1 to 7.