A multi-level secure isolation system and method for a database gateway

By employing a multi-level layered protection architecture and an adaptive token bucket rate limiting mechanism, the problem of detecting covert attacks and controlling high-concurrency requests in existing technologies is solved, enabling fine-grained management and efficient protection of database access requests.

CN120956518BActive Publication Date: 2026-04-28SUZHOU VOCATIONAL INSTITUTE OF INDUSTRIAL TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU VOCATIONAL INSTITUTE OF INDUSTRIAL TECHNOLOGY
Filing Date
2025-09-18
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing database protection methods are unable to detect and respond to covert attack chains in a timely manner, lack adaptive layered defense mechanisms, and cannot perform fine-grained control over requests of different risk levels in high-concurrency request scenarios, resulting in frequent false blocking or missed blocking.

Method used

A multi-level, layered protection architecture is adopted, including a traffic interception module, a semantic parsing module, a risk assessment module, a policy execution module, and a feedback training module. It dynamically adjusts database access requests through risk scoring and adaptive protection actions, combines a Transformer encoder and a graph neural network for deep parsing and risk assessment, and uses an adaptive token bucket rate limiting mechanism for traffic control.

Benefits of technology

It enables fine-grained control over database access requests, improving protection and system stability in complex attack scenarios. It can dynamically adjust strategies based on real-time risks, ensuring normal access performance for low-risk requests and effective rate limiting or isolation for high-risk requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956518B_ABST
    Figure CN120956518B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multistage security isolation systems and methods of database gateway, belong to information security technical field.System includes: traffic interception module, for intercepting all incoming database access requests;Semantic analysis module, for in-depth analysis of access request, obtain numerical feature vector;Risk determination module, for dynamic risk scoring of feature vector, obtain risk score;Strategy execution module, for based on risk score corresponding protection action;Feedback training module, for based on the feature vector of access request, risk score and protection action periodic training, adjust the parameters of system.The application can dynamically adjust security policy according to the real-time risk of request, both can guarantee the access performance of low-risk normal flow, and can effectively limit speed or isolate when high-risk request surge, so as to improve the protection effect and system stability of database gateway to complex attack scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information security technology, specifically relating to a multi-level security isolation system and method for a database gateway. Background Technology

[0002] Existing database protection methods mainly include static SQL auditing, Web Application Firewalls (WAFs), and network firewalls. These methods mostly use fixed rules or signatures to monitor and block database access, but they are difficult to detect and respond to in a timely manner when facing covert attack chains (such as escalating SQL injection attacks and cross-system association attacks). Furthermore, attackers can bypass static rule detection by constantly changing attack syntax and methods, leading to frequent false positives or false negatives with traditional protection measures. Traditional solutions typically lack adaptive layered defense mechanisms and cannot dynamically adjust strategies based on real-time risks. Especially in high-concurrency request scenarios, a single global rate limiting or blocking strategy is often too coarse, unable to fine-tune the control of requests at different risk levels, potentially causing false blocking of legitimate requests while failing to effectively curb high-risk traffic. Therefore, a protection system that can dynamically classify based on real-time risks, implementing differentiated rate limiting and isolation strategies for requests at each level, is needed to improve the overall security and stability of the database gateway. Summary of the Invention

[0003] Based on risk scoring of database access requests, this invention proposes a multi-level layered protection architecture to enhance security and adaptive defense capabilities during database access.

[0004] To achieve the above objectives, the present invention provides the following solution: a multi-level security isolation system for a database gateway, comprising:

[0005] The traffic interception module is used to intercept all incoming database access requests;

[0006] The semantic parsing module is used to perform deep parsing on the access request to obtain a numerical feature vector;

[0007] The risk assessment module is used to perform dynamic risk scoring on the feature vector to obtain a risk score.

[0008] The strategy execution module is used to take corresponding protective actions based on the risk score; the protective actions include: traffic control and blocking measures;

[0009] The feedback training module is used to periodically train and adjust the system parameters based on the feature vectors, risk scores, and protective actions of access requests.

[0010] More preferably, the process by which the semantic parsing module obtains the feature vector includes:

[0011] The access request is broken down into meaningful tokens;

[0012] Based on the syntax rules of the database language, an abstract syntax tree for the access request is constructed;

[0013] Based on the abstract syntax tree, feature maps reflecting the semantic relationships of the access request are extracted;

[0014] The feature vector is obtained based on the lexical units, the abstract syntax tree, and the feature map.

[0015] More preferably, the risk assessment module obtains the risk score based on a pre-trained machine learning model;

[0016] The process of obtaining the risk score includes:

[0017] A Transformer encoder is used to capture long-distance dependencies and contextual semantic information in lexical units;

[0018] A graph neural network encoder is used to process the abstract syntax tree and feature map to obtain structural features;

[0019] The risk score is obtained based on long-distance dependencies, contextual semantic information, and structural features.

[0020] More preferably, the process of performing flow control includes:

[0021] Future short-term traffic can be obtained based on historical request rate sequences;

[0022] Calculate the overall load factor based on CPU load, memory usage, and bandwidth utilization.

[0023] Adaptive filling rate and bucket capacity adjustment based on future short-term flow and overall load factor.

[0024] More preferably, the method for calculating the comprehensive load factor includes:

[0025] L sys (t)=ω cpu L cpu (t)+ω mem L mem (t)+ω net L net (t),∑ω i =1;

[0026] In the formula, L cpu (t), L mem (t) and L net (t) represent CPU load, memory usage, and bandwidth utilization, respectively; ω cpu ωmem ω net These are the weighting coefficients for CPU load, memory usage, and bandwidth utilization, respectively.

[0027] More preferably, the method for adaptive filling rate and bucket capacity adjustment includes:

[0028] R(t) = R0 + k1(r) pred (t+δ)-R0)-k2L sys (t);

[0029] B(t)=B0(1+γL sys (t));

[0030] In the formula, R(t) is the actual token filling rate at time t; R0 is the base token filling rate; k1 and k2 are rate adjustment coefficients; r pred (t+δ) represents the request rate at predicted time t+δ; B(t) is the actual token bucket capacity at time t; B0 is the base token bucket capacity; γ is the capacity elasticity coefficient.

[0031] This invention also provides a multi-level security isolation method for a database gateway, comprising the following steps:

[0032] Intercept all incoming database access requests;

[0033] The access request is analyzed in depth to obtain a numerical feature vector;

[0034] Dynamic risk scoring is performed on the feature vector to obtain a risk score;

[0035] Based on the risk score, corresponding protective actions are taken; the protective actions include: flow control and blocking measures;

[0036] The isolation system's parameters are adjusted through periodic training based on the feature vectors, risk scores, and protective actions of access requests.

[0037] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0038] This invention can dynamically adjust security policies based on the real-time risk of requests, achieving multi-level differentiated protection. It can ensure the access performance of low-risk normal traffic, while effectively limiting or isolating high-risk requests when they surge, thereby improving the protection effect of the database gateway against complex attack scenarios and the stability of the system. Attached Figure Description

[0039] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a schematic diagram of the overall architecture of the system provided in an embodiment of the present invention;

[0041] Figure 2 A flowchart of a method provided in an embodiment of the present invention. Detailed Implementation

[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0044] Example 1:

[0045] like Figure 1 As shown, this embodiment provides a multi-level security isolation system for a database gateway, including: a traffic interception module for intercepting all incoming database access requests; a semantic parsing module for performing deep parsing on the access requests to obtain numerical feature vectors; a risk determination module for dynamically scoring the feature vectors to obtain risk scores; a policy execution module for taking corresponding protective actions based on the risk scores; the protective actions include: traffic control and blocking measures; and a feedback training module for periodically training based on the feature vectors of access requests, risk scores, and protective actions to adjust the system parameters.

[0046] Specifically, the traffic interception module is deployed at the database gateway entry point. It intercepts all incoming database access requests (such as SQL queries and DDL operations) through network monitoring or reverse proxy technologies (such as Nginx and Envoy), temporarily stores the original requests in a memory queue, and asynchronously passes them to the semantic parsing module to avoid blocking high-concurrency traffic. Optional support is provided for IP blacklists / whitelists or protocol compliance checks (such as basic SQL syntax validation).

[0047] When a database access request (such as an SQL query or DDL operation) enters the gateway, it is first deeply parsed by the semantic parsing module. The request text is broken down into meaningful tokens, such as keywords, identifiers, operators, and constants. Based on the syntax rules of the database language (such as SQL), an abstract syntax tree (AST) is constructed for the request. This tree starts with the root node `SelectStatement` and expands hierarchically into `SelectClause` (field list), `FromClause` (data source), and `WhereClause` (conditional expression). Branch nodes precisely express the logical relationships between operators (such as >, AND), column references (age, country), and constants (25, 'CN'). This structured representation reveals the essence of SQL: for example, an attack statement (`WHERE 1=1 OR email LIKE '%admin%'`) will expose a always true condition node (`1=1`) and an anomalous fuzzy match (`LIKE '%admin%'`) in the AST, enabling the system to identify syntax variations that are difficult to detect with traditional regular expression matching (such as comment character interference or case variations). The AST precisely represents the syntactic structure of the request in a tree-like structure. Based on the AST, further feature maps reflecting the semantic relationships of the requests are extracted or constructed. This includes identifying dependencies between tables, columns, functions, and operators, as well as data flow. The parsed global semantic features (such as request intent, operation type, and key objects involved) and structural features (such as the topology of the AST, node type distribution, depth, and complexity; node and edge attributes in the semantic graph) are transformed into numerical feature vectors that can be processed by machine learning models.

[0048] The risk assessment module receives feature vectors as input and feeds them into a pre-trained machine learning model for inference. Specifically, a Transformer encoder is used to capture long-distance dependencies and contextual semantic information in the request text sequence (lexical units). A Graph Neural Network (GNN) encoder is used to process graph-structured data such as ASTs and feature maps, learning representations of nodes and graphs to effectively capture structural features. The process first uses a Transformer encoder to encode the request lexical sequence. Its self-attention mechanism captures long-distance dependencies and global contextual semantic information between keywords, constants, and operators in the SQL statement, generating a semantically rich lexical vector representation. Simultaneously, a Graph Neural Network (GNN) encoder processes the Abstract Syntax Tree (AST) and semantic feature map. Through multi-layer message passing and aggregation mechanisms, it learns the structural relationships between nodes and their neighbors, and obtains a vector representation of the entire request's syntax and semantic structure via graph pooling. Finally, the contextual semantic vector output by the Transformer and the structural feature vector output by the GNN are concatenated and input into a fully connected layer for feature fusion and nonlinear transformation. A normalized risk score within the [0,1] interval is output using the Sigmoid function. This score comprehensively reflects the degree of semantic and structural anomalies in the request. The risk score reflects the probability that the access request may contain malicious behavior or abnormal operations. The system pre-sets multiple risk thresholds and classifies access requests based on the risk score.

[0049] The policy enforcement module triggers rate limiting, allowing, or blocking actions at the corresponding level based on the risk score structure. The risk score is divided into five security levels: safe, suspicious, low risk, medium risk, and high risk. Each security level is configured with independent traffic control policies and blocking measures, and different protective actions are taken for different risk levels.

[0050] In this embodiment, to further enhance the system's ability to protect against sudden floods and high-concurrency SQL requests, an intelligent token bucket adaptive rate control method is proposed based on the existing token bucket rate limiting mechanism, specifically including:

[0051] 1. Based on the historical request rate sequence r(t-τ),…,r(t-1), an LSTM model is used to predict the future short-term traffic r. pred (t+δ):

[0052] r pred (t+δ)=LSTM(r(t-τ),…,r(t-1));

