Database instance testing method and device, electronic equipment and storage medium

By extracting and analyzing the data related to the operation of database instances, the problem of providing personalized services in massive database instance data is solved, and the accuracy and user experience of database instance testing are improved.

CN119493806APending Publication Date: 2025-02-21ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311015827.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

Data mining in massive database instance data and providing personalized database instance services is difficult to implement.

Method used

By obtaining the operation-related data of the database instance, extracting data features, and analyzing these features, the characterization results of the database instance in at least one running test dimension are obtained.

Benefits of technology

It improves the accuracy of database instance testing and provides more comprehensive and accurate database instance testing results, helping users to use database instance resources more reasonably and efficiently, perform cost optimization, and avoid possible exceptions and risks in advance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493806A_ABST
    Figure CN119493806A_ABST
Patent Text Reader

Abstract

The invention provides a database instance testing method and device, electronic equipment and a storage medium. According to the embodiment of the invention, after operation related data of a database instance is obtained, data features of the operation related data are extracted, then the data features are analyzed, and a representation result of the database instance in at least one operation testing dimension is obtained. By adopting the scheme, the database instance can be subjected to feature disassembly through big data, and comprehensive analysis and evaluation suggestions of the database instance in at least one running test dimension are given in combination with specific requirements, so that the accuracy of database instance test is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a database instance testing method, device, electronic device and storage medium. Background Art

[0002] With the development of cloud computing, it has become a common practice to deploy database instance services in the cloud, and the refined operation of database instances will be a major trend in the future database operation and maintenance field. However, in the process of using database instances, different operation behaviors and request behaviors may lead to great differences in the use of database instances, and the amount of data generated by these operation behaviors and request behaviors is relatively large. How to conduct data mining in the massive amount of database instance data and provide targeted and personalized database instance services that are more in line with user usage habits is a topic worthy of in-depth research. Summary of the invention

[0003] The embodiments of the present application provide a database instance testing method, device, electronic device and storage medium to solve one or more of the above-mentioned technical problems.

[0004] In a first aspect, an embodiment of the present application provides a database instance testing method, including:

[0005] Get the operation-related data of the database instance;

[0006] extracting data features of the operation-related data;

[0007] The data features are analyzed to obtain characterization results of the database instance in at least one running test dimension.

[0008] In a second aspect, an embodiment of the present application provides a database instance testing device, including:

[0009] The operation data acquisition module is used to obtain operation-related data of the database instance;

[0010] A data feature extraction module, used to extract data features of the operation-related data;

[0011] The characterization result analysis module is used to analyze the data features to obtain the characterization result of the database instance in at least one running test dimension.

[0012] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the above methods when executing the computer program.

