Database performance determination method and device, electronic equipment and storage medium

By executing benchmark query statements and analyzing slow statements in the database cluster, it solves the problem that existing tools cannot quickly locate the worst-performing database, implements a method to quickly optimize database performance, and improves the operation and maintenance efficiency of the CRM system.

CN118733626AActive Publication Date: 2024-10-01CHINA TELECOM CORP LTD

Patent Information

Application Number
CN202410749766.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-01
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

Existing database operation and maintenance tools cannot quickly locate the database with the worst performance among multiple databases, making the multi-cluster database performance optimization and analysis process of the CRM system cumbersome, complex and inefficient.

Method used

By executing the preset baseline structured query statement in the database cluster, the database instance whose execution time exceeds the threshold is determined to be the database to be optimized, and the slow statements in its historical logs are analyzed, the performance parameters of the slow statements are calculated, and then the performance of the database to be optimized is evaluated. Performance level to quickly locate performance bottlenecks.

Benefits of technology

In a cluster scenario composed of multiple database instances, a single performance bottleneck database can be quickly located, which improves the efficiency of database performance optimization and simplifies the operation and maintenance process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733626A_ABST
    Figure CN118733626A_ABST
Patent Text Reader

Abstract

The invention discloses a database performance determination method and device, electronic equipment and a storage medium. The method comprises the following steps: determining the execution duration of executing a preset reference structured query statement in each database instance of a database cluster; determining the database instances of which the execution time lengths of the reference structured query statements exceed a first time length threshold value as to-be-optimized databases, and determining slow statements corresponding to the to-be-optimized databases; according to the index value of the performance evaluation index corresponding to the slow statement, a first performance parameter of the slow statement is determined, and the first performance parameter is used for representing the influence degree of the slow statement on the database performance; and determining a second performance parameter of the to-be-optimized database according to the first performance parameters of all the slow statements corresponding to the to-be-optimized database. According to the method and the device, the technical problem that a database operation and maintenance tool in related technologies cannot position a database with the worst performance in a database cluster is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of database operation and maintenance, and in particular to a method, device, electronic device and storage medium for determining database performance. Background Art

[0002] The customer relationship management system (CRM) is the core system of operators. Once the database has performance problems, it will affect the efficiency of front-line business. However, the system is large in size, involving many subsystems and submodules, and data often exists in multiple databases. The database operation and maintenance tools in related technologies are lacking in performance troubleshooting and cannot quickly locate the database with the worst performance among multiple databases, resulting in a cumbersome and complex performance optimization and analysis process for multi-cluster databases for CRM systems, and low efficiency.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for determining database performance, so as to at least solve the technical problem that database operation and maintenance tools in related technologies cannot locate the database with the worst performance in a database cluster.

[0005] According to one aspect of an embodiment of the present application, a method for determining database performance is provided, including: determining the execution time of a preset benchmark structured query statement in each database instance of a database cluster, wherein the database instance is a database system corresponding to each subsystem of a customer relationship management system in the database cluster; determining a database instance whose execution time of the benchmark structured query statement exceeds a first time threshold as a database to be optimized, and determining a slow statement corresponding to each database to be optimized, wherein the slow statement is a structured query statement whose execution time in a historical log of the database to be optimized exceeds a second time threshold; determining a first performance parameter of the slow statement based on an indicator value of a performance evaluation indicator corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on the database performance; determining a second performance parameter of the database to be optimized based on the first performance parameters of all slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the degree of performance quality of the database to be optimized.

[0006] Optionally, the method also includes: in a database instance, executing each benchmark structured query statement, and determining the average execution time of each benchmark structured query statement as the execution time corresponding to the database instance, wherein the benchmark structured query statements corresponding to each database instance are the same; when the execution time is greater than a first time threshold, determining that the performance of the database instance needs to be optimized, and determining the database instance as a database to be optimized; when the execution time is not greater than the first time threshold, determining that the performance of the database instance does not need to be optimized.

[0007] Optionally, determining the slow statement corresponding to each database to be optimized includes: accessing the database to be optimized based on access information corresponding to the database to be optimized, and obtaining a historical log corresponding to the database to be optimized, wherein the access information includes: a database network protocol address, a port, a login account and a password, and the historical log includes structured query statements historically executed by the database to be optimized and corresponding execution information; and determining a structured query statement in the historical log whose execution time exceeds a second time threshold as a slow statement corresponding to the database to be optimized.

