banner
Home » Knowledge » Content
Product Categories

What is the principle of two-dimensional code?

- Jun 05, 2018 -

What is the principle of two-dimensional code?


Introduction: What is the principle of two-dimensional code? Do not know when to start, our life is suddenly full of two-dimensional code, look at the page to scan the QR code, add friends to scan the QR code, and now the grandfather who sells strawberries under the stairs to support scan code payment.


What is the principle of two-dimensional code? Do not know when to start, our life is suddenly full of two-dimensional code, look at the web page to scan the QR code, add friends to scan the QR code, and now the grandfather who sells strawberries under the stairs to support scan code payment, Well, have you ever wondered how this strangely-viewed QR code came from? What is its principle? You will know after reading


Actually, you may have guessed before introducing the principle of two-dimensional code. The two-dimensional code is to translate information into black and white small squares, and then fill in this big square, which is similar to the answer sheet for high school exams. It is to turn information into machines. You can scan the pattern and you will know how many points you have scored in a second. Of course, the principle of the two-dimensional code and the answer sheet are not quite the same, as we will discuss later.


Let's first talk about the two-dimensional code brother - bar code. That is, the black-and-white bar scanned by a time-out cashier, the computer can identify the black and white bar with uneven thickness in the horizontal direction, and can find out the product number information contained therein, compared to the bar code carrying information in only one dimension. "Two-dimensional code" carries information in both horizontal and vertical dimensions, and it also looks like a square. Barcodes and two-dimensional codes are white for good brothers. They are actually numbers, letters, symbols, etc. The characters changed clothes and dressed up as black and white strips or blocks that could be recognized by the cell phone camera. Then, the most critical question is, how do these characters become such two-dimensional code patterns?


This refers to a great invention "binary" with epoch-making significance. The number we usually use. Characters, characters, and other characters, although the style is completely different, but witty humans invented a method, so that they can be uniformly converted to a binary sequence of 0 and 1, the conversion process is called encoding, internationally There are several sets of common coding rules. Let's use an example today to feel how coding works. For example, AB is a character composed of two English letters. According to the encoding rules, each individual English letter has a unique decimal number corresponding to it. However, a string such as AB must be calculated based on the corresponding number. , And the result of the operation is converted to binary, and it becomes a number like "000111001101". Oh yeah, the whole computer and internet civilization are built on this kind of binary code. You now see the video, no matter in your In fact, a computer or a mobile phone is just a string of 0's and 1's.


Let's go back to the generation principle of QR code. After a character becomes a sequence of numbers consisting only of 0's and 1's, after a series of optimization algorithms (in this case, we make up a series of optimization algorithms), we get the final binary code. . In the last string of codes, a 0 corresponds to a 'white box' and a 1 corresponds to a 'black box'. We divide these small boxes into groups of 8 and fill it into a large box. It is a complete two-dimensional code pattern that can be recognized by the mobile phone camera.


If you want to ask why there are 3 big squares on all the QR code corners, actually these 3 identical squares are used to position the camera. If you don’t believe it, you will sweep away, whether you are scanning or scanning. Or is it the same result of oblique scanning?