Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Json format data analytic method and data receiving end

A format data and analysis method technology, applied in the direction of electrical digital data processing, instruments, program control devices, etc., can solve the problem of not being able to correctly receive Json format data

Inactive Publication Date: 2016-02-24
WUHAN IRON & STEEL (GROUP) CORP
View PDF3 Cites 18 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The present invention provides a Json format data parsing method and a data receiving end to solve the technical problem that the data receiver in the prior art cannot correctly receive Json format data without knowing the corresponding relationship between key and value key-value pairs in Json

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 analytic method and data receiving end
  • Json format data analytic method and data receiving end
  • Json format data analytic method and data receiving end

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0050] Enclosed by the outermost curly braces is the entire Json, and enclosed by square brackets is the value (value) of the name (key) people. In the square brackets, there are three relatively independent Json enclosed in braces. The Json in this format is JsonArray. Its unique format specifiers are square brackets and braces that appear multiple times. If the value (value) is enclosed by a pair of square brackets or multiple pairs of braces, it can be determined that it is a JsonArray.

[0051] JsonObject is Json, and JsonArray is used to represent Array and list.

[0052] Therefore, the determination of whether JsonArray is included in the Json format data is specifically:

[0053] Judging whether the Json format data contains the format: the first curly bracket group, the first bracket group located in the first bracket group, and the second bracket group located in the first bracket group string.

[0054] In step S103, it is first necessary to distinguish between Jso...

example 1

[0091] Enclosed by the outermost curly braces is the entire Json, and enclosed by square brackets is the value (value) of the name (key) people. In the square brackets, there are three relatively independent Json enclosed in braces. The Json in this format is JsonArray. Its unique format specifiers are square brackets and braces that appear multiple times. If the value (value) is enclosed by a pair of square brackets or multiple pairs of braces, it can be determined that it is a JsonArray.

[0092] JsonObject is Json, and JsonArray is used to represent Array and list.

[0093] Step S303: Distinguish between JsonArraykey and value:

[0094] JsonArray is a list (list) composed of JsonObject, and each element in the list follows the standard format of JsonObject. Using the characteristics of the JsonObject standard format, use the method of string analysis to distinguish the key and value of each element in the list.

[0095] JsonObject is a string with a special format, so al...

example 2

[0101] The name (key) and value (value) of JsonObject are enclosed by braces and separated by commas. JsonArray is essentially a special value (value) of JsonObject enclosed in square brackets. This value (value) is composed of JsonObject again. Therefore, first traverse the entire JsonObject to find the JsonArray through the square brackets, and take it out of the JsonObject, and then use the split method to obtain each pair of name (key) and value (value).

[0102] Step S304: Correspondence between JsonArraykey and value:

[0103] Use the string parsing method to complete the one-to-one correspondence between key and value according to the key and value correspondence rules in the JsonObject standard format. As can be seen from the example in (Example 2), JsonArray is actually a name (key) / value (value) pair with a special value (value) in JsonObject. Value (value) is composed of standard JsonObject. Each pair of name (key) and value (value) can be obtained with the spli...

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 present invention relates to the field of software design and discloses a Json format data analytic method and a data receiving end so as to solve the technical problem that in the prior art, a data receiving party cannot correctly receive any data transmitted in a Json format under the condition of not appointing keys. The method comprises: receiving Json format data sent by a data sending end by virtue of the data receiving end ; by character string analysis and a special format character corresponding to a JsonArray, judging whether the Json format data comprises the JsonArray or not; when the Json format data comprises the JsonArray, extracting keys and values of the JsonArray; completing one-to-one correspondence between the keys and the values; the keys and the values are stored into a List and the List is output; completing correspondence between keys and values of a JsonObject; and storing each pair of key and value of the analyzed JsonObject as one element in the List and output the same. The method achieves the technical effect that even though the data receiving party does not know the corresponding relationship between the keys and the values, the data receiving party also can correctly receive and analyze the Json format data.

Description

technical field [0001] The invention relates to the field of software design, in particular to a Json format data parsing method and a data receiving end. Background technique [0002] In the field of software design, data exchange is an extremely important realization function. Fast, correct and convenient data exchange is one of the basic needs of users. As a lightweight data exchange format, Json adopts a language-independent text format with rigorous syntax, which is easy for people to read and write, easy for machine parsing and generation, and has a high network transmission rate. It is an ideal data for a wide range of applications. Exchange languages. [0003] In order to use Json efficiently, the sending and receiving parties must determine the corresponding relationship between key and value in advance, and strictly follow this format during the entire data conversion, transmission and analysis process. Therefore, if the data receiver does not agree on the key, ...

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): G06F9/44
CPCG06F8/31G06F8/427
Inventor 彭征林聪
Owner WUHAN IRON & STEEL (GROUP) CORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products