# US 2021/0173856 A1 · Maintaining differential privacy for database query results

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0173856 A1
- Document ID: US20210173856A1
- Status: Published application
- Kind: A1
- Application number: 16/708,307
- Filed: 2019-12-09
- Published: 2021-06-10
- Earliest claimed: 2019-12-09
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Mona CHITNIS; Abhishek BHOWMICK; Lucas O. WINSTROM; Koray MANCUHAN; Stephen D. FLEISCHER
- Web page: https://patentgrep.com/patent/US20210173856A1

## CPC

- G06F 16/335: Filtering based on additional data, e.g. user or group profiles (filtering in web context G06F16/9535, G06F16/9536)
- G06F 21/6227: {where protection concerns the structure of data, e.g. records, types, queries}
- G06F 16/168: {Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs (query results presentation G06F16/156)}
- G06F 16/3331: Query processing
- G06F 16/338: Presentation of query results
- G06F 21/6218: {to a system of files or objects, e.g. local or distributed file system or database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The subject technology for maintaining differential privacy for database query results receives a query for a database that contains user data. The subject technology determines that the query is permitted for the database based at least in part on a privacy policy associated with the database. The subject technology determines that performing the query will not exceed a query budget for the database. The subject technology, when the query is permitted and performing the query will not exceed the query budget, performs the query on the database and receiving results from the query. The subject technology selects a differential privacy algorithm for the results based at least in part on a query type of the query. The subject technology applies the selected differential privacy algorithm to the results to generate differentially private results. The subject technology provides the differentially private results.

## Claims

### Claim 1

A method comprising:
receiving a query for a database, the database comprising user data;
determining that the query is permitted for the database based at least in part on a privacy policy associated with the database;
determining that performing the query will not exceed a query budget for the database, the query budget being depleted based at least in part on a number of queries performed on the database;
when the query is permitted and performing the query will not exceed the query budget, performing the query on the database and receiving results from the query;
selecting a differential privacy algorithm for the results based at least in part on a query type of the query;
applying the selected differential privacy algorithm to the results to generate differentially private results; and
providing the differentially private results.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining that the query is permitted under the privacy policy further comprises:
generating a second query based on the query;
performing the second query on the database;
receiving second results from the second query from the database; and
determining that the second results from the second query are compliant with the privacy policy based at least in part on whether the second results include information that correspond to a threshold number of individuals.

### Claim 3 (depends on 2)

The method of claim 2, wherein the number of individuals are greater than a threshold number indicating that the second results are compliant with the privacy policy.

### Claim 4 (depends on 1)

The method of claim 1, wherein determining that the query can be performed based on the query budget further comprises:
receiving the query budget corresponding to at least a number of queries that are allowed to be performed on the database during a period of time;
determining a current query budget based at least in part on a number of previous queries performed during the period of time;
determining that the query can be performed based on the current query; and
adjusting the current query based on a budget cost associated with performing the query.

### Claim 5 (depends on 4)

The method of claim 4, wherein the query budget further corresponds to particular types of operations performed on the database, and each type of operation is associated with a respective cost for performing each type of operation.

### Claim 6 (depends on 4)

The method of claim 4, wherein the period of time corresponds to a duration of a healthcare study.

### Claim 7 (depends on 1)

The method of claim 1, wherein the query is received from a graphical user interface (GUI) tool or a command line interface (CLI) tool.

### Claim 8 (depends on 1)

The method of claim 1, wherein generating differential privacy information is based on a type of query corresponding to the received query.

### Claim 9 (depends on 8)

The method of claim 8, wherein the type of query includes an operation, the operation comprising one of a sum, count, maximum, average, median, or histogram.

### Claim 10 (depends on 1)

The method of claim 1, wherein the database includes health information.

### Claim 11

A system comprising;
a processor; and
a memory device containing instructions, which when executed by the processor cause the processor to:
receive a query for a database, the database comprising user data;
determine that the query is permitted for the database based at least in part on a privacy policy associated with the database;
determine that performing the query will not exceed a query budget for the database, the query budget being depleted based at least in part on a number of queries performed on the database;
when the query is permitted and performing the query will not exceed the query budget, performing the query on the database and receiving results from the query;
select a differential privacy algorithm for the results based at least in part on a query type of the query;
apply the selected differential privacy algorithm to the results to generate differentially private results; and
provide the differentially private results.

### Claim 12 (depends on 11)

The system of claim 11, wherein to determine that the query is permitted under the privacy policy further causes the processor to:
generate a second query based on the query;
perform the second query on the database;
receive second results from the second query from the database; and
determine that the second results from the second query are compliant with the privacy policy based at least in part on whether the second results include information that correspond to a threshold number of individuals.

### Claim 13 (depends on 12)

The system of claim 12, wherein the number of individuals are greater than a threshold number indicating that the second results are compliant with the privacy policy.

### Claim 14 (depends on 11)

The system of claim 11, wherein further causes the processor to:
receive a query budget corresponding to at least a number of queries that are allowed to be performed on the database during a period of time;
determine a current query budget based at least in part on a number of previous queries performed during the period of time;
determine that the query can be performed based on the current query; and
adjust the current query based on a budget cost associated with performing the query.

### Claim 15 (depends on 14)

The system of claim 14, wherein the query budget further corresponds to particular types of operations performed on the database, and each type of operation is associated with a respective cost for performing each type of operation.

### Claim 16 (depends on 14)

The system of claim 14, wherein the period of time corresponds to a duration of a healthcare study.

### Claim 17 (depends on 11)

The system of claim 11, wherein the query is received from a graphical user interface (GUI) tool or a command line interface (CLI) tool.

### Claim 18 (depends on 11)

The system of claim 11, wherein to generate differential privacy information is based on a type of query corresponding to the received query.

### Claim 19 (depends on 18)

The system of claim 18, wherein the type of query includes an operation, the operation comprising one of a sum, count, maximum, average, median, or histogram.

### Claim 20

A non-transitory computer-readable medium comprising instructions, which when executed by a computing device, cause the computing device to perform operations comprising:
receiving a query for a database, the database comprising user data;
determining that the query is permitted for the database based at least in part on a privacy policy associated with the database;
determining that performing the query will not exceed a query budget for the database, the query budget being depleted based at least in part on a number of queries performed on the database;
when the query is permitted and performing the query will not exceed the query budget, performing the query on the database and receiving results from the query;
selecting a differential privacy algorithm for the results based at least in part on a query type of the query;
applying the selected differential privacy algorithm to the results to generate differentially private results; and
providing the differentially private results.
