String Encoding by Preset Pattern Removal to Avoid Base64 Bloat
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Base64 encoding increases the length of a string by about 30%, negatively impacting the application effect of encoded data.
Innovation Solution
An encoding method that traverses a to-be-encoded string, searches for and deletes a preset string, resulting in a target string that maintains the original length during encoding, thereby expanding the application scenario and improving encoding efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If Base64 encoding is used to encode data, then reliability of data transmission is improved, but length of the string is increased by about 30%
Solution Approach 1:
The patent extracts and removes preset strings (such as 'AAAA', '====') from the Base64 encoded result. By identifying and deleting these specific patterns that do not carry meaningful information, the encoded string length is reduced while maintaining the reliability of actual data transmission.
Solution Approach 2:
The patent discards redundant characters in the encoding process and recovers the original data by detecting and removing these unnecessary characters. The preset strings are discarded during encoding, and the original information is recovered through the deletion process, achieving both compression and faithful data representation.
2Reliability
If Base64 encoding is used to ensure quality of data transmission, then quality of data transmission is improved, but application effect of the encoded data is severely affected
Solution Approach 1:
By extracting and removing preset strings from the encoded data, the patent reduces unnecessary bloat while preserving the core encoded information. This extraction process maintains data transmission quality while improving application effectiveness by reducing the overhead of the encoded format.
Solution Approach 2:
The patent changes the parameter of encoded string length by removing redundant characters. This parameter modification allows the encoded data to maintain its reliability while becoming more adaptable to various application scenarios where shorter, more efficient data representation is beneficial.
Data Source
AI summary
An encoding method includes traversing a to-be-encoded string, searching for a preset string in the to-be-encoded string, and deleting the preset string in the to-be-encoded string if the preset string is found, to obtain a target string.


