Database testing method, device, storage medium and database stress testing device

By obtaining compatibility testing instructions and test configuration information, the database compatibility test results are directly generated, which solves the problem of insufficient convenience and accuracy of database compatibility testing and improves the user experience.

CN114936145BActive Publication Date: 2025-08-19ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210361562.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-07
Publication Date
2025-08-19
Estimated Expiration
2042-04-07

AI Technical Summary

Technical Problem

In the prior art, the convenience and accuracy of database compatibility testing are insufficient, which affects the user's user experience.

Method used

By obtaining compatibility testing instructions, obtaining test configuration information based on the instructions, and sending the information to the test server through the port identification of the database, obtaining test execution results, and generating compatibility test results.

Benefits of technology

Improves the convenience and accuracy of database compatibility testing and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114936145B_ABST
    Figure CN114936145B_ABST
Patent Text Reader

Abstract

This specification discloses a database testing method, device, storage medium and database stress testing device, wherein the method includes: obtaining a compatibility test instruction for a database, obtaining test configuration information corresponding to the database based on the compatibility test instruction, the test configuration information being used for executing the database and returning a test execution result; sending the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database, obtaining a test execution result corresponding to the test configuration information returned by the database via the test server; and generating a compatibility test result corresponding to the database based on the test execution result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a database testing method, device, storage medium, and database stress testing device. Background Art

[0002] With the advancement of science and technology, databases have emerged to facilitate data storage. A database is a warehouse that stores data, and data within a database is stored according to specific rules. Users can create a database hardware and software verification environment to better provide database services. Database compatibility testing can promote the development of database products and ecosystems, so improving the convenience of database compatibility testing has become a key concern for users. Summary of the Invention

[0003] The embodiments of this specification provide a database testing method, device, storage medium, and database stress testing device, which can improve the convenience of database compatibility testing while improving the accuracy of database compatibility determination, thereby improving the user experience.

[0004] In a first aspect, embodiments of this specification provide a database testing method, which is applied to a database stress testing device. The method includes:

[0005] Obtaining a compatibility test instruction for a database, and obtaining test configuration information corresponding to the database based on the compatibility test instruction, wherein the test configuration information is used for executing the database and returning a test execution result;

[0006] Sending the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database, and obtaining a test execution result corresponding to the test configuration information returned by the database via the test server;

[0007] Based on the test execution result, a compatibility test result corresponding to the database is generated.

[0008] In a second aspect, an embodiment of this specification provides a database testing device, the device comprising:

[0009] An instruction acquisition unit, configured to acquire a compatibility test instruction for a database, and based on the compatibility test instruction, acquire test configuration information corresponding to the database, wherein the test configuration information is used for executing the database and returning a test execution result;

[0010] an information sending unit, configured to send the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database, and obtain a test execution result corresponding to the test configuration information returned by the database via the test server;

[0011] A result generating unit is used to generate a compatibility test result corresponding to the database based on the test execution result.

[0012] In a third aspect, an embodiment of this specification provides a database stress testing device, comprising: at least one processor, and a memory communicatively connected to the at least one processor; wherein:

[0013] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

[0014] In a fourth aspect, an embodiment of this specification provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.

[0015] According to a fifth aspect, a computer program product comprises a computer program, which is used to perform the above method steps when executed by a processor.

[0016] In an embodiment of the present specification, a compatibility test instruction for a database is obtained, and based on the compatibility test instruction, the test configuration information corresponding to the database is obtained. The test configuration information is used for database execution and the test execution result is returned. The test configuration information is sent to the test server to which the database belongs based on the port identifier corresponding to the database, and the test execution result corresponding to the test configuration information returned by the database via the test server is obtained. Based on the test execution result, the compatibility test result corresponding to the database can be directly generated. Therefore, when performing a compatibility test on a database, the test configuration information can be directly obtained without the need to configure the test configuration information. This can reduce the time required to obtain the test configuration information and improve the convenience of database compatibility testing. At the same time, the compatibility test result is determined based on the test execution result corresponding to the test configuration information returned by the database via the test server, which can improve the accuracy of determining database compatibility and thereby improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is a system architecture diagram of a database testing method provided in an embodiment of this specification;

[0019] Figure 2 This is a flowchart of a database testing method provided in an embodiment of this specification;

[0020] Figure 3 This is a flowchart of a database testing method provided in an embodiment of this specification;

[0021] Figure 4 This is a system architecture diagram of a database testing method provided in an embodiment of this specification;

[0022] Figure 5 This is an interactive sequence diagram of a database testing method provided in an embodiment of this specification;

[0023] Figure 6 This is a flowchart of a database testing method provided in an embodiment of this specification;

[0024] Figure 7 This is a schematic diagram of a terminal display interface change provided by an embodiment of this specification;

[0025] Figure 8 This is an example diagram of a terminal display interface provided in an embodiment of this specification;

[0026] Figure 9 This is an interactive sequence diagram of a database testing method provided in an embodiment of this specification;

[0027] Figure 10 This is a schematic diagram of the structure of a database testing device provided in an embodiment of this specification;

[0028] Figure 11 This is a schematic diagram of the structure of a database testing device provided in an embodiment of this specification;

[0029] Figure 12 This is a schematic diagram of the structure of a database testing device provided in an embodiment of this specification;

[0030] Figure 13 This is a schematic diagram of the structure of a database testing device provided in an embodiment of this specification;

[0031] Figure 14 This is a schematic diagram of the structure of a database stress testing device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this specification.

[0033] In the description of this specification, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In the description of this specification, it should be noted that, unless otherwise expressly specified and limited, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood according to the specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0034] Compatibility testing is the process of testing whether software can run smoothly on specific hardware platforms, between different application software, on different operating system platforms, and in different network environments. Data compatibility testing is crucial to database product and ecosystem development.

[0035] Figure 1 This is a system architecture diagram of a database testing method provided by the embodiment of this specification. Figure 1As shown, the terminal 10 can generate test configuration information for the database and send the test configuration information to the database stress testing device 20 via the network 40. The database stress testing device 20 can obtain the test configuration information sent by the terminal 10 for the database and store the test configuration information. The terminal 10 can obtain a compatibility test instruction for the database and send the compatibility test instruction to the database stress testing device 20 via the network 40. The database stress testing device 20 can obtain the compatibility test instruction for the database and obtain the test configuration information corresponding to the database based on the compatibility test instruction. The database stress testing device 20 sends the test configuration information to the test server 30 to which the database belongs via the network 50 based on the port identifier corresponding to the database, and obtains the test execution result corresponding to the test configuration information returned by the database via the test server 30 via the network 50. If the test execution result is consistent with the expected execution result corresponding to the test configuration information, the database stress testing device 20 determines that the compatibility test result corresponding to the database is a compatibility test success; if the test execution result is an error result, the database stress testing device 20 determines that the compatibility test result corresponding to the database is a compatibility test failure. The database stress testing device 20 can generate a compatibility test report corresponding to the compatibility test result. The terminal 10 may send a viewing instruction for the compatibility test report to the database stress testing device 20 via the network 40. If the database stress testing device 20 obtains the viewing instruction for the compatibility test report from the terminal 10, the database stress testing device 20 may send the compatibility test report to the terminal 10 via the network 40.

[0036] The database testing method provided in this specification is described in detail below with reference to specific embodiments.

[0037] See Figure 2 , is a flowchart of a database testing method provided in the embodiment of this specification. Figure 2 As shown, the embodiment of this specification is described from the perspective of the database stress testing device, and the method may include the following steps S102-S106.

[0038] S102, obtaining a compatibility test instruction for the database, and obtaining test configuration information corresponding to the database based on the compatibility test instruction;

[0039] According to some embodiments, the execution entity of the embodiments of this specification is a database stress testing device. A database refers to a "warehouse that organizes, stores, and manages data according to a data structure." It is a collection of large amounts of data stored in a computer for a long period of time, organized, shareable, and uniformly managed. The database in the embodiments of this specification refers to a database stored on a server. The database can refer to a warehouse that stores data. The database does not specifically refer to a fixed database. For example, when the data stored in the database changes, the database can also change accordingly.

[0040] It is easy to understand that the server may include multiple databases. The database in this specification refers to the database used for compatibility testing in the server.

[0041] In some embodiments, compatibility testing refers to testing whether a database can be compatible with data sharing. The compatibility testing of the embodiments of this specification can be, for example, a Structured Query Language (SQL) test, which can test whether a database can compatibly execute standard SQL statements and non-standard SQL statements.

[0042] It is easy to understand that the compatibility test instruction is an instruction for instructing the database stress testing device to perform a compatibility test on the database. The compatibility test instruction can be an instruction sent to the database stress testing device through the terminal, or it can be a test instruction directly obtained by the database stress testing device.

[0043] According to some embodiments, test configuration information refers to information corresponding to a database and used to perform compatibility testing on the database. This test configuration information is used to execute the database and return the test execution results. This test configuration information corresponds to the database, meaning that different databases correspond to different test configuration information, and the same database can also correspond to different test configuration information. For example, for the same database, if the test time point in the test configuration information corresponding to the database changes, the test configuration information can also change accordingly.

[0044] According to some embodiments, when a database stress testing device executes a database testing method, the database stress testing device may detect whether a compatibility testing instruction for the database is obtained. When the database stress testing device obtains a compatibility testing instruction for the database, the database stress testing device may obtain test configuration information corresponding to the database based on the compatibility testing instruction.

[0045] S104, sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, and obtaining the test execution result corresponding to the test configuration information returned by the database via the test server;

[0046] According to some embodiments, a port identifier is an identifier used to uniquely identify a database. When a database is deployed on a server, the server may provide the database's port identifier. A server may include multiple databases or just one database, and each database may correspond to a different port identifier. This means that different databases correspond to different port identifiers.

[0047] In some embodiments, the port identifier does not specifically refer to a fixed identifier. For example, when the database changes, the port identifier may also change accordingly.

[0048] It is easy to understand that the test server in the embodiments of this specification refers to a server that can perform compatibility testing. The test server can be used to test the compatibility performance of the database. The database test server refers to the server where the database undergoing compatibility testing is located, and the database server can be the server where the database is deployed.

[0049] It is easy to understand that the test execution result refers to the test execution result corresponding to the test configuration information returned by the database. The test execution result does not specifically refer to a fixed result. For example, when any configuration information in the test configuration information changes, the test execution result may also change accordingly. For example, when the data included in the database changes, the test execution result may also change accordingly.

[0050] According to some embodiments, when the database stress testing device executes the database testing method, the database stress testing device can detect whether a compatibility test instruction for the database is obtained. When the database stress testing device obtains a compatibility test instruction for the database, the database stress testing device can obtain the test configuration information corresponding to the database based on the compatibility test instruction. The database stress testing device can send the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, and obtain the test execution result corresponding to the test configuration information returned by the database via the test server. In other words, the database stress testing device can send the test configuration information to the test server to which the database belongs, and the database can execute the test configuration information and return the test execution result to the database stress testing device through the test server.

[0051] S106: Generate a compatibility test result corresponding to the database based on the test execution result.

[0052] According to some embodiments, the compatibility test result refers to the result obtained by performing a compatibility test on the database. The compatibility test result does not specifically refer to a fixed test result. Different test execution results correspond to different compatibility test results.

[0053] It is easy to understand that when the database stress testing device obtains a compatibility test instruction for the database, the database stress testing device can obtain the test configuration information corresponding to the database based on the compatibility test instruction. The database stress testing device can send the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, and obtain the test execution result corresponding to the test configuration information returned by the database via the test server. When the database stress testing device obtains the test execution result, the database can generate the compatibility test result corresponding to the database based on the test execution result.

[0054] In an embodiment of the present specification, a compatibility test instruction for a database is obtained, and based on the compatibility test instruction, the test configuration information corresponding to the database is obtained. The test configuration information is used for database execution and the test execution result is returned. The test configuration information is sent to the test server to which the database belongs based on the port identifier corresponding to the database, and the test execution result corresponding to the test configuration information returned by the database via the test server is obtained. Based on the test execution result, the compatibility test result corresponding to the database can be directly generated. Therefore, when performing a compatibility test on a database, the test configuration information can be directly obtained without the need to configure the test configuration information. This can reduce the time required to obtain the test configuration information and improve the convenience of database compatibility testing. At the same time, the compatibility test result is determined based on the test execution result corresponding to the test configuration information returned by the database via the test server, which can improve the accuracy of determining database compatibility and thereby improve the user experience.

[0055] See Figure 3 , is a flowchart of a database testing method provided in the embodiment of this specification. Figure 3 As shown, the embodiment of this specification is described from the perspective of the database stress testing device, and the method may include the following steps S202-S214.

[0056] S202, obtaining a compatibility test instruction for the database, and obtaining test configuration information corresponding to the database based on the compatibility test instruction;

[0057] The specific process is as described above and will not be repeated here.

[0058] In some embodiments, the embodiments of this specification may be applied, for example, in SQL scenarios. SQL is a special-purpose programming language used to manage relational database management systems (RDBMS) or to perform stream processing in relational stream data management systems (RDSMS). SQL is based on relational algebra and tuple-relational calculus and includes a data definition language and a data manipulation language. The scope of SQL includes data insertion, querying, updating and deletion, database schema creation and modification, and data access control. Although SQL is often described as, and is largely described as, a declarative programming language (4GL), it also contains elements of procedural programming.

[0059] It is easy to understand that in the embodiments of this specification, compatibility testing can be performed using a single database stress testing device or a distributed database stress testing device, that is, compatibility testing can be performed using multiple database stress testing devices.

[0060] According to some embodiments, the compatibility test instructions for the database obtained by the database stress testing device may be instructions sent by a terminal to the database stress testing device. For example, when the terminal detects a compatibility test instruction corresponding to any database in the database set, the terminal may send the compatibility test instruction to the database stress testing device. The terminal may obtain the compatibility test instruction, for example, by displaying the port identifiers corresponding to each database in the database set, and the terminal may obtain the compatibility test instruction entered for any port identifier.

[0061] It is easy to understand that the connection between the terminal and the database stress testing device can be a wireless connection or a wired connection. For example, the connection between the terminal and the database stress testing device can be a wireless connection. Figure 4 This is a system architecture diagram of a compatibility test instruction transmission provided by the embodiment of this specification. Figure 4 As shown, when the terminal 10 obtains the compatibility test instruction, the terminal can send the compatibility test instruction to the database stress testing device 20 through the wireless network 40.

[0062] According to some embodiments, the database may be, for example, database A. The database stress testing device may obtain a compatibility test instruction for database A, and obtain test configuration information corresponding to database A based on the compatibility test instruction.

[0063] S204, determining a processing thread for testing the database from the thread set;

[0064] According to some embodiments, a thread is the smallest unit capable of performing computational scheduling in a database stress testing device. It is contained within a process and is the actual unit of operation within the process. A thread refers to a single, sequential flow of control within a process. A process can have multiple threads running concurrently, each executing different tasks in parallel.

[0065] It is easy to understand that a thread set refers to a set of at least one thread configured in a database stress testing device. This thread set does not specifically refer to a fixed set. For example, if the number of threads in a thread set changes, the thread set may also change accordingly. For example, if the thread information in a thread set changes, the thread set may also change accordingly. Thread information may, for example, refer to the tasks executed by the thread.

[0066] In some embodiments, a processing thread refers to a thread in a thread set used to test the database. The processing thread may include at least one thread. When there is one processing thread, the database stress testing device uses only one thread to test the database. When there are two processing threads, the database stress testing device concurrently executes the two threads to test the database.

[0067] According to some embodiments, when a database stress testing device obtains a compatibility test instruction for a database and obtains test configuration information corresponding to the database based on the compatibility test instruction, the database stress testing device can determine a processing thread from a thread set to test the database. When the database stress testing device determines a processing thread from a thread set to test the database, it can be determined based on pre-set thread configuration information, based on a user's thread configuration instruction, or by detecting the running status of the thread. When the database stress testing device determines a processing thread by detecting the running status of a thread, for example, a thread in the thread set with an idle running status can be determined as the processing thread.

[0068] According to some embodiments, the database may be, for example, database A. The thread set may include, for example, Q1 thread, Q2 thread, Q3 thread, Q4 thread, and Q5 thread. The database stress testing device may obtain a compatibility test instruction for database A and, based on the compatibility test instruction, obtain test configuration information corresponding to database A. The database stress testing device may, for example, determine, based on the thread selection instruction, from the thread set, a processing thread to be used for testing the database. The processing thread may be, for example, Q3 thread or Q4 thread.

[0069] S206, calling the processing thread and executing the step of sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database;

[0070] According to some embodiments, when a database stress testing device obtains a compatibility test instruction for a database and obtains test configuration information corresponding to the database based on the compatibility test instruction, the database stress testing device may determine, from a thread set, a processing thread for testing the database. When the database stress testing device determines the processing thread for testing the database, the database stress testing device may call the processing thread and execute the step of sending the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database.

[0071] According to some embodiments, the database may be, for example, database A. The thread set may include, for example, Q1 thread, Q2 thread, Q3 thread, Q4 thread, and Q5 thread. The database stress testing device may obtain a compatibility test instruction for database A, and obtain test configuration information corresponding to database A based on the compatibility test instruction. The database stress testing device may, for example, determine a processing thread for testing the database in the thread set based on the thread selection instruction. The processing thread may be, for example, Q3 thread and Q4 thread. The database stress testing device may call Q3 thread and Q4 thread, and execute the step of sending the test configuration information to the test server to which database A belongs based on the port identifier corresponding to database A.

[0072] S208, encapsulating the test statement set based on the test configuration attributes to obtain database test data;

[0073] According to some embodiments, the test configuration information includes test statements and test configuration attributes, wherein the test statement is a statement executed by the database, and the test configuration attribute is used to set the execution mode of the test statement. The test statement includes a first number of standard test statements and a second number of non-standard test statements. The first number refers to the number corresponding to the standard test statements, and the first number does not specifically refer to a fixed number. For example, when the database stress testing device obtains a modification instruction for the first number, the database stress testing device can modify the first number based on the modification instruction. The second number refers to the number corresponding to the non-standard test statements, and the second number does not specifically refer to a fixed number. For example, when the database stress testing device obtains a modification instruction for the second number, the database stress testing device can modify the second number based on the modification instruction.

[0074] It is easy to understand that test configuration attributes are used to indicate how the database executes test statements. These test configuration attributes include, but are not limited to, statement configuration ratio information, the order of each test statement in the test statement set, the test time point, the test duration, and so on. These test configuration attributes do not specifically refer to a fixed attribute. For example, when the attribute type included in the test configuration attribute changes, the test configuration attribute may also change accordingly. For example, when the information corresponding to each attribute in the test configuration attribute changes, the test configuration attribute may also change accordingly. For example, when the test time point changes, the test configuration attribute may also change accordingly.

[0075] It is easy to understand that a test statement set refers to a set including at least one test statement. The test statement set does not specifically refer to a fixed set. The test statement set includes a first number of standard test statements and a second number of non-standard test statements. The standard test statement may be, for example, a standard SQL test statement. The non-standard test statement may be, for example, a non-standard SQL test statement. The test statement set does not specifically refer to a fixed statement set. For example, when the number of statements included in the test statement set changes, the test statement set may also change accordingly. For example, when the first number or the second number changes, the test statement set may also change accordingly.

[0076] According to some embodiments, when the database testing device obtains test configuration information, that is, when the database testing device obtains test statements and test configuration attributes in the test configuration information, the database testing device can encapsulate the test statement set based on the test configuration attributes to obtain database test data.

[0077] In some embodiments, the database may be, for example, database A. The database stress testing device may obtain a compatibility test instruction for database A and, based on the compatibility test instruction, obtain test configuration information corresponding to database A. This configuration information may, for example, include a first number of five standard SQL test statements, a second number of four non-standard SQL test statements, and test configuration attributes. The database stress testing device may encapsulate the first number of five standard SQL test statements and the second number of four non-standard SQL test statements based on the test configuration attributes.

[0078] According to some embodiments, the test configuration attributes include statement configuration ratio information and the arrangement order of each test statement in the test statement set. When the database stress testing device encapsulates the test statement set based on the test configuration attributes to obtain database test data, it can obtain a first number of standard test statements and a second number of non-standard test statements in the test statement set based on the statement configuration ratio information. Standard test statements are test statements supported by all databases, and non-standard test statements are test statements customized for different databases. The database stress testing device encapsulates the standard test statements and non-standard test statements based on the arrangement order of each test statement in the test statement set to obtain database test data. The database stress testing device encapsulates the test statement set based on the test configuration attributes so that the database executes the test statement set according to the test configuration attributes, which can improve the accuracy of the database's compatibility test execution and improve the accuracy of obtaining compatibility test results.

[0079] It's easy to understand that statement configuration ratio information refers to the ratio of standard test statements to non-standard test statements in a test statement set, namely, the ratio of the first quantity to the second quantity. This statement test ratio information does not specifically refer to a fixed ratio. For example, if the first quantity or the second quantity obtained by the database stress testing device changes, the statement configuration ratio information may also change accordingly.

[0080] Optionally, the order of each test statement in the test statement set refers to the order of the test statements in the test statement set corresponding to the database. Each test statement is executed at least once. This order does not specifically refer to a fixed order. For example, if the execution order of each test statement changes, the order may also change accordingly. For example, if the execution count of each test statement changes, the order may also change accordingly.

[0081] It is easy to understand that a test statement set refers to a group formed by at least one test statement. The test statement set may include, for example, at least one standard test statement and at least one non-standard test statement. The test statement set does not specifically refer to a fixed statement set. For example, when the number of statements included in the test statement set changes, the test statement set may also change accordingly. For example, when the statement ratio information corresponding to the test statement set changes, the test statement set may also change accordingly. The statement ratio information refers to the statement ratio of the standard test statement subset and the non-standard test statement subset in the test statement set.

[0082] According to some embodiments, the database may be, for example, database A. The test configuration attributes include statement configuration ratio information, which may be, for example, 5:4, and the arrangement order of each test statement in the test statement set. The database stress testing device may, for example, obtain a first number of 5 standard test statements and a second number of 4 non-standard test statements in the test statement set based on the statement configuration ratio information. The arrangement order of each test statement in the test statement set obtained by the data stress testing device may, for example, be to execute the first number of 5 standard test statements first and then execute the second number of 4 non-standard test statements. The database stress testing device may encapsulate the standard test statements and non-standard test statements based on the arrangement order of each test statement in the test statement set to obtain database test data.

[0083] Optionally, the first number of 5 standard test statements may be, for example, W1 standard test statements, W2 standard test statements, W3 standard test statements, W4 standard test statements, and W5 standard test statements. The second number of 4 non-standard test statements may be, for example, E1 non-standard test statements, E2 non-standard test statements, E3 non-standard test statements, and E4 non-standard test statements. The order of arrangement of the test statements in the test statement set acquired by the data stress testing device may be, for example, W1 standard test statements, W2 standard test statements, W3 standard test statements, W4 standard test statements, W5 standard test statements, E1 non-standard test statements, E2 non-standard test statements, E3 non-standard test statements, and E4 non-standard test statements. The arrangement order of each test statement in the test statement set obtained by the data stress testing device can also be, for example, W1 standard test statement, E1 non-standard test statement, W2 standard test statement, W3 standard test statement, W4 standard test statement, E2 non-standard test statement, E3 non-standard test statement, W1 standard test statement, W4 standard test statement, W5 standard test statement and E4 non-standard test statement.

[0084] In some embodiments, the test configuration attributes also include, for example, a first number corresponding to standard test statements, a second number corresponding to non-standard test statements, and an arrangement order of each test statement in the test statement set. When the database stress testing device encapsulates the test statement set based on the test configuration attributes to obtain database test data, it can obtain a first number of standard test statements and a second number of non-standard test statements in the test statement set based on the statement configuration ratio information. Standard test statements are test statements supported by all databases, and non-standard test statements are test statements customized for different databases. The database stress testing device encapsulates standard test statements and non-standard test statements based on the arrangement order of each test statement in the test statement set to obtain database test data.

[0085] S210, sending the database test data to the test server to which the database belongs based on the port identifier corresponding to the database;

[0086] According to some embodiments, when a database stress testing device obtains database test data, it can obtain a port identifier corresponding to the database and, based on the port identifier corresponding to the database, send the database test data to a test server to which the database belongs. When the database stress testing device sends the database test data to the test server to which the database belongs, the database can execute the database test data.

[0087] S212, obtaining a test execution result corresponding to the database test data returned by the database via the test server;

[0088] According to some embodiments, when the database stress testing device sends database test data to the test server to which the database belongs based on the port identifier corresponding to the database, the database stress testing device can obtain the test execution result corresponding to the database test data returned by the database via the test server.

[0089] In some embodiments, the database may be, for example, database A. Database test data may include, for example, statement configuration information of 5:4. The database stress testing device encapsulates a first number of 5 standard test statements and a second number of 4 non-standard test statements based on the order of the test statements in the test statement set, thereby obtaining database test data. The database stress testing device may send the database test data to a test server to which database A belongs based on the port identifier a1 corresponding to database A, and obtain a test execution result corresponding to the database test data returned by database A via the test server.

[0090] S214: Generate a compatibility test result corresponding to the database based on the test execution result.

[0091] The specific process is as described above and will not be repeated here.

[0092] According to some embodiments, Figure 5 This is a time sequence interaction diagram of a database testing method provided by the embodiment of this specification. Figure 5As shown, the database stress testing device can obtain compatibility test instructions for the database, obtain test configuration information corresponding to the database based on the compatibility test instructions, and the database stress testing device can determine the processing thread used to test the database in the thread set. The database stress testing device calls the processing thread and executes the step of sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database. The database stress testing device encapsulates the test statement set based on the test configuration attributes to obtain database test data, and the database stress testing device sends the database test data to the test server to which the database belongs based on the port identifier corresponding to the database. The database can execute the database test statement, obtain the test execution result, and return the test execution result to the database stress testing device via the test server. The database stress testing device can obtain the test execution result corresponding to the database test data returned by the database via the test server, and generate the compatibility test result corresponding to the database based on the test execution result.

[0093] In an embodiment of the present specification, a compatibility test instruction for a database is obtained, and the test configuration information corresponding to the database is obtained based on the compatibility test instruction. The test configuration information can be directly obtained without configuring the test configuration information. This can reduce the time required to obtain the test configuration information and improve the convenience of database compatibility testing. Secondly, in the thread set, a processing thread for testing the database is determined. The processing thread can be called, and the step of sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database is executed. This can improve the execution efficiency of the compatibility test and the convenience of the compatibility test. In addition, the test statement set is encapsulated based on the test configuration attribute to obtain database test data, and the database test data is sent to the test server to which the database belongs based on the port identifier corresponding to the database. The test execution result corresponding to the database test data returned by the database via the test server is obtained, and based on the test execution result, the compatibility test result corresponding to the database is generated. This can improve the accuracy of determining the compatibility of the database, thereby improving the user experience.

[0094] See Figure 6 , is a flowchart of a database testing method provided in the embodiment of this specification. Figure 6 As shown, the embodiment of this specification is described from the perspective of the database stress testing device, and the method may include the following steps S302-S314.

[0095] S302, obtaining test configuration information sent by the terminal to the database, and storing the test configuration information;

[0096] According to some embodiments, a terminal is a terminal connected to a database stress testing device. This connection method includes, but is not limited to, a wired connection and a wireless connection. For example, the connection method between the terminal and the database stress testing device can be a wireless connection.

[0097] In some embodiments, the test configuration information in this embodiment refers to the test configuration information obtained by the terminal. For example, it can be information configured on the terminal display interface. When the terminal obtains the test configuration information for the database, it can be, for example, the test configuration information configured based on the port identifier corresponding to the database.

[0098] It is easy to understand that Figure 7 A schematic diagram showing the changes in a terminal display interface according to an embodiment of this specification is shown. Figure 7 As shown, the terminal can, for example, display a set of database identifiers. The terminal can obtain a click setting instruction for the a1 identifier corresponding to the A database. The terminal can display an interface corresponding to the test configuration information. The interface can, for example, include controls corresponding to the test statements, statement configuration ratio information, and the arrangement order of each test statement in the test statement set. For example, the terminal can display a test statement set based on a click instruction of the test statement control. For example, when the terminal obtains the test statement, statement configuration ratio information, and the arrangement order of each test statement in the test statement set, the terminal can obtain the test configuration information. The terminal can send the test configuration information to the database stress testing device via a wireless network.

[0099] S304, obtaining a compatibility test instruction for the database, and obtaining test configuration information corresponding to the database based on the compatibility test instruction;

[0100] The specific process is as described above and will not be repeated here.

[0101] According to some embodiments, the compatibility test instruction may be sent by the terminal to the database stress testing device, or may be directly obtained by the database stress testing device.

[0102] S306, sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, and obtaining the test execution result corresponding to the test configuration information returned by the database via the test server;

[0103] The specific process is as described above and will not be repeated here.

[0104] S308, if the test execution result is consistent with the expected execution result corresponding to the test configuration information, then the compatibility test result corresponding to the database is determined to be a compatibility test success;

[0105] According to some embodiments, the expected execution result refers to the execution result corresponding to the test configuration information. The expected execution result includes, but is not limited to, numerical values, data, etc. When the database stress testing device obtains the test execution result corresponding to the test configuration information returned by the database via the test server, the database stress testing device can obtain the expected execution result corresponding to the test configuration information. The database stress testing device can detect whether the test execution result is consistent with the expected execution result. If the test execution result is consistent with the expected execution result corresponding to the test configuration information, the database stress testing device can determine that the compatibility test result corresponding to the database is a successful compatibility test.

[0106] In some embodiments, the database may be, for example, database A. The expected execution result corresponding to the test configuration information may be a value of 1. The test execution result corresponding to the test configuration information returned by the test server to the database stress testing device, obtained by the database stress testing device, may be, for example, a value of 1. If the test execution result value 1 is consistent with the expected execution result value 1, the database stress testing device may determine that the compatibility test result corresponding to database A is a successful compatibility test.

[0107] S310, if the test execution result is an error result, determining that the compatibility test result corresponding to the database is a compatibility test failure;

[0108] According to some embodiments, when a database stress testing device obtains a test execution result corresponding to test configuration information returned by a database via a test server, the database stress testing device may detect the test execution result. If the test execution result is an error, the database compatibility test result is determined to be a compatibility test failure. In other words, if the test execution result indicates that the test statement cannot be executed, the database stress testing device determines that the database compatibility test result is a compatibility test failure.

[0109] In some embodiments, the database may be, for example, database A. The first number of 5 standard test statements may be, for example, W1 standard test statements, W2 standard test statements, W3 standard test statements, W4 standard test statements, and W5 standard test statements. The second number of 4 non-standard test statements may be, for example, E1 non-standard test statements, E2 non-standard test statements, E3 non-standard test statements, and E4 non-standard test statements. The order of arrangement of each test statement in the test statement set obtained by the data stress testing device may be, for example, W1 standard test statements, W2 standard test statements, W3 standard test statements, W4 standard test statements, W5 standard test statements, E1 non-standard test statements, E2 non-standard test statements, E3 non-standard test statements, and E4 non-standard test statements. If database A cannot execute the W2 standard test statement, database A may send an error report result to the database stress testing device via the test server. The database stress testing device determines that the compatibility test result corresponding to database A is a compatibility test failure.

[0110] S312, generating a compatibility test report corresponding to the compatibility test result;

[0111] According to some embodiments, when a database stress testing device obtains compatibility test results, the database stress testing device may generate a compatibility test report corresponding to the compatibility test results. The compatibility test report is not specifically a fixed test report. For example, when the compatibility test results change, the compatibility test content may also change accordingly.

[0112] According to some embodiments, if the test execution result is consistent with the expected execution result corresponding to the test configuration information, then the compatibility test result corresponding to the database is determined to be a compatibility test success, and the compatibility test report corresponding to the compatibility test result generated by the database stress testing device may, for example, indicate that the compatibility test result for the database is a compatibility test success. If the test execution result is an error result, then the compatibility test result corresponding to the database is determined to be a compatibility test failure, and the compatibility test report corresponding to the compatibility test result generated by the database stress testing device may indicate that the compatibility test result for the database is a compatibility test failure.

[0113] In some embodiments, when the database stress testing apparatus generates a compatibility test report corresponding to the compatibility test result, the database stress testing apparatus may store the compatibility test report.

[0114] S314: If a viewing instruction for the compatibility test report from the terminal is obtained, the compatibility test report is sent to the terminal.

[0115] According to some embodiments, when the database stress testing device generates a compatibility test report corresponding to the compatibility test result, the database stress testing device can detect whether a viewing instruction for the compatibility test report is obtained. If a viewing instruction for the compatibility test report is obtained from the terminal, the compatibility test report is sent to the terminal.

[0116] According to some embodiments, if the test execution result is consistent with the expected execution result corresponding to the test configuration information, it is determined that the compatibility test result corresponding to the database is a successful compatibility test, and the compatibility test report corresponding to the compatibility test result generated by the database stress testing device can be, for example, a compatibility test result for the database is a successful compatibility test. If the database stress testing device obtains a viewing instruction from the terminal for the compatibility test report, the database stress testing device can send the compatibility test report to the terminal. The terminal can display the compatibility test report, and an example schematic diagram of the terminal display interface can be as follows: Figure 8 shown.

[0117] According to some embodiments, Figure 9This is a time sequence interaction diagram of a database testing method provided by the embodiment of this specification. Figure 9 As shown, the terminal generates test configuration information for the database and sends the test configuration information to the database stress testing device. The database stress testing device can obtain the test configuration information sent by the terminal to the database and store the test configuration information. The terminal can obtain a compatibility test instruction for the database and send the compatibility test instruction to the database stress testing device. The database stress testing device can obtain a compatibility test instruction for the database and obtain the test configuration information corresponding to the database based on the compatibility test instruction. The database stress testing device sends the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, and obtains the test execution result corresponding to the test configuration information returned by the database via the test server. If the test execution result is consistent with the expected execution result corresponding to the test configuration information, the database stress testing device determines that the compatibility test result corresponding to the database is a successful compatibility test; if the test execution result is an error result, the database stress testing device determines that the compatibility test result corresponding to the database is a failed compatibility test. The database stress testing device can generate a compatibility test report corresponding to the compatibility test result. The terminal can send a viewing instruction for the compatibility test report to the database stress testing device. If the database stress testing device obtains a viewing instruction from the terminal for the compatibility test report, the database stress testing device may send the compatibility test report to the terminal.

[0118] In an embodiment of the present specification, the test configuration information sent by the terminal to the database is obtained, and the test configuration information is stored. When obtaining the compatibility test instruction for the database, the test configuration information corresponding to the database can be directly obtained based on the compatibility test instruction, without configuring the test configuration information. This can reduce the time required to obtain the test configuration information and improve the convenience of database compatibility testing. Secondly, the test configuration information is sent to the test server to which the database belongs based on the port identifier corresponding to the database, and the test execution result corresponding to the test configuration information returned by the database via the test server is obtained. If the test execution result is consistent with the expected execution result corresponding to the test configuration information, the compatibility test result corresponding to the database is determined to be a successful compatibility test. If the test execution result is an error result, the compatibility test result corresponding to the database is determined to be a failed compatibility test. Different test execution results correspond to different compatibility test results, which can improve the accuracy of determining database compatibility and thus improve the user experience. Finally, a compatibility test report corresponding to the compatibility test result can be generated. If the terminal obtains a viewing instruction for the compatibility test report, the compatibility test report is sent to the terminal. This can improve the convenience of the terminal in obtaining the display of the compatibility test report and improve the user experience.

[0119] The following will be combined with the Figure 10 -Attached Figure 13 , the database testing device provided in the embodiment of this specification is introduced in detail. Figure 10 -Attached Figure 13 The database test device in the embodiment may be the terminal in the embodiment described above, for executing the Figure 2-Figure 9 For the convenience of explanation, only the part related to the embodiment of this specification is shown. For the specific technical details not disclosed, please refer to this specification. Figure 2-Figure 9 The embodiment shown.

[0120] See Figure 10 , which shows a schematic diagram of the structure of a database testing device provided by an exemplary embodiment of this specification. The database testing device 1 can be implemented as all or part of a device through software, hardware, or a combination of both. The device 1 includes an instruction acquisition unit 11, an information transmission unit 12, and a result generation unit 13.

[0121] An instruction acquisition unit 11 is configured to acquire a compatibility test instruction for a database, and acquire test configuration information corresponding to the database based on the compatibility test instruction, wherein the test configuration information is used to execute the database and return a test execution result;

[0122] An information sending unit 12 is configured to send the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database, and obtain a test execution result corresponding to the test configuration information returned by the database via the test server;

[0123] The result generating unit 13 is configured to generate a compatibility test result corresponding to the database based on the test execution result.

[0124] According to some embodiments, the test configuration information includes a set of test statements and test configuration attributes;

[0125] The information sending unit 12 is used to send the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, and obtain the test execution result corresponding to the test configuration information returned by the database via the test server, specifically for:

[0126] Encapsulate the test statement set based on the test configuration attributes to obtain database test data. The test statement is the statement executed by the database. The test configuration attributes are used to set the execution mode of the test statement.

[0127] Send the database test data to the test server to which the database belongs based on the port identifier corresponding to the database;

[0128] Get the test execution results corresponding to the database test data returned by the database via the test server.

[0129] According to some embodiments, the test configuration attributes include statement configuration ratio information and an arrangement order of test statements in a test statement set;

[0130] The information sending unit 12 is used to encapsulate the test statement set based on the test configuration attributes to obtain database test data, specifically for:

[0131] Obtaining a first number of standard test statements and a second number of non-standard test statements from a test statement set based on the statement configuration ratio information, wherein the standard test statements are test statements supported by all databases, and the non-standard test statements are test statements customized for different databases;

[0132] Based on the arrangement order of each test statement in the test statement set, the standard test statements and non-standard test statements are encapsulated to obtain database test data.

[0133] According to some embodiments, Figure 11 This is a schematic diagram of the structure of a database testing device provided in an embodiment of this specification. Figure 11 As shown, the apparatus 1 further includes a thread determination unit 14, which is configured to determine a processing thread for testing the database from a thread set before sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database;

[0134] The processing thread is called and the step of sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database is executed.

[0135] According to some embodiments, the result generating unit 113 is configured to generate a compatibility test result corresponding to the database based on the test execution result, specifically to:

[0136] If the test execution result is consistent with the expected execution result corresponding to the test configuration information, then the compatibility test result corresponding to the database is determined to be successful;

[0137] If the test execution result is an error result, it is determined that the compatibility test result corresponding to the database is a compatibility test failure.

[0138] According to some embodiments, Figure 12 This is a schematic diagram of the structure of a database testing device provided in an embodiment of this specification. Figure 12 As shown, the apparatus 1 further includes a report sending unit 15, configured to generate a compatibility test report corresponding to the compatibility test result;

[0139] If a viewing instruction for the compatibility test report from the terminal is obtained, the compatibility test report is sent to the terminal.

[0140] According to some embodiments, Figure 13 This is a schematic diagram of the structure of a database testing device provided in an embodiment of this specification. Figure 13 As shown, the device 1 also includes an information storage unit 16, which is used to obtain the test configuration information sent by the terminal for the database and store the test configuration information before obtaining the compatibility test instruction for the database and obtaining the test configuration information corresponding to the database based on the compatibility test instruction.

[0141] In an embodiment of the present specification, the instruction acquisition unit can acquire a compatibility test instruction for a database, and acquire the test configuration information corresponding to the database based on the compatibility test instruction, wherein the test configuration information is used by the database to execute and return the test execution result; the information sending unit can send the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, and acquire the test execution result corresponding to the test configuration information returned by the database via the test server; the result generation unit can generate the compatibility test result corresponding to the database based on the test execution result. Therefore, when performing a compatibility test on a database, the test configuration information can be directly acquired without the need to configure the test configuration information, which can reduce the time required to acquire the test configuration information and improve the convenience of database compatibility testing. At the same time, the compatibility test result can be determined based on the test execution result corresponding to the test configuration information returned by the database via the test server, which can improve the accuracy of determining database compatibility and thereby improve the user experience.

[0142] Please refer to Figure 14 , which shows a block diagram of the database stress testing device provided in an embodiment of this specification. The database stress testing device in an embodiment of this specification may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected via bus 150.

[0143] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the database stress testing device. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, as well as accesses data stored in the memory 120, to perform various functions of the database stress testing device 100 and process data. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a CPU, a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interfaces, and applications; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communication chip.

