Movatterモバイル変換


[0]ホーム

URL:


CN119003364A - Data testing method and device, computer equipment and storage medium - Google Patents

Data testing method and device, computer equipment and storage medium
Download PDF

Info

Publication number
CN119003364A
CN119003364ACN202411175955.0ACN202411175955ACN119003364ACN 119003364 ACN119003364 ACN 119003364ACN 202411175955 ACN202411175955 ACN 202411175955ACN 119003364 ACN119003364 ACN 119003364A
Authority
CN
China
Prior art keywords
test
service
task
database
data
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
CN202411175955.0A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co LtdfiledCriticalPing An Technology Shenzhen Co Ltd
Priority to CN202411175955.0ApriorityCriticalpatent/CN119003364A/en
Publication of CN119003364ApublicationCriticalpatent/CN119003364A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The embodiment of the application belongs to the field of database testing, and relates to a data testing method, which comprises the steps of obtaining a task to be tested, importing the task to be tested into a preset database testing model, analyzing a service load type through a monitoring analyzer to obtain a service monitoring index, performing pressure testing on a service database through a testing resource pool to obtain a target testing result, performing sliding window analysis on the target testing result based on the service monitoring index, and outputting a data testing report. The application also provides a data testing device, computer equipment and a storage medium. The application can realize stability test of various service databases, does not need to manually customize and modify specific databases, reflects the responsiveness and processing capacity of the service databases under different load conditions in real time, timely discovers performance bottlenecks and potential anomalies, helps technical teams optimize database configuration and service logic, and improves the overall efficiency and reliability of the system.

Description

Data testing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of database testing technologies, and in particular, to a data testing method, a data testing device, a computer device, and a storage medium.
Background
The database product is taken as the basic software of the underlying data storage, is one of the most important components in any business system, and besides the function of meeting the business data storage, the other very important aspect is the stability of the database product, so that in order to ensure the stability of the database product, enterprises must perform full and comprehensive stability test on the database at regular time.
Conventional database stability testing methods are not systematic and require manual verification of sql statements to provide pressure to the database, or some commercially available tool to provide a pressure scenario.
However, conventional testing methods and tools are not compatible with a variety of mainstream databases, and even more unable to monitor anomalies and errors in the different database products themselves, which makes stability testing difficult to develop, not reusable, and not reliable in itself.
Disclosure of Invention
The embodiment of the application aims to provide a data testing method, a data testing device, computer equipment and a storage medium, which are used for solving the technical problems that the traditional testing method and tool cannot be compatible with various mainstream databases and cannot monitor the abnormality and error generated by different database products.
In order to solve the above technical problems, the embodiment of the present application provides a data testing method, which adopts the following technical schemes:
acquiring a task to be tested, wherein the task to be tested consists of a service load type and a service database;
importing the task to be tested into a preset database test model, wherein the preset database test model comprises a test resource pool and a monitoring analyzer;
analyzing the service load type through the monitoring analyzer to obtain a service monitoring index;
performing pressure test on the service database through the test resource pool to obtain a target test result;
And carrying out sliding window analysis on the target test result based on the service monitoring index, and outputting a data test report.
Further, the step of obtaining the task to be tested, where the task to be tested is composed of a service load type and a service database, specifically includes:
acquiring an object to be processed, wherein the object to be processed comprises a data source identification code and a service log;
Analyzing the data source identification code through a regular expression to obtain a port number and a communication protocol;
determining the service database based on the port number and a communication protocol;
Analyzing the service log to obtain a target service with highest request response ratio in the service log, and taking the type of the target service as the service load type;
and integrating the service load type and the service database to obtain the task to be tested.
Further, before the step of importing the task to be tested into a preset database test model, the method further includes:
importing the task to be tested into a first message queue, wherein the first message queue can accommodate a plurality of tasks to be tested;
monitoring the first message queue through a task work process;
If the task to be tested in the first message queue reaches the upper limit of the capacity of the first message queue, marking the task to be tested as a waiting task;
And if the task to be tested in the first message queue does not reach the capacity upper limit of the first message queue, importing the task to be tested into a preset database test model according to the first-in first-out principle.
Further, the monitoring analyzer includes a plurality of sets of monitoring index sets, and the step of analyzing the service load type by the monitoring analyzer to obtain the service monitoring index specifically includes:
analyzing the service load type through the monitoring analyzer to obtain the load characteristic of the service load type;
And matching the monitoring index set based on the load characteristics of the service load types to obtain the service monitoring index.
Further, the test resource pool includes a plurality of test hosts, and the step of performing a pressure test on the service database through the test resource pool to obtain a target test result specifically includes:
generating test data based on the traffic load type;
Checking the resource state of the test resource pool, wherein the resource state comprises an idle host state and a full host state;
If the resource state of the test resource pool is an idle host state, the connection address and the port number of the service database are imported into a test host, and the test host is locked;
The test data is imported into the test host to carry out pressure test, and a target test result is obtained;
and if the resource state of the test resource pool is the full-load host state, storing the service database into a second message queue for waiting until the resource state of the test resource pool is the idle host state.
Further, the step of analyzing the sliding window for the target test result based on the service monitoring index and outputting a data test report specifically includes:
Acquiring sliding window parameters;
Generating a target sliding window based on the sliding window parameters;
calculating the target test result based on the service monitoring index to obtain a test performance index;
updating the test performance index through the target sliding window to obtain a target performance index;
and carrying out data analysis on the target test result based on the target performance index to obtain the data test report, wherein the data analysis comprises trend analysis, anomaly detection analysis and association analysis.
Further, the sliding window parameter includes a sliding step length, and the step of updating the test performance index through the target sliding window to obtain a target performance index specifically includes:
Collecting the test performance index through the target sliding window;
And carrying out movement updating on the target sliding window based on the sliding step length to obtain the target performance index.
In order to solve the above technical problems, the embodiment of the present application further provides a data testing device, which adopts the following technical scheme:
the acquisition module is used for acquiring a task to be tested, wherein the task to be tested consists of a service load type and a service database;
the importing module is used for importing the task to be tested into a preset database test model, and the preset database test model comprises a test resource pool and a monitoring analyzer;
The analysis module is used for analyzing the service load type through the monitoring analyzer to obtain a service monitoring index;
the test module is used for performing pressure test on the service database through the test resource pool to obtain a target test result;
And the sliding window analysis module is used for carrying out sliding window analysis on the target test result based on the service monitoring index and outputting a data test report.
In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical schemes:
A computer device comprising a memory and a processor, said memory having stored therein computer readable instructions which when executed by said processor implement the steps of said data testing method.
In order to solve the above technical problems, an embodiment of the present application further provides a computer readable storage medium, which adopts the following technical schemes:
a computer readable storage medium having stored thereon computer readable instructions which when executed by a processor perform the steps of the data testing method.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
According to the embodiment of the application, the task to be tested is imported into the preset database test model, the service load type is analyzed through the monitoring analyzer to obtain the service monitoring index, the service database is subjected to pressure test through the test resource pool to obtain the target test result, the sliding window analysis is performed on the target test result based on the service monitoring index to output the data test report, the stability test on various service databases is realized by importing the task to be tested into the database test model, the customization modification is not required for a specific database by manpower, the characteristic of the service load is accurately analyzed through the monitoring analyzer, the pertinence pressure test is performed through the test resource pool, the responsiveness and the processing capacity of the service database under different load conditions can be reflected in real time, the performance bottleneck and the potential abnormality can be found in time by performing the fine-granularity performance evaluation on the test result through the sliding window technology, the technical team is helped to optimize the database configuration and the service logic, and the overall efficiency and the reliability of the system are improved.
Drawings
In order to more clearly illustrate the solution of the present application, a brief description will be given below of the drawings required for the description of the embodiments of the present application, it being apparent that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without the exercise of inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a data testing method according to the present application;
FIG. 3 is a schematic diagram of an embodiment of a data testing apparatus according to the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device in accordance with the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the data testing method provided by the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the data testing device is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow chart of one embodiment of a method of data testing according to the present application is shown. The data testing method comprises the following steps:
step S201, a task to be tested is acquired.
In this embodiment, the data testing method may be deployed in a data testing platform, where the data testing platform may be constructed by a server or a server cluster, the data testing platform further has a visual front-end page for a database administrator to upload, download, view, save, and the like, the server or the server cluster may be any electronic device with functions of text recognition, text processing, data transmission, data storage, and the like, and the electronic device (for example, a server/terminal device shown in fig. 1) on which the data testing method is running may receive a task to be tested through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection may include, but is not limited to, 3G/4G/5G connection, wiFi connection, bluetooth connection, wiMAX connection, zigbee connection, UWB (ultra wideband) connection, and other now known or later developed wireless connection.
In this embodiment, the task to be tested may be a stability test task for an existing database, or may be a deployment and test task for a new database type and version, and when the task to be tested is the deployment and test task for the new database type and version, the user may select the database type and version by himself, and the data test platform may automatically deploy the database product and perform stability test.
Specifically, the task to be tested consists of a service load type and a service database, wherein the service load type can be a type of work load required for simulating the request and operation of the service database in a real service environment, and the service load type can comprise TPC-C and TPC-H, wherein the TPC-C can be a type of business load of online transaction processing, mainly simulates transaction processing in an electronic commerce environment, such as order entry, payment processing and the like, and the TPC-H can be a type of business load of online analysis processing, mainly used for query processing of a data warehouse, and relates to complex query, large data volume processing and the like;
The service Database may be a Database system to be tested, and may be an existing Database or a newly deployed Database product, such as the mainstream databases of Oracle Database, mySQL, microsoft SQL SERVER, IBM DB2, etc.
In particular, regarding the above specific implementation process of acquiring the task to be tested, the present application will be described in further detail in the following specific embodiments, which will not be described herein.
Step S202, a task to be tested is imported into a preset database test model.
In this embodiment, the predetermined database test model may be a comprehensive test model including a plurality of components based on data test frames such as Locust, JMeter and Gatling. Specifically, the preset database test model comprises a test resource pool and a monitoring analyzer;
The test resource pool may be a resource pool for managing and distributing service database tests, such as servers, virtual machines, containers, etc., and may be used to control the testing process of the service database in an isolated environment, where the test resource pool may include Docker, kubernetes containers and cloud servers provided by suppliers such as AWS, azure, google Cloud Platform, etc.
The monitoring analyzer may be used to collect and analyze performance data of the service database during testing of the service database, and the monitoring analyzer may be a data monitoring tool such as New Relic, APPDYNAMICS, datadog, etc.
And step S203, analyzing the service load type through a monitoring analyzer to obtain a service monitoring index.
In this embodiment, the service monitoring indicator may be used to evaluate performance and reliability of the service database under actual operation conditions, where the service monitoring indicator may include index data such as response time, throughput, resource usage, error rate, concurrency performance, connection number, cache hit rate, data replication delay, transaction log growth rate, and system stability.
In particular, regarding the above specific implementation process of analyzing the traffic load type by the monitoring analyzer to obtain the traffic monitoring index, the present application will be described in further detail in the following specific embodiments, which will not be described herein.
And S204, performing pressure test on the service database through the test resource pool to obtain a target test result.
In this embodiment, the target test result may be that the service database obtains the performance index data set after the pressure test. Specifically, the performance index data set may include data such as response time and throughput, stability report, error and anomaly records, system resource consumption, and pressure test data, and by analyzing the target test result, a database manager may be helped to understand the behavior of the current service database under the actual workload, so as to perform necessary adjustment and optimization, determine the optimal configuration of the current service database, and ensure efficient and stable operation of the database system.
Specifically, regarding the specific implementation process of performing the pressure test on the service database through the test resource pool to obtain the target test result, the present application will be described in further detail in the following specific embodiments, which will not be described herein.
And step S205, carrying out sliding window analysis on the target test result based on the service monitoring index, and outputting a data test report.
In this embodiment, the data test report may be used to summarize and analyze and display the test results of the service database in detail, so as to provide clear and easily understood information for technical teams, so as to evaluate the performance and stability of the database. Specifically, the data test report may include resource usage details, anomaly and error analysis, stability assessment, pressure test results, optimization suggestions, trend and comparison analysis, and analysis results of the analysis may be configured on the data test platform by using a report automation tool such as Crystal Reports or SQL SERVER Reporting Services (SSRS), and after the test is completed, the data test report may be forwarded to a database administrator in a subscription manner.
Specifically, regarding the above-mentioned implementation process of performing sliding window analysis on the target test result based on the service monitoring index and outputting the data test report, the present application will be described in further detail in the following specific embodiments, which will not be described herein.
According to the application, the task to be tested is imported into a preset database test model, the service load type is analyzed through the monitoring analyzer to obtain the service monitoring index, the service database is subjected to pressure test through the test resource pool to obtain the target test result, the sliding window analysis is performed on the target test result based on the service monitoring index to output the data test report, the stability test on various service databases is realized by importing the task to be tested into the database test model, the customization modification is not required for a specific database by manpower, the characteristic of the service load is accurately analyzed through the monitoring analyzer, and the targeted pressure test is performed through the test resource pool, so that the responsiveness and the processing capacity of the service database under different load conditions can be reflected in real time, the performance evaluation of the test result with fine granularity can be performed by utilizing the sliding window technology, and the performance bottleneck and potential abnormality can be found in time, thereby helping technical teams optimize the database configuration and the service logic, and improving the overall efficiency and reliability of the system.
In some alternative implementations, step S201 includes the steps of:
acquiring an object to be processed;
Analyzing the data source identification code through the regular expression to obtain a port number and a communication protocol;
determining a service database based on the port number and a communication protocol;
Analyzing the service log to obtain a target service with highest request response ratio in the service log, and taking the type of the target service as a service load type;
and integrating the service load type and the service database to obtain the task to be tested.
In this embodiment, the object to be processed may be an existing Database or a newly deployed Database product, such as the mainstream databases of Oracle Database, mySQL, microsoft SQL SERVER, IBM DB2, and the like. Specifically, the object to be processed includes a data source identification code (DSN) and a service log, where the data source identification code (DSN) may be a parameter used to define and access a specific database instance, the data source identification code may include contents such as a database connection ip, a port number, a user name, a password, a database name, and a communication protocol, and the service log may be a history log record generated by a service database during operation, and the service log may include a history log such as a transaction log, a query log, and a performance log.
In a possible embodiment, the database administrator may select the object to be processed by means of drag, click, and the like on the front page of the data testing platform, where the object to be processed may be stored in the front page of the data testing platform in the form of an icon, and then parse the data source identifier by means of a regular expression to obtain the port number and the communication protocol, where the data source identifier is as follows, for example:
tcp://username:password@hostname:3306/databasename;
In this regard, the regular expression may be: wherein, w+ matches the protocol type, d+ is the port number, thus extracting the port number and the communication protocol, and since different database systems can use different default ports and protocols, the service database can be determined based on the port number and the communication protocol, for example, if the resolved protocol is TCP and the port number is 3306, the type of the current service database can be generally judged to be MySQL database.
In a possible embodiment, key information such as request type, timestamp, response time and the like can be extracted by analyzing the start time, end time, type and result of each request recorded in the service log, then the request response time of each service type is counted, average response time and request completion rate are calculated, then the request response rate of which service type is highest, namely, which service is most processed in unit time and has highest efficiency, is determined as the main service load type, and is used for further performance and stability test, and finally the service load type and the service database are integrated and packaged to obtain the task to be tested.
According to the application, the accuracy and efficiency of the test are effectively improved by automatically analyzing the data source identification code and the service log, the performance and stability of the database can be pertinently optimized by the test activity, the manual intervention requirement is reduced by automatic test preparation and execution, the error rate is reduced, the test period is accelerated, the database system is more reliable, and the high-efficiency and dynamic service requirement is met.
In some alternative implementations, prior to step S202, the following steps are included:
importing a task to be tested into a first message queue;
monitoring a first message queue through a task work process;
if the task to be tested in the first message queue reaches the upper limit of the capacity of the first message queue, marking the task to be tested as a waiting task;
If the task to be tested in the first message queue does not reach the capacity upper limit of the first message queue, the task to be tested is imported into a preset database test model according to the first-in first-out principle.
In this embodiment, the first message queue may be configured to receive and store the task to be tested, and distribute the task to be tested according to a certain policy (such as first in first out). Specifically, the first message queue may be standard message queue software such as rabhitmq, APACHE KAFKA or AWS SQS (Simple Queue Service).
In this embodiment, the task work process may be a component responsible for monitoring a message queue, extracting and executing tasks. Specifically, a scheduler such as a Docker switch, nomad, or Kubernetes may be used to dynamically allocate resources and manage task execution functions for a task work process.
In one possible embodiment, before the task to be tested is imported into the preset database test model, the task to be tested needs to be imported into a task queue (a first message queue) for waiting, the task queue is monitored through a Kubernetes cluster (task work process), if the task to be tested in the task queue reaches the upper capacity limit of the task queue, the task to be tested is marked as a waiting task, and if the task to be tested in the task queue does not reach the upper capacity limit of the task queue, the task to be tested is imported into the preset database test model according to the first-in first-out principle.
According to the application, the task to be tested is imported and managed in the first message queue, and the task work process is effectively monitored and scheduled, so that efficient task processing and resource allocation can be realized, and stable operation of the system when the capacity limit is reached can be ensured, thereby improving the overall test automation and the system responsiveness.
In some alternative implementations, step S203 includes the steps of:
Analyzing the service load type through a monitoring analyzer to obtain the load characteristic of the service load type;
and matching the monitoring index set based on the load characteristics of the service load types to obtain service monitoring indexes.
In this embodiment, the load characteristic may be a usage pattern and a behavior characteristic of the service database on the system resource when the service is running. Specifically, the load characteristics may include characteristics such as request frequency, data transmission amount, CPU and memory usage during operation, and the number of concurrent users.
In this embodiment, the monitoring analyzer includes several sets of monitoring indicators. Specifically, the monitoring index set may be a necessary test index for the service database stored in the monitoring analyzer, where the necessary test index may include a performance index, a resource usage index, a capacity index, a stability index, and other indexes, where the monitoring index set may include the service monitoring index, and according to a load characteristic of a service load type, the monitoring analyzer may select an appropriate monitoring index set as the service monitoring index, so as to comprehensively evaluate and monitor the performance of the database.
In one possible embodiment, after obtaining the load characteristic, key performance indicators capable of reflecting the load characteristic may be matched in the monitoring indicator set according to the load characteristic. For example, for a database of high query load, the query response time and the number of Queries Per Second (QPS) are matched; for write-intensive applications, matching monitors transaction commit latency, transactions Per Second (TPS), and disk write operations; for the service requiring high availability, the system availability, the fault recovery time and the error rate are matched, and the key performance index is used as the service monitoring index.
The application can realize highly customized performance monitoring by analyzing the service load type by using the monitoring analyzer and matching the proper monitoring index set based on the load characteristic, can more effectively identify and solve the performance bottleneck, optimize the system configuration, improve the application performance and finally ensure the efficient and stable operation of the service.
In some alternative implementations, step S204 includes the steps of:
generating test data based on the traffic load type;
checking the resource state of the test resource pool;
if the resource state of the test resource pool is the idle host state, the connection address and the port number of the service database are imported into the test host, and the test host is locked;
The test data is imported into the test host to carry out pressure test, and a target test result is obtained;
and if the resource state of the test resource pool is the full-load host state, storing the service database into a second message queue for waiting until the resource state of the test resource pool is the idle host state.
In this embodiment, the second message queue may be standard message queue software such as rabhitmq, APACHE KAFKA or AWS SQS (Simple Queue Service).
In a possible embodiment, when the service load type is TPC-C, a custom script data generating tool such as Apache JMeter, TPC Benchmark may be used to create a test script (test data) to simulate transaction processing in an e-commerce environment, then a resource management and monitoring tool such as Kubernetes, docker Swarm, etc. is used to check the resource utilization rate, check the resource status of the test resource pool, if the resource status of the test resource pool is in a idle host state, the connection address and port number of the service database are imported into the test host, and lock the test host, and the test script is imported into the test host to perform pressure test, so as to obtain the indexes such as throughput, response time, execution time, CPU usage rate, memory usage rate, and disk I/O (i.e. the target test result), and if the resource status of the test resource pool is in a full host state, store the service database into the second message queue and wait until the resource status of the test resource pool is in a idle host state.
The application effectively improves the automation degree and the resource utilization efficiency of the test by dynamically monitoring and managing the test resources, ensures that the test is executed only when the resources are enough, avoids the problems of resource contention and overload, ensures the reliability and the accuracy of the test, and simultaneously ensures the orderly execution of the test tasks without interruption of the test caused by insufficient resources by managing the overload tasks by using the second message queue, thereby maximizing the effectiveness of the test resources and the continuity of the test process.
In some alternative implementations, step S205 includes the steps of:
Acquiring sliding window parameters;
generating a target sliding window based on the sliding window parameters;
calculating the target test result based on the service monitoring index to obtain a test performance index;
Updating the test performance index through the target sliding window to obtain a target performance index;
and carrying out data analysis on the target test result based on the target performance index to obtain a data test report.
In this embodiment, the sliding window parameter may include a window size and a sliding step size. Specifically, the window size defines the range of time series data to be analyzed, and the step size defines the interval of window movement.
In one possible embodiment, a window size of 5 minutes and a step size of 1 minute are selected as sliding window parameters for real-time monitoring of database performance, a sliding window (i.e. the target sliding window) for managing time series data is constructed by using a pandas library of Python, service monitoring index data such as throughput, response time, etc. in the sliding window period are collected, average query response time and transaction number per second (i.e. the test performance index) in each window are calculated, window data are updated once per minute, average response time and transaction number (i.e. the target performance index) are recalculated, the recalculated average response time and transaction number are recorded in a data test report, and a detailed data test report is generated by performing trend analysis, anomaly detection analysis and association analysis on target test results and ending with final target performance index in the sliding window, wherein the data test report contains graphs and trend analysis of key performance indexes.
The trend analysis may be to use a graph to show the change of the target performance index over time, helping to identify long-term trends or periodic patterns; the anomaly detection analysis may identify an anomaly value in the target performance index using statistical methods such as standard deviation, IQR, etc.; the correlation analysis may be to analyze the correlation between the target performance index and the target test result, such as the relationship between CPU usage and response time, to determine the root cause of the performance bottleneck.
The application realizes continuous performance monitoring and data analysis through sliding window analysis, can immediately find out performance problems and rapidly respond, and the sliding window provides a dynamic performance view, can reflect the change of system performance along with time, and helps administrators and developers understand the performance of the database under actual workload.
In some alternative implementations, the step of updating the test performance index through the target sliding window to obtain the target performance index includes the following steps:
collecting the test performance index through a target sliding window;
and carrying out movement updating on the target sliding window based on the sliding step length to obtain the target performance index.
In this embodiment, after the specified sliding step is reached, the target sliding window moves forward, a new test performance index is added as the target performance index, and the test performance index with the earliest window is removed.
According to the application, the target sliding window is used for collecting and updating the test performance index, so that the performance data is always kept up to date, the latest performance trend is reflected, and an administrator can make a quick and effective decision based on the latest performance trend, and the potential performance problem is timely identified and solved, so that the system operation is optimized and the user experience is improved.
It should be emphasized that, to further ensure the privacy and security of the data test report information, the data test report information may also be stored in a node of a blockchain.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a data testing apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 3, the data testing apparatus 300 according to the present embodiment includes: the system comprises an acquisition module 301, an import module 302, a resolution module 303, a test module 304 and a sliding window resolution module 305. Wherein:
The acquisition module 301 is configured to acquire a task to be tested, where the task to be tested is composed of a service load type and a service database;
an importing module 302, configured to import the task to be tested into a preset database test model, where the preset database test model includes a test resource pool and a monitoring analyzer;
the analyzing module 303 is configured to analyze the service load type through the monitoring analyzer to obtain a service monitoring indicator;
The testing module 304 is configured to perform a pressure test on the service database through the testing resource pool to obtain a target testing result;
And the sliding window analysis module 305 is configured to perform sliding window analysis on the target test result based on the service monitoring index, and output a data test report.
The acquiring module 301 includes:
the first acquisition sub-module is used for acquiring an object to be processed, wherein the object to be processed comprises a data source identification code and a service log;
The first analysis submodule is used for analyzing the data source identification code through a regular expression to obtain a port number and a communication protocol;
a first determining submodule for determining the service database based on the port number and the communication protocol;
the second analysis submodule is used for analyzing the service log to obtain a target service with highest request response ratio in the service log, and the type of the target service is used as the service load type;
and the integration sub-module is used for integrating the service load type and the service database to obtain the task to be tested.
Before the import module 302, it includes:
The first importing module is used for importing the task to be tested into a first message queue, and the first message queue can accommodate a plurality of tasks to be tested;
the monitoring module is used for monitoring the first message queue through a task work process;
the marking module is used for marking the task to be tested as a waiting task if the task to be tested in the first message queue reaches the upper limit of the capacity of the first message queue;
And the second importing module is used for importing the task to be tested into a preset database test model according to the first-in first-out principle if the task to be tested in the first message queue does not reach the upper capacity limit of the first message queue.
The parsing module 303 includes:
A third analysis sub-module, configured to analyze the service load type through the monitoring analyzer, to obtain a load characteristic of the service load type;
And the matching sub-module is used for matching the monitoring index set based on the load characteristics of the service load types to obtain the service monitoring index.
The test module 304 includes:
A first generation sub-module for generating test data based on the traffic load type;
The checking sub-module is used for checking the resource state of the test resource pool, wherein the resource state comprises an idle host state and a full host state;
A first judging sub-module, configured to, if the resource state of the test resource pool is an idle host state, import a connection address and a port number of the service database into a test host, and lock the test host;
The pressure test sub-module is used for importing the test data into the test host to carry out pressure test and target test results;
And the second judging sub-module is used for storing the service database into a second message queue for waiting until the resource state of the test resource pool is an idle host state if the resource state of the test resource pool is a full host state.
The sliding window parsing module 305 includes:
the second acquisition submodule is used for acquiring sliding window parameters;
The second generation submodule is used for generating a target sliding window based on the sliding window parameters;
The calculation sub-module is used for calculating the target test result based on the service monitoring index to obtain a test performance index;
the updating sub-module is used for updating the test performance index through the target sliding window to obtain a target performance index;
and the fourth analysis sub-module is used for carrying out data analysis on the target test result based on the target performance index to obtain the data test report, wherein the data analysis comprises trend analysis, anomaly detection analysis and association analysis.
The update sub-module includes:
The collecting unit is used for collecting the test performance indexes through the target sliding window;
and the moving unit is used for moving and updating the target sliding window based on the sliding step length to obtain the target performance index.
In this embodiment, by acquiring a task to be tested, importing the task to be tested into a preset database test model, analyzing the service load type through a monitoring analyzer to obtain a service monitoring index, performing a pressure test on a service database through a test resource pool to obtain a target test result, performing a sliding window analysis on the target test result based on the service monitoring index to output a data test report, importing the task to be tested into the database test model to realize a stability test on a plurality of service databases, without manually performing customized modification on a specific database, accurately analyzing the characteristics of the service load through a monitoring analyzer, performing a targeted pressure test on the test resource pool, and performing a fine-granularity performance evaluation on the test result through a sliding window technology to timely find performance bottlenecks and potential anomalies, thereby helping a technical team to optimize database configuration and service logic, and improving the overall efficiency and reliability of the system.
In this embodiment, the operations performed by the units or modules respectively correspond to the steps of the data testing method in the foregoing embodiment one by one, which is not described herein in detail.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It should be noted that only computer device 4 having components 41-43 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an Application SPECIFIC INTEGRATED Circuit (ASIC), a Programmable gate array (Field-Programmable GATE ARRAY, FPGA), a digital Processor (DIGITAL SIGNAL Processor, DSP), an embedded device, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the computer device 4. Of course, the memory 41 may also comprise both an internal memory unit of the computer device 4 and an external memory device. In this embodiment, the memory 41 is typically used to store an operating system and various application software installed on the computer device 4, such as computer readable instructions of a data testing method. Further, the memory 41 may be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer readable instructions stored in the memory 41 or process data, such as computer readable instructions for executing the data testing method.
The network interface 43 may comprise a wireless network interface or a wired network interface, which network interface 43 is typically used for establishing a communication connection between the computer device 4 and other electronic devices.
The embodiment provides a computer device, a task to be tested is obtained and is imported into a preset database test model, a service load type is analyzed through a monitoring analyzer to obtain a service monitoring index, a service database is subjected to pressure test through a test resource pool to obtain a target test result, a sliding window analysis is performed on the target test result based on the service monitoring index to output a data test report, the task to be tested is imported into the database test model to realize stability test on various service databases, customization modification is not needed for a specific database manually, the characteristic of the service load is accurately analyzed through a monitoring analyzer, and the specific pressure test is performed through the test resource pool, so that the responsiveness and the processing capability of the service database under different load conditions can be reflected in real time, the performance of the test result is subjected to fine-granularity performance evaluation through a sliding window technology, and performance bottlenecks and potential anomalies can be found in time, thereby helping a technical team to optimize the database configuration and the service logic, and the overall efficiency and the reliability of the system are improved.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the data testing method as described above.
The embodiment provides a computer readable storage medium, by acquiring a task to be tested, importing the task to be tested into a preset database test model, analyzing the service load type through a monitoring analyzer to obtain a service monitoring index, performing pressure test on a service database through a test resource pool to obtain a target test result, performing sliding window analysis on the target test result based on the service monitoring index, outputting a data test report, importing the task to be tested into the database test model to realize stability test on various service databases, without manually customizing a specific database, accurately analyzing the characteristics of the service load through a monitoring analyzer, performing targeted pressure test through the test resource pool, performing fine-granularity performance evaluation on the test result by utilizing a sliding window technology, and timely finding out performance bottlenecks and potential anomalies, thereby helping a technical team to optimize database configuration and service logic, and improving the overall efficiency and reliability of a system.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. 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 storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.

Claims (10)

CN202411175955.0A2024-08-232024-08-23Data testing method and device, computer equipment and storage mediumPendingCN119003364A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411175955.0ACN119003364A (en)2024-08-232024-08-23Data testing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411175955.0ACN119003364A (en)2024-08-232024-08-23Data testing method and device, computer equipment and storage medium

Publications (1)

Publication NumberPublication Date
CN119003364Atrue CN119003364A (en)2024-11-22

Family

ID=93488276

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411175955.0APendingCN119003364A (en)2024-08-232024-08-23Data testing method and device, computer equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN119003364A (en)

Similar Documents

PublicationPublication DateTitle
US10116534B2 (en)Systems and methods for WebSphere MQ performance metrics analysis
US11782989B1 (en)Correlating data based on user-specified search criteria
US10515000B2 (en)Systems and methods for performance testing cloud applications from multiple different geographic locations
US10877986B2 (en)Obtaining performance data via an application programming interface (API) for correlation with log data
US10817803B2 (en)Data driven methods and systems for what if analysis
US20250175400A1 (en)Automatic capture of detailed analysis information based on remote server analysis
US10318541B2 (en)Correlating log data with performance measurements having a specified relationship to a threshold value
US9712410B1 (en)Local metrics in a service provider environment
US20180307734A1 (en)Correlating performance data and log data using diverse data stores
US9811445B2 (en)Methods and systems for the use of synthetic users to performance test cloud applications
CN112527599B (en) Intelligent monitoring method, device, electronic device and readable storage medium
CN109684052B (en) Transaction analysis method, apparatus, device and storage medium
US20170255639A1 (en)Processing of Performance Data and Structure Data from an Information Technology Environment
CN113127356A (en)Pressure measurement method and device, electronic equipment and storage medium
US11182386B2 (en)Offloading statistics collection
CN115237724A (en) AI-based data monitoring method, device, equipment and storage medium
JP7305641B2 (en) Methods and systems for tracking application activity data from remote devices and generating corrective behavior data structures for remote devices
US20160139961A1 (en)Event summary mode for tracing systems
CN115982049A (en) Abnormal detection method, device and computer equipment in performance testing
US20060025981A1 (en)Automatic configuration of transaction-based performance models
US11169905B2 (en)Testing an online system for service oriented architecture (SOA) services
CN119003364A (en)Data testing method and device, computer equipment and storage medium
US11200138B1 (en)Policy-based request tracing using a computer
Kotsiuba et al.Multi-Database Monitoring Tool for the E-Health Services
ChenHolistic Observability Framework and Software Library for Performance Diagnosis In Cloud

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp