About the type and basic structure of QR code

2022-10-10 | 895 view
QR code is a kind of coding method of two-dimensional code. It represents binary data 0 and 1 through the contrast of color blocks with the background color

 

QR code is a kind of coding method of two-dimensional code. It represents binary data 0 and 1 through the contrast of color blocks with the background color, and the two-dimensional matrix composed of color blocks represents the content of numbers, English, Chinese characters, Japanese and so on. The computer or intelligent end can decode it through the image recognition equipment.

Because QR code has the advantages of more information storage and strong anti-interference ability than barcode, it is widely used by people.

QR Code type

There are currently five types of QR codes with different features and uses. They are [5]: the most widely used QR Code Model1/2(the QR Code mentioned in this paper is Model 2), only one positioning pattern is suitable for small area printing Micro QR Code, IQR Code with larger information capacity, SQRC, which can store private information (the appearance is no different from Model2), and frame QR, which can flexibly embed patterns.

QR Code generated

The first one is the structure of QR Code. The basic structure that makes up a QR Code is the symbol, which is the smallest square in the pattern. QR Code is composed of functional patterns (positioning patterns, alignment patterns, temporal patterns, isolators) and coding areas (format information, version information, data and fault tolerance areas). The positioning pattern is a fixed 7*7 symbol, the middle is a 3*3 symbol solid square, the periphery is a 7*7 hollow square, and the alignment pattern is a 5*5 symbol pattern. Except for version 1, which does not need the positioning pattern, the number of the other versions of the positioning pattern numbers=pow((version/7-1),2)-3. The temporal pattern is fixed as a black and white pattern. The coding areas are filled in the fixed order shown in the image below.

The generation of QR Code is roughly divided into 5 steps: select the error correction level and the version of the corresponding data amount, group and encode the data, calculate the fault tolerance information, calculate and add the appropriate mask, calculate the version and format information, through the above steps can get a complete QR Code pattern.

 

Select the error correction level and the version that can hold the corresponding amount of data

First of all, you need to decide the QR Code error correction level and version according to the amount of information stored and the purpose of the QR code. QR Code has four error correction levels: L, M, Q and H, which correspond to 7%, 15%, 25% and 30% recovery rates respectively. For example, the URL "http://li-Zang" is coded with QR Code, which contains 17 characters. If it is used for screen display (not easy to occlude or damage), the error correction level L can be used. The query version and error correction level can be compared with the following table. You can get the URL can use version 1 to store the URL. The version of the QR Code determines the number of symbols, and the version and error correction level together determine the amount of information that can be stored. The code number corresponding to version 1 is 21*21. The code number is calculated using the formula: module=17+4*version.

The above is about the type of QR code and the basic structure introduction. About the type and basic structure of QR code introduction