Single-Field String Encoding for Lower Memory Hash Storage

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Memory-constrained computing devices face substantial memory usage issues due to the need to store string lengths and hash values in separate fields for each string object, leading to increased memory consumption.

Innovation Solution

A system that encodes both string length and hash values into a single field, allocating bits based on string length and using remaining bits for the hash code, with a valid bit to indicate the presence of a hash code, allowing efficient access to both values.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If separate fields are allocated for string length and hash value, then both values can be stored and accessed, but memory usage increases substantially

Engineering Contradiction:
Improveaccess reliabilityVSAvoidmemory usage
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent combines two separate fields (string length field and hash value field) into a single unified field. This merging reduces memory consumption by eliminating redundant field overhead while maintaining the ability to store and access both the string length and hash value. The unified field efficiently packs both pieces of information, resolving the contradiction between reliable access to both values and substantial memory usage.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The unified field serves multiple functions simultaneously: it stores the string length, stores the hash value, and provides both values for access. This multi-functionality eliminates the need for separate dedicated fields for each piece of information, thereby reducing overall memory usage while ensuring both values remain reliably accessible when needed.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Adaptability or versatility

If multiple fields are allocated for each string, then string length and hash value can be stored, but the number of fields increases memory consumption

Engineering Contradiction:
Improvestorage flexibilityVSAvoidmemory consumption
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

By merging the string length field and hash value field into a single unified field, the patent reduces the number of fields from two to one. This consolidation maintains storage flexibility because both values can still be stored and accessed independently within the unified field, while simultaneously reducing memory consumption by eliminating the overhead of maintaining separate field structures.

Inventive Principle:
Principle #5Merging (Combining)

3Quantity of substance

If a single field stores both string length and hash code, then memory usage is reduced, but bit allocation must be optimized

Engineering Contradiction:
Improvememory usageVSAvoidbit allocation complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The unified field is segmented into distinct bit regions: one portion dedicated to storing the string length and another portion for storing the hash value. This segmentation allows for optimized bit allocation where each piece of information is placed in appropriately sized segments, reducing memory usage while managing the complexity of bit allocation through systematic division of the field into functional segments.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS7592930B1Method and apparatus for reducing memory usage by encoding two values in a single field
Publication Date: 2009.09.22 GOOGLE LLC
  • US7592930B1 patent drawing
  • US7592930B1 patent drawing
  • US7592930B1 patent drawing

AI summary

One embodiment of the present invention provides a system that reduces memory usage by encoding two values in a single field. During operation, the system receives a string. After determining the length of the string, the system allocates a first set of bits in the single field to store the length of the string, where the size of this first set of bits depends upon the determined length of the string. The system then stores the length of the string in the first set of bits. Subsequently, the system computes a hash code for the string. The system then allocates a second set of bits from the remaining unallocated bits in the single field to store this hash code, and stores the hash code in this second set of bits. Thereafter, the system can access the string length value from the single field and can also use the entire single field as a hash value for the string.