[0053] Where r(t) is the actual request rate at time t, in "requests / second"; τ is the historical window length, i.e., the number of past time steps used for prediction; r pred(t+δ) represents the request rate at prediction time t+δ; δ is the prediction lead, representing the time step interval for the model to predict forward.

[0054] 2. Multi-dimensional system load perception: Real-time acquisition of CPU load L cpu (t); memory usage L mem (t) and bandwidth utilization L net (t); ω cpu ω mem ω net The weighting coefficients of the above three indicators satisfy ω cpu +ω mem +ω net =1; Calculate the overall load factor L sys (t):

[0055] L sys (t)=ω cpu L cpu (t)+ω mem L mem (t)+ω net L net (t),∑ω i =1.

[0056] 3. Adaptive filling rate and bucket capacity adjustment:

[0057] R(t) = R0 + k1(r) pred (t+δ)-R0)-k2L sys (t);

[0058] Where R(t) is the actual token filling rate at time t, which is dynamically calculated by the above formula; R0 is the base (default) token filling rate, in units of "tokens / second"; k1 and k2 are rate adjustment coefficients, used to adjust the effects of prediction bias and system load on the filling rate, respectively.

[0059] B(t)=B0(1+γL sys (t));

[0060] Where B(t) is the actual capacity of the token bucket at time t; B0 is the base (default) token bucket capacity, representing the maximum number of tokens that can be stored; γ is the capacity elasticity coefficient, used to dynamically increase or decrease the bucket capacity according to the load.

[0061] 4. Token consumption and updates handle incoming requests as follows:

[0062] T(t) = min{B(t), T(t)} - )+R(t)Δt}-1;

[0063] Where T(t) is the remaining token quantity at time t, calculated according to the above formula and then deducted from the tokens required for the current request (usually 1 token is consumed per request); min{·} is the minimum value operation to ensure that the number of tokens after replenishment does not exceed the bucket capacity; T(t - ) represents the remaining amount of tokens at the instant before time t (the amount before the update); Δt represents the token replenishment period or time interval, in seconds; the -1 at the end of the formula indicates that one token is consumed for each request.

[0064] The policy enforcement module takes corresponding actions based on the determined security level of requests passing the token bucket check: Secure requests are allowed with the highest priority and only basic logging is performed; suspicious requests are allowed but are logged in detail (complete request, context, score), and a slight rate limit may be applied to prevent probing attacks, without proactive blocking; low-risk requests are subject to strict rate limits, detailed logging is performed, and additional review may be triggered; medium-risk requests are strictly limited or most requests are blocked. For the few allowed requests, they must be forcibly redirected to a sandbox isolation environment for execution, where in-depth security checks (such as behavior monitoring and result analysis) are performed, with results only returning secure responses; high-risk requests are immediately blocked, database access is prohibited, a high-level alert is generated to notify the security administrator, and complete attack characteristics are recorded. Details are shown in Table 1.

[0065] Table 1

[0066]

[0067] Finally, data on original requests, risk scores, and execution results (whether false positives / false negatives were detected) are collected, and high-risk samples are labeled: attack cases verified by security administrators. The feedback training module periodically retrains the model iteratively, fine-tuning the model weights with new data to adapt to new attack syntax. False positive samples are added to the training queue in real time, dynamically updating the model. The grading threshold is adjusted based on the false positive / false negative rate (e.g., lowering the high-risk threshold from 0.9 to 0.85). Token bucket parameters are also dynamically calibrated to improve the system's adaptability to dynamic traffic and abnormal fluctuations. Specifically, the token filling rate or bucket capacity for each security level can be adjusted in a timely manner based on the system's monitored load, false positive / false negative rate, or the output of the feedback training module. For example, when the system detects a surge in high-concurrency requests or attack traffic, the filling rate or bucket capacity of the corresponding level can be temporarily increased to alleviate instantaneous traffic pressure; when the load is low, the filling rate can be reduced to save resources. Furthermore, based on the false positive and false negative rates statistically analyzed in the feedback training module, the token bucket parameters at each level can be automatically calibrated, making flow control more intelligent and adaptive.

[0068] In summary, this invention achieves fine-grained control over database access requests by introducing a dynamic, multi-level security isolation mechanism based on risk scoring into the database gateway. Independent token bucket rate limiting and differentiated policy execution at each level effectively enhance the system's ability to handle peak concurrency and high-risk traffic, thereby improving the overall security of database operations.

[0069] Example 2:

[0070] like Figure 2 As shown, this embodiment provides a multi-level security isolation method for a database gateway, including the following steps: intercepting all incoming database access requests; performing deep analysis on the access requests to obtain numerical feature vectors; performing dynamic risk scoring on the feature vectors to obtain risk scores; taking corresponding protective actions based on the risk scores; the protective actions include: traffic control and blocking measures; and periodically training based on the feature vectors, risk scores, and protective actions of the access requests to adjust the parameters of the isolation system.

[0071] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A multi-level security isolation system for a database gateway, characterized in that, include: The traffic interception module is used to intercept all incoming database access requests; The semantic parsing module is used to perform deep parsing on the access request to obtain a numerical feature vector; The risk assessment module is used to perform dynamic risk scoring on the feature vector to obtain a risk score. The strategy execution module is used to take corresponding protective actions based on the risk score; the protective actions include: traffic control and blocking measures; The feedback training module is used to periodically train and adjust the system parameters based on the feature vectors, risk scores, and protective actions of access requests. The risk assessment module obtains the risk score based on a pre-trained machine learning model; The process of obtaining the risk score includes: A Transformer encoder is used to capture long-distance dependencies and contextual semantic information in lexical units; A graph neural network encoder is used to process the abstract syntax tree and feature map to obtain structural features; The risk score is obtained based on long-distance dependencies, contextual semantic information, and structural features; The process of flow control includes: Future short-term traffic can be obtained based on historical request rate sequences; Calculate the overall load factor based on CPU load, memory usage, and bandwidth utilization. Adaptive filling rate and bucket capacity adjustment based on future short-term flow and overall load factor.

2. The multi-level security isolation system for a database gateway according to claim 1, characterized in that, The process by which the semantic parsing module obtains the feature vector includes: The access request is broken down into meaningful tokens; Based on the syntax rules of the database language, an abstract syntax tree for the access request is constructed; Based on the abstract syntax tree, feature maps reflecting the semantic relationships of the access request are extracted; The feature vector is obtained based on the lexical units, the abstract syntax tree, and the feature map.

3. The multi-level security isolation system for a database gateway according to claim 1, characterized in that, The method for calculating the comprehensive load factor includes: ; In the formula, , and These represent CPU load, memory usage, and bandwidth utilization, respectively. , , These are the weighting coefficients for CPU load, memory usage, and bandwidth utilization, respectively.

4. A multi-level security isolation system for a database gateway according to claim 3, characterized in that, Methods for adaptive filling rate and bucket capacity adjustment include: ; ; In the formula, It is a moment The actual token filling rate; It is the base token filling rate; , It is the rate adjustment coefficient; Indicates the predicted time Request rate; It is a moment The actual capacity of the token bucket; This is the basic token bucket capacity; It is the capacity elasticity coefficient.

5. A multi-level security isolation method for a database gateway, wherein the method is applied to the system described in any one of claims 1-4, characterized in that, Includes the following steps: Intercept all incoming database access requests; The access request is analyzed in depth to obtain a numerical feature vector; Dynamic risk scoring is performed on the feature vector to obtain a risk score; Based on the risk score, corresponding protective actions are taken; the protective actions include: flow control and blocking measures; The isolation system's parameters are adjusted through periodic training based on the feature vectors, risk scores, and protective actions of access requests.

Citation Information

Patent Citations

  • Database access flow control method and system

    CN117171778A

  • Access control method and system based on big data statistical analysis

    CN118264456A