The invention discloses a self-adaptive
SQL differential privacy noise adding method, and relates to the technical field of data protection. In order to accurately calculate and add
noise of a proper magnitude in a complex
SQL statement, the adopted scheme comprises the following steps: regularly collecting and updating
metadata of a
database, analyzing attribute features of a data table, and forming a data attribute feature
library and a corresponding data sensitivity
library; the
SQL query request is rewritten into an
abstract syntax tree and traversed, and an aggregation function, multi-table connection and a sub-query structure are recorded; key
semantic information contained in the request is bound with the data sensitivity
library, the sensitivity of the request is calculated, and a privacy budget is distributed in a self-adaptive mode; the privacy budget allowance is checked, when the allowance is sufficient, a data disturbance mechanism meeting-
differential privacy is used for disturbing the query result, a disturbed result is obtained, and otherwise, the request is rejected. The method is used for accurately calculating the dynamic allocation privacy budget according to the characteristics of the complex SQL query.