SQL statement auditing method based on graph attention neural network

Through the SQL auditing method based on graph attention neural network, an accurate syntax tree structure is generated and combined with a variety of auditing methods, which solves the problems of low efficiency and insufficient accuracy of complex SQL query auditing in the existing technology, and realizes efficient SQL statements. Audits and performance evaluations ensure data security and compliance.

CN118708183APending Publication Date: 2024-09-27CHINA BOHAI BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410700034.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing SQL audit technology has problems such as inaccurate syntax tree generation, difficulty in understanding, and low efficiency when processing complex SQL queries. It cannot fully cover the detection of semantic errors and performance issues, and it is difficult for traditional methods to capture complex dependencies in SQL queries, resulting in Slow review process and risk of errors.

Method used

A SQL statement review method based on graph attention neural network is used to generate a structured syntax tree structure by converting the SQL statement into a sequence that can be processed by the graph attention neural network, and combines syntax checking, semantic checking and performance evaluation, using TreeNLL loss The function measures syntax tree similarity, formulates SQL audit rules for comprehensive traversal, and identifies potential problems.

Benefits of technology

The speed and accuracy of SQL statement auditing are greatly improved. When processing complex SQL queries, the accuracy rate reaches more than 98%, the performance is more than doubled, detailed audit reports are generated, and audit efficiency and data security are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708183A
    Figure CN118708183A
Patent Text Reader

Abstract

The invention discloses an SQL statement auditing method based on a graph attention neural network, and the method specifically comprises the following steps: receiving a structured query language SQL statement auditing request, and obtaining a to-be-audited SQL statement; converting the SQL statement into a sequence which can be processed by a GAT (Graph Attention Neural Network); coding the sequence, and abstracting each node of the sequence into a vector representation; based on learning of a graph attention neural network GAT, generating a syntax tree structure with a structured expression; and formulating an SQL auditing rule, performing comprehensive traversal according to the SQL auditing rule syntax tree structure, performing rule matching on each node, identifying potential problems, and completing SQL auditing. By generating the syntax tree structure, the grammar and semantic structures of the SQL statement are deeply understood, and the accuracy of checking the SQL statement is improved; the method comprises the following steps: disassembling an SQL statement, and carrying out attention matching with related auditing rule items, so as to identify potential optimization risk points;
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a SQL statement auditing method, and in particular to a SQL statement auditing method based on a graph attention neural network. Background Art

[0002] With the rapid development of information technology, databases have become an important platform for enterprise data storage and processing. SQL, as a standard language for database operations, is widely used, but there are also some problems and challenges in practical applications. SQL audit technology is an important means to ensure data security and compliance. With the increase in data volume and the complexity of data management, the importance of SQL audit technology has received more and more attention; existing SQL audit technologies include syntax checking, semantic checking, performance evaluation, dynamic analysis, etc. Among them, syntax checking is used to check whether the syntax of SQL statements is correct, fast and easy to use; semantic checking is used to check whether the data in SQL statements conforms to specific business rules and data models; performance evaluation is to use tools to perform performance tests on SQL statements to evaluate the impact of SQL statements on the database; dynamic analysis is to dynamically analyze SQL statements by simulating the actual operating environment to evaluate its performance and security in different situations.

[0003] Due to human factors and subjective judgment, auditors may not be able to implement specifications completely consistently, resulting in potential errors and risks. In addition, if the performance problems of SQL statements are not discovered and resolved in a timely manner, it may lead to serious impacts on the online environment, thereby affecting business use and data quality. The existing SQL statement auditing methods have different focuses and cannot fully cover all SQL audit processing requirements. For example, although syntax checking can quickly and conveniently check whether the syntax of SQL statements is correct, it cannot check semantic errors or performance problems; semantic checking can check whether the data in SQL statements conforms to specific business rules and data models, but it cannot cover all business rules and data models; performance evaluation can use tools to perform performance tests on SQL statements to evaluate the performance impact of SQL statements on the database, but may not be able to discover potential performance problems. In addition, traditional SQL syntax tree generation methods may have difficulties in processing complex SQL queries, especially when involving multiple nested subqueries, connections, and conditional statements, resulting in the generated statement tree being inaccurate or difficult to understand; when processing large-scale and complex SQL queries, existing SQL statement auditing technologies face performance bottlenecks, resulting in slow generation and auditing processes.

