Performance analysis method and device for query language, equipment, medium and product

By combining the time-consuming, number of calls, table data volume and call interface of the subquery language, SQL performance analysis is performed using the data processing model, and the problem of stereotyped inspection rules in the static code scanning method is solved, and efficient and accurate SQL performance analysis is achieved and optimize.

CN119322786APending Publication Date: 2025-01-17DIGITAL GUANGDONG NETWORK CONSTR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411439710.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

When analyzing SQL statements, the existing static code scanning methods check the rules are relatively rigid and cannot adapt to various actual business needs, which are prone to false positives, and it is difficult to comprehensively consider the overall functional logic of the project, the actual call frequency of the programming language, and the database. Factors such as table design and index design have led to low efficiency and quality of SQL performance analysis.

Method used

By determining the target evaluation parameters of the query language to be analyzed, including the time-consuming, number of calls, table data volume and call interface of the subquery language, combined with the data processing model for comprehensive analysis, automated scoring and optimization interface, providing detailed performance diagnostic conclusions and optimization suggestions.

Benefits of technology

It improves the efficiency and quality of SQL performance analysis, reduces the false positive rate, and can more accurately identify interfaces that need to be optimized, saves performance analysis costs, and adapts to a variety of actual business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322786A_ABST
    Figure CN119322786A_ABST
Patent Text Reader

Abstract

The invention discloses a query language performance analysis method and device, equipment, a medium and a product, and relates to the technical field of query language evaluation.The method comprises the steps that target evaluation parameters of a to-be-analyzed query language are determined, and the to-be-analyzed query language comprises at least one sub-query language; the target evaluation parameters comprise time consumption, calling times, table data volume and calling interfaces of at least one sub-query language; determining an interface score of the at least one sub-query language based on the target evaluation parameter of the to-be-analyzed query language, further determining a target processing interface of the at least one sub-query language, and processing the evaluation parameter of the target processing interface by using the data processing model to obtain an analysis conclusion of the to-be-analyzed query language. According to the method, the to-be-analyzed query language is automatically and comprehensively analyzed by combining the time consumption, the calling times, the table data volume, the calling interface and the data processing model of the at least one sub-query language, and the SQL performance analysis efficiency and quality are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of query language evaluation, and in particular to a query language performance analysis method, device, equipment, medium and product. Background Art

[0002] Database is a common way to save data in the process of business system development. Large-scale software project development requires frequent Structured Query Language (SQL) operations on the database. Therefore, the performance of SQL is one of the issues that attracts much attention.

[0003] At present, the query method of SQL is mainly static code scanning. Static code scanning is a quality-left shift method that can automatically discover security defects, code specifications and code defects in SQL code, help developers detect and fix errors, vulnerabilities and quality problems in the code, and reduce development costs and repair costs. However, static code scanning requires the use of static code scanning tools. When analyzing the static parameters of SQL statements, the tool focuses on analyzing the syntax of SQL statements, that is, forming corresponding inspection rules based on the writing specifications of SQL statements. The inspection rules are relatively rigid and cannot adapt to a variety of actual business needs, which easily leads to false positives. Summary of the invention

[0004] The present invention provides a query language performance analysis method, device, equipment, medium and product, which automatically conducts a comprehensive analysis of the query language to be analyzed by combining the time consumption, number of calls, table data volume, call interface and data processing model of at least one sub-query language, thereby improving the efficiency and quality of SQL performance analysis.

[0005] According to one aspect of the present invention, a method for performance analysis of a query language is provided, the method comprising:

[0006] Determine target evaluation parameters of the query language to be analyzed, wherein the query language to be analyzed includes at least one sub-query language, and the target evaluation parameters include time consumption, number of calls, table data volume, and calling interface of the at least one sub-query language;

[0007] Determine an interface score of at least one sub-query language based on the time consumption, number of calls, table data volume, and calling interface of at least one sub-query language;

[0008] Based on the interface score of at least one sub-query language, a target processing interface of at least one sub-query language is determined, and the evaluation parameters of the target processing interface are processed using a data processing model to obtain an analysis conclusion of the query language to be analyzed, wherein the target processing interface includes at least one sub-processing interface, and the sub-processing interface and the sub-query language have a one-to-one correspondence.

