Dot matrix generating and reading method

By combining customized information output parameters and error correction information, an adaptive dot matrix image is generated, which solves the problems of long reading time, large reading area and insufficient security in QR code and micro-dot matrix technology, and realizes efficient and flexible information reading and enhanced anti-counterfeiting capabilities. It is suitable for the fields of traceability and logistics management.

CN120671706AActive Publication Date: 2025-09-19DANDE IMAGE MASTER CO LTD ZHUHAI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510861605.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-09-19
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

In the field of anti-counterfeiting and traceability, existing technologies such as QR codes and micro-dot matrix technologies have problems such as long reading time, large area, insufficient security, and difficulty for ordinary consumers to quickly query. In addition, there is a risk of uneven dot matrix and fixed positioning in the micro-dot matrix design, which is easy to crack.

Method used

By combining customized information output parameters, error correction information, and security information, an adaptive dot matrix image is generated. Customized positioning information and length and width parameters are used to achieve flexible processing and fast decoding of dot matrix images, supporting diverse information encoding and decoding requirements.

Benefits of technology

It improves the information carrying capacity and reading efficiency, enhances the security and anti-counterfeiting capabilities of information, ensures the integrity and accuracy of information, adapts to information reading in different devices and scenarios, and meets the needs of ordinary consumers and professionals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671706A_ABST
    Figure CN120671706A_ABST
Patent Text Reader

Abstract

The invention provides a dot matrix generating and reading method. The dot matrix generating and reading method comprises the steps of dot matrix generating, wherein information output parameters are set; processing the original information, the error correction information and the self-defined security information to form a to-be-converted information sequence; converting the processed information sequence into a dot matrix form according to set information output parameters; outputting the generated dot matrix image; a dot matrix reading step: preprocessing the obtained dot matrix image; calculating the number N of communicated areas in the dot matrix image, and determining the central point of each communicated area and the distance between the points; the corresponding proportion of the distance d0 is calculated in a self-adaptive mode according to the distance between the points; and determining positioning candidates by using self-defined positioning information and length and width parameters, extracting information from the dot matrix image according to a scanning method for decoding, and finally outputting the decoded information. By applying the method, the problems of uneven dot matrix, fixed positioning and extensible tiling in closed-loop micro dot matrix design can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a dot matrix generation and reading method. Background Art

[0002] With the rapid development of information technology, traceability and logistics management are playing an increasingly important role across all industries. Currently, QR codes and barcodes are widely used in the industry for information transmission. These technologies, backed by sophisticated traceability system software and fast-reading devices such as personal digital assistants (PDAs), enable fast and convenient information access and query, significantly improving logistics efficiency and product traceability.

[0003] Information technology also plays a key role in anti-counterfeiting. Encrypted QR codes, as a key anti-counterfeiting measure, encrypt the original information and create a QR code, or embed unique security information while being compatible with universal QR code recognition software. This not only verifies the QR code's origin but also reduces the risk of mass production of counterfeit codes by unscrupulous individuals after the code package is leaked. However, the added encryption step of encrypted QR codes increases the decoding time required. Furthermore, to be compatible with conventional QR codes, the error correction capability of the code needs to be improved, which often results in an increase in the output code size, further increasing the time and area costs of operations such as tracing.

[0004] On the other hand, micro-dot matrix technology, as an emerging anti-counterfeiting method, converts information into binary and encodes it (including error correction), then performs high-resolution printing according to the sequence of designed positioning points and output binary. An encryption step is inserted during the information conversion process, forming a closed loop of generation and reading, effectively preventing the mass production of counterfeit codes. Micro-dot matrix technology is particularly suitable for applications where the surface area is too small to use a QR code or where higher security requirements are required. Furthermore, by tiling or linking micro-dot matrix blocks, it can also be used as a background texture over a large area and carry more information. Furthermore, printing micro-dots with invisible ink is restricted to professional use, further enhancing the anti-counterfeiting effect.

[0005] However, whether it is a conventional QR code, barcode or QR code combined with a micro-dot matrix, they all face certain challenges in practical application. First, these technologies all require a certain area to carry information, and while encrypted QR codes improve security, they also increase the area of ​​the output code and the time it takes to read it. Secondly, when these technologies are applied to anti-counterfeiting or traceability, the need for ordinary consumers to participate in inquiries is becoming increasingly prominent. Especially when it comes to products such as food, infant products, and medicines that have high safety requirements, ordinary consumers not only want to participate in authenticity checks, but also often have traceability needs. However, if tampered with by criminals, the act of easily scanning the code to obtain information may become a high-risk phishing behavior, seriously threatening the rights and interests of consumers.

[0006] While micro-dot matrix technology's closed-loop design enhances anti-counterfeiting effectiveness, it also presents some challenges. For example, the simple output method of "0 output, 1 blank" makes it difficult to avoid uneven output of the dot matrix. While distinct positioning points facilitate rapid positioning, the addition of encryption and the design of a uniform output algorithm can open up the possibility of cracking the fixed positioning information. Furthermore, the presence of the positioning information after tiling can lead to uneven dot matrix.

[0007] Therefore, how to develop a new anti-counterfeiting and traceability technology that can read information quickly and conveniently, ensure information security, prevent forgery and tampering, and meet the different needs of ordinary consumers and professionals has become an urgent problem to be solved in the current industry. Summary of the Invention

[0008] In response to various problems existing in the existing technology, the present invention provides a dot matrix generation and reading method, aiming to solve the problems of dot matrix unevenness, fixed positioning and scalable tiling in closed-loop micro-dot matrix design. It can efficiently and flexibly process different data types and support encryption functions to meet the diverse needs of information encoding and decoding in fields such as traceability and logistics management.

[0009] Furthermore, this invention integrates existing front-end software technologies (applets, web pages, etc.) for acquiring high-quality images, allowing consumers to quickly and easily query and provide feedback on anti-counterfeiting and traceability information. Through clever design, this invention combines security information, error correction information, and original information, customizing positioning information, and effectively and quickly addressing the aforementioned issues even when the micro-dot array output area is irregular.