[0008] Optionally, determining the first performance parameter of the slow statement includes: determining the index value of the performance evaluation index corresponding to each slow statement corresponding to the database to be optimized, wherein the performance evaluation index includes at least one of the following: the number of queries corresponding to the slow statement, the query duration, the waiting time, and the amount of retrieved data, wherein the waiting time is the length of time the query operation corresponding to the slow statement waits for obtaining a record lock when obtaining data; determining the first weight coefficient corresponding to each performance evaluation index of the slow statement, wherein the first weight coefficient is used to characterize the degree of demand for the performance evaluation index by the business corresponding to the slow statement; determining the first performance parameter of the slow statement based on the index value of each performance evaluation index corresponding to the slow statement and the first weight coefficient corresponding to each performance evaluation index.

[0009] Optionally, determining the second performance parameter of the database to be optimized based on the first performance parameters of all slow statements corresponding to the database to be optimized includes: determining a subsystem in the customer relationship management system associated with the database to be optimized, and determining a second weight coefficient corresponding to each database to be optimized based on a parameter of the degree of influence of the subsystem on the customer relationship management system, wherein the second weight coefficient is used to characterize the degree of influence of the database to be optimized on the customer relationship management system; determining the second performance parameter based on the first performance parameters of each slow statement corresponding to the database to be optimized and the second weight coefficient corresponding to the database to be optimized.

[0010] Optionally, after determining the second performance parameter of the database to be optimized, the method also includes: sorting the database to be optimized in descending order of the second performance parameter, wherein the larger the second performance parameter is, the higher the priority of the database to be optimized; and optimizing the slow statements of each database to be optimized in turn according to the sorted order and based on statement optimization rules, wherein the statement optimization rules are used to convert the grammatical format of the slow statement, and the execution performance of the statement after the grammatical format conversion is better than that of the statement before the conversion, and the execution result of the statement is consistent with the execution result of the statement before the conversion.

[0011] Optionally, optimizing the slow statements of each database to be optimized in sequence includes: sorting the slow statements corresponding to the database to be optimized in descending order according to the first performance parameter of the slow statements, wherein the larger the first performance parameter is, the higher the priority of the slow statement for optimization; in the process of optimizing each database to be optimized, optimizing the slow statements corresponding to the database to be optimized in sequence according to the order of the sorted slow statements.

[0012] According to another aspect of the embodiment of the present application, a database performance determination device is also provided, including: an execution time determination module, used to determine the execution time of a preset benchmark structured query statement in each database instance of a database cluster, wherein the database instance is a database system corresponding to each subsystem of a customer relationship management system in the database cluster; a slow statement determination module, used to determine a database instance whose execution time of the benchmark structured query statement exceeds a first time threshold as a database to be optimized, and determine a slow statement corresponding to each database to be optimized, wherein the slow statement is a structured query statement whose execution time in a historical log of the database to be optimized exceeds a second time threshold; a first performance evaluation module, used to determine a first performance parameter of the slow statement according to an index value of a performance evaluation index corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on the database performance; a second performance evaluation module, used to determine a second performance parameter of the database to be optimized according to the first performance parameters of all slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the degree of performance quality of the database to be optimized.

[0013] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the database performance determination method is executed when the program is run.

