Differential privacy noise adding method and device for enumeration value, medium, equipment and product

By using the exponential mechanism to select the target enumeration value from the candidate set of the enumeration value expression in the differential privacy noise addition process, the problem of poor noise control in the prior art is solved, and the efficient controllability and usability of the noise addition result is achieved.

CN119670143APending Publication Date: 2025-03-21BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411752146.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In the noise addition process of differential privacy, it is difficult for the prior art to ensure that the noise control of the aggregate function whose expression values ​​are enumeration values ​​is within a suitable range, resulting in the availability of the noise addition result being affected.

Method used

By identifying the noise-added aggregate function in the SQL statement, if its expression value is an enumeration value, the target enumeration value is selected from multiple enumeration values ​​using an exponential mechanism that matches the aggregation function type, and generate the noise-added result based on the target enumeration value and the aggregate function type.

Benefits of technology

This method can effectively control noise within the range of candidate sets of enumeration value expressions, making the differential privacy noise addition process efficient and controllable, and ensuring the availability of noise addition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670143A_ABST
    Figure CN119670143A_ABST
Patent Text Reader

Abstract

The invention discloses a differential privacy noise adding method and device for enumeration values, a medium, equipment and a product. The method comprises the following steps: in response to a received structured query language (SQL) statement, identifying an aggregation function to be noised in the SQL statement; for each aggregation function, if the value of the expression in the aggregation function is an enumeration value, obtaining a plurality of enumeration values to be aggregated according to the expression of the aggregation function; selecting a target enumeration value from a plurality of enumeration values by using an exponential mechanism matched with the type of the aggregation function, wherein the type of the target enumeration value is used for representing whether the aggregation value of the aggregation function is obtained by calculation or not; and generating a noise adding result of the aggregation function according to the target enumeration value and the type of the aggregation function. Therefore, the noise of the aggregation function of which the value of the expression is the enumerated value can be controlled within the range of the value candidate set of the expression in the aggregation function by utilizing an exponential mechanism, so that the differential privacy noise adding process is efficient and controllable, and the availability of a noise adding result can be ensured while the safety is not influenced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a differential privacy noise adding method, device, medium, equipment and product for enumeration values. Background Art

[0002] Differential Privacy (DP) is a privacy protection method, mainly used to protect aggregated statistical data. It can protect 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 a record in the data will not have a significant impact on the statistical results, aiming to solve the problem of data leakage in the statistical release process.

[0003] At present, there are many mechanisms for achieving differential privacy, including the Laplace mechanism, Gaussian mechanism, exponential mechanism, etc. Different mechanisms are selected to achieve differential privacy capabilities based on the type and distribution of the original data set. In the process of achieving differential privacy, how to ensure the availability of the noise-added results is of great significance to protecting data privacy. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a differential privacy noise adding method for enumeration values, the method comprising:

[0006] In response to receiving a structured query language SQL statement, identifying an aggregate function to be noised in the SQL statement;

[0007] For each of the aggregate functions, if the value of the expression in the aggregate function is an enumeration value, then according to the expression of the aggregate function, multiple enumeration values ​​to be aggregated are obtained; a target enumeration value is selected from the multiple enumeration values ​​using an index mechanism that matches the type of the aggregate function, wherein the type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation; and according to the target enumeration value and the type of the aggregate function, a noise-added result of the aggregate function is generated.

[0008] In a second aspect, the present disclosure provides a differential privacy noise adding device for enumeration values, the device comprising:

[0009] A noise point identification module, configured to identify, in response to receiving a structured query language SQL statement, an aggregate function to be noised in the SQL statement;

[0010] An acquisition module is used for obtaining, for each of the aggregate functions, a plurality of enumeration values ​​to be aggregated according to the expression of the aggregate function if the value of the expression in the aggregate function is an enumeration value; a selection module is used for selecting a target enumeration value from the plurality of enumeration values ​​using an exponential mechanism that matches the type of the aggregate function, wherein the type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation; a generation module is used for generating a noise-added result of the aggregate function according to the target enumeration value and the type of the aggregate function.

[0011] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the differential privacy noising method for enumeration values ​​provided in the first aspect of the present disclosure.

[0012] In a fourth aspect, the present disclosure provides an electronic device, including:

[0013] a storage device having a computer program stored thereon;

[0014] A processing device is used to execute the computer program in the storage device to implement the steps of the differential privacy noising method for enumeration values ​​provided in the first aspect of the present disclosure.

[0015] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the differential privacy noising method for enumeration values ​​provided in the first aspect of the present disclosure.

[0016] In the above technical scheme, after receiving a structured query language SQL statement, the aggregation function to be noised in the SQL statement is first identified; then, for each aggregation function to be noised in the SQL statement, if the value of the expression in the aggregation function is an enumeration value, a target enumeration value is selected from multiple enumeration values ​​to be aggregated using an index mechanism matching the type of the aggregation function, wherein the type is used to characterize whether the aggregation value of the aggregation function is obtained by calculation; and a noised result of the aggregation function is generated according to the target enumeration value and the type of the aggregation function. The differential privacy noised scheme of the enumeration value selects a target enumeration value from multiple enumeration values ​​to be aggregated using an index mechanism, and generates a noised result of the aggregation function based on the target enumeration value, so that the noise of the aggregation function whose expression value is an enumeration value can be controlled within the range of the candidate set of values ​​of the expression in the aggregation function (including multiple enumeration values ​​to be aggregated) by using the index mechanism, so that the differential privacy noised process is efficient and controllable, and the availability of the noised result can be guaranteed without affecting security.

[0017] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0019] Figure 1 The present invention is a flowchart of a differential privacy noise adding method for enumeration values ​​according to an exemplary embodiment.

[0020] Figure 2 The figure is a schematic diagram of a differential privacy noising process of an enumeration value according to an exemplary embodiment.

[0021] Figure 3 The diagram is a hierarchical diagram of a SQL statement according to an exemplary embodiment.

[0022] Figure 4 is a schematic diagram of differential privacy noise adding logic of different types of aggregation functions according to an exemplary embodiment.

[0023] Figure 5 The figure is a block diagram of a differential privacy noise adding device for enumeration values ​​according to an exemplary embodiment.

[0024] Figure 6 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0025] As discussed in the background technology, differential privacy is usually achieved by using Laplace mechanism, Gaussion mechanism, exponential mechanism, etc. In the process of achieving differential privacy, how to ensure the availability of the noise-added results is of great significance for protecting data privacy.

[0026] In actual applications, for aggregate functions whose expression values ​​are enumerated values, these enumerated values ​​often have special meanings, such as max(if(val>1,1,0)). The value of the internal expression may have a clear range and value, and may only be 1 or 0, where val is the physical column name. In this case, if the Laplace mechanism or Gaussion mechanism is used, the added noise may not be 0 or 1, which causes the expression to lose its actual business meaning and affects the usability of the noise-added result.

[0027] Combined with the specific meaning of enumeration value expressions in actual application scenarios, the inventors found that the key to ensuring the availability of the noise-added results of the aggregation function whose expression value is the enumeration value is to control the noise within the candidate set corresponding to the enumeration value expression. Therefore, it is possible to consider using the exponential mechanism to handle the noise-added problem of the aggregation operator of such expressions, thereby ensuring the availability of the noise-added results.

[0028] In view of this, the present disclosure provides a differential privacy noise adding method, apparatus, medium, equipment and product for enumeration values.

[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0035] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0036] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's information. Thus, the user can autonomously choose whether to provide information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0037] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide information to the electronic device.

[0038] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0039] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0040] Figure 1 FIG. 1 is a flowchart of a differential privacy noise adding method for enumeration values ​​according to an exemplary embodiment. Figure 1 As shown, the differential privacy noise adding method of the enumeration value may include the following S101 to S104.

[0041] In S101 , in response to receiving a structured query language SQL statement, an aggregate function to be noised in the SQL statement is identified.

[0042] In the present disclosure, the differential privacy noising method for the above enumeration values ​​can be applied to the scenario of structured query language (SQL) analysis query.

[0043] Among them, enumeration value usually refers to the member of enumeration type. Enumeration is a data type, which consists of a set of predefined constants. These constants are usually called enumeration values ​​or enumeration members.

[0044] like Figure 2As shown in the figure, differential privacy noise addition of enumeration values ​​can be achieved by combining the processing logic based on the noise addition service with the user-defined aggregate function (UDAF). The SQL statement parsing and noise point screening functions can be integrated into the noise addition service separately, and the differential privacy noise addition processing implementation process can be integrated into the UDAF calculation to meet the needs of overall analysis of SQL statements and noise addition processing for noise points.

[0045] The differential privacy noise addition method of the above enumeration value can be applied to the data provider. After receiving the SQL statement input by the user, the data provider can use the noise addition service to parse the SQL statement, filter the noise points, and rewrite the SQL statement to obtain a new SQL statement.

[0046] After receiving the SQL statement input by the user, the data provider can parse the SQL statement, for example, using antlr (another tool for language recognition) to parse it to obtain the abstract syntax tree (AST) corresponding to the SQL statement; then, based on the abstract syntax tree, identify the noise points in the SQL statement and select a suitable noise mechanism; and rewrite the SQL statement based on the identified noise points and their noise mechanism.

[0047] Among them, ANTLR refers to an open source syntax analyzer that can automatically generate a syntax tree based on input and display it visually. AST is an abstract representation of the syntax structure of the source code. It represents the syntax structure of the programming language in a tree form. Each node on the syntax tree represents a structure in the source code.

[0048] In S102, for each aggregation function to be noised, if the value of the expression in the aggregation function is an enumeration value, multiple enumeration values ​​to be aggregated are obtained according to the expression of the aggregation function.

[0049] In S103, a target enumeration value is selected from multiple enumeration values ​​using an index mechanism that matches the type of the aggregate function.

[0050] In S104, a noise-added result of the aggregate function is generated according to the target enumeration value and the type of the aggregate function.

[0051] In the present disclosure, for each aggregate function to be noised (belonging to the noise point), by analyzing the possible values ​​of the expression in the aggregate function, it can be determined whether the value of the aggregate function is an enumeration value. Figure 2As shown in the figure, if the value of the expression in the aggregate function is not an enumeration value, the Laplace or Gaussian mechanism can be used to add noise, for example, the count function, and add noise to the expression of the aggregate function, that is, rewrite the SQL statement; if the value of the expression in the aggregate function is an enumeration value, different exponential mechanisms are used for differential privacy noise addition according to different types of aggregate functions.

[0052] The type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation. Aggregate functions can be divided into two categories according to whether the aggregate value is obtained by calculation: one category is that the aggregate value is not obtained by calculation, such as the min function and the max function, whose aggregate value is an element in the value candidate set of the expression in the aggregate function, where the value candidate set includes all possible values ​​of the expression in the aggregate function, that is, the multiple enumeration values ​​to be aggregated mentioned above; the other category is that the aggregate value is obtained by calculation, such as the sum function, the avg function, the var function, and the standard deviation (std) function, etc., whose aggregate value is calculated based on the elements in the value candidate set.

[0053] For these two types of aggregation functions, different exponential mechanisms can be used to perform differential privacy noise. Figure 2 As shown, for the aggregation function whose aggregate value is not obtained by calculation, the aggregation function can be replaced by UDAF, and the exponential mechanism can be used to add noise to the selection process of the aggregate value of the aggregation function, so as to add noise to select any element in the candidate value set (that is, the target enumeration value); and for the aggregation function whose aggregate value is obtained by calculation, the exponential mechanism can be used to select the noise value (that is, the target enumeration value) from the candidate value set, and add the noise value to the expression of the aggregation function, where the noise value is an element in the candidate value set.

[0054] Specifically, if Figure 2 As shown, if the type of the aggregate function represents that the aggregate value of the aggregate function is not obtained by calculation, the target enumeration value is determined as the noisy aggregate value of the aggregate function; if the type of the aggregate function represents that the aggregate value of the aggregate function is obtained by calculation, the target enumeration value is added as a noise value to the expression of the aggregate function, that is, the SQL expression is rewritten to obtain the noisy result of the aggregate function.

[0055] When the noise value is added to the expression of the aggregate function, the expression of the aggregate function can be rewritten in the form of "expression + noise value". For example, the aggregate function is select sum(is_cnt)frominput_a. After adding the noise value to the expression of the aggregate function, the following SQL statement can be obtained: select sum(is_cnt)+exp_rand frominput_a, or select sum(is_cnt)-exp_rand frominput_a, where exp_rand is the noise value, input_a is the table name, and is_cnt is the physical column name.

[0056] Before selecting a target enumeration value from multiple enumeration values ​​using an index mechanism that matches the type of the aggregate function, it is also necessary to determine the type of the aggregate function. Specifically, if the aggregate function is a max function or a min function, determining the type of the aggregate function indicates that the aggregate value of the aggregate function is not obtained by calculation; if the aggregate function is any one of an avg function, a sum function, a var function, and a standard deviation function, determining the type of the aggregate function indicates that the aggregate value of the aggregate function is obtained by calculation.

[0057] In the above technical scheme, after receiving a structured query language SQL statement, the aggregation function to be noised in the SQL statement is first identified; then, for each aggregation function to be noised in the SQL statement, if the value of the expression in the aggregation function is an enumeration value, a target enumeration value is selected from multiple enumeration values ​​to be aggregated using an index mechanism matching the type of the aggregation function, wherein the type is used to characterize whether the aggregation value of the aggregation function is obtained by calculation; and a noised result of the aggregation function is generated according to the target enumeration value and the type of the aggregation function. The differential privacy noised scheme of the enumeration value selects a target enumeration value from multiple enumeration values ​​to be aggregated using an index mechanism, and generates a noised result of the aggregation function based on the target enumeration value, so that the noise of the aggregation function whose expression value is an enumeration value can be controlled within the range of the candidate set of values ​​of the expression in the aggregation function (including multiple enumeration values ​​to be aggregated) by using the index mechanism, so that the differential privacy noised process is efficient and controllable, and the availability of the noised result can be guaranteed without affecting security.

[0058] The following is a detailed description of the specific implementation method of identifying the noise points in the SQL statement based on the abstract syntax tree. Specifically, it can be achieved through the following steps [1] and [2].

[0059] Step [1]: Analyze the abstract syntax tree structure and divide it into nested levels.

[0060] For example, a SQL statement such as Figure 3As shown, it includes 2 levels, namely, layer 1, layer 2.1 and layer 2.2.

[0061] Step [2]: Noise point screening. Specifically, the aggregation nodes that need to be noised (i.e., the aggregation functions to be noised) can be screened in accordance with the noise addition rule requirements. For example, when there are nested aggregation functions, the inner layer is noised first, and the outer layer aggregation function is not noised, for example, sum(avg(val)+noise).

[0062] The following is a detailed description of the specific implementation method of analyzing the possible values ​​of the expression in the aggregate function to determine whether the value of the aggregate function is an enumeration value. In one implementation, the category of the expression in the aggregate function can be determined first, where the category is any one of the following: a physical column, a constant, or a combination of a physical column and a constant; then, different determination methods are used according to different categories.

[0063] Specifically, when the category of the expression in the aggregate function is a physical column, it is possible to determine whether the data type of the physical column is an enumeration type based on the meta information of the physical column. When the expression in the aggregate function includes a physical column, if the data type of the physical column is an enumeration type, the value of the expression in the aggregate function is determined to be an enumeration value; if the data type of the physical column is not an enumeration type, the value of the expression in the aggregate function is determined not to be an enumeration value. The meta information of the physical column includes all possible values ​​of the physical column, the total number of these values, the frequency of occurrence of each value, and the data type of the physical column.

[0064] For example, Figure 4 As shown in the figure, the aggregate function is max(val) or sum(val), and its expression is the physical column val. If the data type of the physical column val is an enumeration type, the value of the expression in the aggregate function is determined to be an enumeration value, that is, the value of the physical column val is an enumeration value; if the data type of the physical column val is not an enumeration type, the value of the expression in the aggregate function is determined not to be an enumeration value, that is, the value of the physical column val is not an enumeration value. In this case, the Laplace mechanism can be used to add noise.

[0065] When the category of the expression within the aggregate function is a physical column and the expression within the aggregate function includes multiple physical columns, if the data type of each physical column in the expression within the aggregate function is an enumeration type, then the value of the expression within the aggregate function is determined to be an enumeration value; if there is a physical column whose data type is not an enumeration type among the multiple physical columns of the expression within the aggregate function, then the value of the expression within the aggregate function is determined not to be an enumeration value.

[0066] For example, Figure 4As shown in the figure, the aggregate function is sum(if(val>1,val,val1)), and its expression includes physical columns val and val1. If the data types of physical columns val and val1 are both enumeration types, the value of the expression in the aggregate function is determined to be an enumeration value; if the data type of physical column val or val1 is not an enumeration type, the value of the expression in the aggregate function is determined not to be an enumeration value. In this case, the Laplace mechanism can be used to add noise.

[0067] When the category of the expression in the aggregate function is a constant (that is, all the expressions in the aggregate function are determined constants), the value of the expression in the aggregate function can be determined to be an enumeration value.

[0068] For example, Figure 4 As shown, the aggregate function is max(if(val>1,1,0)) or sum(if(val>1,1,0)), and its expression includes constants 1 and 0. Then it can be determined that the expression in the aggregate function is an enumeration value.