[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.

[0014] Compared with the related art, this application has the following advantages:

[0015] According to an embodiment of the present application, after obtaining the operation-related data of the database instance, the data features of the operation-related data are extracted, and then the data features are analyzed to obtain the characterization results of the database instance in at least one operation test dimension. The above scheme can be used to decompose the features of the database instance through big data, and give a comprehensive analysis and evaluation suggestion of the database instance in at least one operation test dimension in combination with specific applications, thereby improving the accuracy of the database instance test. The presentation method of the comprehensive analysis and evaluation suggestions can adopt the method of profiling the database instance, that is, a radar chart, so as to more intuitively understand the overall operation of the database instance.

[0016] In the above-mentioned process of testing the database instance, the pre-trained AI model can be called to extract the data features of the database instance. On the one hand, the data features of the database instance can be extracted in multiple dimensions through AI big data. On the other hand, the performance of the database instance in multiple running test dimensions can be analyzed based on the extracted data features, making the test results of the database instance more comprehensive and accurate.

[0017] Furthermore, in the embodiment of the present application, the data features of the database instance may include the time series features of the data sequence composed of the operation-related data in the time dimension in the time sequence, and / or the database query behavior features characterized by the database query statement (SQL, Structured Query Language). Among them, when extracting the periodic features in the time series features of the data sequence composed of the operation-related data in the time dimension in the time sequence, a load data periodic feature detection method of high-precision univariate time series periodicity detection can be adopted, that is, the maximum overlap discrete wavelet transform is introduced to divide the operation-related data of the database instance into multiple data sequences with overlapping segments and sorted in time, and the divided data sequences are periodically decomposed, and at least one target period is determined from the multiple decomposed periodic data segments according to the wavelet variance. In this way, the maximum overlap discrete wavelet transform and component sorting means are used in frequency domain processing to preferentially output the most significant periodic components, which can improve the accuracy of periodicity detection.

[0018] In addition, when extracting the database query behavior features represented by the database query statements, a database query behavior analysis method based on the detailed data, attribute features, and vectorized features of the database query statements can be used to determine the query quality and operational risk of the database query statements corresponding to the database instance according to the extracted data features, determine the user request behavior pattern according to multiple database query statements corresponding to the same user, determine the source of the problem that affects the characterization result of the database instance in at least one test dimension according to the determined user request behavior pattern, and generate an operation optimization strategy for the database instance according to the source of the problem. In this way, the abnormal phenomenon of the database instance and the request behavior of the user database query statement can be associated and analyzed, and the request behavior features of the user database query statement can be mined to provide suggestions for optimizing the request behavior, which can improve the interpretability of the database query statement.

[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to the present application and should not be regarded as limiting the scope of the present application.

[0021] Figure 1 A test flow diagram of a database instance test solution provided in an embodiment of the present application is shown;

[0022] Figure 2 A system flow diagram of a database instance testing solution provided in an embodiment of the present application is shown;

[0023] Figure 3 A flowchart of a database instance testing method provided in an embodiment of the present application is shown;

[0024] Figure 4 A schematic diagram of an algorithm flow for extracting periodic features of a data sequence composed of operation-related data in chronological order in a database instance test solution provided in an embodiment of the present application is shown;

[0025] Figure 5 A schematic diagram of an algorithm flow for extracting database query behavior features represented by database query statements in a database instance test solution provided in an embodiment of the present application is shown;

[0026] Figure 6 A structural block diagram of a database instance testing device provided in an embodiment of the present application is shown; and

[0027] Figure 7 A block diagram of an electronic device used to implement an embodiment of the present application is shown. DETAILED DESCRIPTION

[0028] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the concept or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary in nature and not restrictive.

[0029] To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.

[0030] With the continuous development of proactive operation and maintenance, many cloud database instance service providers are constantly exploring the topic of intelligent operation and maintenance of database instances by actively mining potential user needs from user behaviors through AI big data, forming differentiated services, and improving user experience. In the actual production process, the workload environment of database instances is very complex, and the status of users using database instances is dynamically changing. For example, the peak time for different users to use database instances may be different. For example, the peak time for some users is on weekdays, while the peak time for other users is on weekends. The operation and request behaviors of these databases will generate massive amounts of data. It is difficult to mine data in the massive amount of database instance data, form a comprehensive intelligent test result for the database instance through database query language, load data, etc., and provide targeted and personalized database instance services that are more in line with user habits.

[0031] In some cases, some cloud services can perform static statistics on the load and request behavior of database instances in the scenario of database instance migration, thereby outputting the test results of the database instance to form a portrait. However, this method of testing database instances has limitations. It can only be tested in the scenario of database migration and cannot comprehensively detect the operating data of the database instance. Moreover, the technical means relied on only through static statistics are not intelligent enough, and the test results are not comprehensive and accurate enough.

[0032] In view of this, an embodiment of the present application provides a database instance testing solution, which can help users intuitively understand the overall picture of the database instance, quickly confirm whether there are anomalies and defects in the database instance, and guide users to use the resources of the database instance more reasonably and efficiently, perform cost optimization, etc. according to the characterization results of the database instance in at least one running test dimension, that is, the portrait characteristics of the database instance; it can also help users avoid possible anomalies and risks in advance according to the generated database instance operation optimization strategy. These optimization strategies may include but are not limited to elastic scaling configuration optimization suggestions, database query statement optimization diagnosis suggestions, database query statement security audit risk suggestions, etc.; it can also obtain comprehensive database instance test results to more accurately recommend to users the applicable engines & specifications, core parameter configurations, related services, etc. of the required database instances, thereby improving the user experience of using database instances and the conversion rate of corresponding service products.

[0033] Figure 1 It is a test flow diagram of a database instance test scheme for implementing the method of the embodiment of the present application. The test scheme of the database instance provided in the embodiment of the present application can obtain the operation-related data of the database instance, such as the load status data of the resources on which the database instance depends on for operation (obtaining resource usage data and obtaining historical cache data) and the database query statement for accessing the database instance (obtaining instance SQL data), and then can perform time series feature detection and SQL behavior analysis on the operation-related data, extract data features of the operation-related data, and analyze the characterization results of the database instance in at least one operation test dimension based on the extracted data features.

[0034] like Figure 1 As shown, when a test request (portrait request) of a database instance is triggered (started), the operation-related data of the database instance can be obtained from the data cache pool storing the operation-related data of the database instance. These operation-related data can be the load status data of the resources that the database instance depends on for operation in a certain time period, such as resource usage data such as CPU usage, disk usage, and number of active sessions, historical cache data such as historical load and historical failures (historical behavior data), and database query statements used to access the database instance, such as SQL details, SQL aggregation templates, and other database instance SQL data.

[0035] Before extracting features from the operation-related data, the acquired operation-related data of the database instance may be preprocessed, such as missing value processing, data aggregation, data smoothing, etc. Among them, missing value processing can identify and supplement the missing values ​​of the operation-related data of the database instance corresponding to at least one time unit. For example, the conditional mean completer method can be used to complete the missing points in the operation-related data, thereby reducing the impact of missing values ​​on the algorithm; data aggregation can aggregate the operation-related data of the database instance corresponding to different device nodes, and divide the operation-related data according to the set time window. For example, for database engine instances with multiple shard nodes such as Redis database (Remote Dictionary Server) and PolarDB database (relational cloud native database), the data can be aggregated according to the id dimension of the database instance, and then the data granularity can be integrated according to a certain size of sliding window (for example, 1 hour) to reduce the subsequent calculation amount; data smoothing can obtain noise-removed operation-related data from the operation-related data of the database instance through the first filtering process, such as weighted filtering of the data in the window through the SG filtering method (Savitzky Golay Filter) to reduce the impact of glitches and noise on the algorithm.

[0036] Secondly, extract the data features of the operation-related data. The step of extracting the data features of the operation-related data can be implemented by calling at least one pre-trained feature extraction algorithm model, which can be input into the analysis module (portrait analyzer) of the database instance after the aforementioned data preprocessing, and the portrait analyzer uses the corresponding algorithm in its algorithm model base to extract the data features of the operation-related data. For example, the operation-related data can be subjected to time series feature detection to extract the time series features of the data sequence composed of the operation-related data in time order in the time dimension; the operation-related data can also be subjected to SQL behavior analysis to extract the database query behavior features represented by the database query statements of the operation-related data. Among them, the time series features of the operation-related data extracted by time series feature detection may include time series features such as periodicity, trend, stability, spikes and change points of the data; the database query behavior features extracted by SQL behavior analysis may include database query behavior features such as SQL injection, slow log, high-risk SQL, and access source.

[0037] Thirdly, the data features can be analyzed to obtain the characterization results of the database instance in at least one running test dimension. The data features of the database instance operation-related data obtained by the aforementioned time series feature detection and SQL behavior analysis can be further evaluated for instance portraits, and the data features can be mapped to the corresponding running test dimensions to analyze the characterization results of the database instance in at least one running test dimension. For example, based on pre-set rule templates with expert experience, these data features can be further analyzed and predicted, and instance activity analysis, load prediction, elastic configuration diagnosis, slow SQL diagnosis, SQL risk diagnosis, etc. can be performed.

[0038] Finally, an operation optimization strategy for the database instance can be generated based on the characterization results of the database instance in at least one test dimension. The operation optimization strategy may include at least one of enabling resource elasticity management function, database query current limiting, optimizing elastic resource management scheme, and optimizing database query statements. The operation optimization strategy can then be displayed on the user interface for the user to view (the portrait evaluation results are sent down). This completes the test of the above database instance (end).

[0039] Accordingly, Figure 2 A system flow diagram of a database instance testing solution provided in an embodiment of the present application is shown. Figure 2 As shown, the above process of extracting data features of operation-related data and obtaining the characterization results of the database instance in at least one operation test dimension can be performed in Figure 2 After the profile analyzer obtains the operation-related data of the database instance (such as resource usage data, SQL data, and historical behavior data), the algorithm model base in the profile analyzer can be used to extract data features of the operation-related data, such as time series feature detection and SQL behavior analysis (SQL behavior diagnosis) of the operation-related data. The algorithms in the algorithm model base can include prediction, cycle detection, classification, anomaly detection, and other algorithms.

[0040] After extracting data features, the extracted data features can be further analyzed using a portrait analyzer to obtain characterization results of the database instance in at least one running test dimension. For example, instance activity analysis, load prediction, elastic configuration diagnosis (elastic configuration optimization), and other analyses can be performed. Furthermore, an operation optimization strategy for the database instance can be generated based on the characterization results of the database instance in at least one test dimension, and the analysis results can be mapped to at least one pre-set running test dimension to form an instance portrait and evaluation suggestions, etc., for user viewing. For example, the instance profile feature analysis can be performed in six dimensions, which can be: resources (mainly measuring the current and historical usage of the database's disk, memory and space resources), sessions (mainly measuring the current and historical active sessions and abnormal sessions of the database); access (mainly measuring whether the database has access risks from unknown source machines or new ones), requests (mainly measuring the slow SQL request profile of the database), risks (mainly measuring whether the database has high-risk SQL operations, SQL injection and other risks), load (mainly measuring the current and historical load water level of the database, the database operation performance profile), and scoring these dimensions (the score range can be 0-100 points), and can be presented to users in the form of a visual radar chart. Optimization suggestions for corresponding dimensions can also be given (evaluation and recommendation transmission). For example, the optimization suggestions for load evaluation can be load stability evaluation of database instances, recommendation of appropriate elastic configuration and instance specifications, etc.; the optimization suggestions for risk evaluation can be early discovery of instances with risks and suggestions for early operation and maintenance actions, etc.; the optimization suggestions for resource evaluation can be recommendation of specification expansion and sales ratio based on instance resource status and future usage trends.

[0041] The execution subject of the embodiment of the present application can be an application, service, instance, software-based functional module, virtual machine (VM), container or cloud server, etc., or a hardware device (such as a server or terminal device) or hardware chip with data processing function, such as a central processing unit (CPU), a graphics processing unit (GPU), a field programmable gate array (FPGA), a neural network processor (NPU), an intelligent acceleration card (AI acceleration card) or a data processor (DPU). The device for implementing the database instance test can be deployed on the computing device of the application party that provides the corresponding service or on a cloud computing platform that provides computing power, storage and network resources. The mode of providing services to the outside world by the cloud computing platform can be IaaS (Infrastructure as a Service), PaaS (Platform as a Service), SaaS (Software as a Service) or DaaS (Data as a Service). Taking the platform providing SaaS software as a service (Software as a Service) as an example, the cloud computing platform can use its own computing resources to provide database instance test model training or database instance test module function execution, and the specific application architecture can be built according to service requirements. For example, the platform can provide application parties or individuals who use platform resources with a construction service based on the above model, and further call the above model based on the database instance test request submitted by the relevant client or server and other devices and implement the online or offline database instance test function.

[0042] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0043] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The several specific embodiments listed can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0044] The present application embodiment provides a database instance testing method, such as Figure 3 The flowchart of a database instance testing method 300 according to an embodiment of the present application is shown. The method 300 may include:

[0045] In step S301, operation-related data of the database instance is obtained.

[0046] In a possible implementation, the operation-related data of the database instance may be load status data of resources on which the operation of the database instance depends and a database query statement used to access the database instance.

[0047] Among them, the database query statement used to access the database instance is also SQL data, which can include SQL details, SQL aggregation templates, etc., and the database query behavior characteristics represented by the database query statement can be extracted to generate an operation optimization strategy based on the characteristics. The load status data of the resources on which the database instance operation depends can be the resource usage data of the database instance. For example, the CPU usage rate, disk usage rate, number of active sessions, etc., the data granularity of the collected resource usage data can be the granularity of the minute level; the load status data of the resources on which the database instance operation depends can also be the historical behavior data (historical load data) of the database instance, such as the CPU usage rate, disk rate, number of active sessions, and historical 7-day data of the past 7 days or 10 days. The data granularity of the collected historical behavior data can be the granularity of the hour level. The time series characteristics (such as periodicity, trend, etc.) of the data series composed of the CPU usage rate and disk usage in time order in the time dimension can be extracted, or the periodicity of the data series composed of the number of active sessions in time order in the time dimension can be extracted. The load status data of the resources on which the database instance depends can also be some historical fault data, such as historical abnormal events and fault data in the host error log. The fault value can be counted, such as how many times it occurred. On this basis, the weight of the characterization result of the corresponding running test dimension in the final database instance test result (the weight of the portrait evaluation score) is updated. The more times the fault occurs, the lower the score is, so as to remind users to pay attention to the faults in this dimension.

[0048] In some embodiments, the above-mentioned data features may include the time series features in the time dimension of the data sequence composed of the operation-related data in chronological order, and / or the database query behavior features represented by the database query statement. The step of extracting the data features of the operation-related data can be achieved by calling at least one pre-trained feature extraction algorithm model.

[0049] Exemplarily, the time series characteristics of the data sequence composed of operation-related data in chronological order in the time dimension may include the periodicity, trend, stationary, spike, changepoint, etc. of the operation-related data, and the time series characteristics of the load status data of the resources that the database instance operation depends on in a certain time period corresponding to the database instance. The database query behavior characteristics represented by the database query statement may include the newly added abnormal access sources, the number of high-risk SQLs, the number of SQL injections, slow logs, etc., and the database query behavior characteristics represented by the database query statement used to access the database instance that the database instance operation depends on in a certain time period corresponding to the database instance.

[0050] The step of extracting data features of operation-related data can be implemented by calling at least one pre-trained feature extraction algorithm model. That is, the extraction of the above-mentioned data features such as periodicity, trend, number of SQL injections, etc. needs to be implemented using different feature extraction algorithm models. When extracting corresponding features, the algorithm model of the corresponding features can be called for feature extraction.

[0051] Optionally, different algorithm models can also select required operation-related data from the operation-related data. For example, the algorithm model for extracting periodic features can select the load status data or historical behavior data of the resources that the database instance operation depends on, such as CPU usage, disk usage, etc., according to the indicator name of the operation-related data; the algorithm model for extracting periodic features can select the database query statement for accessing the database instance that the database instance operation depends on, such as SQL details, SQL aggregation templates, etc., according to the indicator name of the operation-related data.

[0052] In one possible implementation, after obtaining the operation-related data of the database instance, the operation-related data may also be preprocessed. The data preprocessing may include at least one of the following steps: identifying and supplementing missing values ​​of the operation-related data of the database instance (which may be missing values ​​corresponding to at least one time unit); aggregating the operation-related data of the database instance corresponding to different device nodes; dividing the operation-related data according to a set time window; and removing noise from the operation-related data through a first filtering process.

[0053] Among them, identifying and supplementing the missing values ​​of the operation-related data of the database instance can reduce the interference of noise when extracting the features of the operation-related data. For example, the conditional mean completion method (Conditional Mean Completer) can be used to complete the values ​​on the missing points and reduce the impact of missing values ​​on the algorithm, such as when a single point is missing in the process of obtaining operation-related data; the linear difference method can also be used to fill the missing values ​​to deal with the scenario of large-scale data missing, such as the scenario where the empty points exceeding the minute-level granularity appear in the process of obtaining operation-related data due to the master-slave switch of the database.

[0054] The data aggregation of operation-related data of database instances corresponding to different device nodes involved in the embodiments of the present application can be for database engine instances with multiple shard nodes such as Redis and PolarDB, and the operation-related data is aggregated according to the dimension of instance ID to integrate the data in the nodes of different database instances (such as primary and standby nodes) to prevent inaccurate data feature extraction due to differences in data from different nodes.

[0055] The operation-related data involved is segmented according to the set time window. This can be for database engine instances with multiple shard nodes such as Redis and PolarDB. After data aggregation, the data granularity is integrated according to a certain size sliding window (such as 1h) to reduce the subsequent calculation amount. Since the total amount of operation-related data of the database instance may be relatively large, the general sampling method is to sample at the granularity of the minute level. Therefore, for data with a large amount of data, the data can be segmented according to the set time window to reduce the calculation amount when the subsequent algorithm extracts data features.

[0056] The first filtering process involves removing noise from the operation-related data through a first filtering process. The first filtering process may use the SG (Savitzky Golay Filter) filtering method to perform weighted filtering on the data within a set time window to reduce the impact of glitches and noise on the algorithm. For example, when extracting the timing features of the operation-related data, if the operation-related data itself has many glitches, or in the process of sampling the operation-related data, the time granularity of the operation-related data is different, some are 60 seconds, and some are 59 seconds, which will affect the accuracy of data feature extraction. Therefore, these glitches need to be filtered out in advance to make the data accuracy better during feature extraction.

[0057] In some embodiments, when the data features include the timing features of a data sequence in the time dimension composed of operation-related data in chronological order, after obtaining the operation-related data of the database instance, in addition to the above-mentioned data preprocessing steps, the operation-related data of the database instance can also be subjected to a second filtering process to remove non-periodic operation-related data.

[0058] Among them, the second filtering process can use the HP (Hodrick–Prescott trend filtering) filtering method to extract and remove trend items in the time series to reduce the impact that non-periodic data features may have on the algorithm. For example, the data within the set time window may itself have many fluctuations, and these fluctuations will form the trend of the data in the window. These trends can be the slope of this section of time series data in the window. The HP filtering method can be used to extract these trends (slopes) and reduce the weight of the non-periodic features of the time series data in the window.

[0059] In step S302, data features of operation-related data are extracted.

[0060] In one possible implementation, when the data features include the timing features in the time dimension of a data sequence composed of operation-related data in chronological order, the method for extracting the data features of the operation-related data can be to first divide the operation-related data into at least one target periodic data segment with periodic characteristics, and then generate the period length corresponding to each target periodic data segment in the at least one target periodic data segment; based on the period length of each target periodic data segment in the at least one target periodic data segment, determine the timing features corresponding to the operation-related data.

[0061] The time series characteristics of a data series in the time dimension can include the periodicity of the time series. Periodicity generally refers to a repetitive pattern in a time series. Since the periodicity that appears in different practical applications is diverse and complex, it is not easy to extract accurate periodic features from a time series. For example, a time series of traffic congestion usually shows daily and weekly periodicity, but when long weekends such as holidays come, the weekly periodic pattern may change, and different period lengths may exist in the same time series.

[0062] Therefore, the operation-related data can be first divided into at least one target periodic data segment with periodic characteristics, that is, different periodic characteristics are isolated, and then the period length corresponding to each target periodic data segment in at least one target periodic data segment is generated, and the timing characteristics corresponding to the operation-related data are determined based on the period length of each target periodic data segment in at least one target periodic data segment, that is, the corresponding period length is generated from these different periodic characteristics, and a period length with the highest confidence is selected as the periodic feature corresponding to the operation-related data.

[0063] Optionally, the periodic characteristics of the data sequence may be extracted by directly calculating the period of the data sequence using methods such as Fast Fourier Transform (FFT) or Discrete Fourier Transform (DFT), and the present application does not impose any restrictions on this.

[0064] In some embodiments, the operation-related data can be divided into at least one target periodic data segment with periodic characteristics by first performing a maximum overlap discrete wavelet transform on the operation-related data to obtain a frequency domain graph corresponding to the operation-related data, dividing the operation-related data into multiple data sequences with overlapping segments and sorted in time according to the frequency domain graph, and then performing periodic decomposition on the divided data sequences to divide the operation-related data into multiple periodic data segments, and finally determining at least one target periodic segment from the multiple periodic data segments according to the wavelet variance corresponding to the periodic data segments.

[0065] Among them, the maximum overlap discrete wavelet transform (MODWT) is a multi-scale time series analysis method that can decompose signals or time series data into wavelet subbands of different frequencies and scales. The operation-related data can be divided into multiple data sequences with overlapping segments and sorted in time according to the frequency domain diagram, and then the divided data sequences are periodically decomposed to divide the operation-related data into multiple periodic data segments. For example, the data sequence of the operation-related data in time order can be decoupled into multiple levels of wavelet subbands in the frequency domain diagram, and then the single periodicity of each wavelet subband is extracted. Each wavelet subband can have 50% overlap with the adjacent wavelet subband, so that each time series data sample can be used by two adjacent wavelet subbands at the same time, and the adjacent wavelet subbands can share the information of 50% overlapping time series data samples, thereby making the frequency range of each wavelet subband more continuous. This overlap helps to linearly enhance the frequency resolution and time resolution, and can also better separate different levels of periodicity (such as weekly cycle and daily cycle).

[0066] Furthermore, at least one target periodic segment can be determined from multiple periodic data segments according to the wavelet variance corresponding to the periodic data segment. For example, based on the different levels of periods decomposed from multiple wavelet sub-bands and their corresponding wavelet variances, the wavelet variance corresponding to each wavelet sub-band is calculated, and the periodic data segments corresponding to these wavelet sub-bands are sorted based on the wavelet variance.

[0067] Correspondingly, the method for generating the period length corresponding to each target period data segment in at least one target period data segment can be to generate a candidate period length of the target period segment for each target period data segment in the aforementioned at least one target period data segment using a periodogram algorithm, and then use the autocorrelation function of the candidate period length to verify and optimize the candidate period length to obtain the target period length corresponding to the target period segment.

[0068] In an embodiment of the present application, after the operation-related data is divided into at least one target periodic data segment with periodic characteristics by the aforementioned discrete wavelet transform method (that is, after the decomposition of multiple periods is completed), the candidate period length of the target period segment can be generated by the periodogram algorithm, and then the candidate period length is verified and optimized by the autocorrelation function to obtain the target period length corresponding to the target period segment. Among them, the periodogram algorithm can adopt a method based on Huber-Periodogram (Huber periodogram), that is, the periodogram of the Huber loss function is superimposed, so that the interference of outliers on the overall decline of the loss function during the fitting process can be better avoided, and a more accurate estimate can be made. Fisher's Test (Fisher's exact test) based on Huber-Periodogram can be used to generate the candidate period length of the target period segment at each level, and then the autocorrelation function (ACF) is used to verify and optimize these candidate period lengths, and finally the target period length corresponding to the target period segment is obtained.

[0069] Figure 4 The following is a schematic diagram of an algorithm flow for extracting the periodic characteristics of a data sequence composed of operation-related data in chronological order in a database instance test solution provided in an embodiment of the present application. Figure 4As shown in the figure, when extracting the periodic characteristics of the data sequence in the time dimension composed of the operation-related data in chronological order, the trend items in the time series data can be extracted and removed by using a trend filter (Tread Filter, such as HP filtering method) in the preprocessing process (Pre-Processing) of the periodic algorithm framework (Framework of the proposed RobustPeriod algorithm), and then the discrete wavelet transform (MODWT) and ranking (Ranking by Robust WV) are used to decouple multiple periods (Decoupling MultiplePeriodicities) of these data, and then the periodogram (Huber Periodogram) is used to generate the candidate period length of the target period segment, and the autocorrelation function (Huber ACF) is used to verify and optimize the candidate period length, so as to perform single period detection (Robust Single Periodicity Detection) on the decoupled data, and finally the target period length corresponding to the target period segment is obtained.

[0070] In a possible implementation, when the data features of the operation-related data include the time series features of the data sequence formed by the operation-related data in time order in the time dimension, the time series features may include one or more of data periodicity, data trend, data stationarity, data spike points and data change points. At this time, the method of extracting the data features of the operation-related data may call at least one of an autoregressive moving average model, an autocorrelation function, a partial autocorrelation function, a data spike point detection algorithm based on the mean and standard deviation, and a Bayesian mutation point algorithm to extract the time series features of the operation-related data.