[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the database performance determination method by running the computer program.

[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which implements the steps of the database performance determination method when the computer program is executed by a processor.

[0016] In an embodiment of the present application, the execution time of a preset benchmark structured query statement is determined in each database instance of a database cluster, wherein the database instance is a database system corresponding to each subsystem of a customer relationship management system in the database cluster; a database instance whose execution time of the benchmark structured query statement exceeds a first time threshold is determined as a database to be optimized, and a slow statement corresponding to each database to be optimized is determined, wherein the slow statement is a structured query statement whose execution time in a historical log of the database to be optimized exceeds a second time threshold; a first performance parameter of the slow statement is determined according to the index value of the performance evaluation index corresponding to the slow statement, wherein the first performance parameter of the slow statement is The performance parameter is used to characterize the influence of slow statements on database performance; the second performance parameter of the database to be optimized is determined according to the first performance parameters of all slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the performance quality of the database to be optimized. The slow statement performance of a single database is quantified, and the overall performance of the database is further quantified according to the quantified value of the slow statement performance, thereby achieving the purpose of quickly locating a single performance bottleneck instance in a cluster database scenario composed of a large number of database instances, thereby solving the technical problem that the database operation and maintenance tools in the related technology cannot locate the database with the worst performance in the database cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 It is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a method for determining database performance according to an embodiment of the present application;

[0019] Figure 2 It is a schematic diagram of a method flow for determining database performance provided according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of a multi-cluster database performance optimization analysis framework provided according to an embodiment of the present application;

[0021] Figure 4 It is a schematic diagram of a multi-cluster database performance optimization analysis method for a CRM system in an information innovation environment provided according to an embodiment of the present application;

[0022] Figure 5 It is a structural diagram of a database performance determination device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] The customer relationship management system (CRM) is the core system of operators. It involves the entire business process of mobile phone card processing and cancellation, package launch and upgrade, call fee payment, customer complaints, etc. in the operator's business hall. Therefore, the operating speed of the system is very high. Once the database has performance problems, it will affect the efficiency of front-line business processing, trigger customer complaints, and have a negative impact on the company.

[0026] The system is large in size, involving many subsystems and submodules, and data often exists in multiple databases. However, traditional database operation and maintenance tools in related technologies are lacking in performance troubleshooting. First, they cannot quickly locate the database with the worst performance among multiple databases, and second, they cannot quickly locate the SQL (Structured Query Language) that most affects performance in a single database.

[0027] In order to solve the above problems, relevant solutions are provided in the embodiments of the present application to guide operation and maintenance personnel to optimize and analyze the database to quickly restore system performance, which is described in detail below.

[0028] According to an embodiment of the present application, an embodiment of a method for determining database performance is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or electronic device) for implementing a method for determining database performance. Figure 1 As shown, the computer terminal 10 (or electronic device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0030] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or electronic device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0031] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the database performance determination method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned database performance determination method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or electronic device).

[0034] In the above operating environment, the embodiment of the present application provides a method for determining database performance. Figure 2 is a schematic diagram of a method flow for determining database performance according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0035] Step S202, determining the execution time of a preset benchmark structured query statement in each database instance of the database cluster, wherein the database instance is a database system in the database cluster corresponding to each subsystem of the customer relationship management system;

[0036] Step S204, determining the database instance whose execution time of the benchmark structured query statement exceeds the first time threshold as the database to be optimized, and determining the slow statement corresponding to each database to be optimized, wherein the slow statement is the structured query statement whose execution time exceeds the second time threshold in the historical log of the database to be optimized;

[0037] Step S206, determining a first performance parameter of the slow statement according to the index value of the performance evaluation index corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on the database performance;

[0038] Step S208: determining a second performance parameter of the database to be optimized based on the first performance parameters of all slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the performance quality of the database to be optimized.

[0039] Through the above steps, by quantifying the slow statement performance of a single database, and further quantifying the overall performance of the database based on the quantified value of the slow statement performance, the purpose of quickly locating a single performance bottleneck instance in a cluster database scenario composed of a large number of database instances is achieved, thereby solving the technical problem that database operation and maintenance tools in related technologies cannot locate the database with the worst performance in a database cluster.

[0040] The following further introduces the method for determining database performance in steps S202 to S208 of the embodiment of the present application.

[0041] In the embodiment of the present application, a performance analysis platform can be used to perform performance optimization analysis on a multi-cluster database, such as Figure 3 As shown, the performance analysis platform includes: data input, performance evaluation, performance analysis and performance optimization modules, wherein the data input module is used to store the Internet Protocol addresses IP, ports, user names, passwords, etc. of all instances of the database cluster involved in the CRM system, and can also receive the database instance performance optimization coefficients (i.e., the second weight coefficient) involved in each subsystem module in the CRM system preset by the operation and maintenance personnel; the performance evaluation module is used to perform performance checks on all database instances involved in the CRM system; the performance analysis module is used to calculate the performance optimization indexes (i.e., the second performance parameter) of all database instances and sort them; the performance optimization module is used to make optimization suggestions to the operation and maintenance personnel based on the database performance optimization indexes (i.e., the second performance parameter) output by the performance analysis module.

