Method and device for testing load replay between heterogeneous databases
By obtaining and converting the load statement of the database, generating the target statement expression of the target database, and generating a replay time limit based on user configuration parameters, the complexity and resource consumption issues of load replay between heterogeneous databases are solved, and the versatility of the test is improved. and flexibility.
Patent Information
- Application Number
- CN202410783423.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-08-30
AI Technical Summary
Existing database load replay technology is mainly limited to testing between databases of the same type. It is difficult to perform load replay between heterogeneous databases, and the replay rate is unadjustable. It has poor versatility and flexibility, complex deployment, and high resource consumption. The types of supported databases are limited.
By obtaining the recorded load statement of the source database, perform load conversion to generate the target statement expression of the target database, and generate a replay time limit based on user configuration parameters, and perform load replay on the target database according to the replay time limit to support load reloading between heterogeneous databases. Play the test and adjust the playback rate.
It enables independent load replay testing between heterogeneous databases, saves system resources, improves the versatility and flexibility of load replay, supports multiple database types, and can adjust the replay time limit at different rates.
Smart Images

Figure CN118567962A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, in particular to the field of artificial intelligence technology, and more particularly to a load replay test method and device between heterogeneous databases. Background Art
[0002] Database load replay is of great significance for ensuring the performance, reliability, compatibility and recoverability of database systems. By simulating the actual workload, we can better understand the behavior of the system and make more informed decisions and optimizations. At present, database load replay is mostly limited to different versions of the same database. In related technologies, load replay between heterogeneous databases requires multiple components and tools to replay between different types of databases. The components and tools used in this way are not independent products and need to be bundled or only use their own products. In addition, there are many components involved, the deployment and configuration are complex, the resource consumption is large, the types of supported databases are limited, the replay rate cannot be adjusted, and the versatility and flexibility are poor. Summary of the invention
[0003] One object of the present invention is to provide a load replay test method between heterogeneous databases, which can be independent of different types of databases, support load replay testing between heterogeneous databases, adjust the replay time limit, and replay the target statement expression to the target database at different rates within the replay time limit, thereby saving system resources and improving the versatility and flexibility of load replay. Another object of the present invention is to provide a load replay test device between heterogeneous databases. Another object of the present invention is to provide a computer-readable medium. Another object of the present invention is to provide a computer device.
[0004] In order to achieve the above objectives, the present invention discloses a load replay test method between heterogeneous databases, including:
[0005] Get the recorded load statements of the source database;
[0006] Perform load conversion on the recorded load statements to generate target statement expressions for the target database. The source database and the target database are heterogeneous databases.
[0007] Generate a replay time limit based on the recorded load statements and preset user configuration parameters;
[0008] According to the replay time limit, the target database is load replayed according to the target statement expression to generate the load replay test results.
[0009] Preferably, obtaining the recorded load statement of the source database includes:
[0010] Use the connection pool tool to obtain the recorded load statements and corresponding timestamp information of the source database according to the preset log parameters.
[0011] Preferably, performing load conversion on the recorded load statement to generate a target statement expression of the target database includes:
[0012] Parse the recorded load statements through the statement parsing algorithm to generate an abstract syntax tree;
[0013] According to the database type of the target database, determine the corresponding target element to generate a logical execution plan;
[0014] Generate a logical execution plan through the target elements, and generate the target statement expression of the target database according to the abstract syntax tree.
[0015] Preferably, the recorded load statement includes a plurality of sequential recorded load statements;
[0016] Generates a replay time limit based on the recorded load statements and preset user configuration parameters, including:
[0017] Generate an initial time interval between each recorded load statement and the first recorded load statement according to timestamp information corresponding to the plurality of sequential recorded load statements;
[0018] Generates the replay time limit based on user configuration parameters and the initial time interval.
[0019] Preferably, the configuration parameters include a rate multiplier value or a full value;
[0020] Generates the replay time limit based on user configuration parameters and the initial time interval, including:
[0021] If the user configuration parameter is a rate multiplier value, the initial time interval is divided by the rate multiplier to generate the replay time interval;
[0022] Determine the replay time interval as the replay time limit;
[0023] If the user configuration parameter is full, the replay time limit is set to empty.
[0024] Preferably, according to the replay time limit, the target database is load replayed according to the target statement expression to generate a load replay test result, including:
[0025] If the replay time limit is the replay time interval, within the replay time limit, the target statement expressions are sent to the target database in sequence for load replay, and the load replay test results are generated;
[0026] If the replay time limit is empty, the target statement expressions are sent to the target database in sequence for load replay, and the load replay test results are generated.
[0027] The present invention also discloses a load replay test system between heterogeneous databases, comprising: a source database, a load replay test device between heterogeneous databases and a target database, wherein the source database and the target database are heterogeneous databases;
[0028] The source database is used to store recorded load statements;
[0029] The load replay test device between heterogeneous databases is used to perform load conversion on recorded load statements to generate target statement expressions of target databases; generate a replay time limit according to the recorded load statements and preset user configuration parameters; perform load replay on the target database according to the replay time limit and the target statement expression to generate load replay test results;
[0030] The target database is used to perform workload replay in response to the target statement expression.
[0031] The present invention also discloses a load replay test device between heterogeneous databases, comprising:
[0032] An acquisition unit, used to acquire recorded load statements of a source database;
[0033] A load conversion unit is used to perform load conversion on recorded load statements to generate target statement expressions for a target database, where the source database and the target database are heterogeneous databases;
[0034] A replay time limit generating unit, used to generate a replay time limit according to a recorded load statement and preset user configuration parameters;
[0035] The load replay unit is used to perform load replay on the target database according to the replay time limit and the target statement expression, and generate the load replay test result.
[0036] The present invention also discloses a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.
[0037] The present invention also discloses a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, the processor is used to control the execution of program instructions, and the processor implements the above method when executing the program.
[0038] The present invention also discloses a computer program product, including a computer program / instruction, and the method described above is implemented when the computer program / instruction is executed by a processor.
[0039] The present invention obtains recorded load statements of a source database; performs load conversion on the recorded load statements to generate target statement expressions of a target database, wherein the source database and the target database are heterogeneous databases; generates a replay time limit according to the recorded load statements and preset user configuration parameters; performs load replay on the target database according to the replay time limit and the target statement expression to generate a load replay test result, which can be independent of different types of databases, supports load replay testing between heterogeneous databases, adjusts the replay time limit, and replays the target statement expression to the target database at different rates within the replay time limit, thereby saving system resources and improving the versatility and flexibility of load replay. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A schematic diagram of the structure of a load replay test system between heterogeneous databases provided by an embodiment of the present invention;
[0042] Figure 2 A flow chart of a load replay test method between heterogeneous databases provided by an embodiment of the present invention;
[0043] Figure 3 A flow chart of another load replay test method between heterogeneous databases provided by an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of the structure of a load replay test device between heterogeneous databases provided by an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] It should be noted that the load replay test method and device between heterogeneous databases disclosed in the present application can be used in the field of artificial intelligence technology, and can also be used in any field other than the field of artificial intelligence technology. The application field of the load replay test method and device between heterogeneous databases disclosed in the present application is not limited.
[0048] In order to facilitate the understanding of the technical solution provided by the present application, the relevant contents of the technical solution of the present application are first described below. Heterogeneous database refers to an integrated system composed of different types of database systems. These different types of database systems can come from different suppliers, use different data storage and access technologies, and support different data models and query languages. Heterogeneous database systems include multiple database types such as data warehouses, relational databases, object-oriented databases, XML databases, etc. These database systems are connected through a middleware so that they can work together to achieve data integration and sharing. The implementation of heterogeneous database systems needs to consider issues such as data consistency, security, performance, etc. In order to solve these problems, it is usually necessary to adopt technologies such as data conversion, data cleaning, and data mapping.
[0049] Load refers to the workload or amount of tasks borne by a computer system or network. In a computer system, load usually refers to the overall level of indicators such as the number of running processes, CPU utilization, memory utilization, network bandwidth, etc. A high load usually means that system resources have been fully utilized, and may even cause the system to respond slowly or crash. Therefore, it is very important for a computer system or network to understand and control the load. Load monitoring and control usually require the use of load balancing, caching, scheduling and other technologies to ensure the stability and performance of the system. For databases, load usually refers to the workload or amount of tasks borne by the database system. Specifically, load can refer to the following aspects:
[0050] Query load: refers to the number and frequency of query requests that a database system is subjected to. A high query load usually means that the database system needs to process more query requests, and therefore requires higher processing power and speed.
[0051] Transaction load: refers to the number and frequency of transactions that a database system is subjected to. A high transaction load usually means that the database system needs to support more concurrent transactions, and therefore requires higher concurrency performance and transaction processing capabilities.
[0052] Storage load: refers to the amount and frequency of data storage and reading that the database system is subjected to. A high storage load usually means that the database system needs higher storage capacity and read / write speed to support more data storage and reading requests.
[0053] Network load: refers to the number and frequency of network requests that the database system is subjected to. A high network load usually means that the database system requires a higher network bandwidth and number of connections to support more network requests and data transmission.
[0054] Different optimization strategies and technologies can be used to improve the performance and stability of the database system for different types of loads. For example, when the query load is high, indexing, partitioning, caching and other technologies can be used to optimize query performance; when the storage load is high, distributed storage, compression, archiving and other technologies can be used to optimize storage performance.
[0055] Load Testing is a testing method used to evaluate the performance of a system under different load conditions. Load replay usually simulates real user requests or other loads to stress test the system to evaluate the performance and stability of the system under high load conditions.
[0056] In load replay testing, some tools and techniques are used to simulate different types of loads, such as simulating user requests, data transmission, transaction processing, etc. These tools can control the type, intensity, and duration of the load, and can record performance indicators such as the system's response time, throughput, and error rate. By analyzing and comparing these indicators, the performance bottlenecks of the system under different load conditions can be identified, thereby optimizing the performance and stability of the system.
[0057] Load replay is a common testing method that can be used to evaluate various types of systems, including database systems, network systems, web applications, etc. In database systems, load replay can be used to evaluate the performance and stability of the database, as well as to optimize the database configuration and parameter settings. For example, you can use the load replay tool to simulate different types of query loads, transaction loads, etc. to evaluate the performance of the database under high load conditions, and optimize the database cache, index, partition, etc.
[0058] Figure 1 A schematic diagram of a load replay test system between heterogeneous databases provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the system includes: a source database 100, a load replay test device 200 between heterogeneous databases and a target database 300, wherein the source database 100 and the target database 300 are heterogeneous databases. Database types include but are not limited to: MySQL, Oracle, SQLServer, PostgreSQL, DB2, Sybase.
[0059] The source database 100 is used to store recorded load statements.
[0060] The load replay test device 200 between heterogeneous databases is used to perform load conversion on recorded load statements to generate target statement expressions of the target database; generate a replay time limit based on the recorded load statements and preset user configuration parameters; according to the replay time limit, load replay is performed on the target database according to the target statement expression to generate a load replay test result.
[0061] The target database 300 is used to perform workload replay in response to a target statement expression.
[0062] In the embodiment of the present invention, the load replay test device 200 between heterogeneous databases includes a database load collection module 210 , a database load conversion module 220 , a database load delivery module 230 and a load performance analysis module 240 .
[0063] The database load collection module 210 runs on the source database 100 and is used to obtain the database load through the connection pool tool. Through the connection pool tool's own support for heterogeneous databases, the loads of different databases are collected, including but not limited to SQL statements and timestamp information. There is no need to intercept traffic from the application side to record database operations, which simplifies the system complexity to a certain extent and can eliminate the interference of network traffic.
[0064] The database load conversion module 220 runs on the source database 100 and is used to perform statement parsing through a statement parsing algorithm to construct a target statement expression of the target database. Through statement parsing and construction, support for multiple database types is achieved.
[0065] The database load delivery module 230 is used to configure different replay rates through user configuration parameters, and then deliver them to the target database through the connection pool tool to achieve load replay, which is used to simulate various scenarios and determine the load bearing capacity of the target database.
[0066] The load performance analysis module 240 is used to collect various monitoring data during the load collection and replay process and generate load replay test results.
[0067] In the technical solution provided by the embodiment of the present invention, a recorded load statement of a source database is obtained; a load conversion is performed on the recorded load statement to generate a target statement expression of a target database, wherein the source database and the target database are heterogeneous databases; a replay time limit is generated according to the recorded load statement and preset user configuration parameters; according to the replay time limit, the load of the target database is replayed according to the target statement expression to generate a load replay test result, which can be independent of different types of databases, support load replay testing between heterogeneous databases, adjust the replay time limit, and replay the target statement expression to the target database at different rates within the replay time limit, thereby saving system resources and improving the versatility and flexibility of load replay.
[0068] It is worth mentioning that Figure 1 The scenario of load replay testing between heterogeneous databases shown is also applicable to Figure 2 or Figure 3 The load replay test method between heterogeneous databases will not be described in detail here.
[0069] The following takes the load replay test device between heterogeneous databases as an example to illustrate the implementation process of the load replay test method between heterogeneous databases provided by the embodiment of the present invention. It can be understood that the execution subject of the load replay test method between heterogeneous databases provided by the embodiment of the present invention includes but is not limited to the load replay test device between heterogeneous databases.
[0070] Figure 2 A flow chart of a load replay test method between heterogeneous databases provided by an embodiment of the present invention, such as Figure 2 As shown, the method includes:
[0071] Step 101: Obtain the recorded load statement of the source database.
[0072] Step 102: Perform load conversion on the recorded load statement to generate a target statement expression of the target database, where the source database and the target database are heterogeneous databases.
[0073] Step 103: Generate a replay time limit according to the recorded load statement and preset user configuration parameters.
[0074] Step 104: Replay the load on the target database according to the replay time limit and the target statement expression to generate a load replay test result.
[0075] In the technical solution provided by the embodiment of the present invention, a recorded load statement of a source database is obtained; a load conversion is performed on the recorded load statement to generate a target statement expression of a target database, wherein the source database and the target database are heterogeneous databases; a replay time limit is generated according to the recorded load statement and preset user configuration parameters; according to the replay time limit, the load of the target database is replayed according to the target statement expression to generate a load replay test result, which can be independent of different types of databases, support load replay testing between heterogeneous databases, adjust the replay time limit, and replay the target statement expression to the target database at different rates within the replay time limit, thereby saving system resources and improving the versatility and flexibility of load replay.
[0076] Figure 3 A flow chart of another load replay test method between heterogeneous databases provided by an embodiment of the present invention, such as Figure 3 As shown, the method includes:
[0077] Step 201: Obtain the recorded load statements and corresponding timestamp information of the source database through the connection pool tool according to the preset log parameters.
[0078] In the embodiment of the present invention, each step is performed by a load replay test device between heterogeneous databases.
[0079] As an optional solution, the connection pool tool is Druid connection pool. Druid is an open source, high-performance Java language connection database (Java DataBase Connectivity, referred to as: JDBC) connection pool. Druid connection pool provides more functions and performance optimizations than traditional JDBC connection pools, including but not limited to:
[0080] Data source monitoring: Druid connection pool supports real-time monitoring of data source status and performance indicators, including but not limited to the number of active connections, number of idle connections, maximum number of connections, average waiting time, maximum waiting time, etc. Through data source monitoring, performance bottlenecks and abnormal conditions of the connection pool can be discovered in a timely manner for adjustment and optimization.
[0081] Structured Query Language (SQL) Firewall: Druid connection pool supports SQL firewall, which can identify and intercept malicious SQL statements, including SQL injection, slow query, etc. SQL firewall can improve the security and stability of the application.
[0082] Connection pool cache: Druid connection pool supports connection pool cache, which can cache the status and configuration information of the connection pool to avoid repeated creation and destruction of the connection pool. Through the connection pool cache, the performance and response speed of the connection pool can be improved.
[0083] Concurrency control: Druid connection pool supports concurrency control, which can prevent multiple threads from operating the same connection pool at the same time, causing abnormal connection pool status. Concurrency control can improve the stability and reliability of the connection pool.
[0084] Multiple data source support: Druid connection pool supports multiple data source configurations and can manage connection pools of multiple data sources at the same time. With multiple data source support, application configuration and management can be simplified.
[0085] It is worth noting that when using the Druid connection pool, you need to pay attention to the fact that the configuration and usage of the connection pool may vary and need to be adjusted and optimized according to actual conditions.
[0086] In an embodiment of the present invention, the log parameters include log record parameters and timestamp format parameters. Specifically, the value of the log record parameter statementExecutableSqlLogEnable is set to true to enable SQL log record; the timestamp format parameter is set to "%date{yyyy-MM-dd HH:mm:ss.SSS}[%thread]%level[%C{36}.%M]-%msg%n" to record the timestamp of the SQL statement, so as to accurately control the playback rate later. Through the execution log of the Druid connection pool, the recorded load statement and the corresponding timestamp information of the source database are obtained according to the log record parameters and timestamp format parameters.
[0087] In the embodiment of the present invention, the recorded load statement includes a plurality of sequentially recorded load statements, each of which has corresponding timestamp information, and the timestamp information increases in the order of recording complex statements.
[0088] Step 202: Parse the recorded load statement through a statement parsing algorithm to generate an abstract syntax tree.
[0089] In the embodiment of the present invention, the statement parsing algorithm is a built-in algorithm of the SQL Parser module in the connection pool tool, and the abstract syntax tree (abstract syntax tree, referred to as AST) is a general expression form of SQL statements. AST is a tree representation of the abstract syntax structure of the source code, and each node on the tree represents a structure in the source code. AST does not represent every detail of the real syntax. For example, nested brackets are implicit in the tree structure and are not presented in the form of nodes.
[0090] Specifically, the SQL Parser module in the connection pool tool uses a built-in algorithm to parse SQL statements with natural semantics into a more abstract data structure to generate an AST.
[0091] Step 203: According to the database type of the target database, determine the corresponding target element to generate a logic execution plan.
[0092] In the embodiment of the present invention, different database types correspond to different element generation logic execution plans, and the element generation logic execution plan describes the data to be queried or the data to be stored.
[0093] It is worth noting that the correspondence between the database type and the element generation logic execution plan and the specific content of the element generation logic execution plan can be set according to actual conditions, and the embodiment of the present invention does not limit this.
[0094] Step 204: Generate a logical execution plan through the target element, and generate a target statement expression of the target database according to the abstract syntax tree.
[0095] Specifically, the Visitor mode is adopted to traverse the AST syntax tree to obtain each element in the recorded load SQL statement, which includes SQL basic elements and related data; the corresponding target element generation logic execution plan is determined through the database type of the target database; the target statement expression supported by the target database is generated according to the target element generation logic execution plan.
[0096] Among them, the visitor pattern refers to separating the structure and data, writing a visitor to access the elements in the data structure, and then leaving the processing of each element to the visitor class.
[0097] Step 205: Generate an initial time interval between each recorded load statement and the first recorded load statement according to the timestamp information corresponding to the plurality of sequential recorded load statements.
[0098] Specifically, obtain the timestamp information A1 of the first recorded load statement; obtain the timestamp information A2 of the second recorded load statement, calculate the difference between A1 and A2, and generate the initial time interval δ2 between the second recorded load statement and the first recorded load statement; obtain the timestamp information A3 of the third recorded load statement, calculate the difference between A1 and A3, and generate the initial time interval δ3 between the third recorded load statement and the first recorded load statement, until the timestamp information corresponding to all recorded load statements is traversed, and the initial time interval between each recorded load statement and the first recorded load statement is generated.
[0099] Step 206: Generate a playback time limit according to the user configuration parameters and the initial time interval.
[0100] In the embodiment of the present invention, the configuration parameter is a speed regulation parameter rate, and the speed regulation parameter rate includes a rate multiplier value or a full value. The configuration parameter is input by the user, the rate multiplier value is a determined value, and the full value is full. As an optional solution, the user configuration parameter includes 1.0, 1.5, 2.0, 3.0, and full. Among them, 1.0, 1.5, 2.0, and 3.0 are rate multiplier values, and full is the full value. The user can select the corresponding speed regulation parameter rate according to actual needs.
[0101] Step 206 specifically includes:
[0102] Step 2061, determine whether the user configuration parameter is a rate multiplier value, if so, execute step 2062; if not, execute step 2064.
[0103] In an embodiment of the present invention, if the user configuration parameter is a rate multiple value, it is necessary to adjust the load replay rate according to the rate multiple, that is, the load delivery interval is shortened by the corresponding multiple to simulate the carrying capacity of the target end under different load replay rates, and step 2062 is continued to be executed; if the user configuration parameter is a full value, it means that there is no need to additionally control the load delivery interval, and the recorded load is directly delivered in the order of load occurrence within the capacity of the replay system, so as to verify the maximum capacity of the target database to withstand the load, and step 2064 is continued to be executed.
[0104] Step 2062: Divide the initial time interval by the rate multiple to generate a replay time interval.
[0105] For example, if the initial time interval corresponding to the target statement expression to be sent is 10 minutes and the rate multiplier selected by the user is 2.0, the generated replay time interval is 5 minutes. That is, all database operations originally executed in the source database within 10 minutes will be sent to the target database within 5 minutes for load replay.
[0106] Step 2063: determine the playback time interval as the playback time limit, and this step ends.
[0107] Step 2064: Set the playback time limit to null.
[0108] In the embodiment of the present invention, the replay time limit is set to be empty, indicating that no additional control load delivery interval is required.
[0109] In the embodiment of the present invention, based on the target statement expression of the target database and the corresponding initial time interval δn, combined with the speed adjustment parameter rate input by the user, the load is accurately controlled to be sent to the target database at the required time interval to simulate the carrying capacity of the target database under different load replay rates.
[0110] Step 207: Replay the load on the target database according to the replay time limit and the target statement expression to generate a load replay test result.
[0111] In an embodiment of the present invention, if the replay time limit is the replay time interval, within the replay time limit, the target statement expression is sent to the target database in sequence for load replay, and a load replay test result is generated; if the replay time limit is empty, the target statement expression is sent to the target database in sequence for load replay, and a load replay test result is generated.
[0112] Furthermore, based on the built-in statistical filter (StatFilter) plug-in provided by Druid, detailed statistics on SQL execution performance are collected to monitor database access performance for analysis of database access performance; the information metadata monitored by StatFilter is compared with the information metadata in the source database to generate load replay test results. The information metadata counted by StatFilter is shown in Table 1:
[0113] Table 1
[0114]
[0115]
[0116]
[0117] Specifically, you can enable slow SQL statistics by setting the parameter log-slow-sql = true, and configure the slow SQL standard by setting slow-sql-millis. SQL that takes longer than slow-sql-millis is defined as slow SQL and will be recorded and used for analysis. The default value of slow-sql-millis is 3000, or 3 seconds. Setting the parameter mergeSql = true to enable SQL merging settings can merge the same SQL with the same format but different condition values for statistical analysis, which is convenient for analyzing the statistical values of performance indicators.
[0118] This application can support load replay between multiple types of databases. It is not limited to load replay between databases of the same type, but can support multiple types of databases at the same time. The replay rate can be set during replay, including constant-speed replay (rate=1.0), double-speed replay and extreme-speed replay (rate="full"), where constant-speed replay is used to verify the performance of the target database under real load; double-speed load can increase the load pressure to a certain extent, which can verify the stress test performance of the target database; extreme-speed replay can issue the maximum load pressure to verify the performance of the target database under extreme pressure, meeting multiple verification scenarios. During the load recording and replay process, the performance of database runtime statements can be collected at the same time, including statistical analysis of multiple operating indicators of SQL statements, collection of slow SQL, etc., which can be used to evaluate the performance of the source database and the target database.
[0119] It is worth noting that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of laws and regulations. The user information in the embodiments of this application is obtained through legal and compliant channels, and the acquisition, storage, use, and processing of user information are authorized and agreed by the customer.
[0120] It is worth noting that the information collected in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0121] It is worth noting that the technical solution provided in this application provides users with corresponding operation entrances for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0122] In the technical solution of the load replay test method between heterogeneous databases provided by the embodiment of the present invention, the recorded load statement of the source database is obtained; the recorded load statement is load converted to generate the target statement expression of the target database, and the source database and the target database are heterogeneous databases; the replay time limit is generated according to the recorded load statement and the preset user configuration parameters; according to the replay time limit, the load of the target database is replayed according to the target statement expression to generate the load replay test result, which can be independent of different types of databases, support load replay testing between heterogeneous databases, adjust the replay time limit, and replay the target statement expression to the target database at different rates within the replay time limit, saving system resources and improving the versatility and flexibility of load replay.
[0123] Figure 4 A schematic diagram of the structure of a load replay test device between heterogeneous databases provided by an embodiment of the present invention, wherein the device is used to perform the load replay test method between heterogeneous databases, such as Figure 4 As shown, the device includes: an acquisition unit 11, a load conversion unit 12, a replay time limit generation unit 13 and a load replay unit 14.
[0124] The acquisition unit 11 is used to acquire the recorded load statements of the source database.
[0125] The load conversion unit 12 is used to perform load conversion on the recorded load statements to generate target statement expressions of the target database, wherein the source database and the target database are heterogeneous databases.
[0126] The replay time limit generating unit 13 is used to generate a replay time limit according to the recorded load statement and preset user configuration parameters.
[0127] The load replay unit 14 is used to perform load replay on the target database according to the replay time limit and the target statement expression, and generate a load replay test result.
[0128] In the embodiment of the present invention, the acquisition unit 11 is specifically used to acquire the recorded load statements and corresponding timestamp information of the source database through a connection pool tool according to preset log parameters.
[0129] In an embodiment of the present invention, the load conversion unit 12 is specifically used to parse the recorded load statement through a statement parsing algorithm to generate an abstract syntax tree; determine the corresponding target element to generate a logical execution plan according to the database type of the target database; generate a logical execution plan through the target element, and generate a target statement expression of the target database according to the abstract syntax tree.
[0130] In an embodiment of the present invention, the recorded load statement includes multiple sequential recorded load statements; the replay time limit generation unit 13 is specifically used to generate an initial time interval between each recorded load statement and the first recorded load statement according to the timestamp information corresponding to the multiple sequential recorded load statements; and generate the replay time limit according to the user configuration parameters and the initial time interval.
[0131] In an embodiment of the present invention, the configuration parameter includes a rate multiplier value or a full value; the replay time limit generation unit 13 is specifically used to divide the initial time interval by the rate multiplier to generate a replay time interval if the user configuration parameter is a rate multiplier value; determine the replay time interval as the replay time limit; if the user configuration parameter is a full value, set the replay time limit to empty.
[0132] In an embodiment of the present invention, the load replay unit 14 is used to send the target statement expression in sequence to the target database for load replay within the replay time limit if the replay time limit is the replay time interval, and generate a load replay test result; if the replay time limit is empty, the target statement expression is sent in sequence to the target database for load replay, and generate a load replay test result.
[0133] In the scheme of the embodiment of the present invention, a recorded load statement of a source database is obtained; a load conversion is performed on the recorded load statement to generate a target statement expression of a target database, wherein the source database and the target database are heterogeneous databases; a replay time limit is generated according to the recorded load statement and preset user configuration parameters; according to the replay time limit, the load of the target database is replayed according to the target statement expression to generate a load replay test result, which can be independent of different types of databases, support load replay testing between heterogeneous databases, adjust the replay time limit, and replay the target statement expression to the target database at different rates within the replay time limit, thereby saving system resources and improving the versatility and flexibility of load replay.
[0134] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer device, and specifically, the computer device may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0135] An embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, the steps of the embodiment of the load replay test method between heterogeneous databases are implemented. For a specific description, please refer to the embodiment of the load replay test method between heterogeneous databases.
[0136] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer device 600 suitable for implementing an embodiment of the present application.
[0137] like Figure 5 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate operations and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer device 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0138] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal feedback device (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed as needed as the storage section 608.
[0139] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 609, and / or installed from the removable medium 611.
[0140] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0141] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0142] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0145] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0146] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0147] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0148] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0149] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0150] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0151] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A load replay test method between heterogeneous databases, characterized in that: The method comprises: Get the recorded load statements of the source database; Performing load conversion on the recorded load statement to generate a target statement expression for a target database, wherein the source database and the target database are heterogeneous databases; Generate a replay time limit according to the recorded load statement and preset user configuration parameters; According to the replay time limit, the target database is load replayed according to the target statement expression to generate a load replay test result.
2. The load replay test method between heterogeneous databases according to claim 1, characterized in that: The step of obtaining the recorded load statement of the source database includes: Through the connection pool tool, according to the preset log parameters, the recorded load statements and corresponding timestamp information of the source database are obtained.
3. The load replay test method between heterogeneous databases according to claim 1, characterized in that: The performing load conversion on the recorded load statement to generate a target statement expression of the target database includes: Parsing the recorded load statement through a statement parsing algorithm to generate an abstract syntax tree; Determine, according to the database type of the target database, a corresponding target element generation logic execution plan; A logical execution plan is generated through the target element, and a target statement expression of the target database is generated according to the abstract syntax tree.
4. The load replay test method between heterogeneous databases according to claim 2, characterized in that: The recorded load statement includes a plurality of sequential recorded load statements; The generating a replay time limit according to the recorded load statement and preset user configuration parameters includes: Generate an initial time interval between each recorded load statement and the first recorded load statement according to the timestamp information corresponding to the plurality of sequential recorded load statements; The playback time limit is generated according to the user configuration parameters and the initial time interval.
5. The load replay test method between heterogeneous databases according to claim 4 is characterized in that: The configuration parameters include a rate multiplier value or a full value; The generating the playback time limit according to the user configuration parameter and the initial time interval includes: If the user configuration parameter is a rate multiplier value, the initial time interval is divided by the rate multiplier to generate a replay time interval; Determining the playback time interval as the playback time limit; If the user configuration parameter is a full value, the playback time limit is set to empty.
6. The load replay test method between heterogeneous databases according to claim 5, characterized in that: The step of performing load replay on the target database according to the target statement expression according to the replay time limit to generate a load replay test result includes: If the replay time limit is the replay time interval, within the replay time limit, the target statement expressions are sent to the target database in sequence for load replay, and a load replay test result is generated; If the replay time limit is empty, the target statement expressions are sent to the target database in sequence for load replay to generate a load replay test result.
7. A load replay test system between heterogeneous databases, characterized in that: The system comprises: a source database, a load replay test device between heterogeneous databases and a target database, wherein the source database and the target database are heterogeneous databases; The source database is used to store recorded load statements; The load replay test device between heterogeneous databases is used to perform load conversion on the recorded load statement to generate a target statement expression of the target database; generate a replay time limit according to the recorded load statement and preset user configuration parameters; perform load replay on the target database according to the replay time limit and the target statement expression to generate a load replay test result; The target database is used to perform load replay in response to the target statement expression.
8. A load replay test device between heterogeneous databases, characterized in that: The device comprises: An acquisition unit, used to acquire recorded load statements of a source database; A load conversion unit, used to perform load conversion on the recorded load statement to generate a target statement expression of a target database, wherein the source database and the target database are heterogeneous databases; A replay time limit generating unit, used to generate a replay time limit according to the recorded load statement and preset user configuration parameters; The load replay unit is used to perform load replay on the target database according to the target statement expression according to the replay time limit and to generate a load replay test result.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the load replay test method between heterogeneous databases described in any one of claims 1 to 6 is implemented.
10. A computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the load replay test method between heterogeneous databases described in any one of claims 1 to 6 is implemented.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the load replay test method between heterogeneous databases described in any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Database load file playback method, medium, product and equipment
CN121070977A
Playback method, medium, product and device for database load files
CN121070977B