[0071] For example, when extracting trend features of data, the autoregressive moving average model (ARMA) algorithm can be called to construct an autoregressive equation and a moving average equation. The trend features of the data can be extracted by splitting the time series into two parts, autoregressive and moving average, and combining the two.

[0072] When extracting the stationary features of data, the autocorrelation function (ACF) and partial autocorrelation function (PACF) can be called. If the time series is stationary, the ACF and PACF images will quickly approach 0 after a certain point. Therefore, the stationarity of the time series can be extracted by observing the images of the autocorrelation function and the partial autocorrelation function.

[0073] When extracting data spike point features, you can call the data spike point detection algorithm based on the mean and standard deviation. By calculating the mean and standard deviation of the time series, and then adding or subtracting several standard deviations from the mean, you can get a threshold range. When the deviation of a data point in the time series exceeds the threshold range, it can be regarded as a spike point, and then the data spike point features can be extracted.

[0074] When extracting data change point features, the Bayesian Change Point Detection algorithm can be called to divide the time series into several paragraphs, and then use the Bayesian model to calculate the boundary probability of each paragraph. The Bayesian model can perform probabilistic modeling on different paragraphs and can adaptively select segmentation points based on actual conditions. Therefore, change points can be found in this way to extract data change point features.

[0075] In step S303, the data features are analyzed to obtain a characterization result of the database instance in at least one running test dimension.

[0076] The operation test dimensions involved in the embodiments of the present application can be based on the operation test dimensions that need to be pre-set. This division of the operation test dimensions can provide users with more intuitive and specific test results. For example, six dimensions of operation test dimensions can be set, and these six dimensions can be: resources (mainly measuring the current & historical usage of the database's disk, memory and space resources), sessions (mainly measuring the current and historical active sessions of the database, abnormal session profiles); access (mainly measuring whether the database has unknown source machines or new access risks), requests (mainly measuring the slow SQL request profile of the database), risks (mainly measuring whether the database has high-risk SQL operations, SQL injections and other risks), loads (mainly measuring the current & historical load water levels of the database, and the database operation performance profile), and these dimensions are scored separately (the score range can be 0-100 points) and presented to the user in the form of a visual radar chart. In addition, optimization suggestions for the corresponding dimensions can also be given.

[0077] Among them, after feature extraction of the load status data of the resources on which the operation of the acquired database instance depends, at least the characterization results of the three operation test dimensions of resources, sessions, and loads can be analyzed; after feature extraction of the database query statements used to access the database instance on which the operation of the acquired database instance depends, at least the characterization results of the three operation test dimensions of requests, risks, and accesses can be analyzed. Optionally, the characterization results of the six operation test dimensions of resources, sessions, loads, requests, risks, and accesses can also be analyzed by summing up the extraction results after feature extraction of the load status data and database query statements, and this application does not impose any restrictions on this.

[0078] Analyzing the characterization results of the database instance in at least one running test dimension according to the extracted data features may be performed after further analyzing the aforementioned extracted data features, and then analyzing the characterization results of the database instance in at least one running test dimension. For example, the load start and stop points and running peak windows of the database instance may be analyzed based on the time series features of the data sequence in the time dimension formed by the extracted running-related data in chronological order, and the database query behavior features represented by the extracted database query statements. Through historical time series data, a time series prediction curve or cycle for a period of time in the future (for example, 24 hours) may be obtained, and then the data (statistics) calculated by statistics such as the mean, standard deviation, and correlation coefficient of the historical time series data may be combined with the time series prediction curve or cycle (predicted value) to comprehensively judge the start and stop time points of the corresponding database instance in a period of time in the future (for example, 24 hours). For the judgment of the load start and stop points, it can be that when the predicted value continues to exceed the 15% percentile of the statistic, it is considered that the database instance has a high probability of being started, and when the predicted value continues to be lower than the 15% percentile of the statistic, it is considered that the database instance has a high probability of being stopped; for the judgment of the operation peak window, it can be that when the predicted value continues to exceed the 90% percentile of the statistic, it is considered that the database instance has a high probability of entering the operation peak. Therefore, based on the load start and stop points and / or operation peak windows of the analyzed database instance, the characterization results of the database instance in at least one operation test dimension can be analyzed.

[0079] In a possible implementation, analyzing data features to obtain characterization results of a database instance in at least one test dimension may include at least one of the following steps: determining historical abnormal operation events of the database instance based on the extracted data features; predicting load status data of resources that the database instance depends on in a future time period based on the extracted data features; and determining query quality and operational risk of a database query statement corresponding to the database instance based on the extracted data features.

[0080] For example, based on the extracted data features, historical abnormal operation events of the database instance can be determined, such as historical abnormal operation events such as slow SQL of the database instance and high load level of the database instance shown by the data features; the load status data of the resources that the database instance depends on in the future time period can also be predicted based on the extracted data features, such as predicting that the load may reach a certain peak value in a certain period of time in the future based on the periodicity of the load shown by the data features, and the load distribution status of the instance activity in a certain period of time in the future; the query quality and operational risks of the database query statements corresponding to the database instance can also be determined based on the extracted data features, such as the existence of high-risk SQL operations, SQL injection risks, unknown source machines or new access risks, etc.

[0081] In some embodiments, an operation optimization strategy for the database instance can also be generated based on the characterization results of the database instance in at least one test dimension. The operation optimization strategy can include at least one of a resource elasticity management function activation strategy, a database query flow limiting strategy, an elastic resource management solution optimization strategy, and a database query statement optimization strategy.

[0082] For example, in the resource testing dimension, the future load of the database instance can be predicted by analyzing the current or historical disk, memory, and space resource usage data of the database instance, and the corresponding operation optimization strategy can be generated. For example, if the load will reach a certain peak in the next 24 hours, it is recommended to enable the elastic scaling function to smoothly pass the application peak period.

[0083] In the session test dimension, you can generate corresponding operation optimization strategies by analyzing the relevant operation data of the current or historical active sessions and abnormal sessions of the database instance. For example, if the instance activity distribution is generally high, you can recommend enabling autonomous functions such as automatic SQL flow control.

[0084] In the load testing dimension, the corresponding operation optimization strategy can be generated by analyzing the current or historical database load characteristics, water level, database operation performance and other data. For example, if the load water level of the instance is high and the load is periodic, it can be recommended to enable the scheduled automatic elastic scaling autonomous function to ensure the smooth operation of the database instance; for example, if the user has configured the elastic scaling function of the database instance, it can be verified whether the elastic configuration is the preferred solution, and if not, configuration optimization suggestions can be given.

[0085] In the request test dimension, you can generate corresponding operation optimization strategies by analyzing the SQL requests of the database instance, SQL aggregation templates and other data. For example, if there is a slow SQL in the database instance, it is recommended that users perform slow SQL diagnosis, and SQL optimization suggestions such as index optimization can be given for the existing slow SQL, and the benefit calculation results can be given.

[0086] In the risk testing dimension, you can conduct a security audit of the database instance SQL to determine whether the database instance has risks such as high-risk SQL operations and SQL injection. If so, you can generate corresponding operation optimization strategies, such as risk warnings and recommended optimized configurations.

[0087] In the access test dimension, you can analyze the SQL access sources of the database instance to determine whether the database instance has unknown source machines or new access risks. If so, you can generate corresponding operation optimization strategies, such as risk warnings and recommendations for adding firewalls.

[0088] Exemplarily, a method for generating an operation optimization strategy for a database instance based on the characterization results of the database instance in at least one test dimension can be to first determine the user request behavior pattern based on multiple database query statements corresponding to the same user, then determine the source of the problem affecting the characterization result based on the user request behavior pattern, and generate an operation optimization strategy for the database instance based on the source of the problem.

[0089] For example, you can first use the corresponding database SQL request behavior analysis algorithm based on multiple database query statements corresponding to the same user to analyze the SQL request, SQL aggregation template and other data of the database instance, such as whether there are new abnormal access sources, the number of high-risk SQLs, the number of SQL injections, slow logs and other data features, to determine the behavior pattern of user requests. You can establish a link between database instance abnormalities and user request behavior patterns through an algorithm model built based on a variety of detailed data and attributes, and then determine the source of the problem that affects the characterization results based on the determined user request behavior pattern, and generate an operation optimization strategy for the database instance based on the source of the problem, that is, you can find and analyze the causes of database instance performance problems, and assist in optimizing the performance of the database instance system.

[0090] In the specific database SQL request behavior analysis algorithm, the SQL text can be vectorized (SQL text embedding), and the features of the vectorized SQL text can be extracted. The SQL request data can be classified and aggregated and then mined to obtain a Pattern (a class used to create a regular expression, that is, to create a matching pattern), which can supplement the analysis of the relevance features of the SQL context. For example, by associating the vectorized attributes of various SQL detail data such as SQL text with the vectorized features of the user request behavior pattern, and inputting these associated data into the corresponding algorithm model, the algorithm model is trained to fully learn these data information, and the SQL attributes and user request behavior are classified based on these associations (the classifier is trained to fully learn the data information), the SQL pattern can be fully mined, the accuracy of the algorithm in identifying the association between SQL data and the user request behavior pattern can be improved, and a more explanatory pattern can be obtained.

[0091] Optionally, when training the classifier in the database SQL request behavior analysis algorithm, the SQL template identifier of the SQL request can be used to represent the database request sequence. Assuming that the target database request sequence = abababadac, the determined request behavior pattern contains a database request sequence = ba. It can be seen that "ba" is contained in "abababadac", indicating that after the user uses the SQL template identified as b to initiate a database request, he will then use the SQL template identified as a to initiate a database request. It should be noted that the SQL template is a general format of a certain operation type SQL statement. Usually, multiple SQL templates are provided for each operation type, and a specific SQL statement can be formed by directly entering the corresponding parameter values ​​in the SQL template. When performing request behavior pattern recognition, the request behavior pattern of the target user can be determined by determining the correlation probability between the database requests in the target database request sequence, and then based on the correlation probability and the target database request sequence. Among them, the correlation probability between database requests is the probability of the occurrence of database request association, which can be the state transition probability of the Markov model. Since the database requests initiated by the user have a certain correlation relationship, the use of the correlation probability between database requests can more accurately identify the request behavior pattern of the target database request sequence.

[0092] Figure 5 The following is a schematic diagram of an algorithm flow for extracting database query behavior features represented by database query statements in a database instance test solution provided in an embodiment of the present application. Figure 5As shown, in the data collection stage, the full amount of SQL request data can be obtained from the audit log of the database instance, which may include tid (thread control identifier) ​​information. Then, merge (merge sort algorithm) can be used to group the obtained SQL data and obtain the grouped SQL request details, which may include SQL request details of multiple attributes (such as attribute 1, attribute n, SQL text), further extract the vectorized features (Bert Embedding) of the SQL text, use Label (a label that defines a variable or label type) to mark these vectorized SQL data, and then input these marked SQL data into the classifier, and predict (predict) based on the training set (train) in the classifier. If the classification prediction result shows that the input SQL detail data belongs to Label 1, the SQL ID sequence can be further obtained, and the SQL data belonging to Label 1 can be input into the pattern mining (class pattern selection module) for pattern selection and pattern mining, and then the pattern sequence can be obtained. In addition, in the data collection stage, the user's SQL request data can also be obtained through the app log, and the accuracy can be verified before analysis. The aforementioned pattern sequence and the user's SQL request data are simultaneously subjected to correlation analysis, for example, analyzing whether the aforementioned pattern sequence and the user's SQL request data are correlated (select ... from A, select ... from B, Update A). Finally, optimization suggestions may be generated based on the results of the aforementioned correlation analysis.

[0093] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a database instance testing device. Figure 6 The structure block diagram of a database instance testing device 600 according to an embodiment of the present application is shown. The device 600 may include:

[0094] The operation data acquisition module 601 is used to acquire operation-related data of the database instance;

[0095] A data feature extraction module 602 is used to extract data features of the operation-related data;

[0096] The characterization result analysis module 603 is used to analyze the data features to obtain the characterization result of the database instance in at least one running test dimension.

[0097] In a possible implementation, the operation-related data of the database instance includes load status data of resources on which the operation of the database instance depends and a database query statement used to access the database instance.

[0098] In one possible implementation, the data features include the time series features of the data sequence composed of the operation-related data in chronological order in the time dimension, and / or the database query behavior features represented by the database query statement, and the step of extracting the data features of the operation-related data is implemented by calling at least one pre-trained feature extraction algorithm model.

[0099] In a possible implementation, when the data feature includes a time series feature of a data sequence formed by the operation-related data in time order in a time dimension, the data feature extraction module 602 may include:

[0100] a data segment division submodule, configured to divide the operation-related data into at least one target periodic data segment having periodic characteristics;

[0101] The cycle length generating submodule is used to generate the cycle length corresponding to each target cycle data segment in the at least one target cycle data segment.

[0102] The timing feature determination module is used to determine the timing feature corresponding to the operation-related data based on the period length of each target period data segment in the at least one target period data segment.

[0103] In some embodiments, the data segment division submodule may include:

[0104] A wavelet transform processing unit, used for performing maximum overlap discrete wavelet transform on the operation-related data to obtain a frequency domain graph corresponding to the operation-related data;

[0105] a data sequence division unit, configured to divide the operation-related data into a plurality of data sequences having overlapping segments and ordered in time according to the frequency domain graph;

[0106] a periodic decomposition unit, configured to periodically decompose the divided data sequence to divide the operation-related data into a plurality of periodic data segments;

[0107] The target periodic segment determining unit is used to determine the at least one target periodic segment from the multiple periodic data segments according to the wavelet variance corresponding to the periodic data segment.

[0108] In some embodiments, the aforementioned cycle length generation submodule may include:

[0109] a candidate cycle length generating unit, configured to generate, for each target cycle data segment in the at least one target cycle data segment, a candidate cycle length of the target cycle segment by using a periodogram algorithm;

[0110] The target cycle length determination unit is used to verify and optimize the candidate cycle length by using the autocorrelation function of the candidate cycle length to obtain the target cycle length corresponding to the target cycle segment.

[0111] In a possible implementation, when the data feature includes a time series feature of a data sequence formed by the operation-related data in time order in a time dimension, the time series feature includes one or more of data periodicity, data trend, data stability, data spike point, and data change point, the data feature extraction module 602 may include:

[0112] The time series feature detection submodule is used to call at least one of the following algorithms: an autoregressive moving average model, an autocorrelation function, a partial autocorrelation function, a data spike point detection algorithm based on the mean and standard deviation, and a Bayesian mutation point algorithm to extract the time series features of the operation-related data.

[0113] In a possible implementation, when the data feature includes a time series feature of a data sequence formed by the operation-related data in time order in a time dimension, the apparatus may further include:

[0114] The non-periodic data removal module is used to perform a second filtering process on the operation-related data of the database instance to remove the non-periodic operation-related data.

[0115] In a possible implementation, the characterization result analysis module 603 may include at least one of the following submodules:

[0116] An abnormal event determination submodule, used to determine the historical operation abnormal events of the database instance according to the extracted data features;

[0117] A load state prediction submodule, used to predict the load state data of the resources that the database instance depends on in a future time period according to the extracted data features;

[0118] The operational risk determination submodule is used to determine the query quality and operational risk of the database query statement corresponding to the database instance according to the extracted data features.

[0119] In a possible implementation, the above device may further include:

[0120] An optimization strategy generation module is used to generate an operation optimization strategy for the database instance based on the characterization results of the database instance in at least one test dimension, and the operation optimization strategy includes at least one of a resource elasticity management function activation strategy, a database query flow limiting strategy, an elastic resource management solution optimization strategy, and a database query statement optimization strategy.

[0121] In some embodiments, the above optimization strategy generation module may include:

[0122] A behavior pattern determination submodule, for determining a user request behavior pattern based on multiple database query statements corresponding to the same user;

[0123] The optimization strategy generation submodule is used to determine the source of the problem affecting the characterization result according to the user request behavior pattern, and generate an operation optimization strategy for the database instance according to the source of the problem.

[0124] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0125] Figure 7 FIG. 1 is a block diagram of an electronic device used to implement an embodiment of the present application. Figure 7 As shown, the electronic device includes: a memory 701 and a processor 702. The memory 701 stores a computer program that can be run on the processor 702. When the processor 702 executes the computer program, the method in the above embodiment is implemented. The number of the memory 701 and the processor 702 can be one or more.