[0004] The existing SQL audit syntax checking methods only focus on syntax-level issues. The existing semantic checking is difficult to capture complex SQL injection attack patterns. It mainly detects based on known vulnerabilities and attack patterns, but has relatively weak detection capabilities for unknown vulnerabilities. The SQL syntax tree generation method and audit tasks are inefficient and difficult to capture the complex dependencies between the various parts of the SQL query. Summary of the invention

[0005] In order to solve the shortcomings of the above technologies, the present invention provides a SQL statement auditing method based on graph attention neural network.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a SQL statement auditing method based on graph attention neural network, which specifically includes the following steps:

[0007] Step S1: receiving a structured query language SQL statement review request and obtaining a SQL statement to be reviewed;

[0008] Step S2: Convert the SQL statement into a sequence that can be processed by the graph attention neural network GAT;

[0009] Step S3: Encode the sequence and abstract each node of the sequence into a vector representation; generate a syntax tree structure with structured expressions based on the learning of the graph attention neural network GAT; use the TreeNLL loss function to measure the structural similarity between the generated syntax tree structure and the actual syntax tree structure. The formula of the Tree NLL loss function is:

[0010]

[0011] Where P(t) is the probability distribution on the syntax tree structure; α is the scaling factor used to adjust the amplitude of the probability distribution; λ||P(t)|| is the regularization term;

[0012] Step S4: Formulate SQL audit rules, comprehensively traverse the syntax tree structure in step S3 according to the SQL audit rules, and match each node according to the SQL audit rules to identify potential problems and complete the SQL audit.

[0013] Furthermore, in step S1, the SQL statement acquisition source is the request submitted by the developer, tester and user.

[0014] Furthermore, in step S2, the SQL statement is converted into a sequence that can be processed by the graph attention neural network GAT, which specifically includes the following steps:

[0015] Step S21: word segmentation; splitting the SQL statement into the smallest units and individual words;

[0016] Step S22: Part-of-speech tagging: each word is tagged with a part-of-speech tag;

[0017] Step S23: parsing the grammatical relationship between each word in the SQL statement through a syntactic analyzer;

[0018] Step S24: Serialization, converting the SQL statement into a sequence.

[0019] Furthermore, generating the syntax tree structure in step S3 specifically includes the following steps:

[0020] Step S31: Map each word in the sequence to a node, and connect the nodes into a graph structure according to the SQL statement;

[0021] Step S32: Using the graph attention neural network GAT to propagate information on the graph structure, the vector representation of each node is updated to the weighted average of the vector representations of the node's neighboring nodes, capturing the deep semantic and grammatical relationships between the words;

[0022] Step S33: introduce the vector representation of each node into the decoder, convert the vector of each node into a node of the syntax tree, connect the nodes according to specific rules, and generate a syntax tree structure.

[0023] Furthermore, in step S3, the self-attention mechanism is used in the graph attention neural network GAT model to allow the network to focus on nodes adjacent to the target node, and then the node vector output by the encoder is input into the decoder; in the decoder, the inverse self-attention mechanism and the language model technology are used to generate nodes of the syntax tree structure.

[0024] Furthermore, the stacked graph attention based on the graph attention neural network GAT realizes the grammatical relationship between each word. The specific steps include:

[0025] Step S321: The input of this layer is the node feature set F is the dimension of each node feature; the output of this layer is a new node feature set F' is the dimension of each new node feature;

[0026] Step S322: Apply a shared weight matrix W of F×F' to each node to calculate the weight of each neighboring node. The calculation formula is:

[0027]

[0028] Among them, e ij is the importance of node j relative to node i; W is the shared parameter for dimensional expansion;

[0029] Step S323: Normalize the weight coefficient, the formula is:

[0030]

[0031] Step S324: Recalculate the feature set h' of node i according to the normalized weight coefficient. i for:

[0032]

[0033] Among them, σ is the activation function; W is the shared parameter for dimensional expansion.

[0034] Furthermore, the formula for the probability distribution on the syntax tree structure in step S3 is:

[0035] P(t)=

[0036] P(root)*Πp(child1 / parent1)*Πp(child2 / parent2)*...Πp(childN / parentN);

[0037] Among them, P(t) is the occurrence probability of syntax tree t, that is, the probability distribution on the syntax tree; root is the root node; child1, child2, ..., childN are child nodes; parent1, parent2, ..., parentN are parent nodes; p(childi / parenti) is the probability of the grammatical rules of the child nodes and the parent nodes.

