Lossless JSON (JavaScript Object Notation) data compression method

A data compression, data technology, applied in electrical components, code conversion, etc., can solve problems such as inability to compress data

Active Publication Date: 2013-11-20
华易互动科技(北京)有限公司
View PDF4 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0054] And HPack cann

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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0067] The specific lossless compression process of the present invention is:

[0068] 1. Traverse and read the JSON data, parse the JSON objects in it, and generate data objects respectively. The data objects contain all the "Key values" and "Value values" of a JSON object.

[0069] 2. Compare the "Key value" owned by each data object, extract the duplicate "Key value", and generate a "Key value" template.

[0070] 3. Compare the "Value" of each data object, extract the "Value" that appears twice or more, and generate a "Value" template.

[0071] 4. For the same data object, replace the repeated "Value value" in "Value value" with an identifier. The identifier starts with "#", followed by a number representing the first "Value value" template, followed by "." and numbers represent the value in the "Value value" template, such as "#1.2" represents the second value in the first "Vlaue value" template.

[0072] 5. Generate new JSON data

[0073] Example of specific compressio...

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 lossless JSON (JavaScript Object Notation) data compression method. The method comprises the steps of (1) reading to-be-compressed JSON data in a traversal way and generating a data object for each JSON object, wherein the data objects comprises all Key values and Value values of the JSON objects; (2) comparing the Key value of each data object, generating a Key value template with the repeated Key values, comparing the Value value of each data object and generating a Value value template with the repeated Value values; and (3) compressing the to-be-compressed JSON data according to the Key value template and the Value value template via a mode that the repeated Value values of the same data object are replaced by an identifier which indicates the location of the Value value in the n Value value template as the n value. By the adoption of the lossless JSON data compression method, the compression rate is further decreased; and the more the data are, the lower the compression rate is and the smaller a compressed file is.

Description

technical field [0001] The invention relates to a lossless data compression method, in particular to a lossless JSON data compression method. Background technique [0002] JSON is a lightweight data exchange format that is easy for humans to read and write, and easy for machines to parse and generate. It can be used as a data exchange format, just like XML. When comparing JSON and XML, JSON has several advantages: 1. It is easy for human to read and write. 2. Easy for machine parsing and generation. This is why JSON is considered a lightweight alternative to XML. Although JSON has the above advantages, its data repetition is still relatively high. The larger the file, the more repetitions of the KEY value. In mobile Internet applications, transmitting data consumes more traffic, so some JSON data compression methods have emerged. . [0003] The JSON compression algorithm currently has two open source compression methods, CJSON and HPack. Both algorithms achieve compress...

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): H03M7/30
Inventor 孔校军刘洁
Owner 华易互动科技(北京)有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products