A method, system and device for testing a time series database
By schema analysis of the timing data of the timing database and automatically generating test cases, the problem of inefficiency of traditional manual testing is solved, efficient and accurate automated testing is achieved, and the stability and reliability of the timing database is ensured.
Patent Information
- Application Number
- CN202411207840.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2024-06-26
- Filing Date
- 2024-08-30
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2044-08-30
AI Technical Summary
Traditional manual testing methods are inefficient when iterating time series database versions, and cannot fully cover newly introduced functions and possible defects, resulting in performance degradation or data inconsistency.
By obtaining the timing data of the timing database for pattern analysis, generating timing analysis data, automatically generating test cases based on the analysis data, and using the pre-set test execution engine to execute test cases, reducing manual participation, improving testing efficiency and accuracy covering key functions.
It realizes automated testing, improves testing efficiency, enhances the coverage and accuracy of test cases, and ensures the stability and reliability of the timing database.
Smart Images

Figure CN119065982B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of databases, and in particular to a time series database testing method, system, and device. Background Art
[0002] Time series data, also known as time series data, refers to data arranged in chronological order. Time series data reflects the changing trends of one or more random variables over time. Time series databases are systems specifically designed to store and process time series data. They must support basic functions such as fast writing, persistence, and multi-dimensional aggregate queries. Time series databases offer advantages such as high performance, high throughput, and scalability. They can securely and efficiently aggregate, store, analyze, and distribute terabytes or even petabytes of data generated daily by large amounts of physical data collection devices. Their query and analysis capabilities significantly facilitate time series data analysis and user decision-making.
[0003] With the increasing popularity and use of time series data in finance, the Internet of Things, energy, and other fields, the demand for time series databases has gradually increased. However, time series database systems are frequently updated and iterated. Due to the high dimensionality, large scale, and complexity of time series data, such as data volume, number of sub-tables, and multi-dimensional data fields, ensuring the stability and reliability of time series databases after each version update has become a must-consider issue. Testing each iteration not only includes testing new features but also requires regression testing of key core functions of previous versions. However, traditional manual testing methods are often time-consuming and labor-intensive, with low testing efficiency. Moreover, manual testing may not fully cover all newly introduced features and potential defects, leading to performance degradation or data inconsistencies after version iterations. Summary of the Invention
[0004] In order to improve testing efficiency, the present application provides a time series database testing method, system and device. In the first aspect, the present application provides a time series database testing method, which adopts the following technical solutions:
[0005] A time series database testing method, comprising:
[0006] Acquire time series data in a target time series database, and perform pattern analysis on the time series data to obtain time series analysis data, where the time series analysis data is used to characterize at least one data feature of the time series data;
[0007] Creating at least one test case according to the time series analysis data and predefined test case creation rules, wherein the test case has at least one data feature of the time series data;
[0008] The at least one test case is executed according to a preset test execution engine and predefined test case execution rules to obtain a test result.
[0009] By adopting the above technical solution, the time series data in the target time series database is obtained, and the time series data is subjected to pattern analysis to obtain time series analysis data, which is used to characterize the data characteristics of at least one time series data; then, at least one test case is created based on the time series analysis data and predefined test case creation rules, and the test case has the data characteristics of at least one time series data; finally, at least one test case is executed according to a pre-set test execution engine and pre-defined test case execution rules to obtain a test result. The test method of the present application is highly automated. By automatically generating and executing test cases, the need for manual participation is reduced, which is more time-saving and labor-saving, thereby improving test efficiency. Compared with manual testing, the test cases cover key functions and performance indicators more comprehensively and with higher accuracy.
[0010] Optionally, the step of performing pattern analysis on the time series data to obtain time series analysis data includes:
[0011] Performing data preprocessing on the time series data to obtain preprocessed data;
[0012] Performing feature engineering on the preprocessed data to obtain data features;
[0013] The data features are input into the evaluated time series data analysis model to obtain time series analysis data.
[0014] By adopting the above technical solution, in order to obtain time series analysis data, the time series data is first preprocessed to obtain preprocessed data, and then feature engineering is performed on the preprocessed data to obtain data features. Then, the data features are input into the evaluated time series data analysis model to obtain time series analysis data.
[0015] Optionally, the step of performing feature engineering on the preprocessed data to obtain data features includes:
[0016] Performing feature construction and feature extraction on the preprocessed data to obtain intermediate features;
[0017] An application scenario of the time series data is obtained, and feature selection is performed on the intermediate features according to the application scenario to determine data features.
[0018] By adopting the above technical solution, in order to determine the data characteristics, feature construction and feature extraction are performed on the preprocessed data to obtain intermediate features, and then the application scenario of the time series data is obtained, and feature selection is performed on the intermediate features according to the application scenario to determine the data characteristics.
[0019] Optionally, the step of obtaining an application scenario of the time series data, and performing feature selection on the intermediate features according to the application scenario to determine data features includes:
[0020] Acquire an application scenario of the time series data, and determine a feature category of each intermediate feature based on the application scenario and the intermediate features;
[0021] For each feature category, the feature category is used as a target category, and the correlation degree between the target category and each non-target category is calculated;
[0022] Determining the weight corresponding to each feature category based on the application scenario, and calculating the evaluation value of each feature category according to the weight and the association degree;
[0023] The feature category is selected according to the size of the evaluation value, and the intermediate feature corresponding to the selected feature category is used as the data feature.
[0024] By adopting the above technical solution, in order to obtain data features, the application scenario of the time series data is first obtained, and the feature category of each intermediate feature is determined based on the application scenario and the intermediate features. For each feature category, the feature category is used as the target category, and the correlation between the target category and each non-target category is calculated. Then, the weight corresponding to each feature category is determined based on the application scenario, and the evaluation value of each feature category is calculated based on the weight and correlation. Then, the feature category is selected according to the size of the evaluation value, and the intermediate feature corresponding to the selected feature category is used as the data feature.
[0025] Optionally, the step of generating the evaluated time series data analysis model includes:
[0026] Obtaining sample data, and dividing the sample data into a training set, a validation set, and a test set;
[0027] Obtaining a pre-built time series data analysis model, and training the pre-built time series data analysis model according to the training set to obtain a trained time series data analysis model;
[0028] Optimizing the trained time series data analysis model according to the validation set to obtain an optimized time series data analysis model;
[0029] The optimized time series data analysis model is evaluated according to the test set to obtain an evaluated time series data analysis model.
[0030] By adopting the above technical solution, in order to obtain an evaluated time series data analysis model, sample data is first obtained and divided into a training set, a validation set and a test set, and then a pre-built time series data analysis model is obtained, and the pre-built time series data analysis model is trained according to the training set to obtain a trained time series data analysis model, and then the trained time series data analysis model is optimized according to the validation set to obtain an optimized time series data analysis model, and then the optimized time series data analysis model is evaluated according to the test set to obtain an evaluated time series data analysis model.
[0031] Optionally, after the step of executing the at least one test case according to the preset test execution engine and the predefined test case execution rules to obtain a test result, the method further includes:
[0032] Analyzing the test results to obtain test analysis data;
[0033] The predefined test case creation rules and the predefined test execution rules are optimized according to the test analysis data.
[0034] By adopting the above technical solution, in order to optimize the test case generation process and execution process and reduce manual intervention, the test results are first analyzed to obtain test analysis data, and then the pre-defined test case creation rules and pre-defined test execution rules are optimized based on the test analysis data.
[0035] Optionally, the step of optimizing the predefined test case creation rules and the predefined test execution rules according to the test analysis data includes: the predefined test case creation rules include creation parameters of the test case; the predefined test execution rules include execution priorities of each test case;
[0036] For each test case, obtaining the number of successful executions and the number of failed executions of the test case according to the test analysis data;
[0037] Calculating the execution success rate of the test case according to the number of successful executions and the number of failed executions;
[0038] Determine whether the execution success rate is lower than a preset value, and if so, adjust at least one of the creation parameter, execution priority, and execution frequency according to a preset rule.
[0039] By adopting the above technical solution, for each test case, the number of successful executions and the number of failed executions of the test case are obtained based on the test analysis data, and then the execution success rate of the test case is calculated based on the number of successful executions and the number of failed executions, and it is determined whether the execution success rate is lower than the preset value. If the execution success rate is lower than the preset value, at least one of the creation parameters, execution priority and execution frequency is adjusted according to the preset rules.
[0040] In a second aspect, the present application also provides a time series database testing system, which adopts the following technical solutions:
[0041] A time series database testing system, comprising:
[0042] A time series data pattern analysis module is used to obtain time series data in a target time series database and perform pattern analysis on the time series data to obtain time series analysis data, wherein the time series analysis data is used to characterize at least one data feature of the time series data;
[0043] an iterative test case generation module, configured to create at least one test case based on the time series analysis data and predefined test case creation rules, wherein the test case has at least one data characteristic of the time series data;
[0044] The test execution engine module is used to execute the at least one test case according to a preset test execution engine and predefined test case execution rules to obtain a test result.
[0045] The testing device further includes a feedback learning module, which includes:
[0046] A test result analysis submodule, used to analyze the test results to obtain test analysis data;
[0047] The optimization submodule is used to optimize the predefined test case creation rules and the predefined test execution rules according to the test analysis data.
[0048] In a third aspect, the present application further provides a computer device that adopts the following technical solution:
[0049] A computer device comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the method described in the first aspect when executing the computer program.
[0050] In summary, the present application includes at least the following beneficial technical effects: obtaining time series data in a target time series database, and performing pattern analysis on the time series data to obtain time series analysis data, the time series analysis data being used to characterize the data characteristics of at least one time series data; then creating at least one test case based on the time series analysis data and predefined test case creation rules, the test case having the data characteristics of at least one time series data; finally executing at least one test case based on a pre-set test execution engine and predefined test case execution rules to obtain a test result. The test method of the present application is highly automated, and by automatically generating and executing test cases, the need for manual participation is reduced, which is more time-saving and labor-saving, thereby improving test efficiency. Compared with manual testing, the test cases cover key functions and performance indicators more comprehensively and with higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of the overall process of the embodiment of the present application.
[0052] Figure 2 It is a schematic diagram of the workflow of the system of the embodiment of the present application.
[0053] Figure 3 It is a structural diagram of the system of this application.
[0054] Figure 4 It is a structural block diagram of the computer device of this application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-4 It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0056] The embodiment of the present application discloses a time series database testing method.
[0057] Reference Figure 1 , a time series database testing method, comprising the following steps:
[0058] Step S11: Acquire time series data in a target time series database, and perform pattern analysis on the time series data to obtain time series analysis data.
[0059] The time series analysis data is used to characterize the data characteristics of at least one item of time series data.
[0060] It should be noted that the reference Figure 2In step S11, the data pattern of the target time series database is analyzed by the time series data pattern analysis module to obtain time series analysis data. The time series analysis data includes characteristics such as trend, seasonality, and periodicity. That is, the time series of time series data is analyzed based on machine learning technology to identify the key patterns and abnormal behaviors of the time series data. In addition, the noise and outliers in the time series data can be identified to improve the accuracy of the test. If the time series data is a data set of electricity consumption, the time series analysis data may include: daily periodicity of electricity consumption, that is, electricity consumption increases significantly in specific time periods every day (such as 7 to 8 in the morning and 8 to 10 in the evening); weekly seasonality of electricity consumption, that is, electricity consumption on weekends is lower than that on weekdays; abnormal behavior of electricity consumption, such as a sudden increase in electricity consumption during low-peak hours for several consecutive days, which indicates that there may be noise in the data or a special event has occurred.
[0061] Step S12: creating at least one test case according to the time series analysis data and predefined test case creation rules.
[0062] The test case has at least one data characteristic of time series data.
[0063] It should be noted that the reference Figure 2 In step S12, based on the timing analysis data output in step S11, the test case generation module automatically creates test cases for the target time series database. The generated test cases are used to verify the performance and reliability of the target time series database and the accuracy of the timing data. The generated test cases involve aspects such as data processing, response time query, and data accuracy analysis. During the implementation process, different user scenarios and data traffic also need to be considered to ensure that the test covers key database functions and performance indicators. In addition, specific test scenarios will be created based on the timing analysis data. For example, when verifying daily periodicity, test cases are used to verify whether the database can accurately calculate and predict the peak power consumption during specific time periods each day. When performing performance testing, test cases are used to simulate the data loading performance and query performance on weekends and weekdays to ensure that the system remains stable when the data volume changes. When performing outlier processing, test cases are used to check how the target time series database handles and reports abnormal data, such as a sudden increase in power consumption.
[0064] Step S13: Execute at least one test case according to a preset test execution engine and predefined test case execution rules to obtain a test result.
[0065] It should be noted that the reference Figure 2In step S13, the test execution engine module automatically executes the test cases created by the test case generation module according to predefined test case execution rules, thereby obtaining test results. The test execution engine module supports automated testing of various target time series database operations, including data insertion, query, and data analysis functions, ensuring that tests cover key database functions and performance indicators. Furthermore, the test execution engine module can simulate different load conditions to evaluate the performance of the target time series database under high load.
[0066] It should be further explained that the reference Figure 2 After the test results are generated, they can be displayed on the terminal, and the tester can provide feedback to the feedback learning module based on the test results; in addition, the tester can also configure the test parameters, conduct the test, and then view the test results and the corresponding test report.
[0067] In the above embodiment, the time series data in the target time series database is obtained, and the time series data is subjected to pattern analysis to obtain time series analysis data, which is used to characterize the data characteristics of at least one time series data; then, at least one test case is created based on the time series analysis data and predefined test case creation rules, and the test case has the data characteristics of at least one time series data; finally, at least one test case is executed according to a pre-set test execution engine and predefined test case execution rules to obtain a test result. The test method of the present application is highly automated. By automatically generating and executing test cases, the need for manual participation is reduced, which is more time-saving and labor-saving, thereby improving test efficiency. Compared with manual testing, the test cases cover key functions and performance indicators more comprehensively and with higher accuracy.
[0068] As a further implementation method of the time series database testing method, the data characteristics of the time series data include at least one of data time series characteristics, data query characteristics and abnormal behavior characteristics. The data time series characteristics are used to characterize the data characteristics of the time series data in the time series; the data query characteristics are used to characterize the data characteristics of the time series data in the query structure; and the abnormal behavior characteristics are used to characterize the abnormal characteristics of the time series data in dynamic changes.
[0069] As a further implementation of the time series database testing method, the step of performing pattern analysis on the time series data to obtain time series analysis data includes the following steps:
[0070] Step S21: preprocess the time series data to obtain preprocessed data.
[0071] It can be understood that the above-mentioned data preprocessing includes processing steps such as data cleaning, missing value processing, and noise smoothing.
[0072] Step S22: Perform feature engineering on the preprocessed data to obtain data features.
[0073] It can be understood that by performing feature engineering on the preprocessed data, data with large information content and representativeness, namely data features, are selected from the preprocessed data.
[0074] Step S23: input the data features into the evaluated time series data analysis model to obtain time series analysis data.
[0075] It can be understood that in the above steps, the time series data pattern analysis module identifies the features and patterns in the time series data based on machine learning technology, and then captures the data features by building and training relevant models, and further analyzes the data features to obtain time series analysis data. The time series analysis data includes long-term dependencies, nonlinear features and potential dynamic changes in the time series data.
[0076] In the above embodiment, in order to obtain time series analysis data, the time series data is first preprocessed to obtain preprocessed data, and then feature engineering is performed on the preprocessed data to obtain data features. The data features are then input into the evaluated time series data analysis model to obtain time series analysis data.
[0077] As a further implementation of the time series database testing method, the step of performing feature engineering on the preprocessed data to obtain data features includes the following steps:
[0078] Step S31: construct and extract features on the preprocessed data to obtain intermediate features.
[0079] It should be noted that through feature construction and feature extraction, selecting relevant features and constructing new features from preprocessed data is conducive to improving the predictive ability of the evaluated time series data analysis model; feature extraction methods include calculating sliding window statistics, Fourier transform, wavelet transform, etc. In addition, the above feature extraction methods can capture the periodicity and trend of time series data.
[0080] Step S32: Obtain application scenarios of the time series data, and perform feature selection on intermediate features according to the application scenarios to determine data features.
[0081] In the above embodiment, in order to determine the data features, feature construction and feature extraction are performed on the preprocessed data to obtain intermediate features, and then the application scenario of the time series data is obtained, and feature selection is performed on the intermediate features according to the application scenario to determine the data features.
[0082] As a further implementation of the time series database testing method, the step of obtaining application scenarios of time series data and performing feature selection on intermediate data features according to the application scenarios to determine data features includes the following steps:
[0083] Step S41: Acquire the application scenario of the time series data, and determine the feature category of each intermediate feature according to the application scenario and the intermediate features.
[0084] Step S42: for each feature category, the feature category is used as a target category, and the association degree between the target category and each non-target category is calculated.
[0085] Specifically, for each feature category, the feature category is regarded as the target category, and other feature categories other than the feature category are regarded as non-target categories, and the correlation degree between the target category and each non-target category is calculated.
[0086] It should be noted that the correlation degree is used to indicate the degree of correlation between the target category and the non-target category. In this application, the correlation degree is represented by a numerical value.
[0087] Step S43: determining the weight corresponding to each feature category based on the application scenario, and calculating the evaluation value of each feature category according to the weight and the correlation degree.
[0088] Step S44: Select a feature category according to the size of the evaluation value, and use the intermediate feature corresponding to the selected feature category as the data feature.
[0089] In the above embodiment, in order to obtain data features, the application scenario of the time series data is first obtained, and the feature category of each intermediate feature is determined based on the application scenario and the intermediate features. For each feature category, the feature category is used as the target category, and the correlation between the target category and each non-target category is calculated. Then, the weight corresponding to each feature category is determined based on the application scenario, and the evaluation value of each feature category is calculated based on the weight and correlation. Then, the feature category is selected according to the size of the evaluation value, and the intermediate feature corresponding to the selected feature category is used as the data feature.
[0090] As a further implementation of the time series database testing method, the step of generating an evaluated time series data analysis model includes the following steps:
[0091] Step S51: Obtain sample data and divide the sample data into a training set, a validation set, and a test set.
[0092] Step S52: Obtain a pre-built time series data analysis model, and train the pre-built time series data analysis model according to the training set to obtain a trained time series data analysis model.
[0093] Step S53: Optimize the trained time series data analysis model according to the validation set to obtain an optimized time series data analysis model.
[0094] Step S54: Evaluate the optimized time series data analysis model according to the test set to obtain an evaluated time series data analysis model.
[0095] In the above embodiment, in order to obtain an evaluated time series data analysis model, sample data is first obtained and divided into a training set, a validation set and a test set. Then, a pre-built time series data analysis model is obtained, and the pre-built time series data analysis model is trained according to the training set to obtain a trained time series data analysis model. Then, the trained time series data analysis model is optimized according to the validation set to obtain an optimized time series data analysis model. Then, the optimized time series data analysis model is evaluated according to the test set to obtain an evaluated time series data analysis model.
[0096] As a further implementation of the time series database testing method, after executing at least one test case according to a preset test execution engine and predefined test case execution rules to obtain a test result, the method further includes the following steps:
[0097] Step S61: Analyze the test results to obtain test analysis data.
[0098] Step S62: Optimize the predefined test case creation rules and the predefined test execution rules according to the test analysis data.
[0099] It should be noted that the reference Figure 2 The feedback learning module analyzes the test results based on machine learning technology to discover problems in the testing process, and then continuously optimizes the test case generation strategy and test execution process, so that the test method of this application can adaptively improve the test quality and efficiency, while providing predictive insights into future version iterations. In addition, the feedback learning module can also adjust the priority and frequency of test cases according to the test results to ensure that the most important test cases are executed most frequently. For example, if false positives and missed negatives occur, it may be that the test case is too sensitive, resulting in an increase in false positives, or it may be that the test case is not sensitive enough and fails to detect the actual problem. At this time, the parameters of the test case can be adjusted according to the false positives and missed negatives, that is, the conditions and thresholds of the test case can be adjusted; if a performance bottleneck occurs, for example, in a high-load test, the performance of certain database operations (such as complex query operations) is degraded, then performance tuning is required, that is, optimization for specific database operations, such as optimizing indexes or adjusting query algorithms.
[0100] It's important to note that during the testing process, the Feedback Learning Module continuously collects test data and analyzes and identifies test results based on machine learning models, thereby adjusting the testing strategy. For example, if the Feedback Learning Module discovers that a test case frequently fails, it will adjust the generation parameters (i.e., creation parameters) for that test case or increase its execution priority, thereby improving testing efficiency and effectiveness while reducing manual intervention.
[0101] As you can see, the feedback learning module enables the testing framework to adjust itself based on test results, adapting to changing testing requirements. Furthermore, the feedback learning module provides predictive insights into future version iterations, identifying potential issues in advance, demonstrating its adaptability and predictive nature.
[0102] In the above implementation, in order to optimize the test case generation process and execution process and reduce manual intervention, the test results are first analyzed to obtain test analysis data, and then the pre-defined test case creation rules and pre-defined test execution rules are optimized based on the test analysis data.
[0103] As a further implementation of the time series database testing method, the step of optimizing the predefined test case creation rules and the predefined test execution rules according to the test analysis data includes the following steps: the predefined test case creation rules include test case creation parameters; the predefined test execution rules include execution priorities of each test case;
[0104] Step S71: For each test case, obtain the number of successful executions and the number of failed executions of the test case according to the test analysis data.
[0105] Step S72: Calculate the execution success rate of the test case based on the number of successful executions and the number of failed executions.
[0106] Step S73: determine whether the execution success rate is lower than a preset value. If so, adjust at least one of the creation parameters, execution priority, and execution frequency according to preset rules.
[0107] In the above embodiment, for each test case, the number of successful executions and the number of failed executions of the test case are obtained based on the test analysis data, and then the execution success rate of the test case is calculated based on the number of successful executions and the number of failed executions, and it is determined whether the execution success rate is lower than the preset value. If the execution success rate is lower than the preset value, at least one of the creation parameters, execution priority and execution frequency is adjusted according to the preset rules.
[0108] The embodiment of the present application also discloses a time series database testing system.
[0109] refer to Figure 3 , a time series database testing system, comprising:
[0110] A time series data pattern analysis module is used to obtain time series data from a target time series database and perform pattern analysis on the time series data to obtain time series analysis data, which is used to characterize the data characteristics of at least one item of time series data;
[0111] An iterative test case generation module, configured to create at least one test case based on the time series analysis data and predefined test case creation rules, wherein the test case has at least one data characteristic of the time series data;
[0112] The test execution engine module is used to execute at least one test case according to a pre-set test execution engine and pre-defined test case execution rules to obtain a test result.
[0113] The test device also includes a feedback learning module, which includes:
[0114] The test result analysis submodule is used to analyze the test results and obtain test analysis data;
[0115] The optimization submodule is used to optimize the predefined test case creation rules and predefined test execution rules based on the test analysis data.
[0116] The time series database testing system of the present invention can implement any of the time series database testing methods, and the specific working process of the time series database testing system of the present invention can refer to the corresponding process in the above-mentioned time series database testing method.
[0117] The embodiment of the present application also discloses a computer device.
[0118] refer to Figure 4 A computer device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, any one of the above-mentioned time series database testing methods is implemented.
[0119] The above are all preferred embodiments of the present application and are not intended to limit the scope of protection of this application. Unless otherwise stated, any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features. In other words, unless otherwise stated, each feature is merely an example of a series of equivalent or similar features.
Claims
1. A time series database testing method, characterized in that: include: Acquire time series data in a target time series database, and perform pattern analysis on the time series data to obtain time series analysis data, where the time series analysis data is used to characterize at least one data feature of the time series data; Creating at least one test case according to the time series analysis data and predefined test case creation rules, wherein the test case has at least one data feature of the time series data; Execute the at least one test case according to a preset test execution engine and predefined test case execution rules to obtain a test result; The step of performing pattern analysis on the time series data to obtain time series analysis data includes: Performing data preprocessing on the time series data to obtain preprocessed data; Performing feature engineering on the preprocessed data to obtain data features; Inputting the data features into the evaluated time series data analysis model to obtain time series analysis data; The step of performing feature engineering on the preprocessed data to obtain data features includes: Performing feature construction and feature extraction on the preprocessed data to obtain intermediate features; Obtaining an application scenario of the time series data, and performing feature selection on the intermediate features according to the application scenario to determine data features; The step of obtaining an application scenario of the time series data, and performing feature selection on the intermediate features according to the application scenario to determine data features includes: Acquire an application scenario of the time series data, and determine a feature category of each intermediate feature based on the application scenario and the intermediate features; For each feature category, the feature category is used as a target category, and the correlation degree between the target category and each non-target category is calculated; Determining the weight corresponding to each feature category based on the application scenario, and calculating the evaluation value of each feature category according to the weight and the association degree; The feature category is selected according to the size of the evaluation value, and the intermediate feature corresponding to the selected feature category is used as the data feature.
2. A time series database testing method according to claim 1, characterized in that: The step of generating the evaluated time series data analysis model comprises: Obtaining sample data, and dividing the sample data into a training set, a validation set, and a test set; Obtaining a pre-built time series data analysis model, and training the pre-built time series data analysis model according to the training set to obtain a trained time series data analysis model; Optimizing the trained time series data analysis model according to the validation set to obtain an optimized time series data analysis model; The optimized time series data analysis model is evaluated according to the test set to obtain an evaluated time series data analysis model.
3. A time series database testing method according to claim 1, characterized in that: After the step of executing the at least one test case according to the preset test execution engine and the predefined test case execution rules to obtain a test result, the method further includes: Analyzing the test results to obtain test analysis data; The predefined test case creation rules and the predefined test execution rules are optimized according to the test analysis data.
4. A time series database testing method according to claim 3, characterized in that: The step of optimizing the predefined test case creation rules and the predefined test execution rules according to the test analysis data includes: the predefined test case creation rules include creation parameters of the test case; the predefined test execution rules include execution priorities of each test case; For each test case, obtaining the number of successful executions and the number of failed executions of the test case according to the test analysis data; Calculating the execution success rate of the test case based on the number of successful executions and the number of failed executions; Determine whether the execution success rate is lower than a preset value, and if so, adjust at least one of the creation parameter, execution priority, and execution frequency according to a preset rule.
5. A time series database testing system, characterized in that: include: A time series data pattern analysis module is used to obtain time series data in a target time series database and perform pattern analysis on the time series data to obtain time series analysis data, wherein the time series analysis data is used to characterize at least one data feature of the time series data; an iterative test case generation module, configured to create at least one test case based on the time series analysis data and predefined test case creation rules, wherein the test case has at least one data characteristic of the time series data; The test execution engine module is used to execute the at least one test case according to a preset test execution engine and predefined test case execution rules to obtain a test result.
6. A time series database testing system according to claim 5, characterized in that: The testing device further includes a feedback learning module, which includes: A test result analysis submodule, used to analyze the test results to obtain test analysis data; The optimization submodule is used to optimize the predefined test case creation rules and the predefined test execution rules according to the test analysis data.
7. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the method according to any one of claims 1 to 4 when executing the computer program.
Citation Information
Patent Citations
Self-adaptive multi-scene database performance test method and system
CN118093445A