# US 11,442,949 B2 · Semantic search of application rules

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

- Number: US 11,442,949 B2
- Document ID: US11442949B2
- Status: Granted
- Kind: B2
- Application number: 16/571,561
- Filed: 2019-09-16
- Published: 2021-03-18
- Granted: 2022-09-13
- Earliest claimed: 2019-09-16
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Wei Chen
- Web page: https://patentgrep.com/patent/US11442949B2

## CPC

- G06F 16/24564: {Applying rules; Deductive queries}
- G06F 16/2462: {Approximate or statistical queries}
- G06F 16/2246: {Trees, e.g. B+trees}
- G06F 16/24557: {Efficient disk access during query execution}
- G06F 16/24561: {Intermediate data storage techniques for performance improvement}
- G06F 16/24565: {Triggers; Constraints}
- G06F 16/248: Presentation of query results
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Various examples are directed to systems and methods for searching application rules. A rule management system may access application rule data describing a first application rule and generate a first textual summary of the first application rule. The rule management system may encode the first textual summary to generate a first rule vector. The rule management system may receive a application rule query. The application rule query may include a query description. The rule management system may encode the query description to generate a first query vector and select the first application rule as responsive to the application rule query using the first rule vector and the first query vector. The rule management system may return the first application rule in response to the application rule query.

## Claims

### Claim 1

A system for searching application rules, the system comprising:
a processor; and
a non-transitory machine-readable medium having instructions stored thereon that, when executed by the processor, cause the processor to perform operations comprising:
accessing application rule data describing a first application rule;
generating a textual summary of the first application rule;
encoding the textual summary of the first application rule to generate a first rule vector;
receiving an application rule query, the application rule query including a query description;
encoding the query description to generate a first query vector;
selecting the first application rule as responsive to the application rule query using the first rule vector and the first query vector; and
returning the first application rule in response to the application rule query.

### Claim 2 (depends on 1)

The system of claim 1, wherein generating the textual summary of the first application rule comprises:
identifying at least one action indicated by the first application rule;
identifying at least one condition indicated by the first application rule;
applying an action template to a first action of the at least one action to generate a textual summary of the first action; and
applying a condition template to a first condition of the at least one condition to generate a textual summary of the first condition.

### Claim 3 (depends on 2)

The system of claim 2, wherein the textual summary of the first application rule is based at least in part on the textual summary of the first action and the textual summary of the first condition.

### Claim 4 (depends on 2)

The system of claim 2, wherein generating the textual summary of the first application rule further comprises:
applying an action template to a second action of the at least one action to generate a textual summary of the second action;
determining that the first action and the second action are equivalent actions; and
using the textual summary of the first action to generate a combined textual summary of the first action and the second action, wherein textual summary of the first application rule is based at least in part on the combined textual summary.

### Claim 5 (depends on 2)

The system of claim 2, wherein generating the textual summary of the first application rule further comprises:
generating a syntax tree representing the first application rule; and
traversing the syntax tree to identify the at least one action indicated by the first application rule and the at least one condition indicated by the first application rule.

### Claim 6 (depends on 2)

The system of claim 2, wherein generating the textual summary of the first application rule further comprises applying a merge template using at least the textual summary of the first action and the textual summary of the first condition to generate the query description.

### Claim 7 (depends on 1)

The system of claim 1, the operations further comprising:
generating a first application rule data structure for the first application rule, the first application rule data structure comprising a computer-readable syntax of the first application rule, the query description, and the first rule vector; and
storing the first application rule data structure at an application rule database.

### Claim 8 (depends on 7)

The system of claim 7, the operations further comprising storing the first application rule data structure at the application rule database, wherein selecting the first application rule as responsive to the application rule query comprises prompting a database management system of the application rule database to execute a vector comparison function to compare the first rule vector and the first query vector.

### Claim 9 (depends on 1)

The system of claim 1, wherein selecting the first application rule as responsive to the application rule query comprises determining a cosine similarity between the first rule vector and the first query vector.

### Claim 10

A method of searching application rules, comprising:
accessing, by a rule management system, application rule data describing a first application rule, the rule management system comprising at least one processor;
generating, by the rule management system, a textual summary of the first application rule;
encoding the textual summary of the first application rule, by the rule management system, to generate a first rule vector;
receiving an application rule query, by the rule management system, the application rule query including a query description;
encoding the query description, by the rule management system, to generate a first query vector;
selecting, by the rule management system, the first application rule as responsive to the application rule query using the first rule vector and the first query vector; and
returning, by the rule management system, the first application rule in response to the application rule query.

### Claim 11 (depends on 10)

The method of claim 10, wherein generating the textual summary of the first application rule comprises:
identifying at least one action indicated by the first application rule;
identifying at least one condition indicated by the first application rule;
applying an action template to a first action of the at least one action to generate a textual summary of the first action; and
applying a condition template to a first condition of the at least one condition to generate a textual summary of the first condition.

### Claim 12 (depends on 11)

The method of claim 11, wherein the textual summary of the first application rule is based at least in part on the textual summary of the first action and the textual summary of the first condition.

### Claim 13 (depends on 11)

The method of claim 11, wherein generating the textual summary of the first application rule further comprises:
applying an action template to a second action of the at least one action to generate a textual summary of the second action;
determining that the first action and the second action are equivalent actions; and
using the textual summary of the first action to generate a combined textual summary of the first action and the second action, wherein textual summary of the first application rule is based at least in part on the combined textual summary.

### Claim 14 (depends on 11)

The method of claim 11, wherein generating the textual summary of the first application rule further comprises:
generating a syntax tree representing the first application rule; and
traversing the syntax tree to identify the at least one action indicated by the first application rule and the at least one condition indicated by the first application rule.

### Claim 15 (depends on 11)

The method of claim 11, wherein generating the textual summary of the first application rule further comprises applying a merge template using at least the textual summary of the first action and the textual summary of the first condition to generate the query description.

### Claim 16 (depends on 10)

The method of claim 10, further comprising:
generating a first application rule data structure for the first application rule, the first application rule data structure comprising a computer-readable syntax of the first application rule, the query description, and the first rule vector; and
storing the first application rule data structure at an application rule database.

### Claim 17 (depends on 16)

The method of claim 16, further comprising storing the first application rule data structure at the application rule database, wherein selecting the first application rule as responsive to the application rule query comprises prompting a database management system of the application rule database to execute a vector comparison function to compare the first rule vector and the first query vector.

### Claim 18 (depends on 10)

The method of claim 10, wherein selecting the first application rule as responsive to the application rule query comprises determining a cosine similarity between the first rule vector and the first query vector.

### Claim 19

A non-transitory machine-readable medium having instructions stored thereon that, when executed by at least one processor, cause the at least one processor to perform operations comprising:
accessing application rule data describing a first application rule;
generating a textual summary of the first application rule;
encoding the textual summary of the first application rule to generate a first rule vector;
receiving an application rule query, the application rule query including a query description;
encoding the query description to generate a first query vector;
selecting the first application rule as responsive to the application rule query using the first rule vector and the first query vector; and
returning the first application rule in response to the application rule query.

### Claim 20 (depends on 19)

The machine-readable medium of claim 19, wherein generating the textual summary of the first application rule comprises:
identifying at least one action indicated by the first application rule;
identifying at least one condition indicated by the first application rule;
applying an action template to a first action of the at least one action to generate a textual summary of the first action; and
applying a condition template to a first condition of the at least one condition to generate a textual summary of the first condition.