[0038] Furthermore, the SQL audit rules in step S4 include whether to detect SQL injection attacks, whether to protect sensitive data, and whether to detect performance issues.

[0039] Furthermore, in step S4, the SQL audit rules are specified by regular expressions, pattern matching and semantic analysis.

[0040] Furthermore, a report is generated for all violations detected according to the SQL audit rules; the report includes detailed information of the violation, including the violating SQL statement, the type of violation, and the location of the violation.

[0041] The present invention discloses a SQL statement auditing method based on a graph attention neural network. The method adopts a comprehensive method for auditing, combines syntax checking with semantic checking, performance evaluation and other technical means, realizes end-to-end SQL statements, greatly improves the speed of auditing SQL statements, and thus improves the overall auditing efficiency. In the process of generating a syntax tree structure, the relationship between nodes is learned through a graph attention neural network, and the syntax and semantic structure of SQL statements are deeply understood. The method performs better when processing complex SQL statements containing multi-layer nesting, multiple connections and conditional statements. The accuracy rate of traditional complex SQL statements is improved to more than 98%, and the processing performance is more than doubled compared with the traditional method, reaching less than 20ms. On the basis of the successful construction of the syntax tree structure, the SQL statements are segmented and matched one by one with the relevant audit rule items to identify potential optimization risk points, and finally a detailed audit report is generated, providing a scientific and feasible path for optimization and auditing. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flow chart of the present invention.

[0043] Figure 2 It is a flow chart of the SQL grammar parsing process in the present invention.

[0044] Figure 3 The flowchart of the process of converting a statement into a syntax tree in the present invention. DETAILED DESCRIPTION

[0045] The present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods. A SQL statement auditing method based on a graph attention neural network specifically comprises the following steps:

[0046] Step S1: receiving a structured query language SQL statement review request and obtaining a SQL statement to be reviewed;

[0047] Step S2: Convert the SQL statement into a sequence that can be processed by the graph attention neural network GAT;

[0048] Step S3: Encode the sequence and abstract each node of the sequence into a vector representation; generate a syntax tree structure with structured expressions based on the learning of the graph attention neural network GAT; use the Tree NLL loss function to measure the structural similarity between the generated syntax tree structure and the actual syntax tree structure. The formula of the Tree NLL loss function is:

[0049]

[0050] Where P(t) is the probability distribution on the syntax tree structure; α is the scaling factor used to adjust the amplitude of the probability distribution; λ||P(t)|| is the regularization term;

[0051] Step S4: Formulate SQL audit rules, comprehensively traverse the syntax tree structure in step S3 according to the SQL audit rules, and match each node according to the SQL audit rules to identify potential problems and complete the SQL audit.

[0052] Specifically, the SQL statement acquisition source in step S1 is the request submitted by the developer, tester and user. Figure 2 As shown in the flowchart of the syntax parsing process of SQL statements in a SQL statement auditing method based on a graph attention neural network, in step S2, the SQL statement is converted into a sequence that can be processed by the graph attention neural network GAT, which specifically includes the following steps:

[0053] Step S21: word segmentation; splitting the SQL statement into the smallest units and individual words;

[0054] Step S22: Part-of-speech tagging: each word is tagged with a part-of-speech tag;

[0055] Step S23: parsing the grammatical relationship between each word in the SQL statement through a syntactic analyzer;

[0056] Step S24: Serialization, converting the SQL statement into a sequence.

[0057] like Figure 3 As shown in the flowchart of the process of converting a statement into a syntax tree in a SQL statement auditing method based on a graph attention neural network, the specific steps of generating a syntax tree structure in step S3 include:

[0058] Step S31: Map each word in the sequence to a node, and connect the nodes into a graph structure according to the SQL statement;

[0059] Step S32: Using the graph attention neural network GAT to propagate information on the graph structure, the vector representation of each node is updated to the weighted average of the vector representations of the node's neighboring nodes, capturing the deep semantic and grammatical relationships between the words;

[0060] Step S33: introduce the vector representation of each node into the decoder, convert the vector of each node into a node of the syntax tree, connect the nodes according to specific rules, and generate a syntax tree structure.

[0061] In step S3, the self-attention mechanism is used in the graph attention neural network GAT model to allow the network to focus on nodes adjacent to the target node, and then the node vector output by the encoder is input into the decoder; in the decoder, the inverse self-attention mechanism and the language model technology are used to generate nodes of the syntax tree structure. The stacked graph attention based on the graph attention neural network GAT realizes the grammatical relationship between each word, and the specific steps include:

[0062] Step S321: The input of this layer is the node feature set F is the dimension of each node feature; the output of this layer is a new node feature set F' is the dimension of each new node feature;

[0063] Step S322: Apply a shared weight matrix W of F×F' to each node to calculate the weight of each neighboring node. The calculation formula is:

[0064]

[0065] Among them, e ij is the importance of node j relative to node i; W is the shared parameter for dimensional expansion;

[0066] Step S323: Normalize the weight coefficient, the formula is:

[0067]

[0068] Step S324: Recalculate the feature set h' of node i according to the normalized weight coefficient. i for:

[0069]

[0070] Among them, σ is the activation function; W is the shared parameter for dimensional expansion.

[0071] The formula for the probability distribution on the syntax tree structure in step S3 is:

[0072] P(t)=

[0073] P(root)*Πp(child1 / parent1)*Πp(child2 / parent2)*...Πp(childN / parentN);

[0074] Among them, P(t) is the occurrence probability of syntax tree t, that is, the probability distribution on the syntax tree; root is the root node; child1, child2, ..., childN are child nodes; parent1, parent2, ..., parentN are parent nodes; p(childi / parenti) is the probability of the grammatical rules of the child nodes and the parent nodes.

[0075] The SQL audit rules in step S4 include whether to detect SQL injection attacks, whether to protect sensitive data, and whether to detect performance issues. The SQL audit rules formulated in step S4 are specified by regular expressions, pattern matching, and semantic analysis. All violations detected according to the SQL audit rules are reported; the report includes detailed information on the violations, including the violating SQL statements, the types of violations, and the locations of the violations. Through in-depth analysis, various potential problems that may affect the quality and execution efficiency of the program are discovered and resolved. This process is not limited to simple syntax checking, but also covers a comprehensive evaluation of the program to ensure excellent, reliable, and efficient performance at runtime, providing strong support for the performance and stability of the database system, and ensuring that the specifications are correctly and effectively implemented. The comprehensive approach can greatly improve the accuracy and efficiency of SQL audits, while providing strong support for the performance and stability of the database system, ensuring that the specifications are correctly and effectively implemented, improving work efficiency, and also benefiting the data security and management of the enterprise.

[0076] This embodiment provides a SQL statement auditing method based on a graph attention neural network, and provides a specific auditing method for the audited SQL statement "SELECT name, age FROM users WHERE age>30 ORDER BY age DESC". Figure 1 As shown in the flowchart of a SQL statement audit method based on a graph attention neural network, the SQL statement to be audited is first obtained, and a structured query language SQL statement audit request is accepted. The SQL statement to be audited is obtained according to the SQL statement audit request; each SQL statement input is parsed, and the SQL statement is converted into a sequence that can be used for the graph attention neural network GAT. GAT can deeply understand and learn the language by learning the relationship between nodes, and then generate an SQL syntax tree; use the SQL syntax tree to parse each part of the SQL statement and match it with the relevant audit rule items one by one to find the risk points to be optimized; finally, the risk points to be optimized are integrated into a report with audit results. The specific steps are as follows:

[0077] Step 1: Segment the SQL statement into the smallest units, i.e., words or tokens; segment the SQL statement into the following words: 'SELECT', 'name', 'age', 'FROM', 'users', 'WHERE', '>', '30', 'ORDER BY', 'DESC';

[0078] Step 2: Tag the words in step 1 as part of speech, that is, mark each unit as a specific part of speech; 'SELECT', 'FROM', 'WHERE', 'ORDER BY' are marked as keywords; 'name', 'age', 'users' are marked as identifiers; '>', ',' are marked as operators and punctuation marks;

[0079] Step 3: Perform grammatical analysis on the SQL statement to determine the relationship between each word;

[0080] Step 4: Convert the words after the segmentation of the SQL statement into a sequence that can be processed by GAT;

[0081] Step 5: Encode the obtained sequence; map each word to a node, and connect all nodes into a graph structure; the nodes and edges of the graph structure after processing the SQL statement can be expressed as:

[0082] Nodes:{Select,Projection,Column,age,name,From,Table,users,Where,Condition,>,30,OrderBy,DESC}

[0083] Edges:{(Select,Projection),(Projection,Column:name),(Projection,Column:age),(Select,From),(From,Table:users),(Select,Where),(Where,Condition:age>30),(Select,OrderBy),(OrderBy,Column:age),(OrderBy,Direction:DESC)}

[0084] Step 6: Use GAT to propagate information on the graph structure; use GAT to encode the graph structure by updating the vector representation of each node to the weighted average of its neighboring node representations; use the self-attention mechanism to allow the network to be anxious about the nodes adjacent to the target node, and then input the node vector output by the encoder into the decoder;

[0085] Step 61: GAT (GraphAttentionLayer) uses the obtained serialized data to parse the syntactic dependencies between sentences by stacking graph attention layers. The input of this layer is the node feature set h:

[0086]

[0087] Among them, F is the dimension of each node feature;

[0088] The output is a new node feature set h':

[0089]

[0090] Among them, F' is the dimension of each new node feature;

[0091] Step 62: Calculate the weight of each neighbor node and apply it to each node through a shared weight matrix W of F×F' to calculate the attention coefficient

[0092] Among them, e ij is the importance of node j relative to node i; W is the shared parameter for dimensional expansion;

[0093] Step 63: Normalized weight coefficient; Normalized ownership coefficient α ij for:

[0094]

[0095] Step 64: Recalculate the feature set h' of node i using the weight coefficient in step 63. The feature set h' of node i i for:

[0096]

[0097] Among them, σ is the activation function; W is the shared parameter for dimensional expansion;

[0098] Step 7: Introduce the vector representation of each node into the decoder, convert the vector of each node into a node of the syntax tree, and connect the nodes of the syntax tree according to specific rules to finally generate a complete syntax tree structure;

[0099] The GAT model uses a back-propagation algorithm to update the model parameters through repeated iterations to minimize the TreeNLL loss between the generated syntax tree and the actual syntax tree, thereby generating a correct syntax tree structure; the formula for the loss function is:

[0100]

[0101] Among them, P(t) is the probability distribution on the syntax tree; α is the scaling factor used to adjust the amplitude of the probability distribution. By adjusting α, the sensitivity of the loss function in the entire probability range is changed; λ||P(t)|| is the regularization term, which is used to prevent model fitting and improve the generalization ability of the model;

[0102] The calculation formula for the probability distribution on the syntax tree is:

[0103] P(t)=

[0104] P(root)*Πp(child1 / parent1)*Πp(child2 / parent2)*...Πp(childN / parentN);

[0105] Among them, P(t) is the occurrence probability of syntax tree t, that is, the probability distribution on the syntax tree; root is the root node; child1, child2, ..., childN are the child nodes; parent1, parent2, ..., parentN are the parent nodes; p(childi / parenti) is the probability of the grammatical rules of the child nodes and the parent nodes.

[0106] Step 8: Traverse the clearly defined rules through the obtained syntax tree structure, match the rules for each node, discover and correct potential problems, and complete the SQL audit; for any violations detected, the method will record them in detail and generate a report; the report contains detailed information about the violation, such as the violating SQL statement, the type of violation, and the location of the violation.

[0107] By performing word segmentation, part-of-speech tagging, and syntax analysis on the SQL language, the SQL language is converted into a sequence that can be processed by the graph attention neural network and represented as a vector, and the sequence is encoded, which can deeply understand the syntax and semantic structure of SQL statement queries, and help to more accurately identify potential vulnerabilities, unsafe query structures, and possible security risks. Based on deep learning technology, it can identify and understand complex attack patterns from a large number of data sets, learn the relevant patterns of the SQL syntax tree, and make the system more flexible and adaptable; identify and understand the syntax structure of SQL queries; and use the graph attention mechanism to improve the understanding and processing capabilities of complex SQL; the establishment of the SQL syntax tree is the preparatory work for the SQL rule matching stage, which can more efficiently process a large amount of SQL query data and enhance the audit system's understanding and recognition capabilities of various database operation modes; and by learning patterns and anomalies in large-scale data, it can detect potential new attacks without clear rules, discover the laws hidden in complex data patterns, and improve the perception of unknown threats.

[0108] The above implementation modes are not limitations of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the scope of the technical solution of the present invention also belong to the protection scope of the present invention.

Claims

