CN108073966B - Conversion method of two-dimensional code and hole array code - Google Patents

Conversion method of two-dimensional code and hole array code Download PDF

Info

Publication number
CN108073966B
CN108073966B CN201711328465.XA CN201711328465A CN108073966B CN 108073966 B CN108073966 B CN 108073966B CN 201711328465 A CN201711328465 A CN 201711328465A CN 108073966 B CN108073966 B CN 108073966B
Authority
CN
China
Prior art keywords
code
hole array
converting
dimensional code
array code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711328465.XA
Other languages
Chinese (zh)
Other versions
CN108073966A (en
Inventor
梅领亮
龚奇峰
肖聪
廖良树
徐地华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Zhengye Technology Co Ltd
Original Assignee
Guangdong Zhengye Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Zhengye Technology Co Ltd filed Critical Guangdong Zhengye Technology Co Ltd
Priority to CN201711328465.XA priority Critical patent/CN108073966B/en
Publication of CN108073966A publication Critical patent/CN108073966A/en
Application granted granted Critical
Publication of CN108073966B publication Critical patent/CN108073966B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details

Abstract

The invention relates to the technical field of product production and discloses a conversion method of a two-dimensional code and a hole array code. When the m × m specification is greater than the preset threshold, the conversion method comprises the following steps: the two-dimensional code with the m x m specification is converted into a binary table with the m x m specification, the binary table is divided into at least two binary table parts from the whole, each part is converted into a corresponding hole array code local graph, and finally all the hole array code local graphs are combined into a complete hole array code graph, so that the hole array code is formed. When the m × m specification is not greater than the preset threshold, the conversion method comprises the following steps: the two-dimensional code with the m × m specification is converted into a binary table with the m × m specification, the binary table is converted into a decimal table with the m × 1 specification, the decimal table with the m × 1 specification is converted into a hole array code diagram with the m × 1 specification, and accordingly the hole array code is formed. The embodiment of the invention can convert the two-dimensional code into the hole array code with less holes, thereby greatly reducing the processing workload, reducing the processing cost and improving the working efficiency.

Description

Conversion method of two-dimensional code and hole array code
Technical Field
The invention relates to the technical field of product production, in particular to a conversion method of a two-dimensional code and a hole array code.
Background
The reason for the product problem is traced back to a serious challenge for manufacturers in every industry, from the automobile manufacturing industry to the aerospace industry, and from the medical industry to the food industry. In a global era, enterprises pursue relationship management to maximize customer satisfaction. Consumer and environmental regulations are becoming more stringent and traceability is becoming more necessary.
Manufacturers seek to maximize production capacity and to reduce costs at all times. To achieve this goal, each process in the overall manufacturing flow must be monitored and a complete history maintained. Problems affecting product quality must be quickly identified and corrected to prevent defective products from continuing to flow down the production line with the ultimate goal of achieving a zero product return rate as much as possible. In the electronics industry, PCB production also needs to meet customer traceability requirements, and when finding a problem, customers want to be able to quickly locate the cause of the problem and the range of affected products.
At present, in the manufacturing process of various products (such as multilayer PCB and FPC), a factory generally directly uses a two-dimensional code as an information carrier to be sprayed on a board surface, and reads two-dimensional code information and adds new processing information to the two-dimensional code through a scanning gun in each process. However, the mode of using the two-dimensional code as the tracing identifier has the defect of being easily affected by various factors to cause difficult identification, and therefore, the two-dimensional code can be converted into the hole array code to serve as the tracing identifier to overcome the defect.
Disclosure of Invention
The invention aims to provide a method for converting a two-dimensional code and a hole array code, which is used for converting the two-dimensional code into the hole array code with less holes, reducing the processing workload and improving the working efficiency.
In order to achieve the purpose, the invention adopts the following technical scheme:
a two-dimensional code and hole array code conversion method is provided, the specification of the two-dimensional code is m x m, and when the m x m specification is larger than a preset threshold value, the conversion method comprises the following steps:
converting the m × m-standard two-dimensional code into an m × m-standard dot matrix code and then converting the m × m-standard dot matrix code into an m × m-standard binary table;
dividing the m x m sized binary table from the whole into at least two binary table portions;
converting each binary table part into a corresponding hole array code local graph respectively;
combining the obtained partial images of all the hole array codes into a complete hole array code image;
and forming a hole array code on the product according to the hole array code pattern.
Optionally, the method for dividing the m × m-sized binary table into at least two binary table parts from the whole includes:
obtaining the drilling precision of the machine
Figure GDA0002596156350000021
Size L of hole array code area1×L2And the specification m × m of the two-dimensional code; said L1Is length, L2Is the width;
according to the formula
Figure GDA0002596156350000022
Calculating to obtain a combined column number n;
obtaining an equal division number x according to a formula x ═ m/n ];
and dividing the binary table with the m x m specification into x parts according to the mode that each part of combined column is n.
Optionally, the method for dividing the m × m-sized binary table into at least two binary table parts from the whole includes:
obtaining the drilling precision of the machine
Figure GDA0002596156350000023
Size L of hole array code area1×L2And the specification m × m of the two-dimensional code; said L1Is length, L2Is the width;
according to the formula
Figure GDA0002596156350000024
Calculating to obtain the maximum value n of the combined column number nmax
According to the formula xmin=[m/nmax]Obtaining the minimum value x of the equal division number xmin
The number of the combined columns of the binary table with the m multiplied by m specification is nmaxIs divided into xminAnd (4) portions are obtained.
Optionally, theThe method of dividing a binary table of m x m size from a whole into at least two binary table sections further comprises: the number of the combined columns of the binary table with the m multiplied by m specification is nmaxIs divided into xminWhen the parts are shared, the sum of the equal values in the reverse order is minimized.
Optionally, after dividing the m × m binary table into x parts according to the way that the number of combined columns of each part is n, if the equal score is 1, generating holes by using the column lines on the corresponding side when converting the corresponding binary table part into the local graph of the hole array code.
Optionally, when m × m is 18 × 18, the binary table with the m × m specification is divided into five binary table parts from the whole, and the specification of each part is: 18 × 4, and 18 × 2.
Optionally, the method for converting each binary table portion into a corresponding hole array code partial graph respectively includes:
converting the data in each binary table portion to decimal data and dividing by 2nSo that each number in the table is smaller than 1, and a hole array code table with the specification of m multiplied by 1 is obtained;
and drawing a hole array code chart according to the hole array code table with the m multiplied by 1 specification.
Optionally, when the m × m specification is not greater than the preset threshold, the conversion method is:
and converting the m × m-standard two-dimensional code into an m × m-standard lattice code, and then converting the m × m-standard lattice code into an m × m-standard binary table, wherein m × m is smaller than a preset value.
The m × m-sized binary table is converted into an m × 1-sized decimal table.
And converting the decimal table with the m × 1 specification into a hole array code diagram with the m × 1 specification, and then forming a hole array code on the product according to the hole array code diagram.
Optionally, the method for converting the decimal table with the m × 1 specification into the hole array code map with the m × 1 specification includes:
dividing each data in the m x 1-sized decimal table by 2mSuch that each of the tablesThe number is less than 1, and a hole array code table with the specification of mx 1 is obtained;
and drawing a hole array code chart according to the hole array code table with the m multiplied by 1 specification.
Optionally, the two-dimensional code includes a row-type two-dimensional code and a matrix-type two-dimensional code.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the embodiment of the invention can convert the two-dimensional code into the hole array code with less holes, thereby greatly reducing the processing workload, reducing the processing cost and improving the working efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is an illustration of a QR two-dimensional code in the prior art;
FIG. 2 is an illustration of a DM two-dimensional code in the prior art;
FIG. 3 is a dot matrix code converted from the QR two-dimensional code shown in FIG. 1;
fig. 4 is a lattice code converted from the DM two-dimensional code shown in fig. 2;
FIG. 5 is a 3 × 3 bitmap obtained by conversion of the 3 × 3 binary table shown in Table 1;
FIG. 6 is a 4 × 4 bitmap obtained by converting the 4 × 4 binary table shown in Table 2;
fig. 7 is a flowchart of a method for converting a two-dimensional code with a specification not greater than a preset threshold into a hole array code according to an embodiment of the present invention;
FIG. 8 is a diagram of a hole array code plotted from the 4 × 1 hole array code table shown in Table 4;
fig. 9 is a flowchart of a method for converting a two-dimensional code with a specification greater than a preset threshold into a hole array code according to an embodiment of the present invention;
fig. 10 is a diagram of an array of 18 × 18 two-dimensional codes;
fig. 11 is a diagram of an aperture code converted from the 18 × 18 two-dimensional code shown in fig. 10;
FIG. 12 is a hole array code obtained from the hole array code diagram of FIG. 11;
FIG. 13 is a 21 × 21 bitmap generated from the binary table shown in Table 5;
FIG. 14 is a graph of the transformed aperture codes according to Table 6;
fig. 15 is a hole array code obtained from the hole array code diagram shown in fig. 14.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The technical scheme of the invention is further explained by the specific implementation mode in combination with the attached drawings.
Brief introduction to two-dimensional code technology
The two-dimensional code is an information identification technology developed by combining three technologies of computer, communication and photoelectric sensing. The character is a black-white geometric figure arranged according to a certain rule, and black and white positions in the figure respectively correspond to '1' and '0', so that a binary character sequence is formed, and the binary character can represent information such as numbers, characters and the like. According to different coding principles, the two-dimensional codes are divided into two types, namely row-type two-dimensional codes and matrix-type two-dimensional codes.
The row-type two-dimensional code is formed by combining one-dimensional codes into a plurality of rows according to a certain rule. Because of the relation between the row-type two-dimensional code and the one-dimensional code, the two codes have the same part in the coding principle, but the row-type two-dimensional code coding rule is different from that of the one-dimensional code, so the decoding algorithm is also different.
The matrix type two-dimensional bar code realizes the coding effect through the distribution of dark color pixels and light color pixels in a matrix, binary '1' in the coding is represented by dark color pixels, binary '0' is represented by light color pixels, finally all the pixels form a rectangular graph, and the position distribution of the pixels represents the content contained in the matrix type two-dimensional bar code. The Matrix type two-dimensional Code is usually provided with QR Code, Maxi Code, Data Matrix and the like. In the PCB industry, two-dimensional codes are also widely used, wherein Data Matrix coding is mainly used.
Brief introduction to the second Aperture code
Different from a mode that matrix type two-dimensional codes adopt dark and light color block combination marking information, the hole array codes mark information needing to be recorded by combining position information of a plurality of small holes in a specified area range.
(III) two-dimensional code information storage mechanism
The matrix type two-dimensional code is a graphic symbol automatic identification processing code system and generally has an error correction function. Wherein, the representative matrix type two-dimensional code is composed of QR code, DM code and the like.
As shown in fig. 1, the QR Code two-dimensional Code is square, and is generally black and white. The functional graphic comprises a coding area and a functional graphic, wherein the coding area is responsible for storing data coding information, the functional graphic is used for defining fixed format information such as version information and format information, and all the functional graphic areas are surrounded by a blank area and are used for being distinguished from the coding area. The QR Code two-dimensional Code model 1 is the QRCode two-dimensional Code which is made earliest, the highest version is 14(73X73 Code elements), and the QR Code model can process 1167 digits at most. The QR Code two-dimensional Code model 2 is an improved version of the model 1, the highest version is 40(177X177 Code elements), and can process 7089 digits at most. The method can read data smoothly under the condition that the two-dimensional code is deformed. When the two-dimensional code is printed on a curved surface, or the two-dimensional code is deformed due to a reading angle or the like, the two-dimensional code can still be effectively read through an alignment mode provided inside the two-dimensional code.
The QR Code symbols have 1-40 versions and respectively represent forty specifications. Each version has symbols that are increased by 4 modules per side compared to the previous version, i.e., version 1 is a 21 module × 21 module in specification, version 2 is a 25 module × 25 module, … …, and version 40 is a 177 module × 177 module in specification.
As shown in fig. 2, a Data Matrix code (DM code for short) is one of the earliest two-dimensional codes, is the smallest in size among all barcodes at present, is suitable for identification of small parts, is directly printed on a product entity for reading, and is widely used in the fields of industrial serial number management, product finalization and the like.
The DM code is a two-dimensional matrix image and consists of square data blocks (nominal data blocks), a finding mode edge (finder pattern L boundary) and a switching mode edge (alternating pattern module), and is different from the QR code, the DM code does not have a 7x 7 module position detection graph and a 3x 3 module correction pattern, is smaller in size relative to the QR code, and is easy to mark on small parts.
Capacity:
(1) digital data: 3,116 characters;
(2) alphanumeric data 235 characters;
(3) 1,556 characters of 8-bit byte data;
(4) chinese character data: not supported.
The DM code has strong error correction performance, and only 20% of data needs to be read under the condition of an end to correctly identify the data. It should be noted that when the number of modules exceeds 255, the DM code will be split, and the code will be split while switching modes, which results in high recognition rate.
No matter what code system is adopted by the two-dimensional code for coding, what is really needed is the information stored in the two-dimensional code. Although fig. 1 and 2 are different in appearance, the information finally read from the two-dimensional codes is the same four words. For the two-dimensional codes shown in fig. 1 and 2, they can be converted into dot-form two-dimensional codes, as shown in fig. 3 and 4, respectively.
Compared with the method for engraving the original square two-dimensional code on the product (such as a PCB (printed Circuit Board) and an FPC (Flexible printed Circuit Board), the method for engraving the dot code on the product is more efficient and reliable. However, the number of dots of the dot code is still large, and it is not the best choice to process the dot code, and therefore, this embodiment proposes a form of a hole matrix code to replace the dot code.
Firstly, it is known how to store information in a dot code, which is encoded by using binary numbers and finally converted into a two-dimensional code, and the principle is as follows. In general, the specifications of two-dimensional codes are relatively large, and specifications such as 16 × 16 and 18 × 18 are commonly used, but for the sake of explanation of the principle, descriptions will not be made by using specifications of 3 × 3 and 4 × 4.
This can be understood for lattice codes of the 3 × 3 specification: as shown in table 1 below, table 1 is a table of 3 × 3 format, in which some binary information is stored, and it is possible to image the binary information, wherein for "1", dark dots may be used for representation, and for "0", blank dots may be used for representation, so that table 1 can be converted into a bitmap, the shape of which is shown in fig. 5.
0 0 1
1 1 0
1 0 1
TABLE 1
As can be seen from fig. 6, the part of table 1 with data 1 is represented by black dots, and the part of table 1 with data 0 is represented by open dots, so that the information of table 1 is converted into the image of fig. 5 from number to image, and the information stored in them is the same, though not the same.
This can be understood for lattice codes of the 4 × 4 specification: firstly, randomly selecting a binary table with the specification of 4 multiplied by 4, as shown in the following table 2; still, with regard to table 2, conversion may be performed in such a manner that "1" is a dark dot and "0" is a blank, and fig. 6 may be obtained.
1 0 1 0
0 1 0 1
1 0 0 1
1 1 0 0
TABLE 2
From the above analysis, it can be seen that for each table storing binary information, a bitmap can be found corresponding to the table. In addition, it can be known from the knowledge of the combination that the larger the binary table specification is, the more information it can store, but the more points the corresponding bitmap has. For QR two-dimensional code, the 21 × 21 specification is the minimum specification, which means that each dot matrix diagram with the minimum specification has 441 dots, whereas the two-dimensional code of version 40 today has the specification of 177 × 177, which means that one 177 × 177 two-dimensional code needs 31329 dots, which is very inconvenient for industrial application, so this embodiment proposes a set of encoding rules to convert the dot matrix code into the dot matrix code, so as to greatly reduce the number of holes.
(IV) two-dimensional code-to-hole array code coding rule
The embodiment provides a method for converting a two-dimensional code and a hole array code, which comprises the following steps: the conversion method for the two-dimensional code with the specification not larger than the preset threshold value and the conversion method for the two-dimensional code with the specification larger than the preset threshold value.
(I) For a two-dimensional code with a specification not greater than a preset threshold, the method for converting the two-dimensional code with a hole array code is shown in fig. 7, and includes:
step 101, converting the two-dimensional code with the m × m specification into a lattice code with the m × m specification, and then converting the lattice code with the m × m specification into a binary table with the m × m specification, wherein m × m is smaller than a preset value.
And 102, converting the binary table with the m multiplied by m specification into a decimal table with the m multiplied by 1 specification.
Step 103, dividing each data in the m × 1 decimal table by 2mAnd enabling each number in the table to be smaller than 1, and obtaining the hole array code table with the m multiplied by 1 specification.
And step 104, drawing a hole array code graph according to the hole array code table with the m multiplied by 1 specification.
And 105, forming a hole array code on the product according to the hole array code pattern.
The following description will be made of a specific conversion method by taking a two-dimensional code of 4 × 4 standard as an example:
fig. 6 is still taken as an example for the 4 × 4 two-dimensional code. For FIG. 6, it may be converted first to the 4 × 4 binary table shown in Table 2 and then to the 4 × 1 decimal table shown in Table 3:
10
5
9
12
TABLE 3
Thus, the 4 × 4 two-dimensional code is converted into a 4 × 1 decimal table, and in order to convert the information into the required achievable hole array code, the following conversion is continued: divide each data in the 4 x1 table by 24This gives table 4, each number in table 4 being less than 1.
Figure GDA0002596156350000091
TABLE 4
For this table 4, it can be converted to an aperture pattern code map as shown in fig. 8: each data is converted into the proportion that the point position is in one row, 4 columns can be converted into a column of point storage information, and if the number of columns is increased, the efficiency of depicting the two-dimensional code can be improved to a great extent.
(II) for the two-dimensional code with the specification larger than the preset threshold, the method for converting the two-dimensional code with the hole array code is shown in FIG. 9, and comprises the following steps:
step 201, converting the two-dimensional code with the m × m specification into a lattice code with the m × m specification, and then converting the lattice code into a binary table with the m × m specification.
Step 202, dividing the binary table with the m × m specification into at least two binary table parts from the whole, wherein the specification of each binary table part is smaller than the m × m specification;
and 203, converting each binary table part into a corresponding hole array code local graph respectively to obtain at least two hole array code local graphs.
And step 204, combining all the obtained hole array code partial images into a complete hole array code image.
And step 205, forming a hole array code on the product according to the hole array code pattern.
In order to minimize the number of holes of the finally formed hole array code, the method for dividing the m × m binary table in step 202 includes:
firstly, obtaining the punching precision of the machine
Figure GDA0002596156350000092
Size L of hole array code area1×L2(L1Is a length, L2Width) and two-dimensional code specification m × m; wherein, the size of the hole array code area is generally 5mm multiplied by 5mm or 4mm multiplied by 4 mm;
then, according to the formula
Figure GDA0002596156350000093
Calculating to obtain an available value of the number n of the combined columns;
finally, according to the formula x ═ m/n ], the bisector number x of the binary table division with the m × m specification is obtained.
In the above-described division method, n may have a plurality of values, so that the bisector x may also have a plurality of values, that is, there are a plurality of division methods. However, the larger the bisector x, the more holes need to be processed, and thus the optimum bisector x is [ m/n ]max]。
In step 203, the method for converting each binary table portion into a corresponding hole array code partial graph respectively comprises:
the data in each binary table portion is first converted to decimal data and divided by 2nSo that each number in the table is smaller than 1, and a hole array code table with the specification of m multiplied by 1 is obtained;
and drawing a hole array code picture according to the hole array code table with the m multiplied by 1 specification.
The following description will take two-dimensional codes of 18 × 18 and 21 × 21 specifications commonly used in the PCB industry as an example.
18 x 18 two-dimensional code hole-turning array code
Taking the 18 × 18 two-dimensional code array diagram shown in fig. 10 as an example, it can be clearly understood that the requirement for converting 18 × 18 into an 18 × 1 hole array diagram is very high before conversion. If the hole array code of the 18 × 1 specification is converted, the precision of the machine for processing the holes should be smaller than or equal to that of 238nm, which is far beyond the level that the current machine can actually process. For this reason, the present embodiment will convert it, and it is conceivable to divide 18 × 18 into such small parts as 18 × 4 or 18 × 5, and then convert such small parts into the partial lattice code maps, respectively. Then the present embodiment adopts the following calculation method:
first, the following parameters are obtained:
a. machine drilling precision
Figure GDA0002596156350000101
b. Size L of hole array code area1×L2
c. The two-dimensional code specification m × m is 18 × 18.
For the punching precision, the calculation method may be: for n rows of data converted into one row of data, the minimum unit of measure e*The method comprises the following steps:
Figure GDA0002596156350000102
then the drilling precision of the machine should satisfy:
Figure GDA0002596156350000103
thus, when the punching precision of the machine is given, the area width L of the two-dimensional code is determined2N can be obtained from formula 2maxFinally according to nmaxThe best scheme is obtained. The calculation process is as follows:
assuming a given machine accuracy
Figure GDA0002596156350000111
L1×L24mm × 4 mm. Since n is an integer, inverse solution is difficult, n can be substituted into formula 2 from small to large, the maximum value meeting the condition is taken, and n can be obtainedmax4 toTwo-dimensional code data can be divided into x ═ 18/4]Equal to 5 equal parts. The larger the halving number x is, the number of holes to be processed is correspondingly increased, for example, if the halving number x is 6, 18 holes are required to be added, so that under the constraint condition that the requirement on accuracy is as small as possible and the number of holes is as small as possible, the optimal scheme can be obtained, namely 18 × 18 is divided into 18 × 4, 18 × 4, 18 × 4, 18 × 4 and 18 × 2.
Then, the hole array code graph shown in fig. 11 can be obtained after conversion processing and merging, and the final hole array code can be obtained by removing line modification in the hole array code graph, as shown in fig. 12, the graph has a total of 93 holes, including 90 data holes and 3 positioning holes; and the original two-dimensional code data totally count 414 holes, which obviously greatly reduces the processing amount.
Two-dimensional code rotary hole array code of 21 x 21 specification
First, a two-dimensional code is randomly generated, which corresponds to a binary table of 21 × 21 specifications, as shown in table 5 below.
0 0 0 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1
0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 1 1 1 1 0
1 0 0 1 1 1 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1
0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 1
0 1 0 0 0 0 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1
0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 0 1 1 1 0
1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0
1 1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 1 0 0 1 1
1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 1 1 0
1 1 1 0 1 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 1
0 0 0 0 1 0 1 1 0 1 0 0 1 1 1 1 1 0 1 1 1
0 0 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 0 0 1 0
1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 1 0 1 1
0 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 0 0 0 1 0
1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0
0 0 0 0 0 1 1 1 1 0 0 1 0 1 1 1 0 0 1 1 1
1 0 0 0 1 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0
0 1 0 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1
1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 1 1
1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1
0 1 0 0 0 0 1 1 0 1 1 1 0 1 0 0 0 0 1 0 0
TABLE 5
Next, a 21 × 21-standard dot matrix chart as shown in fig. 13 is generated from table 5, which is unrealistic if it is converted into a 21 × 1-standard hole matrix code chart, so this example also performs calculation according to the 18 × 18-standard calculation method, as follows:
assuming the drilling precision of the machine
Figure GDA0002596156350000121
I.e., 15.625um, L25mm, then n can be calculated step by step instead of equation 2max5. Therefore, for a 21 × 21 two-dimensional code, it is minimally necessary to divide the 21-column data into [21/5 ]]Then, the 21 × 21 two-dimensional code can be divided into the following parts:
(1)21×5,21×5,21×5,21×5,21×1;
or, (2)21 × 5, 21 × 4, 21 × 4, 21 × 4, 21 × 4;
or, (3)21 × 5, 21 × 5, 21 × 4, 21 × 4, 21 × 3;
and so on.
It is clear that the required accuracy of the machining of 21 × 5, 21 × 4 and 21 × 3 decreases in order. In actual operation, firstly, the number of the processing holes needs to be reduced as far as possible on the premise of meeting the punching precision of a machine, secondly, the number of the holes with high precision requirements needs to be reduced as far as possible, and at the moment, the optimal scheme can be determined according to the judgment principle that the sum of the equal-division values and the inverse sequence is minimum. Among the three partitioning schemes, the distribution of the number of holes required for precision can be evaluated by using the inverse number (every two numbers in the sequence are compared, the number of sequences with unequal numbers is added with 1), the sequence inverse numbers of the above schemes (5,5,5,5,1), (5,4,4, 4), (5,5,4,4,3) are respectively 4,4 and 8, but the number of 21 × 5 in the scheme (1) is greater than that in the scheme (2), so the scheme (2) is the best scheme among the three partitioning schemes.
For 21 × 1 such data that only one column is converted, the data can be represented by punching 5 holes in the left column. According to the above rule, the two-dimensional code data of the 21 × 21 specification can be converted into the following table 6:
0 6 13 23 11
21 1 11 31
11 1 16 20
1 6 23 1
10 10 4 24 23
1 15 13 1
29 15 31 24
14 6 30 25
12 18 6 29
11 2 24 4
1 9 22 12 19
14 16 27 24
10 12 20 18
18 25 2 5 11
0 0 19 29
2 8 9 17
31 0 3 26
21 4 17 20
19 7 3 14 8
26 3 13 14
18 15 4 6
TABLE 6
The data from table 6 is divided by 25 and finally converted into a hole pattern code pattern as shown in fig. 14. After the lines are removed, the final hole array code can be obtained, as shown in fig. 15.
Compared with 441 holes of a 21 x 21-specification two-dimensional graph, only 113 holes are needed in the graph 15, wherein 110 data holes and 3 positioning holes are needed, and the production efficiency is greatly improved.
To sum up, before conversion, the following information is required: machine drilling precision
Figure GDA0002596156350000131
Size L of hole array code area1×L2(L1Is a length, L2Width) and two-dimensional code specification m × m;
then, calculating according to the formula 2 to obtain a combined column number n, calculating an equant number x by using the combined column number n, and finally obtaining various combinations meeting the conditions; the optimal solution should be among these: to ensure a minimum number of holes, this requires that the number of halves x be equal to [ m/n ]max](ii) a On the basis of the minimum number of machining holes, the number of holes required for ensuring high precision is as small as possible, so that the sum of the reverse orders of the equal values (such as 5,5,1 and 1) is required to be minimum. In addition, if the equivalent value is 1, punching is performed by using the left column line, so that the number of holes can be reduced.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A two-dimensional code and hole array code conversion method is provided, the specification of the two-dimensional code is m x m, and the conversion method is characterized in that when the m x m specification is larger than a preset threshold value:
converting the m × m-standard two-dimensional code into an m × m-standard dot matrix code and then converting the m × m-standard dot matrix code into an m × m-standard binary table;
dividing the m x m sized binary table from the whole into at least two binary table portions;
converting each binary table part into a corresponding hole array code local graph respectively;
combining the obtained partial images of all the hole array codes into a complete hole array code image;
and forming a hole array code on the product according to the hole array code pattern.
2. The method for converting two-dimensional code into hole array code according to claim 1, wherein the method for dividing the m x m sized binary table into at least two binary table sections from the whole comprises:
obtaining the drilling precision of the machine
Figure FDA0002596156340000011
Size L of hole array code area1×L2And the specification m × m of the two-dimensional code; said L1Is length, L2Is the width;
according to the formula
Figure FDA0002596156340000012
Calculating to obtain a combined column number n;
obtaining an equal division number x according to a formula x ═ m/n ];
and dividing the binary table with the m x m specification into x parts according to the mode that each part of combined column is n.
3. The method for converting two-dimensional code into hole array code according to claim 1, wherein the method for dividing the m x m sized binary table into at least two binary table sections from the whole comprises:
obtaining the drilling precision of the machine
Figure FDA0002596156340000013
Size L of hole array code area1×L2Andthe specification of the two-dimensional code is m multiplied by m; said L1Is length, L2Is the width;
according to the formula
Figure FDA0002596156340000014
Calculating to obtain the maximum value n of the combined column number nmax
According to the formula xmin=[m/nmax]Obtaining the minimum value x of the equal division number xmin
The number of the combined columns of the binary table with the m multiplied by m specification is nmaxIs divided into xminAnd (4) portions are obtained.
4. The method for converting two-dimensional code into hole array code according to claim 3, wherein said method for dividing the m x m sized binary table into at least two binary table sections from the whole further comprises: the number of the combined columns of the binary table with the m multiplied by m specification is nmaxIs divided into xminWhen the parts are shared, the sum of the equal values in the reverse order is minimized.
5. The method as claimed in claim 2, wherein after the m x m-sized binary table is divided into x parts by n combined columns, if the equal value is 1, the holes are generated by using the corresponding side column lines when the corresponding binary table portion is converted into the partial map of the matrix code.
6. The method for converting two-dimensional code into hole array code according to claim 3, wherein when m x m is 18 x 18, the binary table with m x m specification is divided into five binary table sections from the whole, and the specification of each section is as follows: 18 × 4, and 18 × 2.
7. The method for converting two-dimensional code and hole array code according to claim 2, wherein said method for converting each binary table portion into corresponding hole array code partial graph respectively comprises:
converting the data in each binary table portion to decimal data and dividing by 2nSo that each number in the table is smaller than 1, and a hole array code table with the specification of m multiplied by 1 is obtained;
and drawing a hole array code chart according to the hole array code table with the m multiplied by 1 specification.
8. The method for converting a two-dimensional code and a hole array code according to claim 1, wherein when the mxm specification is not greater than a preset threshold, the method comprises:
converting the two-dimensional code with the m × m specification into a lattice code with the m × m specification, and then converting the lattice code with the m × m specification into a binary table with the m × m specification, wherein the m × m is smaller than a preset value;
converting the binary table with the m × m specification into a decimal table with the m × 1 specification;
and converting the decimal table with the m × 1 specification into a hole array code diagram with the m × 1 specification, and then forming a hole array code on the product according to the hole array code diagram.
9. The method for converting two-dimensional code into hole array code according to claim 8, wherein the method for converting the m x1 decimal table into the m x1 hole array code figure comprises:
dividing each data in the m x 1-sized decimal table by 2mSo that each number in the table is smaller than 1, and a hole array code table with the specification of m multiplied by 1 is obtained;
and drawing a hole array code chart according to the hole array code table with the m multiplied by 1 specification.
10. The method for converting the two-dimensional code into the hole array code according to claim 1, wherein the two-dimensional code comprises a row-type two-dimensional code and a matrix-type two-dimensional code.
CN201711328465.XA 2017-12-13 2017-12-13 Conversion method of two-dimensional code and hole array code Active CN108073966B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711328465.XA CN108073966B (en) 2017-12-13 2017-12-13 Conversion method of two-dimensional code and hole array code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711328465.XA CN108073966B (en) 2017-12-13 2017-12-13 Conversion method of two-dimensional code and hole array code

Publications (2)

Publication Number Publication Date
CN108073966A CN108073966A (en) 2018-05-25
CN108073966B true CN108073966B (en) 2020-11-10

Family

ID=62158343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711328465.XA Active CN108073966B (en) 2017-12-13 2017-12-13 Conversion method of two-dimensional code and hole array code

Country Status (1)

Country Link
CN (1) CN108073966B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108764407A (en) * 2018-05-30 2018-11-06 深圳市恩兴实业有限公司 Product traceability method, apparatus, system and computer storage media
CN109933033B (en) * 2019-04-23 2022-04-19 深圳镭霆激光科技有限公司 PCB whole-process tracing laminating process segment tracing method
CN111598199A (en) * 2020-05-26 2020-08-28 成都鹏业软件股份有限公司 Two-dimensional code generation method
CN112024178A (en) * 2020-08-20 2020-12-04 中国联合工程有限公司 Workpiece identification system and method for spraying production line based on two-dimensional code
CN112454493B (en) * 2020-10-16 2022-06-03 广州裕申电子科技有限公司 Circuit board identification system, method and storage medium
CN113370669B (en) * 2021-05-08 2022-12-27 广州裕申电子科技有限公司 Circuit board tracing method and system
CN115392277B (en) * 2022-08-30 2023-04-28 武汉至简天成科技有限公司 Coded information reading method and visual code reading equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003346105A (en) * 2002-04-29 2003-12-05 Shenzhen Syscan Technology Co Ltd Two-dimensional bar code and method for recording the same
CN103020689A (en) * 2013-01-16 2013-04-03 重庆大学 Method for recognizing hole-shaped codes of articles on basis of geometric figures
CN103413160A (en) * 2013-08-30 2013-11-27 北京慧眼智行科技有限公司 Method, device and system for encoding and decoding
CN104636784A (en) * 2015-02-28 2015-05-20 立德高科(北京)数码科技有限责任公司 Two-dimensional code, and generation method and identification method thereof
CN105279539A (en) * 2014-06-07 2016-01-27 王树敏 Dot-matrix two-dimensional code coding and decoding
CN105894067A (en) * 2016-02-06 2016-08-24 深圳市天朗时代科技有限公司 Dot matrix two-dimensional code coding and reading method
CN106022425A (en) * 2016-05-15 2016-10-12 上海思岭信息科技有限公司 Layered-structure 2D code encoding and decoding method
CN106851990A (en) * 2017-03-27 2017-06-13 雪龙数控设备(深圳)有限公司 For the drilling control method and drilling control system of wiring board

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7811768B2 (en) * 2001-01-26 2010-10-12 Aviva Biosciences Corporation Microdevice containing photorecognizable coding patterns and methods of using and producing the same

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003346105A (en) * 2002-04-29 2003-12-05 Shenzhen Syscan Technology Co Ltd Two-dimensional bar code and method for recording the same
CN103020689A (en) * 2013-01-16 2013-04-03 重庆大学 Method for recognizing hole-shaped codes of articles on basis of geometric figures
CN103413160A (en) * 2013-08-30 2013-11-27 北京慧眼智行科技有限公司 Method, device and system for encoding and decoding
CN105279539A (en) * 2014-06-07 2016-01-27 王树敏 Dot-matrix two-dimensional code coding and decoding
CN104636784A (en) * 2015-02-28 2015-05-20 立德高科(北京)数码科技有限责任公司 Two-dimensional code, and generation method and identification method thereof
CN105894067A (en) * 2016-02-06 2016-08-24 深圳市天朗时代科技有限公司 Dot matrix two-dimensional code coding and reading method
CN106022425A (en) * 2016-05-15 2016-10-12 上海思岭信息科技有限公司 Layered-structure 2D code encoding and decoding method
CN106851990A (en) * 2017-03-27 2017-06-13 雪龙数控设备(深圳)有限公司 For the drilling control method and drilling control system of wiring board

Also Published As

Publication number Publication date
CN108073966A (en) 2018-05-25

Similar Documents

Publication Publication Date Title
CN108073966B (en) Conversion method of two-dimensional code and hole array code
EP2393035B1 (en) QR barcode decoding chip and decoding method thereof
EP0999519B1 (en) Distortion correction method in optical code reading
KR100414524B1 (en) Two-dimensional Code having superior decoding property which is possible to control the level of error correcting codes, and method for encoding and decoding the same
EP1016027B1 (en) Distortion resistant double-data correcting color transition barcode and method of generating and using same
EP2393037B1 (en) Data matrix decoding chip and decoding method thereof
EP2393038A1 (en) Matrix-type two-dimensional barcode decoding chip and decoding method thereof
CN107247985B (en) Coding, positioning and identifying method of two-dimensional code
JP2010510561A (en) Two-dimensional code, decoding method thereof, and printed publication to which the two-dimensional code is applied
JP2005267598A (en) Two-dimensional bar code and sign decoding method
IL150832A (en) Method for data matrix print quality verification
CN111046996B (en) Color QR code generation and identification method
EP1316061B1 (en) Data package template with data embedding
EP3561729B1 (en) Method for detecting and recognising long-range high-density visual markers
EP3996283B1 (en) Coding pattern, coding and reading methods for same, calibration board, and calibration method
CN107992918A (en) A kind of efficient product whole process quality retroactive method
CN100356399C (en) Two-dimensional barcode card and its decoding method
CN101303742B (en) Microminiature Hanxin code and method for generating symbol thereof
CN104217189A (en) Self-learning identification method of barcode used for test strip
CN112187284A (en) Encoding method, encoding pattern reading method, and imaging device
CN101571916B (en) Method for identifying screen code with uniform dot matrix
CN109934036B (en) Method and system for recognizing and reading QR (quick response) code through single-position detection graph
CN112183695B (en) Coding method, coding pattern reading method, and photographing apparatus
CN110659532A (en) One-dimensional punching-based coding identification and analysis method and system
CN112184803A (en) Calibration plate and calibration method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant