CN113190422A - Quality analysis method, device, terminal and medium for SQL (structured query language) statements - Google Patents

Quality analysis method, device, terminal and medium for SQL (structured query language) statements Download PDF

Info

Publication number
CN113190422A
CN113190422A CN202110300327.0A CN202110300327A CN113190422A CN 113190422 A CN113190422 A CN 113190422A CN 202110300327 A CN202110300327 A CN 202110300327A CN 113190422 A CN113190422 A CN 113190422A
Authority
CN
China
Prior art keywords
risk
statement
determining
query statement
rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110300327.0A
Other languages
Chinese (zh)
Other versions
CN113190422B (en
Inventor
熊军
巩飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunhe Enmo Beijing Information Technology Co ltd
Original Assignee
Yunhe Enmo Beijing Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunhe Enmo Beijing Information Technology Co ltd filed Critical Yunhe Enmo Beijing Information Technology Co ltd
Priority to CN202110300327.0A priority Critical patent/CN113190422B/en
Publication of CN113190422A publication Critical patent/CN113190422A/en
Application granted granted Critical
Publication of CN113190422B publication Critical patent/CN113190422B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a quality analysis method, a quality analysis device, a quality analysis terminal and a quality analysis medium for SQL sentences. The method comprises the following steps: acquiring a query statement to be analyzed; determining a selected target statement rule analysis template based on a plurality of preset statement rule analysis templates; and analyzing the template according to the target statement rule, and determining an analysis result of the query statement. The method and the device have the advantages that the code editing rules of the same database are integrated, the effect of auditing and analyzing the SQL sentences of various grammar rules is achieved, the detailed analysis result is also provided, the purpose of performing automatic quality analysis on the query sentences is achieved, and the quality analysis efficiency of the SQL sentences is improved.

Description

Quality analysis method, device, terminal and medium for SQL (structured query language) statements
Technical Field
The application relates to the technical field of database analysis, in particular to a quality analysis method, a decoder, a terminal and a medium for SQL statements.
Background
With the continuous progress of the IT technology, various applications become more and more complex, and the IT application systems of enterprises also face huge challenges, especially SQL auditing.
The related SQL examination comprises two modes of manual examination and automatic examination. The manual auditing mode has the problems of low efficiency, difficulty in ensuring accuracy and higher requirements on SQL knowledge and experience of inspectors. The automatic auditing mode can only audit the SQL statement of one grammar rule and can only give the result that the audit is passed or not passed.
Disclosure of Invention
In order to solve the technical problem, the present application provides a method, an apparatus, a terminal and a medium for quality analysis of an SQL statement.
According to a first aspect of the present application, there is provided a method for quality analysis of an SQL statement, the method including:
acquiring a query statement to be analyzed;
determining a selected target statement rule analysis template based on a plurality of preset statement rule analysis templates;
and analyzing the template according to the target statement rule, and determining an analysis result of the query statement.
According to a second aspect of the present application, there is provided an apparatus for quality analysis of an SQL statement, the apparatus including:
the statement acquisition module is used for acquiring the query statement to be analyzed;
the template determining module is used for determining the selected target sentence rule analysis template based on a plurality of preset sentence rule analysis templates;
and the quality analysis module is used for analyzing the template according to the target statement rule and determining the analysis result of the query statement.
According to a third aspect of the present application, there is provided a terminal comprising: the processor executes the computer program to realize the quality analysis method of the SQL statement.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium storing computer-executable instructions for performing the above-mentioned method of quality analysis of SQL statements.
According to the method, the query statement to be analyzed is obtained, the selected target statement rule analysis template is determined based on the preset multiple statement rule analysis templates, the template is analyzed according to the target statement rule, the analysis result of the query statement is determined, and the quality analysis of the SQL statement is performed through the statement rule analysis template, so that the code editing rules of the same database are integrated, the effect of auditing and analyzing the SQL statement of multiple language rules is achieved, the detailed analysis result is provided, the purpose of performing automatic quality analysis on the query statement is achieved, and the quality analysis efficiency of the SQL statement is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flow chart of a method for analyzing quality of an SQL statement according to an embodiment of the present application; and
fig. 2 is a block diagram structural schematic diagram of a quality analysis apparatus for SQL statements provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that although functional blocks are illustrated as being partitioned in a schematic diagram of an apparatus and logical order is illustrated in a flowchart, in some cases, the steps illustrated or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
According to an embodiment of the present application, there is provided a quality analysis method of an SQL statement, as shown in fig. 1, the method includes step S101, step S102, and step S103.
Step S101: and acquiring the query statement to be analyzed.
Specifically, the SQL statement quality analysis tool obtains a query statement to be analyzed.
The query statement to be analyzed may be obtained through a preset interface. For example, the terminal obtains the query statement to be analyzed through a preset interface in the code editing tool.
Step S102: and determining the selected target sentence rule analysis template based on a plurality of preset sentence rule analysis templates.
In an embodiment of the present application, the statement rule analysis template is used to detect unreasonable or erroneous points of the query statement.
Specifically, different sentence rule analysis templates correspond to different grammar rule databases and are used for analyzing codes written by different grammar rule database languages. For example, if the database language in which the query statement is written is db2, then the template statement rules analysis target is a statement rules analysis template for db 2. More specifically, any one statement rule analysis template typically includes a plurality of statement rules.
Specifically, when a selected operation is detected, the template identifier corresponding to the selected operation may be used to search among a plurality of pre-stored syntax rule analysis targets, and the matched sentence rule analysis template may be used as the target sentence rule analysis template.
Step S103: and analyzing the template according to the target statement rule, and determining an analysis result of the query statement.
Specifically, the analysis result may include a database to which the query statement belongs, an audit object, and a rule name, a rule description, a type of a risk point to which the query statement belongs, and the like for the audit object. For example, if the database is db2, then the audit object may be ddltext; if the database is mysql, the audit object may be ddltext; if the database is oracle, the audit object may be index, sequence, sql play, sql ltext, table, view, or even all. When the method is applied, various databases and audit objects thereof as well as rules of the audit objects can be set according to business requirements.
When the query statement analysis template is applied, all statement rules included in the target statement rule analysis template are read by loading the target statement rule analysis template so as to judge the query statement.
According to the method, the query statement to be analyzed is obtained, the selected target statement rule analysis template is determined based on the preset multiple statement rule analysis templates, the template is analyzed according to the target statement rule, the analysis result of the query statement is determined, and the quality analysis of the SQL statement is performed through the statement rule analysis template, so that the code editing rules of the same database are integrated, the effect of auditing and analyzing the SQL statement of multiple language rules is achieved, the detailed analysis result is provided, the purpose of performing automatic quality analysis on the query statement is achieved, and the quality analysis efficiency of the SQL statement is improved.
In some embodiments, step S103 further comprises: step S1031 to step S1033 (not shown in the figure).
Step S1031: determining each statement rule triggered by the query statement based on a plurality of statement rules included in the target statement rule analysis template;
step S1032: determining each risk point existing in the query statement and the risk type to which each risk point belongs respectively according to each statement rule triggered by the query statement;
step S1033: and determining an optimization suggestion aiming at the query statement according to the risk types to which the risk points belong respectively.
Specifically, the sentence rules included in each sentence rule analysis template can be adjusted in time through operations such as editing and updating the template, and the purpose of enriching the sentence rule analysis template is achieved.
In the embodiment of the present application, the risk type is used to characterize the influence degree of the query statement on the query process.
Specifically, the risk type may be set to severe, warning, reminder, or the like. When the method is applied, the risk types can be adjusted according to business requirements. More specifically, optimization suggestions for a query statement may be output in a manner that throws "severe" hints when the risk type includes severe situations.
In some embodiments, step S1033 includes:
determining risk parameters respectively corresponding to various risk types;
determining risk values respectively corresponding to various risk types according to risk parameters respectively corresponding to various risk types and a preset risk value calculation formula;
and determining an optimization suggestion aiming at the query statement based on the risk values respectively corresponding to the various risk types.
In particular, the risk value may be used as a basis for optimizing the query statement. When the method is applied, an optimization suggestion database of each of multiple risk types can be stored in advance, and the optimization suggestion database comprises optimization suggestions corresponding to multiple risk values. For example, the two parameters are queried through the type identifier of the risk type to be queried and the risk value corresponding to the risk type, so as to obtain the optimization suggestion for the query statement.
According to the method and the device, calculation is carried out through a preset risk value calculation formula, and the risk values corresponding to various risk types are obtained. For example, the sum of the risk parameters corresponding to each of the plurality of risk types may be used as the risk value corresponding to each of the plurality of risk types.
In particular, the query statement may present one or more risk types. For example, if the risk types include "severe", "warning", and "hint", the risk type to which the statement rule hit in the target statement rule analysis template that is hit by the query statement belongs may be at least one of "severe", "warning", and "hint", that is, there is at least one risk in the query statement.
In some embodiments, the risk value calculation formula is:
risk value ═ risk reduction value × (1-cue attenuation factor ^ cue risk number)/(1-cue attenuation factor);
the risk parameters corresponding to any type of risk type include:
risk reduction value, attenuation coefficient, number of risk points belonging to any type of risk type.
Specifically, the risk subtraction value is a fixed value, and the attenuation coefficient is a self-defined attenuation value range. Wherein the range of attenuation values can be adjusted according to traffic demands.
In the embodiment of the present application, the number of risk points is used to characterize the maximum number of risk points. Specifically, the number of risk points is generally a fixed value that can be adjusted by user. For example, if the risk type is severe, the number of risk points may be set to 60.
Specifically, the risk parameters corresponding to each type of risk may be set with reference to table 1.
TABLE 1
Figure BDA0002985985720000051
Figure BDA0002985985720000061
In some embodiments, the step of determining an optimization suggestion for the query statement based on the risk values corresponding to the risk types to which the respective risk points belong further includes:
adding risk values corresponding to the risk types to which the risk points belong respectively to obtain a risk value sum;
and determining an optimization suggestion aiming at the query statement according to the risk value sum.
Specifically, the optimization suggestion may include a modification suggestion for the risk point, and may also include a prompt message indicating whether the query statement passes the quality audit. When the optimization suggestion is the prompt information indicating whether the query statement passes the quality check or not, the output of the prompt information can interrupt the flow of detailed analysis of the query statement so as to enable a user to adjust the query statement in time, thereby saving the time for generating the optimization suggestion and further improving the efficiency of the user in optimizing the query statement subsequently.
In the embodiment of the application, the risk value sum is used for representing the quality of the query statement. In particular, the sum of the risk values may be expressed in percentiles. For example, the maximum value of the risk value sum of the query statement is 100 points, and if the risk value sum is less than 60 points, an optimization suggestion that the review for the query statement fails is generated. The method for rapidly determining the optimization suggestion through the risk value sum improves the quality analysis efficiency of the query statement.
In some embodiments, step S1033 may further include:
determining a risk value corresponding to each risk point according to the risk type to which each risk point belongs;
counting the sum of the risk values corresponding to the risk points respectively;
based on the sum of the risk values, an optimized suggestion for the query statement is determined.
Specifically, risk values corresponding to different analysis types may be preset, and the purpose of calculating the sum of the risk values corresponding to the risk points is achieved by adding and processing.
Specifically, an optimization suggestion table may be preselected, and optimization suggestions corresponding to the risk value sum ranges are stored through the optimization suggestion table, so that the corresponding optimization suggestions are obtained through querying the risk value sum in the optimization suggestion table.
In some embodiments, step S1033 further comprises:
generating an inquiry request according to the inquiry statement, each risk point and the risk type to which each risk point belongs;
sending the query request to a preset optimization suggestion server;
optimization suggestions from an optimization suggestion server are obtained.
According to the embodiment of the application, the purpose of providing the optimization suggestion aiming at the query statement by the optimization suggestion server is achieved by optimizing the setting of the suggestion server, the effect of obtaining the more professional optimization suggestion and improving the access efficiency of the follow-up user to the database is achieved.
When the method is applied, the SQL statement quality analysis tool can also send a storage request generated according to the query statement and the analysis result to the optimization suggestion server according to a preset period, so that the query statement of a user and the analysis record of the query statement are realized, and the purpose of cloud access is realized.
The following query statement is analyzed in conjunction with table 1 below.
Assume that the query statement is:
SELECT
ytd_sales AS Sales,
authors.au_fname+”+authors.au_lname AS Author,
ToAuthor=(ytd_sales*royalty)/100,
ToPublisher=ytd_sales-(ytd_sales*royalty)/100
FROM
titles,
titleauthor,
authors
WHERE
titles.title_id=titleauthor.title_id
ORDER BY
Sales DESC,
Author ASC。
therefore, the upper limit of the total serious risk is min (20 × 1-0.5^1)/(1-0.5), and 60) ═ min (20 × 0.5/0.5,60) ═ min (20,60) ═ 20;
a warning risk score of min (warning single risk score of 1 (warning attenuation factor ^ warning risk quantity)/(1-warning attenuation factor), a warning risk total impact upper limit of min (10 (1-0.5^1)/(1-0.5),30) of min (10 0.5/0.5,30) of min (10,30) of 10;
the prompt risk score is min (prompt single risk score value is 1- (prompt attenuation coefficient ^ prompt risk quantity)/(1- (prompt attenuation coefficient)), and the prompt total influence upper limit is min (3 is 1- (0.5 ^0)/(1-0.5), and 10 is min (3 is 0/0.5, and 10 is min (0,10) is 0.
To sum up: SQL quality score 100-severe risk score-warning risk score-cue risk score 100-20-10-0-70. When the optimization suggestion database is applied, the optimization suggestions corresponding to the 70 points can be obtained by querying the optimization suggestion database.
Another embodiment of the present application provides an apparatus for quality analysis of SQL statements, as shown in fig. 2, the apparatus 20 includes: a sentence acquisition module 201, a template determination module 202 and a quality analysis module 203.
A statement obtaining module 201, configured to obtain a query statement to be analyzed;
the template determining module 202 is configured to determine a selected target sentence rule analysis template based on a plurality of preset sentence rule analysis templates;
and the quality analysis module 203 is used for analyzing the template according to the target statement rule and determining an analysis result of the query statement.
According to the method, the query statement to be analyzed is obtained, the selected target statement rule analysis template is determined based on the preset multiple statement rule analysis templates, the template is analyzed according to the target statement rule, the analysis result of the query statement is determined, and the quality analysis of the SQL statement is performed through the statement rule analysis template, so that the code editing rules of the same database are integrated, the effect of auditing and analyzing the SQL statement of multiple language rules is achieved, the detailed analysis result is provided, the purpose of performing automatic quality analysis on the query statement is achieved, and the quality analysis efficiency of the SQL statement is improved.
Further, the mass analysis module includes:
the statement rule determining submodule is used for determining each statement rule triggered by the query statement based on a plurality of statement rules included in the target statement rule analysis template;
the risk information determining submodule is used for determining each risk point existing in the query statement and the risk type to which each risk point belongs according to each statement rule triggered by the query statement;
and the optimization suggestion determining submodule is used for determining the optimization suggestion aiming at the query statement according to the risk types to which the risk points belong respectively.
Further, the optimization suggestion determination sub-module includes:
the parameter determining unit is used for determining risk parameters corresponding to various risk types respectively;
the first risk value determining unit is used for determining risk values corresponding to various risk types according to risk parameters corresponding to the various risk types respectively and a preset risk value calculating formula;
and the first suggestion determining unit is used for determining the optimized suggestion aiming at the query statement based on the risk values respectively corresponding to the various risk types.
Further, the risk value calculation formula is:
risk value ═ risk reduction value × (1-cue attenuation factor ^ cue risk number)/(1-cue attenuation factor);
the risk parameters corresponding to any type of risk type include:
risk reduction value, attenuation coefficient, number of risk points belonging to any type of risk type.
Further, the advice determination unit further includes:
the adding and processing subunit is used for adding and processing the risk values corresponding to the risk types to which the risk points belong respectively to obtain a risk value sum;
and the auditing and determining subunit is used for determining the optimization suggestion aiming at the query statement according to the risk value sum.
Further, the risk information determination sub-module further includes:
the second risk value determining unit is used for determining the risk value corresponding to each risk point according to the risk type to which each risk point belongs;
and the second suggestion determining unit is used for determining the optimized suggestion aiming at the query statement based on the risk values respectively corresponding to the risk points.
Further, the apparatus further comprises:
the request generation module is used for generating a query request according to the query statement, each risk point existing in the query statement and the risk type to which each risk point belongs;
the request reporting module is used for sending the query request to a preset optimization suggestion server;
and the suggestion acquisition module is used for acquiring the optimization suggestions from the optimization suggestion server.
The quality analysis apparatus for SQL statements in this embodiment may execute the quality analysis method for SQL statements provided in this embodiment, which is similar to the implementation principle, and is not described herein again.
Another embodiment of the present application provides a terminal, including: the processor executes the computer program to realize the quality analysis method of the SQL statement.
In particular, the processor may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. A processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, a DSP and a microprocessor, or the like.
In particular, the processor is coupled to the memory via a bus, which may include a path for communicating information. The bus may be a PCI bus or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
The memory may be, but is not limited to, ROM or other type of static storage device that can store static information and instructions, RAM or other type of dynamic storage device that can store information and instructions, EEPROM, CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
Optionally, the memory is used for storing codes of computer programs for executing the scheme of the application, and the processor is used for controlling the execution. The processor is configured to execute the application program code stored in the memory to implement the actions of the quality analysis apparatus for SQL statements provided by the foregoing embodiments.
Yet another embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for performing the above-mentioned method for quality analysis of SQL statements.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as integrated circuits, such as application specific integrated circuits. Such software can be distributed on computer readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
While the present application has been described with reference to the preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A quality analysis method of SQL statements is characterized by comprising the following steps:
acquiring a query statement to be analyzed;
determining a selected target statement rule analysis template based on a plurality of preset statement rule analysis templates;
and analyzing a template according to the target statement rule, and determining an analysis result of the query statement.
2. The method of claim 1, wherein the step of determining the analysis result of the query statement according to the target statement rule analysis template comprises:
determining each statement rule triggered by the query statement based on a plurality of statement rules included in the target statement rule analysis template;
determining each risk point existing in the query statement and the risk type to which each risk point belongs respectively according to each statement rule triggered by the query statement;
and determining an optimization suggestion aiming at the query statement according to the risk types to which the risk points belong respectively.
3. The method according to claim 2, wherein the step of determining risk points existing in the query statement and risk types to which the risk points belong respectively according to the statement rules triggered by the query statement comprises:
determining risk parameters respectively corresponding to various risk types;
determining risk values respectively corresponding to various risk types according to risk parameters respectively corresponding to various risk types and a preset risk value calculation formula;
and determining an optimization suggestion aiming at the query statement based on the risk values respectively corresponding to the various risk types.
4. The method of claim 3, wherein the risk value calculation formula is:
the risk value ═ risk reduction value ═ (1-cue attenuation coefficient ^ cue risk number)/(1-cue attenuation coefficient);
the risk parameters corresponding to any type of the risk types include:
risk reduction value, attenuation coefficient, number of risk points belonging to any of the risk types.
5. The method according to claim 3, wherein the step of determining the optimization suggestion for the query statement based on the risk values corresponding to the risk types to which the respective risk points belong further comprises:
adding risk values corresponding to the risk types to which the risk points belong respectively to obtain a risk value sum;
and determining an optimization suggestion aiming at the query statement according to the risk value sum.
6. The method of claim 2, wherein determining the optimized suggestion for the query statement according to the risk types to which the risk points respectively belong comprises:
generating a query request according to the query statement, each risk point existing in the query statement and the risk type to which each risk point belongs;
sending the query request to a preset optimization suggestion server;
obtaining an optimization suggestion from the optimization suggestion server.
7. An apparatus for analyzing quality of an SQL statement, comprising:
the statement acquisition module is used for acquiring the query statement to be analyzed;
the template determining module is used for determining the selected target sentence rule analysis template based on a plurality of preset sentence rule analysis templates;
and the quality analysis module is used for analyzing a template according to the target statement rule and determining an analysis result of the query statement.
8. The apparatus of claim 7, wherein the mass analysis module comprises:
a statement rule determining submodule, configured to determine, based on a plurality of statement rules included in the target statement rule analysis template, each statement rule triggered by the query statement;
the risk information determining submodule is used for determining each risk point existing in the query statement and the risk type to which each risk point belongs according to each statement rule triggered by the query statement;
and the optimization suggestion determination submodule is used for determining the optimization suggestion aiming at the query statement according to the risk types to which the risk points respectively belong.
9. A terminal, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the method of any of claims 1 to 6.
10. A computer-readable storage medium storing computer-executable instructions for performing the method of any one of claims 1-6.
CN202110300327.0A 2021-03-22 2021-03-22 Quality analysis method, device, terminal and medium for SQL (structured query language) statements Active CN113190422B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110300327.0A CN113190422B (en) 2021-03-22 2021-03-22 Quality analysis method, device, terminal and medium for SQL (structured query language) statements

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110300327.0A CN113190422B (en) 2021-03-22 2021-03-22 Quality analysis method, device, terminal and medium for SQL (structured query language) statements

Publications (2)

Publication Number Publication Date
CN113190422A true CN113190422A (en) 2021-07-30
CN113190422B CN113190422B (en) 2022-05-13

Family

ID=76973549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110300327.0A Active CN113190422B (en) 2021-03-22 2021-03-22 Quality analysis method, device, terminal and medium for SQL (structured query language) statements

Country Status (1)

Country Link
CN (1) CN113190422B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114896269A (en) * 2022-05-31 2022-08-12 北京达佳互联信息技术有限公司 Structured query statement detection method and device, electronic equipment and storage medium
CN115129746A (en) * 2022-08-30 2022-09-30 平安银行股份有限公司 SQL (structured query language) examination and analysis method, server and SQL examination and analysis system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070112827A1 (en) * 2005-11-10 2007-05-17 International Business Machines Corporation Abstract rule sets
US20080140692A1 (en) * 2006-12-11 2008-06-12 Scott Gehring System and method of data movement between a data source and a destination
US20170323006A1 (en) * 2015-11-29 2017-11-09 Vatbox, Ltd. System and method for providing analytics in real-time based on unstructured electronic documents
CN107563193A (en) * 2017-08-28 2018-01-09 深信服科技股份有限公司 Access and control strategy of database method and system based on SQL templates
CN109240901A (en) * 2018-08-28 2019-01-18 北京小度信息科技有限公司 Method for analyzing performance, performance evaluation device, storage medium and electronic equipment
CN111913937A (en) * 2020-07-31 2020-11-10 中国工商银行股份有限公司 Database operation and maintenance method and device
CN111949541A (en) * 2020-08-14 2020-11-17 中国工商银行股份有限公司 Multi-source database statement checking method and device
CN112115159A (en) * 2020-09-28 2020-12-22 北京奇艺世纪科技有限公司 SQL statement generation method and device, electronic equipment and storage medium
CN112163000A (en) * 2020-08-31 2021-01-01 阿里巴巴集团控股有限公司 Data query method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070112827A1 (en) * 2005-11-10 2007-05-17 International Business Machines Corporation Abstract rule sets
US20080140692A1 (en) * 2006-12-11 2008-06-12 Scott Gehring System and method of data movement between a data source and a destination
US20170323006A1 (en) * 2015-11-29 2017-11-09 Vatbox, Ltd. System and method for providing analytics in real-time based on unstructured electronic documents
CN107563193A (en) * 2017-08-28 2018-01-09 深信服科技股份有限公司 Access and control strategy of database method and system based on SQL templates
CN109240901A (en) * 2018-08-28 2019-01-18 北京小度信息科技有限公司 Method for analyzing performance, performance evaluation device, storage medium and electronic equipment
CN111913937A (en) * 2020-07-31 2020-11-10 中国工商银行股份有限公司 Database operation and maintenance method and device
CN111949541A (en) * 2020-08-14 2020-11-17 中国工商银行股份有限公司 Multi-source database statement checking method and device
CN112163000A (en) * 2020-08-31 2021-01-01 阿里巴巴集团控股有限公司 Data query method and device
CN112115159A (en) * 2020-09-28 2020-12-22 北京奇艺世纪科技有限公司 SQL statement generation method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114896269A (en) * 2022-05-31 2022-08-12 北京达佳互联信息技术有限公司 Structured query statement detection method and device, electronic equipment and storage medium
CN115129746A (en) * 2022-08-30 2022-09-30 平安银行股份有限公司 SQL (structured query language) examination and analysis method, server and SQL examination and analysis system

Also Published As

Publication number Publication date
CN113190422B (en) 2022-05-13

Similar Documents

Publication Publication Date Title
CN111522816B (en) Data processing method, device, terminal and medium based on database engine
US11341116B2 (en) Techniques for automated data analysis
CN113190422B (en) Quality analysis method, device, terminal and medium for SQL (structured query language) statements
CN110019218B (en) Data storage and query method and equipment
CN113641701B (en) Data query method, system, heterogeneous acceleration platform and storage medium
US10129113B2 (en) Method and apparatus for evaluating hardware based on cloud server
TW201915777A (en) Financial analysis system and method for unstructured text data
CN112084211A (en) Slow SQL statement processing system
US10339035B2 (en) Test DB data generation apparatus
CN112286958B (en) Processing method and system for database query expression
TW202004526A (en) Index creating method and apparatus based on NoSQL database of mobile terminal
TW202026920A (en) Computational accelerator architecture for change control in model-based system engineering
CN110720097A (en) Functional equivalence of tuples and edges in graph databases
CN109241075B (en) Index basic data processing method and equipment and computer readable storage medium
CN113535817A (en) Method and device for generating characteristic broad table and training business processing model
CN107291749B (en) Method and device for determining data index association relation
CN109101541B (en) Newly added index management method, device and computer readable storage medium
CN109214640B (en) Method and device for determining index result and computer readable storage medium
CN114064606A (en) Database migration method, device, equipment, storage medium and system
JP5310196B2 (en) Classification system revision support program, classification system revision support device, and classification system revision support method
US8359329B2 (en) Method, computer apparatus and computer program for identifying unusual combinations of values in data
CN113157671A (en) Data monitoring method and device
CN111444315A (en) Method, device and equipment for screening error correction phrase candidate items and storage medium
JP2017010376A (en) Mart-less verification support system and mart-less verification support method
CN110334098A (en) A kind of database combining method and system based on script

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant