QR code extension method

11809931 · 2023-11-07

Assignee

Inventors

Cpc classification

International classification

Abstract

Disclosed is a QR code extension method, comprising the following steps: S1. obtaining data encoding information, and determining the number of positioning points based on a data encoding length; S2. partitioning a data area according to different shapes, and adjusting a parameter of each data partition by adjusting the number of transverse and/or longitudinal unit QR codes; and S3, drawing a QR code, and outputting a result. The method is more flexible, and can make a QR code realize one-way or two-way extension, and the length and the width of a data area can be slightly adjusted to ensure that the capacity of the data area is close to the size of data information, so that capacity in per unit space is optimized.

Claims

1. A method, comprising: obtaining a data code, and determining the number of positioning points based on the length of the data code; partitioning data areas, and adjusting parameters of each of the data areas by adjusting the numbers of transverse unit QR codes and/or longitudinal unit QR codes; drawing a QR code; wherein at least one of the data areas is partitioned into an A data area, a B data area and a C data area; wherein the capacities of the A data area, the B data area and the C data area meet a relationship of x*y+y:2x+(y−1)*(x−1):x*y, x and y respectively representing the number of the transverse unit QR codes and the number of the longitudinal unit QR codes; wherein the number of the transverse unit QR codes and/or the number of the longitudinal unit QR codes are adjusted to determine the capacity of each of the data areas; and wherein, the width L1 of the A data area and the length L2 of the B data area are adjustable; wherein the numbers of the A data area, the B data area and the C data area, the length of the A data area and the width of the B data area are fixed values; wherein the parameters of the C data area are obtained according to the parameters of the A data area and the B data area, and the total capacity of the data areas is calculated based on L1 and L2.

2. The method according to claim 1, wherein, the number of the positioning points is determined by calculating the capacity of the data areas, or determined by direct selection from a list of custom versions.

3. The method according to claim 2, wherein, determination of the number of the positioning points is determination of the number of appropriate transverse and longitudinal positioning points.

4. The method according to claim 3, wherein, the positioning points comprise main positioning points and auxiliary positioning points.

5. The method according to claim 3, further comprising compiling number information of the positioning points into a basic information area.

6. The method according to claim 1, wherein, the data capacity of the QR code is larger than the length of the data code.

7. The method according to claim 1, wherein, the total capacity is not less than an encoded data size.

8. The method according to claim 7, wherein, drawing the QR code comprise drawing a QR code framework according to the number of the positioning points, transverse and longitudinal parameters of the positioning points and length and width parameters of the data areas, and filling in the encoded data.

9. The method according to claim 8, wherein, before the result is outputted, all parameter information is processed into codes and filled into a basic information area.

Description

BRIEF DESCRIPTION OF FIGURES

(1) FIG. 1 is a flow chart of QR code extension method;

(2) FIG. 2 is a specific structural schematic diagram of QR code;

(3) FIG. 3 is a structure of a unit QR code;

(4) FIG. 4 is a structural diagram of QR code with three transverse units and one longitudinal unit;

(5) FIG. 5 is a structural diagram of QR code with three transverse units and two longitudinal units.

(6) Reference Signs: 103—spacer area; 106—camouflage spacer area; 201—A data area unit partition; 202—B data area unit partition; 203—C data area unit partition; 100—positioning point; 101—basic information area; 102—outer frame; 103—spacer area; 104—auxiliary positioning point.

DETAILED DESCRIPTION

(7) Specific implementation of the present invention is described below in detail. It is necessary to indicate here that the following implementation is only used for further illustrating the present invention, and shall not be understood as a limitation to the protection scope of the present invention. Non-essential improvements and adjustments made by those skilled in the art according to the above contents of the present invention shall also belong to the protection scope of the present invention.

(8) The present invention provides QR code extension method, and a specific process of the method is shown in FIG. 1.

(9) In the extension mode of the present invention, on one hand, the QR code can be more flexible through the unidirectional or bidirectional extension form; and on the other hand, unnecessary data filling can be reduced through parameter adjustment of the data areas to maximize the data capacity of the unit area.

(10) The realization steps of the present invention specifically comprise the following steps: 1. Obtaining final data code information. 2. Obtaining the code length according to the code information, and selecting the number of appropriate transverse and longitudinal positioning points.

(11) The above positioning points comprise main positioning points and auxiliary positioning points. Of course, the positioning points can be distributed around the QR code, as shown in FIG. 5, and can also be added in the middle of the QR code. In addition, the positioning points also determine the number of the data areas. The data areas are partitioned according to different shapes into A area, B area and C area in the present invention. As shown in FIG. 4, specific data areas are located below numbers A, B and C in the figure. The data areas below the same number have the same parameters.

(12) The number of the positioning points can be obtained through fixed calculation formulas. Because the parameters of the initial data area are default standards and the proportions of the data areas are regular, the number of the positioning points can be determined by calculating the capacity of the data areas. The number of the positioning points can also be directly selected from a list of custom versions according to the code length. However, in any form, the number information of the positioning points will be compiled into the basic information area (FIG. 2-101), and the data capacity of the QR code must be larger than the length of the data code.

(13) The proportional rule of the above data areas is: if x and y respectively represent the number of transverse unit QR codes and the number of longitudinal unit QR codes in the final QR code (the unit is the QR code as shown in FIG. 3),then A:B:C must satisfy x*y+y: 2x+(y−1)*(x−1):x*y, i.e., A:B:C=x*y+y:2x+(y−1)*(x−1):x*y.

(14) Unidirectional or bidirectional pattern extension can be realized for the setting of x and y parameters. x is unchanged and y is changed, or y is unchanged and x is changed, i.e., only the change of the parameter in one of the directions represents unidirectional extension. The change of both x and y, i.e., the change of the parameters in the two directions, represents bidirectional extension.

(15) For comparison of acquisition of the number of two types of positioning points, the calculation of the first mode is relatively time-consuming, but the result will be more conducive to next data space optimization. The second mode is rapider, and has speed advantage in encoding and decoding, and relatively beautiful patterns.

(16) 3. Obtaining the number of transverse and longitudinal positioning points according to the code length and the previous step.

(17) The step is an important invention point step of the present invention. In the step, when the width L1 of the A area and the length L2 of the B data area are adjustable parameters and the number of the A, B and C data areas, the length of the A area and the width of the B region are fixed values, the parameters of the C area can be obtained according to A and B parameters. If L1 and L2 can be adjusted, the total capacity needed by the data areas in the QR code can be calculated.

(18) A calculation principle is: the capacity of the data areas is infinitely close to a real encoded data size, but not less than the encoded data size. The design can realize the optimization of the data capacity, that is, all the resources in the space will be allocated to the real encoded data to reduce the complement information of blank parts.

(19) 4. Drawing QR code and outputting a result.

(20) QR code framework is drawn according to the number of the positioning points, the transverse and longitudinal parameters of the positioning points and the length and width parameters of the data areas. The encoded data are filled in. Before the result is outputted, all the parameter information needs to be processed into codes and filled into the basic information area (FIG. 2-101). The QR code is outputted.

(21) Unidirectional or bidirectional extension of the QR code can be realized for the parameters in transverse and longitudinal dimensions in the present invention, so that the extension of the QR code is more flexible and changeable.

(22) The variable parameters of the data areas of the present invention can reduce unnecessary data capacity, make the capacity of the data areas more close to the sum of the capacity of the data areas, and achieve the result of optimal data capacity in the unit space.

(23) Although exemplary embodiments of the present invention have been described for the purpose of explanation, it will be appreciated for those skilled in the art that various variations of amendments, additions and replacements can be made in the forms and details without departing from the invention scope and spirit disclosed in appended claims, and all these variations shall belong to the protection scope of the appended claims of the present invention. Moreover, the steps in all parts and methods of the product to be protected by the present invention can be combined in any combination form. Therefore, the explanation of the embodiments disclosed in the present invention is not intended to limit the scope of the present invention, and merely used to explain the present invention. Accordingly, the scope of the present invention is not limited by the above embodiments, and is defined by the claims or equivalents thereof.