[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN118051426A - Test method, test device and related equipment - Google Patents

Test method, test device and related equipment Download PDF

Info

Publication number
CN118051426A
CN118051426A CN202211674637.XA CN202211674637A CN118051426A CN 118051426 A CN118051426 A CN 118051426A CN 202211674637 A CN202211674637 A CN 202211674637A CN 118051426 A CN118051426 A CN 118051426A
Authority
CN
China
Prior art keywords
database system
database
statement
target
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211674637.XA
Other languages
Chinese (zh)
Inventor
刘志俊
窦德明
陈星虎
李威
杨春宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to PCT/CN2023/100114 priority Critical patent/WO2024098746A1/en
Publication of CN118051426A publication Critical patent/CN118051426A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a testing method, which comprises the following steps: the testing device acquires a database statement, such as an SQL statement, used for accessing a first database system in a service processing system, wherein the service processing system comprises service processing equipment and the first database system; the testing device executes database sentences in a second database system to obtain first operation data, and the second database system is used for replacing the first database system or adding the new database system in the service processing system, so that the testing device generates a testing result according to the first operation data. Therefore, the test case is not required to be constructed manually for test verification, so that the labor cost can be reduced, the test process is executed based on the database statement under the real service scene, the running condition of the new database system under the real service scene can be simulated, and the reliability of testing the new database system can be improved. In addition, the application also provides a corresponding device, equipment and a storage medium.

Description

Test method, test device and related equipment
The present application claims priority from China national intellectual property office, application number 202211406229.6, application name "a database system testing method, apparatus and related device", filed on 10-11-2022, the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of database technologies, and in particular, to a testing method, apparatus, and related devices.
Background
A database (database) refers to a warehouse that organizes, stores and manages data according to a data structure, which is particularly important for enterprises or other organizations, and a database system (database system) refers to a system composed of a database and its management software. Currently, enterprises often update database systems. For example, as cloud-native databases evolve, more and more businesses choose to move traditional database systems (e.g., oracle) to cloud database systems (e.g., gaussDB). For another example, the enterprise may upgrade a currently employed database system, such as upgrading a database system from version a to version B, etc. However, due to the difference between heterogeneous database systems or the difference between different versions of the same type of database system, the problems of data access errors or data read-write anomalies and the like easily occur when a new database system is accessed, so that the normal operation of enterprise business is affected.
In an actual application scenario, before updating a database system of an enterprise, a tester usually constructs a test case manually according to business logic, and tests and verifies a new database on the database system by using the test case so as to identify risks existing in updating the database system and repair the database system in time.
However, the manual testing of the new database system not only requires higher labor cost, but also can cause errors when accessing the new database system even if the newly deployed database system passes the test verification of the tester and completes the problem repair, thereby affecting the normal operation of the enterprise business.
Disclosure of Invention
In view of this, the embodiment of the application provides a testing method for improving the reliability of database system testing while reducing the testing cost. The application also provides a corresponding apparatus, a computing device cluster, a computer readable storage medium and a computer program product.
In a first aspect, an embodiment of the present application provides a test method, where the test method is applied to a test device, and specifically, the test device obtains a database statement, such as an SQL statement, in a service processing system, where the service processing system includes a service processing device and a first database system, where the database statement is sent by the service processing device to the first database system, and is used to access the first database system; the test device executes database sentences in a second database system to obtain first operation data, wherein the second database system is used for updating the database system in the service processing system, and specifically can be used for replacing the first database system in the service processing system or is used for newly adding the database system in the service processing system, so that the test device generates a test result aiming at the second database system according to the first operation data.
Because the database sentences sent to the first database system by the service processing equipment are used for testing when the new database system (namely the second database system) is tested, the test cases do not need to be constructed manually for test verification, the labor cost can be reduced, and the database sentences adopted by the new database system are tested and are the database sentences sent by the service processing equipment in the real service scene, so that the testing device can simulate the running condition of the new database system in the real service scene based on the testing process executed by the database sentences, the reliability of testing the new database system can be improved, and the influence on the normal running of the enterprise service after the database system is updated can be avoided as much as possible.
In one possible implementation manner, the test device may further obtain second operation data obtained by executing the database statement in the target database system, where the target database system is a first database system, or the target database system is a database system isomorphic to the first database, that is, an independent database system with the same type and version as the first database system, and before executing the database statement, the target database system and the second database system have the same data, for example, the target database system and the data in the second database system may be kept consistent by means of data synchronization before executing the database statement; thus, when the test device generates the test result for the second database system, the test device may specifically generate the test result for the second database system according to the first operation data and the second operation data. Therefore, the testing device can determine whether the performance of the second database system is lower than that of the target database system by comparing and analyzing the first operation data and the second operation data, and generate a testing result to realize performance testing of the second database system. Or the testing device can determine whether the results obtained by executing the database statement by the second database system and the target database system are consistent by comparing the first operation data with the second operation data, so as to realize the test of whether the semantics or grammar of the same database statement in the database system and the target database system are consistent.
In one possible implementation, the database statement includes a read data statement for reading data stored in the first database system; when the test device executes the database statement in the second database system, the test device specifically may amplify the number of the read data statement to obtain an extended database statement; then, the testing device executes the database statement and the extended database statement in the second database system to obtain the first operation data. Thus, the testing device can test the maximum pressure condition which can be born by the second database system by executing a larger number of database sentences in the second database system.
In one possible implementation, the database statement is a statement that the service processing device sends to the first database system within a first time period; when the test device executes the database statement in the second database system, the test device may specifically execute the database statement in the second database system in a second time period, so as to obtain the first operation data, where the duration of the second time period is less than the duration of the first time period. Therefore, the testing device can be used for simulating and increasing the flow of the read-write data of the second database system in the real service scene by compressing the time length of executing all database sentences by the second database system, so that the maximum pressure condition which can be born by the database system is tested.
In one possible implementation manner, the target database system is a database system isomorphic to the second database system, and when the test device executes the database statement in the second database system, the test device may specifically execute the database statement in the second database system after executing the database statement in the target database system, so as to obtain the first operation data; accordingly, the generated test results are used to indicate data consistency between the target database system and the second database system after the database statement is executed. Thus, whether the semantics or grammar of the same database statement in the second database system is consistent with those of the target database system can be tested by comparing whether the data results obtained by executing the database statement in the target database system with those obtained by executing the database statement in the second database system are consistent with each other.
In one possible embodiment, the test device may further determine reference data in the first database system and synchronize the reference data to the target database system and the second database system, respectively, before executing the database statement. Therefore, the data synchronization between the target database system and the second database system can be realized, so that whether the data results obtained by executing the database statement by the target database system and the second database system are consistent or not can be tested under the condition that the target database system and the second database system store the same data, and whether the semantics or grammar of the same database statement in the second database system and the target database system are consistent or not can be tested.
In one possible implementation manner, when the testing device obtains the database statement in the service processing system, the flow between the service processing device and the first database system may be recorded, where the flow includes the database statement. Therefore, the testing device can acquire the database statement under the real service scene in a flow recording mode, so that the second database system can be tested by using the database statement under the real service scene.
In one possible implementation, traffic between the service processing device and the first database system is recorded by a proxy component that is deployed on the first database system or that is deployed independent of the first database system. Thus, the database statement under the real service scene can be obtained by deploying the proxy component.
In one possible implementation, the target database system is a cloud database system. Therefore, when the database of the enterprise migrates to the cloud, the test of the cloud database system can be realized.
In one possible implementation, the target database system and the second database system are different versions of the same type of database system; or the target database system and the second database system are different types of database systems. Thus, universality and expansibility of the test database system can be improved.
In a second aspect, the embodiment of the present application further provides a test method, where the test method is executed by a corresponding test device, and specifically, the test device determines a target interface, where the target interface is used to call an object to be updated in a target system, and the object may be an object such as a database system; and then, the testing device calls a target object by using the call record of the target interface to obtain operation data, wherein the target object is used for replacing an object to be updated in the target system or is used for adding an object newly in the target system, so that the testing device generates a testing result aiming at the target object according to the operation data. When a new object (namely a target object) is tested, the call record of the object to be updated is actually called for testing, and the test case is not required to be constructed manually for testing and verifying, so that the labor cost can be reduced, and the call record adopted for testing the new object is the call record in the target system in the real service scene, so that the testing device can simulate the running condition of the new object in the real service scene based on the test process executed by the call record, thereby improving the reliability of testing the new object and avoiding affecting the normal running of the service after the object is updated in the target system as much as possible.
In a third aspect, an embodiment of the present application further provides a testing device, where the testing device includes: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring database sentences in a service processing system, the service processing system comprises service processing equipment and a first database system, the database sentences are sent to the first database system by the service processing equipment, and the database sentences are used for accessing the first database system; the test module is used for executing the database statement in a second database system to obtain first operation data, wherein the second database system is used for replacing the first database system in the service processing system or the second database system is used for newly adding the database system in the service processing system; and the generating module is used for generating a test result aiming at the second database system according to the first operation data.
In a possible implementation manner, the obtaining module is further configured to obtain second operation data obtained by executing the database statement in a target database system, where the target database system is the first database system, or the target database system is a database system isomorphic to the first database, and before executing the database statement, the target database system and the second database system have the same data; the generating module is specifically configured to generate a test result for the second database system according to the first operation data and the second operation data.
In one possible implementation, the database statement includes a read data statement for reading data stored in the first database system; the test module is specifically configured to: performing quantity amplification on the read data sentences to obtain extended database sentences; and executing the database statement and the extended database statement in the second database system to obtain the first operation data.
In a possible implementation manner, the database statement is a statement that the service processing device sends to the first database system in a first period of time; the test module is specifically configured to execute the database statement in the second database system in a second time period, so as to obtain the first operation data, where a duration of the second time period is less than a duration of the first time period.
In one possible implementation, the target database system is a database system that is isomorphic with the second database system; the test module is specifically configured to execute the database statement in the second database system after executing the database statement in the target database system, so as to obtain the first operation data; the test result is used to indicate data consistency between the target database system and the second database system after the database statement is executed.
In a possible implementation manner, the test module is further configured to: determining reference data in the first database system prior to executing the database statement; and synchronizing the reference data to the target database system and the second database system respectively.
In a possible implementation manner, the obtaining module is specifically configured to record a flow between the service processing device and the first database system, where the flow includes the database statement.
In one possible implementation, the traffic between the service processing device and the first database system is recorded by a proxy component, where the proxy component is deployed on the first database system or where the proxy component is deployed independent of the first database system.
In one possible implementation, the target database system is a cloud database system.
In one possible implementation, the target database system and the second database system are different versions of the same type of database system; or the target database system and the second database system are different types of database systems.
It is noted that the test device provided in the third aspect corresponds to the test method provided in the first aspect, so the technical effects of the third aspect and any implementation manners of the third aspect may be referred to the technical effects of the first aspect or the corresponding implementation manners of the first aspect.
In a fourth aspect, the present application provides a test apparatus comprising: the acquisition module is used for determining a target interface, and the target interface is used for calling an object to be updated in a target system; the test module is used for calling a target object by using the calling record of the target interface to obtain operation data, wherein the target object is used for replacing an object to be updated in the target system or is used for adding an object newly in the target system; and the generating module is used for generating a test result aiming at the target object according to the operation data.
It is noted that, the test device provided in the fourth aspect corresponds to the test method provided in the second aspect, so the technical effects of the embodiment of the fourth aspect can be seen from the technical effects of the embodiment of the second aspect.
In a fifth aspect, the present application provides a cluster of computing devices, the computing devices comprising at least one computing device, the at least one computing device comprising at least one processor and at least one memory; the at least one memory is configured to store instructions that the at least one processor executes to cause the cluster of computing devices to perform the test method of the first aspect, or the second aspect, or any one of the possible implementations of the first aspect. It should be noted that the memory may be integrated into the processor or may be independent of the processor. The at least one computing device may also include a bus. The processor is connected with the memory through a bus. The memory may include a readable memory and a random access memory, among others.
In a sixth aspect, the present application provides a computer readable storage medium having instructions stored therein which, when run on at least one computing device, cause the at least one computing device to perform the method of the first aspect, or the second aspect, or any implementation of the first aspect, above.
In a seventh aspect, the present application provides a computer program product comprising instructions which, when run on at least one computing device, cause the at least one computing device to perform the method of the first aspect, or the second aspect, or any implementation of the first aspect, above.
Further combinations of the present application may be made to provide further implementations based on the implementations provided in the above aspects.
Drawings
FIG. 1 is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application;
fig. 2 is a schematic diagram of another exemplary application scenario provided in an embodiment of the present application;
FIG. 3 is a schematic flow chart of a testing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a configuration interface according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an interactive interface according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a computing device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computing device cluster according to an embodiment of the present application.
Detailed Description
The embodiments of the present application will be described below with reference to the drawings.
In a practical application scenario, it is often necessary to update a database system used by an enterprise. For example, a conventional database system (e.g., oracle, etc.) used by the enterprise may be migrated to a cloud database system (e.g., gaussDB), or a version upgrade may be performed on the database system used by the enterprise (which may be a conventional database system or a cloud database system). Because there is a difference between the two database systems before and after updating, such as the meaning or grammar incompatibility of the database sentences (such as SQL sentences, etc.), the same database sentence is easy to generate an error when being executed in the updated database system, or the performance difference of the same database sentence in the database systems before and after updating is larger, thereby influencing the operation of the enterprise business, such as reducing the concurrency of the enterprise business, or causing the paralysis of the enterprise business, etc.
At present, in the process of updating a database system used by an enterprise, a tester usually constructs a test case in advance according to service logic, and performs one or more rounds of test verification on a new database system by using the test case to detect and identify problems existing in the updated database system, so that after the database system is correspondingly maintained according to a test result, the new database system can be used for supporting the enterprise to continue to operate the service.
The scheme for testing the database by using the artificially constructed test cases depends on the technical capability of testers, the understanding degree of the service and the completeness degree of the constructed test cases, and not only has higher requirements on the technical level of the testers and the completeness degree of the test cases, but also has higher labor cost. In addition, the artificially constructed test cases are easy to deviate from the actual application scene of the service, for example, the scene (such as deadlock, etc.) in which part of the service actually exists is difficult to be constructed manually, so that the completeness of the constructed test cases is uncontrollable, and the reliability of the test database is lower by utilizing the test cases. Therefore, in the actual application scenario, when the business of the enterprise accesses the new database system verified by the test case, the problems of access errors and the like still occur frequently.
Based on the above, the embodiment of the application provides a testing method for improving the reliability of testing and verifying a new database system. In particular, the method may be executed by a testing device, and in the process of testing the second database system (i.e. the new database system), the testing device may first obtain a database statement in the service processing system, that is, a database statement sent by the service processing device in the service processing system to the first database system, where the database statement is typically used to access the first database system, and in particular, read and write data to the first database system; then, the test device executes the database statement in the second database system to obtain operation data, and the second database system is used for updating the database system in the service processing system, specifically, the first database system in the service processing system is replaced, or the database system is newly added in the service processing system, so that the test device generates a test result aiming at the second database system according to the operation data.
Because the second database system is tested by using the database statement sent to the first database system by the service processing equipment, the test case is not required to be constructed manually for test verification, and the labor cost can be reduced.
Moreover, the database statement adopted by the second database system is tested and is the database statement sent by the service processing equipment in the real service scene, so that the running condition of the second database system in the real service scene can be simulated based on the test process executed by the database statement, the reliability of testing the second database system can be improved, and the influence on the normal running of the enterprise service after the database system in the service processing system is updated is avoided as much as possible.
As an example, the testing device may be deployed in a cloud for providing cloud services for users/tenants to test a new database system. For example, in the application scenario shown in fig. 1, the testing apparatus 100 is deployed in a cloud, such as public cloud, private cloud, edge cloud, and the like, and may be implemented by a computing device or a computing device cluster in the cloud, so as to provide a cloud service for testing a new database system for the service processing system 200.
As shown in fig. 1, the service processing system 200 includes a service processing device 201 and a database system 202, where service data of a tenant 301 is stored in a persistent manner in the database system 202, and the database system 202 may be deployed locally or in a cloud. The service processing device 201 is configured to respond to a request sent by the tenant 301 through the client 302 to read and write data, generate a corresponding database statement based on the request, and send the database statement to the database system 202, so as to write new data into the database system 202, or read new data from the database system 202, or the like.
The test apparatus 100 may include an acquisition module 101, a test module 102, and a generation module 103. The acquiring module 101 is configured to acquire information, specifically, acquire a database statement sent by the service processing device 201 to the database system 202, and provide the database statement to the test module 102. The test module 102 is configured to execute a database statement in the database system 1021 to obtain operation data, where the database system 1021 is configured to update a database system in the service processing system 200, for example, the database system 1021 may be used to replace the database system 202, or the database system 1021 may be newly added to the service processing system 200; the test module 102 then provides the resulting operational data to the generation module 103. The generating module 103 generates a test result according to the operation data, where the test result is used to indicate a test condition for the database system 1021, such as indicating concurrency performance of the database system 1021, whether to identify a database statement, execution efficiency for the database statement, and so on, so that an operator can deploy or operate the database system 1021 based on the test result. Further, the testing device 100 may further include other functional modules, such as a presenting module, a configuration module, etc., where the presenting module may be used to present the generated testing result to the operation and maintenance personnel; the configuration module is configured to perform corresponding configuration on the testing process of the testing apparatus 100, for example, the configuration testing module 102 executes database statements in the database system 1021 through one or more modes such as a simulation mode, a touch-up mode, a consistency mode, and the like.
As another example, the testing device described above may be deployed locally, so that a user/tenant may be provided with local services for testing the new database. For example, in the application scenario shown in fig. 2, the testing apparatus 100 may be deployed together with the service processing system 200 on the local side of the user, so that when the service processing system 200 needs to update the database, the testing apparatus 100 may provide a service for testing a new database for the service processing system 200 locally.
In an actual application scenario, the database system 1021 is implemented by hardware, for example, may be implemented by a database server or other form of hardware device.
The test apparatus 100 may be implemented by software or may be implemented by hardware.
Test apparatus 100 may include code running on a computing instance as an example of a software functional unit. Wherein the computing instance may include at least one of a host, a virtual machine, and a container. Further, the above-described computing examples may be one or more. For example, the test apparatus 100 may include code running on multiple hosts/virtual machines/containers. It should be noted that, multiple hosts/virtual machines/containers for running the code may be distributed in the same region (region), or may be distributed in different regions. Further, multiple hosts/virtual machines/containers for running the code may be distributed in the same availability zone (availability zone, AZ) or may be distributed in different AZs, each AZ comprising one data center or multiple geographically close data centers. Wherein typically a region may comprise a plurality of AZs.
Also, multiple hosts/virtual machines/containers for running the code may be distributed in the same virtual private cloud (virtual private cloud, VPC) or may be distributed in multiple VPCs. In general, one VPC is disposed in one region, and a communication gateway is disposed in each VPC for implementing inter-connection between VPCs in the same region and between VPCs in different regions.
Test apparatus 100 as an example of a hardware functional unit, test apparatus 100 may include at least one computing device, such as a server or the like. Alternatively, the test apparatus 100 may be a device implemented using an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or the like. The PLD may be implemented as a complex program logic device (complex programmable logical device, CPLD), a field-programmable gate array (FPGA) GATE ARRAY, a general-purpose array logic (GENERIC ARRAY logic, GAL), or any combination thereof.
The multiple computing devices included in the test apparatus 100 may be distributed in the same region or may be distributed in different regions. The plurality of computing devices included in the test apparatus 100 may be distributed in the same AZ or may be distributed in different AZ. Likewise, the plurality of computing devices included in the test apparatus 100 may be distributed in the same VPC or may be distributed in a plurality of VPCs. The plurality of computing devices may be any combination of computing devices such as servers, ASIC, PLD, CPLD, FPGA, and GAL.
Next, various non-limiting embodiments of the testing process are described in detail.
Referring to fig. 3, a flow chart of a testing method according to an embodiment of the application is shown. The method can be applied to the application scenario shown in fig. 1 or fig. 2, or can be applied to other applicable application scenarios. For ease of understanding, the following description will be given by taking an application scenario as shown in fig. 1 as an example. The test method shown in fig. 3 specifically may include:
S301: the acquisition module 101 acquires a database statement in the service processing system 200, the service processing system 200 comprising a service processing device 201 and a database system 202, the database statement being sent by the service processing device 201 to the database system 202 and the database statement being used for accessing the database system 202.
In this embodiment, the service processing system 200 may provide a service of reading and writing data for the tenant 301. In particular implementations, tenant 301 may send an access request to business processing system 200 via client 302 for reading data stored in business processing system 200 or for writing new data into business processing system 200. At this time, the service processing apparatus 201 may generate a database statement, such as an SQL statement or the like, for the received access request, and transmit the database statement to the database system 202 so as to access the database system 202 using the database statement. Typically, the database system 202 may perform semantic and grammatical analysis on the database statement to determine the validity of the database statement. Wherein, the grammar analysis means that whether grammar errors exist in the database statement is checked by utilizing grammar rules of the database language; semantic analysis refers to analyzing whether the semantics of the database statement are legal. After passing the validity check, database system 202 may generate a planning tree for the database statement, the planning tree indicating an execution plan for processing the data. Finally, after the database system 202 completes the optimization of the planning tree, a corresponding data reading and writing process is implemented in the database system 202 according to the optimized planning tree.
When the database system in the service processing system 200 needs to be updated, for example, the database system 202 is replaced by the database system 1021, or a new database system 1021 is added in the service processing system 200, because there is a general difference between the database system 202 that can be adapted by the service processing device 201 and the new database system 1021, the testing apparatus 100 may collect a database statement received by the database system 202 in a real service scenario, so as to test the new database system 1021 by using the database statement.
In one implementation manner of obtaining database sentences, the obtaining module 101 may obtain database sentences in a real service scenario by using a flow recording manner. Specifically, the obtaining module 101 may record the traffic between the service processing device 201 and the database system 202, so that the obtaining module 101 may parse the database statement sent by the service processing device 201 to the database system 202 from the recorded traffic.
Illustratively, the acquiring module 101 may locate a port on the database system 202 for receiving a data packet sent by the service processing device 201, and copy the data packet when the database system 202 receives the data packet using the port (the original data packet is used for the database system 202 to normally provide the service). The obtaining module 101 may then parse the replicated data packet according to a communication protocol between the service processing device 201 and the database system 202, such as a transmission control protocol/internet protocol (Transmission Control Protocol/Internet Protocol, TCP/IP), to obtain a database statement carried in the data packet. In practical application, the obtaining module 101 may parse out, in addition to the database statement from the data packet, other information, such as one or more of a type of a database to be accessed, a database account number, a database session connection identifier, a type of a client accessing the database, a type of the database statement, a value of a binding variable, an execution start time, an execution end time of the database statement, parameters (such as a reference) in a storage process, and the like, and store the parsed information, such as a file format such as json, a message format such as Kafka, or a data format such as elastic search. Therefore, only the communication protocol adopted by the database system is needed to be known, and the database statement sent to the database system can be obtained by analyzing the data packet, so that the universality of the database system to be tested can be improved.
The acquiring module 101 may record the traffic between the service processing device 201 and the database system 202 through a agent component, where the agent component may be deployed in an invasive deployment or a non-invasive deployment.
When the invasive deployment is adopted, the agent component is deployed in the database system 202, for example, that is, the agent component can be deployed with the database system in the same machine, which has the advantages of lower deployment difficulty and no need of additional equipment resources.
When a non-invasive deployment is employed, the agent component is deployed separately from the database system 202, e.g., the agent component is deployed on a server separate from the database system 202. In this way, by configuring port mirroring on a switch in the network for transmitting data packets, traffic sent to database system 202 is replicated to a device where a agent component is located, so that traffic replicated to the device can be collected by the agent component. The advantage of this deployment is that the agent component does not need to use the computing power of the database system 202 in recording traffic, so that the traffic recording process can not interfere with the performance of the database system 202.
Further, the obtaining module 101 may further filter the parsed database statement according to the needs of the practical application. For example, when only database statements of the database account are concerned, the obtaining module 101 may filter database statements belonging to other database accounts. Alternatively, the obtaining module 101 may filter the database statement according to the information such as the client type, the type to which the database statement belongs, and the execution time range, which is not limited in this embodiment.
It should be noted that, the embodiments for obtaining the database statement described above are merely described as some implementation examples, and the implementation process of obtaining the database statement by the obtaining module 101 is not limited in this embodiment. For example, in other possible embodiments, a corresponding log, such as a full log, an audit log, etc., is generated when the service processing device 201 communicates with the database system 202, so that the obtaining module 101 may also parse the database statement sent by the service processing device 201 to the database system 202 from the log.
After acquiring the database statement, the acquiring module 101 may send the database statement to the testing module 102. Wherein the database statements provided to test module 102 may include one or more statements.
S302: the test module 102 executes the database statement in the database system 1021 to obtain the first operation data, where the database system 1021 is used to replace the database system 202 in the service processing system 200, or where the database system 1021 is used to add a new database system in the service processing system 200.
S303: the generating module 103 generates a test result for the database system 1021 according to the first operation data.
Wherein database system 1021 may be used to replace database system 202; or a new database system may be added to service processing system 200, where both database system 202 and database system 1021 may be running in service processing system 200. In the present embodiment, the implementation of updating the database system in the service processing system 200 with the database system 1021 is not limited.
Since the database statement provided by the obtaining module 101 is a database statement sent by the service processing device 201 to the data processing system 202, that is, a database statement in a real service scenario, the testing module 102 uses the database statement to test a new database system, so that a test scenario matched with the real service scenario can be simulated for the database system 1021.
In a first implementation example, the test module 102 may play back the database statement in the database system 1021, thereby simulating an operation of the database system 1021 under the same pressure as the database system 202, and collecting first operation data of the database system 1021 during playback of the database statement. The first operation data may indicate whether the database system 1021 recognizes the database statement, or the first operation data may indicate a result obtained by executing the database statement if the database system 1021 is able to recognize the database statement, or the first operation data may indicate time consumption, load generated, and the like information required by the database system 1021 to execute the database statement.
The test module 102 then provides the first operational data to the generation module 103. In this way, the generating module 103 may generate a test result for the database system 1021 according to the first operation data.
For example, when the compatibility of the database system 1021 with respect to the database statement sent by the service processing device 201 is tested, if the first operation data indicates that the database system 1021 does not recognize the database statement, the test result generated by the generating module 103 may indicate that the test is not passed, that is, it means that after the database system 1021 is updated to the service processing system 200, the database statement sent by the service processing device 201 to the database system 1021 cannot be recognized and executed, so that normal processing of the service by the service processing system 200 may be affected.
For another example, when the first running data indicates that the database system 1021 executes the result output by the database statement in the case of identifying the database statement, the test result generated by the generating module 103 may indicate that the test is passed, and indicate the execution result (such as the result of success or failure of execution, parameter output, etc.) output by the database system 1021, or indicate whether the execution result meets the expectations.
For another example, when the first running data indicates that the database system 1021 needs time consuming and load generating information, the test result generated by the generating module 103 may indicate that the performance of the database system 1021 is high or low, for example, when the time consuming and load generating information is high or the load generating information is high, the test result indicates that the performance of the database system 1021 is low; the test results indicate that the performance of the database system 1021 is higher, etc., when the time consuming execution of the database statement is lower or the load is less.
When the test target is to test the performance or the execution result of the database system 1021 when executing the database sentence, since there is a difference between the database system 1021 and the database system 202 in terms of the grammar of the database sentence or the way of executing the database sentence, before executing the database sentence, the test module 102 may parse the database sentence by using the parser to obtain the grammar tree corresponding to the database sentence. The test module 102 may then convert the database statement according to the grammar criteria applicable to the database system 1021, e.g., convert a function in the database statement to a function that matches the database system 1021, etc., to generate a database statement that can be applied to the grammar of the database system 1021, so that the database system 1021 can perform the corresponding operation indicated by the database statement based on the grammar-converted database statement. The test module 102 may also determine the type of the database statement according to the syntax tree, and select a corresponding manner to execute the database statement in the database system 1021 according to the type of the database statement. Typically, different types of database statements are executed in different ways, such as executeUpdate methods requiring the use of Java database connections (Java database connectivity, JDBC) for database statements of the data manipulation statement (data manipulation language, DML) type, startTransaction interfaces for database statements of the start (begin) type, commit interfaces for database statements of the commit (commit) type, etc. When the grammar conversion for a database statement fails (e.g., the corresponding grammar is not supported in database system 1021, etc.), the database statement may not need to be replayed; the test module 102 may record the database statement into an exception record table so that the overall test condition, such as the success rate of statistically replaying the database statement, is known based on the entries in the exception record table.
Further, the database system 1021 may have stored therein data in advance before executing the database statement, which may be consistent with, for example, reference data stored in the database system 202, which may be specifically data stored by the database system 202 at a certain time. Illustratively, the test apparatus 100 may synchronize the reference data stored in the database system 202 into the database system 1021 in advance so that the database system 1021 executes the database statement based on the synchronized data. Or the data stored in the database system 1021 may be provided and configured by the tenant 301 or tester in advance.
In the above implementation example, the test apparatus 100 may test the compatibility of the database system 1021 with respect to the database statement, and in other implementation examples, the test apparatus 100 may also perform the stress test on the database system 1021.
Specifically, in the second implementation example, the database statement sent by the service processing apparatus 201 to the database system 202 includes a read data statement for reading data stored in the database system 202. In this way, after the test module 102 obtains the database statement, the number of read data statements in the database statement may be amplified (i.e. the read flow is amplified), and for the amplified read data statement, the amplified read data statement is hereinafter referred to as an extended database statement, so that the test module 102 may execute not only the database statement but also the extended database statement in the database system 102, thereby obtaining the first operation data. When the number of the read data sentences is amplified, the amplification can be performed according to a preset proportion, for example, the number of the read data sentences is amplified to 1.5 times or 2 times of the original number, and the like. Thus, by executing a greater number of database statements in the database system 1021, the maximum pressure conditions that the database system 1021 can withstand can be tested.
Or the database statement provided by the obtaining module 101 is a statement that the service processing device 201 sends to the database system 202 in a first period of time (for example, 1 hour, etc.), when the database system 1021 executes the database statement, the test module 102 may complete execution of all database statements in a second period of time, so as to obtain the first operation data, where the duration of the second period of time is less than that of the first period of time. That is, the test module 102 can be used to simulate and increase the flow of the read-write data of the database system 1021 in the real service scenario by compressing the duration of executing all database sentences by the database system 1021, so as to test the maximum pressure situation that the database system 1021 can bear.
In the first and second implementation examples, the generating module 103 may generate the test result only according to the first operation data generated by the database system 1021 executing the database statement. In other implementation examples, the generation module 103 may generate test results for the database system 1021 by comparing the operational data generated by the execution of the database statement by multiple database systems.
In this embodiment, a third implementation example is also provided:
The acquiring module 101 may acquire not only the first operation data, but also second operation data obtained by executing the database statement in the target database system, where the second operation data may be used to indicate a result obtained by executing the database statement in the target database system, or may be used to indicate time-consuming, load-generating, and the like information required for executing the database statement in the target database system. The target database system may be the database system 202, or may be a database system that is isomorphic to the database system 202, such as a database system of the same version that is of the same type as the database system 202. The acquisition module 101 may then provide the acquired second operational data to the generation module 103.
In this way, the generating module 103 may generate a test result for the database system 1021 according to the acquired second operation data and the first operation data. For example, when the operation data indicates the time consuming or load generated by the database system for executing the database statement, the generating module 103 may determine whether the performance of the database system 1021 is lower than the performance of the target database system by comparing and analyzing the first operation data with the second operation data, and generate a test result according to the determination result, so as to implement the performance test on the database system 1021. For another example, when the operation data indicates a result obtained when the database system executes the database statement, the generating module 103 may determine whether the result obtained when the database system 1021 executes the database statement is consistent with the result obtained when the target database system executes the database statement by comparing the first operation data with the second operation data, and generate a test result according to the result, so as to realize whether the semantics or grammar of the same database statement in the database system 1021 and the target database system are consistent.
Specifically, based on the target database system and the database system 1021, the following test modes are provided in this embodiment, respectively: simulation mode and consistency mode.
The test apparatus 100 may synchronize the target database system with the database system 1021 in advance before executing the database statement. For example, the test apparatus 100 may backup the reference data in the database system 202 to the target database system, and then generate the reference data applicable to the database system 1021 based on the reference data in the target database system, for example, generate the reference data applicable to the B format of the database system 1021 based on the reference data of the a format in the target database system, and so on, so as to store the generated reference data in the database system 1021. In practical applications, the test apparatus 100 may synchronize the reference data in the database system 202 with the target database system and the database system 1021 respectively by means of data import and export or by using a data synchronization tool.
In the simulation mode, the target database system may be a database system that is isomorphic with the database system 202, so that the test module 102 may instruct the database system 1021 and the target database system to obtain the first operation data corresponding to the database system 1021 and the second operation data corresponding to the target database system based on playing back the database statements respectively. In this process, the database system 1021 and the target database system may execute the database statement simultaneously (i.e., play back the database statement multiple times concurrently). Thus, the generating module 103 may verify the performance difference of the database system 1021 with respect to the target database system (or with respect to the database system 202) under the same service pressure by analyzing the first operation data and the second operation data, and generate a test result indicating the performance difference between the two database systems. For example, the generating module 103 may determine, according to the first operation data and the second operation data, an execution duration of the target data system and the database system 1021 for executing the same database statement, so as to serve as a performance difference between the two database systems according to a difference of the execution durations, and generate a test result according to the performance difference. Or the generating module 103 may determine, according to the first operation data and the second operation data, a load generated by the target data system and the database system 1021 when executing the same database statement, where the load may be represented by a CPU utilization rate, a memory occupancy rate, and the like, so that the generating module 103 may determine, by comparing the load sizes of the two database systems, a performance difference between the two database systems, and generate a test result according to the performance difference.
In other implementations, the target database system may also be database system 202. At this time, the test apparatus 100 can also verify the performance operation difference of the database system 1021 with respect to the database system 202 under the same service pressure in a similar manner as described above.
In the consistency mode, the test module 102 executes the same database statement in the target database system as well as the database system 1021 in a single concurrent manner. Specifically, for a database statement, the test module 102 may execute the database statement in the target database system first, and after the execution is successful, execute the database statement in the database system 1021. In this way, it can be ensured that the order in which the target database system and the database system 1021 play back the plurality of database statements, respectively, remains consistent. Since the target database system and the database system 1021 store the same data before executing the database statement, by executing the database statement in a single concurrent manner, whether the semantics of the database statement in the target database system and the database system 1021 are consistent can be analyzed by checking whether the data stored by the target database system and the database system 1021 after playing back the database statement are consistent. At this time, the test results generated by the generation module 103 may be used to indicate data consistency between the target database system and the database system 1021 after the database statement is executed.
In practical application, in the consistency mode, except for playing back the database sentences in a single concurrent mode, the target database system and the database system 1021 can be deployed in the same operation environment, so as to avoid the influence of the difference of the operation environments on the data consistency between the target database system and the database system 1021. And, non-idempotent type database statements (e.g., non-idempotent SQL) may be excluded from the database statements played back in the target database system and database system 1021. For database sentences of non-idempotent types, the results of multiple execution in the same database system will be different, and typically the database sentences comprise functions related to environments, such as a now function, a random function and the like. Accordingly, for database statements of the idempotent type, the result of their execution in the same database system is the same, as for database statements: insert into table1 values (1), whenever it is executed, the result of the execution is to insert a piece of data with value 1 into table 1.
In practical application, the testing device 100 can select a corresponding implementation mode or a corresponding testing mode according to testing requirements, and execute a testing process on the database system 1021, so that requirements of various service testing scenes can be met, and the diversity and flexibility of testing schemes are improved. Alternatively, the testing apparatus 100 may select a corresponding testing mode to test the database system 1021 according to the configuration of the tenant 301. For example, the test apparatus 100 may generate a configuration interface as shown in fig. 4, in which a plurality of test modes may be defined, such as a standard mode (for testing compatibility of the database system 1021 for one or more database statements), a simulation mode (for testing performance of the database system 1021), a fumbly mode (for testing maximum pressure conditions that the database system 1021 can withstand), a consistency mode (for testing semantic conditions of the database system 1021 for the database statements), and present the configuration interface to the tenant 301 through the client 302, as shown in fig. 4. In this way, tenant 301 may select from among the plurality of test patterns presented on client 302, such that test apparatus 100 may perform a test procedure for database system 1021 according to the test pattern selected by tenant 301.
It should be noted that the above various implementations are only exemplary, and are not intended to limit the specific process of testing database system 1021 by test apparatus 100. For example, in other possible implementations, the testing apparatus 100 may also be configured to perform the testing process on the database system 1021 by combining the various implementation examples described above.
Further, after the test device 100 generates the test result, the test result may be fed back to the tenant 301, so that the tenant 301 knows the performance of the database system 1021, or the compatibility of the database system 1021 with the database statements sent by the service processing device 201, so as to determine whether to update the database system in the service processing system 200 with the database system 1021. For example, when test results characterize database system 1021 as unsuitable for replacing database system 202, tenant 301 may select other types or versions of database systems to replace database system 202.
Illustratively, after generating the test results, the testing apparatus 100 may generate an interactive interface as shown in fig. 5, and output the interactive interface to the client 302, so as to present the interactive interface to the tenant 301 on the client 302. As shown in FIG. 5, the interactive interface may be presented with test results for database system 1021, including conclusions as to whether the test passed or not, and also including detailed data collected or generated during the test. As shown in fig. 5, information such as the number of database statements executed by the database system 1021, the execution time required to execute the database statements, the size of the load generated, and the like may also be presented on the interactive interface, so that the tenant 301 knows the database system 1021 in more detail based on the presented information, thereby helping the tenant 301 determine whether to update the database system in the service processing system with the database system 1021.
In the embodiment shown in fig. 3 above, the test procedure for the database system is mainly described, and based on the similar concept, the test procedure for other objects than the database system can be implemented. For example, in other possible embodiments, the objects to be tested may also be components, devices, or clusters, etc. in a certain system (hereinafter referred to as a target system), and calls to these objects may be implemented using the corresponding interfaces. Therefore, when the object to be updated in the target system needs to be updated, the testing device can determine the target interface used for calling the object to be updated, call the target object by using the call record of the target interface, and collect the operation data in the process of calling the target object, where the target object is used for updating the object to be updated in the target system, for example, the object to be updated in the target system can be replaced, or the target object can be newly added in the target system, etc., so that the testing device can generate the testing result for the target object according to the operation data. Since the test target object and the test database system 1021 are based on the same inventive concept, the specific implementation of the test target object may be described with reference to the relevant points of the above embodiments, which are not described herein.
It should be noted that, in the present embodiment, the division and the functional description of each module in the test apparatus 100 are only examples. For example, in other embodiments, the acquiring module 101 may be configured to perform any step in the above-mentioned testing method, and similarly, the testing module 102 and the generating module 103 may be configured to perform any step in the above-mentioned testing method, and the steps that the acquiring module 101, the testing module 102 and the generating module 103 are responsible for implementing may be specified as needed, and all the functions of the testing apparatus 100 are implemented by implementing different steps in the testing method by the acquiring module 101, the testing module 102 and the generating module 103 respectively.
In the embodiment shown in fig. 3, the test apparatus 100 (including the acquisition module 101, the test module 102, and the generation module 103) involved in the test process may be software configured on a computing device or a computing device cluster, and by running the software on the computing device or the computing device cluster, the computing device or the computing device cluster may implement the functions of the test apparatus 100. The test apparatus 100 involved in the test process will be described in detail below based on the hardware device implementation angle.
Fig. 6 shows a schematic structural diagram of a computing device, where the test apparatus 100 may be deployed, and the computing device may be a computing device (such as a server) in a cloud environment, or a computing device in an edge environment, or a terminal device, etc. may be specifically configured to implement the functions of the acquisition module 101, the test module 102, and the generation module 103 in the embodiment shown in fig. 3.
As shown in fig. 6, computing device 600 includes a processor 610, a memory 620, a communication interface 630, and a bus 640. Communication between processor 610, memory 620, and communication interface 630 occurs via bus 640. Bus 640 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 6, but not only one bus or one type of bus. The communication interface 630 is used for communication with the outside, for example, receiving raw data provided by the user and a feature extraction network model to be trained, etc.
The processor 610 may be a central processing unit (central processing unit, CPU), an Application SPECIFIC INTEGRATED Circuit (ASIC), a graphics processor (graphics processing unit, GPU), or one or more integrated circuits, among others. The processor 610 may also be an integrated circuit chip with signal processing capabilities. In implementation, the functions of the various modules in the test apparatus 100 may be performed by integrated logic circuitry in hardware or instructions in software in the processor 610. The processor 610 may also be a general purpose processor, a data signal processor (DIGITAL SIGNAL process, DSP), a field programmable gate array (field programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components, which may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the application. The method disclosed in the embodiment of the application can be directly embodied as a hardware decoding processor or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 620 and the processor 610 reads information in the memory 620 and, in combination with its hardware, performs some or all of the functions in the test device 100.
The memory 620 may include volatile memory (RAM), such as random access memory (random access memory). The memory 620 may also include a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, an HDD, or an SSD.
The memory 620 has stored therein executable code that the processor 610 executes to perform the methods performed by the test apparatus 100 described previously.
Specifically, in the case where the embodiment shown in fig. 3 is implemented, and where the acquisition module 101, the test module 102, and the generation module 103 described in the embodiment shown in fig. 3 are implemented by software, software or program codes required for executing the functions of the acquisition module 101, the test module 102, and the generation module 103 in fig. 3 are stored in the memory 620, and interactions between the acquisition module 101 and other devices are implemented through the communication interface 630, and the processor is configured to execute instructions in the memory 620, so as to implement a method executed by the test apparatus 100.
FIG. 7 illustrates a schematic diagram of a computing device cluster. Wherein the computing device cluster 70 shown in fig. 7 includes a plurality of computing devices, the testing apparatus 100 may be distributed and deployed on the plurality of computing devices in the computing device cluster 70. As shown in fig. 7, the computing device cluster 70 includes a plurality of computing devices 700, each computing device 700 including a memory 720, a processor 710, a communication interface 730, and a bus 740, wherein the memory 720, the processor 710, and the communication interface 730 implement a communication connection between each other through the bus 740.
Processor 710 may employ CPU, GPU, ASIC or one or more integrated circuits. Processor 710 may also be an integrated circuit chip with signal processing capabilities. In implementation, some of the functionality of test device 100 may be accomplished with instructions in the form of integrated logic circuits or software through hardware in processor 710. Processor 710 may also be a DSP, FPGA, general purpose processor, other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and may implement or perform some of the methods, steps, and logic blocks disclosed in embodiments of the present application. The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware decoding processor or in a combination of hardware and software modules in the decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 720, and in each computing device 700, the processor 710 reads the information in the memory 720, and in combination with the hardware, can perform part of the functions of the test apparatus 100.
The memory 720 may include ROM, RAM, static storage devices, dynamic storage devices, hard disks (e.g., SSDs, HDDs), etc. The memory 720 may store program codes, for example, a part or all of program codes for implementing the acquisition module 101, a part or all of program codes for implementing the test module 102, a part or all of program codes for implementing the generation module 103, and the like. For each computing device 700, when the program code stored in the memory 720 is executed by the processor 710, the processor 710 executes a part of the methods executed by the test apparatus 100 based on the communication interface 730, such as a part of the computing devices 700 may be used to execute the methods executed by the acquisition module 101, and another part of the computing devices 700 may be used to execute the methods executed by the test module 102 and the generation module 103. Memory 720 may also store data such as: intermediate data or result data generated by the processor 710 during execution, such as the first operational data described above, test results, and the like.
The communication interface 703 in each computing device 700 is used to communicate with the outside, such as to interact with other computing devices 700, etc.
Bus 740 may be a peripheral component interconnect standard bus or an extended industry standard architecture bus, among others. For ease of illustration, bus 740 within each computing device 700 in FIG. 7 is represented by only one thick line, but does not represent only one bus or type of bus.
Communication paths are established between the plurality of computing devices 700 through a communication network to implement the functions of the test apparatus 100. Any computing device may be a computing device in a cloud environment (e.g., a server), or a computing device in an edge environment, or a terminal device.
Furthermore, embodiments of the present application provide a computer-readable storage medium having instructions stored therein, which when executed on one or more computing devices, cause the one or more computing devices to perform the methods performed by the modules of the test apparatus 100 of the above embodiments.
Furthermore, embodiments of the present application provide a computer program product that, when executed by one or more computing devices, performs any of the foregoing test methods. The computer program product may be a software installation package, which may be downloaded and executed on a computer in case any of the aforementioned test methods is required.
It should be further noted that the above-described apparatus embodiments are merely illustrative, and that the units described as separate units may or may not be physically separate, and that units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the application, the connection relation between the modules represents that the modules have communication connection, and can be specifically implemented as one or more communication buses or signal lines.
The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely illustrative of the manner in which embodiments of the application have been described in connection with the description of the objects having the same attributes.
From the above description of the embodiments, it will be apparent to those skilled in the art that the present application may be implemented by means of software plus necessary general purpose hardware, or of course by means of special purpose hardware including application specific integrated circuits, special purpose CPUs, special purpose memories, special purpose components, etc. Generally, functions performed by computer programs can be easily implemented by corresponding hardware, and specific hardware structures for implementing the same functions can be varied, such as analog circuits, digital circuits, or dedicated circuits. But a software program implementation is a preferred embodiment for many more of the cases of the present application. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a readable storage medium, such as a floppy disk, a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk or an optical disk of a computer, etc., comprising several instructions for causing a computer device (which may be a personal computer, a training device, a network device, etc.) to perform the method according to the embodiments of the present application.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via a wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device, a data center, or the like that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (Solid STATE DISK, SSD)), etc.

Claims (25)

1. A method of testing, the method comprising:
the method comprises the steps that a testing device obtains database sentences in a service processing system, wherein the service processing system comprises service processing equipment and a first database system, the database sentences are sent to the first database system by the service processing equipment, and the database sentences are used for accessing the first database system;
the test device executes the database statement in a second database system to obtain first operation data, wherein the second database system is used for replacing the first database system in the service processing system or the second database system is used for newly adding the database system in the service processing system;
And the testing device generates a testing result aiming at the second database system according to the first operation data.
2. The method according to claim 1, wherein the method further comprises:
The test device obtains second operation data obtained by executing the database statement in a target database system, wherein the target database system is the first database system or the target database system is a database system isomorphic with the first database, and the target database system and the second database system have the same data before executing the database statement;
The test device generates a test result for the second database system according to the first operation data, including:
and the testing device generates a testing result aiming at the second database system according to the first operation data and the second operation data.
3. The method according to claim 1 or 2, wherein the database statement comprises a read data statement for reading data stored in the first database system;
the test device executes the database statement in a second database system to obtain first operation data, and the test device comprises:
The test device carries out quantity amplification on the read data sentences to obtain expanded database sentences;
And the testing device executes the database statement and the extended database statement in the second database system to obtain the first operation data.
4. The method according to claim 1 or 2, wherein the database statement is a statement that the service processing device sent to the first database system within a first time period;
the test device executes the database statement in a second database system to obtain first operation data, and the test device comprises:
And the testing device executes the database statement in the second database system within a second time period to obtain the first operation data, wherein the duration of the second time period is smaller than that of the first time period.
5. The method of claim 2, wherein the target database system is a database system isomorphic to the second database system, and wherein the test device executes the database statement in the second database system to obtain the first operational data, comprising:
After the database statement is executed in the target database system, the test device executes the database statement in the second database system to obtain the first operation data;
the test result is used to indicate data consistency between the target database system and the second database system after the database statement is executed.
6. The method of claim 5, wherein the method further comprises:
the test device determines reference data in the first database system before executing the database statement;
The test device synchronizes the reference data to the target database system and the second database system respectively.
7. The method according to any one of claims 1 to 6, wherein the testing device obtains database statements in a business processing system, comprising:
The testing device records the flow between the service processing equipment and the first database system, wherein the flow comprises the database statement.
8. The method of claim 7, wherein traffic between the service processing device and the first database system is recorded by a proxy component that is deployed at or independent of the first database system.
9. The method of any one of claims 1 to 8, wherein the target database system is a cloud database system.
10. The method according to any of claims 1 to 9, wherein the target database system and the second database system are different versions of the same type of database system; or the target database system and the second database system are different types of database systems.
11. A method of testing, the method comprising:
The testing device determines a target interface, wherein the target interface is used for calling an object to be updated in a target system;
The test device uses the calling record of the target interface to call a target object to obtain operation data, wherein the target object is used for replacing an object to be updated in the target system or is used for adding an object in the target system;
And the testing device generates a testing result aiming at the target object according to the operation data.
12. A test device, the test device comprising:
The system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring database sentences in a service processing system, the service processing system comprises service processing equipment and a first database system, the database sentences are sent to the first database system by the service processing equipment, and the database sentences are used for accessing the first database system;
The test module is used for executing the database statement in a second database system to obtain first operation data, wherein the second database system is used for replacing the first database system in the service processing system or the second database system is used for newly adding the database system in the service processing system;
And the generating module is used for generating a test result aiming at the second database system according to the first operation data.
13. The test device of claim 12, wherein the obtaining module is further configured to obtain second operation data obtained by executing the database statement in a target database system, the target database system being the first database system or the target database system being a database system isomorphic to the first database, the target database system and the second database system having the same data prior to executing the database statement;
The generating module is specifically configured to generate a test result for the second database system according to the first operation data and the second operation data.
14. The test device of claim 12 or 13, wherein the database statement comprises a read data statement for reading data stored in the first database system;
The test module is specifically configured to:
Performing quantity amplification on the read data sentences to obtain extended database sentences;
And executing the database statement and the extended database statement in the second database system to obtain the first operation data.
15. The test apparatus according to claim 12 or 13, wherein the database statement is a statement that the service processing device sent to the first database system within a first period of time;
the test module is specifically configured to execute the database statement in the second database system in a second time period, so as to obtain the first operation data, where a duration of the second time period is less than a duration of the first time period.
16. The test apparatus of claim 13, wherein the target database system is a database system that is isomorphic to the second database system;
the test module is specifically configured to execute the database statement in the second database system after executing the database statement in the target database system, so as to obtain the first operation data;
the test result is used to indicate data consistency between the target database system and the second database system after the database statement is executed.
17. The test device of claim 16, wherein the test module is further configured to:
Determining reference data in the first database system prior to executing the database statement;
and synchronizing the reference data to the target database system and the second database system respectively.
18. The test device according to any one of claims 12 to 17, wherein the obtaining module is configured to record a traffic between the service processing apparatus and the first database system, the traffic comprising the database statement.
19. The test apparatus of claim 18, wherein traffic between the service processing device and the first database system is recorded by a proxy component that is deployed at the first database system or that is deployed independent of the first database system.
20. The test device of any one of claims 12 to 19, wherein the target database system is a cloud database system.
21. The test device of any one of claims 12 to 20, wherein the target database system and the second database system are different versions of the same type of database system; or the target database system and the second database system are different types of database systems.
22. A test device, the test device comprising:
the acquisition module is used for determining a target interface, and the target interface is used for calling an object to be updated in a target system;
The test module is used for calling a target object by using the calling record of the target interface to obtain operation data, wherein the target object is used for replacing an object to be updated in the target system or is used for adding an object newly in the target system;
And the generating module is used for generating a test result aiming at the target object according to the operation data.
23. A cluster of computing devices, comprising at least one computing device, each computing device comprising a processor and a memory;
the processor is configured to execute instructions stored in the memory to cause the cluster of computing devices to perform the method of any one of claims 1 to 11.
24. A computer-readable storage medium having instructions stored therein that, when executed on at least one computing device, cause the at least one computing device to perform the method of any of claims 1-11.
25. A computer program product containing instructions which, when run on at least one computing device, cause the at least one computing device to perform the method of any of claims 1 to 11.
CN202211674637.XA 2022-11-10 2022-12-26 Test method, test device and related equipment Pending CN118051426A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2023/100114 WO2024098746A1 (en) 2022-11-10 2023-06-14 Test method, apparatus, and related device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211406229 2022-11-10
CN2022114062296 2022-11-10

Publications (1)

Publication Number Publication Date
CN118051426A true CN118051426A (en) 2024-05-17

Family

ID=91050873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211674637.XA Pending CN118051426A (en) 2022-11-10 2022-12-26 Test method, test device and related equipment

Country Status (1)

Country Link
CN (1) CN118051426A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118585458A (en) * 2024-08-06 2024-09-03 恒生电子股份有限公司 Database testing method, device and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118585458A (en) * 2024-08-06 2024-09-03 恒生电子股份有限公司 Database testing method, device and program product

Similar Documents

Publication Publication Date Title
CN110309071B (en) Test code generation method and module, and test method and system
CN106940695B (en) Data source information verification method and device
CN108170612B (en) Automatic testing method and device and server
CN111737140B (en) Interface automatic test method, device, equipment and computer readable storage medium
CN112636992B (en) Dynamic routing method, device, equipment and storage medium
CN116881145B (en) Interface testing method, device, equipment and storage medium based on flow playback
CN112799939B (en) Incremental code coverage rate testing method and device, storage medium and electronic equipment
CN111241111B (en) Data query method and device, data comparison method and device, medium and equipment
CN118051426A (en) Test method, test device and related equipment
WO2024098746A1 (en) Test method, apparatus, and related device
CN113946559A (en) Data processing method, target database system and data processing system
CN113742200A (en) Test method, device and computer readable medium for database version upgrade
CN110750445A (en) Method, system and equipment for testing high-availability function of YARN component
CN111930625A (en) Log obtaining method, device and system based on cloud service platform
CN114895879B (en) Management system design scheme determining method, device, equipment and storage medium
US11288175B1 (en) Software production load and software test load synchronization feedback system
CN111309297B (en) Script development system and method
CN116974881A (en) Application testing method, device, electronic equipment and readable medium
CN113434409A (en) Micro-service test method and device
CN111767222A (en) Data model verification method and device, electronic equipment and storage medium
KR102655091B1 (en) Test management system using data set and method therefor
CN115145831B (en) Non-invasive test data recovery method and system
CN118646595B (en) Method, equipment and storage medium for repairing server to avoid secret mutual trust
US20230195609A1 (en) Automatic generation of summary report for validation tests of computing systems
CN116089200A (en) Storage system robustness testing method, device, equipment and medium based on ceph

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication