Phrase Tree Structure for Memory-Efficient Code Processing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional phrase tree encoding techniques face memory inefficiencies due to the large size of the data structure, which increases with the number of nodes, leading to high memory usage even when compressing data.
Innovation Solution
A revised data structure for the phrase tree that includes a code for characters or character strings, an appearance sequential number for next characters, and a counter for appearances exceeding a threshold, with limited child nodes and no parent node pointers, reducing memory usage by limiting the number of child nodes and using extended counters when necessary.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the phrase tree includes pointers to all 256 possible child nodes and counters for each, then the data structure can represent any character sequence, but the memory usage becomes excessively large (3,085 bytes per node)
Solution Approach 1:
The patent segments the fixed 256-entry child node array into a dynamic structure where only actually used child nodes are stored. Instead of allocating space for all 256 possible characters, the data structure only creates entries for characters that actually appear as children in the phrase tree, thereby reducing memory usage while maintaining the ability to represent any character sequence that occurs in the data.
Solution Approach 2:
The patent transforms the static fixed-size array structure into a dynamic structure that adapts to the actual data characteristics. The child node pointers and counters are allocated based on the number of actual child nodes rather than a fixed 256-size allocation, allowing the data structure to grow and shrink according to the actual content being compressed.
2Productivity
If the number of nodes in the phrase tree increases to compress more diverse data, then the compression ratio improves, but the overall size of the phrase tree becomes large
Solution Approach 1:
The patent merges the storage of child node information by combining the child node pointer array and the counter array into a unified dynamic structure. Instead of maintaining separate fixed-size arrays for pointers and counters, the patent integrates them so that both are allocated based on the actual number of child nodes, reducing redundant memory allocation and overall phrase tree size.
Solution Approach 2:
The patent changes the parameter of array allocation from a fixed size of 256 to a dynamic size based on the actual number of child nodes. This parameter change allows the data structure to scale efficiently with the complexity of the data being compressed, maintaining high compression ratios for diverse data while keeping the phrase tree size proportional to the actual content requirements.
3Ease of manufacture
If fixed-size arrays are used for child node pointers and counters, then memory allocation is simple, but memory efficiency deteriorates when many nodes have fewer than 256 children
Solution Approach 1:
The patent introduces dynamic memory allocation for child node structures, where the size of pointer and counter arrays is determined at runtime based on the actual number of child nodes. This dynamic approach replaces static fixed-size allocation, maintaining ease of implementation while dramatically improving memory efficiency for nodes with fewer than 256 children, which is the typical case in most compressed data.
Data Source
AI summary
A disclosed data structure of a phrase tree includes, as data of each node in the phrase tree, a data block including a first area for holding a code for a character or a character string, a second area for holding, for each character that will be used, an appearance sequential number of a second character that appears next to the character or the character string, and a third area for holding, according to the appearance sequential number, a number of appearances or a code corresponding to a character string comprising the character or the character string and the second character when the number of appearances exceeds a threshold.