[0144] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an iOS system developed by Apple, including a system deeply developed based on the iOS system or other systems.

[0145] The memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve better operating results, the operating system allocates corresponding system resources to different third-party applications. However, the requirements for system resources in different application scenarios in the same third-party application are also different. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the third-party application has higher requirements for GPU performance. The operating system and the third-party application are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenario of the third-party application.

[0146] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0147] The input device 130 is used to receive input commands or data and includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch-sensitive device. The output device 140 is used to output commands or data and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 may be a touch-sensitive display.

[0148] The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of this specification.

[0149] Furthermore, those skilled in the art will appreciate that the structure of the database stress testing device illustrated in the above figures does not limit the database stress testing device. The database stress testing device may include more or fewer components than illustrated, or may combine certain components or arrange the components differently. For example, the database stress testing device may also include a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module, and other components, which will not be described in detail here.

[0150] exist Figure 14 In the database stress testing device shown in FIG. 1 , the processor 110 can be used to call the database test application stored in the memory 120 and specifically execute the above-mentioned Figure 2-Figure 9The database testing method of the embodiment shown, the specific execution process can be found in Figure 2-Figure 9 The detailed description of the illustrated embodiment will not be repeated here.

[0151] The embodiment of this specification also provides a computer storage medium that can store multiple instructions, which are suitable for being loaded and executed by a processor as described above. Figure 2-Figure 9 The database testing method of the embodiment shown, the specific execution process can be found in Figure 2-Figure 9 The detailed description of the illustrated embodiment will not be repeated here.

[0152] This specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor as described above. Figure 2-Figure 9 The database testing method of the embodiment shown, the specific execution process can be found in Figure 2-Figure 9 The detailed description of the illustrated embodiment will not be repeated here.

[0153] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory, or a random access memory.

[0154] The above disclosure is only a preferred embodiment of this specification, and certainly cannot be used to limit the scope of rights of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.

[0155] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims

1. A database testing method, applied to a database stress testing device, comprising: Obtaining a compatibility test instruction for a database, and obtaining test configuration information corresponding to the database based on the compatibility test instruction, wherein the test configuration information is used for executing the database and returning a test execution result; Sending the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database, and obtaining a test execution result corresponding to the test configuration information returned by the database via the test server; Based on the test execution result, generating a compatibility test result corresponding to the database; The test configuration information includes a test statement set and a test configuration attribute; sending the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database, and obtaining a test execution result corresponding to the test configuration information returned by the database via the test server, includes: Encapsulating the test statement set based on the test configuration attributes to obtain database test data, wherein the test statements are statements executed by the database, and the test configuration attributes are used to set an execution mode of the test statements; Sending the database test data to the test server to which the database belongs based on the port identifier corresponding to the database; Obtaining a test execution result corresponding to the database test data returned by the database via the test server; The test configuration attributes include statement configuration ratio information and an arrangement order of each test statement in the test statement set; and the encapsulating the test statement set based on the test configuration attributes to obtain database test data includes: Obtaining a first number of standard test statements and a second number of non-standard test statements from the test statement set based on the statement configuration ratio information, wherein the standard test statements are test statements supported by all databases, and the non-standard test statements are test statements customized for different databases; Based on the arrangement order of each test statement in the test statement set, the standard test statement and the non-standard test statement are encapsulated to obtain database test data.

2. The method according to claim 1, before sending the test configuration information to the test server to which the database belongs based on the port identifier corresponding to the database, further comprising: Determine the processing thread used to test the database in the thread collection; The processing thread is called, and the step of sending the test configuration information to the test server to which the database belongs is executed based on the port identifier corresponding to the database.

3. The method according to claim 1, wherein generating a compatibility test result corresponding to the database based on the test execution result comprises: If the test execution result is consistent with the expected execution result corresponding to the test configuration information, then determining that the compatibility test result corresponding to the database is a compatibility test success; If the test execution result is an error result, it is determined that the compatibility test result corresponding to the database is a compatibility test failure.

4. The method according to claim 3, further comprising: Generate a compatibility test report corresponding to the compatibility test result; If a viewing instruction for the compatibility test report from the terminal is obtained, the compatibility test report is sent to the terminal.

5. The method according to claim 1, before obtaining a compatibility test instruction for a database and obtaining test configuration information corresponding to the database based on the compatibility test instruction, further comprising: Acquire test configuration information sent by the terminal to the database, and store the test configuration information.

6. A database testing device, comprising: An instruction acquisition unit, configured to acquire a compatibility test instruction for a database, and based on the compatibility test instruction, acquire test configuration information corresponding to the database, wherein the test configuration information is used for executing the database and returning a test execution result; an information sending unit, configured to send the test configuration information to a test server to which the database belongs based on a port identifier corresponding to the database, and obtain a test execution result corresponding to the test configuration information returned by the database via the test server; A result generating unit, configured to generate a compatibility test result corresponding to the database based on the test execution result; The test configuration information includes a test statement set and a test configuration attribute; the information sending unit is specifically configured to encapsulate the test statement set based on the test configuration attribute to obtain database test data, the test statement is a statement executed by the database, and the test configuration attribute is used to set an execution mode for the test statement; Sending the database test data to the test server to which the database belongs based on the port identifier corresponding to the database; Obtaining a test execution result corresponding to the database test data returned by the database via the test server; The test configuration attributes include statement configuration ratio information and an arrangement order of each test statement in the test statement set; the information sending unit is specifically configured to obtain a first number of standard test statements and a second number of non-standard test statements from the test statement set based on the statement configuration ratio information, wherein the standard test statements are test statements supported by all databases, and the non-standard test statements are test statements customized for different databases; Based on the arrangement order of each test statement in the test statement set, the standard test statement and the non-standard test statement are encapsulated to obtain database test data.

7. A database stress testing device, comprising: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Database grammar testing system, method, device and equipment and storage medium

    CN112948266A