[go: up one dir, main page]

CN108073966B - A kind of conversion method of two-dimensional code and hole array code - Google Patents

A kind of 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
array code
size
dimensional 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.)
Expired - Fee Related
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
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Error Detection And Correction (AREA)
  • Image Processing (AREA)

Abstract

本发明涉及产品生产技术领域,公开了一种二维码与孔阵码的转换方法。在m×m规格大于预设阈值时,转换方法为:先将m×m规格的二维码转换m×m规格的二进制表格,再将其由整体划分为至少两个二进制表格部分,然后将每个部分分别转换为相应的孔阵码局部图,最后将全部孔阵码局部图合并为完整的孔阵码图,据此形成孔阵码。在m×m规格不大于预设阈值时,转换方法为:先将m×m规格的二维码转换为m×m规格的二进制表格,再将其转换为m×1规格的十进制表格,然后将m×1规格的十进制表格转换为m×1规格的孔阵码图,据此形成孔阵码。本发明实施例可将二维码转换为具有较少孔数的孔阵码,大大减少加工工作量,降低加工成本,提高工作效率。

Figure 201711328465

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 size is greater than the preset threshold, the conversion method is as follows: first convert the m×m size QR code into the m×m size binary table, then divide it into at least two binary table parts from the whole, and then convert Each part is converted into the corresponding hole-array code local map, and finally all the hole-array code local maps are combined into a complete hole-array code map, and the hole-array code is formed accordingly. When the m×m size is not greater than the preset threshold, the conversion method is: first convert the m×m size QR code into m×m size binary table, then convert it into m×1 size decimal table, then Convert the decimal table of m×1 size to the hole array code map of m×1 size, and form the hole array code accordingly. The embodiment of the present invention can convert a two-dimensional code into a hole array code with a smaller number of holes, which greatly reduces the processing workload, reduces the processing cost, and improves the work efficiency.

Figure 201711328465

Description

一种二维码与孔阵码的转换方法A kind of 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 technique

产品问题的原因追溯是每个行业的制造商都面临的一个严峻挑战,从汽车制造行业到航空航天业,从医疗到食品行业,无不如此。在一个全球化的时代,企业追求关系管理,以实现客户满意度的最大化。消费和环境法规越来越严格,因此可追溯性就变得更有必要。Tracing the cause of product problems is a serious challenge for manufacturers in every industry, from automotive to aerospace, from medical to food. In an era of globalization, companies pursue relationship management to maximize customer satisfaction. Consumption and environmental regulations are becoming more stringent, so traceability becomes even more necessary.

制造商比以往任何时候都追求生产能力最大化,并希望降低成本。为了实现这一目标,必须监控整个制造流程中的每一个工序,并保存完整的历史记录。必须快速识别并纠正影响产品质量的问题,防止有缺陷的产品继续沿生产线往下流动,其最终目标是尽量实现零产品退货率。在电子行业中,PCB 的生产同样需要满足客户对追溯性的要求,在发现问题时,客户希望可以快速定位问题原因和受影响的产品范围。More than ever, manufacturers are seeking to maximize production capacity and reduce costs. To achieve this, every step in the entire manufacturing process must be monitored and a complete history maintained. Issues affecting product quality must be quickly identified and corrected to prevent defective product from continuing down the production line, with the ultimate goal of minimizing product returns. In the electronics industry, PCB production also needs to meet customer requirements for traceability. When problems are found, customers want to quickly locate the cause of the problem and the affected product range.

目前,在各种产品(如多层PCB、FPC)的制作流程中,工厂一般直接用二维码作为信息载体在喷涂于板面,在各个工序中通过扫描枪来读取二维码信息并向该二维码中添加新的加工信息。但是,这种以二维码作为追溯标识的方式存在着容易受各种因素影响导致不易识别的缺陷,为此可将二维码转换为孔阵码来作为追溯标识以克服此缺陷,然而孔阵码所包含的孔数较大程度影响了加工工作量和加工效率,因而如何将二维码转换为具有较少孔数的孔阵码是目前亟待解决的问题。At present, in the production process of various products (such as multi-layer PCB, FPC), the factory generally directly uses the two-dimensional code as an information carrier to spray on the board surface, and in each process, the two-dimensional code information is read by a scanning gun and Add new processing information to the QR code. However, this method of using the two-dimensional code as a traceability mark has the defect that it is easily affected by various factors and is difficult to identify. Therefore, the two-dimensional code can be converted into a hole array code as a traceability mark to overcome this defect. The number of holes contained in the array code greatly affects the processing workload and processing efficiency. Therefore, how to convert the two-dimensional code into a hole array code with a smaller number of holes is an urgent problem to be solved at present.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种二维码与孔阵码的转换方法,将二维码转换为具有较少孔数的孔阵码,减少加工工作量,提高工作效率。The purpose of the present invention is to provide a conversion method between a two-dimensional code and a hole array code, which converts the two-dimensional code into a hole array code with fewer holes, reduces the processing workload, and improves the work efficiency.

为达此目的,本发明采用以下技术方案:For this purpose, the present invention adopts the following technical solutions:

一种二维码与孔阵码的转换方法,所述二维码的规格为m×m,在所述m ×m规格大于预设阈值时,所述转换方法为:A conversion method of a two-dimensional code and a hole array code, wherein the size of the two-dimensional code is m×m, and when the m×m size is greater than a preset threshold, the conversion method is:

将所述m×m规格的二维码转换为m×m规格的点阵码,再转换为m×m 规格的二进制表格;Converting the two-dimensional code of the m×m specification into a dot matrix code of the m×m specification, and then converted into a binary table of the m×m specification;

将所述m×m规格的二进制表格由整体划分为至少两个二进制表格部分;dividing the binary table of m×m specification into at least two binary table parts from the whole;

将每个二进制表格部分分别转换为相应的孔阵码局部图;Convert each binary table part into the corresponding hole array code local map;

将所得到的全部孔阵码局部图合并为完整的孔阵码图;Combine all the obtained partial maps of hole array codes into a complete hole array code map;

根据所述孔阵码图在产品上形成孔阵码。A hole array code is formed on the product according to the hole array code map.

可选的,所述将m×m规格的二进制表格由整体划分为至少两个二进制表格部分的方法包括:Optionally, the method for dividing the binary table of m×m size into at least two binary table parts from the whole includes:

获取机台打孔精度

Figure GDA0002596156350000021
孔阵码区域尺寸L1×L2以及所述二维码的规格 m×m;所述L1为长度、L2为宽度;Get the punching accuracy of the machine
Figure GDA0002596156350000021
The size of the hole array code area L 1 ×L 2 and the specification m×m of the two-dimensional code; the L 1 is the length, and the L 2 is the width;

根据公式

Figure GDA0002596156350000022
计算得出组合列数n;According to the formula
Figure GDA0002596156350000022
Calculate the number of combined columns n;

按照公式x=[m/n],得到等分数x;According to the formula x=[m/n], get the equal fraction x;

将所述m×m规格的二进制表格按照每份组合列数为n的方式划分为x 份。The binary table of m×m size is divided into x parts in a manner that the number of columns for each combination is n.

可选的,所述将m×m规格的二进制表格由整体划分为至少两个二进制表格部分的方法包括:Optionally, the method for dividing the binary table of m×m size into at least two binary table parts from the whole includes:

获取机台打孔精度

Figure GDA0002596156350000023
孔阵码区域尺寸L1×L2以及所述二维码的规格 m×m;所述L1为长度、L2为宽度;Get the punching accuracy of the machine
Figure GDA0002596156350000023
The size of the hole array code area L 1 ×L 2 and the specification m×m of the two-dimensional code; the L 1 is the length, and the L 2 is the width;

根据公式

Figure GDA0002596156350000024
计算得出组合列数n的最大值nmax;According to the formula
Figure GDA0002596156350000024
Calculate the maximum value n max of the number of combined columns n;

按照公式xmin=[m/nmax],得到等分数x的最小值xminAccording to the formula x min =[m/n max ], obtain the minimum value x min of the equal fraction x;

将所述m×m规格的二进制表格按照每份组合列数为nmax的方式划分为 xmin份。The binary table of m×m specification is divided into x min parts in a manner that the number of columns in each combination is n max .

可选的,所述将m×m规格的二进制表格由整体划分为至少两个二进制表格部分的方法还包括:在将所述m×m规格的二进制表格按照每份组合列数为nmax的方式划分为xmin份时,使得等分值逆序总和最小。Optionally, the method for dividing the binary table of m×m size into at least two binary table parts from the whole further includes: dividing the binary table of m×m size according to the number of columns of each combination being n max . When the method is divided into x min parts, the reversed sum of the equal division values is minimized.

可选的,在将所述m×m规格的二进制表格按照每份组合列数为n的方式划分为x份后,若等分值有1,则在将相应二进制表格部分转换为孔阵码局部图时利用相应侧的列线生成孔。Optionally, after dividing the binary table of m×m size into x parts according to the way that each combined column number is n, if the equal value is 1, then convert the corresponding binary table part into hole array code. Holes are generated using the Columns on the corresponding side in the partial drawing.

可选的,所述m×m=18×18时,将所述m×m规格的二进制表格由整体划分为五个二进制表格部分,各部分的规格分别为:18×4、18×4、18×4、 18×4及18×2。Optionally, when the m×m=18×18, the binary table of the m×m specification is divided into five binary table parts from the whole, and the specifications of each part are: 18×4, 18×4, 18×4, 18×4 and 18×2.

可选的,所述将每个二进制表格部分分别转换为相应的孔阵码局部图的方法包括:Optionally, the method for converting each binary table part into a corresponding hole array code local map includes:

将所述每个二进制表格部分中的数据转换成十进制数据并除以2n,使得表格中的每个数均小于1,得到m×1规格的孔阵码表格;Convert the data in each binary table part into decimal data and divide by 2 n , so that each number in the table is less than 1, and obtain a hole array code table of m×1 specification;

根据所述m×1规格的孔阵码表格绘制孔阵码图。Draw a hole array code diagram according to the hole array code table of m×1 specification.

可选的,在所述m×m规格不大于预设阈值时,所述转换方法为:Optionally, when the m×m specification is not greater than a preset threshold, the conversion method is:

将所述m×m规格的二维码先转换为m×m规格的点阵码,再转换为m ×m规格的二进制表格,其中的m×m小于预设值。The two-dimensional code of m×m size is first converted into a dot matrix code of m×m size, and then converted into a binary table of m×m size, where m×m is smaller than a preset value.

将m×m规格的二进制表格转换为m×1规格的十进制表格。Convert a binary table of m×m size to a decimal table of m×1 size.

将所述m×1规格的十进制表格转换为m×1规格的孔阵码图,之后据此孔阵码图在产品上形成孔阵码。Convert the decimal table of m×1 specification into a hole array code map of m×1 specification, and then form a hole array code on the product according to the hole array code map.

可选的,所述将m×1规格的十进制表格转换为m×1规格的孔阵码图的方法包括:Optionally, the method for converting a decimal table of m×1 size into a hole array code map of m×1 size includes:

将所述m×1规格的十进制表格中的每个数据除以2m,使得表格中的每个数均小于1,得到m×1规格的孔阵码表格;Divide each data in the decimal table of m×1 specification by 2 m , so that each number in the table is less than 1, and obtain the hole array code table of m×1 specification;

根据所述m×1规格的孔阵码表格绘制孔阵码图。Draw a hole array code diagram according to the hole array code table of m×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 present invention has the following beneficial effects: the embodiment of the present invention can convert the two-dimensional code into a hole array code with a smaller number of holes, greatly reducing the processing workload, reducing the processing cost, and improving the work efficiency .

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1为现有技术中的QR二维码例图;Fig. 1 is an example diagram of a QR two-dimensional code in the prior art;

图2为现有技术中的DM二维码例图;Fig. 2 is a DM two-dimensional code example diagram in the prior art;

图3为由图1所示QR二维码转换得到的点阵码;Fig. 3 is the lattice code obtained by conversion of the QR two-dimensional code shown in Fig. 1;

图4为由图2所示DM二维码转换得到的点阵码;Fig. 4 is the lattice code obtained by the conversion of DM two-dimensional code shown in Fig. 2;

图5为由表1所示3×3二进制表格转换得到的3×3点阵图;Fig. 5 is a 3×3 bitmap converted from the 3×3 binary table shown in Table 1;

图6为由表2所示4×4二进制表格转换得到的4×4点阵图;Fig. 6 is a 4×4 bitmap converted from the 4×4 binary table shown in Table 2;

图7为本发明实施例提供的规格不大于预设阈值的二维码至孔阵码的转换方法流程图;7 is a flowchart of a method for converting a two-dimensional code with a size not greater than a preset threshold to a hole array code provided by an embodiment of the present invention;

图8为由表4所示4×1孔阵码表格绘制的孔阵码图;FIG. 8 is a hole array code diagram drawn by the 4×1 hole array code table shown in Table 4;

图9为本发明实施例提供的规格大于预设阈值的二维码至孔阵码的转换方法流程图;9 is a flowchart of a method for converting a two-dimensional code with a specification greater than a preset threshold to a hole array code provided by an embodiment of the present invention;

图10为18×18二维码阵列图;Figure 10 is an 18×18 two-dimensional code array diagram;

图11为由图10所示18×18二维码转换得到的孔阵码图;Fig. 11 is a hole array code diagram obtained by converting the 18×18 two-dimensional code shown in Fig. 10;

图12为根据图11所示孔阵码图得到的孔阵码;Fig. 12 is the hole array code obtained according to the hole array code diagram shown in Fig. 11;

图13为根据表5所示二进制表格产生的21×21点阵图;Figure 13 is a 21×21 bitmap generated according to the binary table shown in Table 5;

图14为根据表6转换得到的孔阵码图;Fig. 14 is the hole array code diagram obtained according to table 6 conversion;

图15为根据图14所示孔阵码图得到的孔阵码。FIG. 15 is a hole array code obtained according to the hole array code diagram shown in FIG. 14 .

具体实施方式Detailed ways

为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本发明一部分实施例,而非全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, 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. Obviously, the following The described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

下面结合附图并通过具体实施方式来进一步说明本发明的技术方案。The technical solutions of the present invention will be further described below with reference to the accompanying drawings and through specific embodiments.

(一)二维码技术简介(1) Introduction to QR code technology

二维码,是结合了计算机、通信和光电传感三种技术发展起来的信息识别技术。它是按一定规则排列的黑白几何图形,在图形中的黑白位置分别对应“1”和“0”,从而组成一个二进制字符序列,该二进制字符可表示数字、字符等信息。根据编码原理不同,二维码分行排式二维码和矩阵式二维码两种类型。Two-dimensional code is an information identification technology developed by combining three technologies of computer, communication and photoelectric sensing. It is a black and white geometric figure arranged according to certain rules. The black and white positions in the figure correspond to "1" and "0" respectively, thus forming a binary character sequence, which can represent numbers, characters and other information. According to different coding principles, there are two types of two-dimensional code: row-type two-dimensional code and matrix-type two-dimensional code.

行排式二维码,由一维码按一定规则组合成多行形成。由于行排式二维码与一维码的关系,使得二者在编码原理上有相同之处,但行排式二维码编码规则与一维码不同,所以译码算法也不同。Row-type two-dimensional codes are formed by combining one-dimensional codes into multiple lines according to certain rules. Due to the relationship between the row-type two-dimensional code and the one-dimensional code, the two have the same encoding principle, but the encoding rule of the row-type two-dimensional code is different from that of the one-dimensional code, so the decoding algorithm is also different.

矩阵式二维条码,是通过深色和浅色两种颜色像素在一个矩阵中的分布实现编码的效果,编码中二进制的“1”用深色像素表示,二进制的“0”用浅色像素表示,最终所有像素构成一个矩形图形,像素的位置分布表示了矩阵式二维码包含的内容。矩阵式二维码常用码制有QR Code、Maxi Code、Data Matrix等。在PCB行业中,二维码也得到广泛应用,其中主要采用的是Data Matrix码制。Matrix-type two-dimensional barcodes achieve the effect of encoding through the distribution of dark and light color pixels in a matrix. In the encoding, binary "1" is represented by dark pixels, and binary "0" is represented by light pixels. Indicates that in the end all pixels form a rectangular figure, and the position distribution of the pixels represents the content contained in the matrix QR code. Commonly used code systems for matrix QR codes include QR Code, Maxi Code, Data Matrix, etc. In the PCB industry, two-dimensional codes are also widely used, and the Data Matrix code system is mainly used.

(二)孔阵码简介(2) Introduction to hole array code

不同于矩阵式二维码采用深浅两色块组合标记信息的方式,孔阵码是通过组合多个小孔在一块指定区域范围内的位置信息来标记需要记录的信息。Different from the matrix two-dimensional code, which uses the combination of dark and light color blocks to mark information, the hole array code marks the information to be recorded by combining the position information of multiple small holes within a specified area.

(三)二维码存储信息机制(3) QR code storage information mechanism

矩阵式二维码是一种图形符号自动识别处理码制,通常具有纠错功能。其中具有代表性的矩阵式二维码由QR码,DM码等。Matrix-type two-dimensional code is a symbol system for automatic identification and processing of graphic symbols, usually with error correction function. Among them, the representative matrix two-dimensional codes are QR codes, DM codes and so on.

如图1所示,QR Code二维码呈正方形,一般为黑白两色。它由编码区域和功能图形两部分构成,编码区域负责存储数据编码信息,功能图形用于定义版本信息、格式信息等固定格式的信息,所有功能图形区域都被空白区域包围用于与编码区域区分。QR Code二维码模型1是最早制作的QRCode 二维码,最高版本为14(73X73码元),最多可以处理1167位数字。QR Code 二维码模型2是模型1的改良版,最高版本为40(177X177码元),最多可处理7089位数字。它在二维码变形的情况下也能顺利读取数据。当二维码被打印在曲面上,或由于读取角度等原因导致二维码变形时,仍然可以通过设置在二维码内部的对齐模式有效读取。As shown in Figure 1, the QR Code is a square, generally black and white. It consists of two parts: coding area and function graphics. The coding area is responsible for storing data coding information. The function graphics is used to define fixed-format information such as version information and format information. All functional graphics areas are surrounded by blank areas to distinguish them from the coding area. . QR Code QR code model 1 is the earliest QRCode QR code produced. The highest version is 14 (73X73 code element), which can process up to 1167 digits. QR Code QR Code Model 2 is an improved version of Model 1, the highest version is 40 (177X177 symbols), and can handle up to 7089 digits. It can also read the data smoothly even if the QR code is deformed. When the QR code is printed on a curved surface, or the QR code is deformed due to the reading angle and other reasons, it can still be effectively read through the alignment mode set inside the QR code.

QR Code码符号有1~40个版本,分别表示四十种规格。每一版本符号比前一版本每边增加4个模块,即版本1的规格为21模块×21模块,版本2为25模块×25模块,……,版本40规格为177模块×177模块。There are 1 to 40 versions of QR Code symbols, representing 40 specifications respectively. Each version symbol is increased by 4 modules on each side of the previous version, that is, the specification of version 1 is 21 modules × 21 modules, the version 2 is 25 modules × 25 modules, ..., the specifications of version 40 are 177 modules × 177 modules.

如图2所示,Data Matrix码(简称DM码)是最早的二维码之一,是目前所有条码中尺寸最小的,别适用于小零件的标识,直接印刷在产品实体上进行读取,广泛用在工业串号管理和产品最终等领域。As shown in Figure 2, Data Matrix code (referred to as DM code) is one of the earliest two-dimensional codes. It is the smallest of all barcodes at present. It is especially suitable for the identification of small parts. It is directly printed on the product entity for reading. Widely used in industrial serial number management and product finalization and other fields.

DM码是二维矩阵图像,方形数据块(nominally square modules)、查找模式边(finder pattern L boundary)和切换模式边(alternating pattern module) 组成,与QR码不同,DM码不具备7*7模块位置探测图形和3*3模块矫正图样,相对QR码尺寸更小,易标记在细小零件上。The DM code is a two-dimensional matrix image, consisting of nominally square modules, a finder pattern L boundary and an alternating pattern module. Unlike the QR code, the DM code does not have a 7*7 module. Position detection graphics and 3*3 module correction patterns are smaller than QR codes and can be easily marked on small parts.

容量:capacity:

(1)数字数据:3,116个字符;(1) Numerical data: 3,116 characters;

(2)字母数据:235个字符;(2) Alphabet data: 235 characters;

(3)8位字节数据:1,556个字符;(3) 8-bit byte data: 1,556 characters;

(4)汉字数据:不支持。(4) Chinese character data: not supported.

DM码具有很强的纠错性能,端情况下只需要读取20%的数据即可对数据进行正确识别。需要注意的是,模块数量超过255时,DM码将进行拆分,码以切换模式边进行分割,高识别率。The DM code has strong error correction performance, and only needs to read 20% of the data 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 by switching the mode, which has a high recognition rate.

无论二维码采用哪种码制进行编码,真正需要的是它里面所存储的信息。图1与图2的样子虽然不同,但是最终从这两张二维码读取到的信息都是同样的四个字。对于图1和图2所示的二维码,可以将其转换成点形式二维码,分别如图3和图4所示。No matter which code system the QR code uses to encode, what is really needed is the information stored in it. Although the appearances of Figure 1 and Figure 2 are different, the information finally read from the two QR codes are the same four words. For the two-dimensional code shown in Figure 1 and Figure 2, it can be converted into a two-dimensional code in dot form, as shown in Figure 3 and Figure 4, respectively.

相对于在产品(如PCB板、FPC板)上刻印原来方块状的二维码,在产品上刻印点状码将更加高效和可靠。但上述点阵码的点数依旧较多,加工这种点阵码并不是最佳选择,为此,本实施例将提出一种孔阵码的形式用来取代该点阵码。Compared with the original square-shaped QR code on the product (such as PCB board and FPC board), it will be more efficient and reliable to print the dot-shaped code on the product. However, the above-mentioned dot matrix code still has a large number of dots, and it is not the best choice to process this kind of dot matrix code. Therefore, this embodiment will propose a form of hole matrix code to replace the dot matrix code.

首先,要知道点阵码是如何存储信息的,点阵码是采用二进制数进行编码,最后转化成二维码,其原理如下所述。一般来说,二维码的规格都比较大,如16×16,18×18这些规格都是常用的,但为了说明原理,不妨采用3 ×3、4×4的规格进行说明。First of all, it is necessary to know how the dot matrix code stores information. The dot matrix code is encoded by binary numbers and finally converted into a two-dimensional code. The principle is as follows. Generally speaking, the specifications of QR codes are relatively large, such as 16×16 and 18×18, which are commonly used. However, in order to illustrate the principle, we may use the specifications of 3×3 and 4×4.

对于3×3规格的点阵码可以这么理解:如下表1所示,表1是一张3×3 规格的表格,其中存储了一些二进制信息,对于这些二进制信息可以将其图像化处理,其中对于“1”,可以采用深色圆点表示,对于“0”,可以采用空白表示,于是,能够将表1转化成一张点阵图,其形状如图5所示。The dot matrix code of 3×3 specification can be understood as follows: as shown in Table 1 below, Table 1 is a table of 3×3 specification, which stores some binary information, and can be imaged for these binary information, among which For "1", it can be represented by a dark dot, and for "0", it can be represented by a blank. Therefore, Table 1 can be converted into a bitmap, the shape of which is shown in Figure 5.

00 00 11 11 11 00 11 00 1 1

表1Table 1

从图6可以看到,表1中数据为1的部分,使用黑色圆点表示,数据为0 的部分,使用空心圆点表示,这样表1的信息就转化成了图5的图像,从数字到图像,尽管样子不一样,但它们所存储的信息是一样的。As can be seen from Figure 6, the part with data 1 in Table 1 is represented by black dots, and the part with data 0 is represented by hollow dots, so that the information in Table 1 is transformed into the image in Figure 5, from the digital To images, although they look different, the information they store is the same.

对于4×4规格的点阵码可以这么理解:首先,随机取一个4×4规格的二进制表格,如下表2所示;对于表2,依然可以按照“1”为深色圆点、“0”为空白的方式进行转换,可以得到图6。The dot matrix code of 4×4 specification can be understood as follows: First, randomly select a binary table of 4×4 specification, as shown in Table 2 below; ” is blank to convert, and Figure 6 can be obtained.

11 00 11 00 00 11 00 11 11 00 00 11 11 11 00 0 0

表2Table 2

从以上分析能够看出,对于每一个存储二进制信息的表格,都能找到一张点阵图与之对应。另外,根据组合的知识可以知道二进制表格规格越大,那它能存储的信息也就越多,但相应的点阵图的点数就越多。对于QR二维码, 21×21的规格是最小规格,这意味着每一张最小规格的点阵图具有441个点,而如今版本40的二维码规格为177×177,这意味着一张177×177的二维码需要31329个点,这对于工业应用是很不便的,因此本实施例提出一套编码规则,将点阵码转化成孔阵码,以大大减少孔数。It can be seen from the above analysis that for each table storing binary information, a bitmap can be found corresponding to it. In addition, according to the knowledge of the combination, it can be known that the larger the size of the binary table, the more information it can store, but the more points of the corresponding bitmap. For QR codes, the size of 21×21 is the minimum size, which means that each minimum size bitmap has 441 dots, while the size of the QR code in version 40 today is 177×177, which means that one A 177×177 two-dimensional code requires 31329 points, which is very inconvenient for industrial applications. Therefore, this embodiment proposes a set of coding rules to convert the dot matrix code into a hole matrix code to greatly reduce the number of holes.

(四)二维码转孔阵码编码规则(4) Encoding rules for QR code to hole array code

本实施例提出了一种二维码与孔阵码的转换方法,包括:对于规格不大于预设阈值的二维码的转换方法,以及对于规格大于预设阈值的二维码的转换方法。This embodiment proposes a method for converting a two-dimensional code and a hole array code, including: a method for converting two-dimensional codes whose specifications are not greater than a preset threshold, and a method for converting two-dimensional codes whose specifications are greater than a preset threshold.

(I)对于规格不大于预设阈值的二维码,其与孔阵码的转换方法如图7 所示,包括:(1) For the two-dimensional code whose specification is not greater than the preset threshold, the conversion method between it and the hole array code is shown in Figure 7, including:

步骤101、将m×m规格的二维码先转换为m×m规格的点阵码,再转换为m×m规格的二进制表格,其中的m×m小于预设值。Step 101: Convert the two-dimensional code of m×m size into a dot matrix code of m×m size, and then convert it into a binary table of m×m size, where m×m is smaller than a preset value.

步骤102、将m×m规格的二进制表格转换为m×1规格的十进制表格。Step 102 , convert the binary table of m×m size into a decimal table of m×1 size.

步骤103、对m×1规格的十进制表格中的每个数据除以2m,使得表格中的每个数均小于1,得到m×1规格的孔阵码表格。Step 103: Divide each data in the m×1 decimal table by 2 m so that each number in the table is less than 1, and obtain the m×1 hole array code table.

步骤104、根据m×1规格的孔阵码表格绘制孔阵码图。Step 104 , drawing a hole array code diagram according to the hole array code table of m×1 specification.

步骤105、根据孔阵码图在产品上形成孔阵码。Step 105 , forming a hole array code on the product according to the hole array code map.

下面将以4×4规格的二维码为例进行说明具体转换方法:The following will take a 4×4 QR code as an example to illustrate the specific conversion method:

对于4×4二维码,依然以图6为例。对于图6,可先将其转换为表2所示的4×4二进制表格,再转换为表3所示的4×1的十进制表格:For the 4×4 QR code, still take Figure 6 as an example. For Figure 6, it can 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:

1010 55 99 12 12

表3table 3

这样,就将4×4的二维码转换成了4×1的十进制表格,为了将该信息转换成需要的可实现的孔阵码,继续做如下转换:4×1表格中的每个数据除以24,这样就得到表4,表4中的每个数均小于1。In this way, the 4×4 two-dimensional code is converted into a 4×1 decimal table. In order to convert this information into the required achievable hole array code, the following conversion is continued: each data in the 4×1 table Divide by 2 4 , which gives Table 4, where every number in Table 4 is less than 1.

Figure GDA0002596156350000091
Figure GDA0002596156350000091

表4Table 4

对于这个表4,可以将其转换成如图8所示的孔阵码图:将每个数据转换成点位置在一行的比例,就能将4列转换成一列点存储信息,如果列数增加,就能在很大程度上提升刻画二维码的效率。For this table 4, it can be converted into a hole array code map as shown in Figure 8: by converting each data into the ratio of point positions in one row, 4 columns can be converted into one column of point storage information, if the number of columns increases , which can greatly improve the efficiency of characterizing the two-dimensional code.

(II)对于规格大于预设阈值的二维码,其与孔阵码的转换方法如图9所示,包括:(II) For the two-dimensional code whose specification is greater than the preset threshold, the conversion method between it and the hole array code is shown in Figure 9, including:

步骤201、将m×m规格的二维码转换为m×m规格的点阵码,再转换为 m×m规格的二进制表格。Step 201: Convert the two-dimensional code of m×m size into a dot matrix code of m×m size, and then convert it into a binary table of m×m size.

步骤202、将m×m规格的二进制表格由整体划分为至少两个二进制表格部分,每个二进制表格部分的规格小于m×m规格;Step 202: Divide the binary table of m×m size into at least two binary table parts from the whole, and the size of each binary table part is smaller than the m×m size;

步骤203、将每个二进制表格部分分别转换为相应的孔阵码局部图,得到至少两个孔阵码局部图。Step 203: Convert each binary table part into a corresponding hole-array code local map to obtain at least two hole-array code local maps.

步骤204、将所得到的全部孔阵码局部图合并成完整的孔阵码图。Step 204: Combine all the obtained partial maps of the hole array code into a complete map of the hole array code.

步骤205、根据孔阵码图在产品上形成孔阵码。Step 205 , forming a hole array code on the product according to the hole array code map.

为了尽量减少最终形成的孔阵码的孔数,步骤202中m×m规格的二进制表格的划分方法包括:In order to minimize the number of holes in the finally formed hole array code, the method for dividing the binary table of m×m size in step 202 includes:

首先,获取机台打孔精度

Figure GDA0002596156350000092
孔阵码区域尺寸L1×L2(L1为长度,L2为宽度)以及二维码规格m×m;其中,孔阵码区域尺寸一般为5mm×5mm或者4mm×4mm;First, get the punching accuracy of the machine
Figure GDA0002596156350000092
The size of the hole array code area L 1 ×L 2 (L 1 is the length, L 2 is the width) and the size of the two-dimensional code m×m; the size of the hole array code area is generally 5mm×5mm or 4mm×4mm;

然后,根据公式

Figure GDA0002596156350000093
计算得出组合列数n的可取值;Then, according to the formula
Figure GDA0002596156350000093
Calculate the possible value of the number of combination columns n;

最后,按照公式x=[m/n],得到m×m规格的二进制表格划分的等分数x。Finally, according to the formula x=[m/n], the equal fraction x of the binary table division of the m×m specification is obtained.

在上述划分方法中,n可能会有多个值,使得等分数x也可能会有多个值,即存在多种划分方法。然而等分数x越大,需要加工的孔数就越多,因而,最佳等分数x=[m/nmax]。In the above division method, n may have multiple values, so that the equal fraction x may also have multiple values, that is, there are multiple division methods. However, the larger the aliquot x, the more holes need to be machined, so the optimal aliquot x=[m/n max ].

步骤203中,将每个二进制表格部分分别转换为相应的孔阵码局部图的方法为:In step 203, the method for converting each binary table part into a corresponding hole array code local map is as follows:

先将每个二进制表格部分中的数据转换成十进制数据并除以2n,使得表格中的每个数均小于1,得到m×1规格的孔阵码表格;First convert the data in each binary table part into decimal data and divide by 2 n , so that each number in the table is less than 1, and obtain the hole array code table of m×1 specification;

再根据m×1规格的孔阵码表格绘制孔阵码图。Then draw the hole array code diagram according to the hole array code table of m×1 specification.

下面将采用PCB行业常用的18×18规格和21×21规格的二维码为例进行说明。The following will take the 18×18 and 21×21 QR codes commonly used in the PCB industry as examples to illustrate.

①18×18规格的二维码转孔阵码①18×18 QR code to hole array code

以图10所示的18×18二维码阵列图为例,在转换之前可以明确的是, 18×18要转成一个18×1孔阵图要求非常高。如果转成18×1规格的孔阵码,需要机台对孔的加工精度应该小于或等于,也就是238nm,这远远超过了目前机台实际加工所能到达的水平。为此,本实施例将对其进行转换,可以考虑将18×18分成18×4或者18×5这样的小部分,然后再将这样的小部分分别转换成孔阵码局部图。那么本实施例采用以下计算方法:Taking the 18×18 two-dimensional code array diagram shown in FIG. 10 as an example, it is clear before the conversion that the requirements for converting 18×18 into an 18×1 hole array diagram are very high. If it is converted into 18×1 hole array code, the machining accuracy of the machine should be less than or equal to 238nm, which is far beyond the level that the current machine can actually process. To this end, this embodiment will convert it. It can be considered to divide 18×18 into small parts such as 18×4 or 18×5, and then convert such small parts into local maps of hole array codes respectively. Then this embodiment adopts the following calculation method:

首先,获取如下参数:First, get the following parameters:

a、机台打孔精度

Figure GDA0002596156350000101
a. The punching accuracy of the machine
Figure GDA0002596156350000101

b、孔阵码区域尺寸L1×L2b. The size of the hole array code area L 1 ×L 2 ;

c、二维码规格m×m,为18×18。c. The size of the QR code is m×m, which is 18×18.

对于打孔精度,其计算方法可以为:对于n列数据转换成一列数据,最小计量单位e*是:For the punching accuracy, the calculation method can be as follows: For the conversion of n columns of data into one column of data, the minimum unit of measurement e * is:

Figure GDA0002596156350000102
Figure GDA0002596156350000102

那么机台的打孔精度应该满足:Then the punching accuracy of the machine should meet:

Figure GDA0002596156350000103
Figure GDA0002596156350000103

这样,当给定机台打孔精度,根据二维码区域宽度L2,可以由式2得到 nmax,最后根据nmax得到最佳方案。计算过程如下:In this way, when the punching precision of the machine is given, according to the width L 2 of the two-dimensional code area, n max can be obtained by formula 2, and finally the optimal solution can be obtained according to n max . The calculation process is as follows:

假设给定机台精度

Figure GDA0002596156350000111
L1×L2=4mm×4mm。由于n为整数,反解较为困难,可以将n从小到大代入到式2,取满足条件的最大值,可以得到 nmax=4,于是可以将二维码数据分为x=[18/4]=5等份。而等分数x越大,需要加工的孔数就会相应增加,比如如果分成6份,那么需要增加18个孔,因此,在满足精度要求尽可能小、孔数尽可能少的约束条件下,可以得到最佳方案,即将18×18分为18×4,18×4,18×4,18×4,18×2。Assuming a given machine accuracy
Figure GDA0002596156350000111
L 1 ×L 2 =4mm×4mm. Since n is an integer, the inverse solution is difficult. You can substitute n into Equation 2 from small to large, and take the maximum value that satisfies the conditions, you can get n max =4, so the two-dimensional code data can be divided into x=[18/4 ] = 5 aliquots. And the larger the equal fraction x is, the number of holes to be processed will increase accordingly. For example, if it is divided into 6 parts, then 18 holes need to be added. Therefore, under the constraints that the accuracy requirements are as small as possible and the number of holes are as small as possible, The best solution can be obtained, that is, 18×18 is divided into 18×4, 18×4, 18×4, 18×4, 18×2.

那么,经转换处理并合并后可以得到图11所示的孔阵码图,去掉孔阵码图中的线条修饰可以得到最后的孔阵码,如图12所示,该图共计93个孔,包括90个数据孔,3个定位孔;而原二维码数据共计414孔,很明显,这将大大减少加工量。Then, the hole array code diagram shown in Figure 11 can be obtained after conversion processing and merging, and the final hole array code can be obtained by removing the line decoration in the hole array code diagram. As shown in Figure 12, the picture has a total of 93 holes. Including 90 data holes and 3 positioning holes; while the original two-dimensional code data has a total of 414 holes, obviously, this will greatly reduce the processing volume.

②21×21规格的二维码转孔阵码②21×21 QR code to hole array code

首先,随机产生一张二维码,其对应的21×21规格的二进制表,如下表 5所示。First, a QR code is randomly generated, and its corresponding 21×21 binary table is shown in Table 5 below.

00 00 00 00 11 00 00 00 11 11 00 00 00 11 11 11 11 11 11 11 11 00 00 00 11 00 11 11 00 11 00 11 00 00 00 00 00 11 11 11 11 00 11 00 00 11 11 11 11 00 00 00 11 00 00 11 00 11 00 11 00 00 11 00 00 00 00 11 00 11 00 11 00 11 00 11 00 11 11 00 11 00 11 11 00 11 00 00 00 00 00 11 11 00 00 00 11 11 00 11 11 00 11 11 11 00 00 11 11 00 11 11 00 00 00 00 11 00 00 00 00 00 11 11 11 00 11 00 11 00 00 00 00 11 00 11 00 00 11 00 00 00 00 00 00 11 00 11 11 11 00 00 11 11 11 11 11 00 00 11 11 00 11 11 00 00 11 11 11 11 11 00 11 00 11 00 11 00 11 11 00 00 11 00 00 00 11 11 00 11 11 11 00 11 11 00 00 00 11 00 11 00 00 00 11 00 00 00 11 11 00 00 00 00 11 00 11 11 00 11 00 00 11 11 11 11 11 00 11 11 11 00 00 11 11 11 00 11 00 11 11 00 11 00 11 11 11 11 00 00 11 00 11 00 00 00 11 00 11 00 11 00 00 00 00 11 00 00 00 11 00 11 11 00 00 11 11 11 00 11 00 00 00 11 00 11 00 00 11 00 00 00 11 00 11 11 11 11 11 11 11 00 00 00 00 11 11 00 00 00 00 00 00 11 00 00 00 00 00 00 11 11 11 11 00 00 11 00 11 11 11 00 00 11 11 11 11 00 00 00 11 00 11 11 11 00 00 00 11 00 00 00 00 11 00 00 00 00 11 00 11 11 00 11 00 11 00 11 11 11 00 11 11 11 00 11 00 11 11 00 11 00 00 11 00 11 11 00 11 11 00 11 00 11 00 11 11 11 11 11 00 00 11 11 00 00 11 00 00 00 11 11 11 00 00 00 00 00 11 11 00 11 00 00 00 00 11 11 00 11 11 11 00 11 00 00 00 00 11 00 0 0

表5table 5

接着通过该表5产生如图13所示的21×21规格的点阵图,对于该规格点阵图如果将其转换成21×1规格的孔阵码图是不现实的,因此本实例同样按照18×18规格的计算方法进行计算,过程如下:Then, a bitmap of the 21×21 specification as shown in Figure 13 is generated through the table 5. It is unrealistic to convert the bitmap of this specification into a hole matrix code of the 21×1 specification, so this example is the same The calculation is carried out according to the calculation method of the 18×18 specification, and the process is as follows:

假设机台打孔精度

Figure GDA0002596156350000121
即15.625um,L2=5mm,那么可以一步步代入式2计算得到nmax=5。因此,对21×21的二维码,最少需要将21列数据分成[21/5]=5份,于是可以将21×21规格的二维码分为以下几部分:Assuming the punching accuracy of the machine
Figure GDA0002596156350000121
That is, 15.625um, L 2 =5mm, then n max =5 can be calculated by substituting into Equation 2 step by step. Therefore, for the 21×21 QR code, at least 21 columns of data need to be divided into [21/5]=5 parts, so the 21×21 QR code can be divided into the following parts:

(1)21×5,21×5,21×5,21×5,21×1;(1) 21×5, 21×5, 21×5, 21×5, 21×1;

或者,(2)21×5,21×4,21×4,21×4,21×4;Or, (2) 21×5, 21×4, 21×4, 21×4, 21×4;

或者,(3)21×5,21×5,21×4,21×4,21×3;Or, (3) 21×5, 21×5, 21×4, 21×4, 21×3;

等等。and many more.

很明显,21×5、21×4及21×3的加工要求精度依次递减。在实际操作中,首先需保证在满足机台打孔精度的前提下尽可能地减少加工孔的个数,其次需尽可能减少具有高精度要求的孔数,此时可以根据等分值逆序总和最小的判断原则来确定其中最佳方案。上述三种划分方案中,其中精度要求的孔数分布情况可以采用逆序数(序列中每两数比较,两数不等序列数加1)进行评估,以上方案(5,5,5,5,1)、(5,4,4,4,4)、(5,5,4,4,3)等序列逆序数分别为4、4、 8,但(1)方案中21×5个数大于(2)方案,因而在上述三种划分方案中方案(2) 为最佳方案。Obviously, the machining requirements of 21×5, 21×4 and 21×3 require decreasing precision. In actual operation, first of all, it is necessary to reduce the number of machined holes as much as possible under the premise of satisfying the drilling accuracy of the machine, and secondly, to reduce the number of holes with high precision requirements as much as possible. The principle of least judgment is used to determine the best solution. In the above three division schemes, the distribution of the number of holes required by the precision can be evaluated by the reverse order number (every two numbers in the sequence are compared, and the number of two unequal sequences is added by 1). The above schemes (5, 5, 5, 5, 1), (5, 4, 4, 4, 4), (5, 5, 4, 4, 3) and other sequence inverse numbers are 4, 4, and 8 respectively, but the number of 21×5 in scheme (1) is greater than Scheme (2), so scheme (2) is the best scheme among the above three division schemes.

对于21×1这种只转换一列的数据,可以利用左侧竖列打5个孔表示该数据。根据上述规则,可以将21×21规格的二维码数据转换成下表6:For 21×1 data that only converts one column, you can use the left vertical column to punch 5 holes to represent the data. According to the above rules, the 21×21 QR code data can be converted into the following table 6:

00 66 1313 23twenty three 1111 21twenty one 11 1111 3131 1111 11 1616 2020 11 66 23twenty three 11 1010 1010 44 24twenty four 23twenty three 11 1515 1313 11 2929 1515 3131 24twenty four 1414 66 3030 2525 1212 1818 66 2929 1111 22 24twenty four 44 11 99 22twenty two 1212 1919 1414 1616 2727 24twenty four 1010 1212 2020 1818 1818 2525 22 55 1111 00 00 1919 2929 22 88 99 1717 3131 00 33 2626 21twenty one 44 1717 2020 1919 77 33 1414 88 2626 33 1313 1414 1818 1515 44 6 6

表6Table 6

根据表6数据除以25,最后可将其转换成如图14所示的孔阵码图。去掉线条后,可以得到最终的孔阵码,如图15所示。Divide the data in Table 6 by 25, and finally convert it into the hole array code map shown in Figure 14. After removing the lines, the final hole array code can be obtained, as shown in Figure 15.

相对于21×21规格二维图的441个孔,该图15只需要113个孔,其中 110个数据孔,3个定位孔,大大提高了生产效率。Compared with the 441 holes in the 21×21 size two-dimensional map, the figure 15 only needs 113 holes, including 110 data holes and 3 positioning holes, which greatly improves the production efficiency.

综上,转换之前,需要如下信息:机台打孔精度

Figure GDA0002596156350000131
孔阵码区域尺寸L1×L2(L1为长度,L2为宽度)以及二维码规格m×m;In summary, before the conversion, the following information is required: the punching accuracy of the machine
Figure GDA0002596156350000131
The size of the hole array code area L 1 ×L 2 (L 1 is the length, L 2 is the width) and the QR code specification m×m;

接着依据式2计算得到组合列数n,利用组合列数n计算出等分数x,最后得到满足以上条件的多种组合;其中最优方案应该是这样的:为保证加工孔数最少,这就要求等分数x等于[m/nmax];在加工孔数最少的基础上,为保证高精度要求的孔数尽可能少,这样就要求等分值(比如5,5,1,1)逆序总和最小。另外,若等分值有1,利用左侧列线打孔,这样可以减少一列孔。Then, the number of combination columns n is calculated according to formula 2, and the equal fraction x is calculated by using the number of combination columns n, and finally a variety of combinations that meet the above conditions are obtained; the optimal solution should be as follows: in order to ensure the minimum number of machining holes, this The equal fraction x is required to be equal to [m/n max ]; on the basis of the minimum number of processed holes, the number of holes required to ensure high precision is as small as possible, so the equal fraction values (such as 5, 5, 1, 1) are required to be in reverse order The sum is the smallest. In addition, if the equal value is 1, use the left column line to punch holes, which can reduce one column of holes.

以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the present invention.

Claims (10)

1.一种二维码与孔阵码的转换方法,所述二维码的规格为m×m,其特征在于,在所述m×m规格大于预设阈值时,所述转换方法为:1. a conversion method of two-dimensional code and hole array code, the specification of described two-dimensional code is m × m, it is characterized in that, when described m × m specification is greater than preset threshold, described conversion method is: 将所述m×m规格的二维码转换为m×m规格的点阵码,再转换为m×m规格的二进制表格;converting the two-dimensional code of the m×m specification into a dot matrix code of the m×m specification, and then converted into a binary table of the m×m specification; 将所述m×m规格的二进制表格由整体划分为至少两个二进制表格部分;dividing the binary table of m×m specification into at least two binary table parts from the whole; 将每个二进制表格部分分别转换为相应的孔阵码局部图;Convert each binary table part into the corresponding hole array code local map; 将所得到的全部孔阵码局部图合并为完整的孔阵码图;Combine all the obtained partial maps of hole array codes into a complete hole array code map; 根据所述孔阵码图在产品上形成孔阵码。A hole array code is formed on the product according to the hole array code map. 2.根据权利要求1所述的二维码与孔阵码的转换方法,其特征在于,所述将m×m规格的二进制表格由整体划分为至少两个二进制表格部分的方法包括:2. The method for converting a two-dimensional code and a hole array code according to claim 1, wherein the method for dividing the binary table of the m×m specification into at least two binary table parts as a whole comprises: 获取机台打孔精度
Figure FDA0002596156340000011
孔阵码区域尺寸L1×L2以及所述二维码的规格m×m;所述L1为长度、L2为宽度;
Get the punching accuracy of the machine
Figure FDA0002596156340000011
The size of the hole array code area L 1 ×L 2 and the specification m×m of the two-dimensional code; the L 1 is the length, and the L 2 is the width;
根据公式
Figure FDA0002596156340000012
计算得出组合列数n;
According to the formula
Figure FDA0002596156340000012
Calculate the number of combined columns n;
按照公式x=[m/n],得到等分数x;According to the formula x=[m/n], get the equal fraction x; 将所述m×m规格的二进制表格按照每份组合列数为n的方式划分为x份。Divide the binary table of m×m size into x parts in a manner that the number of columns for each combination is n.
3.根据权利要求1所述的二维码与孔阵码的转换方法,其特征在于,所述将m×m规格的二进制表格由整体划分为至少两个二进制表格部分的方法包括:3. The method for converting a two-dimensional code and a hole array code according to claim 1, wherein the method for dividing the binary table of the m×m specification into at least two binary table parts as a whole comprises: 获取机台打孔精度
Figure FDA0002596156340000013
孔阵码区域尺寸L1×L2以及所述二维码的规格m×m;所述L1为长度、L2为宽度;
Get the punching accuracy of the machine
Figure FDA0002596156340000013
The size of the hole array code area L 1 ×L 2 and the specification m×m of the two-dimensional code; the L 1 is the length, and the L 2 is the width;
根据公式
Figure FDA0002596156340000014
计算得出组合列数n的最大值nmax
According to the formula
Figure FDA0002596156340000014
Calculate the maximum value n max of the number of combined columns n;
按照公式xmin=[m/nmax],得到等分数x的最小值xminAccording to the formula x min =[m/n max ], obtain the minimum value x min of the equal fraction x; 将所述m×m规格的二进制表格按照每份组合列数为nmax的方式划分为xmin份。The binary table of m×m specification is divided into x min parts in a manner that the number of columns in each combination is n max .
4.根据权利要求3所述的二维码与孔阵码的转换方法,其特征在于,所述将m×m规格的二进制表格由整体划分为至少两个二进制表格部分的方法还包括:在将所述m×m规格的二进制表格按照每份组合列数为nmax的方式划分为xmin份时,使得等分值逆序总和最小。4. The method for converting a two-dimensional code and a hole-array code according to claim 3, wherein the method for dividing the binary table of the m×m specification into at least two binary table parts as a whole further comprises: When dividing the binary table of m×m size into x min parts in a manner that the number of combined columns for each part is n max , the reversed sum of the equal division values is minimized. 5.根据权利要求2所述的二维码与孔阵码的转换方法,其特征在于,在将所述m×m规格的二进制表格按照每份组合列数为n的方式划分为x份后,若等分值有1,则在将相应二进制表格部分转换为孔阵码局部图时利用相应侧的列线生成孔。5. The conversion method of two-dimensional code and hole array code according to claim 2, is characterized in that, after the binary table of described m×m specification is divided into x parts according to the mode that each combined column number is n , if the equivalence value is 1, the column lines on the corresponding side are used to generate holes when the corresponding binary table part is converted into a local map of hole array codes. 6.根据权利要求3所述的二维码与孔阵码的转换方法,其特征在于,所述m×m=18×18时,将所述m×m规格的二进制表格由整体划分为五个二进制表格部分,各部分的规格分别为:18×4、18×4、18×4、18×4及18×2。6 . The method for converting a two-dimensional code and a hole array code according to claim 3 , wherein when the m×m=18×18, the binary table of the m×m specification is divided into five parts from the whole. 7 . A binary table part, the specifications of each part are: 18 × 4, 18 × 4, 18 × 4, 18 × 4 and 18 × 2. 7.根据权利要求2所述的二维码与孔阵码的转换方法,其特征在于,所述将每个二进制表格部分分别转换为相应的孔阵码局部图的方法包括:7. The conversion method of two-dimensional code and hole array code according to claim 2, is characterized in that, the described method that each binary table part is converted into corresponding hole array code partial map respectively comprises: 将所述每个二进制表格部分中的数据转换成十进制数据并除以2n,使得表格中的每个数均小于1,得到m×1规格的孔阵码表格;Convert the data in each binary table part into decimal data and divide by 2 n , so that each number in the table is less than 1, and obtain a hole array code table of m×1 specification; 根据所述m×1规格的孔阵码表格绘制孔阵码图。Draw a hole array code diagram according to the hole array code table of m×1 specification. 8.根据权利要求1所述的二维码与孔阵码的转换方法,其特征在于,在所述m×m规格不大于预设阈值时,所述转换方法为:8. The conversion method of two-dimensional code and hole array code according to claim 1, wherein, when the m×m specification is not greater than a preset threshold, the conversion method is: 将所述m×m规格的二维码先转换为m×m规格的点阵码,再转换为m×m规格的二进制表格,其中的m×m小于预设值;Converting the two-dimensional code of m×m size into a dot matrix code of m×m size first, and then converting it into a binary table of m×m size, where m×m is smaller than a preset value; 将m×m规格的二进制表格转换为m×1规格的十进制表格;Convert the binary table of m×m size to the decimal table of m×1 size; 将所述m×1规格的十进制表格转换为m×1规格的孔阵码图,之后据此孔阵码图在产品上形成孔阵码。Convert the decimal table of m×1 specification into a hole array code map of m×1 specification, and then form a hole array code on the product according to the hole array code map. 9.根据权利要求8所述的二维码与孔阵码的转换方法,其特征在于,所述将m×1规格的十进制表格转换为m×1规格的孔阵码图的方法包括:9. The method for converting a two-dimensional code and a hole array code according to claim 8, wherein the method for converting a decimal table of m×1 specification into a hole array code map of m×1 specification comprises: 将所述m×1规格的十进制表格中的每个数据除以2m,使得表格中的每个数均小于1,得到m×1规格的孔阵码表格;Divide each data in the decimal table of m×1 specification by 2 m , so that each number in the table is less than 1, and obtain the hole array code table of m×1 specification; 根据所述m×1规格的孔阵码表格绘制孔阵码图。Draw a hole array code diagram according to the hole array code table of m×1 specification. 10.根据权利要求1所述的二维码与孔阵码的转换方法,其特征在于,所述二维码包括行排式二维码和矩阵式二维码。10 . The method for converting a two-dimensional code and a 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. 11 .
CN201711328465.XA 2017-12-13 2017-12-13 A kind of conversion method of two-dimensional code and hole array code Expired - Fee Related CN108073966B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711328465.XA CN108073966B (en) 2017-12-13 2017-12-13 A kind of 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 A kind of 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 Expired - Fee Related CN108073966B (en) 2017-12-13 2017-12-13 A kind of conversion method of two-dimensional code and hole array code

Country Status (1)

Country Link
CN (1) CN108073966B (en)

Families Citing this family (8)

* 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
CN116758696B (en) * 2023-03-06 2025-08-26 广东电网有限责任公司 A working method for judging power grid safety operation based on digital network

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) A kind of conversion method of two-dimensional code and hole array code
EP2393035B1 (en) QR barcode decoding chip and decoding method thereof
CN107247985B (en) Coding, positioning and identifying method of two-dimensional code
EP2393037B1 (en) Data matrix decoding chip and decoding method thereof
FI99056C (en) Binary code that changes dynamically as well as a procedure for reading it and generating it
CN101334849B (en) Symbol generation method and device of two-dimensional code label
CN107992917B (en) A Quality Traceability Method of Multilayer PCB
EP2393038A1 (en) Matrix-type two-dimensional barcode decoding chip and decoding method thereof
JP2007317184A (en) Two-dimensional bar code, and encoding and decoding method thereof
CN111046996B (en) Color QR code generation and identification method
IL150832A (en) Method for data matrix print quality verification
CN101916387A (en) A three-dimensional barcode label and its manufacturing method
EP3996283B1 (en) Coding pattern, coding and reading methods for same, calibration board, and calibration method
CN107992918B (en) A product whole process quality traceability method
CN105426945A (en) Encoding system and method as well as decoding system and method of intelligent graph recognition two-dimension code
CN107563477A (en) Quick Response Code and its generation method and device
CN114021596A (en) Bar code identification method and device based on deep learning
EP3561729B1 (en) Method for detecting and recognising long-range high-density visual markers
CN112507751A (en) QR code positioning method and system
CN112187284B (en) Coding method, coding pattern, coding pattern reading method and shooting device
CN101303742B (en) Micro Chinese Sensible Code and Its Symbol Generation Method
CN107742089B (en) Method for automatically identifying two-dimensional code by using spreadsheet
CN104217189A (en) Self-learning identification method of barcode used for test strip
CN114021595A (en) Two-dimensional code identification method and device
CN117375623A (en) A binary-based mold encoding and identification method, storage device and intelligent terminal

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201110