[0126] The electronic device also includes:

[0127] The communication interface 703 is used to communicate with external devices and perform data exchange transmission.

[0128] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the memory 701, the processor 702 and the communication interface 703 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0129] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.

[0130] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.

[0131] An embodiment of the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method provided in any embodiment of the present application is implemented.

[0132] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.

[0133] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the present application.

[0134] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.

[0135] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).

[0136] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0137] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0138] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0139] Any process or method described in the flow chart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.

[0140] The logic and / or steps described in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or used in combination with these instruction execution systems, devices or apparatuses.

[0141] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0142] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.

[0143] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope recorded in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A database instance testing method, comprising: Get the operation-related data of the database instance; extracting data features of the operation-related data; The data features are analyzed to obtain characterization results of the database instance in at least one running test dimension.

2. The method according to claim 1, wherein: The operation-related data of the database instance includes load status data of resources on which the operation of the database instance depends and a database query statement used to access the database instance.

3. The method according to claim 2, wherein: The data features include the time series features of the data sequence composed of the operation-related data in chronological order in the time dimension, and / or the database query behavior features represented by the database query statement. The step of extracting the data features of the operation-related data is achieved by calling at least one pre-trained feature extraction algorithm model.

4. The method according to claim 1, wherein: When the data feature includes the time series feature of the data sequence formed by the operation-related data in time order in the time dimension, the data feature of the operation-related data extracted includes: dividing the operation-related data into at least one target periodic data segment having a periodic characteristic; Generate a period length corresponding to each target period data segment in the at least one target period data segment; Based on the period length of each target period data segment in the at least one target period data segment, a timing feature corresponding to the operation-related data is determined.

