# US 11,120,025 B2 · System and method for comparing and selectively merging database records

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

- Number: US 11,120,025 B2
- Document ID: US11120025B2
- Status: Granted
- Kind: B2
- Application number: 16/104,361
- Filed: 2018-08-17
- Published: 2019-12-19
- Granted: 2021-09-14
- Earliest claimed: 2018-06-16
- Assignees: Hexagon Technology Center GmbH
- Applicants: Hexagon Technology Center GmbH
- Inventors: Pradeep Reddy Bobbala; Srinivas Mallepally; Satish Subramanya Hota
- Web page: https://patentgrep.com/patent/US11120025B2

## CPC

- G06F 16/2456: {Join operations}
- G06F 7/14: Merging, i.e. combining at least two sets of record carriers each arranged in the same ordered sequence to produce a single set having the same ordered sequence
- G06F 16/21: Design, administration or maintenance of databases
- G06F 16/212: {with details for data modelling support}
- G06F 16/214: {Database migration support}
- G06F 16/215: Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of the present invention allow a Source database and a Target database to be compared and merged in such a way that logically relevant data is considered and merged while ignoring irrelevant differences (e.g., object identifiers) and that all dependencies across relational database tables are considered and merged. Some exemplary embodiments are discussed herein with reference to databases such as the Standard Database (SDB) for Intergraph Smart™ Reference Data product from Intergraph Corporation and are referred to generally as the “SDB Merge Tool,” although the disclosed concepts can be applied more generally to other types of databases.

## Claims

### Claim 1

A method of merging an object from a source database to a target database, the object associated with data stored in a plurality of relational database tables in the source database, the method comprising:
obtaining a primary key for the object, wherein the object is a child object in the source database;
querying the source database using the primary key for the child object to obtain a primary key value from a first relational database table, wherein the first relational database table includes a parent key associated with the primary key value as a reference to a parent key value in a parent object stored in a second relational database table; and, after querying the source database using the primary key for the child object to obtain the primary key value, further comprising:
identifying the parent object associated with the child object based on the parent key from the first relational database table, the parent object associated with the second relational database table;
obtaining the parent key for the identified parent object from the first relational database table;
querying the source database using the obtained parent key to obtain the parent key value from the second relational database table;
querying the target database using the obtained parent key value to determine whether the target database includes an existing parent object record with the parent key value;
when the target database does not include an existing parent object record with the parent key value, assigning a parent key for the parent key value and adding a parent object record to the target database including the parent key value and the parent key and then adding an object record to the target database including the primary key value and the parent key as a reference to the parent key value in the added parent object record, wherein the parent key for the parent key value in the target database is assigned independently of the parent key for the parent key value in the source database; and
when the target database does include an existing parent object record with the parent key value, obtaining from the existing parent object record a parent key associated with the parent key value and adding an object record to the target database including the primary key value and the parent key obtained from the existing parent object record as a reference to the parent key value in the existing parent object record.

### Claim 2 (depends on 1)

The method of claim 1, wherein querying the source database using the parent key to obtain a parent key value from the second relational database comprises:
joining the first and second relational database tables.

### Claim 3 (depends on 1)

The method of claim 1, wherein adding the parent object record to the target database including the parent key value comprises:
assigning an identifier for the parent key value, wherein the identifier is unique within the target database and is assigned independently of a corresponding identifier for the parent key value in the source database.

### Claim 4 (depends on 3)

The method of claim 3, wherein the reference to the parent key value includes the unique identifier assigned for the parent key value.

### Claim 5 (depends on 1)

The method of claim 1, wherein adding the object record to the target database comprises:
assigning an identifier for the primary key value, wherein the identifier is unique within the target database and is assigned independently of a corresponding identifier for the primary key value in the source database.

### Claim 6 (depends on 5)

The method of claim 5, wherein, when the parent key value does exist in a parent object record in the target database, the reference to the parent key value includes an identifier associated with the existing parent key value.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
maintaining a configuration file that describes the data stored in the plurality of relational database tables including the primary key for the object and relationships between the plurality of relational database tables, wherein the primary key for the object, identification of the parent object, and the parent key are obtained from the configuration file.

### Claim 8

