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.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