[0009] According to another aspect of the present invention, a query language performance analysis device is provided. The query language performance analysis device is used to implement the query language performance analysis method in any embodiment of the present invention. The device includes:

[0010] An information acquisition module, used to determine target evaluation parameters of the query language to be analyzed, wherein the query language to be analyzed includes at least one sub-query language, and the target evaluation parameters include the time consumption, number of calls, table data volume and calling interface of the at least one sub-query language;

[0011] An interface scoring module, used to determine an interface score of at least one sub-query language based on the time consumption, number of calls, table data volume and calling interface of at least one sub-query language;

[0012] The conclusion determination module is used to determine the target processing interface of at least one sub-query language based on the interface score of at least one sub-query language, and use the data processing model to process the evaluation parameters of the target processing interface to obtain the analysis conclusion of the query language to be analyzed, wherein the target processing interface includes at least one sub-processing interface, and the sub-processing interface and the sub-query language correspond one to one.

[0013] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0014] at least one processor; and a memory communicatively coupled to the at least one processor;

[0015] The memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the performance analysis method of the query language in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the performance analysis method of the query language in any embodiment of the present invention when executed.

[0017] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the performance analysis method of the query language of any embodiment of the present invention is implemented.

[0018] The performance analysis method of the query language of the present invention comprises: determining the target evaluation parameters of the query language to be analyzed, wherein the query language to be analyzed includes at least one sub-query language, and the target evaluation parameters include the time consumption, number of calls, table data volume and calling interface of at least one sub-query language; based on the time consumption, number of calls, table data volume and calling interface of at least one sub-query language, determining the interface score of at least one sub-query language; based on the interface score of at least one sub-query language, determining the target processing interface of at least one sub-query language, and processing the evaluation parameters of the target processing interface using a data processing model to obtain an analysis conclusion of the query language to be analyzed, wherein the target processing interface includes at least one sub-processing interface, and the sub-processing interface and the sub-query language correspond one to one. The technical scheme of the present invention combines the time consumption, number of calls, table data volume, calling interface and data processing model of at least one sub-query language to automatically perform a comprehensive analysis on the query language to be analyzed, that is, comprehensively considering the overall functional logic of the project engineering, the actual calling frequency of the programming language, the database table design, the index design, the actual calling frequency and other factors to analyze the SQL performance, improve the efficiency and quality of SQL performance analysis, and save the cost of SQL performance analysis. It solves the problem that the inspection rules in the static code scanning method are relatively rigid, cannot adapt to a variety of actual business needs, and are prone to false alarms.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0021] Figure 1 It is a flow chart of a performance analysis method of a query language provided by the present invention;

[0022] Figure 2 It is a structural schematic diagram of a performance analysis device for a query language provided by the present invention;

[0023] Figure 3 It is a structural schematic diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Fixed template scanning tools can only scan scenarios with fixed contexts, and it is difficult to comprehensively analyze SQL performance by taking into account factors such as overall functional logic, actual call frequency, database table design, index design, and actual call frequency. For example, assuming that interface A is 1000QPS (QPS represents the number of successful requests to the server per second for a single process), the actual call takes 500ms, and interface B is 1QPS, which actually takes 2s. When optimizing the system, although interface A takes less time to call than interface B, interface A has a higher QPS, so it is still necessary to focus on optimizing interface A. However, the existing code review method cannot be combined with the interface call frequency for analysis, and will misjudge that interface B has a higher optimization priority than interface A. The performance analysis method proposed in the present invention aims to comprehensively consider factors such as overall functional logic, actual call frequency, database table design, index design, and actual call frequency, and to automatically and high-qualityly perform SQL performance analysis.

[0027] Figure 1 The flowchart of the performance analysis method of a query language provided by the present invention is shown in Figure 1. This embodiment is applicable to the comprehensive, efficient and integrated analysis of SQL performance. The method can be executed by the performance analysis device of the query language provided by the present invention. The device can be implemented in the form of hardware and / or software. In a specific embodiment, the device can be integrated in an electronic device. The following embodiments will be described by taking the device integrated in an electronic device as an example. Figure 1 , the method specifically comprises the following steps:

[0028] S101: Determine target evaluation parameters of the query language to be analyzed.

[0029] Among them, the query language to be analyzed can be understood as the programming language of the software project, and the software project is constructed by multiple programming languages. The query language to be analyzed includes at least one sub-query language, and the target evaluation parameters can be understood as information used to evaluate the performance of at least one sub-query language, including the time consumption, number of calls, table data volume and calling interface of at least one sub-query language.

[0030] Specifically, the query language (i.e., SQL statement) time usually refers to the time required to execute an SQL query or operation, which starts from the time the database receives the query request and ends when the database completes the query and returns the result to the requester. The time is limited by factors such as query complexity, data volume, index usage, database design, server performance, network latency, concurrent access, database configuration, locks and transactions, and query optimizer. The number of SQL statement calls usually refers to the number of times the SQL statement is executed on the database within a certain period of time. It can be used to monitor the load and performance of the database, evaluate the frequency of database operations, and assist technical personnel in understanding the usage pattern of the database, predict future resource requirements, and expand or optimize when necessary. Analyzing the changing trend of the number of calls can also discover potential performance problems or abnormal behaviors. The number of calls is limited by factors such as business needs, number of users, application design, database optimization, concurrent processing capabilities, database monitoring tools, slow query logs, database connection pools, automatic expansion, and load balancing. The table data volume of an SQL statement refers to the number of rows contained in a specific table in the database, that is, the number of data records stored in the table. The table data volume is directly related to query efficiency, storage space requirements, and the overall performance of the database, and is very important for database design, performance optimization, and resource planning. The table data volume is related to factors such as data scale, query performance, storage space, index optimization, paging processing, data maintenance, backup and recovery, data archiving, partitioning strategy, and hardware resources. The calling interface of an SQL statement usually refers to the programming interface for interaction between an application and a database. The interface allows developers to execute SQL statements in their applications to query, insert, update, or delete data in the database. The interface includes but is not limited to the standard interface for Java applications to interact with databases (Java Database Connectivity, JDBC), the standard database access interface (OpenDatabase Connectivity, ODBC), the interface for database access technology for the .NET framework (ADO.NET), the database interface (Database Interface, DBI) of the Perl language, and the SQL toolkit and object-relational mapping (ORM) framework (SQLAlchemy) of Python.

[0031] The benefit of this setting is that all SQL statements and their operating parameters of the software project can be determined, so as to accurately and comprehensively analyze the performance of the query language of the software project.

[0032] In one embodiment, S101 may specifically include: determining candidate operation logs of the query language to be analyzed, and processing the candidate operation logs using a data processing model to obtain a first evaluation parameter of the query language to be analyzed, wherein the first evaluation parameter of the query language to be analyzed includes the time consumption, number of calls, calling interface and first database table name of at least one sub-query language; based on the data structure of the database table corresponding to the query language to be analyzed, determining a second evaluation parameter of the query language to be analyzed, wherein the second evaluation parameter of the query language to be analyzed includes a second database table name and table data volume of at least one sub-query language; based on the matching result of the first database table name and the second database table name, merging the first evaluation parameter and the second evaluation parameter of the query language to be analyzed, and determining the target evaluation parameter of the query language to be analyzed according to the merging result.

[0033] The candidate operation log can be understood as the log generated by the technician when performing user page testing. The data processing model can be understood as a large language model, which can be used to analyze the performance prediction parameters of SQL, for example, to analyze the complexity, data volume, index usage, etc. of SQL queries, and then predict the execution time or resource consumption of SQL queries. The target evaluation parameters can be understood as the necessary data for determining SQL performance, including the log data during the joint debugging and deployment of the test environment and the data level of the database data definition language (DDL) statement. Among them, the log data during the joint debugging and deployment of the test environment can be understood as the first evaluation parameter of the query language to be analyzed, and the data level of the database DDL statement can be understood as the second evaluation parameter of the query language to be analyzed. In addition, when processing the data to obtain the target evaluation parameters, the functional logic of the engineering code will also be analyzed to obtain the code logic evaluation parameters, which can be combined with the first evaluation parameter and the second evaluation parameter of the subquery language after parsing the target processing interface of the subquery language to determine the performance and optimization suggestions of the subquery language.

[0034] Exemplarily, the process of determining the target evaluation parameters includes: 1) turning on the service SQL log printing function to output the service operation log and SQL statement, and the technical staff performs user page testing in the system to generate sufficient logs, and the collected system operation log containing SQL is input into the data processing model as the analysis input source for preprocessing to obtain the interface path (i.e., calling interface), number of interface calls, SQL statement, SQL time consumption, number of SQL calls and database table name, as shown in Table 1.

