Database data testing method and system
Through the agent-based automated database testing platform, the problems of low efficiency and high cost of traditional database testing are solved, efficient and accurate test environment construction and performance evaluation are achieved, and testing efficiency and product quality are improved.
Patent Information
- Application Number
- CN202410704530.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The traditional database testing process is inefficient and costly, requiring manual allocation of virtual machines and deployment of clusters, and execution of test cases through manual operations.
Provide an agent-based database testing platform that automatically completes virtual machine allocation, cluster deployment and test case execution. It creates tasks through test components, matches virtual machine parameters, allocates agent components, builds test case sets, and collects execution logs.
It improves testing efficiency and accuracy, reduces testing costs, ensures the stability and coverage of the testing environment, provides detailed performance analysis reports, and enhances the quality and competitiveness of software products.
Smart Images

Figure CN118277282B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data testing method and system for a database. Background Art
[0002] The traditional database testing process usually requires manual allocation of virtual machines, deployment of database clusters, and execution of test cases through manual operations. This method has the problems of low efficiency and high cost. In order to solve this problem, an agent-based database testing platform is proposed, which can automatically complete the process of virtual machine allocation, cluster deployment and test case execution, improve test efficiency and reduce test costs. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a method and system for testing data in a database, so as to improve the efficiency of testing data in a database.
[0004] The present invention provides a data testing method for a database, comprising: starting a test component, and creating a test task through the test component; calibrating a test cluster version for the test task to obtain a target test version; matching virtual machine parameters according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the load of the virtual machine; allocating an agent component to each virtual machine based on the virtual machine parameters; constructing a test case for the target test version through the agent component of each virtual machine to obtain a test case set; performing data testing through the test case set, and collecting execution logs during the test process.
[0005] In the present invention, the steps of starting the test component and creating a test task through the test component include: starting the test component and collecting user operation information in real time; matching the task identifier according to the user operation information to obtain the target task identifier; creating a test task according to the target task identifier to obtain the test task.
[0006] In the present invention, the step of calibrating the test cluster version of the test task to obtain the target test version includes: collecting multiple cluster version data to be tested, matching the task identifier with performance indicators, and obtaining multiple performance indicator data; performing version screening on the multiple cluster version data to be tested based on the multiple performance indicator data to obtain multiple first cluster versions to be tested; and screening the multiple first cluster versions to be tested according to the user operation information to obtain the target test version.
[0007] In the present invention, the virtual machine parameters are matched according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the virtual machine load step, including: extracting version attributes of the target test version to obtain version attribute data; collecting test environment parameters according to the version attribute data to obtain environment parameters, wherein the environment parameters include: server resources, network bandwidth and storage capacity data; analyzing the number of virtual machines for the target test version based on the environment parameters to obtain the number of virtual machines; matching the virtual machine load based on the target number of virtual machines to obtain the virtual machine load.
[0008] In the present invention, the step of allocating an agent component to each virtual machine based on the virtual machine parameters includes: matching the installation script of each virtual machine based on the virtual machine parameters to obtain the installation script of each virtual machine; and allocating an agent component to each virtual machine through the installation script of each virtual machine.
[0009] In the present invention, the step of constructing test cases for the target test version through the agent component of each virtual machine to obtain a test case set includes: generating test code for the target test version through the agent component of each virtual machine to obtain the test code corresponding to each virtual machine; and constructing test cases for the target test version based on the test code corresponding to each virtual machine to obtain a test case set.
[0010] In the present invention, the steps of performing data testing through the test case set and collecting execution logs during the test process include: performing data testing through the test case set and collecting test data at the same time; performing performance data analysis on the test data to obtain test performance data; and collecting execution logs based on the test performance data to obtain the execution logs.
[0011] The present invention also provides a database data testing system, comprising:
[0012] A startup module, used to start the test component and create a test task through the test component;
[0013] A calibration module, used to calibrate the test cluster version of the test task to obtain a target test version;
[0014] A matching module, used to match virtual machine parameters according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the virtual machine load;
[0015] An allocation module, configured to allocate an agent component to each virtual machine based on the virtual machine parameters;
[0016] A construction module, used to construct test cases for the target test version through the agent component of each virtual machine to obtain a test case set;
[0017] The test module is used to perform data testing through the test case set and collect execution logs during the test process.
[0018] In the technical solution provided by the present invention, by starting the test component and creating the test task, it is possible to respond to the user's needs in a timely manner, ensure the smooth progress of the test task, and improve the execution efficiency and flexibility of the test task. Secondly, the test cluster version is calibrated for the test task, and the target test version can be accurately determined, thereby avoiding the trouble of selecting from too many versions and improving the pertinence and accuracy of the test. After determining the target test version, matching is performed according to the virtual machine parameters, and an agent component is assigned to each virtual machine, which helps to build a stable and efficient test environment and ensure the accuracy and reliability of the test. By constructing test cases through the agent component of each virtual machine, the role of each virtual machine can be fully utilized, and the coverage and depth of the test are improved. Subsequently, data testing is performed through the test case set and execution logs are collected, which can comprehensively evaluate the performance and stability of the target test version, provide accurate and reliable test results and performance analysis reports for the software development team, help to timely discover and solve potential problems, improve the quality and reliability of software products, thereby enhancing the competitiveness and user satisfaction of the product. In summary, the scheme will effectively improve test efficiency and test accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 The present invention is a flowchart of a method for testing database data in an embodiment of the present invention.
[0021] Figure 2 The flowchart of calibrating the test cluster version for the test task in the embodiment of the present invention.
[0022] Figure 3 The figure is a schematic diagram of a data testing system for a database in an embodiment of the present invention.
[0023] Reference numerals:
[0024] 301. Startup module; 302. Calibration module; 303. Matching module; 304. Allocation module; 305. Construction module; 306. Test module. DETAILED DESCRIPTION
[0025] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0027] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , Figure 1 is a flow chart of a method for testing data in a database according to an embodiment of the present invention. Figure 1 As shown, the following steps are included:
[0028] S101, start the test component and create a test task through the test component;
[0029] S102, calibrate the test cluster version for the test task to obtain the target test version;
[0030] S103, matching virtual machine parameters according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the virtual machine load;
[0031] S104, assigning an agent component to each virtual machine based on the virtual machine parameters;
[0032] S105, constructing test cases for the target test version through the agent component of each virtual machine to obtain a test case set;
[0033] S106. Perform data testing through a test case set and collect execution logs during the testing process.
[0034] It should be noted that starting the test component is the starting point of the entire automated database testing process. Through this test component, users can easily create and manage test tasks. For example, a new database management system is being developed, and the test component they use includes functions such as use case management and tested version management. In this test component, the tester can create a test task called "Database Performance Test". Next, the tester created a task called "Database Performance Test" in the test component and added the use cases that need to be tested to it. In this example, the test task may include test cases for database read and write performance, concurrent processing capabilities, etc.
[0035] Afterwards, the tester needs to calibrate the target test version. This means selecting a version suitable for performance testing from the available database versions. Suppose the tester selects the company's latest released database management system version, called "DBMS v2.0". According to the selected target test version, the system automatically matches the virtual machine parameters. The virtual machine parameters include the number of virtual machines and the load. For example, if the tester decides to deploy 10 virtual machines in the test environment, and the load of each virtual machine does not exceed 50% to ensure stability and reliability.
[0036] Based on the matched virtual machine parameters, the system assigns an agent component to each virtual machine. The agent component is responsible for installing and executing test tasks on the virtual machine. For example, the system automatically installs a test agent component named "DBMS_Agent" on each virtual machine. Subsequently, the agent component of each virtual machine starts to build a test case set. This means that it pulls all the test cases in the "Database Performance Test" task and prepares to execute them on the virtual machine. For example, the agent component on the virtual machine pulls the test cases for testing the database read and write performance and prepares to perform simulated database read and write operations on the virtual machine.
[0037] Finally, after the test case set is ready, the system starts data testing and collects execution logs during the test process. For example, if the test case involves testing the database read and write performance, the system will record the execution of each read and write operation, including execution time, success rate and other information, and record this information in the execution log for subsequent analysis and reporting.
[0038] By executing the above steps, by starting the test component and creating the test task, it is possible to respond to the user's needs in a timely manner, ensure the smooth progress of the test task, and improve the execution efficiency and flexibility of the test task. Secondly, the test cluster version calibration for the test task can accurately determine the target test version, thereby avoiding the trouble of choosing from too many versions and improving the pertinence and accuracy of the test. After determining the target test version, matching according to the virtual machine parameters and assigning the agent component to each virtual machine helps to build a stable and efficient test environment and ensure the accuracy and reliability of the test. By constructing test cases through the agent component of each virtual machine, the role of each virtual machine can be fully utilized, improving the coverage and depth of the test. Subsequently, through the test case set, data testing and execution log collection can be carried out, the performance and stability of the target test version can be comprehensively evaluated, and accurate and reliable test results and performance analysis reports can be provided to the software development team, which helps to timely discover and solve potential problems, improve the quality and reliability of software products, and thus enhance the competitiveness of products and user satisfaction. In summary, this solution will effectively improve test efficiency and test accuracy.
[0039] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0040] (1) Start the test component and collect user operation information in real time;
[0041] (2) Match the task identifier according to the user operation information to obtain the target task identifier;
[0042] (3) Create a test task according to the target task identifier to obtain the test task.
[0043] Specifically, when the test component is started, user operation information needs to be collected in real time in order to understand user needs and behaviors. For example, when testers log in to the test component, their login time, pages browsed, tasks created, edited, or deleted, and other operation information will be recorded.
[0044] Based on the collected user operation information, task ID matching can be performed to determine the user's target task ID. This means that it is necessary to identify the test tasks that users are interested in based on their operation behaviors. For example, if a tester browses the page about performance testing many times in a row and frequently creates or edits tasks named "database performance testing", it can be inferred that the tester is particularly interested in performance testing tasks.
[0045] After the target task identifier is determined, the corresponding test task can be created based on this information. For example, if a tester is determined to be interested in database performance testing, a test task named "Database Performance Testing" will be automatically created, and relevant test cases and configuration information will be added to the test task. Through such a process, the user's needs and interests can be automatically identified based on the user's real-time operation information, and the corresponding test tasks can be created accordingly. In this way, testers do not need to manually create test tasks, and this process can be automatically completed based on their behavior, greatly improving the efficiency and accuracy of the test.
[0046] For example, if a tester logs in to the test component, browses the page about database performance testing continuously, and edits the task named "Database Performance Testing" multiple times, these operation information will be recorded in real time. Then, based on this information, it is determined that the tester is interested in the database performance testing task, and a test task named "Database Performance Testing" is automatically created, and related test cases and configuration information are added. In this way, testers can directly find the test tasks they are interested in without having to create them manually, which greatly improves the efficiency and convenience of testing.
[0047] In a specific embodiment, if Figure 2 As shown, the process of executing step S102 may specifically include the following steps:
[0048] S201, collecting data of multiple cluster versions to be tested, matching performance indicators of task identifiers, and obtaining multiple performance indicator data;
[0049] S202: Screen multiple versions of clusters to be tested based on multiple performance indicator data to obtain multiple first cluster versions to be tested;
[0050] S203: Filter multiple first to-be-tested cluster versions according to the user operation information to obtain a target test version.
[0051] It should be noted that in the process of collecting data from multiple versions of the cluster to be tested, it is first necessary to collect performance indicator data from clusters of different versions. These performance indicators may include data on response time, throughput, resource utilization, etc. By analyzing these performance indicator data, detailed information about the performance of each cluster version can be obtained.
[0052] Based on the performance indicator data collected for multiple cluster versions to be tested, the task identifiers can be matched with performance indicators. This means that the performance of different cluster versions needs to be matched and evaluated according to the performance indicator requirements set by the user. For example, if the cluster version that the user wants to test needs to have a lower response time and a higher throughput, then the cluster versions that meet the conditions will be screened out based on these requirements and the corresponding performance indicator data will be obtained.
[0053] After obtaining multiple performance indicator data, the version screening phase begins. In this phase, multiple cluster versions to be tested are screened based on multiple performance indicator data to obtain multiple first cluster versions to be tested. This means that it is necessary to comprehensively consider the data of various performance indicators and select the cluster version with the best performance in each indicator as the first version to be tested. For example, the cluster version with the best performance in terms of response time and throughput may be selected as the first version to be tested.
[0054] After obtaining multiple first cluster versions to be tested, further screening will be performed based on user operation information. Based on user needs and preferences, factors such as ease of use and stability will be considered to determine the final target test version. For example, if the user prefers a more stable version, then a cluster version with high stability based on good performance may be selected as the final target test version. Through such a process, the target test version with the best performance and highest stability can be selected from multiple cluster versions to be tested based on user needs and actual conditions. In this way, the accuracy and effectiveness of the test tasks can be ensured, and the efficiency and reliability of the test can be improved.
[0055] For example, assume that performance indicator data of three cluster versions to be tested are collected, namely version A, version B, and version C. After performance indicator matching and version screening, it is found that version A has the best performance in response time and throughput, so it is selected as the first version to be tested. Next, based on the user's operation information, version A is further screened, and after considering user preferences and needs, version A is determined to be the final target test version.
[0056] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0057] (1) Extract version attributes of the target test version to obtain version attribute data;
[0058] (2) Collect test environment parameters based on version attribute data to obtain environment parameters, where the environment parameters include: server resources, network bandwidth, and storage capacity data;
[0059] (3) Analyze the number of virtual machines for the target test version based on the environmental parameters to obtain the number of virtual machines;
[0060] (4) Perform virtual machine load matching based on the target number of virtual machines to obtain the virtual machine load.
[0061] Specifically, in the process of extracting the version attributes of the target test version, it is first necessary to extract the various attribute data of the version from the target test version. These attribute data may include information such as version number, release date, and main functional characteristics. For example, for a database management version, its attribute data may include version number "v3.0", release date "March 1, 2024", and main functional characteristics include "added data backup and recovery functions", etc.
[0062] Based on the extracted version attribute data, the test environment parameters can be collected. This means that parameter information related to the test environment needs to be collected based on the version attribute data. These environment parameters can include data such as server resources, network bandwidth, and storage capacity. For example, the server type, network bandwidth requirements, and storage capacity requirements that need to be used may be determined based on the version attribute data.
[0063] After obtaining the test environment parameters, the number of virtual machines for the target test version will be analyzed based on these parameters. This means that the number of virtual machines to be deployed needs to be determined based on the parameter information of the test environment. For example, if the test environment requires more server resources and higher network bandwidth requirements, it may be decided that more virtual machines need to be deployed to meet the test needs.
[0064] Based on the determined number of virtual machines, virtual machine load matching will be performed. This means that the load of each virtual machine needs to be determined based on the parameter information of the test environment to ensure the stability and performance of the test environment. For example, if the test environment requires more server resources, the load of the virtual machine may be set higher to ensure that the server resources can be fully utilized during the test and improve the test efficiency.
[0065] Through the above steps, we can collect test environment parameters and determine the number and load of virtual machines according to the attribute data of the target test version, thus providing the necessary environmental support for the execution of the test task. In this way, we can ensure the stability and accuracy of the test process and improve the test efficiency and reliability.
[0066] For example, suppose that the attribute data of a database management version "v3.0" is extracted, and the environment parameters such as server resources, network bandwidth, and storage capacity that need to be used are determined based on the attributes of this version. Then, based on these parameter analysis, it is determined that the number of virtual machines that need to be deployed is 10, and load matching is performed based on the number of virtual machines to ensure that the load of each virtual machine is suitable for the test environment requirements.
[0067] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0068] (1) Based on the virtual machine parameters, match the installation script of each virtual machine to obtain the installation script of each virtual machine;
[0069] (2) Assign the agent component to each virtual machine through the installation script of each virtual machine.
[0070] Specifically, based on the previous steps, the parameter information of the test environment has been determined, including the number of virtual machines and load conditions. Next, it is necessary to match the installation script for each virtual machine to ensure that each virtual machine can correctly install and run the agent component.
[0071] First, the corresponding installation scripts are generated according to the virtual machine parameters. These installation scripts include the steps and configuration information required to install the agent component. For example, for each virtual machine, you may need to generate an installation script that includes the link to download the agent component, install the dependent library, configure the parameters of the connection test component, etc.
[0072] By analyzing the virtual machine parameters, the content of the installation script for each virtual machine can be determined. For example, if it is determined that a certain virtual machine requires higher network bandwidth and storage capacity, the generated installation script may contain additional network configuration and storage optimization parameters.
[0073] Next, the agent component is distributed through the installation script of each virtual machine. This means that the corresponding installation script will be run on each virtual machine to complete the installation and configuration of the agent component. For example, the generated installation script will be sent to each virtual machine through a remote connection or an automated script, and the script will be executed to install and configure the agent component.
[0074] Through this process, it can be ensured that each virtual machine can correctly install and run the agent component, so as to achieve the smooth execution of the test task. In this way, the test component can communicate with the agent component on each virtual machine to perform data testing and performance monitoring.
[0075] For example, suppose you need to install the agent component on a group of virtual machines, including 10 virtual machines. According to the parameter information of each virtual machine, the corresponding installation script is generated and sent to each virtual machine. Then, the corresponding installation script is executed on each virtual machine to complete the installation and configuration of the agent component. In this way, each virtual machine can communicate with the test component and participate in the execution of the entire test task.
[0076] In a specific embodiment, the process of executing step S105 may specifically include the following steps:
[0077] (1) Generate test code for the target test version through the agent component of each virtual machine to obtain the test code corresponding to each virtual machine;
[0078] (2) Based on the test code corresponding to each virtual machine, test cases are constructed for the target test version to obtain a test case set.
[0079] Specifically, the agent component on each virtual machine will automatically generate the corresponding test code according to the characteristics and requirements of the target test version. These test codes include test scripts for the functions, performance, and stability of the target test version. For example, for a version of a database management system, the agent component may generate test code for testing database read and write performance, concurrent processing capabilities, fault tolerance, etc. Through the test code generated by the agent component, the system can perform a comprehensive test on the target test version. For example, the test code may include stress testing of database read and write performance, load testing of concurrent processing capabilities, etc.
[0080] Next, based on the test code corresponding to each virtual machine, the system will build test cases. This means that the system will create a corresponding set of test cases based on the test code generated for each virtual machine. These test cases cover the various functions and performance requirements of the target test version and are used to evaluate the performance and stability of the target version. For example, the system may create test cases including read and write performance tests, concurrent processing capability tests, fault tolerance tests, etc. based on the generated test code. Through such a process, the system can ensure comprehensive test coverage for the target test version. The test code generated on each virtual machine can fully reflect the characteristics and requirements of the target version, thus providing a sufficient basis for the construction of test cases.
[0081] For example, suppose the system needs to test a new version of a database management system. The agent component generates test code for this version on each virtual machine, including test scripts for database read and write performance, concurrent processing capabilities, fault tolerance, etc. Then, the system creates a corresponding set of test cases based on the test code generated for each virtual machine. These test cases include stress tests for database read and write performance, load tests for concurrent processing capabilities, abnormal situation tests for fault tolerance, etc., which are used to comprehensively evaluate the performance and stability of the target version.
[0082] In a specific embodiment, the process of executing step S106 may specifically include the following steps:
[0083] (1) Perform data testing through a test case set and collect test data at the same time;
[0084] (2) Perform performance data analysis on the test data to obtain test performance data;
[0085] (3) Collect execution logs based on the test performance data to obtain execution logs.
[0086] It should be noted that after the construction of the test case set is completed, these test cases will be used to perform data testing on the target test version and collect test data at the same time.
[0087] First, the test cases in the test case set are executed one by one to conduct comprehensive data testing on the target test version. These test cases cover the various functions and performance requirements of the target version and are used to evaluate the performance and stability of the target version. For example, for a database management version, the test cases may include tests on database read and write performance, concurrent processing capabilities, fault tolerance, etc.
[0088] During the execution of test cases, test data will be collected at the same time. These test data include various performance indicators, execution time, resource consumption and other information generated during the test. For example, the response time, success rate, CPU and memory usage of each test operation may be recorded.
[0089] Next, the collected test data will be analyzed for performance data. This means that the various performance indicators generated during the test will be counted and analyzed to evaluate the performance of the target test version. For example, the response time of database read and write performance may be analyzed to determine the performance of the target version under different load conditions.
[0090] While analyzing performance data, execution logs will be collected based on test data. This means that every step and result of the test process will be recorded for subsequent analysis and reporting. For example, the execution status of each test operation, the log information generated, etc. may be recorded and saved as an execution log.
[0091] Through this process, the performance and stability of the target test version can be comprehensively evaluated. By collecting test data and execution logs, detailed test results and analysis reports can be provided to provide accurate and reliable performance test results for the software development team.
[0092] For example, suppose a new version of a database management system needs to be performance tested. During the execution of the test case set, test data such as the response time, success rate, CPU and memory usage of each test operation are recorded. Then, performance data analysis is performed on these data to evaluate the performance of the target version under different load conditions. At the same time, the execution status and log information generated by each test operation are recorded and saved as execution logs. In this way, detailed test results and analysis reports can be provided to help the development team evaluate the performance and stability of the target version.
[0093] The embodiment of the present invention also provides a data testing system for a database, such as Figure 3 As shown, the data testing system of the database specifically includes:
[0094] A starting module 301 is used to start a test component and create a test task through the test component;
[0095] A calibration module 302 is used to calibrate the test cluster version of the test task to obtain a target test version;
[0096] A matching module 303 is used to match virtual machine parameters according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the load of the virtual machine;
[0097] An allocation module 304, configured to allocate an agent component to each virtual machine based on the virtual machine parameters;
[0098] A construction module 305 is used to construct a test case for the target test version through the agent component of each virtual machine to obtain a test case set;
[0099] The testing module 306 is used to perform data testing through the test case set and collect execution logs during the testing process.
[0100] Through the collaborative work of the above modules, by starting the test components and creating test tasks, it is possible to respond to user needs in a timely manner, ensure the smooth progress of the test tasks, and improve the execution efficiency and flexibility of the test tasks. Secondly, the test cluster version calibration for the test task can accurately determine the target test version, thereby avoiding the trouble of choosing from too many versions and improving the pertinence and accuracy of the test. After determining the target test version, matching is performed according to the virtual machine parameters, and the agent component is assigned to each virtual machine, which helps to build a stable and efficient test environment and ensure the accuracy and reliability of the test. By constructing test cases through the agent component of each virtual machine, the role of each virtual machine can be fully utilized, which improves the coverage and depth of the test. Subsequently, through the test case set, data testing and execution log collection can be carried out, the performance and stability of the target test version can be comprehensively evaluated, and accurate and reliable test results and performance analysis reports can be provided to the software development team, which helps to timely discover and solve potential problems, improve the quality and reliability of software products, and thus enhance the competitiveness of products and user satisfaction. In summary, this solution will effectively improve test efficiency and test accuracy.
[0101] The above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the embodiments, a person skilled in the art should understand that the specific implementation modes of the present invention can still be modified or replaced by equivalents, and any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A data testing method for a database, It is characterized in that include: Start the test component and create a test task through the test component; Specifically including: starting the test component and collecting user operation information in real time; Perform task identification matching according to the user operation information to obtain a target task identification; Create a test task according to the target task identifier to obtain the test task; The test cluster version is calibrated for the test task to obtain the target test version; specifically including: Collect data of multiple cluster versions to be tested, match performance indicators of task identifiers, and obtain multiple performance indicator data; Based on the multiple performance indicator data, multiple cluster version data to be tested are screened to obtain multiple first cluster versions to be tested; Filtering the plurality of first to-be-tested cluster versions according to the user operation information to obtain the target test version; Matching virtual machine parameters according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the load of the virtual machine; Based on the virtual machine parameters, assigning an agent component to each virtual machine; Constructing test cases for the target test version through the agent component of each virtual machine to obtain a test case set; Data testing is performed through the test case set, and execution logs during the testing process are collected.
2. The data testing method for a database according to claim 1, It is characterized in that The step of matching virtual machine parameters according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the virtual machine load, includes: Extracting version attributes of the target test version to obtain version attribute data; Collecting test environment parameters according to the version attribute data to obtain environment parameters, wherein the environment parameters include: server resources, network bandwidth and storage capacity data; Performing a virtual machine quantity analysis on the target test version based on the environmental parameters to obtain the number of virtual machines; The virtual machine load is matched based on the target number of virtual machines to obtain the virtual machine load.
3. The data testing method for a database according to claim 1, It is characterized in that The step of allocating an agent component to each virtual machine based on the virtual machine parameters includes: Based on the virtual machine parameters, matching the installation script of each virtual machine to obtain the installation script of each virtual machine; An agent component is allocated to each virtual machine through the installation script of each virtual machine.
4. The data testing method for a database according to claim 1, It is characterized in that The step of constructing a test case for the target test version through the agent component of each virtual machine to obtain a test case set includes: Generate test code for the target test version through the agent component of each virtual machine to obtain test code corresponding to each virtual machine; Based on the test code corresponding to each of the virtual machines, test cases are constructed for the target test version to obtain a test case set.
5. The data testing method for a database according to claim 4, It is characterized in that The step of performing data testing through the test case set and collecting execution logs during the test process includes: Perform data testing through the test case set and collect test data; Performing performance data analysis on the test data to obtain test performance data; Execution log collection is performed based on the test performance data to obtain the execution log.
6. A database data testing system, used to execute the database data testing method according to any one of claims 1 to 5, It is characterized in that include: A startup module, used to start the test component and create a test task through the test component; Specifically include: Starting the test component and collecting user operation information in real time; Perform task identification matching according to the user operation information to obtain a target task identification; Create a test task according to the target task identifier to obtain the test task; The calibration module is used to calibrate the test cluster version of the test task to obtain the target test version; specifically, it includes: Collect data of multiple cluster versions to be tested, match performance indicators of task identifiers, and obtain multiple performance indicator data; Based on the multiple performance indicator data, multiple cluster version data to be tested are screened to obtain multiple first cluster versions to be tested; Filtering the plurality of first to-be-tested cluster versions according to the user operation information to obtain the target test version; A matching module, used to match virtual machine parameters according to the target test version, wherein the virtual machine parameters include: the number of virtual machines and the virtual machine load; An allocation module, configured to allocate an agent component to each virtual machine based on the virtual machine parameters; A construction module, used to construct test cases for the target test version through the agent component of each virtual machine to obtain a test case set; The test module is used to perform data testing through the test case set and collect execution logs during the test process.