[0042] Figure 4 Schematic diagram of a multi-cluster database performance optimization analysis method for a CRM system in a trusted computing environment provided by an embodiment of the present application. Figure 4 As shown, this method can be used in Figure 3 The framework shown is executed below. Figure 3 and Figure 4 The content of the present application further introduces the method for determining database performance in the embodiment of the present application.

[0043] First, a set of performance check benchmark statements, namely, benchmark structured query statements, can be set through performance evaluation parameters, and performance evaluation can be performed by having each database instance execute the preset benchmark structured query statements. The specific steps are as follows.

[0044] In some embodiments of the present application, the method also includes the following steps: in a database instance, executing each benchmark structured query statement, and determining the average execution time of each benchmark structured query statement as the execution time corresponding to the database instance, wherein the benchmark structured query statements corresponding to each database instance are the same; when the execution time is greater than a first time threshold, determining that the performance of the database instance needs to be optimized, and determining the database instance as a database to be optimized; when the execution time is not greater than the first time threshold, determining that the performance of the database instance does not need to be optimized.

[0045] Specifically, a benchmark structured query statement is executed in the database instance, and the execution time of each benchmark structured query statement is recorded. Finally, the average value is taken and the average value is used as the execution time corresponding to the database instance. Thereafter, the execution time is compared with a pre-set first time threshold. If it is greater than the first time threshold, it is determined that the performance of the database instance needs to be optimized, and subsequent performance analysis is started. If it is less than the first time threshold, it is determined that the performance of the database instance does not need to be optimized, and information such as "system performance is good and no optimization is required" is returned.

[0046] The following is a further introduction to the process of using the performance analysis module to perform performance analysis on a database to be optimized that is determined to need to be optimized.

[0047] First, you need to identify the slow statements in each database to be optimized. The specific steps are as follows.

[0048] In some embodiments of the present application, determining the slow statement corresponding to each database to be optimized includes the following steps: accessing the database to be optimized based on the access information corresponding to the database to be optimized, and obtaining the historical log corresponding to the database to be optimized, wherein the access information includes: database network protocol address, port, login account and password, and the historical log includes structured query statements historically executed by the database to be optimized and the corresponding execution information; determining the structured query statements in the historical log whose execution time exceeds the second time threshold as the slow statement corresponding to the database to be optimized.

[0049] Specifically, first log in to the database to be optimized (the i-th one is database i, and there are n databases to be optimized) based on the access information. The above access information can be set by the operation and maintenance personnel through the data input module, including but not limited to: subsystem list, database IP, port, user name, password, etc.

[0050] After the login is successful, the pre-set second time threshold can be used to query and parse the slow statements whose execution time exceeds the second time threshold in the log of the currently logged-in database to be optimized.

[0051] After the slow statements are determined, the performance optimization index of each slow statement, that is, the first performance parameter, can be calculated according to the index value and the corresponding weight value of the slow statement of the current parameter to be optimized. The specific steps are as follows.

[0052] In some embodiments of the present application, determining the first performance parameter of a slow statement includes the following steps: determining the index value of a performance evaluation index corresponding to each slow statement corresponding to the database to be optimized, wherein the performance evaluation index includes at least one of the following: the number of queries corresponding to the slow statement, the query duration, the waiting duration, and the amount of retrieved data, wherein the waiting duration is the duration that the query operation corresponding to the slow statement waits for obtaining a record lock when acquiring data; determining a first weight coefficient corresponding to each performance evaluation index of the slow statement, wherein the first weight coefficient is used to characterize the degree of demand for the performance evaluation index by the business corresponding to the slow statement; determining the first performance parameter of the slow statement based on the index value of each performance evaluation index corresponding to the slow statement and the first weight coefficient corresponding to each performance evaluation index.

[0053] Specifically, the corresponding performance evaluation indicators can be screened according to the specific business nature of the slow statement. In this embodiment, the above-mentioned performance evaluation indicators include but are not limited to: query count, query time, waiting time for obtaining record locks when the current query obtains data (Lock Time), amount of data retrieved (RowsExamined), etc. In addition, after determining the performance evaluation indicators, the first weight coefficient l corresponding to the performance evaluation indicators can be determined according to the emphasis of the business nature of the slow statement on each performance evaluation indicator. For example, if the current slow statement pays special attention to the accuracy and comprehensiveness of the execution results, the weight coefficient of the query time indicator can be appropriately reduced, and the weight coefficient of the query data volume indicator can be increased;

[0054] After that, the first performance parameter score of the slow statement can be calculated based on the index value of the performance evaluation index of the slow statement and the corresponding weight coefficient. sql =sum(func(q 1 ,q 2 ,q 3 ,...,q n )*l), wherein func() represents a function for normalizing the index values ​​of various indexes. In addition, in the embodiment of the present application, multiple slow statements in the same database to be optimized can also be sorted according to the calculated first performance parameter.

[0055] After obtaining the first performance parameters of each slow statement in the database to be optimized, the overall performance optimization index of the data to be optimized, that is, the second performance parameter, can be further quantified. The specific steps are as follows.

[0056] In some embodiments of the present application, determining the second performance parameter of the database to be optimized based on the first performance parameters of all slow statements corresponding to the database to be optimized includes the following steps: determining the subsystem associated with the database to be optimized in the customer relationship management system, and determining the second weight coefficient corresponding to each database to be optimized based on the influence degree parameter of the subsystem on the customer relationship management system, wherein the second weight coefficient is used to characterize the influence degree of the database to be optimized on the customer relationship management system; determining the second performance parameter based on the first performance parameter of each slow statement corresponding to the database to be optimized and the second weight coefficient corresponding to the database to be optimized.

[0057] Specifically, the second performance parameter score of the database to be optimized can be calculated according to the first performance parameter of each slow statement and the second weight coefficient of the database to be optimized. dbn , as shown in the following formula:

[0058] score dbn = func(score sql1 ,score sql2 ,score sql3 ,...,score sqln )*m

[0059] Among them, score sql1 ,score sql2 ,score sql3 ,...,score sqln represents the first performance parameter corresponding to the n slow statements in the parameter database to be optimized, m represents the above-mentioned second weight coefficient. In this embodiment, the second weight coefficient can be determined based on the mapping list between the subsystem and each database instance obtained through the data input module, combined with the degree of influence of each subsystem on the CRM system.

[0060] By repeatedly executing the above performance analysis process, the second performance parameters corresponding to all n databases to be optimized can be obtained. Afterwards, the embodiment of the present application can also use a performance optimization module to optimize the databases to be optimized. The specific steps are as follows.

[0061] In some embodiments of the present application, after determining the second performance parameter of the database to be optimized, the method also includes the following steps: sorting the database to be optimized in descending order of the second performance parameter, wherein the larger the second performance parameter, the higher the priority of the database to be optimized; according to the sorted order, according to the statement optimization rules, optimizing the slow statements of each database to be optimized in turn, wherein the statement optimization rules are used to convert the grammatical format of the slow statement, and the execution performance of the statement after the grammatical format conversion is better than that of the statement before the conversion, and the execution result of the statement is consistent with the execution result of the statement before the conversion.

[0062] In some embodiments of the present application, optimizing the slow statements of each database to be optimized in sequence includes: sorting the slow statements corresponding to the database to be optimized in descending order according to the first performance parameter of the slow statements, wherein the larger the first performance parameter, the higher the priority of the slow statement optimization; in the process of optimizing each database to be optimized, optimizing the slow statements corresponding to the database to be optimized in sequence according to the order of the sorted slow statements.

[0063] Specifically, the second performance parameter score of all databases dbn After sorting, according to the statement optimization rule set set in the performance optimization module, optimization suggestions are given to the databases to be optimized with the highest second performance parameter in the sorted order. At the same time, for each database to be optimized, the slow statements in it are ranked according to the score of the first performance parameter. sql Sort the statements and make optimization suggestions for slow statements with high first performance parameters in the sorted order.

[0064] The above language optimization rule set includes multiple pre-set rules for converting the syntax format of slow statements to improve the efficiency of statement execution. For example, "SELECT *" (that is, selecting all columns in the data table for query) in slow statements is converted to selecting the corresponding columns required for the statement business for query.

[0065] As an optional implementation, before optimizing the slow statements in the database to be optimized, optimization suggestions for the slow statements can be sent to the front-end interactive interface for display, and the operation and maintenance personnel can choose whether to optimize according to the optimization suggestions. This supports manual determination of whether to optimize, which is more in line with actual scenarios and ensures that no failures will be caused while improving efficiency.

[0066] This application provides an operation and maintenance tool for CRM systems in a trusted computing environment to improve the efficiency of database performance optimization. It can quantify the statement performance of a single database into a performance optimization index, and quantify the database performance in multiple database scenarios into a total performance optimization index. At the same time, it can integrate the experience of operation and maintenance personnel on the business side and the platform side to make the index more adaptable to the application scenarios of the CRM system. In addition, this application adopts a pre-set rule set to make intelligent optimization suggestions for slow statements in the database, which can greatly improve the efficiency of performance optimization and solve the problem of being unable to quickly locate a single performance bottleneck instance in a cluster database scenario composed of a large number of database instances, and unable to quickly locate the SQL that triggers performance problems, thereby improving the efficiency of system operation and maintenance personnel in optimizing database performance and ensuring the stable operation of the IT system.

[0067] According to an embodiment of the present application, an embodiment of a database performance determination device is also provided. Figure 5 Schematic diagram of a database performance determination device provided according to an embodiment of the present application. Figure 5 As shown, the device comprises:

[0068] An execution time determination module 50 is used to determine the execution time of executing a preset benchmark structured query statement in each database instance of the database cluster, wherein the database instance is a database system in the database cluster corresponding to each subsystem of the customer relationship management system;

[0069] The slow statement determination module 52 is used to determine the database instance whose execution time of the benchmark structured query statement exceeds the first time threshold as the database to be optimized, and determine the slow statement corresponding to each database to be optimized, wherein the slow statement is the structured query statement whose execution time exceeds the second time threshold in the historical log of the database to be optimized;

[0070] A first performance evaluation module 54, configured to determine a first performance parameter of a slow statement according to an indicator value of a performance evaluation indicator corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on database performance;

[0071] The second performance evaluation module 56 is used to determine the second performance parameter of the database to be optimized according to the first performance parameters of all slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the performance quality of the database to be optimized.

[0072] Optionally, the database performance determination device is also used to: execute each benchmark structured query statement in a database instance, and determine the average execution time of each benchmark structured query statement as the corresponding execution time of the database instance, wherein the benchmark structured query statements corresponding to each database instance are the same; when the execution time is greater than a first time threshold, determine that the performance of the database instance needs to be optimized, and determine the database instance as a database to be optimized; when the execution time is not greater than the first time threshold, determine that the performance of the database instance does not need to be optimized.

[0073] Optionally, determining the slow statement corresponding to each database to be optimized includes: accessing the database to be optimized based on access information corresponding to the database to be optimized, and obtaining a historical log corresponding to the database to be optimized, wherein the access information includes: a database network protocol address, a port, a login account and a password, and the historical log includes structured query statements historically executed by the database to be optimized and corresponding execution information; and determining a structured query statement in the historical log whose execution time exceeds a second time threshold as a slow statement corresponding to the database to be optimized.

[0074] Optionally, determining the first performance parameter of the slow statement includes: determining the index value of the performance evaluation index corresponding to each slow statement corresponding to the database to be optimized, wherein the performance evaluation index includes at least one of the following: the number of queries corresponding to the slow statement, the query duration, the waiting time, and the amount of retrieved data, wherein the waiting time is the length of time the query operation corresponding to the slow statement waits for obtaining a record lock when obtaining data; determining the first weight coefficient corresponding to each performance evaluation index of the slow statement, wherein the first weight coefficient is used to characterize the degree of demand for the performance evaluation index by the business corresponding to the slow statement; determining the first performance parameter of the slow statement based on the index value of each performance evaluation index corresponding to the slow statement and the first weight coefficient corresponding to each performance evaluation index.

[0075] Optionally, determining the second performance parameter of the database to be optimized based on the first performance parameters of all slow statements corresponding to the database to be optimized includes: determining a subsystem in the customer relationship management system associated with the database to be optimized, and determining a second weight coefficient corresponding to each database to be optimized based on a parameter of the degree of influence of the subsystem on the customer relationship management system, wherein the second weight coefficient is used to characterize the degree of influence of the database to be optimized on the customer relationship management system; determining the second performance parameter based on the first performance parameters of each slow statement corresponding to the database to be optimized and the second weight coefficient corresponding to the database to be optimized.

[0076] Optionally, after determining the second performance parameter of the database to be optimized, the database performance determination device is also used to: sort the database to be optimized in descending order of the second performance parameter, wherein the larger the second performance parameter, the higher the priority of the database to be optimized; and optimize the slow statements of each database to be optimized in turn according to the sorted order and based on statement optimization rules, wherein the statement optimization rules are used to convert the grammatical format of the slow statement, and the execution performance of the statement after the grammatical format conversion is better than that of the statement before the conversion, and the execution result of the statement is consistent with the execution result of the statement before the conversion.

[0077] Optionally, optimizing the slow statements of each database to be optimized in sequence includes: sorting the slow statements corresponding to the database to be optimized in descending order according to the first performance parameter of the slow statements, wherein the larger the first performance parameter is, the higher the priority of the slow statement for optimization; in the process of optimizing each database to be optimized, optimizing the slow statements corresponding to the database to be optimized in sequence according to the order of the sorted slow statements.

[0078] It should be noted that the various modules in the above-mentioned database performance determination device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0079] It should be noted that the database performance determination device provided in this embodiment can be used to perform Figure 2 The database performance determination method shown, therefore, the relevant explanations and instructions on the above-mentioned database performance determination method are also applicable to the embodiments of the present application and will not be repeated here.

[0080] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following database performance determination method by running the computer program: determining the execution time of a preset benchmark structured query statement in each database instance of the database cluster, wherein the database instance is a database system corresponding to each subsystem of the customer relationship management system in the database cluster; determining the database instance whose execution time of the benchmark structured query statement exceeds a first time threshold as a database to be optimized, and determining the slow statement corresponding to each database to be optimized, wherein the slow statement is a structured query statement whose execution time in the historical log of the database to be optimized exceeds a second time threshold; determining a first performance parameter of the slow statement based on the index value of the performance evaluation index corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on the database performance; determining a second performance parameter of the database to be optimized based on the first performance parameters of all slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the degree of performance of the database to be optimized.

[0081] The embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the database performance determination method described in each embodiment of the present application: determining the execution time of a preset benchmark structured query statement in each database instance of the database cluster, wherein the database instance is a database system corresponding to each subsystem of the customer relationship management system in the database cluster; determining a database instance whose execution time of the benchmark structured query statement exceeds a first time threshold as a database to be optimized, and determining a slow statement corresponding to each database to be optimized, wherein the slow statement is a structured query statement whose execution time in a historical log of the database to be optimized exceeds a second time threshold; determining a first performance parameter of the slow statement based on an index value of a performance evaluation index corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on the database performance; determining a second performance parameter of the database to be optimized based on the first performance parameters of all slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the degree of performance quality of the database to be optimized.

[0082] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0083] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0084] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0086] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0087] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0088] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for determining database performance, characterized in that: include: Determining the execution time of a preset benchmark structured query statement in each database instance of the database cluster, wherein the database instance is a database system in the database cluster corresponding to each subsystem of the customer relationship management system; The database instance whose execution time of the benchmark structured query statement exceeds the first time threshold is determined as a database to be optimized, and a slow statement corresponding to each of the databases to be optimized is determined, wherein the slow statement is a structured query statement whose execution time in the historical log of the database to be optimized exceeds the second time threshold; Determining a first performance parameter of the slow statement according to an indicator value of a performance evaluation indicator corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on database performance; According to the first performance parameters of all the slow statements corresponding to the database to be optimized, a second performance parameter of the database to be optimized is determined, wherein the second performance parameter is used to characterize the performance quality of the database to be optimized.

2. The method for determining database performance according to claim 1, characterized in that: The method further comprises: In the database instance, executing each of the benchmark structured query statements, and determining the average of the execution time of each of the benchmark structured query statements as the execution time corresponding to the database instance, wherein the benchmark structured query statements corresponding to each of the database instances are the same; When the execution time is longer than the first time threshold, determining that the performance of the database instance needs to be optimized, and determining the database instance as the database to be optimized; When the execution time is not greater than the first time threshold, it is determined that the performance of the database instance does not need to be optimized.

3. The method for determining database performance according to claim 1, characterized in that: Determining the slow statements corresponding to each of the databases to be optimized includes: According to the access information corresponding to the database to be optimized, access the database to be optimized, and obtain the historical log corresponding to the database to be optimized, wherein the access information includes: database network protocol address, port, login account and password, and the historical log includes the structured query statements historically executed by the database to be optimized and the corresponding execution information; The structured query statements in the historical log whose execution time exceeds the second time threshold are determined as the slow statements corresponding to the database to be optimized.