[0035] Table 1

[0036]

[0037] Among them, statement 1 is select * from user where identityCode = ? 1; statement 2 is select * from `group` where adminId = ? 1.

[0038] 2) Collect engineering code (the interface methods in the code will annotate the corresponding interface requirements), input the collected code into the data processing model and combine it with the functional logic for overall optimization analysis (for example, if SQL statement queries are performed multiple times in an interface, the number of SQL queries that can be optimized is analyzed based on the actual functional requirements, thereby improving the overall performance), and obtain the requirements, interface paths, and code logic, as shown in Table 2.

[0039] Table 2

[0040] need Interface Path Code logic Query logged-in user information GET / api / user Logic 1 Add a new group GET / api / group Logic 2

[0041] Among them, logic 1 is to query user information according to user ID, and logic 2 is to check whether the group name already exists. If not, a new group is created.

[0042] 3) Collect database DDL statements (including detailed information such as indexes) and use them as the analysis input source, mark the data level of each data table, and parse the correspondence between database table name, table design and table data volume, as shown in Table 3.

[0043] Table 3

[0044] Database table name Table Design Table data volume User Design 1 100000 group Design 2 500

[0045] Among them, design 1 is:--table structure

[0046] create table user (

[0048] id varchar(36)not null comment'ID'

[0049] primary key,

[0050] identityCode varchar(60)null comment'certificate number',

[0051] name varchar(255)null comment'User name' )

[0053] comment'user';

[0054] --index

[0055] create index inx_name

[0056] on user(name);

[0057] Design 2 is:--Table structure

[0058] create table `group` (

[0060] id varchar(36)not null comment'ID'

[0061] primary key,

[0062] name varchar(255)null comment'Group name';

[0063] adminId varchar(36)null comment'Administrator ID' )

[0065] comment'group';

[0066] 4) Based on the association relationship of "interface path" and the association relationship of "database table name", the data obtained from step 1) to step 3) are sorted to obtain the target evaluation parameters. The target evaluation parameters can be a comprehensive information table, including the interface number (which can be automatically generated and used to identify the interface), interface path, number of interface calls, SQL statement, SQL time consumption, number of SQL calls, requirements, database table name, table design and table data volume, as shown in Table 4.

[0067] Table 4

[0068]

[0069]

[0070] Since the input source is complex and the data volume is large, divergence problems and slow operation problems may occur when analyzing SQL performance with a large language model. Therefore, the present invention will pre-process the data. For example, important functional interface performance indicators are extracted from three types of operating data: system logs, engineering codes, and database DDL, to reduce the amount of data processing and avoid model divergence problems.

[0071] S102: Determine an interface score of at least one sub-query language based on the time consumption, number of calls, table data volume, and calling interface of at least one sub-query language.

[0072] The interface score of at least one sub-query language can be understood as a performance score of at least one sub-query language based on the time consumption, number of calls, table data volume and calling interface of at least one sub-query language, which is used to evaluate the degree of optimizability of each sub-query language.

[0073] The advantage of this setting is that the optimizability of each sub-query language can be quantified, so as to screen the sub-query languages ​​and their optimization interfaces that need to be optimized, and then formulate targeted optimization strategies.

[0074] In one embodiment, S102 may specifically include: determining the interface score of at least one sub-query language based on the time consumption, number of calls, table data volume and calling interface of at least one sub-query language, including: determining the optimization information of at least one sub-query language based on the time consumption, number of calls and table data volume of at least one sub-query language; determining the interface call probability of at least one intermediate processing interface based on the calling interface and number of calls of at least one sub-query language; determining the interface score of at least one sub-query language based on the optimization information of at least one sub-query language and the interface call probability of at least one intermediate processing interface, wherein the sub-query language includes i scores, and i is the number of intermediate processing interfaces.

[0075] Among them, the optimization information of at least one sub-query language can be understood as the optimization degree score of each sub-query language. The sub-query language may be processed through any interface (i.e., intermediate processing interface) in the software project, and the interface call probability of at least one intermediate processing interface can be understood as the usage probability of each intermediate processing interface. The sub-query language may pass through any interface in the software project, so a sub-query language will have multiple interface scores, that is, the score of the sub-query language for each intermediate processing interface will be calculated. For any interface, the interface score of the sub-query language is the product of the optimization information of the sub-query language and the interface call probability of the interface.

[0076] The benefit of this setting is to determine the detailed interface score of each sub-query language so as to locate the interface that needs to be optimized in the sub-query language and reduce the workload of performance analysis.

[0077] Based on the time consumption, number of calls and table data volume of at least one sub-query language, the optimization information of at least one sub-query language is determined, including: using a preset call time consumption duration and a time consumption scoring rule to process the time consumption of at least one sub-query language to obtain the time consumption optimization information of at least one sub-query language; using a preset call quantity threshold and a quantity scoring rule to process the number of calls of at least one sub-query language to obtain the quantity optimization information of at least one sub-query language; using a preset data volume scoring rule to process the table data volume of at least one sub-query language to obtain the table data volume optimization information of at least one sub-query language; based on the time consumption optimization information, quantity optimization information and table data volume optimization information of at least one sub-query language, the optimization information of at least one sub-query language is determined.

[0078] The optimization information of the subquery language includes time-consuming optimization information, quantity optimization information and table data volume optimization information. For any subquery language, the optimization information is the sum of the time-consuming optimization information, quantity optimization information and table data volume optimization information.

[0079] Take a subquery language as an example. Assume that the preset time-consuming scoring rule is that if the SQL call time is less than or equal to 100ms, 1 point is given. Every additional 100ms adds 1 point, and the full score is 10 points. The call time is the time length in the time-consuming scoring rule, that is, 100ms. Then the time-consuming optimization information Among them, T 调用耗时 Indicates the time consumed by the subquery language. Assuming that the preset data volume scoring rule is that the number of SQL calls is 1 point, and the score increases by 1 point for each additional SQL call, with a full score of 10 points, then the quantity optimization information Score 数量 =min(10,2*n sql调用数量 ), where n sql The number of calls indicates the number of calls to the subquery language. Assume that the pre-set data volume scoring rule is to obtain the database tables and table levels involved in the current interface, calculate the natural logarithm of the input base 10 for each table, and obtain the single table score after adjustment. Finally, the average sum of the scores of all tables involved in the current interface is obtained to obtain the data volume score. Table data volume optimization information Where n represents the number of data tables, N i Indicates the amount of table data in the subquery language, optimization information Score = Score 耗时 +Score 数量 +Score 表数据量 .

[0080] Based on the calling interface and calling times of at least one sub-query language, the interface calling probability of at least one intermediate processing interface is determined, including: based on the calling interface and calling times of at least one sub-query language, the total number of interface calls, at least one intermediate processing interface and the calling times of at least one intermediate processing interface are determined; and the total number of interface calls, at least one intermediate processing interface and the calling times of at least one intermediate processing interface are processed by using a preset interface calling probability calculation rule to obtain the interface calling probability of at least one intermediate processing interface.

[0081] The total number of interface calls is the sum of the number of calls of all interfaces. The number of calls of the intermediate processing interface can be understood as the number of times the intermediate processing interface is called. The pre-set interface call probability calculation rules include but are not limited to calculating the call probability by proportion and calculating the call probability by proportion and number of interfaces.

[0082] In one embodiment, the intermediate processing interface A i The probability of interface call Where T represents the total number of interface calls, C i Indicates intermediate processing interface A i The number of calls, n represents the total number of interfaces. Subquery language j processes interface A in the middle i Interface score S j =P(A i )*Score j , where Score j Indicates the optimization information of subquery language j.

[0083] Furthermore, after obtaining the interface scores of each sub-query language, they will be aligned and standardized to standardize the interface scores to between 0 and 1 for the convenience of comprehensive evaluation. i Standardized interface scores at Among them, max(S) represents the maximum interface score, and min(S) represents the minimum interface score.

[0084] SQL time consumption and SQL quantity can generally directly reflect the performance problems of the interface, while the influencing factors of table data volume are not easy to be discovered in the development environment. The present invention introduces the predicted table data volume and uses the table data volume as an important factor in scoring, which can avoid the problem of performance failures caused by table data volume being discovered after the project is launched in the production environment, thereby reducing the modification cost and price of the project.

[0085] S103: Based on the interface score of at least one sub-query language, determine the target processing interface of at least one sub-query language, and use the data processing model to process the evaluation parameters of the target processing interface to obtain an analysis conclusion of the query language to be analyzed.

[0086] Among them, the target processing interface can be understood as the SQL interface information that has performance problems and needs to be optimized. The target processing interface includes at least one sub-processing interface. The sub-processing interface and the sub-query language correspond one to one. The analysis conclusion is used to indicate the SQL detection status and optimization suggestions of the project.

[0087] For example, if the interface score of language 1 at interface 2 is abnormal, interface 2 is determined to be the target processing interface of language 1, and all parameter information of language 1 at interface 2 is parsed using the data processing model to determine the performance diagnosis conclusion and optimization suggestions for language 1 so that developers can adjust the project code in a timely manner.

[0088] In one embodiment, S103 may specifically include: determining a score greater than a preset score threshold in the interface score of at least one sub-query language as a target score, and determining a processing interface corresponding to the target score as a target processing interface of at least one sub-query language; determining evaluation parameters of at least one sub-query language at the target processing interface, and using a data processing model to process the evaluation parameters of at least one sub-query language at the target processing interface to obtain a performance diagnosis conclusion and a processing plan for the query language to be analyzed, wherein the processing plan is an optimization suggestion and / or an index suggestion.

[0089] Among them, the preset score threshold can be understood as a pre-set score value. It is considered that the interface score greater than the score value is unreasonable and there is a performance problem, which requires further analysis. Otherwise, it will affect the functional implementation of the project and the safety of online use. The preset score thresholds include 0.5, 0.6, etc. The specific score value is related to the evaluation logic and the performance requirements of the project, and the present invention is not limited to this.

[0090] The present invention proposes a SQL optimization scoring mechanism to screen out key interfaces, and uses a data processing model to parse the screened key interfaces, and combines the number of interface calls, SQL statements, table design, and table data volume to perform SQL analysis, providing SQL optimization suggestions and index suggestions with high accuracy and good performance. Secondly, index suggestions can help developers quickly locate exceptions in the case of large amounts of data, shorten information search time, and improve exception handling efficiency.

[0091] The technical solution of this embodiment combines the time consumption, call times, table data volume, call interface and data processing model of at least one sub-query language to automatically conduct a comprehensive analysis of the query language to be analyzed, that is, comprehensively consider the overall functional logic of the project, the actual call frequency of the programming language, the database table design, the index design, the actual call frequency and other factors to analyze the SQL performance, improve the efficiency and quality of SQL performance analysis, and save the cost of SQL performance analysis. It solves the problem that the inspection rules in the static code scanning method are relatively rigid, cannot adapt to a variety of actual business needs, and are prone to false alarms.

[0092] Figure 2 FIG. 1 is a schematic diagram of a performance analysis device for a query language provided by the present invention. Figure 2 As shown, the device includes: an information acquisition module 201, an interface scoring module 202 and a conclusion determination module 203.

[0093] The information acquisition module 201 is used to determine target evaluation parameters of the query language to be analyzed, wherein the query language to be analyzed includes at least one sub-query language, and the target evaluation parameters include the time consumption, number of calls, table data volume and calling interface of the at least one sub-query language.

[0094] The interface scoring module 202 is used to determine the interface score of at least one sub-query language based on the time consumption, call times, table data volume and call interface of at least one sub-query language.

[0095] The conclusion determination module 203 is used to determine the target processing interface of at least one sub-query language based on the interface score of at least one sub-query language, and use the data processing model to process the evaluation parameters of the target processing interface to obtain the analysis conclusion of the query language to be analyzed, wherein the target processing interface includes at least one sub-processing interface, and the sub-processing interface and the sub-query language correspond one to one.

[0096] Optionally, the information acquisition module 201 is specifically used to determine candidate running logs of the query language to be analyzed, and use the data processing model to process the candidate running logs to obtain a first evaluation parameter of the query language to be analyzed, wherein the first evaluation parameter of the query language to be analyzed includes the time consumption, number of calls, calling interface and first database table name of at least one sub-query language; based on the data structure of the database table corresponding to the query language to be analyzed, determine the second evaluation parameter of the query language to be analyzed, wherein the second evaluation parameter of the query language to be analyzed includes the second database table name and table data volume of at least one sub-query language; based on the matching result of the first database table name and the second database table name, merge the first evaluation parameter and the second evaluation parameter of the query language to be analyzed, and determine the target evaluation parameter of the query language to be analyzed according to the merged result.

[0097] Optionally, the interface scoring module 202 is specifically used to determine the interface score of at least one sub-query language based on the time consumption, number of calls, table data volume and calling interface of at least one sub-query language, including: determining the optimization information of at least one sub-query language based on the time consumption, number of calls and table data volume of at least one sub-query language; determining the interface call probability of at least one intermediate processing interface based on the calling interface and number of calls of at least one sub-query language; determining the interface score of at least one sub-query language based on the optimization information of at least one sub-query language and the interface call probability of at least one intermediate processing interface, wherein the sub-query language includes i scores, and i is the number of intermediate processing interfaces.

[0098] Optionally, the interface scoring module 202 is specifically used to process the time consumption of at least one sub-query language using a preset call time duration and a time consumption scoring rule to obtain the time consumption optimization information of at least one sub-query language; process the number of calls of at least one sub-query language using a preset call quantity threshold and a quantity scoring rule to obtain the quantity optimization information of at least one sub-query language; process the table data volume of at least one sub-query language using a preset data volume scoring rule to obtain the table data volume optimization information of at least one sub-query language; and determine the optimization information of at least one sub-query language based on the time consumption optimization information, quantity optimization information and table data volume optimization information of at least one sub-query language.

[0099] Optionally, the interface scoring module 202 is specifically used to determine the total number of interface calls, at least one intermediate processing interface, and the number of calls of at least one intermediate processing interface based on the calling interface and the number of calls of at least one sub-query language; and to process the total number of interface calls, at least one intermediate processing interface, and the number of calls of at least one intermediate processing interface using a pre-set interface call probability calculation rule to obtain the interface call probability of at least one intermediate processing interface.

[0100] Optionally, the conclusion determination module 203 is specifically used to determine a score greater than a preset score threshold in the interface score of at least one sub-query language as a target score, and determine a processing interface corresponding to the target score as a target processing interface of at least one sub-query language; determine evaluation parameters of at least one sub-query language at the target processing interface, and use a data processing model to process the evaluation parameters of at least one sub-query language at the target processing interface to obtain a performance diagnosis conclusion and a processing plan for the query language to be analyzed, wherein the processing plan is an optimization suggestion and / or an index suggestion.

[0101] The performance analysis device for the query language provided in this embodiment can execute the performance analysis method for the query language provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0102] Figure 3 : is a schematic diagram of the structure of an electronic device provided by the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0103] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (also called random access memory, RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0104] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0105] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a performance analysis method of a query language.

[0106] In some embodiments, the performance analysis method of the query language may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the performance analysis method of the query language described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the performance analysis method of the query language in any other appropriate manner (e.g., by means of firmware).

[0107] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0108] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0109] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0110] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, language input, or tactile input).

[0111] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server) or a computing system that includes middleware components (e.g., an application server) or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein) or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0112] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0113] In one embodiment, the present invention further includes a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the performance analysis method of the query language of any embodiment of the present invention is implemented.

[0114] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0115] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0116] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A performance analysis method for a query language, characterized in that: include: Determining target evaluation parameters of the query language to be analyzed, wherein the query language to be analyzed includes at least one sub-query language, and the target evaluation parameters include time consumption, number of calls, table data volume, and calling interface of the at least one sub-query language; Determine an interface score of the at least one sub-query language based on the time consumption, number of calls, table data volume, and calling interface of the at least one sub-query language; Based on the interface score of the at least one sub-query language, a target processing interface of the at least one sub-query language is determined, and the evaluation parameters of the target processing interface are processed using a data processing model to obtain an analysis conclusion of the query language to be analyzed, wherein the target processing interface includes at least one sub-processing interface, and the sub-processing interface corresponds to the sub-query language one-to-one.

