# US 2021/0004361 A1 · Parser for Schema-Free Data Exchange Format

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

- Number: US 2021/0004361 A1
- Document ID: US20210004361A1
- Status: Published application
- Kind: A1
- Application number: 17/017,513
- Filed: 2020-09-10
- Published: 2021-01-07
- Earliest claimed: 2017-04-28
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Yinan Li; Nikolaos Romanos Katsipoulakis; Badrish Chandramouli; Jonathan D Goldstein; Donald Kossmann
- Web page: https://patentgrep.com/patent/US20210004361A1

## CPC

- G06F 16/2237: {Vectors, bitmaps or matrices}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 16/2455: Query execution
- G06F 16/258: {Data format conversion from or to a database}
- G06F 16/81: Indexing, e.g. XML tags; Data structures therefor; Storage structures
- G06F 40/221: Parsing markup language streams (streaming G06F40/149)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method includes obtaining a query containing at least one field from which data is being queried, obtaining a dataset having a schema-free data exchange format having multiple fields of data at different physical positions in the dataset, and parsing the dataset by obtaining a structural index that maps logical locations of fields to physical locations of the fields of the dataset, accessing the structural index with logical locations of the fields that index to the physical locations, and providing data from the fields based on the physical locations responsive to the query.

## Claims

### Claim 1

A method of generating a structural index identifying locations of fields in a dataset having a schema-free data exchange format having multiple fields of data at different physical positions in the dataset, the method comprising:
detecting key/value structural character separators of data fields in the dataset;
detecting object begin and object end characters in the dataset;
detecting when the structural characters occur within dataset strings and do not define a structure of the dataset; and
creating a bitmap corresponding to structural character separators of the data fields that define the structure of the dataset, wherein the bitmap identifies physical locations of such data fields from logical locations of such data fields.

### Claim 2 (depends on 1)

The method of claim 1 wherein detecting key/value structural character separators of data fields in the dataset comprises building a structural bitmap for each of multiple characters comprising key/value separator characters, object begin and object end characters, string begin and string end characters, element separator in an array, array begin and end characters, and escape characters.

### Claim 3 (depends on 2)

The method of claim 2 wherein the characters comprise JSON (Java Script Object Notation) characters of colons for key/value separator characters, left brace for object begin, right brace for object end, quotes for string begin and string end, comma for element separator in an array, left bracket for array begin, right bracket for array end, and backslash for escape characters.

### Claim 4 (depends on 2)

The method of claim 2 wherein detecting key/value structural character separators is performed by using SIMD (single instruction multiple data) vectorization to first compare a vector of n characters to a vector that contains n copies of the structural character to obtain a multiple bit per lane vector that contains all 1's or all 0's and to second, convert the result vector to a bitmap by selecting the most significant bit of each lane.

### Claim 5 (depends on 2)

The method of claim 2 wherein detecting object begin and object end structural characters in the data structure comprises generating a structural quote bitmap to represent the begin and end positions of all strings, thereby excluding escaped quotes within JSON strings.

### Claim 6 (depends on 5)

The method of claim 5 wherein detecting when the structure characters occur within dataset strings and do not define data structures comprises converting the quote bitmap to a structural quote bitmap by turning off bits corresponding to non-structural quotes in the quote bitmap.

### Claim 7 (depends on 6)

The method of claim 6 wherein converting the quote bitmap to a structural quote bitmap is performed in a bit-parallel fashion wherein two-character subsequences “\″” are found by performing a logical AND between a backslash bitmap and a one-bit-right-shifted quote bitmap where for each 1 in a result bitmap, a length of consecutive 1s in the backslash bitmap is computed starting at the position of a current 1.

### Claim 8 (depends on 7)

The method of claim 7 wherein creating a bitmap corresponding to structural character separators of the data fields that define dataset structure results in the bitmap identifying physical locations of such data fields from logical locations of such data fields, and further comprising transforming the structural quote bitmap to a string mask bitmap, in which bits are on if the corresponding character is inside of a data structure string, and in which bits are off if the corresponding character is outside of any data structure strings, wherein bits at the boundaries of strings are either 0 or 1.

### Claim 9 (depends on 1)

The method of claim 1 wherein the elements are performed on a training subset of the dataset to create a pattern tree having multiple patterns identifying speculative positions in the dataset identifying the physical location of a field.

### Claim 10

A machine readable storage device having instructions for execution by a processor of a machine to cause the processor to perform operations to perform a method of generating a structural index identifying locations of fields in a dataset having a schema-free data exchange format having multiple fields of data at different physical positions in the dataset, the method comprising:
detecting key/value structural character separators of data fields in the dataset;
detecting object begin and object end structural characters in the dataset;
detecting when the structure characters occur within dataset strings and do not define a structure of the dataset; and
creating a bitmap corresponding to structural character separators of the data fields that define structure of the dataset, wherein the bitmap identifies physical locations of such data fields from logical locations of such data fields.

### Claim 11 (depends on 10)

The device of claim 10 wherein detecting key/value structural character separators of data fields in the dataset comprises building a structural bitmap for each of multiple characters comprising key/value separator characters, object begin and object end characters, string begin and string end characters, element separator in an array, array begin and end characters, and escape characters.

### Claim 12 (depends on 11)

The device of claim 11 wherein the characters comprise JSON (Java Script Object Notation) characters of colons for key/value separator characters, left brace for object begin, right brace for object end, quotes for string begin and string end, comma for element separator in an array, left bracket for array begin, right bracket for array end, and backslash for escape characters.

### Claim 13 (depends on 11)

The device of claim 11 wherein detecting key/value structural character separators is performed by using SIMD (single instruction multiple data) vectorization to first compare a vector of n characters to a vector that contains n copies of the structural character to obtain a multiple bit per lane vector that contains all 1's or all 0's and to second, convert the result vector to a bitmap by selecting the most significant bit of each lane.

### Claim 14 (depends on 11)

The device of claim 11 wherein detecting object begin and object end structural characters in the data structure comprises generating a structural quote bitmap to represent the begin and end positions of all strings, thereby excluding escaped quotes within JSON strings.

### Claim 15 (depends on 14)

The device of claim 14 wherein detecting when the structure characters occur within dataset strings and do not define data structures comprises converting the quote bitmap to a structural quote bitmap by turning off bits corresponding to non-structural quotes in the quote bitmap.

### Claim 16 (depends on 15)

The device of claim 15 wherein converting the quote bitmap to a structural quote bitmap is performed in a bit-parallel fashion wherein two-character subsequences “\″” are found by performing a logical AND between a backslash bitmap and a one-bit-right-shifted quote bitmap where for each 1 in a result bitmap, a length of consecutive 1s in the backslash bitmap is computed starting at the position of a current 1.

### Claim 17 (depends on 16)

The device of claim 16 wherein creating a bitmap corresponding to structural character separators of the data fields that define dataset structure results in the bitmap identifying physical locations of such data fields from logical locations of such data fields, and further comprising transforming the structural quote bitmap to a string mask bitmap, in which bits are on if the corresponding character is inside of a data structure string, and in which bits are off if the corresponding character is outside of any data structure strings, wherein bits at the boundaries of strings are either 0 or 1.

### Claim 18 (depends on 10)

The device of claim 10 wherein the elements are performed on a training subset of the dataset to create a pattern tree having multiple patterns identifying speculative positions in the dataset identifying the physical location of a field.

### Claim 19

A device comprising:
a processor; and
a memory device coupled to the processor and having a program stored thereon for execution by the processor to perform operations comprising:
detecting key/value structural character separators of data fields in the dataset;
detecting object begin and object end structural characters in the dataset;
detecting when the structure characters occur within dataset strings and do not define a structure of the dataset; and
creating a bitmap corresponding to structural character separators of the data fields that define structure of the dataset, wherein the bitmap identifies physical locations of such data fields from logical locations of such data fields.

### Claim 20 (depends on 10)

The device of claim 10 wherein detecting key/value structural character separators of data fields in the dataset comprises building a structural bitmap for each of multiple characters comprising key/value separator characters, object begin and object end characters, string begin and string end characters, element separator in an array, array begin and end characters, and escape characters and wherein detecting key/value structural character separators is performed by using SIMD (single instruction multiple data) vectorization to first compare a vector of n characters to a vector that contains n copies of the structural character to obtain a multiple bit per lane vector that contains all 1's or all 0's and to second, convert the result vector to a bitmap by selecting the most significant bit of each lane.