A database system comprising:
a plurality of relational database tables; and
a merge tool having program code that, when executed by at least one processor of the database system, causes the database system to perform computer processes comprising:
obtaining a primary key for the object, wherein the object is a child object in the source database;
querying the source database using the primary key for the child object to obtain a primary key value from a first relational database table, wherein the first relational database table includes a parent key associated with the primary key value as a reference to a parent key value in a parent object stored in a second relational database table; and, after querying the source database using the primary key for the child object to obtain the primary key value, further comprising:
identifying the parent object associated with the child object based on the parent key from the first relational database table, the parent object associated with the second relational database table;
obtaining the parent key for the identified parent object from the first relational database table;
querying the source database using the obtained parent key to obtain the parent key value from the second relational database table;
querying the target database using the obtained parent key value to determine whether the target database includes an existing parent object record with the parent key value;
when the target database does not include an existing parent object record with the parent key value, assigning a parent key for the parent key value and adding a parent object record to the target database including the parent key value and the parent key and then adding an object record to the target database including the primary key value and the parent key as a reference to the parent key value in the added parent object record, wherein the parent key for the parent key value in the target database is assigned independently of the parent key for the parent key value in the source database; and
when the target database does include an existing parent object record with the parent key value, obtaining from the existing parent object record a parent key associated with the parent key value and adding an object record to the target database including the primary key value and the parent key obtained from the existing parent object record as a reference to the parent key value in the existing parent object record.

### Claim 9 (depends on 8)

The database system of claim 8, wherein querying the source database using the parent key to obtain a parent key value from the second relational database comprises:
joining the first and second relational database tables.

### Claim 10 (depends on 8)

The database system of claim 8, wherein adding the parent object record to the target database including the parent key value comprises:
assigning an identifier for the parent key value, wherein the identifier is unique within the target database and is assigned independently of a corresponding identifier for the parent key value in the source database.

### Claim 11 (depends on 10)

The database system of claim 10, wherein the reference to the parent key value includes the unique identifier assigned for the parent key value.

### Claim 12 (depends on 8)

The database system of claim 8, wherein adding the object record to the target database comprises:
assigning an identifier for the primary key value, wherein the identifier is unique within the target database and is assigned independently of a corresponding identifier for the primary key value in the source database.

### Claim 13 (depends on 12)

The database system of claim 12, wherein, when the parent key value does exist in a parent object record in the target database, the reference to the parent key value includes an identifier associated with the existing parent key value.

### Claim 14 (depends on 8)

The database system of claim 8, further comprising:
maintaining a configuration file that describes the data stored in the plurality of relational database tables including the primary key for the object and relationships between the plurality of relational database tables, wherein the primary key for the object, identification of the parent object, and the parent key are obtained from the configuration file.

### Claim 15

A computer program product comprising a tangible, non-transitory computer readable medium having embodied therein program code that, when executed by at least one processor of the database system, causes the database system to perform computer processes comprising:
obtaining a primary key for the object, wherein the object is a child object in the source database;
querying the source database using the primary key for the child object to obtain a primary key value from a first relational database table, wherein the first relational database table includes a parent key associated with the primary key value as a reference to a parent key value in a parent object stored in a second relational database table; and, after querying the source database using the primary key for the child object to obtain the primary key value, further comprising:
identifying the parent object associated with the child object based on the parent key from the first relational database table, the parent object associated with the second relational database table;
obtaining the parent key for the identified parent object from the first relational database table;
querying the source database using the obtained parent key to obtain the parent key value from the second relational database table;
querying the target database using the obtained parent key value to determine whether the target database includes an existing parent object record with the parent key value;
when the target database does not include an existing parent object record with the parent key value, assigning a parent key for the parent key value and adding a parent object record to the target database including the parent key value and the parent key and then adding an object record to the target database including the primary key value and the parent key as a reference to the parent key value in the added parent object record, wherein the parent key for the parent key value in the target database is assigned independently of the parent key for the parent key value in the source database; and
when the target database does include an existing parent object record with the parent key value, obtaining from the existing parent object record a parent key associated with the parent key value and adding an object record to the target database including the primary key value and the parent key obtained from the existing parent object record as a reference to the parent key value in the existing parent object record.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein querying the source database using the parent key to obtain a parent key value from the second relational database comprises:
joining the first and second relational database tables.

### Claim 17 (depends on 15)

The computer program product of claim 15, wherein adding the parent object record to the target database including the parent key value comprises:
assigning an identifier for the parent key value, wherein the identifier is unique within the target database and is assigned independently of a corresponding identifier for the parent key value in the source database.

### Claim 18 (depends on 17)

The computer program product of claim 17, wherein the reference to the parent key value includes the unique identifier assigned for the parent key value.

### Claim 19 (depends on 15)

The computer program product of claim 15, wherein adding the object record to the target database comprises:
assigning an identifier for the primary key value, wherein the identifier is unique within the target database and is assigned independently of a corresponding identifier for the primary key value in the source database.

### Claim 20 (depends on 19)

The computer program product of claim 19, wherein, when the parent key value does exist in a parent object record in the target database, the reference to the parent key value includes an identifier associated with the existing parent key value.

### Claim 21 (depends on 15)

The computer program product of claim 15, further comprising:
maintaining a configuration file that describes the data stored in the plurality of relational database tables including the primary key for the object and relationships between the plurality of relational database tables, wherein the primary key for the object, identification of the parent object, and the parent key are obtained from the configuration file.