4. The method for determining database performance according to claim 3, characterized in that: Determining the first performance parameter of the slow statement includes: Determine the index value of the performance evaluation index corresponding to each of the slow statements corresponding to the database to be optimized, wherein the performance evaluation index includes at least one of the following: the number of queries, query duration, waiting duration, and amount of retrieved data corresponding to the slow statement, wherein the waiting duration is the duration of waiting for the query operation corresponding to the slow statement to obtain a record lock when obtaining data; Determine a first weight coefficient corresponding to each of the performance evaluation indicators of the slow sentence, wherein the first weight coefficient is used to characterize the degree of demand of the business corresponding to the slow sentence for the performance evaluation indicator; The first performance parameter of the slow sentence is determined according to the indicator value of each performance evaluation indicator corresponding to the slow sentence and the first weight coefficient corresponding to each performance evaluation indicator.

5. The method for determining database performance according to claim 4, characterized in that: Determining the second performance parameter of the database to be optimized according to the first performance parameters of all the slow statements corresponding to the database to be optimized includes: Determine the subsystems in the customer relationship management system that are associated with the database to be optimized, and determine the second weight coefficient corresponding to each of the databases to be optimized according to the parameter of the degree of influence of the subsystem on the customer relationship management system, wherein the second weight coefficient is used to characterize the degree of influence of the database to be optimized on the customer relationship management system; The second performance parameter is determined according to the first performance parameter of each of the slow statements corresponding to the database to be optimized and a second weight coefficient corresponding to the database to be optimized.

6. The method for determining database performance according to claim 1, characterized in that: After determining the second performance parameter of the database to be optimized, the method further includes: sorting the databases to be optimized according to the order of the second performance parameter from large to small, wherein the larger the second performance parameter is, the higher the optimization priority of the database to be optimized is; According to the sorted order and based on the statement optimization rules, the slow statements of each of the databases to be optimized are optimized in turn, wherein the statement optimization rules are used to convert the grammatical format of the slow statements, and the execution performance of the statements after the grammatical format conversion is better than that of the statements before the conversion, and the execution results of the statements are consistent with the execution results of the statements before the conversion.

7. The method for determining database performance according to claim 6, characterized in that: Optimizing the slow statements of each of the databases to be optimized in sequence includes: Sorting the slow statements corresponding to the database to be optimized in descending order of the first performance parameter of the slow statements, wherein the larger the first performance parameter, the higher the priority of the slow statement for optimization; In the process of optimizing each of the databases to be optimized, each of the slow statements corresponding to the database to be optimized is optimized in turn according to the sorted order of the slow statements.

8. A database performance determination device, characterized in that: include: An execution time determination module, used to determine the execution time of executing a preset benchmark structured query statement in each database instance of the database cluster, wherein the database instance is a database system in the database cluster corresponding to each subsystem of the customer relationship management system; A slow statement determination module is used to determine the database instance whose execution time of the benchmark structured query statement exceeds a first time threshold as a database to be optimized, and determine a slow statement corresponding to each of the databases to be optimized, wherein the slow statement is a structured query statement whose execution time exceeds a second time threshold in a historical log of the database to be optimized; A first performance evaluation module, configured to determine a first performance parameter of the slow statement according to an indicator value of a performance evaluation indicator corresponding to the slow statement, wherein the first performance parameter is used to characterize the degree of influence of the slow statement on database performance; The second performance evaluation module is used to determine the second performance parameter of the database to be optimized based on the first performance parameters of all the slow statements corresponding to the database to be optimized, wherein the second performance parameter is used to characterize the performance quality of the database to be optimized.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the database performance determination method described in any one of claims 1 to 7 when running.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the database performance determination method described in any one of claims 1 to 7 by running the computer program.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the database performance determination method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Database performance analysis method and device, electronic equipment, medium and product

    CN112527620A

  • Data query performance test method and device based on MySQL database

    CN112765017A

  • Slow query processing method and device, electronic equipment and storage medium

    CN112835921A

  • Information analysis method and device for database, electronic equipment and readable medium

    CN114625763A

  • Slow log analysis method and device for database, equipment and storage medium

    CN115630024A

Cited By

  • Database performance parameter optimization method and device and electronic equipment

    CN119807166A

  • Methods, apparatus, and electronic devices for optimizing database performance parameters

    CN119807166B