Unlock instant, AI-driven research and patent intelligence for your innovation.

JSON format data parsing and storing method and device

A format data and data technology, applied in the field of JSON format data analysis and storage, can solve the problems of unfavorable JSON format data processing and storage, ignoring the logical relationship of JSON format data nodes, etc.

Active Publication Date: 2019-01-04
玖富数科科技集团有限责任公司
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, this invention only extracts all the field names and field values ​​in JSON format data, ignoring the logical relationship between JSON format data nodes, which is not conducive to further processing and storage of JSON format data

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • JSON format data parsing and storing method and device
  • JSON format data parsing and storing method and device
  • JSON format data parsing and storing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0021] figure 1 It is a flowchart of a JSON format data parsing method according to the first embodiment of the present invention, and the method is realized by the following steps.

[0022] Step S101: Set up a set A to store the data parsing results in JSON format. Specifically, set A is established to store the mapping from node names to P1, and P1 is a sequence formed by field names, field values, path names and path values.

[0023] In an optional embodiment, the JAVA language is used to realize the structure of the set A, and the definition form of A is Map>>; wherein the first String is the node name, and the List> is P1, the first String in P1 stores the field name and path name, and the second String in P1 stores the field value and path value.

[0024] Step S102: Determine the type of the data in JSON format, parse the data in JSON format, and add the parsing result to set A.

[0025] Specifically, the method for judging the type of data in JSON format is as follows...

Embodiment 2

[0039] figure 2 It is a flowchart of a JSON format data storage method in the second embodiment of the present invention, and the method is implemented by the following steps.

[0040] Step S201: Determine whether the associated stored source node and target node in set A exist. Specifically, it is judged whether the name of the source node and the name of the target node that need to be stored in association exist in the set A.

[0041] In an optional embodiment, the data in JSON format that needs to be associated and stored is as follows:

[0042]

[0043]

[0044] After parsing the data in JSON format, set A is formed.

[0045] In an optional embodiment, set the name of the source node as "root" and the name of the target node as "query_history", both of which exist in A, and store the "message_id" under "root" in "query_history".

[0046] Continue to extract the sequence P1 corresponding to the target node name "query_history", and add the field "message_id" to e...

Embodiment 3

[0058] image 3 It is a schematic diagram of a JSON format data parsing device according to the third embodiment of the present invention, such as image 3 As shown, the device includes: a paradigm data parsing module 31, a JSON object parsing module 32, and a JSON object sequence parsing module 33.

[0059] The paradigm data parsing module 31 combines the field names, field values, path names and path values ​​of the paradigm data to form a sequence P1, and establishes a mapping from node names to P1.

[0060] The JSON object parsing module 32 uses the combination of the path value of the JSON object and the node name as the new path value. If there is non-standard data under the new path value, continue to parse the JSON object or JSON object sequence under the new path value until all For normalized data, store normalized data; continue to traverse other nodes of the JSON object until all non-normalized data are parsed into normalized data. .

[0061] The JSON object seq...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a JSON format data analysis and storage method and a device thereof. The method comprises the following steps: for the normal form data, the field name, the field value, the path name and the path value of the normal form data are combined to form a sequence P1, and the mapping of node name to P1 is established; For the JSON object, the path value and node name combinationof the JSON object are taken as the new path value. If there is non-normal data under the new path value, the JSON object or the JSON object sequence under the new path value is parsed until all the normal data under the new path value are normal data. Continue to traverse other nodes of the JSON object until all data is resolved to normal form data; For JSON object sequence, the path value, nodename and index combination of JSON object in JSON object sequence are taken as the new path value, and all JSON objects under the new path value are parsed. Data in JSON format is stored in association. Compared with the prior art, the present invention alleviates the problems of difficult maintenance and low general performance of the parsing method, and provides a technical scheme of the associated storage.

Description

technical field [0001] The invention relates to the field of data analysis, in particular to a JSON format data analysis and storage method and device. Background technique [0002] The full name of JSON is JavaScript Object Notation, which is a lightweight data exchange format. JSON has the same characteristics as XML, it is easy to write and read, easy to generate and parse by machine, and the data transmission efficiency of JSON is much higher than that of XML. Therefore, JSON is widely used in the field of data exchange and analysis in the field of software design. [0003] In the traditional method of parsing data in JSON format, it is necessary to agree on the corresponding relationship between field names and field values ​​in advance. If a field name is modified, the parsing method must be modified accordingly. Therefore, the traditional JSON format data parsing method is difficult to maintain and has low general performance. In the Chinese invention patent with p...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/41G06F8/30G06F17/22
CPCG06F8/315G06F8/427G06F40/14G06F40/146
Inventor 周健
Owner 玖富数科科技集团有限责任公司