1. A SQL statement auditing method based on graph attention neural network, characterized in that: The specific steps include: Step S1: receiving a structured query language SQL statement review request and obtaining a SQL statement to be reviewed; Step S2: Convert the SQL statement into a sequence that can be processed by the graph attention neural network GAT; Step S3: Encode the sequence and abstract each node of the sequence into a vector representation; generate a syntax tree structure with structured expressions based on the learning of the graph attention neural network GAT; use the Tree NLL loss function to measure the structural similarity between the generated syntax tree structure and the actual syntax tree structure. The formula of the Tree NLL loss function is: Where P(t) is the probability distribution on the syntax tree structure; α is the scaling factor used to adjust the amplitude of the probability distribution; λ||P(t)|| is the regularization term; Step S4: Formulate SQL audit rules, comprehensively traverse the syntax tree structure in step S3 according to the SQL audit rules, and match each node according to the SQL audit rules to identify potential problems and complete the SQL audit.

2. The SQL statement auditing method based on graph attention neural network according to claim 1 is characterized in that: The SQL statement acquisition source in step S1 is the request submitted by the developer, tester and user.

3. The SQL statement auditing method based on graph attention neural network according to claim 1 is characterized in that: The step S2 converts the SQL statement into a sequence that can be processed by the graph attention neural network GAT, which specifically includes the following steps: Step S21: word segmentation; splitting the SQL statement into the smallest units and individual words; Step S22: Part-of-speech tagging: each word is tagged with a part-of-speech tag; Step S23: parsing the grammatical relationship between each word in the SQL statement through a syntactic analyzer; Step S24: Serialization, converting the SQL statement into a sequence.

4. The SQL statement auditing method based on graph attention neural network according to claim 3 is characterized in that: The generation of the syntax tree structure in step S3 specifically includes the following steps: Step S31: Map each word in the sequence to a node, and connect the nodes into a graph structure according to the SQL statement; Step S32: Using the graph attention neural network GAT to propagate information on the graph structure, the vector representation of each node is updated to the weighted average of the vector representations of the node's neighboring nodes, capturing the deep semantic and grammatical relationships between the words; Step S33: introduce the vector representation of each node into the decoder, convert the vector of each node into a node of the syntax tree, connect the nodes according to specific rules, and generate a syntax tree structure.

5. The SQL statement auditing method based on graph attention neural network according to claim 4 is characterized in that: In the step S3, the self-attention mechanism is used in the graph attention neural network GAT model to allow the network to focus on the nodes adjacent to the target node, and then the node vector output by the encoder is input into the decoder; in the decoder, the inverse self-attention mechanism and the language model technology are used to generate the nodes of the syntax tree structure.

6. The SQL statement auditing method based on graph attention neural network according to claim 5 is characterized in that: The stacked graph attention based on the graph attention neural network GAT realizes the grammatical relationship between each word, and the specific steps include: Step S321: The input of this layer is the node feature set F is the dimension of each node feature; the output of this layer is a new node feature set F' is the dimension of each new node feature; Step S322: Apply a shared weight matrix W of F×F' to each node to calculate the weight of each neighboring node. The calculation formula is: Among them, e ij is the importance of node j relative to node i; W is the shared parameter for dimensional expansion; Step S323: Normalize the weight coefficient, the formula is: Step S324: Recalculate the feature set h' of node i according to the normalized weight coefficient. i for: Among them, σ is the activation function; W is the shared parameter for dimensional expansion.

7. The SQL statement auditing method based on graph attention neural network according to claim 1 is characterized in that: The formula for the probability distribution on the syntax tree structure in step S3 is: P(t)= P(root)*Πp(child1 / parent1)*Πp(child2 / parent2)*...Πp(childN / parentN); Among them, P(t) is the occurrence probability of syntax tree t, that is, the probability distribution on the syntax tree; root is the root node; child1, child2, ..., childN are child nodes; parent1, parent2, ..., parentN are parent nodes; p(childi / parenti) is the probability of the grammatical rules of the child nodes and the parent nodes.

8. The SQL statement auditing method based on graph attention neural network according to claim 1 is characterized in that: The SQL audit rules in step S4 include whether to detect SQL injection attacks, whether to protect sensitive data, and whether to detect performance issues.

9. The SQL statement auditing method based on graph attention neural network according to claim 8 is characterized in that: In step S4, the SQL audit rules are formulated by using regular expressions, pattern matching and semantic analysis.

10. The SQL statement auditing method based on graph attention neural network according to claim 9 is characterized in that: A report is generated for all violations detected according to the SQL audit rules; the report includes detailed information of the violation, including the violating SQL statement, the type of violation, and the location of the violation.