A database operation behavior identification method and system
By designing a database operation behavior recognition system in the database management system, using multi-dimensional abnormal detection and dynamic threshold adjustment, the problem of lagging response of abnormal fluctuations in database access volume is solved, and efficient and secure database operation management is achieved.
Patent Information
- Application Number
- CN202411339650.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The existing database management system is difficult to conduct fine-grained analysis of the multi-dimensional database access volume, resulting in a lag in response when the access volume fluctuates abnormally, and it is impossible to identify and prevent it in time.
A database operation behavior recognition system was designed, including a database information collection module, a preprocessing and feature extraction module, a multi-dimensional abnormality detection module, a real-time monitoring and dynamic adjustment module and a decision-making module, and a database operation log is obtained through regular polling and triggering. and SQL query statements, perform data cleaning, feature extraction, abnormal detection and dynamic threshold adjustment, monitor and evaluate abnormal behavior in real time, and trigger protective measures.
It realizes accurate identification and real-time monitoring of database operation behavior, improves the sensitivity and protection accuracy of abnormal detection, and ensures efficient, safe and intelligent management of the system when facing complex operating environments.
Smart Images

Figure CN118885466B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database technology, and in particular to a method and system for identifying database operation behavior. Background Art
[0002] In the specific subdivision of data management, database operation behavior recognition focuses on monitoring and analyzing the interaction process between users and databases, including tracking of operations such as data query, insertion, update, and deletion. Among these operations, the recognition of abnormal behavior is a key area, which focuses on detecting possible risks and abnormal operations during database use.
[0003] Abnormal fluctuations in access volume are common in database management, especially in data-intensive applications such as large-scale e-commerce platforms. Existing database management systems can usually only monitor changes in overall traffic, and it is difficult to perform fine-grained analysis of access volume dimensions, such as access volume of tables, fields, and specific data objects. Specifically, when the access volume of certain products suddenly surges or decreases, the system is usually unable to quickly identify whether this change is normal user behavior, and lacks accurate positioning of multi-dimensional data anomalies. This shortcoming makes the system slow to respond when faced with abnormal situations, and cannot provide timely warnings and prevention. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a method and system for identifying database operation behavior, which solves the problems mentioned in the background technology.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a database operation behavior recognition system, including a database information acquisition module, a preprocessing and feature extraction module, a multi-dimensional anomaly detection module, a real-time monitoring and dynamic adjustment module and a decision module;
[0006] The database information collection module is used to monitor database operation logs and SQL query statements through regular polling and triggering, obtain database operation related parameter information, and form a first data set DSG;
[0007] The preprocessing and feature extraction module is used to perform data cleaning preprocessing and data standardization preprocessing on the first data set DSG, remove outliers and fill missing values, and then perform feature extraction to obtain the frequency distribution characteristics and operation type proportion characteristics of the query operation to form the second data set FTR;
[0008] The multi-dimensional anomaly detection module is used to establish an anomaly detection algorithm, identify abnormal behaviors in database operations for the second data set FTR, obtain an anomaly detection index ANM, match according to a preset database operation abnormal state threshold SZ, obtain a database operation abnormality evaluation result, and trigger database operation behavior restrictions according to the database operation abnormality evaluation result, synchronously monitor the current database load, query response time and operation frequency, dynamically adjust the database operation abnormal state threshold SZ, and generate a new dynamic threshold THR;
[0009] The real-time monitoring and dynamic adjustment module is used to monitor and count the number of abnormal operations LMT after executing the database operation behavior restriction, perform trend analysis on the number of abnormal operations LMT, and perform secondary regulation on the dynamic threshold THR according to the trend status result;
[0010] The decision module is used to perform fitting according to the anomaly detection index ANM and the dynamic threshold THR, perform impact assessment on the detected abnormal behavior, obtain the risk assessment index LVL of the abnormal behavior, and trigger secondary protection measures and database operation behavior restrictions according to the risk assessment index LVL.
[0011] Preferably, the database information acquisition module periodically queries the database operation log and SQL query statement at set time intervals to implement periodic polling query and capture database operation behaviors when trigger conditions are met. At the end of each time interval, the system extracts the operation log and the SQL query statement in operation from the database, obtains the database operation type Ni, the total number of operations Ntotal, the number of table queries TQC, the number of field queries FQC, the number of user queries UQC and the query response time QRT, and forms a first data set DSG, specifically DSG={Ni, Ntotal, TQC, FQC, UQC, QRT};
[0012] Among them, satisfying the trigger condition specifically means that when the user operation data meets certain conditions, relevant data is automatically collected, including when the number of queries in the user query table meets the conditions, when the number of user operation tables meets the conditions, and when the database response time during user operation meets the conditions.
[0013] Preferably, the preprocessing and feature extraction module includes a data cleaning unit and a feature extraction unit;
[0014] The data cleaning unit performs data cleaning preprocessing and data standardization preprocessing on the first data set DSG to remove outliers and fill missing values;
[0015] Among them, data cleaning preprocessing includes using statistical analysis methods to remove outliers from the data of the first data set DSG, thereby excluding data points that deviate from the mean abnormally; using interpolation and mean filling methods to fill missing values in the data of the first data set DSG, thereby adjusting the continuity of the data in the first data set DSG.
[0016] Preferably, the feature extraction unit performs feature extraction on the first data set DSG that performs data cleaning preprocessing and data standardization preprocessing, obtains frequency distribution features and operation type proportion features of query operations, and forms a second data set FTR;
[0017] Among them, the frequency distribution feature is obtained by counting the execution frequency of user query modification operations within a fixed time window and analyzing the distribution characteristics of the execution frequency to obtain the operation frequency FQ;
[0018] The operating frequency FQ is obtained by the following statistical analysis formula:
[0019] ;
[0020] In the formula, FQi represents the operation frequency of the i-th type of operation, Ti represents the length of the time window, and Ni represents the number of i-th type of operation within the time window length Ti;
[0021] The operation type ratio feature counts the ratio of the number of user query, insert, delete and update operations to the total number of operations Ntotal to identify the operation type ratio OPRi;
[0022] The operation type proportion OPRi is obtained by the following calculation formula
[0023] ;
[0024] The operation frequency FQi and the operation type proportion OPRi are integrated into the second data set FTR, specifically FTR={i, Ntotal, TQC, FQC, UQC, QRT, FQi, OPRi}.
[0025] Preferably, the multi-dimensional anomaly detection module includes an anomaly detection unit and a dynamic threshold adjustment unit;
[0026] The anomaly detection unit establishes an anomaly detection algorithm, identifies abnormal behavior in database operations on the second data set FTR, obtains an anomaly detection index ANM, matches it according to a preset database operation abnormal state threshold SZ, obtains a database operation abnormality evaluation result, and triggers a database operation behavior restriction according to the database operation abnormality evaluation result;
[0027] The anomaly detection index ANM is obtained by the following calculation formula:
[0028] ;
[0029] In the formula, ANMi represents the anomaly detection index of the i-th type of operation, TQCi represents the number of table queries for the i-th type of operation, FQCi represents the number of field queries for the i-th type of operation, UQCi represents the number of user queries for the i-th type of operation, QRTi represents the query response time for the i-th type of operation, represents the historical average of query response time, and ln represents the natural logarithm function.
[0030] Preferably, the database operation abnormality assessment result is obtained by Matching method acquisition;
[0031] When the status return signal of the database operation abnormality assessment result is 1, the database operation abnormality assessment result is obtained as an abnormal result, and the database operation behavior restriction is triggered, including blocking operations and early warning prompts, synchronously monitoring the database status and dynamically adjusting the database operation abnormal status threshold SZ;
[0032] When the status return signal of the database operation abnormality assessment result is 0, the database operation abnormality assessment result obtained is a non-abnormal result.
[0033] Preferably, when the database operation behavior restriction is triggered, the dynamic threshold adjustment unit synchronously monitors the load, response and operation frequency information of the current database, dynamically adjusts the database operation abnormal state threshold SZ, and generates a new dynamic threshold THR;
[0034] The dynamic threshold THR is obtained by the following calculation formula:
[0035] THR = α*SZ + [ β* ( FQbefore-FQafter FQbefore ) + γ* ( QRTbefore-QRTafter QRTbefore ) ] ;
[0036] In the formula, FQbefore and FQafter represent the operation frequency before triggering the database operation behavior restriction and the operation frequency after the restriction, respectively. QRTbefore and QRTafter represent the query response time before triggering the database operation behavior restriction and the query response time after the restriction, respectively. Indicates the adjustment coefficient of the database operation abnormal state threshold SZ. Indicates the adjustment coefficient of the calculation results of the operation frequency FQbefore before triggering the database operation behavior restriction and the operation frequency FQafter after the restriction. Indicates the adjustment coefficient of the query response time FQbefore before triggering the database operation behavior restriction and the query response time FQbefore after the restriction, and, , , , , the specific value is set by the user.
[0037] Preferably, after the real-time monitoring and dynamic adjustment module restricts the execution of database operation behavior, it monitors and counts the number of abnormal operations LMT, matches it with the abnormal operation trend threshold YZ, analyzes the trend of the number of abnormal operations LMT, obtains the abnormal operation trend status result, and triggers secondary regulation of the dynamic threshold THR, and synchronously executes the dynamic threshold adjustment unit to obtain the dynamic threshold THR after the secondary regulation;
[0038] The number of abnormal operations LMT Obtained by statistical method, where P represents the total number of statistical time intervals, q represents the qth statistical time interval, and status represents the return signal, including return signal 1 and return signal 0;
[0039] When the number of abnormal operations LMT ≥ the abnormal operation trend threshold YZ, the abnormal operation trend state result is abnormal, triggering secondary adjustment of the dynamic threshold THR, and executing the dynamic threshold adjustment unit to obtain the dynamic threshold THR after secondary adjustment;
[0040] When the number of abnormal operations LMT is less than the abnormal operation trend threshold YZ, the abnormal operation trend state result is obtained as no abnormality.
[0041] Preferably, the decision module includes a risk impact assessment unit and a risk measure execution unit;
[0042] The risk assessment unit performs fitting according to the abnormal detection index ANM and the dynamic threshold THR, performs an impact assessment on the detected abnormal behavior, and obtains a risk assessment index LVL of the abnormal behavior;
[0043] The risk assessment index LVL is obtained by the following calculation formula:
[0044] ;
[0045] In the formula, represents the exponential decay coefficient, Ty represents the time interval between the abnormal operation and the current time, and Tymax represents the upper limit detection time range of the abnormal operation;
[0046] The risk measure execution unit matches the risk assessment index LVL with the upper threshold SEZ and the lower threshold XEZ of the secondary risk protection assessment, triggering secondary protection measures and database operation behavior restrictions;
[0047] The secondary protection measures and database operation behavior restrictions are triggered by the following trigger mechanisms:
[0048] When the risk assessment index LVL is less than the lower threshold XEZ, the secondary protection measures and database operation behavior restrictions are not triggered;
[0049] When the lower threshold XEZ ≤ risk assessment index LVL ≤ upper threshold SEZ, secondary protection measures and database operation behavior restrictions are triggered, including triggering user identity re-verification and increasing operation delays;
[0050] When the upper threshold SEZ is less than the risk assessment index LVL, secondary protection warning measures and database operation behavior warning restrictions are triggered, including terminating the current database session, rolling back the database and locking key data tables, and triggering mandatory multi-factor authentication.
[0051] A method for identifying database operation behavior comprises the following steps:
[0052] Step 1: The database information collection module monitors the database operation log and SQL query statements through regular polling and triggering, obtains the parameter information related to the database operation, and forms the first data set DSG;
[0053] Step 2: The preprocessing and feature extraction module performs data cleaning and data standardization preprocessing on the first data set DSG, removes outliers and fills missing values, and then performs feature extraction to obtain the frequency distribution characteristics of query operations and the proportion characteristics of operation types to form the second data set FTR;
[0054] Step 3: The multi-dimensional anomaly detection module establishes an anomaly detection algorithm, identifies abnormal behaviors in database operations for the second data set FTR, obtains the anomaly detection index ANM, matches it according to the preset database operation abnormal state threshold SZ, obtains the database operation abnormality evaluation result, and triggers database operation behavior restrictions according to the database operation abnormality evaluation result, synchronously monitors the current database load, query response time and operation frequency, dynamically adjusts the database operation abnormal state threshold SZ, and generates a new dynamic threshold THR;
[0055] Step 4: After the real-time monitoring and dynamic adjustment module restricts the execution of database operation behaviors, it monitors and counts the number of abnormal operations LMT, performs trend analysis on the number of abnormal operations LMT, and performs secondary adjustment on the dynamic threshold THR according to the trend status results;
[0056] Step 5: The decision module is fitted according to the anomaly detection index ANM and the dynamic threshold THR, and the impact assessment of the detected abnormal behavior is evaluated to obtain the risk assessment index LVL of the abnormal behavior. Secondary protection measures and database operation behavior restrictions are triggered according to the risk assessment index LVL.
[0057] The present invention provides a method and system for identifying database operation behavior, which has the following beneficial effects:
[0058] (1) When the system is running, through the database information collection module, the system can periodically poll and trigger in real time to obtain database operation logs and SQL query information to ensure the comprehensiveness and timeliness of data collection. Secondly, the preprocessing and feature extraction module cleans and extracts features from the data to ensure the integrity and accuracy of the data set, thereby effectively eliminating the interference of noise data and outliers. Next, the multi-dimensional anomaly detection module combines the anomaly detection algorithm to timely discover abnormal operation behaviors by analyzing the operation frequency and operation type distribution, and dynamically adjusts the dynamic threshold THR based on the real-time load and response of the database, thereby optimizing the accuracy and adaptability of anomaly detection. The real-time monitoring and dynamic adjustment module further refines the regulation of the dynamic threshold by counting the number and trend of abnormal operations, ensuring that the system can flexibly adjust the protection strategy according to the changes in operation behavior. Finally, the decision module generates the risk assessment index LVL of abnormal behavior through the fitting analysis of the anomaly detection index ANM and the dynamic threshold THR, and triggers corresponding protection measures according to different risk levels. This ensures efficient protection in the face of complex database operation environments and realizes efficient, secure, and intelligent management of databases.
[0059] (2) By establishing an anomaly detection algorithm for the second data set FTR to identify abnormal behaviors in database operations, the anomaly detection index ANM is obtained, and by matching it with the preset database operation abnormal state threshold SZ, the abnormal state of the database operation is quickly evaluated. When the system detects an abnormal operation, it can not only immediately trigger restriction measures, such as blocking operations and early warning prompts, but also synchronously monitor the real-time status of the database load, query response time, and operation frequency, thereby ensuring the effectiveness and timeliness of system protection. In addition, the dynamic threshold adjustment unit automatically calculates the new dynamic threshold THR based on the data changes before and after the operation restriction, so that the system can adaptively adjust the anomaly detection standard under different loads and operating environments, further improving the detection sensitivity and protection accuracy. Compared with the traditional static threshold setting, the dynamic adjustment capability enables it to maintain continuous and efficient response and ensure the stability and security of system operation when facing a frequently changing database operating environment.
[0060] (3) By dynamically monitoring and analyzing the number of abnormal operations LMT after the execution of database operation behavior restrictions, real-time evaluation and accurate response to system abnormal behavior are achieved. By matching LMT with the abnormal operation trend threshold YZ, the system can quickly determine the changing trend of abnormal operations and trigger secondary regulation of the dynamic threshold THR, ensuring that the detection threshold can be accurately adjusted according to real-time operation conditions. At the same time, the risk assessment unit calculates the risk assessment index LVL through an exponential decay model, and effectively evaluates the potential impact of abnormal behavior by combining the current dynamic threshold THR and the anomaly detection index ANM. The risk measure execution unit matches LVL with the preset upper threshold SEZ and lower threshold XEZ of the secondary risk protection assessment, and automatically triggers different levels of secondary protection measures and operation restrictions. It not only avoids excessive interference with normal operations, but also can quickly prevent potential major threats at critical moments, achieving accuracy and efficiency in database operation protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is a schematic diagram of a database operation behavior recognition system according to the present invention;
[0062] Figure 2 The figure is a schematic diagram of the steps of a method for identifying database operation behavior according to the present invention. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0064] Example 1
[0065] The present invention provides a database operation behavior recognition system, please refer to Figure 1 , including database information acquisition module, preprocessing and feature extraction module, multi-dimensional anomaly detection module, real-time monitoring and dynamic adjustment module and decision-making module;
[0066] The database information acquisition module monitors database operation logs and SQL query statements through regular polling and triggering, obtains parameter information related to database operations, and forms a first data set DSG;
[0067] The preprocessing and feature extraction module performs data cleaning preprocessing and data standardization preprocessing on the first data set DSG, removes outliers and fills missing values, and then performs feature extraction to obtain frequency distribution features and operation type proportion features of query operations to form the second data set FTR;
[0068] The multi-dimensional anomaly detection module establishes an anomaly detection algorithm for the second data set FTR to identify abnormal behaviors in database operations, obtains an anomaly detection index ANM, matches it according to a preset database operation abnormal state threshold SZ, obtains a database operation abnormality evaluation result, and triggers database operation behavior restrictions according to the database operation abnormality evaluation result, synchronously monitors the current database load, query response time and operation frequency, dynamically adjusts the database operation abnormal state threshold SZ, and generates a new dynamic threshold THR;
[0069] After the real-time monitoring and dynamic adjustment module restricts the execution of database operation behaviors, it monitors and counts the number of abnormal operations LMT, performs trend analysis on the number of abnormal operations LMT, and performs secondary regulation on the dynamic threshold THR according to the trend status result;
[0070] The decision module is fitted according to the anomaly detection index ANM and the dynamic threshold THR, performs an impact assessment on the detected abnormal behavior, obtains the risk assessment index LVL of the abnormal behavior, and triggers secondary protection measures and database operation behavior restrictions according to the risk assessment index LVL.
[0071] In this embodiment, through the database information collection module, the system can regularly poll and trigger in real time to obtain database operation logs and SQL query information to ensure the comprehensiveness and timeliness of data collection. Secondly, the preprocessing and feature extraction module cleans and extracts features for the data to ensure the integrity and accuracy of the data set, thereby effectively eliminating noise data and outlier interference. Then, the multi-dimensional anomaly detection module combines the anomaly detection algorithm to timely discover abnormal operation behaviors by analyzing the operation frequency and operation type distribution, and dynamically adjusts the dynamic threshold THR based on the real-time load and response of the database, thereby optimizing the accuracy and adaptability of anomaly detection. The real-time monitoring and dynamic adjustment module further refines the regulation of the dynamic threshold by counting the number and trend of abnormal operations, ensuring that the system can flexibly adjust the protection strategy according to the changes in operation behavior. Finally, the decision module generates the risk assessment index LVL of abnormal behavior through the fitting analysis of the anomaly detection index and the dynamic threshold, and triggers corresponding protection measures according to different risk levels. It solves the problem of abnormal operation being difficult to detect in real time and the inflexible response as much as possible, and also ensures efficient protection in the face of complex database operation environments, realizing efficient, safe and intelligent management of databases.
[0072] Example 2
[0073] This embodiment is explained in Example 1, please refer to Figure 1Specifically: the database information acquisition module periodically queries the database operation log and SQL query statement at a set time interval to implement regular polling query and capture database operation behavior when the trigger condition is met. At the end of each time interval, the system extracts the operation log and the running SQL query statement from the database, obtains the database operation type Ni, the total number of operations Ntotal, the number of table queries TQC, the number of field queries FQC, the number of user queries UQC and the query response time QRT, and forms a first data set DSG, specifically DSG={Ni, Ntotal, TQC, FQC, UQC, QRT};
[0074] Among them, satisfying the trigger condition specifically means that when the user operation data meets certain conditions, relevant data is automatically collected, including when the number of queries in the user query table meets the conditions, when the number of user operation tables meets the conditions, and when the database response time during user operation meets the conditions.
[0075] The preprocessing and feature extraction module includes a data cleaning unit and a feature extraction unit;
[0076] The data cleaning unit performs data cleaning preprocessing and data standardization preprocessing on the first data set DSG to remove outliers and fill missing values;
[0077] Among them, data cleaning preprocessing includes using statistical analysis methods to remove outliers from the data of the first data set DSG, thereby excluding data points that deviate from the mean abnormally; using interpolation and mean filling methods to fill missing values in the data of the first data set DSG, thereby adjusting the continuity of the data in the first data set DSG.
[0078] The feature extraction unit extracts features from the first data set DSG that has undergone data cleaning preprocessing and data standardization preprocessing, obtains frequency distribution features and operation type proportion features of query operations, and forms a second data set FTR;
[0079] Among them, the frequency distribution feature is obtained by counting the execution frequency of user query modification operations within a fixed time window and analyzing the distribution characteristics of the execution frequency to obtain the operation frequency FQ;
[0080] The operating frequency FQ is obtained by the following statistical analysis formula:
[0081] ;
[0082] In the formula, FQi represents the operation frequency of the i-th type of operation, Ti represents the length of the time window, and Ni represents the number of i-th type of operation within the time window length Ti;
[0083] The operation type ratio feature counts the ratio of the number of user query, insert, delete and update operations to the total number of operations Ntotal to identify the operation type ratio OPRi;
[0084] The operation type proportion OPRi is obtained by the following calculation formula:
[0085] ;
[0086] The operation frequency FQi and the operation type proportion OPRi are integrated into the second data set FTR, specifically FTR={i, Ntotal, TQC, FQC, UQC, QRT, FQi, OPRi}.
[0087] Example 3
[0088] This embodiment is explained in Example 2. Please refer to Figure 1 ,Specifically: the multi-dimensional anomaly detection module includes an anomaly detection unit and a dynamic threshold adjustment unit;
[0089] The anomaly detection unit establishes an anomaly detection algorithm for the second data set FTR to identify abnormal behavior in database operation, obtains an anomaly detection index ANM, matches it according to a preset database operation abnormal state threshold SZ, obtains a database operation abnormality evaluation result, and triggers a database operation behavior restriction according to the database operation abnormality evaluation result;
[0090] The anomaly detection index ANM is obtained by the following calculation formula:
[0091] ;
[0092] In the formula, ANMi represents the anomaly detection index of the i-th type of operation, TQCi represents the number of table queries for the i-th type of operation, FQCi represents the number of field queries for the i-th type of operation, UQCi represents the number of user queries for the i-th type of operation, QRTi represents the query response time for the i-th type of operation, represents the historical average of query response time, and ln represents the natural logarithm function.
[0093] The database operation abnormality assessment result is Matching method acquisition;
[0094] When the status return signal of the database operation abnormality assessment result is 1, the database operation abnormality assessment result is obtained as an abnormal result, and the database operation behavior restriction is triggered, including blocking operations and early warning prompts, synchronously monitoring the database status and dynamically adjusting the database operation abnormal status threshold SZ;
[0095] When the status return signal of the database operation abnormality assessment result is 0, the database operation abnormality assessment result obtained is a non-abnormal result.
[0096] When the database operation behavior restriction is triggered, the dynamic threshold adjustment unit synchronously monitors the load, response and operation frequency information of the current database, dynamically adjusts the database operation abnormal state threshold SZ, and generates a new dynamic threshold THR;
[0097] The dynamic threshold THR is obtained by the following calculation formula:
[0098] THR = α*SZ + [ β* ( FQbefore-FQafter FQbefore ) + γ* ( QRTbefore-QRTafter QRTbefore ) ] ;
[0099] In the formula, FQbefore and FQafter represent the operation frequency before triggering the database operation behavior restriction and the operation frequency after the restriction, respectively. QRTbefore and QRTafter represent the query response time before triggering the database operation behavior restriction and the query response time after the restriction, respectively. Indicates the adjustment coefficient of the database operation abnormal state threshold SZ. Indicates the adjustment coefficient of the calculation results of the operation frequency FQbefore before triggering the database operation behavior restriction and the operation frequency FQafter after the restriction. Indicates the adjustment coefficient of the query response time FQbefore before triggering the database operation behavior restriction and the query response time FQbefore after the restriction, and, , , , , the specific value is set by the user.
[0100] In this embodiment, an abnormal behavior in database operation is identified by establishing an anomaly detection algorithm for the second data set FTR, obtaining an anomaly detection index ANM, and matching it with the preset database operation abnormal state threshold SZ to quickly evaluate the abnormal state of the database operation. When the system detects an abnormal operation, it can not only immediately trigger restriction measures, such as blocking operations and early warning prompts, but also synchronously monitor the real-time status of the database load, query response time, and operation frequency, thereby ensuring the effectiveness and timeliness of system protection. In addition, the dynamic threshold adjustment unit automatically calculates the new dynamic threshold THR according to the data changes before and after the operation restriction, so that the system can adaptively adjust the anomaly detection standard under different loads and operating environments, further improving the detection sensitivity and protection accuracy. Compared with the traditional static threshold setting, the dynamic adjustment capability of the system enables it to maintain continuous and efficient response in the face of frequently changing database operating environments, ensuring the stability and security of system operation.
[0101] Example 4
[0102] This embodiment is explained in Example 3, please refer to Figure 1 Specifically: the real-time monitoring and dynamic adjustment module monitors and counts the number of abnormal operations LMT after the execution of database operation behavior restrictions, matches it with the abnormal operation trend threshold YZ, analyzes the trend of the number of abnormal operations LMT, obtains the abnormal operation trend status result, and triggers secondary regulation of the dynamic threshold THR, and synchronously executes the dynamic threshold adjustment unit to obtain the dynamic threshold THR after secondary regulation;
[0103] The number of abnormal operations LMT Obtained by statistical method, where P represents the total number of statistical time intervals, q represents the qth statistical time interval, and status represents the return signal, including return signal 1 and return signal 0;
[0104] When the number of abnormal operations LMT ≥ the abnormal operation trend threshold YZ, the abnormal operation trend state result is abnormal, triggering secondary adjustment of the dynamic threshold THR, and executing the dynamic threshold adjustment unit to obtain the dynamic threshold THR after secondary adjustment;
[0105] When the number of abnormal operations LMT is less than the abnormal operation trend threshold YZ, the abnormal operation trend state result is obtained as no abnormality.
[0106] The decision-making module includes a risk impact assessment unit and a risk measure execution unit;
[0107] The risk assessment unit performs fitting according to the abnormal detection index ANM and the dynamic threshold THR, performs an impact assessment on the detected abnormal behavior, and obtains a risk assessment index LVL of the abnormal behavior;
[0108] The risk assessment index LVL is obtained by the following calculation formula:
[0109] ;
[0110] In the formula, represents the exponential decay coefficient, Ty represents the time interval between the abnormal operation and the current time, and Tymax represents the upper limit detection time range of the abnormal operation;
[0111] The risk measure execution unit matches the risk assessment index LVL with the upper threshold SEZ and the lower threshold XEZ of the secondary risk protection assessment, triggering secondary protection measures and database operation behavior restrictions;
[0112] The secondary protection measures and database operation behavior restrictions are triggered by the following trigger mechanisms:
[0113] When the risk assessment index LVL is less than the lower threshold XEZ, the secondary protection measures and database operation behavior restrictions are not triggered;
[0114] When the lower threshold XEZ ≤ risk assessment index LVL ≤ upper threshold SEZ, secondary protection measures and database operation behavior restrictions are triggered, including triggering user identity re-verification and increasing operation delays;
[0115] When the upper threshold SEZ is less than the risk assessment index LVL, secondary protection warning measures and database operation behavior warning restrictions are triggered, including terminating the current database session, rolling back the database and locking key data tables, and triggering mandatory multi-factor authentication.
[0116] In this embodiment, by dynamically monitoring and trending the number of abnormal operations LMT after the execution of database operation behavior restrictions, real-time evaluation and accurate response to abnormal behavior of the system are achieved. By matching LMT with the abnormal operation trend threshold YZ, the system can quickly determine the changing trend of abnormal operations, trigger the secondary regulation of the dynamic threshold THR, and ensure that the detection threshold can be accurately adjusted according to the real-time operation situation. At the same time, the risk assessment unit calculates the risk assessment index LVL through the exponential decay model, and effectively evaluates the potential impact of abnormal behavior by combining the current dynamic threshold THR and the abnormal detection index ANM. The risk measure execution unit matches LVL with the upper threshold SEZ and lower threshold XEZ of the preset secondary risk protection assessment, and automatically triggers secondary protection measures and operation restrictions of different levels. It not only avoids excessive interference with normal operations, but also can quickly prevent potential major threats at critical moments, thereby achieving accuracy and efficiency in database operation protection.
[0117] Example 5
[0118] A database operation behavior identification method, please refer to Figure 2 , specifically: including the following steps:
[0119] Step 1: The database information collection module monitors the database operation log and SQL query statements through regular polling and triggering, obtains the parameter information related to the database operation, and forms the first data set DSG;
[0120] Step 2: The preprocessing and feature extraction module performs data cleaning and data standardization preprocessing on the first data set DSG, removes outliers and fills missing values, and then performs feature extraction to obtain the frequency distribution characteristics of query operations and the proportion characteristics of operation types to form the second data set FTR;
[0121] Step 3: The multi-dimensional anomaly detection module establishes an anomaly detection algorithm for the second data set FTR to identify abnormal behaviors in database operations, obtains the anomaly detection index ANM, matches it according to the preset database operation abnormal state threshold SZ, obtains the database operation abnormality evaluation result, and triggers the database operation behavior restriction according to the database operation abnormality evaluation result, synchronously monitors the current database load, query response time and operation frequency, dynamically adjusts the database operation abnormal state threshold SZ, and generates a new dynamic threshold THR;
[0122] Step 4: After the real-time monitoring and dynamic adjustment module restricts the execution of database operation behaviors, it monitors and counts the number of abnormal operations LMT, performs trend analysis on the number of abnormal operations LMT, and performs secondary adjustment on the dynamic threshold THR according to the trend status results;
[0123] Step 5: The decision module is fitted according to the anomaly detection index ANM and the dynamic threshold THR, and the impact assessment of the detected abnormal behavior is evaluated to obtain the risk assessment index LVL of the abnormal behavior. Secondary protection measures and database operation behavior restrictions are triggered according to the risk assessment index LVL.
[0124] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A database operation behavior recognition system, Features: It includes database information acquisition module, preprocessing and feature extraction module, multi-dimensional anomaly detection module, real-time monitoring and dynamic adjustment module and decision-making module; The database information collection module is used to monitor database operation logs and SQL query statements through regular polling and triggering, obtain database operation related parameter information, and form a first data set DSG; The preprocessing and feature extraction module is used to perform data cleaning preprocessing and data standardization preprocessing on the first data set DSG, remove outliers and fill missing values, and then perform feature extraction to obtain the frequency distribution characteristics and operation type proportion characteristics of the query operation to form the second data set FTR; The multi-dimensional anomaly detection module is used to establish an anomaly detection algorithm, identify abnormal behaviors in database operations on the second data set FTR, obtain an anomaly detection index ANM, match it according to a preset database operation abnormal state threshold SZ, obtain a database operation abnormality evaluation result, and trigger database operation behavior restrictions according to the database operation abnormality evaluation result, synchronously monitor the current database load, query response time and operation frequency, dynamically adjust the database operation abnormal state threshold SZ, and generate a new dynamic threshold THR; The real-time monitoring and dynamic adjustment module is used to monitor and count the number of abnormal operations LMT after executing the database operation behavior restriction, perform trend analysis on the number of abnormal operations LMT, and perform secondary regulation on the dynamic threshold THR according to the trend status result; The decision module is used to perform fitting according to the anomaly detection index ANM and the dynamic threshold THR, perform impact assessment on the detected abnormal behavior, obtain the risk assessment index LVL of the abnormal behavior, and trigger secondary protection measures and database operation behavior restrictions according to the risk assessment index LVL; The multi-dimensional anomaly detection module includes an anomaly detection unit and a dynamic threshold adjustment unit; The anomaly detection unit establishes an anomaly detection algorithm, identifies abnormal behavior in database operations on the second data set FTR, obtains an anomaly detection index ANM, matches it according to a preset database operation abnormal state threshold SZ, obtains a database operation abnormality evaluation result, and triggers a database operation behavior restriction according to the database operation abnormality evaluation result; The anomaly detection index ANM is obtained by the following calculation formula: ; In the formula, ANMi represents the anomaly detection index of the i-th type of operation, TQCi represents the number of table queries for the i-th type of operation, FQCi represents the number of field queries for the i-th type of operation, UQCi represents the number of user queries for the i-th type of operation, QRTi represents the query response time for the i-th type of operation, represents the historical average of query response time, ln represents the natural pair data function, and OPRi represents the proportion of identified operation types; The decision-making module includes a risk impact assessment unit and a risk measure execution unit; The risk assessment unit performs fitting according to the abnormal detection index ANM and the dynamic threshold THR, performs an impact assessment on the detected abnormal behavior, and obtains a risk assessment index LVL of the abnormal behavior; The risk assessment index LVL is obtained by the following calculation formula: ; In the formula, represents the exponential decay coefficient, Ty represents the time interval between the abnormal operation and the current time, and Tymax represents the upper limit detection time range of the abnormal operation; The risk measure execution unit matches the risk assessment index LVL with the upper threshold SEZ and the lower threshold XEZ of the secondary risk protection assessment, triggering secondary protection measures and database operation behavior restrictions; The secondary protection measures and database operation behavior restrictions are triggered by the following trigger mechanisms: When the risk assessment index LVL is less than the lower threshold XEZ, the secondary protection measures and database operation behavior restrictions are not triggered; When the lower threshold XEZ ≤ risk assessment index LVL ≤ upper threshold SEZ, secondary protection measures and database operation behavior restrictions are triggered, including triggering user identity re-verification and increasing operation delays; When the upper threshold SEZ is less than the risk assessment index LVL, secondary protection warning measures and database operation behavior warning restrictions are triggered, including terminating the current database session, rolling back the database and locking key data tables, and triggering mandatory multi-factor authentication.
2. A database operation behavior recognition system according to claim 1, Features: The database information acquisition module periodically queries the database operation log and SQL query statement at a set time interval to implement regular polling query and capture database operation behavior when the trigger condition is met. At the end of each time interval, the system extracts the operation log and the SQL query statement in operation from the database, obtains the database operation type Ni, the total number of operations Ntotal, the number of table queries TQC, the number of field queries FQC, the number of user queries UQC and the query response time QRT, and forms a first data set DSG, specifically DSG={Ni, Ntotal, TQC, FQC, UQC, QRT}; Among them, satisfying the trigger condition specifically means that when the user operation data meets certain conditions, relevant data is automatically collected, including when the number of queries in the user query table meets the conditions, when the number of user operation tables meets the conditions, and when the database response time during user operation meets the conditions.
3. A database operation behavior recognition system according to claim 2, Features: The preprocessing and feature extraction module includes a data cleaning unit and a feature extraction unit; The data cleaning unit performs data cleaning preprocessing and data standardization preprocessing on the first data set DSG to remove outliers and fill missing values; Among them, data cleaning preprocessing includes using statistical analysis methods to remove outliers from the data of the first data set DSG, thereby excluding data points that deviate from the mean abnormally; using interpolation and mean filling methods to fill missing values in the data of the first data set DSG, thereby adjusting the continuity of the data in the first data set DSG.
4. A database operation behavior recognition system according to claim 3, Features: The feature extraction unit extracts features from the first data set DSG after data cleaning preprocessing and data standardization preprocessing, obtains frequency distribution features and operation type proportion features of query operations, and forms a second data set FTR; Among them, the frequency distribution feature is obtained by counting the execution frequency of user query modification operations within a fixed time window and analyzing the distribution characteristics of the execution frequency to obtain the operation frequency FQ; The operating frequency FQ is obtained by the following statistical analysis formula: ; In the formula, FQi represents the operation frequency of the i-th type of operation, Ti represents the length of the time window, and Ni represents the number of i-th type of operation within the time window length Ti; The operation type ratio feature counts the ratio of the number of user query, insert, delete and update operations to the total number of operations Ntotal to identify the operation type ratio OPRi; The operation type proportion OPRi is obtained by the following calculation formula ; The operation frequency FQi and the operation type proportion OPRi are integrated into the second data set FTR, specifically FTR={i, Ntotal, TQC, FQC, UQC, QRT, FQi, OPRi}.
5. A database operation behavior recognition system according to claim 4, Features: The database operation abnormality assessment result is Matching method acquisition; When the status return signal of the database operation abnormality assessment result is 1, the database operation abnormality assessment result is obtained as an abnormal result, and the database operation behavior restriction is triggered, including blocking operations and early warning prompts, synchronously monitoring the database status and dynamically adjusting the database operation abnormal status threshold SZ; When the status return signal of the database operation abnormality assessment result is 0, the database operation abnormality assessment result obtained is a non-abnormal result.
6. A database operation behavior recognition system according to claim 5, Features: When the database operation behavior restriction is triggered, the dynamic threshold adjustment unit synchronously monitors the load, response and operation frequency information of the current database, dynamically adjusts the database operation abnormal state threshold SZ, and generates a new dynamic threshold THR; The dynamic threshold THR is obtained by the following calculation formula: ; In the formula, FQbefore and FQafter represent the operation frequency before triggering the database operation behavior restriction and the operation frequency after the restriction, respectively. QRTbefore and QRTafter represent the query response time before triggering the database operation behavior restriction and the query response time after the restriction, respectively. Indicates the adjustment coefficient of the database operation abnormal state threshold SZ. Indicates the adjustment coefficient of the calculation results of the operation frequency FQbefore before triggering the database operation behavior restriction and the operation frequency FQafter after the restriction. Indicates the adjustment coefficient of the query response time FQbefore before triggering the database operation behavior restriction and the query response time FQbefore after the restriction, and, , , , , the specific value is set by the user.
7. A database operation behavior recognition system according to claim 6, Features: After the real-time monitoring and dynamic adjustment module restricts the execution of database operation behavior, it monitors and counts the number of abnormal operations LMT, matches it with the abnormal operation trend threshold YZ, analyzes the trend of the number of abnormal operations LMT, obtains the abnormal operation trend status result, and triggers secondary regulation of the dynamic threshold THR, and synchronously executes the dynamic threshold adjustment unit to obtain the dynamic threshold THR after secondary regulation; The number of abnormal operations LMT Obtained by statistical method, where P represents the total number of statistical time intervals, q represents the qth statistical time interval, and status represents the return signal, including return signal 1 and return signal 0; When the number of abnormal operations LMT ≥ the abnormal operation trend threshold YZ, the abnormal operation trend state result is abnormal, triggering secondary adjustment of the dynamic threshold THR, and executing the dynamic threshold adjustment unit to obtain the dynamic threshold THR after secondary adjustment; When the number of abnormal operations LMT is less than the abnormal operation trend threshold YZ, the abnormal operation trend state result is obtained as no abnormality.
8. A method for identifying database operation behavior, comprising a database operation behavior identification system according to any one of claims 1 to 7, Features: The following steps are involved: Step 1: The database information collection module monitors the database operation log and SQL query statements through regular polling and triggering, obtains the parameter information related to the database operation, and forms the first data set DSG; Step 2: The preprocessing and feature extraction module performs data cleaning and data standardization preprocessing on the first data set DSG, removes outliers and fills missing values, and then performs feature extraction to obtain the frequency distribution characteristics of query operations and the proportion characteristics of operation types to form the second data set FTR; Step 3: The multi-dimensional anomaly detection module establishes an anomaly detection algorithm, identifies abnormal behaviors in database operations for the second data set FTR, obtains the anomaly detection index ANM, matches it according to the preset database operation abnormal state threshold SZ, obtains the database operation abnormality evaluation result, and triggers database operation behavior restrictions according to the database operation abnormality evaluation result, synchronously monitors the current database load, query response time and operation frequency, dynamically adjusts the database operation abnormal state threshold SZ, and generates a new dynamic threshold THR; Step 4: After the real-time monitoring and dynamic adjustment module restricts the execution of database operation behaviors, it monitors and counts the number of abnormal operations LMT, performs trend analysis on the number of abnormal operations LMT, and performs secondary adjustment on the dynamic threshold THR according to the trend status results; Step 5: The decision module is fitted according to the anomaly detection index ANM and the dynamic threshold THR, and the impact assessment of the detected abnormal behavior is evaluated to obtain the risk assessment index LVL of the abnormal behavior. Secondary protection measures and database operation behavior restrictions are triggered according to the risk assessment index LVL.
