JSON Data Storage Optimization via Contiguous Address Allocation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current data storage methods for JSON structured data are inefficient in optimizing storage space, particularly when dealing with key-value pairs, objects, and arrays, leading to suboptimal use of storage resources.
Innovation Solution
A method and apparatus that acquire target data, determine the number of object, array, first key-value pair, and second key-value pair data, and allocate storage space accordingly, storing key-value pairs with contiguous addresses and sorting key data to generate offset addresses for efficient storage and retrieval.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If data is stored using traditional JSON structure without optimization, then data integrity and structure are maintained, but storage space is wasted and retrieval efficiency is reduced
Solution Approach 1:
The patent segments JSON data into distinct components: key-value pairs, object data, and array data. Each component is stored in a dedicated storage area with specific address allocation rules. This segmentation enables precise control over storage space usage while maintaining efficient retrieval paths for different data types, directly reducing storage waste and improving retrieval efficiency.
Solution Approach 2:
The patent applies different storage strategies to different data types within the JSON structure. Key-value pairs use contiguous address allocation for fast access, objects use structured storage with type identifiers, and arrays use sequential allocation. This local quality approach optimizes storage and retrieval for each specific data type, reducing overall storage occupancy while maintaining high retrieval efficiency.
2Quantity of substance
If storage space is reduced through optimization, then resource utilization improves, but data structure complexity increases
Solution Approach 1:
The patent performs preliminary classification and counting of different data types (key-value pairs, objects, arrays) before storage allocation. By pre-determining the number and type of data elements, the system can allocate storage addresses efficiently without complex runtime decisions, reducing storage space occupancy while keeping the storage structure manageable through advance planning.
Solution Approach 2:
The patent changes the storage parameters by introducing type identifiers and address offset calculations. Instead of uniform storage, the system uses parameter-based allocation where storage addresses are calculated based on data type, position, and predefined offsets. This parameter change enables compact storage while maintaining a systematic rather than chaotic structure.
3Speed
If contiguous addresses are used for key-value pairs, then retrieval speed improves, but storage allocation complexity increases
Solution Approach 1:
The patent segments the storage space into distinct areas: a first storage area for key-value pairs with contiguous addresses, a second storage area for objects, and a third storage area for arrays. This segmentation allows key-value pairs to use simple contiguous address allocation for fast retrieval, while other data types use different strategies, thereby improving retrieval speed without requiring the entire storage system to be complex.
Solution Approach 2:
The patent pre-allocates the first storage area specifically for key-value pairs with contiguous address spacing. This preliminary action simplifies the allocation process for this critical data type, enabling fast retrieval through direct address calculation, while the complexity of allocating other data types is handled separately in their designated areas.
Data Source
AI summary
A method and an apparatus for storing data are provided. The method includes: acquiring target data, the target data including first key-value pair data, object data or array data, the key-value pair data including key data and value data, the object data including second key-value pair data, and the array data including object data; determining an object data number of the object data included in the target data, an array data number of the array data included in the target data, a first key-value pair data number of the first key-value pair data included in the target data, and a second key-value pair data number of the second key-value pair data included in the target data; determining a storage space based on the determined numbers; and storing the target data into the storage space.


