Database service resource testing method, device, equipment, medium and program product

By acquiring and comparing the benchmark operation index images and reference monitoring index images of database service resources, analyzing the abnormal areas of the index difference graph, solving the problem of automated testing in the existing technology, and achieving efficient monitoring chart testing.

CN118796716BActive Publication Date: 2025-02-07SUZHOU JIBEISI DATA TECHNOLOGY CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411275776.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-02-07
Estimated Expiration
2044-09-12

Smart Images

  • Figure CN118796716B_ABST
    Figure CN118796716B_ABST
Patent Text Reader

Abstract

The present invention provides a database service resource testing method, device, equipment, medium and program product, which can be applied to the field of database automated testing. The method comprises: obtaining a benchmark operation index image and a reference monitoring index image, wherein the benchmark operation index image represents the actual operation status of the database service resource in a preset time range, and the reference monitoring index image represents the monitoring display result of the resource monitoring tool on the database service resource in the preset time range; comparing the benchmark operation index image and the reference monitoring index image to obtain an index difference map; performing abnormal area analysis on the index difference map to obtain a test result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database automation testing, and more specifically to a database service resource testing method, device, equipment, medium and program product. Background Art

[0002] In order to ensure the reliability, effectiveness and timeliness of the database resource monitoring tool, it is necessary to verify whether the host resources, instance resources and cluster resources in the resource monitoring tool are consistent with the actual resource usage of the system, and whether the alarm information is triggered in time. The inventor found that due to the variety of monitoring indicators, the fast update frequency of monitoring data, and the high data accuracy requirements, manual testing is not only time-consuming and labor-intensive, but also very prone to errors that are not observable to the naked eye during the test. Most automated test components compare by reading the data of the chart. Even if the data is consistent with expectations, it is impossible to actually verify the chart. Summary of the invention

[0003] In view of the above problems, the present invention provides a method, apparatus, device, medium and program product for testing database service resources.

[0004] According to a first aspect of the present invention, there is provided a database service resource testing method, comprising:

[0005] Obtain a benchmark operating indicator image and a reference monitoring indicator image, wherein the benchmark operating indicator image represents the actual operating status of the database service resources within a preset time range, and the reference monitoring indicator image represents the monitoring and display results of the resource monitoring tool on the database service resources within the preset time range; compare the benchmark operating indicator image and the reference monitoring indicator image to obtain an indicator difference map; perform abnormal area analysis on the indicator difference map to obtain the test results.

[0006] Optionally, obtaining a benchmark operating indicator image and a reference monitoring indicator image includes: obtaining multiple actual operating data of database service resources within a preset time range according to a preset time interval; obtaining multiple monitoring display data of database service resources within a preset time range in a resource monitoring tool according to a preset time interval; visually analyzing the multiple actual operating data to obtain a benchmark operating indicator image; and visually analyzing the multiple monitoring display data to obtain a reference monitoring indicator image.

[0007] Optionally, an abnormal area analysis is performed on the indicator difference map to obtain a test result including: determining the indicator abnormal area in the indicator difference map based on the indicator difference map; determining the proportion of the indicator abnormal area to the abnormal range of the indicator difference map; and determining the test result based on the abnormal range proportion and a preset abnormal area proportion threshold.

[0008] Optionally, determining the test result based on the abnormal range ratio and a preset abnormal area ratio threshold includes: when the abnormal range ratio is greater than the preset abnormal area ratio threshold, determining the test result as an abnormal test result; when the abnormal range ratio is less than or equal to the preset abnormal area ratio threshold, determining the test result as a normal test result.

[0009] Optionally, the database service resources include multiple sub-service resources, and the method also includes: determining monitoring display data of the sub-service resources, the monitoring display data is obtained based on the resource monitoring tool monitoring the operating status of the sub-service resources within a preset time range; comparing the monitoring display data of the sub-service resources with the alarm conditions indicated by preset alarm rules to obtain a comparison result; and determining the alarm test result based on the comparison result and the service resource type of the sub-service resource.

[0010] Optionally, after obtaining the test results and the alarm test results, the method includes: summarizing the test results and the alarm test results to obtain a target test report; storing the target test report to a target location, wherein the target location includes at least one of the following: a server, a target database, and a preset mailbox.

[0011] A second aspect of the present invention provides a database service resource testing device, comprising:

[0012] An acquisition module is used to acquire a benchmark operation indicator image and a reference monitoring indicator image, wherein the benchmark operation indicator image represents the actual operation status of the database service resources within a preset time range, and the reference monitoring indicator image represents the monitoring and display results of the resource monitoring tool on the database service resources within a preset time range; a comparison module is used to compare the benchmark operation indicator image and the reference monitoring indicator image to obtain an indicator difference map; an analysis module is used to perform abnormal area analysis on the indicator difference map to obtain test results.

[0013] A third aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above method.

[0014] The fourth aspect of the present invention also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above method.

[0015] The fifth aspect of the present invention also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0016] Optionally, by obtaining a benchmark operating indicator image and a reference monitoring indicator image, wherein the benchmark operating indicator image represents the actual operating status of the database service resources within a preset time range, and the reference monitoring indicator image represents the monitoring and display results of the resource monitoring tool on the database service resources within the preset time range, the benchmark operating indicator image and the reference monitoring indicator image are compared to obtain an indicator difference map, which can help testers quickly discover and locate errors that are not observable to the naked eye, and perform abnormal area analysis on the indicator difference map to obtain test results. The pass rate of the test case can be improved by analyzing the abnormal area. The database service resource testing method provided by the present invention can realize the automated completion of the test scenario of the monitoring chart. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0018] Figure 1 An application scenario diagram of a database service resource testing method according to an embodiment of the present invention is shown;

[0019] Figure 2 A flowchart of a method for testing database service resources according to an embodiment of the present invention is shown;

[0020] Figure 3A A schematic diagram of a benchmark operating indicator image and a reference monitoring indicator image according to an embodiment of the present invention is shown;

[0021] Figure 3B A schematic diagram of a benchmark operating indicator image and a reference monitoring indicator image according to another embodiment of the present invention is shown;

[0022] Figure 4 A service resource test flow chart according to an embodiment of the present invention is shown;

[0023] Figure 5 It shows a structural block diagram of a database service resource testing device according to an embodiment of the present invention;

[0024] Figure 6 A block diagram of an electronic device suitable for implementing a database service resource testing method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0025] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.

[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0027] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0028] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0029] In order to ensure the reliability, effectiveness and timeliness of database resource monitoring tools, it is necessary to verify whether the chart data of host resources, instance resources and cluster resources in the resource monitoring tool are consistent with the actual resource usage of the system, and whether the alarm information is triggered in time. However, there are many monitoring indicators, the monitoring data is updated frequently, and the data accuracy requirements are very high. Therefore, manual testing is not only time-consuming and labor-intensive, but also very easy to have errors that are not visible to the naked eye during the testing process. Most automated testing components compare by reading the data of the chart. Even if the data is consistent with expectations, it is impossible to actually verify the chart.

[0030] The inventors found that it is difficult to conduct efficient automated testing of the various types of complex charts in the test database resource monitoring tool, the test case maintenance cost is high, and resource alarms are difficult to capture in a timely manner. The main problems faced during the test process are as follows: (1) The resource monitoring charts of the database and other hosts are rich and varied, such as scatter plots, heat maps, scatter points, line graphs / area graphs, etc., and it is difficult to observe the possible errors in the charts with the naked eye; (2) The accuracy requirements of the indicator values ​​in the charts are high and they change in real time. During the test, a small time interval may lead to mismeasurement.

[0031] In view of this, the present invention provides a database service resource testing method, device, electronic device and medium, the method comprising: obtaining a benchmark operating indicator image and a reference monitoring indicator image, wherein the benchmark operating indicator image represents the actual operating status of the database service resource within a preset time range, and the reference monitoring indicator image represents the monitoring and display results of the resource monitoring tool on the database service resource within the preset time range; comparing the benchmark operating indicator image and the reference monitoring indicator image to obtain an indicator difference map; performing abnormal area analysis on the indicator difference map to obtain test results.

[0032] It should be noted that the database service resource testing method and device provided by the present invention can be used in the field of database automation testing, and can also be used in any field other than the field of database automation testing, such as computer vision and other fields. The application field of the database service resource testing method and device provided by the present invention is not limited.

[0033] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0034] Figure 1 An application scenario diagram of a database service resource testing method according to an embodiment of the present invention is shown.

[0035] like Figure 1As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0036] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0038] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0039] It should be noted that the database service resource testing method provided in the embodiment of the present invention can generally be executed by the server 105. Accordingly, the database service resource testing device provided in the embodiment of the present invention can generally be set in the server 105. The database service resource testing method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the database service resource testing device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0040] It should be understood that Figure 1The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0041] The following will be based on Figure 1 The scene described by Figure 2~Figure 4 The database service resource testing method of the disclosed embodiment is described in detail.

[0042] Figure 2 A flow chart of a database service resource testing method according to an embodiment of the present invention is shown.

[0043] like Figure 2 As shown, the database service resource testing method of this embodiment includes operations S210 to S230.

[0044] In operation S210 , a benchmark operation index image and a reference monitoring index image are acquired.

[0045] In operation S220 , the benchmark operation index image and the reference monitoring index image are compared to obtain an index difference map.

[0046] In operation S230, an abnormal region analysis is performed on the indicator difference graph to obtain a test result.

[0047] Optionally, the benchmark operation indicator image represents the actual operation status of the database service resources within a preset time range, and the reference monitoring indicator image represents the monitoring and display results of the resource monitoring tool on the database service resources within a preset time range. Database service resources may include host resources, instance resources, and cluster resources of the server where the database is located, but are not limited to this. The present invention does not limit the specific content of the database service resources. The benchmark operation indicator image may include images of the actual operation status of various monitoring indicators of the database service resources, and the reference monitoring indicator image may include images of the monitoring and display status of various monitoring indicators of the database service resources. Among them, the monitoring indicators may include multiple, for example, Chunk file reading and writing status, central processing unit (CPU) usage rate, number of bytes read per second on the disk, etc., but are not limited to this. The present invention does not limit the specific types of monitoring indicators.

[0048] Optionally, the benchmark operating indicator image and the reference monitoring indicator image can be extracted from the configured specified path, and then the extracted benchmark operating indicator image and the reference monitoring indicator image can be compared to obtain an indicator difference map. The pixel value in the benchmark operating indicator image can be subtracted from the pixel value in the reference monitoring indicator image at the corresponding position to obtain an indicator difference map. For the same position, after subtraction, the place where the pixel value in the indicator difference map is 0 can be displayed in black, and the place where it is not 0 is the abnormal area position of the two images. For the indicator difference map, an image analysis module can also be introduced for visual verification. After image processing and data analysis, the verification of the resource chart is automatically completed.

[0049] Optionally, the indicator difference graph may be analyzed for abnormal regions to obtain test results. If the abnormal region meets the preset conditions, it may indicate that the resource monitoring tool can monitor the database service resources well, and the test case passes.

[0050] Optionally, you can visually verify the accuracy of complex charts through image recognition, image analysis, and difference processing, and automatically generate indicator difference graphs, which can highlight the differences between the benchmark operating indicator image and the reference monitoring indicator image to help testers quickly find and locate problems. Processing and analyzing complex charts through visual means reduces the errors of manual testing.

[0051] Optionally, by obtaining a benchmark operating indicator image and a reference monitoring indicator image, wherein the benchmark operating indicator image represents the actual operating status of the database service resources within a preset time range, and the reference monitoring indicator image represents the monitoring and display results of the resource monitoring tool on the database service resources within the preset time range, the benchmark operating indicator image and the reference monitoring indicator image are compared to obtain an indicator difference map, which can help testers quickly discover and locate errors that are not observable to the naked eye, and perform abnormal area analysis on the indicator difference map to obtain test results. By analyzing the abnormal areas, the pass rate of test cases can be improved.

[0052] Optionally, obtaining a benchmark operating indicator image and a reference monitoring indicator image includes: obtaining multiple actual operating data of database service resources within a preset time range according to a preset time interval; obtaining multiple monitoring display data of database service resources within a preset time range in a resource monitoring tool according to a preset time interval; visually analyzing the multiple actual operating data to obtain a benchmark operating indicator image; and visually analyzing the multiple monitoring display data to obtain a reference monitoring indicator image.

[0053] Optionally, multiple actual operation data of the database service resource in a preset time range can be obtained in the system according to a preset time interval, and then the multiple actual operation data can be visualized and analyzed to finally obtain a benchmark operation indicator image.

[0054] Optionally, multiple monitoring display data of the database service resource in the resource monitoring tool within a preset time range can be obtained according to a preset time interval, and the multiple monitoring display data can be visualized and analyzed to finally obtain a reference monitoring indicator image. At this time, it should be noted that the preset time range and preset time interval in the reference monitoring indicator image are the same as the preset time range and preset time interval in the benchmark operation indicator image.

[0055] Figure 3A A schematic diagram of a benchmark operating indicator image and a reference monitoring indicator image according to an embodiment of the present invention is shown.

[0056] like Figure 3A As shown, the time node parameter (preset time range) in the configuration file is from XXXX-03-24 16:50:00 to XXXX-03-24 17:30:00, and the preset time interval is 10 minutes. You can request the metadata query interface of Grafana to obtain the range data (actual operation data) of the monitoring indicator "Chunk file reading and writing status" within this range, and connect multiple actual operation data to form a line graph, which is the benchmark operation indicator image. In addition, you can automatically intercept the benchmark operation indicator image of the specified range of Grafana as the test standard in each test to reduce the cost of manual maintenance.

[0057] Figure 3B A schematic diagram of a benchmark operating indicator image and a reference monitoring indicator image according to another embodiment of the present invention is shown.

[0058] like Figure 3B As shown, according to the benchmark operation indicator image obtained above, the range data of the monitoring indicator "Chunk file read and write status" with the same time range and the same time interval is obtained in the resource monitoring tool, and multiple monitoring display data are connected to form a line graph, which is the reference monitoring indicator image.

[0059] Optionally, the multiple actual operation data and multiple monitoring display data are visualized and analyzed, and the image formed is not limited to a line graph. The obtained data can be visualized to form a corresponding image type, and the image type can include but is not limited to a scatter plot, a heat map, a scatter plot, a line graph, an area graph, etc. The obtained benchmark operation index image and the reference monitoring index image can be stored in a configured specified path respectively, so as to compare the benchmark operation index image and the reference monitoring index image later.

[0060] Optionally, an abnormal area analysis is performed on the indicator difference map to obtain a test result including: determining the indicator abnormal area in the indicator difference map based on the indicator difference map; determining the proportion of the indicator abnormal area to the abnormal range of the indicator difference map; and determining the test result based on the abnormal range proportion and a preset abnormal area proportion threshold.

[0061] Optionally, the indicator abnormal area in the indicator difference map can be determined based on the indicator difference map. The proportion of the indicator abnormal area to the abnormal range of the indicator difference map is determined, and the obtained abnormal range ratio can be compared with the preset abnormal area ratio threshold to determine the test result of whether the test case passes. For example, in the indicator difference map obtained by subtracting pixel values, the white area is the indicator abnormal area, and the black area is the indicator normal area. The ratio of the area of ​​the white area to the area of ​​the indicator difference map can be calculated, and the ratio is determined as the abnormal range ratio. The preset abnormal area ratio threshold and the abnormal range ratio can be compared to obtain the test result.

[0062] Optionally, determining the test result based on the abnormal range ratio and a preset abnormal area ratio threshold includes: when the abnormal range ratio is greater than the preset abnormal area ratio threshold, determining the test result as an abnormal test result; when the abnormal range ratio is less than or equal to the preset abnormal area ratio threshold, determining the test result as a normal test result.

[0063] Optionally, when the abnormal range ratio is greater than a preset abnormal area ratio threshold, the test case is marked as failed and the test result is determined as an abnormal test result. When the abnormal range ratio is less than or equal to the preset abnormal area ratio threshold, the test result is determined as a normal test result. The pass rate of test cases can be increased by setting a preset abnormal area ratio threshold.

[0064] Optionally, the database service resources include multiple sub-service resources, and the method also includes: determining monitoring display data of the sub-service resources, the monitoring display data is obtained based on the resource monitoring tool monitoring the operating status of the sub-service resources within a preset time range; comparing the monitoring display data of the sub-service resources with the alarm conditions indicated by preset alarm rules to obtain a comparison result; and determining the alarm test result based on the comparison result and the service resource type of the sub-service resource.

[0065] Optionally, the database service resource may include multiple sub-service resources, and the sub-service resources may include host resources, instance resources, and cluster resources, but are not limited thereto and are not limited in the embodiments of the present invention.

[0066] Optionally, monitoring display data of the sub-service resource may be determined, where the monitoring display data is obtained based on a resource monitoring tool monitoring the running status of the sub-service resource within a preset time range.

[0067] Optionally, the monitoring indicator items configured in the resource monitoring tool can be identified. The monitoring indicator items may include the reading and writing status of Chunk files, the CPU usage rate, the number of bytes read per second on the disk, etc., but are not limited to this. The present invention does not limit the specific types of monitoring indicators. The monitoring display data of the sub-service resource can be compared with the alarm condition indicated by the preset alarm rule to obtain a comparison result. For example, the alarm condition indicated by the preset alarm rule is that the CPU usage rate must not exceed 30%. The CPU usage rate in the monitoring display data can be compared with the alarm condition to obtain a comparison result, and then the alarm test result can be determined based on the comparison result and the service resource type of the sub-service resource.

[0068] Optionally, you can automatically trigger platform alarms by operating the database to verify the accuracy and timeliness of the alarms. For example, if the alarm condition indicated by the alarm rule is "the database is offline, continuous occurrence = 1.0", you can call the SSHClient() method, use the Secure Shell protocol to remotely operate the specified database, switch to the user and execute the pause command on it. At this time, the database is offline, triggering the alarm rule.

[0069] Optionally, if no alert email or webhook request is received before the waiting time set in the test expires, the test case execution will be considered as failed.

[0070] Optionally, after obtaining the test results and the alarm test results, the method includes: summarizing the test results and the alarm test results to obtain a target test report; storing the target test report to a target location, wherein the target location includes at least one of the following: a server, a target database.

[0071] Optionally, the test results and the alarm test results can be summarized to obtain a target test report, and the target test report can be stored in a target location, which can include a server or a target database, or the target test report can be sent to a preset mailbox, which can be a tester's mailbox. The target test report can include test case execution results, failed case screenshots, and execution logs, etc., and can have an intuitive web interface to display test results by category.

[0072] Figure 4 A service resource testing flow chart according to an embodiment of the present invention is shown.

[0073] like Figure 4As shown, you can customize the test parameters before starting the test. The customized test parameters can include the storage path of the benchmark running index image and the reference monitoring index image, the preset abnormal area ratio threshold, the maximum number of failed cases, the preset mailbox and other parameters. When starting the test, there are two startup methods. One is to open the test entry file and execute the main function to start the test. This method can support the generation of test reports and store them in the target location or send them to the preset mailbox; the other startup method can start the test through the command line, but this startup method does not generate the target test report.

[0074] Optionally, after the test is started, the monitoring chart test and the alarm test can be started. After the monitoring chart test starts, the time range can be selected first. By setting the time range and time interval, the benchmark operating indicator image and the reference monitoring indicator image can be obtained in the system. The benchmark operating indicator image and the reference monitoring indicator image are input into the visual analysis module together, and the image is analyzed for abnormal areas to obtain an indicator difference map. If the abnormal range ratio does not meet the conditions, the test fails. If the abnormal range ratio meets the conditions, the test passes. After the test results are obtained, the monitoring chart test ends.

[0075] Optionally, the alarm test can be started at the same time as the monitoring chart test, and the platform alarm can be automatically triggered by operating the database, so as to timely verify the accuracy and timeliness of the alarm. If the alarm is triggered successfully, the test passes, and if the alarm is not triggered successfully, the test fails. After the alarm test result is obtained, the alarm test ends.

[0076] Optionally, the test results and the alarm test results are summarized to obtain a target test report, which can be stored in a target location or sent to a preset mailbox. From then on, the startup test is completed.

[0077] Based on the above database service resource testing method, the present invention also provides a database service resource testing device. Figure 5 The device is described in detail.

[0078] Figure 5 A structural block diagram of a database service resource testing device according to an embodiment of the present invention is shown.

[0079] like Figure 5 As shown, the database service resource testing device 500 of this embodiment includes an acquisition module 510 , a comparison module 520 and an analysis module 530 .

[0080] The acquisition module 510 is used to acquire a benchmark operation indicator image and a reference monitoring indicator image, wherein the benchmark operation indicator image represents the actual operation status of the database service resources within a preset time range, and the reference monitoring indicator image represents the monitoring display result of the resource monitoring tool on the database service resources within the preset time range.

[0081] The comparison module 520 is used to compare the benchmark operation index image with the reference monitoring index image to obtain an index difference map.

[0082] The analysis module 530 is used to perform abnormal area analysis on the indicator difference graph to obtain the test result.

[0083] Optionally, by obtaining a benchmark operating indicator image and a reference monitoring indicator image, wherein the benchmark operating indicator image represents the actual operating status of the database service resources within a preset time range, and the reference monitoring indicator image represents the monitoring and display results of the resource monitoring tool on the database service resources within the preset time range, the benchmark operating indicator image and the reference monitoring indicator image are compared to obtain an indicator difference map, which can help testers quickly discover and locate errors that are not observable to the naked eye, and perform abnormal area analysis on the indicator difference map to obtain test results. By analyzing the abnormal areas, the pass rate of test cases can be improved.

[0084] Optionally, the acquisition module 510 includes: an actual operation data acquisition unit, a monitoring display data acquisition unit, a benchmark operation indicator image unit and a reference monitoring indicator image.

[0085] The actual operation data acquisition unit is used to acquire a plurality of actual operation data of the database service resource within a preset time range according to a preset time interval.

[0086] The monitoring display data acquisition unit is used to acquire a plurality of monitoring display data of the database service resources in the resource monitoring tool within a preset time range according to a preset time interval.

[0087] The benchmark operation index image unit is used to perform visual analysis on a plurality of actual operation data to obtain a benchmark operation index image.

[0088] The reference monitoring indicator image unit is used to perform visual analysis on a plurality of monitoring display data to obtain a reference monitoring indicator image.

[0089] Optionally, the analysis module 530 includes: an abnormal region determination unit, a ratio determination unit and a test result determination unit.

[0090] The abnormal area determination unit is used to determine the indicator abnormal area in the indicator difference map according to the indicator difference map.

[0091] The ratio determination unit is used to determine the ratio of the abnormal indicator area to the abnormal range of the indicator difference map.

[0092] The test result determination unit is used to determine the test result according to the abnormal range ratio and a preset abnormal area ratio threshold.

[0093] Optionally, the test result determination unit includes: an abnormal test result determination subunit and a normal test result determination subunit.

[0094] The abnormal test result determination subunit is used to determine the test result as an abnormal test result when the abnormal range ratio is greater than a preset abnormal area ratio threshold.

[0095] The normal test result determination subunit is used to determine the test result as a normal test result when the abnormal range ratio is less than or equal to a preset abnormal area ratio threshold.

[0096] Optionally, the database service resource includes multiple sub-service resources.

[0097] Optionally, the database service resource testing device 500 includes: a monitoring display determination module, a comparison result module and an alarm test result module.

[0098] The monitoring display determination module is used to determine the monitoring display data of the sub-service resources. The monitoring display data is obtained based on the resource monitoring tool monitoring the running status of the sub-service resources within a preset time range.

[0099] The comparison result module is used to compare the monitoring display data of the sub-service resources with the alarm conditions indicated by the preset alarm rules to obtain the comparison results.

[0100] The alarm test result module is used to determine the alarm test result according to the comparison result and the service resource type of the sub-service resource.

[0101] Optionally, the database service resource testing device 500 includes: a summary module and a storage module.

[0102] The summary module is used to summarize the test results and alarm test results to obtain the target test report.

[0103] The storage module is used to store the target test report to a target location, wherein the target location includes at least one of the following: a server, a target database, and a preset mailbox.

[0104] Optionally, any multiple modules among the acquisition module 510, the comparison module 520 and the analysis module 530 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. Optionally, at least one of the acquisition module 510, the comparison module 520 and the analysis module 530 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the acquisition module 510, the comparison module 520 and the analysis module 530 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0105] Figure 6 A block diagram of an electronic device suitable for implementing a database service resource testing method according to an embodiment of the present invention is shown.

[0106] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0107] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.

[0108] Optionally, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.

[0109] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.

[0110] Optionally, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, optionally, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0111] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the database service resource testing method provided by the embodiment of the present invention.

[0112] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 601. Optionally, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0113] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0114] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present invention are performed. Optionally, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.

[0115] Optionally, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages, specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0116] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0117] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways, even if such combinations and / or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All of these combinations and / or combinations fall within the scope of the present invention.

[0118] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination. The scope of the present invention is defined by the attached claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.

Claims

1. A database service resource testing method, characterized in that: The method comprises: Obtain a benchmark operation indicator image and a reference monitoring indicator image, wherein the benchmark operation indicator image represents the actual operation status of the database service resource in a preset time range, and the reference monitoring indicator image represents the monitoring display result of the resource monitoring tool on the database service resource in the preset time range; Comparing the benchmark operation index image with the reference monitoring index image to obtain an index difference map, wherein the index difference map is obtained by subtracting the pixel value of the reference monitoring index image from the pixel value of the benchmark operation index image; According to the indicator difference map, determining an indicator abnormal area in the indicator difference map; Determine the ratio of the abnormal indicator area to the abnormal range of the indicator difference map; The test result is determined according to the abnormal range ratio and a preset abnormal area ratio threshold.

2. The method according to claim 1, characterized in that: The obtaining of the benchmark operation index image and the reference monitoring index image comprises: According to a preset time interval, obtaining a plurality of actual operation data of the database service resource within the preset time range; According to the preset time interval, obtaining a plurality of monitoring display data of the database service resource in the resource monitoring tool within the preset time range; Performing visual analysis on the plurality of actual operation data to obtain a benchmark operation index image; A plurality of monitoring display data are visualized and analyzed to obtain a reference monitoring index image.

3. The method according to claim 1, characterized in that Determining the test result according to the abnormal range ratio and the preset abnormal area ratio threshold comprises: When the abnormal range ratio is greater than the preset abnormal area ratio threshold, determining the test result as an abnormal test result; When the abnormal range ratio is less than or equal to the preset abnormal area ratio threshold, the test result is determined as a normal test result.

4. The method according to claim 1, characterized in that: The database service resource includes a plurality of sub-service resources, and the method further includes: Determining monitoring display data of the sub-service resource, wherein the monitoring display data is obtained based on the resource monitoring tool monitoring the running status of the sub-service resource within the preset time range; Comparing the monitoring display data of the sub-service resource with the alarm condition indicated by the preset alarm rule to obtain a comparison result; and An alarm test result is determined according to the comparison result and the service resource type of the sub-service resource.

5. The method according to claim 4, characterized in that After obtaining the test result and the alarm test result, the method includes: Summarize the test results and the alarm test results to obtain a target test report; The target test report is stored in a target location, wherein the target location includes at least one of the following: a server, a target database.

6. A database service resource testing device, characterized in that: The device comprises: An acquisition module, used to acquire a benchmark operation indicator image and a reference monitoring indicator image, wherein the benchmark operation indicator image represents the actual operation status of the database service resource within a preset time range, and the reference monitoring indicator image represents the monitoring display result of the resource monitoring tool on the database service resource within the preset time range; a comparison module, configured to compare the benchmark operation index image with the reference monitoring index image to obtain an index difference map, wherein the index difference map is obtained by subtracting the pixel values ​​of the reference monitoring index image from the pixel values ​​of the benchmark operation index image; An indicator abnormal area determination module is used to determine the indicator abnormal area in the indicator difference map according to the indicator difference map; An abnormal range ratio determination module is used to determine the ratio of the abnormal indicator area to the abnormal range of the indicator difference map; The test result determination module is used to determine the test result according to the abnormal range ratio and a preset abnormal area ratio threshold.

7. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and device for processing performance test data, computing equipment and medium

    CN111611144A