[0010] The present invention achieves the above-mentioned purpose through the following technical solutions: A method for generating and reading a dot matrix, comprising: Steps to generate the dot matrix: Setting information output parameters; processing original information, error correction information, and customized security information to form an information sequence to be converted; converting the processed information sequence into a dot matrix form according to the set information output parameters; and outputting the generated dot matrix image; Dot matrix reading steps: Preprocessing the acquired dot matrix image; Calculate the number N of connected areas in the dot matrix image, and determine the center point of each connected area and the distance D(N,N) between the points; The corresponding ratio of the distance d0 is adaptively calculated based on the inter-dot distance D(N,N), and the image magnification is corrected to restore the original ratio of the dot matrix image; Using customized positioning information and length and width parameters, the positioning candidate is determined, and information is extracted from the dot matrix image according to the scanning method for decoding, and finally the decoded information is output.

[0011] According to a dot matrix generation and reading method provided by the present invention, setting information output parameters includes: Determine the area of ​​s0×s0 pixels corresponding to each two bits of output, and simultaneously determine the actual area and shape of the information point; where the distance d0 is the distance between the output points corresponding to each two bits; Customized security information, which is a specific string or data used to enhance the security of the dot matrix. It is encoded into binary form so that it can be converted into a dot matrix together with other information. Calculate and determine the length and width parameters W and H of the final lattice based on the total bit length Len of the combination of the original information, error correction information and security information; Customized positioning information: Customize according to the overall layout of the dot matrix image and security requirements.

[0012] According to a dot matrix generation and reading method provided by the present invention, original information, error correction information and customized security information are encoded, error-corrected and encrypted as needed to form an information sequence to be converted, specifically including: Standardize the format of original information, unify character encoding and remove redundant characters; directly perform binary encoding on customized security information; The pre-processed original information and binary code are converted into a binary bit stream using a preset coding rule to form an initial information sequence; Apply an error correction coding algorithm to the initial information sequence, generating an error correction information sequence with error detection and correction capabilities by adding redundant check bits. The error correction code parameters are dynamically configured based on the importance of the information and the transmission environment. According to security requirements, a symmetric encryption algorithm or an asymmetric encryption algorithm is used to encrypt the error correction information sequence to generate an encrypted information sequence; The encrypted information sequence is concatenated with the unencrypted control information to form a complete information sequence to be converted; among them, the control information is used to identify the information type, encoding method and error correction level to ensure that the receiving end can correctly interpret the information content.

[0013] According to a dot matrix generation and reading method provided by the present invention, when processing customized security information, a string or data or its summary is selected as security information from a predefined character set, a string library, or a string generated according to specific requirements. The string or data is retained as secret information when generating the dot matrix and is not directly displayed in the dot matrix image. The customized security information is converted into binary form according to ASCII code or other predetermined encoding methods so that it can be encoded and converted together with other information during the dot matrix generation process.

[0014] According to a dot matrix generation and reading method provided by the present invention, when customizing positioning information, a secret security element is incorporated into the positioning information, and the positioning information includes a positioning output code and position information of the entire information range; In the process of calculating and outputting all the encoded information and security information to form an information block, the arrangement of all information points in the information block, including the positioning points, follows the following rules: Seamless arrangement rule: When all points to be arranged (including positioning points and information points) need to be seamlessly arranged, all points to be arranged are arranged according to the s0×s0 pixels and the distance d0, after representing two bits, and the predetermined geometric arrangement method, and then filled in sequentially to ensure that adjacent information points are closely adjacent to each other without more blank spaces, so as to achieve spatial continuity and integrity of the information block; Seam arrangement rule: When the density of the entire output point needs to be controlled, all points to be arranged are arranged using a blanking method. Specifically, after arranging the points representing two bits based on the s0×s0 pixels and the distance d0, a certain blank area is left between the two bits of information according to a preset blanking ratio and blanking pattern, as well as a predetermined geometric arrangement. The blanking ratio and blanking pattern are set based on at least one of the overall layout requirements of the information block and the output density. According to a dot matrix generation and reading method provided by the present invention, the dot matrix generation step further includes tiling of information blocks: Define the tiling rules of information blocks, which allow the dot matrix image of an information block to be randomly tiled and expanded seamlessly, nearly seamlessly, or without repetition in any given area. When tiling, the edge information of adjacent information blocks can be connected by adding random numbers through preset matching rules. During the tiling process, each information block can be dynamically generated according to the final length and width parameters W and H, the final output image size, and the internal logic of the dot matrix image.

[0015] According to a dot matrix generation and reading method provided by the present invention, in the dot matrix reading step, the number N of connected areas, the center point, and the distance D(N,N) between the points are calculated, including: Perform connected area analysis on the pre-processed dot matrix image, identify and mark all connected areas in the image, and count the total number of connected areas as N; For each detected connected area, calculate the coordinates of its geometric center point (xi, yi), where i = 1, 2, 3, ..., N, as the representative position of the connected area; Based on the coordinates (xi, yi) of the center points of each connected area, the Euclidean distance between any two center points is calculated to construct an N×N-dimensional distance matrix D(N,N), where the matrix element D(i,j) represents the distance between the center points of the i-th and j-th connected areas, and D(i,j)=D(j,i), and the diagonal element D(i,i)=0; Sort each column of the distance matrix D(N,N) from small to large to obtain the sorted distance matrix Sd(N,N); extract the second row of the sorted matrix Sd(N,N), that is, when i=2, all elements of the distance set corresponding to each center point to its nearest neighbor except itself, recorded as Sd(2,1:N); Calculate the arithmetic mean of all distance values ​​in Sd(2,1:N), and use the mean as the average distance D0 between every two bits of output information points in the dot matrix image.

[0016] According to a dot matrix generation and reading method provided by the present invention, based on a preset distance d0 and an average distance D0 actually calculated, a magnification relationship between the two is calculated, that is, R=D0 / d0, where R represents the magnification of the dot matrix image during actual reading relative to the preset standard during generation.

[0017] According to a dot matrix generation and reading method provided by the present invention, when determining positioning candidates, based on the customized positioning information, a positioning feature that meets the information is searched in the dot matrix image, and all searched areas that may meet the positioning conditions are marked as positioning candidates; Verify the validity of each candidate location based on the length and width parameters H and W of the dot matrix image. The verification process at least includes checking whether the candidate area is within the valid range of the dot matrix image, whether the size of the candidate area matches the preset H and W parameters, and whether the candidate area meets other predefined positioning constraints. Each group of positioning candidates that passes the validity verification is used as a candidate for an information block. According to the preset scanning method, information points are scanned in the positioning candidate area according to the preset path and sequence, and all bits of the information block are obtained in each scan.

[0018] According to a dot matrix generation and reading method provided by the present invention, the information bit sequence in a scanned information block is divided according to the reverse order of the dot matrix generation to restore the original data information sequence; the encoded information of the restored data information sequence is extracted using custom security information, and then an error correction code decoding algorithm is applied to correct errors that may occur during transmission or storage based on the previously embedded error correction information, thereby obtaining the accurate original information of the information block.

[0019] For the dot matrix output after tiling multiple information blocks, the above process can be repeated to obtain multiple blocks of error-corrected original information, and the voting rule can be used to obtain the final accurate original information.

[0020] It can be seen that the dot matrix generation and reading method of the present invention has the following significant beneficial effects compared with the prior art: This invention converts the original information, error correction information, and customized security information into a dot matrix format, effectively increasing the information carrying capacity while ensuring the integrity and recoverability of the information. As a new type of information carrier, dot matrix images can carry more information in a smaller area than traditional QR codes or barcodes, and the reading process is more efficient and convenient.

[0021] The embedding of custom security information and the addition of error correction information make the generated dot matrix image more resistant to counterfeiting. Even if the dot matrix image is damaged to some extent during transmission or storage, the error correction information can be used to restore the original data, thus ensuring the accuracy and security of the information. In addition, the application of custom positioning information and length and width parameters further increases the difficulty of cracking, effectively preventing forgery and tampering.

[0022] The present invention calculates the number of connected areas and the distance between dots in a dot matrix image, adaptively calculates the corresponding ratio of the distance d0, and corrects the image magnification, so that the dot matrix image can maintain the original ratio when output at different magnifications or sizes, ensuring accurate reading and rapid analysis of information. This is particularly important for dot matrix images that need to be applied in different scenarios, such as printed materials, display screens, etc., and is also important for users who need to use different acquisition devices to capture images, such as mobile phones and PDAs from different manufacturers.

[0023] Utilizing customized positioning information and length and width parameters, the present invention accurately determines positioning candidates and extracts information from the dot matrix image for decoding based on a pre-set scanning method. This flexible positioning and decoding mechanism not only improves reading efficiency but also enhances the system's compatibility and scalability. Both ordinary consumers and professionals can quickly and accurately obtain information from the dot matrix image using the corresponding reading device or software.

[0024] The dot matrix generation and reading methods of the present invention have broad application prospects. In the fields of traceability and logistics management, they can serve as important means for product identification and information transmission, improving logistics efficiency and product traceability. In the field of anti-counterfeiting, they can serve as an effective tool to prevent counterfeiting and tampering, protecting the rights and interests of consumers. Furthermore, they can be applied to various fields, such as bills, certificates, and artworks, providing new solutions for information management and anti-counterfeiting in these fields.

[0025] In summary, the dot matrix generation and reading method of the present invention achieve efficient information carrying and reading, enhanced anti-counterfeiting and security, adaptive image magnification correction, and broad application prospects through innovative technical means and flexible application mechanisms, providing strong support for technological progress and industrial development in related fields.

[0026] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of an embodiment of a dot matrix generation and reading method of the present invention.

[0028] Figure 2 This is a flow chart of the dot matrix generation steps in an embodiment of a dot matrix generation and reading method of the present invention.

[0029] Figure 3 This is a flow chart of the dot matrix reading steps in an embodiment of a dot matrix generation and reading method of the present invention.

[0030] Figure 4 This is a schematic diagram of a design example of every two-bit output in an embodiment of a dot matrix generation and reading method of the present invention.

[0031] Figure 5 This is a schematic diagram of a two-bit output design example when s0 is an even number in an embodiment of a dot matrix generation and reading method of the present invention.

[0032] Figure 6 It is a schematic diagram of a design example of positioning 1212 and positioning 0123 in an embodiment of a dot matrix generation and reading method of the present invention.

[0033] Figure 7 It is a schematic diagram of 1 bit of a scanning method (information storage) in an embodiment of a dot matrix generation and reading method of the present invention.

[0034] Figure 8 This is a schematic diagram of a dot matrix generation and reading system in an embodiment of a dot matrix generation and reading method of the present invention.

[0035] Figure 9This is a diagram showing the effects of different outputs in an embodiment of a dot matrix generation and reading method of the present invention. DETAILED DESCRIPTION

[0036] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0037] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0038] See also Figures 1 to 9 , this embodiment provides a method for generating and reading a dot matrix, such as Figures 1 to 3 As shown, the method includes: Steps to generate the dot matrix: Setting information output parameters; processing original information, error correction information, and customized security information to form an information sequence to be converted; converting the processed information sequence into a dot matrix form according to the set information output parameters; and outputting the generated dot matrix image; Dot matrix reading steps: Preprocessing the acquired dot matrix image; Calculate the number N of connected areas in the dot matrix image, and determine the center point of each connected area and the distance D(N,N) between the points; The corresponding ratio of the distance d0 is adaptively calculated based on the inter-dot distance D(N,N), and the image magnification is corrected to restore the original ratio of the dot matrix image; Using customized positioning information and length and width parameters, the positioning candidate is determined, and information is extracted from the dot matrix image according to the scanning method for decoding, and finally the decoded information is output.

[0039] In the above-mentioned dot matrix generation step, the information output parameters are set, including: Determine that every two bits correspond to an output area of ​​s0×s0 pixels; Determine the area of ​​s0×s0 pixels corresponding to each two-bit output, and simultaneously determine the actual area and shape of the information point; where the distance d0 is the distance between the output points corresponding to each two bits. Alternatively, the distance d0 can also be the straight-line distance from the center of the information point to its corresponding center point or reference point; Customized security information, which is a specific string or data used to enhance the security of the dot matrix. It is encoded into binary form so that it can be converted into a dot matrix together with other information. Calculate and determine the length and width parameters W and H of the final lattice based on the total bit length Len of the combination of the original information, error correction information and security information; Customized positioning information: Customize according to the overall layout of the dot matrix image and security requirements.

[0040] In the above-mentioned dot matrix generation step, the original information, error correction information and customized security information are encoded, error-corrected and encrypted as needed to form an information sequence to be converted, which specifically includes: Standardize the format of original information, unify character encoding and remove redundant characters; directly perform binary encoding on customized security information; The pre-processed original information and binary code are converted into a binary bit stream using a preset coding rule to form an initial information sequence; Apply an error correction coding algorithm to the initial information sequence, generating an error correction information sequence with error detection and correction capabilities by adding redundant check bits. The error correction code parameters are dynamically configured based on the importance of the information and the transmission environment. According to security requirements, a symmetric encryption algorithm or an asymmetric encryption algorithm is used to encrypt the error correction information sequence to generate an encrypted information sequence; The encrypted information sequence is concatenated with the unencrypted control information to form a complete information sequence to be converted; among them, the control information is used to identify the information type, encoding method and error correction level to ensure that the receiving end can correctly interpret the information content.

[0041] When processing customized security information, this embodiment selects a string or data or its summary as security information from a predefined character set, a string library, or a string generated according to specific requirements. The string or data is retained as secret information when generating the dot matrix and is not directly displayed in the dot matrix image. The customized security information is converted into binary form according to ASCII code or other predetermined encoding methods so that it can be encoded and converted together with other information during the dot matrix generation process.

[0042] In this embodiment, when customizing the positioning information, a security element as a secret is incorporated into the positioning information, and the positioning information includes the positioning output code and the position information of the entire information range; In the process of calculating and outputting all the encoded information and security information to form an information block, the arrangement of all information points in the information block, including the positioning points, follows the following rules: Seamless arrangement rule: When the output points within an information block need to be seamlessly arranged, all points to be arranged are arranged according to the pre-designed s0×s0 and d0 to represent two bits of information points, and the predetermined geometric arrangement method, and then filled in sequentially to ensure that adjacent information points are closely adjacent to each other without more blank spaces, so as to achieve spatial continuity and integrity of the information block; Seam arrangement rule: When the density of the entire output point needs to be controlled, all information points, including the positioning point, are arranged using a blanking method. Specifically, after arranging the information points representing two bits according to the pre-designed s0×s0 and d0, a certain amount of blank space is left between the information points according to the preset blanking ratio and blanking mode. The blanking ratio and blanking mode are set based on at least one of the overall layout requirements of the information block and the output density. The positioning information in this embodiment is part of the secret security information, including the positioning output code encompassing the entire information range (that is, each positioning point is two bits) and the position (the simplest example is a rectangle: which two bits appear as the secret in the top left, bottom left, top right, and bottom right positions, respectively? These bits are not found in the pattern, but are stored as secrets in the background). When customizing positioning information, a secret security element is incorporated into the positioning information (this can be understood as each of the four positioning points appearing differently, i.e., eight bits are used to describe the positioning information, acting as a secret. This secret is required for subsequent traversal of positioning candidates and decoding scanning). Therefore, during the dot matrix generation process, even identical information can appear differently in different batches.

[0043] The lattice generation step also includes: Define the tiling rules of information blocks, which allow the dot matrix image of the information block to be randomly tiled and expanded seamlessly, nearly seamlessly, or without repetition in any given area. When tiling, the edge information of adjacent information blocks can be connected by adding random numbers through preset matching rules. During the tiling process, each information block can be dynamically generated according to the final length and width parameters W and H, the final output image size, and the internal logic of the dot matrix image.

[0044] In the dot matrix reading step, the number of connected areas N, the center point, and the distance between points D(N,N) are calculated by: Perform connected area analysis on the pre-processed dot matrix image, identify and mark all connected areas in the image, and count the total number of connected areas as N; For each detected connected area, calculate the coordinates of its geometric center point (xi, yi), where i = 1, 2, 3, ..., N, as the representative position of the connected area; Based on the coordinates (xi, yi) of the center points of each connected area, the Euclidean distance between any two center points is calculated to construct an N×N-dimensional distance matrix D(N,N), where the matrix element D(i,j) represents the distance between the center points of the i-th and j-th connected areas, and D(i,j)=D(j,i), and the diagonal element D(i,i)=0; Sort each column of the distance matrix D(N,N) from small to large to obtain the sorted distance matrix Sd(N,N); extract the second row of the sorted matrix Sd(N,N), that is, when i=2, all elements of the distance set corresponding to each center point to its nearest neighbor except itself, recorded as Sd(2,1:N); Calculate the arithmetic mean of all distance values ​​in Sd(2,1:N), and use the mean as the average distance D0 between every two bits of output information points in the dot matrix image.

[0045] Based on the preset distance d0 and the actually calculated average distance D0, the magnification relationship between the two is calculated, that is, R=D0 / d0, where R represents the magnification of the dot matrix image during actual reading relative to the preset standard during generation.

[0046] When determining positioning candidates, based on the customized positioning information, the positioning features that meet the information are searched in the dot matrix image, and all the searched areas that may meet the positioning conditions are marked as positioning candidates; Verify the validity of each candidate location based on the length and width parameters H and W of the dot matrix image. The verification process at least includes checking whether the candidate area is within the valid range of the dot matrix image, whether the size of the candidate area matches the preset H and W parameters, and whether the candidate area meets other predefined positioning constraints. For the positioning candidate group that has passed the validity verification, it is used as a candidate for an information block. According to the preset scanning method, the information points are scanned in the positioning candidate area according to the preset path and sequence, and all bits of the information block are obtained in each scan.

[0047] The information bit sequence in a scanned information block is divided in the reverse order of the dot matrix generation to restore the original data information sequence; for the restored data information sequence, the encoded information is extracted using custom security information, and then the error correction code decoding algorithm is applied to correct errors that may occur during transmission or storage based on the previously embedded error correction information to obtain the accurate original information of the information block.

[0048] For the dot matrix output after multiple information blocks are tiled, the above process is repeated to obtain multiple blocks of original information after error correction, and the voting rule is used to obtain the final accurate original information.

[0049] In practical applications, the specific design of the dot matrix generation and reading method provided in this embodiment includes: (1) Information output parameter design and dot matrix generation a) Data information version; b) Number of pixels output per two bits s0×s0; c) Two-bit output information; d) Security information; e) Error correction code (conventional RS, BCH, etc. can be used); f) Length and width parameters W, H; g) Positioning information; h) Encryption method (conventional DES, AES, etc. can be used); i) Tiling method; j) Scanning method.

[0050] (2) Dot matrix reading a) Image preprocessing, including denoising and binarization (both of which can be performed using conventional methods); b) Linear fitting, if necessary, and image correction; c) Calculation of the number N of connected regions, center points, and inter-point distances D(N,N); d) Adaptive calculation of the distance D0 corresponding to d0 and its ratio; e) Using other parameters, determine candidate locations and perform decoding; f) Repeat step e until the entire image is processed and the decoded information is output.

[0051] The data information version (3 bits) of this embodiment includes: Only numbers (000), numbers + English characters (001), ASCII code (010), Chinese characters (011), and whether to encrypt 1 bit: In the case of only numbers (000), convert directly to binary; There are 26×2+10=52 characters in total, including numbers + English characters (001), and each character is encoded with 6 bits; ASCII code (010): ASCII code (0-127), including characters that cannot be displayed, there are 128 in total, which can be directly encoded according to the ASCII code, with each character having 7 bits (which can be expanded to 8 bits in actual use, including characters that cannot be displayed); Chinese characters (011): Chinese character encoding, encoded according to national standard Chinese character encoding (such as GB2312, GBK, etc.).

[0052] This embodiment supports multiple data types such as numbers, English characters, ASCII codes, and Chinese characters, and achieves flexible switching through version identification, meeting the diverse needs in different application scenarios.

[0053] The number of pixels s0×s0 outputted for every two bits is designed to represent the distance d0 between the two bits of information points, and the area of ​​the information points (the parameter can be set to a specific area, including output shapes such as dots and squares, as well as special shapes such as five-pointed stars and triangles; followed by 1 pixel). s0 can be either an odd number or an even number, that is, every two bits will be output as a square with an area of ​​s0×s0; Figure 4 In (a), (b), and (c), s0 is 7, and d0 is 2, 2.83, and 2.24, respectively, meaning they have different angles to the center point, while their areas are all 1 pixel or a set size. Figure 5 As shown, s0 is an even number 8, and d0 is 2; Figure 4 and Figure 5 As shown, there are 24 possible combinations of 0123 for every two bits to determine a certain direction == 4×3×2×1; Figure 4 The following are examples of two-bit output designs (24 combinations at each angular distance). Figure 5 This example shows a two-bit output design when s0 is an even number (same as above, there are 24 possible designs for each angular distance).

[0054] In this embodiment, the custom security information is treated as a secret and encoded in binary. For example, the secret AnQuan in the data information mode (10) has an ASCII code of 65 110 81 117 97 110, which is then converted to binary. In addition, when processing the custom security information and the encoded data, a simple XOR or encryption algorithm such as DES can be used.

[0055] The error correction code of this embodiment may use conventional RS, BCH, etc.

[0056] In this embodiment, the length and width parameters W and H are calculated based on the bit length Len of the combined original information, error correction information, and security information (encrypted if necessary). W and H are calculated to minimize the area or perimeter, or they can be set based on a specified area. Because all information, Len, is grouped in two-bit groups, the number of information groups is Len / 2. If Len is an odd number, zeros are padded to make it an even number. Adding four groups of positioning information results in a total of (Len / 2)+16 groups. Based on the square area, W=H=sqrt((Len / 2)+16), rounded up. For example, if Len is 85, then sqrt(43+16)=7.68, so W=H=8.

[0057] The positioning information of this embodiment is based on the premise that the security information is determined. The positioning information is used as one of the secrets, such as 1212 and 0123. Figure 6 shown (clockwise).

[0058] This embodiment selects a scanning mode according to the scanning method identifier: If the scanning method is identified as 0, the zigzag scanning method is used to fill the 32 sets of data into the dot matrix along a zigzag path.

[0059] If the scanning method is identified as 1, the conventional scanning method is used to fill the 32 sets of data into the dot matrix in sequence.

[0060] like Figure 7 As shown, Figure 7 Add 10 bits of information, 32 bits of error correction code, and 22 bits of security information, for a total of 64 bits of data. If equal-length encryption is used, the result is 64 bits, which are then filled into the dot matrix in groups of two according to the design method of scanning method b), forming the basic dot matrix of the information block containing specific information.

[0061] In this embodiment, a dot matrix image, i.e., an information block, is allowed to be randomly tiled and expanded seamlessly, nearly seamlessly, or without repetition within any given area. When tiling the information blocks, the edge information of adjacent information blocks is connected according to a preset matching rule. On the basis of satisfying the matching rule, the connection of the edge information can be further optimized by adding random numbers to enhance the complexity and security of the overall image after tiling. During the tiling process, each information block dynamically generates a complete information block that meets the requirements based on the final length and width parameters W and H and the final output image size, combined with the internal logical relationship of the dot matrix image itself, to ensure that the overall image after tiling has good layout rationality and data integrity while meeting the information carrying and display requirements.

[0062] The image preprocessing of this embodiment includes denoising and binarization. Mean filtering or median filtering can be used for denoising first, and the adaptive binarization can use the Otsu method or the percentage method, specifically including: De-noising: Use the mean filtering algorithm or the median filtering algorithm to denoise the dot matrix image. The mean filtering algorithm replaces the central pixel value by calculating the average value of the pixel values ​​in the local area of ​​the image to smooth the image and reduce noise; the median filtering algorithm replaces the central pixel value by selecting the median value of the pixel values ​​in the local area of ​​the image to effectively remove isolated noise points such as salt and pepper noise.

[0063] Binarization processing: Based on the denoised image, an adaptive binarization method is used for image segmentation. Specifically, the Otsu method or the percentage method is used to determine the binarization threshold. Among them, the Otsu method automatically determines the optimal threshold by maximizing the between-class variance and divides the image into foreground and background. The percentage method selects a specific percentage position as the threshold according to the distribution of image pixel values, and sets the area in the image with pixel values ​​higher than the threshold as the foreground, and the area below the threshold as the background, thereby realizing image binarization processing.

[0064] In this embodiment, the number N of connected areas, the center points, and the distances between them D(N,N) are calculated. The coordinates of the center points of the N connected areas are assumed to be (xi, yi), i=1, 2, 3, ..., N. The pairwise distances D(N,N) are symmetric matrices with a diagonal of 0. Each column is sorted from small to large to obtain Sd(N,N). Then Sd(2,1:N) is the total distance to the nearest neighbor, and its average is the distance D0 between the points representing two bits. The ratio of d0 is calculated: the ratio of the parameter d0 is derived as R=D0 / d0. When image correction is required after image preprocessing, the following straight line fitting and correction method is used: Straight line fitting step: performing straight line fitting processing on the center points of the pre-processed dot matrix image using a conventional straight line fitting algorithm, the straight line fitting algorithm including but not limited to the Hough transform algorithm, to obtain multiple fitted straight lines that may exist in the image; selecting the fitted straight lines for correction from the majority of fitted straight lines, the screening criteria being: selecting straight lines with an angle range of within ±45 degrees and straight lines perpendicular to these straight lines; at the same time, the center points included in these straight lines must satisfy the requirement that the distances between any two of them are basically in an integer multiple relationship, and the number of center points that meet this integer multiple relationship accounts for more than 95% of the total number of center points on the straight line, thereby ensuring that the selected straight line is a straight line formed by the center points of the information points in the dot matrix image, and preventing the information points themselves from appearing on the straight line used to determine the direction and interfering with the correction process; Image correction steps: Magnification and rotation correction: Based on the selected correction fitting line, the image magnification ratio and rotation angle are calculated. By performing corresponding scaling and rotation operations on the image, the image is initially corrected so that the dot matrix image reaches a relatively standard state in terms of overall scale and direction. Inverse perspective transformation correction (optional): If perspective distortion still exists in the image after magnification and rotation correction, the corresponding ratio of distance d0 is further adaptively calculated based on the inter-point distance D(N,N). The intersection points of the fitted lines near the four corners of the dot matrix image are selected as control points. The inverse perspective transformation matrix is ​​calculated based on the relationship between the actual and ideal positions of these control points. This matrix is ​​used to perform inverse perspective transformation on the image, thereby eliminating the perspective distortion and restoring the dot matrix image to a standard rectangle or an image that conforms to the preset shape, providing a guarantee for the subsequent accurate reading of the dot matrix information.

[0065] During the dot matrix image reading process, the following operations are performed for the image positioning and information decoding steps: Acquiring candidate locations: Based on pre-defined positioning information, which serves as the key identifier for dot matrix image positioning, a specific matching algorithm or feature recognition method is used to search for feature areas that match the secret information in the pre-processed dot matrix image, thereby obtaining multiple candidate locations. These candidate locations are determined based on potential locations where the secret information may appear in the image, providing candidate points for subsequent image positioning and information extraction. Candidate validity determination: Based on a predefined information block size, dot matrix image height H, and width W parameters, which define the standard size and structural characteristics of the dot matrix image, for each set of candidate positioning positions, the image area centered on it is checked to see if it meets the size and structural requirements specified by H and W. Specifically, parameters such as pixel distribution, dot matrix spacing, and number of feature points within this area are calculated and compared with theoretical values ​​derived based on the information block size, H, and W. If the comparison results are within the preset error range, the candidate positioning group is determined to be valid, meaning that this group of positions is highly likely to be the actual positioning positions of the dot matrix image. Information Acquisition and Decoding: For candidate positions of a determined positioning group, information is extracted bit by bit from the dot matrix image using the corresponding scanning path and rules, according to the scanning method in the generation parameter j set when the dot matrix image was generated. During the extraction process, two bits of information are read as a group. Subsequently, the read information sequence is reversed to restore the original data arrangement when the dot matrix image was generated. After that, a preset error correction code decoding algorithm is used to perform error correction decoding on the reversed data sequence to remove errors that may have been introduced during transmission or storage, thereby obtaining the accurate original information of the information block. Overall processing and result output: For the positions of multiple positioning candidate groups obtained in the image, repeat the above steps of positioning candidate acquisition, candidate establishment determination, information acquisition and decoding until the entire dot matrix image is fully processed; during the processing process, if there are differences in the results obtained for different information blocks, an election mechanism is used to integrate the results; specifically, the number of occurrences of each possible result is counted, and the result with the largest number of occurrences (i.e., the highest number of votes) is output as the final decoding information, thereby improving the accuracy and reliability of the decoding results and ensuring that the original information can be accurately extracted from the complex dot matrix image.

[0066] That is, after the dot matrix image is tiled, multiple information blocks will be formed in the image; during the decoding process, even if the information of some information blocks is damaged due to various reasons (such as local occlusion or damage of the image), the decoding result corresponding to each information block can still be obtained through the decoding operation; then, the above-mentioned election mechanism is used to vote on the decoding results of each information block, and the final output information is determined based on the voting results; in this way, the redundant information carried by multiple information blocks in the tiled image is fully utilized, the fault tolerance of the entire information extraction process to image damage and interference is enhanced, and the accuracy and completeness of information extraction are further improved.

[0067] like Figure 8 As shown, this embodiment also provides a dot matrix generation and reading system, the system comprising: Dot generation unit: Parameter setting module, used to set information output parameters; A generation module is used to process the original information, error correction information and customized security information to form an information sequence to be converted; according to the set information output parameters, the processed information sequence is converted into a dot matrix form to generate a dot matrix image; Output module, used for outputting the generated dot matrix image; Dot matrix reading unit: An image acquisition module, used for acquiring a dot matrix image; An image preprocessing module, used for preprocessing the acquired dot matrix image; The decoding and output information module is used to extract information from the dot matrix image according to the scanning method, decode it, and finally output the decoded information; The parameter reading module is used to read the relevant parameters that may be contained in the dot matrix image according to actual needs, and provide comprehensive parameter support for the accurate decoding and processing of the dot matrix image.

[0068] Therefore, this embodiment has the following unique design and operation process during the dot matrix image generation and reading process: The information code is composed of original information, error correction information and custom security information. During the information encoding stage, the above three types of information are integrated according to preset rules to form a complete information sequence. To enhance information security, all the integrated information can be encrypted again. The encryption algorithm can be flexibly selected according to actual security needs to ensure the confidentiality and integrity of the information during transmission and storage.

[0069] Customize the positioning information and height and width (H and W) parameters of the dot matrix image. These parameters are not limited to a specific shape (such as a square) and can be flexibly set according to actual application scenarios and needs. For the same original information, different positioning information, height and width parameters, and subsequent dot matrix generation rules can be used to generate dot matrix images with different expressions, achieving diverse output effects and meeting the display needs of different scenarios. During the dot matrix image generation process, the information in the information code is encoded in groups of two bits according to preset rules, and each two bits of information are output to different positions of the dot matrix image according to the encoding rules; through the dot matrix generation algorithm, it is ensured that when the entire dot matrix image is output, the information bits can be relatively evenly distributed in the image, avoiding excessive concentration or sparseness of information, thereby improving the stability and reading accuracy of the dot matrix image.

[0070] During the dot matrix image generation process, another unique dot matrix generation method can also be used to ensure that each center point in the dot matrix image has output information. This design facilitates subsequent linear fitting and positioning operations. When reading the dot matrix image, by calculating the distance between each point in the information code, key information such as image magnification and rotation angle can be adaptively and quickly calculated. This information provides an important prerequisite for image correction (such as when deformation exists and needs to be corrected) and subsequent decoding work. When tiling bitmap images is required, based on customized positioning information, the bitmap images are not restricted to fixed positions in layout and can be flexibly adjusted according to the actual available area. During the tiling process, random information or security information can be added to the periphery of the dot matrix image or other appropriate locations. This additional information not only increases the complexity and security of the dot matrix image, but also allows for cross-verification with the actual security code in the information code, further improving the security and reliability of the information. Regarding the dot matrix generation method, when each center point has an output, this design also allows for a regular distribution of the center points in the dot matrix image, facilitating linear fitting and positioning operations. When reading the dot matrix image, by calculating the distance between each point in the information code, key information such as image magnification and rotation angle can be adaptively and quickly calculated. This information serves as a key prerequisite for subsequent operations such as image correction (if required) and decoding. Unlike traditional QR code algorithms, in the method provided in this embodiment, during the dot matrix generation process, all required parameters and secret information required for decoding do not need to be embedded in the dot matrix image; through the design of customized positioning information and security information, combined with externally stored or transmitted secret information, the secure storage and reading of information is achieved, making the dot matrix image itself difficult to crack, thereby enhancing the security of the information.

[0071] When it is necessary to tile the dot matrix image to adapt to carriers of different areas or shapes, the method provided in this embodiment can flexibly adjust the dot matrix layout through customized positioning information without being restricted by traditional positions; random information or security information can be added to the peripheral area of ​​the dot matrix according to the actual area. This information not only increases the complexity and security of the dot matrix, but can also be cross-checked with the security code in the information code to ensure information integrity.

[0072] During dot matrix generation, the scanning method and information distribution strategy are optimized to ensure that the output positions of every two bits are relatively uniform, avoiding reading difficulties caused by information concentration. During reading, by calculating the distance between the points representing the two bits, key parameters such as image magnification can be quickly and adaptively calculated, providing the prerequisites for image correction (if necessary) and decoding. Unlike traditional QR code algorithms, the parameters and secret information required for decoding in this method do not need to be embedded in the dot matrix. Through customized positioning and security information verification mechanisms, it achieves dual guarantees of flexibility and security. When the dot matrix is ​​tiled, the random information or security information added to the periphery can be mutually verified with the security code in the real data, further enhancing the information anti-counterfeiting capability.

[0073] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0074] The above embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and replacements made by technicians in this field on the basis of the present invention fall within the scope of protection required by the present invention.

Claims

1. A method for generating and reading a dot matrix, characterized in that: include: Steps to generate the dot matrix: Set information output parameters; Processing the original information, error correction information and customized security information to form an information sequence to be converted; According to the set information output parameters, the processed information sequence is converted into a dot matrix form; Output the generated bitmap image; Dot matrix reading steps: Preprocessing the acquired dot matrix image; Calculate the number N of connected areas in the dot matrix image, and determine the center point of each connected area and the distance D(N,N) between the points; The corresponding ratio of the distance d0 is adaptively calculated based on the inter-dot distance D(N,N), and the image magnification is corrected to restore the original ratio of the dot matrix image; Using customized positioning information and length and width parameters, the positioning candidate is determined, and information is extracted from the dot matrix image according to the scanning method for decoding, and finally the decoded information is output.

2. The method according to claim 1, characterized in that Set information output parameters, including: Determine the area of ​​s0×s0 pixels corresponding to each two bits of output, and simultaneously determine the actual area and shape of the information point; where the distance d0 is the distance between the output points corresponding to each two bits; Customized security information, which is a specific string or data used to enhance the security of the dot matrix. It is encoded into binary form so that it can be converted into a dot matrix together with other information. Calculate and determine the length and width parameters W and H of the final lattice based on the total bit length Len of the combination of the original information, error correction information and security information; Customized positioning information: Customize according to the overall layout of the dot matrix image and security requirements.

3. The method according to claim 1, characterized in that The original information, error correction information, and customized security information are encoded, error corrected, and encrypted as needed to form an information sequence to be converted, specifically including: Standardize the format of original information, unify character encoding and remove redundant characters; directly perform binary encoding on customized security information; The pre-processed original information and binary code are converted into a binary bit stream using a preset coding rule to form an initial information sequence; Apply an error correction coding algorithm to the initial information sequence, generating an error correction information sequence with error detection and correction capabilities by adding redundant check bits. The error correction code parameters are dynamically configured based on the importance of the information and the transmission environment. According to security requirements, a symmetric encryption algorithm or an asymmetric encryption algorithm is used to encrypt the error correction information sequence to generate an encrypted information sequence; The encrypted information sequence is concatenated with the unencrypted control information to form a complete information sequence to be converted; among them, the control information is used to identify the information type, encoding method and error correction level to ensure that the receiving end can correctly interpret the information content.

4. The method according to claim 1, wherein: When processing custom security information, a string or data or its summary is selected as security information from a predefined character set, a string library, or a string generated according to specific requirements. The string or data is retained as secret information when generating the dot matrix and is not directly displayed in the dot matrix image. The customized security information is converted into binary form according to ASCII code or other predetermined encoding methods so that it can be encoded and converted together with other information during the dot matrix generation process.

5. The method according to claim 1, wherein: When customizing positioning information, a secret security element is incorporated into the positioning information, which includes the positioning output code and location information of the entire information range; In the process of calculating and outputting all the encoded information and security information to form an information block, the arrangement of all points including positioning points in the information block follows the following rules: Seamless arrangement rule: When all points to be arranged need to be seamlessly arranged, all points to be arranged are arranged according to the s0×s0 pixels and the distance d0, after representing two bits, and the predetermined geometric arrangement method, and then filled in sequentially to ensure that adjacent information points are closely adjacent to each other without more blank spaces, so as to achieve spatial continuity and integrity of the information block; Seam arrangement rule: When it is necessary to control the density of the entire output point, all the points to be arranged are arranged in a blanking manner. Specifically, after arranging the points representing two bits according to the s0×s0 pixels and the distance d0, a certain blank area is left between the information representing the two bits according to the preset blanking ratio and blanking mode, as well as the predetermined geometric arrangement method. The blanking ratio and blanking mode are set based on at least one of the overall layout requirements of the information block and the output density.

6. The method according to claim 5, characterized in that The lattice generation step also includes tiling of information blocks, including: Define the tiling rules of information blocks, which allow the random tiling and expansion of the dot matrix image of an information block in any given area without any overlap, seamless or nearly seamless tiling, or without any overlap. When tiling, the edge information of adjacent information blocks can be connected by adding random numbers according to the preset matching rules. During the tiling process, each information block can be dynamically generated according to the final length and width parameters W and H, the final output image size, and the internal logic of the dot matrix image.

7. The method according to claim 1, characterized in that In the dot matrix reading step, the number of connected areas N, the center point, and the distance between points D(N,N) are calculated by: Perform connected area analysis on the pre-processed dot matrix image, identify and mark all connected areas in the image, and count the total number of connected areas as N; For each detected connected area, calculate the coordinates of its geometric center point (xi, yi), where i = 1, 2, 3, ..., N, as the representative position of the connected area; Based on the coordinates (xi, yi) of the center points of each connected area, the Euclidean distance between any two center points is calculated to construct an N×N-dimensional distance matrix D(N,N), where the matrix element D(i,j) represents the distance between the center points of the i-th and j-th connected areas, and D(i,j)=D(j,i), and the diagonal element D(i,i)=0; Sort each column of the distance matrix D(N,N) from small to large to obtain the sorted distance matrix Sd(N,N); extract the second row of the sorted matrix Sd(N,N), that is, when i=2, all elements of the distance set corresponding to each center point to its nearest neighbor except itself, recorded as Sd(2,1:N); Calculate the arithmetic mean of all distance values ​​in Sd(2,1:N), and use the mean as the average distance D0 between every two bits of output information points in the dot matrix image.

8. The method according to claim 7, wherein: Based on the preset distance d0 and the actually calculated average distance D0, the magnification relationship between the two is calculated, that is, R=D0 / d0, where R represents the magnification of the dot matrix image during actual reading relative to the preset standard during generation.

9. The method according to claim 8, characterized in that: When determining positioning candidates, based on the customized positioning information, the positioning features that meet the information are searched in the dot matrix image, and all the searched areas that may meet the positioning conditions are marked as positioning candidates; Verify the validity of each candidate location based on the length and width parameters H and W of the dot matrix image. The verification process at least includes checking whether the candidate area is within the valid range of the dot matrix image, whether the size of the candidate area matches the preset H and W parameters, and whether the candidate area meets other predefined positioning constraints. Each group of positioning candidates that passes the validity verification is used as a candidate for an information block. According to the preset scanning method, information points are scanned in the positioning candidate area according to the preset path and sequence, and all bits of the information block are obtained in each scan.

10. The method according to claim 9, characterized in that: The information bit sequence in a scanned information block is divided in the reverse order of the dot matrix generation to restore the original data information sequence of the information block; the encoded information is extracted from the restored data information sequence using the custom security information, and then the error correction code decoding algorithm is applied to correct errors that may have occurred during transmission or storage based on the previously embedded error correction information to obtain the accurate original information of the information block; Among them, for the dot matrix output after multiple information blocks are tiled, the above process can be repeated to obtain multiple blocks of original information after error correction, and the voting rule can be used to obtain the final accurate original information.

Citation Information

Patent Citations

  • Efficient information lattice image and its generation and decoding method

    CN101086761A

  • Hexagonal information encoding article process and system

    CN1039672A

  • Literature chart extraction and classification method and system, computer equipment and storage medium

    CN118135582A