laitimes

The little black and white code has such magic

Today we're going to talk about something that's so closely connected to our daily lives today — we travel, eat, shop, and use it almost every day. That's right, it's a QR code.

Who would have expected that a small black-and-white code could have such a wide range of uses, and who would have expected that this ordinary-looking black-and-white square was subtly changing our lives?

Scan code to add friends: Expand your social circle anytime, anywhere.

The little black and white code has such magic

Scan code payment: Now even the uncle who sells fruit on the roadside is collecting money on WeChat and Alipay, if you still stubbornly use cash to pay, it is really "out".

The little black and white code has such magic

Itinerary tracking code: Since the epidemic, as a key electronic certificate for personal travel during the epidemic control period, the personal one-code pass has laid a solid foundation for epidemic prevention and control and is an important guarantee for the safety of citizens.

The little black and white code has such magic

These are just the most common application scenarios of two-dimensional codes, and the common ones are to scan to obtain product electronic manuals, membership management, advertising pushes and so on.

Remember when you started using QR codes? Do you know QR codes? Why do we see that the QR code has three small squares in a paper shape? Let's unveil its mystery today.

The QR code we now widely use is the QR (Quick Response) code, which first appeared in 1994 and quickly integrated into our lives after it was introduced to China in 2001.

The composition and principle of two-dimensional code

The QR code is a transformation of the bar code. It is most common on the packaging of goods, which is composed of vertical stripes of different thicknesses in black and white, and the information of the product is hidden in this barcode.

Cashiers can scan barcodes to get product information for fast checkout. Barcode is a bar code that carries information in one dimension, and the two-dimensional code, as the name suggests, carries information in both horizontal and vertical dimensions, so it has become a block from a bar. Whether it is a barcode or a two-dimensional code, it is essentially an information portal.

The little black and white code has such magic

A complete two-dimensional code is composed of several small black squares and small white squares, first of all, the numbers, letters, symbols and other characters are converted into binary "0" and "1" after certain operation coding rules, and then after a series of optimization algorithms to obtain the two-dimensional code. The small white square on the QR code represents the binary "0" and the small black square represents the "1".

When the two-dimensional code is read, the 01 sequence on the two-dimensional code is read through the color contrast, and then the binary is converted into a character that we can recognize through numbers, bytes, special characters, mixed encoding, Chinese character encoding, etc.

The generation of two-dimensional codes follows binary encoding, and their arrangement is the embodiment of information. Its basic functional area is divided into:

Position detection graphics, position detection graphic separators, positioning graphics: The three corners of the two-dimensional code are distributed with a large circular black and white square - position detection graphics, which together with the position detection graphic separators and positioning graphics help the two-dimensional code to locate in the process of formation and reduce the occurrence of incorrect arrangements. Whether your phone sweeps horizontally, vertically, or obliquely, it knows in which direction the QR code should be read. For each QR code, their position is fixed, but the size specifications will vary.

The little black and white code has such magic

Format information: Indicates the error correction level of the two-dimensional code, the higher the level, the stronger the error correction ability. For example, if there are 100 codeword data that need to be encoded, and you want to correct half of them, that is, 50 codewords, the calculation method is as follows. Error correction requires a symbol equivalent to 2 times the code word (RS code*), so the number in this case is 50 × 2 = 100 codewords. Therefore, the number of all codewords is 200, of which 50 are used as error corrections, so it is calculated that the error correction rate relative to all codewords is 25%. This ratio is equivalent to the "Q" level in the QR code error correction level.

Level L: Up to 7% of the font size can be corrected.

Level M: Up to 15% of the font size can be corrected.

Level Q: Up to 25% of the word size can be corrected.

Level H: Up to 30% of the word size can be corrected.

The little black and white code has such magic

Correction graphics: In the case of some degree of damage to the image, the decoding software can synchronize the coordinate image of the image module through it. The number and position of QR code correction graphics of different specifications are not the same. When the specifications are determined, its number and location are determined.

The little black and white code has such magic

Data and error correcting code words: The actual saved QR code information and error correction codewords. This is a fault tolerance mechanism of the two-dimensional code, for example, if the area of a two-dimensional code is covered or removed by less than 30%, the two-dimensional code scanner can still accurately obtain information from the mutilated two-dimensional code.

The little black and white code has such magic

Version information: that is, the specifications of the QR code, the QR code symbol has a matrix of 40 specifications, from 21x21 (version 1), to 177x177 (version 40), each version adds 4 modules in portrait and landscape directions than the previous version. Each version of the QR code combines the amount of data, character type and error correction level, and has a corresponding maximum number of input characters, which needs to be selected according to actual needs. If you increase the amount of data, you need more code elements, and the QR code will be larger.

The little black and white code has such magic

When the scanning settings start scanning the QR code, the area to be recognized is quickly extracted according to the position detection graphic, the position detection graphic separator, and the positioning graphic. Sometimes when we scan the QR code with a mobile phone or other device, it is not facing the QR code, or even if it is facing the QR code, it will cause the QR code to tilt, stretch and so on to a certain extent. However, we found that this does not affect the recognition of the two-dimensional code, so the correction graphics designed as some fixed-proportion rectangular blocks can help the device correctly correct the scanned picture.

To sum up, the identification process of our two-dimensional code is roughly as follows: open the mobile phone or other device to scan the two-dimensional code, scan failed, tell to return to the previous step, and start over. Displays a scanning box to facilitate the user's alignment of the QR code.

Will the QR code be exhausted?

Nowadays, almost every country on the planet uses QR codes every day, and the number of daily uses exceeds 10 billion, so will QR codes be used up one day? It depends on how many QR codes humans can make.

There are many types of QR codes (QR codes are just one of them, other common ones are QR Code, Code 49, Code 16K, etc.), and each QR code can carry a lot of information.

The same kind of two-dimensional code, due to the differences in various versions, each version can carry a lot of information.

The two-dimensional code is encoded differently, and the information contained is also different.

The two-dimensional code can be reused, for example, the same two-dimensional code can achieve different links to jump, and the same two-dimensional code can allow people to scan and see different content at different times and places.

The smallest QR code we are currently using is an example, the specification is 21×21, which contains 21 × 21 arrangable points, which can represent 1 or 0. Therefore, according to the method of permutation and combination, that is, the 441 power of 2, and if it is expanded, it is 5.678× 10^132, which is already astronomical. Just one version of a coding two-dimensional code can store so much information, at the rate of human use of 10 billion two-dimensional codes a day to calculate, we do not have to worry about the two-dimensional code will run out.

QR code security issues

While "living on the yard" brings us convenience, security problems also follow. Because QR code generators are easy to obtain from the Internet and have no restrictions on publishing, they are easily used by some criminals to carry out online fraud.

Share a real case: When Mr. Li was shopping on an e-commerce platform, he fancied the LCD TV of an online store, and the price was nearly 1,000 yuan cheaper than the market. The owner claimed to be able to get low-priced "private goods", and Mr. Li accepted the owner's request to let him pay by scanning the QR code. After scanning the QR code sent by the shopkeeper through his mobile phone, Mr. Li entered a payment interface, entered the bank account number and password and clicked Pay, but found that the payment failed. The owner told him there might be a system failure and asked him to rescan. Mr. Li scanned seven times, all of which ended in failure, and had no choice but to cancel the transaction. But then he found that his bank card was deducted more than 17,000 yuan, and only then did he react that he had been deceived. Therefore, it is necessary to establish a sense of prevention, improve the understanding of two-dimensional codes, and learn to use two-dimensional codes correctly.

Although the liar is cunning, he does not change the medicine when he changes the soup. When we use it every day, we should pay attention to it.

Here are some common pitfalls of QR codes, so be careful:

QR code scams

Fishing QR codes

Receive prizes for free

Wait a minute

So how can we strengthen the security of two-dimensional codes and reduce the risk of scanning codes?

To ensure the safety of QR codes, efforts need to be made in the following four aspects:

When enterprises provide two-dimensional codes to the outside world, they should ensure the security of two-dimensional codes.

When we scan the two-dimensional code, one is to use the terminal by the security identification function, and the other is to have security awareness and not to scan the two-dimensional code from an unknown source.

National legislation protects acts related to QR code payments.

Technological development, there are more secure, suitable for Chinese characters, including more information "Hanxin code".

At present, the two-dimensional code is mainly applicable to mobile payment, so our national payment and clearing association has issued the "Bar Code Payment Business Specification" to various payment institutions, which clearly points out the security standards that payment institutions need to comply with to carry out bar code business, which is also to ensure that we are more secure when using two-dimensional codes in daily life. And we must also establish a sense of prevention, improve the understanding of the two-dimensional code, correctly use the two-dimensional code, pay attention to the protection of the payment code when shopping and payment, so that the two-dimensional code brings more convenience to our lives.

With the development of science and technology in the mainland, our country is also developing our own "two-dimensional code" - Hanxin code, on July 28, 2021, Hanxin code ISO international standard project was unanimously approved. On August 27, Hanshe Code ISO international standard ISO/IEC 20830 "Information technology — Automatic identification and data capture techniques — Han Xin Code bar code symbology specification) officially published. This is our country's independent research and development, and compared with other two-dimensional codes in the world, Hanxin code is more suitable for the expression of Chinese character information, and can accommodate more information.

The reproduced content represents the views of the author only

Does not represent the position of the Institute of Physics, Chinese Academy of Sciences

If you need to reprint, please contact the original public account

Source: ZTE Documentation

Edit: Lychee jelly

Read on