2. The method according to claim 1, characterized in that The step of determining target evaluation parameters of the query language to be analyzed includes: Determine a candidate running log of the query language to be analyzed, and process the candidate running log using the data processing model to obtain a first evaluation parameter of the query language to be analyzed, wherein the first evaluation parameter of the query language to be analyzed includes a time consumption, a number of calls, a calling interface, and a first database table name of the at least one sub-query language; Determine a second evaluation parameter of the query language to be analyzed based on the data structure of the database table corresponding to the query language to be analyzed, wherein the second evaluation parameter of the query language to be analyzed includes a name and table data volume of a second database table of the at least one sub-query language; Based on the matching result of the first database table name and the second database table name, the first evaluation parameter and the second evaluation parameter of the query language to be analyzed are merged, and the target evaluation parameter of the query language to be analyzed is determined according to the merged result.

3. The method according to claim 1, characterized in that The determining the interface score of the at least one sub-query language based on the time consumption, the number of calls, the table data volume and the calling interface of the at least one sub-query language comprises: Determining optimization information of the at least one sub-query language based on the time consumption, the number of calls, and the amount of table data of the at least one sub-query language; Determine an interface call probability of at least one intermediate processing interface based on the call interface and call count of the at least one sub-query language; Based on the optimization information of the at least one sub-query language and the interface call probability of the at least one intermediate processing interface, an interface score of the at least one sub-query language is determined, wherein the sub-query language includes i scores, and i is the number of intermediate processing interfaces.

4. The method according to claim 3, characterized in that The determining the optimization information of the at least one sub-query language based on the time consumption, the number of calls, and the amount of table data of the at least one sub-query language includes: Processing the time consumption of the at least one sub-query language by using a preset call time consumption and a time consumption scoring rule to obtain time consumption optimization information of the at least one sub-query language; Processing the number of calls of the at least one sub-query language using a preset call quantity threshold and quantity scoring rule to obtain quantity optimization information of the at least one sub-query language; Processing the table data volume of the at least one sub-query language by using a preset data volume scoring rule to obtain table data volume optimization information of the at least one sub-query language; Based on the time consumption optimization information, quantity optimization information and table data volume optimization information of the at least one sub-query language, the optimization information of the at least one sub-query language is determined.

5. The method according to claim 3, characterized in that: The determining of the interface call probability of at least one intermediate processing interface based on the calling interface and the calling times of the at least one sub-query language comprises: Determine the total number of interface calls, the at least one intermediate processing interface, and the number of calls of the at least one intermediate processing interface based on the calling interface and the number of calls of the at least one sub-query language; The total number of interface calls, the at least one intermediate processing interface and the number of calls of the at least one intermediate processing interface are processed using a preset interface call probability calculation rule to obtain the interface call probability of the at least one intermediate processing interface.

6. The method according to claim 1, characterized in that The step of determining a target processing interface of the at least one sub-query language based on the interface score of the at least one sub-query language, and processing evaluation parameters of the target processing interface using a data processing model to obtain an analysis conclusion of the query language to be analyzed includes: Determine a score greater than a preset score threshold among the interface scores of the at least one sub-query language as a target score, and determine a processing interface corresponding to the target score as a target processing interface of the at least one sub-query language; Determine the evaluation parameters of the at least one sub-query language at the target processing interface, and use the data processing model to process the evaluation parameters of the at least one sub-query language at the target processing interface to obtain a performance diagnosis conclusion and a processing plan for the query language to be analyzed, wherein the processing plan is an optimization suggestion and / or an index suggestion.

7. A performance analysis device for a query language, characterized in that: The performance analysis method for the query language according to any one of claims 1 to 6 is implemented, wherein the performance analysis device for the query language comprises: An information acquisition module, used to determine target evaluation parameters of the query language to be analyzed, wherein the query language to be analyzed includes at least one sub-query language, and the target evaluation parameters include the time consumption, number of calls, table data volume and calling interface of the at least one sub-query language; An interface scoring module, configured to determine an interface score of the at least one sub-query language based on the time consumption, number of calls, table data volume, and calling interface of the at least one sub-query language; A conclusion determination module is used to determine a target processing interface of the at least one sub-query language based on the interface score of the at least one sub-query language, and use a data processing model to process the evaluation parameters of the target processing interface to obtain an analysis conclusion of the query language to be analyzed, wherein the target processing interface includes at least one sub-processing interface, and the sub-processing interface corresponds to the sub-query language one by one.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the performance analysis method of the query language described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the performance analysis method of the query language described in any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the performance analysis method of the query language according to any one of claims 1 to 6.