IP Library Granted Patent US 12,182,095
Granted Patent B2
US 12,182,095 · App. 18/053,505 · Granted Dec 31, 2024

Parsing JSON on field programmable gate arrays

Inventors: Jonas Dann (Heidelberg, DE); Royden Wagner (Bruchsal, DE); Daniel Ritter (Heidelberg, DE)
Assignee: SAP SE
G06F16/235
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,182,095
App. No.
18/053,505
Granted
Dec 31, 2024
Kind
B2
Abstract

A method may include parsing, using a JavaScript Object Notation (JSON) parser implemented on a field programmable gate array (FPGA), a JSON document. The parsing includes dividing an input string comprising the JSON document into one or more data blocks and annotating the characters included in each data block a bitmap for each data block. String characters included in the data blocks may be identified, based on the bitmap associated with each data block, for writing to a string array. Numeric characters included in the data blocks may be transformed, based on the bitmap associated with each data block, into integers value for writing to an integer array or float values for writing to a float array. A tape including a binary representation of the JSON document may be generated based on the bitmap associated with each data block. Related systems and computer program products are also provided.

Claims (33)

1. A system, comprising:

a JavaScript Object Notation (JSON) parser implemented on a field programmable gate array (FPGA), the JSON parser configured to perform operations comprising:

dividing, by an input reader of the JSON parser, an input string comprising a JSON document into one or more data blocks;

annotating, by a tokenizer of the JSON parser, a plurality of characters included in each data block of the one or more data blocks to generate, for each data block of the one or more data blocks, a corresponding bitmap;

appending, by the tokenizer of the JSON parser, a first bit to an end of a first bitmap of a first data block, and pre-pending a last bit of the first bitmap and a second bit to a start of a second bitmap of a second data block following the first data block, wherein the first bit and the second bit identifies an overflow type associated with a single JSON value spanning the first data block and the second data block;

identifying, by a string filter of the JSON parser and based on a bitmap associated with each data block of the one or more data blocks, one or more string characters within the plurality of characters included in the data block for writing to a string array;

transforming, by a number parser of the JSON parser and based on the bitmap associated with each data block of the one or more data blocks, one or more numeric characters within the plurality of characters included in the data block, the one or more numeric characters being transformed into an integer value for writing to an integer array or a float value for writing to a float array; and

generating, by a tape builder of the JSON parser and based on the bitmap associated with each data block of the one or more data blocks, a tape comprising a binary representation of the JSON document.

2. The system of claim 1 , wherein each of the input reader, the tokenizer, the string filter, the number parser, and the tape builder form a pipeline on the FPGA.

3. The system of claim 1 , wherein the JSON parser is communicatively coupled, via a peripheral component interconnect express (PCIe), with a parser stub on a host central processing unit (CPU) with host code for one or more applications ingesting the binary representation of the JSON document.

4. The system of claim 1 , wherein the JSON parser is deployed on a first device while one or more applications ingesting the binary representation of the JSON document is hosted on a second device.

5. The system of claim 1 , wherein the second bit is an overflow bit from an end of the first data block.

6. The system of claim 1 , wherein the overflow type comprises a string, a backslash, a number, or none.

7. The system of claim 1 , wherein the operations further comprise computing, by the tokenizer of the JSON parser, for all overflow types, a corresponding bitmap in parallel, and wherein one or more bitmaps passed onto the string filter and/or the number parser are identified by a multiplexer based on a known overflow type from a previous data block.

8. The system of claim 1 , wherein the operations further comprise operating, by the string filter of the JSON parser, on a quoted range (QR) bitmap, and a quoted range end (QRE) bitmap, and a corresponding block of characters.

9. The system of claim 1 , wherein the operations further comprise compacting, by the string filter of the JSON parser, one or more string characters within a data block into a single contiguous sequence while tracking a quantity of characters, a quantity of different strings, and a length of each individual string.

10. The system of claim 1 , wherein the operations further comprise operating, by the number parser of the JSON parser, on a number range (NR) bitmap, a number range end (NRE) bitmap, a floating point decimal part (FDP) bitmap, and a corresponding block of characters.

11. The system of claim 1 , wherein the operations further comprise processing, by the number parser of the JSON parser, one input character in each pipeline step while updating an internal counter tracking a current number being parsed.

12. The system of claim 11 , wherein the operations further comprise multiplying, by the number parser of the JSON parser, a temporary number pointed to by the internal counter by ten and adding to the current number when the number parser encounters a numerical character.

13. The system of claim 1 , wherein the binary representation of the JSON document includes a plurality of one-byte tokens corresponding to strings, integers, Booleans, null, and/or floating point numbers.

14. The system of claim 1 , wherein the binary representation of the JSON document includes one or more nested objects and array structures, and wherein each nested object or array structure is denoted by a begin token and an end token.

15. A computer-implemented method, comprising:

dividing, by an input reader of a JavaScript Object Notation (JSON) parser implemented on a field programmable gate array (FPGA), an input string comprising a JSON document into one or more data blocks;

annotating, by a tokenizer of the JSON parser, a plurality of characters included in each data block of the one or more data blocks to generate, for each data block of the one or more data blocks, a corresponding bitmap;

appending, by the tokenizer of the JSON parser, a first bit to an end of a first bitmap of a first data block, and pre-pending a last bit of the first bitmap and a second bit to a start of a second bitmap of a second data block following the first data block, wherein the first bit and the second bit identifies an overflow type associated with a single JSON value spanning the first data block and the second data block;

identifying, by a string filter of the JSON parser and based on a bitmap associated with each data block of the one or more data blocks, one or more string characters within the plurality of characters included in the data block for writing to a string array;

transforming, by a number parser of the JSON parser and based on the bitmap associated with each data block of the one or more data blocks, one or more numeric characters within the plurality of characters included in the data block, the one or more numeric characters being transformed into an integer value for writing to an integer array or a float value for writing to a float array; and

generating, by a tape builder of the JSON parser and based on the bitmap associated with each data block of the one or more data blocks, a tape comprising a binary representation of the JSON document.

16. The method of claim 15 , wherein each of the input reader, the tokenizer, the string filter, the number parser, and the tape builder form a pipeline on the FPGA.

17. The method of claim 15 , wherein the second bit an overflow bit from an end of the first data block.

18. The method of claim 15 , further comprising compacting, by the string filter of the JSON parser, one or more string characters within a data block into a single contiguous sequence while tracking a quantity of characters, a quantity of different strings, and a length of each individual string, and wherein the number parser is configured to process one input character at a time while updating an internal counter tracking a current number being parsed.

19. The method of claim 18 , wherein the overflow type comprises a string, a backslash, a number, or none.

20. The method of claim 18 , further comprising computing, by the tokenizer of the JSON parser, for all overflow types, a corresponding bitmap in parallel, and wherein one or more bitmaps passed onto the string filter and/or the number parser are identified by a multiplexer based on a known overflow type from a previous data block.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 8, 2022
From: DANN, JONAS; RITTER, DANIEL; WAGNER, ROYDEN
To: SAP SE
Reel/Frame 061693/0370 →
Continuity (2)
Provisional Application 63350322 · Jun 8, 2022
Related Publication 20230401194A1 · Dec 14, 2023