CN-122019328-A - Performance evaluation method and device for storage process, electronic equipment and storage medium
Abstract
The application discloses a performance evaluation method and device of a storage process, electronic equipment and a storage medium, and relates to the technical field of big data or other related fields; according to the unfavorable operation condition list, simulating unfavorable operation conditions according to database table field information and variable information to obtain a simulated operation parameter set, executing SQL sentences by using the simulated operation parameter set, acquiring execution plan information and performance data corresponding to each SQL sentence in the execution process, analyzing the execution plan information and the performance data to obtain a performance evaluation report, wherein the SQL sentences with performance scores lower than a standard threshold are identified in the performance evaluation report. The application solves the technical problems that the performance evaluation of the existing storage process in the related technology depends on the actual operation parameters of production and the performance influence condition cannot be tested and evaluated in advance.
Inventors
- ZHOU JIANWU
Assignees
- 中国工商银行股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260130
Claims (11)
- 1. A method of evaluating performance of a stored procedure, comprising: carrying out grammar analysis on the target stored process code by using a preset analyzer generator to obtain a grammar analysis result, wherein the grammar analysis result comprises SQL sentences, database table field information and variable information related in the storage process; Simulating unfavorable operation conditions according to the database table field information and the variable information according to the unfavorable operation condition list to obtain a simulated operation parameter set; executing the SQL sentences by using the simulated operation parameter set, and acquiring execution plan information and performance data corresponding to each SQL sentence in the execution process; Analyzing the execution plan information and the performance data to obtain a performance evaluation report, wherein the SQL statement with the performance score lower than a standard threshold is identified in the performance evaluation report.
- 2. The performance evaluation method according to claim 1, wherein the step of parsing the target stored procedure code using a predetermined parser generator to obtain a result of the syntax parsing, comprises: Acquiring a target grammar structure used by a target database system, and carrying out initialization configuration on the parser generator according to the target grammar structure; preprocessing the target stored procedure code, wherein the preprocessing comprises formatting and comment cleaning; And analyzing the preprocessed target stored procedure code by using the analyzer generator after initializing configuration to obtain the grammar analysis result containing the SQL sentence, the database table field information and the variable information.
- 3. The performance evaluation method according to claim 1, wherein the adverse running condition list is constructed by: collecting performance bottleneck data of a target storage process in a historical operation period from a system database, wherein the performance bottleneck data at least comprises operation data marked as high data volume and/or complex query mode; Analyzing each piece of performance bottleneck data based on a database theory to obtain a corresponding performance influence type, wherein the performance influence type comprises index deficiency and data uneven distribution; Defining a boundary range of adverse operating conditions in combination with the performance bottleneck data and the corresponding performance impact type; and integrating boundary ranges of the unfavorable operating conditions corresponding to all the performance bottleneck data, and establishing the unfavorable operating condition list.
- 4. The performance evaluation method according to claim 1, wherein the step of simulating unfavorable operating conditions according to the database table field information and the variable information to obtain a simulated operating parameter set according to a list of unfavorable operating conditions, comprises: For each unfavorable operating condition, mapping the boundary range of the unfavorable operating condition to a database table field corresponding to a target database according to the database table field information to obtain a first simulation operating parameter; mapping the boundary range of the unfavorable operating condition to a database variable corresponding to the target database according to the variable information to obtain a second simulation operating parameter; and integrating the first simulation operation parameters and the second simulation operation parameters to obtain the simulation operation parameter set.
- 5. The performance evaluation method according to claim 1, wherein the step of executing the SQL statements using the simulated running parameter set and acquiring execution plan information corresponding to each of the SQL statements during execution comprises: based on the numerical value in the simulation operation parameter set, assigning a variable in the SQL sentence to obtain an SQL sentence to be executed; Requesting an execution plan corresponding to the SQL statement from a target database system, and extracting key operators in the execution plan, wherein the key operators comprise an index scanning operator and a table scanning operator; Injecting the key operator into the SQL sentence to be executed, and executing the SQL sentence; And in the execution process, acquiring fluctuation information of the key operator to obtain the execution plan information.
- 6. The performance evaluation method according to claim 5, wherein the step of executing the SQL statements using the simulated running parameter set and acquiring performance data corresponding to each of the SQL statements during execution comprises: in the execution process, the operation monitoring data of the SQL statement is obtained at regular time; analyzing the operation monitoring data according to a preset performance index list to obtain the performance data, wherein the performance data comprises query duration and data line number.
- 7. The performance evaluation method according to claim 1, wherein the step of analyzing the execution plan information and the performance data to obtain a performance evaluation report includes: calculating the execution plan information and the performance data according to a preset scoring rule to obtain a performance score of each SQL sentence; And screening the SQL sentences with the performance scores lower than the standard threshold, and writing the SQL sentences, the corresponding performance data and the execution plan information into the performance evaluation report.
- 8. A performance evaluation device for a stored procedure, comprising: the parsing unit is used for carrying out grammar parsing on the target stored process code by using a preset parser generator to obtain a grammar parsing result, wherein the grammar parsing result comprises SQL sentences, database table field information and variable information related in the storage process; the simulation unit is used for simulating unfavorable operation conditions according to the database table field information and the variable information according to the unfavorable operation condition list to obtain a simulated operation parameter set; the execution unit is used for executing the SQL sentences by using the simulation operation parameter set and acquiring the execution plan information and the performance data corresponding to each SQL sentence in the execution process; and the analysis unit is used for analyzing the execution plan information and the performance data to obtain a performance evaluation report, wherein the SQL statement with the performance score lower than a standard threshold is identified in the performance evaluation report.
- 9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the performance evaluation method of the storage procedure according to any one of claims 1 to 7.
- 10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of performance evaluation of a stored procedure of any of claims 1-7.
- 11. A computer program product comprising computer instructions which, when executed by a processor, implement the steps of the stored procedure performance assessment method of any one of claims 1 to 7.
Description
Performance evaluation method and device for storage process, electronic equipment and storage medium Technical Field The present invention relates to the field of big data technology or other related fields, and in particular, to a performance evaluation method and apparatus for a stored procedure, an electronic device, and a storage medium. Background In the age of today where data intensive applications prevail, enterprise-level databases = are carrying unprecedented data access and processing pressures. With the explosive growth of data volume, distributed database designs and architectures are becoming increasingly important, aiming at improving the efficiency and reliability of data processing and meeting the business requirements of high concurrency and high throughput. However, despite the great progress made in distributed database technology, performance assessment of stored procedures in predicting and coping with problems of reduced data processing efficiency under extreme conditions still faces serious challenges. Conventional storage process performance assessment approaches often rely on analysis of actual operational data in a production environment, where optimization is only perceived and undertaken when the storage process is faced with a large amount of data or a particular data distribution, and this process is often delayed and passive. Even more troublesome is that even actual operation in a production environment does not necessarily cover all potential performance risk points due to the complexity and parameter dependencies of the stored procedure call links. Not only is maintenance cost increased, but also the user experience is damaged and the service is interrupted due to the fact that the performance problem is not recognized and repaired in time. In view of the above problems, no effective solution has been proposed at present. Disclosure of Invention The application aims to provide a performance evaluation method and device for a storage process, electronic equipment and a storage medium, which at least solve the technical problem that the performance evaluation of the existing storage process in the related technology depends on actual production operation parameters and cannot test and evaluate performance influence conditions in advance. In order to achieve the above object, according to one aspect of the present application, there is provided a performance evaluation method of a storage process, the method including parsing a target storage process code using a preset parser generator to obtain a syntax parsing result, wherein the syntax parsing result includes SQL statements, database table field information, and variable information involved in the storage process, simulating unfavorable operating conditions according to a list of unfavorable operating conditions according to the database table field information and the variable information to obtain a set of simulated operating parameters, executing the SQL statements using the set of simulated operating parameters, and acquiring execution plan information and performance data corresponding to each SQL statement during execution, and analyzing the execution plan information and the performance data to obtain a performance evaluation report, wherein the SQL statements having performance scores lower than a standard threshold are identified in the performance evaluation report. Further, the method comprises the steps of carrying out grammar analysis on target storage process codes by using a preset parser generator to obtain grammar analysis results, wherein the grammar analysis results comprise the steps of obtaining target grammar structures used by a target database system, carrying out initialization configuration on the parser generator according to the target grammar structures, and carrying out preprocessing on the target storage process codes, wherein the preprocessing comprises formatting processing and comment cleaning, and carrying out analysis on the preprocessed target storage process codes by using the parser generator after the initialization configuration to obtain the grammar analysis results comprising SQL sentences, database table field information and variable information. Further, the adverse operation condition list is constructed by collecting performance bottleneck data of a target storage process in a historical operation period from a system database, wherein the performance bottleneck data at least comprise operation data marked as high data volume and/or complex query mode, analyzing each piece of performance bottleneck data based on database theory to obtain corresponding performance influence types, wherein the performance influence types comprise index deficiency and data uneven distribution, defining boundary ranges of adverse operation conditions by combining the performance bottleneck data and the corresponding performance influence types, and integrating the boundary ranges of the advers