WO2024183646A1 - Sql语句的处理方法、装置及设备 - Google Patents

Sql语句的处理方法、装置及设备 Download PDF

Info

Publication number
WO2024183646A1
WO2024183646A1 PCT/CN2024/079634 CN2024079634W WO2024183646A1 WO 2024183646 A1 WO2024183646 A1 WO 2024183646A1 CN 2024079634 W CN2024079634 W CN 2024079634W WO 2024183646 A1 WO2024183646 A1 WO 2024183646A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
target node
expression
nodes
ast
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2024/079634
Other languages
English (en)
French (fr)
Inventor
苏宁宁
王赛
王帅
吴烨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2024183646A1 publication Critical patent/WO2024183646A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the embodiments of the present disclosure relate to a method, device and equipment for processing SQL (Structured Query Language) statements.
  • SQL Structured Query Language
  • Differential Privacy is a privacy protection method, mainly used to protect aggregated statistical data. It can protect individual sensitive information while maintaining the stability of the overall statistical characteristics of the data. Its main approach is to add an appropriate amount of noise to the statistical results to ensure that modifying an individual record in the data will not have a significant impact on the statistical results. It aims to solve the problem of user privacy leakage in the process of statistical data release.
  • SQL statements can be used to query data tables in the database, but differential privacy algorithms cannot be directly executed on SQL statements that are strings.
  • the embodiments of the present disclosure provide a method, apparatus and device for processing SQL statements, which can convert SQL statements into an intermediate representation structure, and then use this structure to implement the execution of a differential privacy algorithm.
  • an embodiment of the present disclosure provides a method for processing a structured query language SQL statement, the method comprising:
  • the SQL statement is converted into AST;
  • the node types of the AST include statement nodes, block nodes and table nodes.
  • a sensitivity calculation function of an internal node of the first target node is called to obtain the sensitivity of the internal node of the first target node, where the sensitivity of the internal node of the first target node is used to execute a differential privacy algorithm for the first target node.
  • an embodiment of the present disclosure provides a device for processing a structured query language SQL statement, the device comprising:
  • a first acquisition unit used for acquiring SQL statements
  • a conversion unit configured to convert the SQL statement into an AST according to an abstract syntax tree AST conversion rule corresponding to the type of the SQL statement;
  • the node types of the AST include statement nodes, block nodes, and expression nodes, the statement nodes include at least one block node, and the block nodes include at least one expression node;
  • a first search unit used to search for a first target node belonging to an aggregate expression in the expression nodes of the AST
  • a calling unit is used to call the sensitivity calculation function of the internal nodes of the first target node to obtain the sensitivity of the internal nodes of the first target node, and the sensitivity of the internal nodes of the first target node is used to execute a differential privacy algorithm for the first target node.
  • an embodiment of the present disclosure provides a structured query language SQL statement processing device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the SQL statement processing method as described above is implemented.
  • an embodiment of the present disclosure provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium.
  • the terminal device executes the processing method of the SQL statement as described above.
  • FIG1 is a schematic diagram of an exemplary application scenario provided by an embodiment of the present disclosure.
  • FIG2 is a flow chart of a method for processing an SQL statement provided in an embodiment of the present disclosure
  • FIG3 is a schematic diagram of generating an AST provided by an embodiment of the present disclosure.
  • FIG4 is a schematic diagram of a device for processing SQL statements provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of an electronic device provided in an embodiment of the present disclosure.
  • Differential Privacy is a privacy protection method, which is mainly used to protect aggregated statistical data. It can protect individual sensitive information while keeping the overall statistical characteristics of the data stable.
  • a malicious user (usually referred to as an attacker) wants to know whether someone has the user feature.
  • the attacker knows which row of the database the person is in, for example, row 10.
  • the attacker uses a specific form to query the sum of the Boolean values of the first 10 rows and the first 9 rows in the user information record database, and then calculates the difference between the two queries, that is, the result of whether someone has the user feature can be obtained.
  • This is a differential privacy attack. If the results of querying the information of 9 people and the information of 10 people are the same, then the attacker has no way to determine the information of the 10th person. This is differential privacy protection.
  • the main approach to differential privacy protection is to add an appropriate amount of noise to the aggregated statistical results to ensure that modifying an individual record in the data will not have a significant impact on the statistical results. It aims to solve the problem of user privacy leakage in the process of statistical data release.
  • SQL statements can be used to query data tables in the database and obtain aggregate query results.
  • SQL statements are strings, and complex SQL statements cannot be presented in a structured manner, nor can we find which queries need to be executed on the differential privacy algorithm. Therefore, it is currently impossible to directly execute the differential privacy algorithm on SQL statements that are strings.
  • the embodiments of the present disclosure provide a method, apparatus and device for processing SQL statements, which convert SQL statements into an intermediate representation structure AST for representation, and then use this structure to implement the execution of a differential privacy algorithm.
  • FIG. 1 is a schematic diagram of an exemplary application scenario provided by an embodiment of the present disclosure.
  • the differential privacy protection system of the disclosed embodiment takes SQL statements as input and converts SQL statements into AST, which includes three levels of nodes: statement nodes, block nodes, and expression nodes.
  • AST which includes three levels of nodes: statement nodes, block nodes, and expression nodes.
  • the first target node belonging to the aggregate expression that needs to execute the differential privacy algorithm is found from each expression node of the AST, such as the node expression with shading in Figure 1.
  • the sensitivity calculation function of the internal node of the first target node is called to calculate the sensitivity of the internal node of the first target node, so that the differential privacy algorithm such as noise addition can be executed for the first target node according to the sensitivity of the internal node of the first target node.
  • FIG1 is only an example in which the embodiments of the present disclosure may be implemented, and the scope of application of the embodiments of the present disclosure is not limited in any aspect by the framework.
  • FIG. 2 is a flow chart of a method for processing a SQL statement provided by an embodiment of the present disclosure, as shown in FIG. 2 , the method may include S201-S204:
  • SQL statements can be used to query data tables in the database.
  • types of SQL statements that is, there are various SQL statement dialects, such as MySQL-type SQL statements, Hive-type SQL statements, and so on.
  • SQL statement dialects such as MySQL-type SQL statements, Hive-type SQL statements, and so on.
  • Each type of SQL statement has its own unique grammatical structure, and the SQL statement writing method is relatively free, which brings challenges to the analysis of SQL statements.
  • S202 Convert the SQL statement into an AST according to the abstract syntax tree AST conversion rules corresponding to the type of the SQL statement, wherein the node types of the AST include statement nodes, block nodes and expression nodes, a statement node includes at least one block node, and a block node includes at least one expression node.
  • the AST includes three levels of nodes: statement nodes, block nodes, and expression nodes.
  • a statement node includes at least one block node, and a block node includes at least one expression node.
  • a statement node represents a statement. Different types of SQL statements have different syntaxes, and a statement may contain different contents. Therefore, different statements are constructed for different types of SQL statements. Nodes are used to process different types of SQL statements. Statement nodes are composed of different block nodes. Different statement nodes may contain different block nodes. For example, statement nodes include ClickHouseStatement (statement node corresponding to ClickHouse type SQL statements), HiveStatement (statement node corresponding to Hive type SQL statements), MysqlStatement (statement node corresponding to Mysql type SQL statements), SparkStatement (statement node corresponding to Spark type SQL statements), and OtherStatement (statement node corresponding to other types of SQL statements).
  • ClickHouseStatement statement node corresponding to ClickHouse type SQL statements
  • HiveStatement statement node corresponding to Hive type SQL statements
  • MysqlStatement statement node corresponding to Mysql type SQL statements
  • SparkStatement statement no
  • ClickHouse type SQL statements may contain prewhere syntax blocks, while Hive type SQL statements do not support prewhere syntax blocks grammatically.
  • a block node represents a relatively independent block structure in an SQL statement, similar to a short sentence (different parts of a sentence separated by commas).
  • the syntax parts of different characteristics contained in each type of SQL statement are encapsulated as independent block nodes.
  • block nodes include SelectBlock (Select block node), FromBlock (From block node), WhereBlock (Where block node), GroupByBlock (GroupBy block node), HavingBlock (Having block node), OrderByBlock (OrderBy block node), LimitByBlock (LimitByt block node), LimitBlock (Limit syntax block), TeaLimitBlock (TeaLimit block node), WithBlock (With block node), PrewhereBlock (Prewhere block node), SettingBlock (Setting block node), SampleBlock (Sample block node), etc.
  • a block node can also include other block nodes, for example, WithBlock includes WithFromExpressionBlock (WithFromExpression block node) and WithAsQueryBlock (WithAsQuery block node).
  • WithBlock includes WithFromExpressionBlock (WithFromExpression block node) and WithAsQueryBlock (WithAsQuery block node).
  • a block node is composed of different expression nodes, and the expression nodes inside a block node can be freely combined. There can be multiple identical expression nodes inside a block node.
  • An expression node represents a single field or a composite field expression. It has the largest number of node types in the current AST representation system.
  • An expression node can include nodes of multiple general expression types, and each direction is further divided into more lower-level expression nodes.
  • expression nodes include BaseExpr (Base type expression node), AggFunctionExpr (AggFunction type expression node), ArithmeticExpr (Arithmetic type expression node), CondExpr (CondExpr type expression node), and so on. (Cond type expression node), FunctionExpr (Function type expression node), LogicalExpr (Logical type expression node), BoolExpr (Bool type expression node), etc. Taking BaseExpr as an example, it can be further divided into different expression nodes, such as LiteralExpr (constant expression node), IdentifierExpr (identifier expression node), NumberExprExpr (numeric expression node), etc.
  • AST conversion rules corresponding to different types of SQL statements are pre-established to convert SQL statements into AST.
  • the AST conversion rules for each type of SQL statement can be understood as the nodes in the AST that may be included in the SQL statement of that type and the node hierarchical relationship between each node.
  • the AST conversion rules for ClickHouse's SQL statements indicate that ClickHouse's SQL statements may include ClickHouseStatement, ClickHouseStatement includes SelectBlock, FromBlock, PrewhereBlock, etc., and each block node includes which expression nodes.
  • S202 may include converting the SQL statement into an AST according to an abstract syntax tree AST conversion rule corresponding to the type of the SQL statement:
  • A1 Parse the SQL statement into a SQL statement word stream.
  • the SQL statement is a string of characters.
  • the grammar rule parser corresponding to the type of the SQL statement can identify the SQL statement word stream corresponding to the SQL statement.
  • the SQL statement word stream includes multiple words. For example, the SQL statement "select age from table” can be parsed to obtain a word stream including four words "select, age, from, table”.
  • the grammar rule parser can be a SQL statement parsing tool in practical applications.
  • A2 Match the words in the SQL statement word stream with the abstract syntax tree (AST) conversion rules corresponding to the type of the SQL statement to determine the node type of the word and the node hierarchical relationship between the words.
  • AST abstract syntax tree
  • A3 Convert the SQL statement into AST according to the node type of the word and the node hierarchy relationship between each word.
  • the age expression node belongs to the Select block node
  • the table expression node belongs to the From block node
  • the Select block node and the From block node belong to the MysqlStatement node
  • FIG. 3 there is shown a schematic diagram of a process of converting a SQL statement into an AST in a practical application.
  • the disclosed embodiment constructs different statement nodes for different types of SQL statements in AST, and each type of SQL statement is directly parsed into a corresponding statement node during parsing.
  • relatively independent statements and grammatical features are encapsulated into block nodes, and different block node combinations are used to fill different statement nodes.
  • various basic expressions are encapsulated into expression nodes, and expression node combinations are used to fill the expression nodes themselves and block nodes.
  • S203 Search for the first target node belonging to the aggregate expression in the expression nodes of the AST.
  • the differential privacy algorithm needs to calculate the sensitivity of the internal nodes belonging to the aggregate expression during implementation.
  • the first target node belongs to an aggregate expression, it will also include internal nodes.
  • the first target node may include a first-level internal node or multiple-level internal nodes.
  • the sum(age) part in the SQL statement is converted into a sum expression node and an age expression node in the AST.
  • the sum expression node is the first target node, and its internal nodes are the age expression node.
  • the sum(id+age) part in the SQL statement is converted into a sum expression node, an addition expression node, an id expression node, and an age expression node in the AST tree.
  • the sum expression node is the first target node, and its internal nodes are addition expression nodes.
  • the internal nodes of the addition expression node are id expression nodes and age expression nodes.
  • S204 calling a sensitivity calculation function of an internal node of the first target node to obtain the sensitivity of the internal node of the first target node, where the sensitivity of the internal node of the first target node is used to execute a differential privacy algorithm on the first target node.
  • the internal nodes of the first target node can be determined through AST.
  • the internal nodes of the first target node are pre-set with corresponding sensitivity calculation functions.
  • the sensitivity of the internal nodes of the first target node can be obtained, so as to perform the differential privacy algorithm on the first target node using the sensitivity of the internal nodes of the target node.
  • S204 calls the sensitivity calculation function of the internal node of the first target node, and the specific implementation of obtaining the sensitivity of the internal node of the first target node may include:
  • the sensitivity calculation function of the internal node of the first target node is called to obtain metadata information of the internal node of the first target node, and the sensitivity of the internal node of the first target node is calculated using the metadata information; the metadata information is obtained by querying the data table through an SQL statement.
  • the metadata information may include the data type, maximum value, minimum value, data occurrence frequency, etc. in the data table corresponding to the internal node.
  • the metadata information may include the data type, maximum value, minimum value, data occurrence frequency, etc. in the data table corresponding to the internal node.
  • sum(age) it can be known that the sum expression node is the first target node, and the corresponding internal node is the age expression node.
  • the age expression node queries the age (age) column in the data table, and the metadata information of the age expression node can be obtained from the data table, including the data type, maximum value, minimum value, etc.
  • the metadata information of the age expression node can be used to calculate the sensitivity of the age expression node, so as to calculate the sensitivity of the age expression node according to the age expression.
  • the sensitivity of the node performs a differential privacy algorithm on the query result corresponding to the sum expression node.
  • the sensitivity calculation function of the internal nodes of the first target node is called to obtain metadata information of the internal nodes of the first target node.
  • the specific implementation of calculating the sensitivity of the internal nodes of the first target node using the metadata information may include:
  • the sensitivity calculation function of the first-level internal nodes of the target node is called to obtain the metadata information of the second-level internal nodes of the target node, and the sensitivity of the first-level internal nodes of the target node is calculated using the metadata information of the second-level internal nodes of the target node.
  • the second level internal node can be understood as the next level node of the first internal node. Then, the sensitivity calculation function of the first level internal node is called to obtain the metadata information of the next level internal node (i.e., the second internal node) of the first level internal node, and the sensitivity of the first level internal node can be calculated.
  • the sensitivity calculation function of the second-to-last level internal node can be called to obtain the metadata information of the last level internal node, and the sensitivity of the second-to-last level internal node can be calculated using the metadata information of the last level internal node.
  • the sensitivity of the second-to-last level internal node can be used as the metadata information of the second-to-last level internal node.
  • the sum expression node is the first target node
  • the addition expression node is the first-level internal node
  • the id expression node and the age expression node are the second-level internal nodes.
  • the sensitivity calculation function of the addition expression node is called to obtain the metadata information of the id expression node and the age expression node.
  • the minimum values corresponding to the id expression node and the age expression node are added as the minimum value of the addition expression node, and the maximum values corresponding to the id expression node and the age expression node are added as the maximum value of the addition expression node, and the sensitivity of the addition expression node is calculated.
  • the sum expression node is the first target node
  • its first-level internal node is the power (exponential calculation) expression node
  • its second-level internal node is the salary (salary) expression node.
  • Sensitivity calculation function obtains metadata information of salary expression node.
  • the preset sensitivity calculation function of power expression node when the minimum value corresponding to the salary expression node is non-negative, the square of the minimum value is used as the minimum value of the power expression node, and the square of the maximum value corresponding to the salary expression node is used as the maximum value of the power expression node; when the maximum value corresponding to the salary expression node is non-positive, the square of the maximum value is used as the minimum value of the power expression node, and the square of the minimum value corresponding to the salary expression node is used as the maximum value of the power expression node; when the minimum value corresponding to the salary expression node is negative and the maximum value is positive, the minimum value of the power expression node is 0, and the larger of the square of the minimum value and the square of the maximum value corresponding to the salary expression node is used as the maximum value of the power expression node, completing the sensitivity calculation of the power expression node.
  • the disclosed embodiment pre-encapsulates the sensitivity calculation logic for the expression nodes that need to perform sensitivity calculation.
  • the specific logic varies depending on the expression nodes. Based on this, the differential privacy result output of the first target node is achieved.
  • the embodiment of the present disclosure pre-establishes AST conversion rules corresponding to different SQL statement types, which can be compatible with different types of SQL statements, and convert SQL statements into AST, which is represented by a three-level node structure of statement nodes, block nodes, and expression nodes. Then, the first target node belonging to the aggregate expression that needs to execute the differential privacy algorithm is determined in the expression node in the AST, and the sensitivity calculation function of the internal node of the first target node is called to calculate the sensitivity of the internal node of the first target node.
  • the sensitivity of the internal node of the first target node can be used to implement the differential privacy algorithm for the first target node. Thereby, the execution of the differential privacy algorithm is realized after the SQL statement is input.
  • the embodiment of the present disclosure can pre-bind the metadata information with the expression node in the AST.
  • the embodiment of the present disclosure may further include:
  • B1 Search for a second target node of a preset type in the expression node of the AST.
  • the second target node can be understood as an expression node that may need to obtain metadata information.
  • the preset types are table type, column type, and Map expression type.
  • SQL statements query the data table, data column or corresponding node corresponding to the corresponding second target node to obtain the metadata information of the second target node.
  • table1 is parsed as the second target node of table type
  • name and age are parsed as the second target node of column type
  • float_params ⁇ ‘_slot_param_1’ ⁇ is parsed as the second target node of Map expression type.
  • the table1 expression node in the From block node first obtains the metadata information, and then the three expression nodes in the Select block node obtain the metadata information.
  • the metadata information in the data table corresponding to the second target node is metadata information of a corresponding table in the data table corresponding to the second target node;
  • the metadata information in the database corresponding to the second target node is the metadata information of the corresponding column in the data table corresponding to the second target node;
  • the metadata information in the data table corresponding to the second target node is the metadata information of the corresponding node in the data table corresponding to the second target node.
  • the metadata information of the data table corresponding to the second target node is queried (including the metadata information of all columns of the data table).
  • the metadata information of the data column corresponding to the second target node is queried.
  • the second target node is a Map expression type
  • the metadata information of the corresponding node in the data table corresponding to the second target node is queried.
  • B3 Bind the metadata information corresponding to the second target node to the second target node in the AST.
  • the metadata information of each second target node is bound to the second target node.
  • the metadata information of the second target node needs to be obtained, it can be directly obtained from the AST without repeatedly querying the database.
  • S204 calls the sensitivity calculation function of the internal node of the first target node, and the specific implementation of obtaining the sensitivity of the internal node of the first target node may include:
  • the sensitivity calculation function of the internal node of the first target node is called, the metadata information of the internal node of the first target node is obtained from the AST, and the sensitivity of the internal node of the first target node is calculated using the metadata information; the internal node of the first target node is matched with the second target node.
  • the metadata information of the internal node of the first target node when it is necessary to obtain the metadata information of the internal node of the first target node, if the internal node belongs to the second target node, that is, it is bound with metadata information, the metadata information of the internal node can be directly obtained from the AST without querying the database, thereby improving the implementation efficiency.
  • the embodiment of the present disclosure further provides a device for processing a SQL statement, which will be described below in conjunction with the accompanying drawings.
  • FIG. 4 this figure is a schematic diagram of the structure of a SQL statement processing device provided by an embodiment of the present disclosure.
  • the SQL statement processing device includes:
  • a first acquisition unit 401 is used to acquire SQL statements
  • a conversion unit 402 is used to convert the SQL statement into an AST according to an abstract syntax tree AST conversion rule corresponding to the type of the SQL statement;
  • the node types of the AST include statement nodes, block nodes and expression nodes, the statement node includes at least one block node, and the block node includes at least one expression node;
  • a first search unit 403 is used to search for a first target node belonging to an aggregate expression in the expression nodes of the AST;
  • the calling unit 404 is used to call the sensitivity calculation function of the internal nodes of the first target node to obtain the sensitivity of the internal nodes of the first target node, and the sensitivity of the internal nodes of the first target node is used to execute the differential privacy algorithm for the first target node.
  • the conversion unit includes:
  • a parsing subunit used for parsing the SQL statement into a SQL statement word stream
  • a matching subunit used for matching the words in the SQL statement word stream with the abstract syntax tree (AST) conversion rules corresponding to the type of the SQL statement, and determining the node type of the words and the node hierarchical relationship between each of the words;
  • the conversion subunit is used to convert the SQL statement into AST according to the node type of the word and the node level relationship between each of the words.
  • the calling unit is specifically used to:
  • a sensitivity calculation function of the internal nodes of the first target node obtaining metadata information of the internal nodes of the first target node, and using the metadata information to calculate the sensitivity of the internal nodes of the first target node; the metadata information is obtained by querying a data table through the SQL statement.
  • the calling unit when the first target node includes multiple levels of internal nodes, is specifically configured to include:
  • the sensitivity calculation function of the first-level internal nodes of the target node is called to obtain metadata information of the second-level internal nodes of the target node, and the sensitivity of the first-level internal nodes of the target node is calculated using the metadata information of the second-level internal nodes of the target node.
  • the device further includes:
  • a second search unit used to search for a second target node of a preset type in the expression node of the AST
  • a second acquisition unit configured to acquire metadata information in a data table corresponding to the second target node according to the execution order of the SQL statement
  • a binding unit is used to bind the metadata information corresponding to the second target node with the second target node in the AST.
  • the preset type is a table type, a column type, and a Map expression type
  • the metadata information in the data table corresponding to the second target node is the metadata information of the corresponding table in the data table corresponding to the second target node;
  • the metadata information in the database corresponding to the second target node is the metadata information of the corresponding column in the data table corresponding to the second target node;
  • the metadata information in the data table corresponding to the second target node is the metadata information of the corresponding node in the data table corresponding to the second target node.
  • the calling unit is specifically used to:
  • the present disclosure also provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing SQL statements described in any of the above embodiments.
  • FIG5 shows a schematic diagram of the structure of an electronic device 1300 suitable for implementing the embodiment of the present disclosure.
  • the terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc.
  • the electronic device shown in FIG5 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.
  • the electronic device 1300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage device 1306 to a random access memory (RAM) 1303.
  • a processing device e.g., a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 1300 are also stored.
  • the processing device 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304.
  • An input/output (I/O) interface 1305 is also connected to the bus 1304.
  • the following devices may be connected to the I/O interface 1305: input devices 1306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1306 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1309.
  • the communication devices 1309 may allow the electronic device 1300 to communicate wirelessly or wired with other devices to exchange data.
  • FIG. 5 shows an electronic device 1300 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
  • an embodiment of the present disclosure includes a computer program product, which includes The computer program includes a computer program carried on a non-transitory computer readable medium, and the computer program includes a program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through the communication device 1309, or installed from the storage device 1306, or installed from the ROM 1302.
  • the processing device 1301 the above functions defined in the method of the embodiment of the present disclosure are executed.
  • the electronic device provided in the embodiment of the present disclosure and the method for processing a SQL statement provided in the above embodiment belong to the same inventive concept.
  • the technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
  • an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for processing an SQL statement as described in any of the above embodiments is implemented.
  • the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried.
  • This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above.
  • the computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device.
  • the program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can use HTTP (HyperText).
  • the communication network may be interconnected with any form or medium of digital data communication (e.g., a communication network).
  • Examples of communication networks include a local area network ("LAN”), a wide area network ("WAN”), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
  • LAN local area network
  • WAN wide area network
  • an internet e.g., the Internet
  • peer-to-peer network e.g., an ad hoc peer-to-peer network
  • the computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
  • the computer-readable medium carries one or more programs.
  • the electronic device executes the method for processing the SQL statement.
  • Computer program code for performing the operations of the disclosed embodiments may be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages.
  • the program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
  • the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
  • LAN local area network
  • WAN wide area network
  • Internet service provider e.g., via the Internet using an Internet service provider
  • each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function.
  • the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
  • each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure may be implemented by software or hardware.
  • the names of the units/modules do not constitute The definition of the unit itself, for example, the first acquisition unit can also be described as a “first acquisition module”.
  • exemplary types of hardware logic components include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs systems on chip
  • CPLDs complex programmable logic devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing.
  • a more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage device or any suitable combination of the foregoing.
  • Example 1 provides a method for processing an SQL statement, the method comprising:
  • the SQL statement is converted into an AST;
  • the node types of the AST include statement nodes, block nodes and expression nodes, the statement node includes at least one block node, and the block node includes at least one expression node;
  • a sensitivity calculation function of an internal node of the first target node is called to obtain the sensitivity of the internal node of the first target node, where the sensitivity of the internal node of the first target node is used to execute a differential privacy algorithm for the first target node.
  • Example 2 provides a method for processing an SQL statement, wherein the SQL statement is converted into an AST according to an abstract syntax tree AST conversion rule corresponding to the type of the SQL statement, including:
  • the words in the SQL statement word stream are compared with the abstract language corresponding to the type of the SQL statement.
  • the AST conversion rules are matched to determine the node type of the word and the node level relationship between each of the words;
  • the SQL statement is converted into AST according to the node type of the word and the node level relationship between each of the words.
  • Example 3 provides a method for processing an SQL statement, wherein the step of calling a sensitivity calculation function of an internal node of the first target node to obtain the sensitivity of the internal node of the first target node includes:
  • a sensitivity calculation function of the internal nodes of the first target node obtaining metadata information of the internal nodes of the first target node, and using the metadata information to calculate the sensitivity of the internal nodes of the first target node; the metadata information is obtained by querying a data table through the SQL statement.
  • Example 4 provides a method for processing an SQL statement, when the first target node includes multiple levels of internal nodes, calling a sensitivity calculation function of the internal nodes of the first target node, obtaining metadata information of the internal nodes of the first target node, and using the metadata information to calculate the sensitivity of the internal nodes of the first target node, including:
  • the sensitivity calculation function of the first-level internal nodes of the target node is called to obtain metadata information of the second-level internal nodes of the target node, and the sensitivity of the first-level internal nodes of the target node is calculated using the metadata information of the second-level internal nodes of the target node.
  • Example 5 provides a method for processing an SQL statement, the method further comprising:
  • the metadata information corresponding to the second target node is bound to the second target node in the AST.
  • Example 6 provides a method for processing an SQL statement, wherein the preset types are a table type, a column type, and a Map expression type;
  • the metadata information in the data table corresponding to the second target node is the metadata information of the corresponding table in the data table corresponding to the second target node;
  • the metadata information in the database corresponding to the second target node is the metadata information of the corresponding column in the data table corresponding to the second target node;
  • the metadata information in the data table corresponding to the second target node is the metadata information of the corresponding node in the data table corresponding to the second target node.
  • Example 7 provides a method for processing an SQL statement, wherein the calling of a sensitivity calculation function of an internal node of the first target node to obtain the sensitivity of the internal node of the first target node includes:
  • the sensitivity calculation function of the internal nodes of the first target node obtain the metadata information of the internal nodes of the first target node from the AST, and use the metadata information to calculate the sensitivity of the internal nodes of the first target node; the internal nodes of the first target node are matched with the second target node.
  • Example 8 provides a device for processing a SQL statement, the device comprising:
  • a first acquisition unit used for acquiring SQL statements
  • a conversion unit configured to convert the SQL statement into an AST according to an abstract syntax tree AST conversion rule corresponding to the type of the SQL statement;
  • the node types of the AST include statement nodes, block nodes, and expression nodes, the statement nodes include at least one block node, and the block nodes include at least one expression node;
  • a first search unit used to search for a first target node belonging to an aggregate expression in the expression nodes of the AST
  • a calling unit is used to call the sensitivity calculation function of the internal nodes of the first target node to obtain the sensitivity of the internal nodes of the first target node, and the sensitivity of the internal nodes of the first target node is used to execute a differential privacy algorithm for the first target node.
  • Example 9 provides a device for processing a SQL statement, wherein the conversion unit includes:
  • a parsing subunit used for parsing the SQL statement into a SQL statement word stream
  • a matching subunit used for matching the words in the SQL statement word stream with the abstract syntax tree (AST) conversion rules corresponding to the type of the SQL statement, and determining the node type of the words and the node hierarchical relationship between each of the words;
  • the conversion subunit is used to convert the SQL statement into AST according to the node type of the word and the node level relationship between each of the words.
  • Example 10 provides a device for processing a SQL statement, wherein the calling unit is specifically configured to:
  • a sensitivity calculation function of the internal nodes of the first target node obtaining metadata information of the internal nodes of the first target node, and using the metadata information to calculate the sensitivity of the internal nodes of the first target node; the metadata information is obtained by querying a data table through the SQL statement.
  • Example 11 provides a device for processing a SQL statement, when the first target node includes multiple levels of internal nodes, the calling unit is specifically configured to include:
  • the sensitivity calculation function of the first-level internal nodes of the target node is called to obtain metadata information of the second-level internal nodes of the target node, and the sensitivity of the first-level internal nodes of the target node is calculated using the metadata information of the second-level internal nodes of the target node.
  • Example 12 provides a device for processing a SQL statement, the device further comprising:
  • a second search unit used to search for a second target node of a preset type in the expression node of the AST
  • a second acquisition unit configured to acquire metadata information in a data table corresponding to the second target node according to the execution order of the SQL statement
  • a binding unit is used to bind the metadata information corresponding to the second target node with the second target node in the AST.
  • Example 13 provides a device for processing a SQL statement, wherein the preset types are a table type, a column type, and a Map expression type;
  • the metadata information in the data table corresponding to the second target node is the metadata information of the corresponding table in the data table corresponding to the second target node;
  • the metadata information in the database corresponding to the second target node is the metadata information of the corresponding column in the data table corresponding to the second target node;
  • the metadata information in the data table corresponding to the second target node is the metadata information of the corresponding node in the data table corresponding to the second target node. interest.
  • Example 14 provides a device for processing a SQL statement, wherein the calling unit is specifically configured to:
  • the sensitivity calculation function of the internal nodes of the first target node obtain the metadata information of the internal nodes of the first target node from the AST, and use the metadata information to calculate the sensitivity of the internal nodes of the first target node; the internal nodes of the first target node are matched with the second target node.
  • Example 15 provides a device for processing SQL statements, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for processing SQL statements as described in any one of Examples 1 to 7 is implemented.
  • Example 16 provides a computer-readable storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device executes a method for processing SQL statements as described in any one of Examples 1 to 7.
  • At least one (item) means one or more, and “plurality” means two or more.
  • “And/or” is used to describe the association relationship of associated objects, indicating that three relationships may exist.
  • a and/or B can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural.
  • the character “/” generally indicates that the previous and next associated objects are in an “or” relationship.
  • At least one of the following” or similar expressions refers to any combination of these items, including any combination of single or plural items.
  • At least one of a, b or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c", where a, b, c can be single or multiple.
  • the steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two.
  • the software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

本公开提供了一种SQL语句的处理方法、装置及设备,用于将SQL语句转换为AST结构,然后利用此结构实现差分隐私算法的执行。该方法包括:获取SQL语句;按照与SQL语句的类型对应的AST转换规则,将SQL语句转换为AST;AST的节点类型包括语句节点、块节点以及表达式节点,语句节点包括至少一个块节点,块节点包括至少一个表达式节点;在AST的表达式节点中查找属于聚合表达式的第一目标节点;调用第一目标节点的内部节点的敏感度计算函数,得到第一目标节点的内部节点的敏感度,第一目标节点的内部节点的敏感度用于针对第一目标节点执行差分隐私算法。

Description

SQL语句的处理方法、装置及设备
本申请要求于2023年3月3日递交的中国专利申请第202310201045.4号的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。
技术领域
本公开的实施例涉及一种SQL(Structured Query Language,结构化查询语言)语句的处理方法、装置及设备。
背景技术
差分隐私(Differential Privacy,简称DP)是一种隐私保护手段,主要用于聚合统计数据的保护,可以在保持数据整体统计特征稳定的情况下保护个体的敏感信息。其主要做法是在统计结果中加入适量噪音,以确保修改数据中一条个体记录不会对统计结果造成显著影响,旨在解决数据的统计发布过程中的用户隐私泄露问题。
目前,可以利用SQL语句可以对数据库中的数据表进行查询,但是,无法直接对属于字符串的SQL语句执行差分隐私算法。
发明内容
有鉴于此,本公开实施例提供一种SQL语句的处理方法、装置及设备,可以将SQL语句转换为一种中间表示结构,然后利用此结构实现差分隐私算法的执行。
为解决上述问题,本公开实施例提供的技术方案如下:
第一方面,本公开实施例提供一种结构化查询语言SQL语句的处理方法,所述方法包括:
获取SQL语句;
按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST;所述AST的节点类型包括语句节点、块节点以及表 达式节点,所述语句节点包括至少一个块节点,所述块节点包括至少一个表达式节点;
在所述AST的表达式节点中查找属于聚合表达式的第一目标节点;
调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,所述第一目标节点的内部节点的敏感度用于针对所述第一目标节点执行差分隐私算法。
第二方面,本公开实施例提供一种结构化查询语言SQL语句的处理装置,所述装置包括:
第一获取单元,用于获取SQL语句;
转换单元,用于按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST;所述AST的节点类型包括语句节点、块节点以及表达式节点,所述语句节点包括至少一个块节点,所述块节点包括至少一个表达式节点;
第一查找单元,用于在所述AST的表达式节点中查找属于聚合表达式的第一目标节点;
调用单元,用于调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,所述第一目标节点的内部节点的敏感度用于针对所述第一目标节点执行差分隐私算法。
第三方面,本公开实施例提供一种结构化查询语言SQL语句的处理设备,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如上述的SQL语句的处理方法。
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备执行如上述的SQL语句的处理方法。
附图说明
图1为本公开实施例提供的一种示例性应用场景的示意图;
图2为本公开实施例提供的一种SQL语句的处理方法的流程图;
图3为本公开实施例提供的一种生成AST的示意图;
图4为本公开实施例提供的一种SQL语句的处理装置的示意图;以及
图5为本公开实施例提供的一种电子设备的示意图。
具体实施方式
为使本公开的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本公开实施例作进一步详细的说明。
为了便于理解和解释本公开实施例提供的技术方案,下面将先对本公开的背景技术进行说明。
差分隐私(Differential Privacy,简称DP)是一种隐私保护手段,主要用于聚合统计数据的保护,可以在保持数据整体统计特征稳定的情况下保护个体的敏感信息。
例如,假设有一个用户信息记录数据库,使用布尔值记录有每个人是否具有某用户特征,其中,具有该用户特征布尔值为1,不具有该用户特征布尔值为2。假设一个恶意用户(通常被称为攻击者)想知道某人是否具有该用户特征。假设攻击者知道该人在数据库的哪一行,例如在第10行。攻击者使用特定形式的在用户信息记录数据库中查询前10行和前9行的布尔值总和,然后计算两个查询的差别,即可以得到某人是否具有该用户特征的结果,这就是差分隐私攻击。如果查询9个人的信息和查询10个人的信息结果一致,那么攻击者就没有办法确定第10个人的信息,这就是差分隐私保护。
差分隐私保护的主要做法是在聚合统计结果中加入适量噪音,以确保修改数据中一条个体记录不会对统计结果造成显著影响,旨在解决数据的统计发布过程中的用户隐私泄露问题。
目前,可以利用SQL语句可以对数据库中的数据表进行查询,得到聚合查询结果。但是SQL语句属于字符串,对于复杂SQL语句无法结构化呈现,也无法寻找需要对其中的哪些查询执行差分隐私算法。因此,目前无法直接对属于字符串的SQL语句执行差分隐私算法。
基于此,本公开实施例提供一种SQL语句的处理方法、装置及设备,将SQL语句转换为一种中间表示结构AST进行表示,然后利用此结构实现差分隐私算法的执行。
为了便于理解本公开实施例提供的SQL语句的处理方法,下面结合图1 所示的场景示例进行说明。参见图1所示,该图为本公开实施例提供的示例性应用场景的示意图。
本公开实施例的差分隐私保护系统以SQL语句作为输入,将SQL语句转换为AST,AST包括三级节点:语句(Statement)节点、块(Block)节点以及表达式(Expr)节点。当执行差分隐私算法时,从AST的各个表达式节点中查找到需要执行差分隐私算法的属于聚合表达式的第一目标节点,例如图1中带底纹的节点表达式。然后,调用第一目标节点的内部节点的敏感度计算函数,计算得到第一目标节点的内部节点的敏感度,从而可以根据第一目标节点的内部节点的敏感度针对第一目标节点执行加噪等差分隐私算法。
本领域技术人员可以理解,图1所示的框架示意图仅是本公开的实施方式可以在其中得以实现的一个示例。本公开实施方式的适用范围不受到该框架任何方面的限制。
为了便于理解本公开,下面结合附图对本公开实施例提供的一种SQL语句的处理方法进行说明。
参见图2所示,该图为本公开实施例提供的一种SQL语句的处理方法的流程图,如图2所示,该方法可以包括S201-S204:
S201:获取SQL语句。
通过SQL语句可以对数据库中的数据表进行查询。在实际应用中,有不同类型的SQL语句,即具有各种SQL语句方言,例如Mysql类型的SQL语句、Hive类型的SQL语句等等。每种类型的SQL语句有自身独特的语法结构,同时SQL语句编写方式比较自由,这些都为SQL语句的解析带来挑战。
S202:按照与SQL语句的类型对应的抽象语法树AST转换规则,将SQL语句转换为AST。其中,AST的节点类型包括语句节点、块节点以及表达式节点,语句节点包括至少一个块节点,块节点包括至少一个表达式节点。
为了便于后续理解,首先对于本公开实施例中提供的AST的结构进行说明。AST包括三级节点:语句(Statement)节点、块(Block)节点以及表达式(Expr)节点,语句节点包括至少一个块节点,块节点包括至少一个表达式节点。
语句节点代表一条语句,不同类型的SQL语句存在语法差异,一条语句中可能包含的内容不相同,因而通过为不同类型的SQL语句构建不同语句 节点来处理不同类型的SQL语句。语句节点内部由不同的块节点构成,语句节点不同,可以包含的块节点也可能不同。例如,语句节点包括ClickHouseStatement(ClickHouse类型的SQL语句对应的语句节点)、HiveStatement(Hive类型的SQL语句对应的语句节点)、MysqlStatement(Mysql类型的SQL语句对应的语句节点)、SparkStatement(Spark类型的SQL语句对应的语句节点)以及OtherStatement(其他类型的SQL语句对应的语句节点)等。在ClickHouse类型的SQL语句中可能包含prewhere语法块,而Hive类型的SQL语句在语法上不支持prewhere语法块,此时在创建ClickHouseStatement时则可以将prewhere块节点填入,但HiveStatement则不填入,即ClickHouseStatement包括prewhere块节点、HiveStatement不包括prewhere块节点。在语句节点内部相同的块节点只能有一个。
块节点代表的是一条SQL语句中相对独立的一个块结构,类似于短句(一句话中用逗号分割的不同部分)。在当前的AST表示体系中,为支持不同类型的SQL语句,将各类型的SQL语句包含的不同特性的语法部分都封装为独立的块节点。例如,块节点包括有SelectBlock(Select块节点)、FromBlock(From块节点)、WhereBlock(Where块节点)、GroupByBlock(GroupBy块节点)、HavingBlock(Having块节点)、OrderByBlock(OrderBy块节点)、LimitByBlock(LimitByt块节点)、LimitBlock(Limit语法块)、TeaLimitBlock(TeaLimit块节点)、WithBlock(With块节点)、PrewhereBlock(Prewhere块节点)、SettingBlock(Setting块节点)、SampleBlock(Sample块节点)等。
一个块节点还可以包括其他块节点,例如WithBlock包括有WithFromExpressionBlock(WithFromExpression块节点)和WithAsQueryBlock(WithAsQuery块节点)。块节点内部由不同的表达式节点组成,块节点内部的表达式节点可以自由组合,一个块节点内部相同的表达式节点可以有多个。
表达式节点表示单个字段或者复合字段表达式,它是当前的AST表示体系中节点种类最多的。表达式节点可以包括多个大方向的表达式类型的节点,每个方向下还分为更多下一级的表达式节点。例如,表达式节点包括BaseExpr(Base类型的表达式节点)、AggFunctionExpr(AggFunction类型的表达式节点)、ArithmeticExpr(Arithmetic类型的表达式节点)、CondExpr (Cond类型的表达式节点)、FunctionExpr(Function类型的表达式节点)、LogicalExpr(Logical类型的表达式节点)、BoolExpr(Bool类型的表达式节点)等。以BaseExpr为例,其内部进一步可以分为不同的表达式节点,如LiteralExpr(常量表达式节点)、IdentifierExpr(标识符表达式节点)、NumberExprExpr(数值表达式节点)等等。
在本公开实施例中,为了实现对SQL语句的正确解析,预先建立有不同SQL语句的类型对应的AST转换规则,以便将SQL语句转换为AST。每个类型SQL语句的AST转换规则可以理解为该类型SQL语句可能包括的AST中的节点以及各个节点之间的节点层级关系。例如,ClickHouse的SQL语句的AST转换规则指示有ClickHouse的SQL语句可以包括ClickHouseStatement、ClickHouseStatement包括SelectBlock、FromBlock、PrewhereBlock等等,每个块节点又包括哪些表达式节点。通过将SQL语句与对应的AST转换规则进行匹配,可以识别到该条SQL语句包括有哪些节点以及这些节点之间的节点层级关系,从而建立该SQL语句对应的AST。
在一种可能的实现方式中,S202按照与SQL语句的类型对应的抽象语法树AST转换规则,将SQL语句转换为AST的具体实现可以包括:
A1:将SQL语句解析为SQL语句单词流。
SQL语句为一串字符串,通过与SQL语句的类型对应的文法规则解析器能够识别SQL语句对应的SQL语句单词流,SQL语句单词流包括多个单词。例如SQL语句“select age from table”,通过解析可以得到包括4个单词“select、age、from、table”的单词流。文法规则解析器可以为实际应用中的SQL语句解析工具。
A2:将SQL语句单词流中的单词与SQL语句的类型对应的抽象语法树AST转换规则进行匹配,确定单词的节点类型以及各个单词之间的节点层级关系。
A3:根据单词的节点类型以及各个单词之间的节点层级关系将SQL语句转换为AST。
将SQL语句单词流中的单词与对应的AST转换规则进行匹配,可以得到每个单词属于AST中的哪种类型的节点以及这些节点具有怎样的节点层级关系。将这些单词按照节点类型以及相应节点层级关系进行组装可以得到 SQL语句对应的AST。例如,Mysql类型的SQL语句“select age from table”,其中,“age”为表达式节点、“table”为表达式节点、“select”为Select块节点、“from”为From块节点,则age表达式节点属于Select块节点、table表达式节点属于From块节点,Select块节点以及From块节点属于MysqlStatement节点,从而建立了该SQL语句的AST。
参见图3所示,示出了在实际应用中将SQL语句转换为AST过程的示意图。
针对不同类型的SQL语句的输入,利用其对应的文法规则解析器识别SQL语句中的各个单词,构成SQL语句单词流,然后利用其对应的ASTBuilder将这些单词组装成当前设计的AST。ASTBuilder中保存有相应的AST转换规则。当需要适配新类型的SQL语句时,只需要实现其对应的文法规则解析器和ASTBuilder即可,最终实现不同类型的SQL语句利用对应的ASTBuilder来构建出统一的AST。例如,获取Mysql类型的SQL语句,利用Mysql文法规则解析器将SQL语句解析为SQL语句单词流,将SQL语句单词流输入Mysql ASTBuilder,将该SQL语句转换为AST。对于其他类型的SQL语句也是相同的流程,在此不再赘述。
这样,本公开实施例,在AST中为不同类型的SQL语句构建不同的语句节点,每种类型的SQL语句在解析时直接解析成对应的语句节点,同时将相对独立的语句和语法特性封装成块节点,利用不同的块节点组合来填充不同的语句节点,最后将各类基础表达式封装成表达式节点,利用表达式节点组合来填充表达式节点自身和块节点。实现上层AST节点处理不同语法,下层AST节点作为通用节点填充的一种组合方式,从而解决不同类型的SQL语句在AST上的兼容问题。
S203:在AST的表达式节点中查找属于聚合表达式的第一目标节点。
差分隐私算法在实现过程中需要对属于聚合表达式的内部节点进行敏感度计算。为了实现差分隐私算法,可以预先设置聚合表达式的列表,然后在AST的表达式节点中查找属于聚合表达式的节点作为第一目标节点。例如,预先设置需要针对sum表达式执行差分隐私算法,则sum表达式为聚合表达式,在AST的各个表达式节点中查找sum表达式节点作为第一目标节点。
由于第一目标节点属于聚合表达式,因此其内部还会包括内部节点,第一目标节点可以包括一级内部节点,也可以包括多级内部节点。例如,SQL语句中的sum(age)部分,转换为AST中的sum表达式节点和age表达式节点,sum表达式节点为第一目标节点,其内部节点为age表达式节点。又例如,SQL语句中的sum(id+age)部分,转换为AST树中的sum表达式节点、加法表达式节点、id表达式节点和age表达式节点,sum表达式节点为第一目标节点,其内部节点为加法表达式节点,加法表达式节点的内部节点为id表达式节点和age表达式节点。
S204:调用第一目标节点的内部节点的敏感度计算函数,得到第一目标节点的内部节点的敏感度,第一目标节点的内部节点的敏感度用于对第一目标节点执行差分隐私算法。
在确定第一目标节点后,通过AST可以确定第一目标节点的内部节点。本公开实施例为第一目标节点的内部节点预先设置有相应的敏感度计算函数,根据敏感度计算函数的执行逻辑,可以得到第一目标节点的内部节点的敏感度,从而利用目标节点的内部节点的敏感度对第一目标节点执行差分隐私算法。
在一种可能的实现方式中,S204调用第一目标节点的内部节点的敏感度计算函数,得到第一目标节点的内部节点的敏感度的具体实现可以包括:
调用第一目标节点的内部节点的敏感度计算函数,获取第一目标节点的内部节点的元数据信息,利用元数据信息计算第一目标节点的内部节点的敏感度;元数据信息是通过SQL语句查询数据表得到的。
在计算第一目标节点的内部节点的敏感度时,需要利用第一目标节点的内部节点的元数据信息,该元数据信息可以从内部节点对应的数据表中查询得到。具体的,元数据信息可以包括内部节点对应的数据表中的数据类型、最大值、最小值、数据出现频率等。例如,基于上述示例,由sum(age),可知sum表达式节点为第一目标节点,对应的内部节点为age表达式节点。age表达式节点是对数据表中age(年龄)列进行查询,从数据表中可以得到age表达式节点的元数据信息,包括数据表中该列的数据类型、最大值、最小值等。则调用age表达式节点的敏感度计算函数时,可以利用age表达式节点的元数据信息计算得到age表达式节点的敏感度,从而根据age表达式 节点的敏感度对sum表达式节点对应的查询结果执行差分隐私算法。
而在一些可能的实现方式中,由于第一目标节点可以包括多级内部节点,则调用第一目标节点的内部节点的敏感度计算函数,获取第一目标节点的内部节点的元数据信息,利用元数据信息计算第一目标节点的内部节点的敏感度的具体实现可以包括:
调用目标节点的第一级内部节点的敏感度计算函数,获取目标节点的第二级内部节点的元数据信息,利用目标节点的第二级内部节点的元数据信息计算目标节点的第一级内部节点的敏感度。
也即当第一目标节点包括多级内部节点时,第二级内部节点可以理解为第一内部节点的下一级节点。则调用第一级内部节点的敏感度计算函数,获取第一级内部节点的下一级内部节点(即第二内部节点)的元数据信息,可以计算得到第一级内部节点的敏感度。
当第一目标节点包括三级或三级以上内部节点时,可以从倒数第二级内部节点的敏感度计算函数开始调用,获取最后一级内部节点的元数据信息,利用最后一级内部节点的元数据信息计算倒数第二级内部节点的敏感度,倒数第二级内部节点的敏感度可以作为倒数第二级内部节点的元数据信息。继续调用倒数第二级内部节点再上一级内部节点的敏感度计算函数,利用倒数第二级内部节点的元数据信息计算倒数第二级内部节点再上一级内部节点的敏感度。以此类推,最终可以得到第一目标节点的下一级内部节点的敏感度,从而对第一目标节点的查询结果执行差分隐私算法。
例如,基于上述示例,由sum(id+age),sum表达式节点为第一目标节点,加法表达式节点为第一级内部节点,id表达式节点和age表达式节点为第二级内部节点。调用加法表达式节点的敏感度计算函数,获取id表达式节点和age表达式节点的元数据信息。根据预先设置的加法表达式节点的敏感度计算函数,将id表达式节点和age表达式节点对应的最小值相加作为加法表达式节点的最小值,将id表达式节点和age表达式节点对应的最大值相加作为加法表达式节点的最大值,计算得到加法表达式节点的敏感度。
又例如,SQL语句中的sum(power(salary,2))部分,sum表达式节点为第一目标节点,其第一级内部节点为power(指数计算)表达式节点,第二级内部节点为salary(薪水)表达式节点。调用power表达式节点的敏 感度计算函数,获取salary表达式节点的元数据信息。根据预先设置的power表达式节点的敏感度计算函数,当salary表达式节点对应的最小值为非负数时,将该最小值的平方作为power表达式节点的最小值,salary表达式节点对应的最大值的平方作为power表达式节点的最大值;当salary表达式节点对应的最大值为非正数时,将该最大值的平方作为power表达式节点的最小值,salary表达式节点对应的最小值的平方作为power表达式节点的最大值;当salary表达式节点对应的最小值为负数、最大值为正数时,power表达式节点的最小值为0,salary表达式节点对应的最小值的平方、最大值的平方中较大的作为power表达式节点的最大值,完成power表达式节点的敏感度计算。
本公开实施例对需要进行敏感度计算的表达式节点预先封装有敏感度计算逻辑,具体逻辑依据表达式节点的不同而不同,以此为基础实现了第一目标节点的差分隐私结果输出。
基于S201-S204的描述,本公开实施例预先建立有不同SQL语句类型对应的AST转换规则,可以兼容不同类型的SQL语句,将SQL语句转换为AST,AST由语句节点、块节点以及表达式节点三级节点结构进行表示。然后在AST中的表达式节点中确定需要执行差分隐私算法的属于聚合表达式的第一目标节点,调用第一目标节点的内部节点的敏感度计算函数,从而计算得到第一目标节点的内部节点的敏感度,利用第一目标节点的内部节点的敏感度可以实现针对第一目标节点执行差分隐私算法。从而实现了在输入SQL语句后差分隐私算法的执行。
基于上述实施例,为了计算第一目标节点的内部节点的敏感度,需要从第一目标节点的内部节点对应的数据表中查询得到相应数据库、数据表、数据列等的元数据信息。为了提高获取元数据信息的效率,减少查询数据库的次数,本公开实施例可以预先将元数据信息与AST中的表达式节点进行绑定。
在一种可能的实现方式中,基于上述实施例,本公开实施例还可以包括:
B1:在AST的表达式节点中查找预设类型的第二目标节点。
第二目标节点可以理解为可能需要获取元数据信息的表达式节点,在AST中有三类第二目标节点,分别为表类型、列类型以及Map表达式类型。 第二目标节点为表类型代表该表达式节点需要查询数据表、第二目标节点为代表该表达式节点需要查询数据列、第二目标节点为Map表达式类型代表该表达式节点需要查询Map表达式。即在AST的各个表达式节点中查找预设类型的第二目标节点,预设类型为表类型、列类型以及Map表达式类型。
B2:按照SQL语句的执行顺序获取第二目标节点对应的数据表中的元数据信息。
按照SQL语句的执行顺序,查询相应第二目标节点对应的数据表、数据列或者相应节点,从而得到第二目标节点的元数据信息。例如,SQL语句select name,sum(age)as sa,float_params{‘_slot_param_1’}as fp1 from table1,其中,table1被解析为表类型的第二目标节点,name和age被解析为列类型的第二目标节点,float_params{‘_slot_param_1’}被解析为Map表达式类型的第二目标节点。
按照SQL语句的执行顺序,如上述示例中,From块节点中的table1表达式节点先获取元数据信息,然后Select块节点中的三个表达式节点再获取元数据信息。
在一种可能的实现方式中,当第二目标节点为表类型,第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应表的元数据信息;
当第二目标节点为列类型,第二目标节点对应的数据库中的元数据信息为第二目标节点对应的数据表中的相应列的元数据信息;
当第二目标节点为Map表达式类型,第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应节点的元数据信息。
在本公开实施例中,当第二目标节点为表类型,查询该第二目标节点对应的数据表的元数据信息(包括该数据表所有列的元数据信息)。当第二目标节点为列类型,查询该第二目标节点对应的数据列的元数据信息。当第二目标节点为Map表达式类型,查询该第二目标节点对应的数据表中的相应节点的元数据信息。
B3:在AST中将第二目标节点对应的元数据信息与第二目标节点进行绑定。
最后,将各个第二目标节点的元数据信息与第二目标节点进行绑定,从 而在需要获取第二目标节点的元数据信息时,可以从AST中直接获取,而无需再次重复查询数据库。
在一种可能的实现方式中,S204调用第一目标节点的内部节点的敏感度计算函数,得到第一目标节点的内部节点的敏感度的具体实现可以包括:
调用第一目标节点的内部节点的敏感度计算函数,从AST中获取第一目标节点的内部节点的元数据信息,利用元数据信息计算第一目标节点的内部节点的敏感度;第一目标节点的内部节点与第二目标节点相匹配。
在AST中绑定有元数据信息后,当需要获取第一目标节点的内部节点的元数据信息时,如果该内部节点属于第二目标节点,即绑定有元数据信息,可以直接从AST中获取到该内部节点的元数据信息,无需查询数据库,提高了实现效率。
基于上述方法实施例提供的一种SQL语句的处理方法,本公开实施例还提供了一种SQL语句的处理装置,下面将结合附图对该装置进行说明。
参见图4所示,该图为本公开实施例提供的一种SQL语句的处理装置的结构示意图。如图4所示,该SQL语句的处理装置包括:
第一获取单元401,用于获取SQL语句;
转换单元402,用于按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST;所述AST的节点类型包括语句节点、块节点以及表达式节点,所述语句节点包括至少一个块节点,所述块节点包括至少一个表达式节点;
第一查找单元403,用于在所述AST的表达式节点中查找属于聚合表达式的第一目标节点;
调用单元404,用于调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,所述第一目标节点的内部节点的敏感度用于针对所述第一目标节点执行差分隐私算法。
在一种可能的实现方式中,所述转换单元,包括:
解析子单元,用于将所述SQL语句解析为SQL语句单词流;
匹配子单元,用于将所述SQL语句单词流中的单词与所述SQL语句的类型对应的抽象语法树AST转换规则进行匹配,确定所述单词的节点类型以及各个所述单词之间的节点层级关系;
转换子单元,用于根据所述单词的节点类型以及各个所述单词之间的节点层级关系将所述SQL语句转换为AST。
在一种可能的实现方式中,所述调用单元具体用于:
调用所述第一目标节点的内部节点的敏感度计算函数,获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述元数据信息是通过所述SQL语句查询数据表得到的。
在一种可能的实现方式中,当所述第一目标节点包括多级内部节点,所述调用单元具体用于包括:
所述调用所述目标节点的第一级内部节点的敏感度计算函数,获取所述目标节点的第二级内部节点的元数据信息,利用所述目标节点的第二级内部节点的元数据信息计算所述目标节点的第一级内部节点的敏感度。
在一种可能的实现方式中,所述装置还包括:
第二查找单元,用于在所述AST的表达式节点中查找预设类型的第二目标节点;
第二获取单元,用于按照所述SQL语句的执行顺序获取所述第二目标节点对应的数据表中的元数据信息;
绑定单元,用于在所述AST中将所述第二目标节点对应的元数据信息与所述第二目标节点进行绑定。
在一种可能的实现方式中,所述预设类型为表类型、列类型以及Map表达式类型;
当所述第二目标节点为表类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应表的元数据信息;
当所述第二目标节点为列类型,所述第二目标节点对应的数据库中的元数据信息为第二目标节点对应的数据表中的相应列的元数据信息;
当所述第二目标节点为Map表达式类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应节点的元数据信息。
在一种可能的实现方式中,所述调用单元具体用于:
调用所述第一目标节点的内部节点的敏感度计算函数,从所述AST中 获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述第一目标节点的内部节点与所述第二目标节点相匹配。
基于上述方法实施例提供的一种SQL语句的处理方法,本公开还提供一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述任一实施例所述的SQL语句的处理方法。
下面参考图5,其示出了适于用来实现本公开实施例的电子设备1300的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(Personal Digital Assistant,个人数字助理)、PAD(portable android device,平板电脑)、PMP(Portable Media Player,便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV(television,电视机)、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图5所示,电子设备1300可以包括处理装置(例如中央处理器、图形处理器等)1301,其可以根据存储在只读存储器(ROM)1302中的程序或者从存储装置1306加载到随机访问存储器(RAM)1303中的程序而执行各种适当的动作和处理。在RAM1303中,还存储有电子设备1300操作所需的各种程序和数据。处理装置1301、ROM 1302以及RAM 1303通过总线1304彼此相连。输入/输出(I/O)接口1305也连接至总线1304。
通常,以下装置可以连接至I/O接口1305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置1306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置1307;包括例如磁带、硬盘等的存储装置1306;以及通信装置1309。通信装置1309可以允许电子设备1300与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备1300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包 括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置1309从网络上被下载和安装,或者从存储装置1306被安装,或者从ROM1302被安装。在该计算机程序被处理装置1301执行时,执行本公开实施例的方法中限定的上述功能。
本公开实施例提供的电子设备与上述实施例提供的一种SQL语句的处理方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
基于上述方法实施例提供的一种SQL语句的处理方法,本公开实施例提供一种计算机可读介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现如上述任一实施例所述的SQL语句的处理方法。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText  Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述SQL语句的处理方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开实施例的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元/模块的名称在某种情况下并不构成对 该单元本身的限定,例如,第一获取单元还可以被描述为“第一获取模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开实施例的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,示例一提供了一种SQL语句的处理方法,所述方法包括:
获取SQL语句;
按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST;所述AST的节点类型包括语句节点、块节点以及表达式节点,所述语句节点包括至少一个块节点,所述块节点包括至少一个表达式节点;
在所述AST的表达式节点中查找属于聚合表达式的第一目标节点;
调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,所述第一目标节点的内部节点的敏感度用于针对所述第一目标节点执行差分隐私算法。
根据本公开的一个或多个实施例,示例二提供了一种SQL语句的处理方法,所述按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST,包括:
将所述SQL语句解析为SQL语句单词流;
将所述SQL语句单词流中的单词与所述SQL语句的类型对应的抽象语 法树AST转换规则进行匹配,确定所述单词的节点类型以及各个所述单词之间的节点层级关系;
根据所述单词的节点类型以及各个所述单词之间的节点层级关系将所述SQL语句转换为AST。
根据本公开的一个或多个实施例,示例三提供了一种SQL语句的处理方法,所述调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,包括:
调用所述第一目标节点的内部节点的敏感度计算函数,获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述元数据信息是通过所述SQL语句查询数据表得到的。
根据本公开的一个或多个实施例,示例四提供了一种SQL语句的处理方法,当所述第一目标节点包括多级内部节点,所述调用所述第一目标节点的内部节点的敏感度计算函数,获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度,包括:
所述调用所述目标节点的第一级内部节点的敏感度计算函数,获取所述目标节点的第二级内部节点的元数据信息,利用所述目标节点的第二级内部节点的元数据信息计算所述目标节点的第一级内部节点的敏感度。
根据本公开的一个或多个实施例,示例五提供了一种SQL语句的处理方法,所述方法还包括:
在所述AST的表达式节点中查找预设类型的第二目标节点;
按照所述SQL语句的执行顺序获取所述第二目标节点对应的数据表中的元数据信息;
在所述AST中将所述第二目标节点对应的元数据信息与所述第二目标节点进行绑定。
根据本公开的一个或多个实施例,示例六提供了一种SQL语句的处理方法,所述预设类型为表类型、列类型以及Map表达式类型;
当所述第二目标节点为表类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应表的元数据信息;
当所述第二目标节点为列类型,所述第二目标节点对应的数据库中的元数据信息为第二目标节点对应的数据表中的相应列的元数据信息;
当所述第二目标节点为Map表达式类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应节点的元数据信息。
根据本公开的一个或多个实施例,示例七提供了一种SQL语句的处理方法,所述调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,包括:
调用所述第一目标节点的内部节点的敏感度计算函数,从所述AST中获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述第一目标节点的内部节点与所述第二目标节点相匹配。
根据本公开的一个或多个实施例,示例八提供了一种SQL语句的处理装置,所述装置包括:
第一获取单元,用于获取SQL语句;
转换单元,用于按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST;所述AST的节点类型包括语句节点、块节点以及表达式节点,所述语句节点包括至少一个块节点,所述块节点包括至少一个表达式节点;
第一查找单元,用于在所述AST的表达式节点中查找属于聚合表达式的第一目标节点;
调用单元,用于调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,所述第一目标节点的内部节点的敏感度用于针对所述第一目标节点执行差分隐私算法。
根据本公开的一个或多个实施例,示例九提供了一种SQL语句的处理装置,所述转换单元,包括:
解析子单元,用于将所述SQL语句解析为SQL语句单词流;
匹配子单元,用于将所述SQL语句单词流中的单词与所述SQL语句的类型对应的抽象语法树AST转换规则进行匹配,确定所述单词的节点类型以及各个所述单词之间的节点层级关系;
转换子单元,用于根据所述单词的节点类型以及各个所述单词之间的节点层级关系将所述SQL语句转换为AST。
根据本公开的一个或多个实施例,示例十提供了一种SQL语句的处理装置,所述调用单元具体用于:
调用所述第一目标节点的内部节点的敏感度计算函数,获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述元数据信息是通过所述SQL语句查询数据表得到的。
根据本公开的一个或多个实施例,示例十一提供了一种SQL语句的处理装置,当所述第一目标节点包括多级内部节点,所述调用单元具体用于包括:
所述调用所述目标节点的第一级内部节点的敏感度计算函数,获取所述目标节点的第二级内部节点的元数据信息,利用所述目标节点的第二级内部节点的元数据信息计算所述目标节点的第一级内部节点的敏感度。
根据本公开的一个或多个实施例,示例十二提供了一种SQL语句的处理装置,所述装置还包括:
第二查找单元,用于在所述AST的表达式节点中查找预设类型的第二目标节点;
第二获取单元,用于按照所述SQL语句的执行顺序获取所述第二目标节点对应的数据表中的元数据信息;
绑定单元,用于在所述AST中将所述第二目标节点对应的元数据信息与所述第二目标节点进行绑定。
根据本公开的一个或多个实施例,示例十三提供了一种SQL语句的处理装置,所述预设类型为表类型、列类型以及Map表达式类型;
当所述第二目标节点为表类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应表的元数据信息;
当所述第二目标节点为列类型,所述第二目标节点对应的数据库中的元数据信息为第二目标节点对应的数据表中的相应列的元数据信息;
当所述第二目标节点为Map表达式类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应节点的元数据信 息。
根据本公开的一个或多个实施例,示例十四提供了一种SQL语句的处理装置,所述调用单元具体用于:
调用所述第一目标节点的内部节点的敏感度计算函数,从所述AST中获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述第一目标节点的内部节点与所述第二目标节点相匹配。
根据本公开的一个或多个实施例,示例十五提供了一种SQL语句的处理设备,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如示例一至示例七任一项所述的SQL语句的处理方法。
根据本公开的一个或多个实施例,示例十六提供了一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备执行如示例一至示例七任一项所述的SQL语句的处理方法。
需要说明的是,本公开中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统或装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
应当理解,在本公开中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。
还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、 “包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本公开。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种结构化查询语言SQL语句的处理方法,包括:
    获取SQL语句;
    按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST;所述AST的节点类型包括语句节点、块节点以及表达式节点,所述语句节点包括至少一个块节点,所述块节点包括至少一个表达式节点;
    在所述AST的表达式节点中查找属于聚合表达式的第一目标节点;
    调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,所述第一目标节点的内部节点的敏感度用于针对所述第一目标节点执行差分隐私算法。
  2. 根据权利要求1所述的方法,其中,所述按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST,包括:
    将所述SQL语句解析为SQL语句单词流;
    将所述SQL语句单词流中的单词与所述SQL语句的类型对应的抽象语法树AST转换规则进行匹配,确定所述单词的节点类型以及各个所述单词之间的节点层级关系;
    根据所述单词的节点类型以及各个所述单词之间的节点层级关系将所述SQL语句转换为AST。
  3. 根据权利要求1所述的方法,其中,所述调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,包括:
    调用所述第一目标节点的内部节点的敏感度计算函数,获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述元数据信息是通过所述SQL语句查询数据表得到的。
  4. 根据权利要求3所述的方法,其中,当所述第一目标节点包括多级内部节点,所述调用所述第一目标节点的内部节点的敏感度计算函数,获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第 一目标节点的内部节点的敏感度,包括:
    所述调用所述目标节点的第一级内部节点的敏感度计算函数,获取所述目标节点的第二级内部节点的元数据信息,利用所述目标节点的第二级内部节点的元数据信息计算所述目标节点的第一级内部节点的敏感度。
  5. 根据权利要求1-4任一项所述的方法,还包括:
    在所述AST的表达式节点中查找预设类型的第二目标节点;
    按照所述SQL语句的执行顺序获取所述第二目标节点对应的数据表中的元数据信息;
    在所述AST中将所述第二目标节点对应的元数据信息与所述第二目标节点进行绑定。
  6. 根据权利要求5所述的方法,其中,所述预设类型为表类型、列类型以及Map表达式类型;
    当所述第二目标节点为表类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应表的元数据信息;
    当所述第二目标节点为列类型,所述第二目标节点对应的数据库中的元数据信息为第二目标节点对应的数据表中的相应列的元数据信息;
    当所述第二目标节点为Map表达式类型,所述第二目标节点对应的数据表中的元数据信息为第二目标节点对应的数据表中的相应节点的元数据信息。
  7. 根据权利要求5或6所述的方法,其中,所述调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,包括:
    调用所述第一目标节点的内部节点的敏感度计算函数,从所述AST中获取所述第一目标节点的内部节点的元数据信息,利用所述元数据信息计算所述第一目标节点的内部节点的敏感度;所述第一目标节点的内部节点与所述第二目标节点相匹配。
  8. 一种结构化查询语言SQL语句的处理装置,包括:
    第一获取单元,被配置为获取SQL语句;
    转换单元,被配置为按照与所述SQL语句的类型对应的抽象语法树AST转换规则,将所述SQL语句转换为AST;所述AST的节点类型包括语句节 点、块节点以及表达式节点,所述语句节点包括至少一个块节点,所述块节点包括至少一个表达式节点;
    第一查找单元,被配置为在所述AST的表达式节点中查找属于聚合表达式的第一目标节点;
    调用单元,被配置为调用所述第一目标节点的内部节点的敏感度计算函数,得到所述第一目标节点的内部节点的敏感度,所述第一目标节点的内部节点的敏感度用于针对所述第一目标节点执行差分隐私算法。
  9. 一种结构化查询语言SQL语句的处理设备,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时,实现如权利要求1-7任一项所述的SQL语句的处理方法。
  10. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备执行如权利要求1-7任一项所述的SQL语句的处理方法。
PCT/CN2024/079634 2023-03-03 2024-03-01 Sql语句的处理方法、装置及设备 Ceased WO2024183646A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310201045.4A CN116226169B (zh) 2023-03-03 2023-03-03 一种sql语句的处理方法、装置及设备
CN202310201045.4 2023-03-03

Publications (1)

Publication Number Publication Date
WO2024183646A1 true WO2024183646A1 (zh) 2024-09-12

Family

ID=86576553

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/079634 Ceased WO2024183646A1 (zh) 2023-03-03 2024-03-01 Sql语句的处理方法、装置及设备

Country Status (2)

Country Link
CN (1) CN116226169B (zh)
WO (1) WO2024183646A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119128995A (zh) * 2024-11-18 2024-12-13 苏州吉呗思数据技术有限公司 分布式数据库的数据脱敏方法、装置及设备
CN119166671A (zh) * 2024-11-25 2024-12-20 浪潮软件科技有限公司 一种多源异构数据库sql语句敏感度计算方法
CN119201981A (zh) * 2024-11-27 2024-12-27 浪潮软件科技有限公司 一种自适应sql差分隐私加噪方法
CN120849417A (zh) * 2025-09-22 2025-10-28 杭州映云科技有限公司 一种基于图结构与sql语句的流处理方法和系统

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116226169B (zh) * 2023-03-03 2025-07-18 北京字跳网络技术有限公司 一种sql语句的处理方法、装置及设备
CN117312392A (zh) * 2023-10-24 2023-12-29 山东浪潮科学研究院有限公司 一种多云NewSQL数据库隐私增强检索方法及装置
CN117370376A (zh) * 2023-11-24 2024-01-09 罗克佳华(重庆)科技有限公司 Sql语句处理方法、装置及电子设备
CN119670144B (zh) * 2024-11-29 2025-12-05 北京字跳网络技术有限公司 分位数的差分隐私加噪方法、装置、介质、设备及产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125758A (zh) * 2019-12-19 2020-05-08 北京安华金和科技有限公司 一种基于全语法树解析的动态脱敏方法
US20200380159A1 (en) * 2019-06-03 2020-12-03 Immuta, Inc. Systems and methods for privacy-enhancing transformation of a sql query
CN112162998A (zh) * 2020-09-27 2021-01-01 徐州医科大学 隐私保护查询语言pql及其系统
CN112765658A (zh) * 2021-01-15 2021-05-07 杭州数梦工场科技有限公司 一种数据脱敏方法、装置及电子设备和存储介质
CN116226169A (zh) * 2023-03-03 2023-06-06 北京字跳网络技术有限公司 一种sql语句的处理方法、装置及设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8856102B2 (en) * 2012-11-07 2014-10-07 International Business Machines Corporation Modifying structured query language statements
CN111191276B (zh) * 2019-12-05 2023-09-19 平安银行股份有限公司 数据脱敏方法、装置、存储介质及计算机设备
CN113032362B (zh) * 2021-03-18 2024-01-19 广州虎牙科技有限公司 数据血缘分析方法、装置、电子设备和存储介质
CN113190573A (zh) * 2021-04-30 2021-07-30 作业帮教育科技(北京)有限公司 一种基于类sql的数据文件分析处理方法、装置及电子设备
CN115269632A (zh) * 2022-07-20 2022-11-01 天翼云科技有限公司 一种sql语句处理方法、装置、电子设备及存储介质
CN115408419A (zh) * 2022-09-02 2022-11-29 深圳证券信息有限公司 一种数据抽取方法及相关装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200380159A1 (en) * 2019-06-03 2020-12-03 Immuta, Inc. Systems and methods for privacy-enhancing transformation of a sql query
CN111125758A (zh) * 2019-12-19 2020-05-08 北京安华金和科技有限公司 一种基于全语法树解析的动态脱敏方法
CN112162998A (zh) * 2020-09-27 2021-01-01 徐州医科大学 隐私保护查询语言pql及其系统
CN112765658A (zh) * 2021-01-15 2021-05-07 杭州数梦工场科技有限公司 一种数据脱敏方法、装置及电子设备和存储介质
CN116226169A (zh) * 2023-03-03 2023-06-06 北京字跳网络技术有限公司 一种sql语句的处理方法、装置及设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHANG CHAOZHEN: "The Research on Structured Query Language Satisfying Differential Privacy", INFORMATION SCIENCE AND TECHNOLOGY, CHINESE MASTER’S THESES FULL-TEXT DATABASE, 1 June 2020 (2020-06-01), XP093208278, DOI: 10.26989/d.cnki.gdlhu.2020.000414 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119128995A (zh) * 2024-11-18 2024-12-13 苏州吉呗思数据技术有限公司 分布式数据库的数据脱敏方法、装置及设备
CN119166671A (zh) * 2024-11-25 2024-12-20 浪潮软件科技有限公司 一种多源异构数据库sql语句敏感度计算方法
CN119201981A (zh) * 2024-11-27 2024-12-27 浪潮软件科技有限公司 一种自适应sql差分隐私加噪方法
CN120849417A (zh) * 2025-09-22 2025-10-28 杭州映云科技有限公司 一种基于图结构与sql语句的流处理方法和系统

Also Published As

Publication number Publication date
CN116226169A (zh) 2023-06-06
CN116226169B (zh) 2025-07-18

Similar Documents

Publication Publication Date Title
WO2024183646A1 (zh) Sql语句的处理方法、装置及设备
CN113220710B (zh) 数据查询方法、装置、电子设备以及存储介质
CN111198898B (zh) 大数据查询方法及大数据查询装置
US12248884B2 (en) Method and apparatus for knowledge graph construction, storage medium, and electronic device
WO2024109860A1 (zh) 一种交互方法、装置、电子设备、计算机可读介质
CN115544081A (zh) 数据查询方法、装置、电子设备及存储介质
CN116127143A (zh) 数据查询方法、装置、电子设备及可读存储介质
US20250165501A1 (en) Virtual column construction method based on data lake and data query method
CN114969044A (zh) 一种基于数据湖的物化列创建方法以及数据查询方法
CN118246055B (zh) 差分隐私加噪方法、装置、介质及电子设备
CN111813846A (zh) 一种数据分析处理系统和数据处理方法
CN113609100B (zh) 数据存储方法、数据查询方法、装置及电子设备
CN107463671B (zh) 路径查询的方法和装置
US20250181594A1 (en) Structured query statement similarity detection method and apparatus, and device
CN113760905A (zh) 数据库索引处理方法、装置、电子设备和计算机可读介质
WO2025055658A1 (zh) 图像生成方法、装置、系统、电子设备、计算机可读介质
CN114443922A (zh) 面向IoT数据感知的传感器数据分组检索方法、系统、装置
WO2025016112A1 (zh) 信息流转方法、装置、介质和电子设备
CN111737571A (zh) 搜索方法、装置和电子设备
CN118276831A (zh) 一种数据处理方法及系统
CN113779197B (zh) 一种数据集搜索方法、装置、存储介质及终端
CN116483808A (zh) 数据迁移方法、装置、电子设备和计算机可读介质
CN116431657A (zh) 数据查询语句生成方法、装置、设备、存储介质及产品
CN115827676A (zh) Sql子查询的执行方法、装置、终端设备以及介质
CN114741407B (zh) 条件查询方法、装置和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24766362

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 24766362

Country of ref document: EP

Kind code of ref document: A1