5. The method according to claim 4, wherein: The step of dividing the operation-related data into at least one target periodic data segment having a periodic characteristic comprises: Performing maximum overlap discrete wavelet transform on the operation-related data to obtain a frequency domain graph corresponding to the operation-related data; dividing the operation-related data into a plurality of data sequences having overlapping segments and ordered in time according to the frequency domain graph; Performing periodic decomposition on the divided data sequence to divide the operation-related data into a plurality of periodic data segments; The at least one target periodic segment is determined from the plurality of periodic data segments according to the wavelet variance corresponding to the periodic data segment.

6. The method according to claim 4, wherein: The generating of the period length corresponding to each target period data segment in the at least one target period data segment comprises: For each target periodic data segment in the at least one target periodic data segment, generating a candidate period length of the target periodic segment using a periodogram algorithm; The candidate cycle length is verified and optimized by using the autocorrelation function of the candidate cycle length to obtain the target cycle length corresponding to the target cycle segment.

7. The method according to claim 1, wherein: When the data feature includes the time series feature of the data sequence formed by the operation-related data in time order in the time dimension, the time series feature includes one or more of data periodicity, data trend, data stability, data spike point and data change point, the data feature of the operation-related data extracted includes: At least one algorithm selected from the group consisting of an autoregressive moving average model, an autocorrelation function, a partial autocorrelation function, a data spike point detection algorithm based on average and standard deviation, and a Bayesian mutation point algorithm is called to extract the time series characteristics of the operation-related data.

8. The method according to claim 1, wherein: When the data feature includes a time series feature of a data sequence formed by the operation-related data in time order in a time dimension, the method further includes: The operation-related data of the database instance is processed by a second filtering process to remove non-periodic operation-related data.

9. The method according to claim 1, wherein: The step of analyzing the data features to obtain a characterization result of the database instance in at least one test dimension includes at least one of the following steps: Determine historical abnormal operation events of the database instance according to the extracted data features; Predicting load status data of resources that the database instance depends on in a future time period based on the extracted data features; The query quality and operation risk of the database query statement corresponding to the database instance are determined according to the extracted data features.

10. The method according to claim 1, wherein: The method further comprises: Based on the characterization results of the database instance in at least one test dimension, an operation optimization strategy for the database instance is generated, and the operation optimization strategy includes at least one of a resource elasticity management function activation strategy, a database query current limiting strategy, an elastic resource management solution optimization strategy, and a database query statement optimization strategy.

11. The method according to claim 10, wherein: The step of generating an operation optimization strategy for the database instance according to the characterization result of the database instance in at least one test dimension includes: Determining a user request behavior pattern based on multiple database query statements corresponding to the same user; According to the user request behavior pattern, the source of the problem affecting the characterization result is determined, and an operation optimization strategy for the database instance is generated according to the source of the problem.

12. A database instance testing device, comprising: The operation data acquisition module is used to obtain operation-related data of the database instance; A data feature extraction module, used to extract data features of the operation-related data; The characterization result analysis module is used to analyze the data features to obtain the characterization result of the database instance in at least one running test dimension.

13. An electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.