Two-Dimensional Code Encoding Method for Extended Text Capacity
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing two-dimensional code encoding methods often result in binary character strings that exceed the data capacity of the code, leading to failures in generating codes for texts with large character lengths.
Innovation Solution
The method involves determining a target coding mode for each character and grouping characters into fields based on these modes to minimize the number of bits required, allowing for the encoding of longer texts within the code's capacity by reducing the quantity of bits needed for mode indicators and encoding each field separately.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If conventional encoding methods are used, then encoding simplicity is maintained, but the binary character string length exceeds the two-dimensional code data capacity
Solution Approach 1:
The text is divided into multiple character fields based on character types (letters, digits, symbols, etc.), and each field is encoded separately using the most suitable coding mode. This segmentation allows optimization of encoding efficiency for different character types while maintaining overall compactness
Solution Approach 2:
The patent dynamically selects coding modes (coding table selections) based on the actual character content of each field. By changing the coding parameters according to the data characteristics, the encoding achieves optimal compression ratio, reducing the binary string length to fit within two-dimensional code capacity
2Loss of information
If the text length is increased, then information storage capacity is improved, but the binary character string exceeds the code's data capacity
Solution Approach 1:
By segmenting the text into character fields and encoding each field independently with optimized coding modes, the patent achieves better overall compression. This allows longer texts to be encoded into compact binary strings that fit within two-dimensional code capacity limits
Solution Approach 2:
The dynamic selection of coding modes based on character type distribution enables the encoding to adapt to different text compositions. This parameter optimization reduces the average bits per character, increasing the effective information storage capacity within the fixed code capacity
Data Source
AI summary
In a method, an electronic device obtains to-be-encoded text, where the to-be-encoded text includes N characters; the electronic device determines a target coding mode for each of the N characters from X optional coding modes; the electronic device groups the N characters into M character fields based on the target coding mode for each character, and determines a target coding mode for each of the M character fields, where M is less than or equal to N; the electronic device encodes the M character fields based on the target coding mode for each character field to obtain a first binary character string; and the electronic device generates, based on the first binary character string, a two-dimensional code of a version corresponding to a length of the first binary character string.


