# US 2021/0279223 A1 · Processing method for changing time-series database table structure

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

- Number: US 2021/0279223 A1
- Document ID: US20210279223A1
- Status: Published application
- Kind: A1
- Application number: 17/265,278
- Filed: 2019-07-18
- Published: 2021-09-09
- Earliest claimed: 2018-08-03
- Assignees: Taos Data
- Applicants: Taos Data
- Inventors: Hongze CHENG; Shengliang GUAN; Haojun LIAO; Jianhui TAO
- Web page: https://patentgrep.com/patent/US20210279223A1

## CPC

- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/2477: {Temporal data queries}
- G06F 16/211: {Schema design and management}
- G06F 16/213: {with details for schema evolution support}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The invention discloses a processing method for process changing time-series database table structure, wherein comprising following steps: an application side generates a data table containing a table name ID, a schema version, and a column ID; when a data column is increased, the application side modifies a schema of the data table, increases the schema version, assigns a new column ID number to a newly increased column incrementally, and assigns a default value to the newly increased column; according to a data insertion request of the application side, a data node receives data of a schema version carrying a data table from the application side and writes the received data, wherein writing the received data comprises: storing the schema version of the data table carried by data from the application side by the data node, and writing the received data, and writing the received data; when the data node receives new data from the application side, comparing the schema version of the data table carried by the new data with a stored schema version of the same data table; and the data node writes data according to the comparison result. According to the method, the operation of changing the structure of a table can be completed instantly, the historical data does not need to be changed, new and old table structure definitions can be used in parallel, and the flexibility can be improved.

## Claims

### Claim 1

A processing method for changing time-series database table structure, wherein comprising the following steps:
an application side generates a data table containing a table name ID, a schema version, and a column ID; when a data column is increased, the application side modifies a schema of the data table, increases the schema version, assigns a new column ID number to a newly increased column incrementally, and assigns a default value to the newly increased column;
according to a data insertion request of the application side, a data node receives data of a schema version carrying a data table from the application side and writes the received data, wherein writing the received data comprises:
storing the schema version of the data table carried by data from the application side by the data node, and writing the received data;
when the data node receives new data from the application side, comparing the schema version of the data table carried by the new data with a stored schema version of the same data table;
and the data node writes the data according to a comparison result.

### Claim 2 (depends on 1)

The method of claim 1, wherein an increased schema version is modified from 0 or a certain number, each time the schema being modified, the scheme version is increased by 1.

### Claim 3 (depends on 1)

The method of claim 1, wherein the column ID starts to grow naturally from 0 or a certain number, wherein a corresponding column ID is not reused when a column is deleted.

### Claim 4 (depends on 1)

The method of claim 1, wherein if a column is deleted, the column is directly deleted from the data table.

### Claim 5 (depends on 1)

The method of claim 1, wherein when a name of a column is modified, any modification can be made as long as uniqueness of the name of the column in a table is guaranteed.

### Claim 6 (depends on 1)

The method of claim 1, wherein according to the comparison result between the schema version of the data table carried by the new data and the stored schema version of the same data table, the data node takes writing processing, comprising:
if it is consistent, directly write the data into a memory cache region;
if the schema version of the application side is less than the current schema version, handle it as an error; and if the schema version of the application side is greater than the current schema version, the data node takes the following steps:
a. storing all the data of a data sampler in a memory cache region to a disk;
b. obtaining the latest schema definition of the data sampler from the data table on the application side; and
c. after obtaining the latest schema definition, redistributing a new memory cache region, and writing data therein.

### Claim 7 (depends on 6)

The method of claim 6, wherein when data is written into a disk from the cache region, a new data block and corresponding index block information are established; the definition of the schema thereof is stored in the new data block or the index block.

### Claim 8 (depends on 1)

The method of claim 1, further comprising an inquiring step as follows: when inquiring, the application side informs a system of the columns that need to be queried, and the system needs to convert the columns into column IDs and then sends an inquiring request to a corresponding data node.

### Claim 9 (depends on 8)

The method of claim 8, wherein the data node determines a data block meeting conditions according to inquiring conditions, if a column to be inquired is defined in the data block, normal processing is carried out, otherwise, a default value is returned.