[0069] When the category of the expression in the aggregate function is a combination of a physical column and a constant, you can first determine whether the data type of the physical column is an enumeration type based on the meta information of the physical column in the expression in the aggregate function; if the data type of the physical column is an enumeration type, then determine that the value of the expression in the aggregate function is an enumeration value; if the data type of the physical column is not an enumeration type, then determine that the value of the expression in the aggregate function is not an enumeration value.

[0070] For example, Figure 4 As shown, the aggregate function is max(if(val>1,val,0)) or sum(if(val>1,val,0)), and its expression includes both the physical column val and the constant 0. If the data type of the physical column val is an enumeration type, the value of the expression in the aggregate function is determined to be an enumeration value; if the data type of the physical column val is not an enumeration type, the value of the expression in the aggregate function is determined not to be an enumeration value.

[0071] The following describes in detail the specific implementation of obtaining multiple enumeration values ​​to be aggregated according to the expression of the aggregation function in S102.

[0072] Specifically, when the type of the aggregation function indicates that the aggregation value of the aggregation function is not obtained by calculation, the aggregation function can be replaced with a preset UDAF, wherein the parameters of the UDAF include an expression; then, multiple enumeration values ​​to be aggregated are obtained according to the expression of the UDAF.

[0073] Combining the definition of the index mechanism and the rewriting of SQL scenarios, it can be found that it is difficult to add the index mechanism algorithm logic directly to the original query statement through SQL expressions. Therefore, it is possible to consider using UDAF to implement an aggregate function with noise-adding logic whose aggregate value is not calculated, thereby solving the problem of complex SQL statement rewriting and high error rate.

[0074] For example, the aggregation function is select max(val)frominput_a, which can be replaced by the following UDAF: select dp_enum_max(val)frominput_a.

[0075] When the type of the aggregate function indicates that the aggregate value of the aggregate function is obtained by calculation, there is no need to perform UDAF replacement. In this case, multiple enumeration values ​​to be aggregated can be directly obtained according to the expression of the aggregate function.

[0076] The following is a detailed description of the specific implementation of selecting a target enumeration value from multiple enumeration values ​​using an index mechanism matching the type of the aggregation function in the above S103. Specifically, it can be implemented by the following steps (1) to (3).

[0077] Step (1): According to multiple enumeration values, determine the utility function and sensitivity of the index mechanism that matches the type of the aggregation function.

[0078] In the present disclosure, the utility function q(D, r) is used to define the quality of the output result (i.e., numerical value) r on the data set D. The sensitivity Δq of the utility function refers to the maximum difference between the results of the utility function on two data sets D and D' that differ by one data point, where the data set D' differs from the data set D by one data point.

[0079] Step (2): Determine the selection probability of each enumeration value based on the utility function and sensitivity.

[0080] In the present disclosure, in conjunction with the definition of the exponential mechanism, the function e can be considered x The functional form of The probability of each enumeration value being selected is calculated and normalized to obtain the selection probability of each enumeration value, where ε is the privacy budget.

[0081] Step (3): According to the selection probabilities of the multiple enumeration values, select an enumeration value from the multiple enumeration values ​​as the target enumeration value.

[0082] The specific implementation of determining the utility function of the exponential mechanism matching the type of the aggregation function according to multiple enumeration values ​​in the above step (1) is described in detail below.

[0083] Specifically, different utility functions may be used for different types of aggregation functions. In one embodiment, when the type of the aggregation function indicates that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a max function, a utility function may be constructed based on multiple enumeration values ​​so that the result of the utility function is positively correlated with the enumeration value.

[0084] In the present disclosure, when the type of the aggregation function represents that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a max function, multiple enumeration values ​​can be deduplicated first, and then a utility function can be constructed based on the multiple enumeration values ​​obtained after the deduplication process, so that the result of the utility function is positively correlated with the enumeration value, that is, the larger the enumeration value, the larger the result of the corresponding utility function, that is, the higher the score of the enumeration value, the higher the probability of the enumeration value being selected, and the smaller the enumeration value, the smaller the result of the corresponding utility function, that is, the lower the score of the enumeration value, the lower the probability of the enumeration value being selected.

[0085] For example, there are ten enumeration values ​​obtained after deduplication processing. These ten enumeration values ​​can be arranged in ascending order to obtain a first sequence. Then, for each enumeration value obtained after deduplication processing, the serial number of the enumeration value in the first sequence is determined as the score of the enumeration value (that is, the result of the corresponding utility function).

[0086] Combined with the definition of the utility function in this implementation, it can be found that when a piece of data is added / deleted from the original data set, the change in the result of the utility function is at most 1, that is, the sensitivity of the utility function is 1.

[0087] In another embodiment, when the type of the aggregation function represents that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a min function, a utility function can be constructed according to multiple enumeration values ​​so that the result of the utility function is negatively correlated with the enumeration value.

[0088] When the type of the aggregation function represents that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a min function, multiple enumeration values ​​can be deduplicated first, and then a utility function can be constructed based on the multiple enumeration values ​​obtained after the deduplication process, so that the result of the utility function is negatively correlated with the enumeration value, that is, the smaller the enumeration value, the larger the result of the corresponding utility function, that is, the higher the score of the enumeration value, the higher the probability of the enumeration value being selected, and the larger the enumeration value, the smaller the result of the corresponding utility function, that is, the lower the score of the enumeration value, the lower the probability of the enumeration value being selected.

[0089] For example, there are ten enumeration values ​​obtained after deduplication processing. These ten enumeration values ​​can be arranged in order from large to small to obtain a second sequence. Then, for each enumeration value obtained after deduplication processing, the serial number of the enumeration value in the second sequence is determined as the score of the enumeration value.

[0090] Combined with the definition of the utility function in this implementation, it can be found that when a piece of data is added / deleted from the original data set, the change in the result of the utility function is at most 1, that is, the sensitivity of the utility function is 1.

[0091] In another embodiment, when the type of the aggregate function represents that the aggregate value of the aggregate function is obtained by calculation, the category of the expression in the aggregate function can be determined first, where the category is any one of the following: a physical column, a constant, and a combination of a physical column and a constant; then, based on the category of the expression in the aggregate function and multiple enumeration values, a utility function of an exponential mechanism that matches the type of the aggregate function is determined.

[0092] In the present disclosure, when the type of the aggregate function represents that the aggregate value of the aggregate function is obtained by calculation, different utility function construction methods can be selected according to different categories of expressions in the aggregate function.

[0093] Specifically, if the category of the expression in the aggregate function is a physical column, the occurrence frequency of each enumeration value is obtained; then, based on the occurrence frequency of each enumeration value, a utility function is constructed so that the result of the utility function is positively correlated with the occurrence frequency. That is,

[0094] In one implementation, when the category of the expression in the aggregate function is a physical column, for each enumeration value, the frequency of occurrence of the enumeration value can be determined as the result of the utility function corresponding to the enumeration value. That is, the more the frequency of occurrence of the enumeration value, the greater the result of the corresponding utility function, that is, the higher the score of the enumeration value, the higher the probability of the enumeration value being selected; the less the frequency of occurrence of the enumeration value, the smaller the result of the corresponding utility function, that is, the lower the score of the enumeration value, the lower the probability of the enumeration value being selected.

[0095] The occurrence frequency of each enumeration value may be obtained by statistical means, or the occurrence frequency of each enumeration value may be obtained according to the meta information of the physical column in the expression within the aggregate function.

[0096] For example, Figure 4As shown, the aggregate function is sum(if(val>1,val,val1)), where the aggregate function includes the physical column val and the physical column val1, and the values ​​of these two physical columns are both enumeration values. Then, the occurrence frequency of each enumeration value in the physical column val and the occurrence frequency of each enumeration value in the physical column val1 can be obtained first, and then, for each enumeration value, the sum of the occurrence frequency of the enumeration value in the physical column val and the occurrence frequency of the enumeration value in the physical column val1 is determined as the occurrence frequency of the enumeration value, and the occurrence frequency is determined as the score of the enumeration value.

[0097] For example, Figure 4 As shown, the aggregate function is sum(val), where the aggregate function includes a physical column val, and the value of the physical column is an enumeration value. The occurrence frequency of each enumeration value in the physical column val can be obtained first, and then, for each enumeration value, the occurrence frequency of the enumeration value in the physical column val is determined as the score of the enumeration value.

[0098] Combined with the definition of the utility function in this implementation, it can be found that when a piece of data is added / deleted from the original data set, the change in the result of the utility function is at most 1, that is, the sensitivity of the utility function is 1.

[0099] In another embodiment, when the category of the expression in the aggregate function is a constant (i.e., all the expressions in the aggregate function are fixed constants), the utility function is equal to the first preset value, i.e., the scores of the constants in the expression in the aggregate function are the same, i.e., they are all the first preset values.

[0100] For example, Figure 4 As shown, the aggregation function is sum(if(val>1,1,0)), and its expression includes constants 1 and 0. The scores of constants 1 and 0 (ie, the results of the corresponding utility functions) are both the first preset values, for example, 10 points.

[0101] Combined with the definition of the utility function in this implementation, it can be found that when a piece of data is added / deleted from the original data set, the change in the result of the utility function is at most 1, that is, the sensitivity of the utility function is 1.

[0102] In another embodiment, if the category of the expression in the aggregate function is a combination of a physical column and a constant, the frequency of occurrence of each enumeration value in the physical column can be obtained first; when the enumeration value is a constant and does not come from the physical column of the expression, the utility function is equal to the second preset value; for each enumeration value in the physical column of the expression, the product of the second preset value and the frequency of occurrence of the enumeration value is determined as the result of the utility function corresponding to the enumeration value.

[0103] In the present disclosure, when the category of the expression in the aggregate function is a combination of a physical column and a constant, the total score of the physical column is the same as the score of each constant, wherein each enumeration value in the physical column splits the total score according to the frequency of occurrence.

[0104] For example, Figure 4 As shown, the aggregation function is sum(if(val>1,val,0)), and its expression includes both the physical column val and the constant 0, wherein the physical column val includes five enumeration values, wherein the occurrence frequency of enumeration value A is 2, the occurrence frequency of enumeration value B is 3, and the second preset value is 5, then the score of constant 0 is 5 (ie, the second preset value), the score of enumeration value A is 5*(2 / 5)=2, and the score of enumeration value B is 5*(3 / 5)=3.

[0105] In particular, when the expression in the aggregate function includes multiple physical columns or multiple constants, the scores of the multiple constants are the same, and the total score of the multiple physical columns is the same as the score of each constant. The enumeration values ​​of the multiple physical columns can be merged, and each enumeration value splits the total score according to the frequency of occurrence.

[0106] Among them, the frequency of occurrence of each enumeration value in the physical column can be obtained in a statistical way, or the frequency of occurrence of each enumeration value and the total number of these enumeration values ​​can be first obtained according to the meta information of the physical column in the expression in the aggregate function, and then, for each enumeration value in the physical column, the quotient of the frequency of occurrence of the enumeration value in the physical column and the total number is determined as the frequency of occurrence of the enumeration value.

[0107] Combined with the definition of the utility function in this implementation, it can be found that when a piece of data is added / deleted from the original data set, the change in the result of the utility function is at most 1, that is, the sensitivity of the utility function is 1.

[0108] Figure 5 FIG. 1 is a block diagram of a differential privacy noise adding device for enumeration values ​​according to an exemplary embodiment. Figure 5 As shown, the differential privacy noise adding device 200 of the enumeration value may include:

[0109] A noise point identification module 201 is used for identifying an aggregate function to be noised in a structured query language SQL statement in response to receiving the statement;

[0110] The acquisition module 202 is used for obtaining, for each of the aggregation functions, a plurality of enumeration values ​​to be aggregated according to the expression of the aggregation function if the value of the expression in the aggregation function is an enumeration value; the selection module 203 is used for selecting a target enumeration value from the plurality of enumeration values ​​using an exponential mechanism matching the type of the aggregation function, wherein the type is used to characterize whether the aggregation value of the aggregation function is obtained by calculation; the generation module 204 is used for generating a noise-added result of the aggregation function according to the target enumeration value and the type of the aggregation function.

[0111] In the above technical scheme, after receiving a structured query language SQL statement, the aggregation function to be noised in the SQL statement is first identified; then, for each aggregation function to be noised in the SQL statement, if the value of the expression in the aggregation function is an enumeration value, a target enumeration value is selected from multiple enumeration values ​​to be aggregated using an index mechanism matching the type of the aggregation function, wherein the type is used to characterize whether the aggregation value of the aggregation function is obtained by calculation; and a noised result of the aggregation function is generated according to the target enumeration value and the type of the aggregation function. The differential privacy noised scheme of the enumeration value selects a target enumeration value from multiple enumeration values ​​to be aggregated using an index mechanism, and generates a noised result of the aggregation function based on the target enumeration value, so that the noise of the aggregation function whose expression value is an enumeration value can be controlled within the range of the candidate set of values ​​of the expression in the aggregation function (including multiple enumeration values ​​to be aggregated) by using the index mechanism, so that the differential privacy noised process is efficient and controllable, and the availability of the noised result can be guaranteed without affecting security.

[0112] Optionally, the selection module 203 includes:

[0113] A first determination submodule, configured to determine, according to the plurality of enumeration values, a utility function and a sensitivity of an exponential mechanism matching the type of the aggregation function;

[0114] A second determination submodule, configured to determine a selection probability of each of the enumerated values ​​according to the utility function and the sensitivity;

[0115] The selection submodule is used to select an enumeration value from the multiple enumeration values ​​as the target enumeration value according to the selection probabilities of the multiple enumeration values ​​respectively.

[0116] Optionally, the first determining submodule includes:

[0117] The third determination submodule is used to construct the utility function according to the multiple enumeration values ​​when the type of the aggregation function represents that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a max function, so that the result of the utility function is positively correlated with the enumeration value.

[0118] Optionally, the first determining submodule further includes:

[0119] The fourth determination submodule is used to construct the utility function according to the multiple enumeration values ​​when the type of the aggregation function represents that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a min function, so that the result of the utility function is negatively correlated with the enumeration value.

[0120] Optionally, the first determining submodule further includes:

[0121] a fifth determination submodule, configured to determine a category of an expression within the aggregate function when the type of the aggregate function represents that the aggregate value of the aggregate function is obtained by calculation, wherein the category is any one of the following: a physical column, a constant, or a combination of a physical column and a constant;

[0122] The sixth determination submodule is configured to determine the utility function according to the category and the multiple enumeration values.

[0123] Optionally, the determining submodule according to the sixth step includes:

[0124] A first acquisition submodule, configured to acquire the occurrence frequency of each of the enumeration values ​​if the category is the physical column;

[0125] The first construction submodule is used to construct the utility function according to the occurrence frequency of each of the enumeration values, so that the result of the utility function is positively correlated with the occurrence frequency.

[0126] Optionally, the sixth determining submodule further includes:

[0127] The second construction submodule is used for, if the category is the constant, then the utility function is equal to a first preset value.

[0128] Optionally, the sixth determining submodule further includes:

[0129] A second acquisition submodule, configured to acquire the occurrence frequency of each enumeration value in the physical column if the category is a combination of a physical column and a constant;

[0130] A third construction submodule, configured to, when the enumeration value is the constant and is not from a physical column of the expression, equal the utility function to a second preset value;

[0131] The fourth construction submodule is used to determine, for each enumeration value in the physical column of the expression, the product of the second preset value and the occurrence frequency of the enumeration value as the result of the utility function corresponding to the enumeration value.

[0132] Optionally, the acquisition module 202 includes:

[0133] A replacement submodule, used for replacing the aggregation function with a preset user-defined aggregation function UDAF when the aggregation value of the type characterizing the aggregation function is not obtained by calculation, wherein the parameters of the UDAF include the expression;

[0134] The third acquisition submodule is used to acquire multiple enumeration values ​​to be aggregated according to the expression of the UDAF.

[0135] Optionally, the generating module 204 includes:

[0136] The seventh determination submodule is used to determine the target enumeration value as the aggregate value of the aggregate function after adding noise if the aggregate value representing the type of the aggregate function is not obtained by calculation.

[0137] Optionally, the generating module 204 further includes:

[0138] The noise adding submodule is used to add the target enumeration value as a noise value to the expression of the aggregation function if the aggregation value representing the type of the aggregation function is obtained by calculation, so as to obtain the noise added result of the aggregation function.

[0139] Optionally, the differential privacy noise adding device 200 for enumerated values ​​further includes:

[0140] A first determination module is used for determining, if the aggregation function is a max function or a min function, that the type of the aggregation function represents that the aggregation value of the aggregation function is not obtained by calculation;

[0141] The second determination module is used to determine the type of the aggregation function if the aggregation function is any one of the avg function, the sum function, the var function and the standard deviation function, and the aggregation value of the aggregation function is obtained by calculation.

[0142] The present disclosure also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the differential privacy noising method for enumeration values ​​provided by the present disclosure.

[0143] The present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the differential privacy noisy method for enumeration values ​​provided by the present disclosure.

[0144] Reference below Figure 6, which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 600 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, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0145] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0146] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0147] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0148] It should be noted that 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. More specific examples of 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. In the present disclosure, 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. In the present disclosure, 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.

[0149] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and 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 future developed network.

[0150] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0151] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: in response to receiving a structured query language SQL statement, identifies the aggregate function to be noised in the SQL statement; for each of the aggregate functions, if the value of the expression in the aggregate function is an enumeration value, obtains multiple enumeration values ​​to be aggregated according to the expression of the aggregate function; selects a target enumeration value from the multiple enumeration values ​​using an index mechanism matching the type of the aggregate function, wherein the type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation; and generates the noised result of the aggregate function according to the target enumeration value and the type of the aggregate function.

[0152] Computer program code for performing the operations of the present disclosure 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. In cases involving a remote computer, the remote computer may be connected to the user's computer through 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).

[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, 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. It should also be noted that in some implementations as replacements, 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. It should also be noted that 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.

[0154] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the selection module may also be described as "a module for selecting a target enumeration value from the multiple enumeration values ​​using an index mechanism that matches the type of the aggregation function".

[0155] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0156] In the context of the present disclosure, 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.

[0157] According to one or more embodiments of the present disclosure, Example 1 provides a differential privacy noise adding method for enumeration values, the method comprising:

[0158] In response to receiving a structured query language SQL statement, identifying an aggregate function to be noised in the SQL statement;

[0159] For each of the aggregate functions, if the value of the expression in the aggregate function is an enumeration value, then according to the expression of the aggregate function, multiple enumeration values ​​to be aggregated are obtained; a target enumeration value is selected from the multiple enumeration values ​​using an index mechanism that matches the type of the aggregate function, wherein the type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation; and according to the target enumeration value and the type of the aggregate function, a noise-added result of the aggregate function is generated.

[0160] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein selecting a target enumeration value from the multiple enumeration values ​​using an index mechanism matching the type of the aggregate function includes:

[0161] Determine, according to the plurality of enumerated values, a utility function and a sensitivity of an index mechanism matching the type of the aggregation function;

[0162] Determining a selection probability of each of the enumerated values ​​according to the utility function and the sensitivity;

[0163] According to the selection probabilities of the respective enumeration values, an enumeration value is selected from the multiple enumeration values ​​as the target enumeration value.

[0164] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein determining, according to the multiple enumeration values, a utility function of an exponential mechanism matching the type of the aggregation function includes:

[0165] When the type of the aggregation function indicates that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a max function, the utility function is constructed according to the multiple enumeration values ​​so that a result of the utility function is positively correlated with the enumeration values.

[0166] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein determining, according to the multiple enumeration values, a utility function of an exponential mechanism matching the type of the aggregation function further includes:

[0167] When the type of the aggregation function indicates that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a min function, the utility function is constructed according to the multiple enumeration values ​​so that the result of the utility function is negatively correlated with the enumeration value.

[0168] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 3, wherein determining, according to the multiple enumeration values, a utility function of an exponential mechanism matching the type of the aggregation function further includes:

[0169] When the type of the aggregate function represents that the aggregate value of the aggregate function is obtained by calculation, determining the category of the expression in the aggregate function, wherein the category is any one of the following: a physical column, a constant, or a combination of a physical column and a constant;

[0170] The utility function is determined based on the category and the plurality of enumerated values.

[0171] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein determining the utility function according to the category and the multiple enumeration values ​​includes:

[0172] If the category is the physical column, obtaining the occurrence frequency of each of the enumeration values;

[0173] The utility function is constructed according to the occurrence frequency of each of the enumeration values, so that a result of the utility function is positively correlated with the occurrence frequency.

[0174] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein determining the utility function according to the category and the multiple enumeration values ​​further includes:

[0175] If the category is the constant, the utility function is equal to a first preset value.

[0176] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 6, wherein determining the utility function according to the category and the multiple enumeration values ​​further includes:

[0177] If the category is a combination of a physical column and a constant, obtaining the occurrence frequency of each enumeration value in the physical column;

[0178] When the enumeration value is the constant and is not from the physical column of the expression, the utility function is equal to a second preset value;

[0179] For each enumeration value in the physical column of the expression, the product of the second preset value and the occurrence frequency of the enumeration value is determined as the result of the utility function corresponding to the enumeration value.

[0180] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 1, wherein obtaining multiple enumeration values ​​to be aggregated according to the expression of the aggregation function includes:

[0181] When the type characterizes that the aggregate value of the aggregate function is not obtained by calculation, the aggregate function is replaced with a preset user-defined aggregate function UDAF, wherein the parameters of the UDAF include the expression;

[0182] According to the UDAF expression, multiple enumeration values ​​to be aggregated are obtained.

[0183] According to one or more embodiments of the present disclosure, Example 10 provides the method of Example 1, wherein generating a noise-added result of the aggregate function according to the target enumeration value and the type of the aggregate function includes:

[0184] If the type characterizing the aggregate value of the aggregate function is not obtained by calculation, the target enumeration value is determined as the aggregate value of the aggregate function after adding noise.

[0185] According to one or more embodiments of the present disclosure, Example 11 provides the method of Example 10, wherein generating a noise-added result of the aggregate function according to the target enumeration value and the type of the aggregate function further includes:

[0186] If the type represents an aggregate value of the aggregate function obtained by calculation, the target enumeration value is added as a noise value to the expression of the aggregate function to obtain a noise-added result of the aggregate function.

[0187] According to one or more embodiments of the present disclosure, Example 12 provides the method of any one of Examples 1-11, wherein the method further includes:

[0188] If the aggregate function is a max function or a min function, determining the type of the aggregate function indicates that the aggregate value of the aggregate function is not obtained by calculation;

[0189] If the aggregation function is any one of an avg function, a sum function, a var function, and a standard deviation function, then determining the type of the aggregation function represents an aggregation value of the aggregation function obtained by calculation.

[0190] According to one or more embodiments of the present disclosure, Example 13 provides a differential privacy noise adding device for enumeration values, the device comprising:

[0191] A noise point identification module, configured to identify, in response to receiving a structured query language SQL statement, an aggregate function to be noised in the SQL statement;

[0192] An acquisition module is used for obtaining, for each of the aggregate functions, a plurality of enumeration values ​​to be aggregated according to the expression of the aggregate function if the value of the expression in the aggregate function is an enumeration value; a selection module is used for selecting a target enumeration value from the plurality of enumeration values ​​using an exponential mechanism that matches the type of the aggregate function, wherein the type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation; a generation module is used for generating a noise-added result of the aggregate function according to the target enumeration value and the type of the aggregate function.

[0193] According to one or more embodiments of the present disclosure, Example 14 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-12 when executed by a processing device.

[0194] According to one or more embodiments of the present disclosure, Example 15 provides an electronic device, including:

[0195] a storage device having a computer program stored thereon;

[0196] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-12.

[0197] According to one or more embodiments of the present disclosure, Example 16 provides a computer program product, including a computer program, which implements the steps of any one of the methods of Examples 1-12 when executed by a processor.

[0198] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0199] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0200] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A differential privacy noise adding method for enumeration values, characterized in that: The method comprises: In response to receiving a structured query language SQL statement, identifying an aggregate function to be noised in the SQL statement; For each of the aggregate functions, if the value of the expression in the aggregate function is an enumeration value, then according to the expression of the aggregate function, multiple enumeration values ​​to be aggregated are obtained; a target enumeration value is selected from the multiple enumeration values ​​using an index mechanism that matches the type of the aggregate function, wherein the type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation; and according to the target enumeration value and the type of the aggregate function, a noise-added result of the aggregate function is generated.

2. The method according to claim 1, characterized in that: The selecting a target enumeration value from the multiple enumeration values ​​using an index mechanism matching the type of the aggregate function includes: Determine, according to the plurality of enumerated values, a utility function and a sensitivity of an index mechanism matching the type of the aggregation function; Determining a selection probability of each of the enumerated values ​​according to the utility function and the sensitivity; According to the selection probabilities of the respective enumeration values, an enumeration value is selected from the multiple enumeration values ​​as the target enumeration value.

3. The method according to claim 2, characterized in that The step of determining, according to the multiple enumeration values, a utility function of an exponential mechanism that matches the type of the aggregation function comprises: When the type of the aggregation function indicates that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a max function, the utility function is constructed according to the multiple enumeration values ​​so that the result of the utility function is positively correlated with the enumeration value.

4. The method according to claim 3, characterized in that The step of determining, according to the plurality of enumeration values, a utility function of an exponential mechanism matching the type of the aggregation function further includes: When the type of the aggregation function indicates that the aggregation value of the aggregation function is not obtained by calculation and the aggregation function is a min function, the utility function is constructed according to the multiple enumeration values ​​so that the result of the utility function is negatively correlated with the enumeration value.

5. The method according to claim 3, characterized in that: The step of determining, according to the plurality of enumeration values, a utility function of an exponential mechanism matching the type of the aggregation function further includes: When the type of the aggregate function represents that the aggregate value of the aggregate function is obtained by calculation, determining the category of the expression in the aggregate function, wherein the category is any one of the following: a physical column, a constant, or a combination of a physical column and a constant; The utility function is determined based on the category and the plurality of enumerated values.

6. The method according to claim 5, characterized in that Determining the utility function according to the category and the plurality of enumeration values ​​comprises: If the category is the physical column, obtaining the occurrence frequency of each of the enumeration values; The utility function is constructed according to the occurrence frequency of each of the enumeration values, so that a result of the utility function is positively correlated with the occurrence frequency.

7. The method according to claim 6, characterized in that The determining the utility function according to the category and the plurality of enumeration values ​​further comprises: If the category is the constant, the utility function is equal to a first preset value.

8. The method according to claim 6, characterized in that The determining the utility function according to the category and the plurality of enumeration values ​​further comprises: If the category is a combination of a physical column and a constant, obtaining the occurrence frequency of each enumeration value in the physical column; When the enumeration value is the constant and is not from the physical column of the expression, the utility function is equal to a second preset value; For each enumeration value in the physical column of the expression, the product of the second preset value and the occurrence frequency of the enumeration value is determined as the result of the utility function corresponding to the enumeration value.

9. The method according to claim 1, characterized in that: The step of obtaining multiple enumeration values ​​to be aggregated according to the expression of the aggregation function includes: When the type characterizes that the aggregate value of the aggregate function is not obtained by calculation, the aggregate function is replaced with a preset user-defined aggregate function UDAF, wherein the parameters of the UDAF include the expression; According to the UDAF expression, multiple enumeration values ​​to be aggregated are obtained.

10. The method according to claim 1, characterized in that The generating a noise-added result of the aggregate function according to the target enumeration value and the type of the aggregate function includes: If the type characterizing the aggregate value of the aggregate function is not obtained by calculation, the target enumeration value is determined as the aggregate value of the aggregate function after adding noise.

11. The method according to claim 10, characterized in that The step of generating a noise-added result of the aggregate function according to the target enumeration value and the type of the aggregate function further includes: If the type represents an aggregate value of the aggregate function obtained by calculation, the target enumeration value is added as a noise value to the expression of the aggregate function to obtain a noise-added result of the aggregate function.

12. The method according to any one of claims 1 to 11, characterized in that The method further comprises: If the aggregate function is a max function or a min function, determining the type of the aggregate function indicates that the aggregate value of the aggregate function is not obtained by calculation; If the aggregation function is any one of an avg function, a sum function, a var function, and a standard deviation function, then determining the type of the aggregation function represents an aggregation value of the aggregation function obtained by calculation.

13. A differential privacy noise adding device for enumeration values, characterized in that: The device comprises: A noise point identification module, configured to identify, in response to receiving a structured query language SQL statement, an aggregate function to be noised in the SQL statement; An acquisition module is used for obtaining, for each of the aggregate functions, a plurality of enumeration values ​​to be aggregated according to the expression of the aggregate function if the value of the expression in the aggregate function is an enumeration value; a selection module is used for selecting a target enumeration value from the plurality of enumeration values ​​using an exponential mechanism that matches the type of the aggregate function, wherein the type is used to characterize whether the aggregate value of the aggregate function is obtained by calculation; a generation module is used for generating a noise-added result of the aggregate function according to the target enumeration value and the type of the aggregate function.

14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 12 are implemented.

15. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 12.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.