Method and device for generating two-dimensional code
By using the pentagram outer frame and sub-grid segmentation method of multiple circles in the QR code, a pentagram-shaped QR code is generated, which solves the problem of difficulty in using square QR codes in scenarios where square areas cannot be provided, and achieves a wider use scenario and higher applicability.
Patent Information
- Application Number
- CN202210262628.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-03-17
AI Technical Summary
It is difficult to use existing square QR codes in scenarios where square areas cannot be provided, such as in the pentagram area of the seal.
A method for generating a QR code is proposed, using the five-pointed star outer frame as the basis. By taking the center point of the five-pointed star outer frame as the center, using different radii to make multiple circumferences, and separating multiple circumferences are divided, and information is determined to fill the sub-grid and separating sub-grids, and data is filled to generate the QR code.
The scope of QR code usage scenarios has been expanded so that it can not only be applicable to square QR code applications, but also to scenes where square QR codes cannot be applied, such as the five-pointed star area of the seal, improving the applicability of QR codes.
Smart Images

Figure CN114676805B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security, and in particular to a method and device for generating a two-dimensional code. Background Art
[0002] The current mainstream QR code is the square QR code, which has been used in various scenarios.
[0003] However, the square QR code is fixed and single in form. When using a square QR code, a square area is required. Therefore, it is difficult to use it in scenarios where a square area is not available. For example, in a seal, a square QR code cannot be used in the five-pointed star area of the seal. It can be seen that the use scenarios of square QR codes are relatively limited. Summary of the invention
[0004] Based on this, the present application proposes a method and device for generating a QR code, so as to expand the scope of usage scenarios of the QR code and improve the applicability of the QR code.
[0005] In a first aspect, the present application provides a method for generating a two-dimensional code, wherein the two-dimensional code has a five-pointed star frame, and the method comprises:
[0006] Taking the center point of the five-pointed star outer frame as the center of the circle and using different radii to make multiple circles;
[0007] Dividing the multiple circles into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame;
[0008] In the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids;
[0009] Data is filled in the information filling sub-grid to obtain the two-dimensional code.
[0010] In one embodiment, the multiple circumferences include a first circumference and a second circumference, the radius of the first circumference is greater than the radius of the second circumference, and the multiple circumferences are divided into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame, including:
[0011] For any corner of the five-pointed star outer frame, the first circumference is divided into sub-grids based on a plurality of parallel first line segments with equal spacing to obtain a plurality of sub-grids, wherein the starting point of one of the first line segments is the center point of the first circular arc, and the end point is the intersection point of a second line segment and the first circumference with the smallest radius, the second line segment is a line segment formed by the center point of the first circular arc and the center of the circle, and the first circular arc corresponds to the first circumference with the largest radius in the corner;
[0012] The second circle is divided into sub-grids based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection point of each fourth line segment and the second circle with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
[0013] In one embodiment, the step of filling data in the information filling sub-grid to obtain the two-dimensional code includes:
[0014] Encode the QR code information to be filled to obtain a binary sequence;
[0015] Taking each of the four information-filled sub-grids in the form of a square as an information storage unit, and sequentially filling each binary digit in the binary sequence into the information storage unit to obtain a temporary code;
[0016] The temporary code is masked to obtain the two-dimensional code.
[0017] In one embodiment, the method for generating a two-dimensional code further includes:
[0018] For the three adjacent corners of the five-pointed star outer frame, the first center of the circle is determined on the line connecting the corner vertex and the center point of the five-pointed star outer frame, and the third circumference is made with a first radius, and each of the third circumferences is filled with color to obtain a positioning mark.
[0019] In one embodiment, sequentially filling each binary digit in the binary sequence into the information storage unit to obtain a temporary code includes:
[0020] Based on the positioning mark, determining the starting information storage unit filled with the binary sequence;
[0021] Starting from the starting information storage unit, sequentially filling the information storage unit with binary digits in the binary sequence;
[0022] In the process of filling the binary digits in the binary sequence into the information storage unit, when the binary digit is 1, the information storage unit is filled with a first color, and when the binary digit is 0, the information storage unit is filled with a second color to obtain a temporary code.
[0023] In one embodiment, the QR code includes an avatar placement area, and the method further includes:
[0024] The area within the circle with the smallest radius among the multiple circles is used as the avatar placement area.
[0025] In the second aspect, the present application also provides a device for generating a two-dimensional code, wherein the two-dimensional code has a five-pointed star outer frame, and the generating device includes: a circle division module, which is used to make multiple circles with different radii and with the center point of the five-pointed star outer frame as the center of the circle; a segmentation module, which is used to divide the multiple circles into sub-grids to obtain multiple sub-grids in the five-pointed star outer frame, and in the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the ring composed of the innermost two circles are determined as separation sub-grids, and the sub-grids in the two rings composed of the outermost three circles are determined as information-filled sub-grids; a data processing module, which is used to fill data in the information-filled sub-grids to obtain the two-dimensional code.
[0026] In one embodiment, the multiple circumferences include a first circumference and a second circumference, the radius of the first circumference is greater than the radius of the second circumference, and the segmentation module is further used to:
[0027] For any corner of the five-pointed star outer frame, the first circumference is divided into sub-grids based on a plurality of parallel first line segments with equal spacing to obtain a plurality of sub-grids, wherein the starting point of one of the first line segments is the center point of the first circular arc, and the end point is the intersection point of a second line segment and the first circumference with the smallest radius, the second line segment is a line segment formed by the center point of the first circular arc and the center of the circle, and the first circular arc corresponds to the first circumference with the largest radius in the corner;
[0028] The second circle is divided into sub-grids based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection point of each fourth line segment and the second circle with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
[0029] In one embodiment, the data processing module is further used to:
[0030] Encode the QR code information to be filled to obtain a binary sequence;
[0031] Taking each of the four information-filled sub-grids in the form of a square as an information storage unit, and sequentially filling each binary digit in the binary sequence into the information storage unit to obtain a temporary code;
[0032] The temporary code is masked to obtain the two-dimensional code.
[0033] In one embodiment, the two-dimensional code generating device further includes a positioning mark setting module, and the positioning mark setting module is used to:
[0034] For the three adjacent corners of the five-pointed star outer frame, the first center of the circle is determined on the line connecting the corner vertex and the center point of the five-pointed star outer frame, and the third circumference is made with a first radius, and each of the third circumferences is filled with color to obtain a positioning mark.
[0035] In one embodiment, the data processing module is further used to:
[0036] Based on the positioning mark, determining the starting information storage unit filled with the binary sequence;
[0037] Starting from the starting information storage unit, sequentially filling the information storage unit with binary digits in the binary sequence;
[0038] In the process of filling the binary digits in the binary sequence into the information storage unit, when the binary digit is 1, the information storage unit is filled with a first color, and when the binary digit is 0, the information storage unit is filled with a second color to obtain a temporary code.
[0039] In one embodiment, the two-dimensional code includes an avatar placement area, and the two-dimensional code generation device further includes an avatar placement area setting module, and the avatar placement area setting module is used to:
[0040] The area within the circle with the smallest radius among the multiple circles is used as the avatar placement area.
[0041] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0042] Taking the center point of the five-pointed star outer frame as the center of the circle and using different radii to make multiple circles;
[0043] Dividing the multiple circles into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame;
[0044] In the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids;
[0045] Data is filled in the information filling sub-grid to obtain the two-dimensional code.
[0046] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0047] Taking the center point of the five-pointed star outer frame as the center of the circle and using different radii to make multiple circles;
[0048] Dividing the multiple circles into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame;
[0049] In the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids;
[0050] Data is filled in the information filling sub-grid to obtain the two-dimensional code.
[0051] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0052] Taking the center point of the five-pointed star outer frame as the center of the circle and using different radii to make multiple circles;
[0053] Dividing the multiple circles into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame;
[0054] In the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids;
[0055] Data is filled in the information filling sub-grid to obtain the two-dimensional code.
[0056] The method and device for generating a QR code provided by the present application, the QR code has a five-pointed star outer frame, with the center point of the five-pointed star outer frame as the center of the circle, and multiple circles with different radii are made; the multiple circles are divided into sub-grids to obtain multiple sub-grids in the five-pointed star outer frame; in the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the ring composed of the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two rings composed of the outermost three circles are determined as the information filling sub-grids; data is filled in the information filling sub-grids to obtain the QR code. The method and device for generating a QR code provided by the present application can generate a five-pointed star-shaped QR code, enriching the generation method and style of the QR code. Since the five-pointed star-shaped QR code can be applied not only to the scenarios of square QR code application, but also to the scenarios that square QR code cannot be applied to, for example: the scenario of the five-pointed star area in the seal, therefore, the scope of use scenarios is wider, improving the applicability of the QR code. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flowchart of a method for generating a QR code in one embodiment of the present application.
[0058] Figure 2 It is a schematic diagram of multiple circles within a five-pointed star frame in one embodiment of the present application.
[0059] Figure 3 It is a flowchart of step 102 in an embodiment of the present application.
[0060] Figure 4 It is a schematic diagram of a method for generating a QR code in one embodiment of the present application.
[0061] Figure 5 It is a flowchart of step 106 in an embodiment of the present application.
[0062] Figure 6 It is a schematic diagram of a template code when performing mask processing in an embodiment of the present application.
[0063] Figure 7 It is a schematic diagram of a QR code in one embodiment of the present application.
[0064] Figure 8 It is a schematic diagram of a method for generating a QR code in one embodiment of the present application.
[0065] Fig. 9 It is a flowchart of step 502 in an embodiment of the present application.
[0066] Fig.10 It is a schematic diagram of a QR code in one embodiment of the present application.
[0067] Fig.11 It is a schematic diagram of a device for generating a two-dimensional code in one embodiment of the present application.
[0068] Fig.12 It is a diagram of the internal structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0070] In one embodiment, Figure 1 As shown, a method for generating a two-dimensional code is provided, and the two-dimensional code has a five-pointed star frame. This embodiment uses the method applied to a terminal as an example for illustration, and it can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0071] Step 100, using the center point of the five-pointed star frame as the center of the circle and using different radii to make multiple circles.
[0072] For example, the sides of the five-pointed star frame are equal in length, and the degrees of the angles are equal. In the five-pointed star frame, from the outer ring to the inner ring, the radii of multiple circles decrease at a fixed unit distance.
[0073] For example, see Figure 2 , the center point O of the five-pointed star frame is the center of the circle, and the radius difference between the circumscribed circle a and the inscribed circle b of the five-pointed star frame is d. That is, the distance between the vertex of each corner of the five-pointed star frame and the point where the connection between the vertex of the corner and the center of the circle intersects with the inscribed circle, that is, Figure 2 The length of the middle line segment CD is d. Select a point P on the line segment CD, the length of the line segment CP is 0.4d, and the length of the line segment PD is 0.6d. Divide the length of the line segment PD into 14 equal parts, and get a fixed unit distance w = 0.6d / 14. Take the center point O of the outer frame of the five-pointed star as the center of the circle and the length of the line segment PO as the radius to make a circle with the largest radius inside the corner. Figure 2 Take the adjacent angle of the angle where the midpoint C is located as an example. The intersection points of the circle with the largest radius in the angle and the two sides of any angle of the five-pointed star frame are A and B. The length of the arc AB is 0.4*d*tan18°*2=0.4*tan18°*2*(14 / 0.6)*w=6w. With point O as the center, the radius decreases from the length of the line segment PO by a fixed unit distance w, and multiple circles are made until the circle coincides with the inscribed circle b. Then, with point O as the center, the radius decreases from the radius of the inscribed circle b by a fixed unit distance w to make three more circles. There are 17 circles in the five-pointed star frame.
[0074] Step 102, dividing the multiple circles into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame.
[0075] The multiple circles can be divided into sub-grids using multiple line segments within the five-pointed star outer frame, so as to divide the multiple circles within the five-pointed star outer frame into a large number of small grids to obtain multiple sub-grids. After obtaining multiple sub-grids within the five-pointed star outer frame, the parts of the multiple circles outside the five-pointed star outer frame can be deleted.
[0076] Step 104, in the five-pointed star frame, from the outer ring to the inner ring, take every four circles as a group, determine the sub-grids in the ring composed of the innermost two circles as the separation sub-grids, and determine the sub-grids in the two rings composed of the outermost three circles as the information filling sub-grids.
[0077] Among them, the direction from the outer ring to the inner ring within the five-pointed star frame is Figure 2The direction from the circumscribed circle a to the inscribed circle b. Take the four circles starting from the circle with the largest radius inside the corner (i.e. the circle where point P is located) as an example, the sub-cells in the two rings formed by the outermost three circles of the circle where point P is located are information filling sub-cells, and the sub-cells in the rings formed by the innermost two circles are separation sub-cells. The filling sub-cells are areas that can be used to fill in the QR code information. The separation sub-cells are not used to fill in the QR code information.
[0078] Step 106, fill in the information filling sub-grid with data to obtain a QR code.
[0079] The data filled in the information filling sub-grid is a two-dimensional code sequence obtained after encoding the two-dimensional code information to be filled in the two-dimensional code. Each group of two-dimensional code sequences consists of 8 binary digits. By filling the information filling sub-grid with different binary digits, a two-dimensional code can be obtained.
[0080] The above-mentioned QR code generation method, the QR code has a five-pointed star outer frame, with the center point of the five-pointed star outer frame as the center of the circle, and multiple circles of different radii are made; the multiple circles are divided into sub-grids to obtain multiple sub-grids in the five-pointed star outer frame; in the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the ring composed of the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two rings composed of the outermost three circles are determined as the information filling sub-grids; data is filled in the information filling sub-grids to obtain the QR code. The QR code generation method provided in the embodiment of the present application can generate a five-pointed star-shaped QR code, enriching the generation method and style of the QR code. Since the five-pointed star-shaped QR code can be applied not only to the scenarios of square QR code application, but also to the scenarios that square QR code cannot be applied to, for example: the scene of the five-pointed star area in the seal, therefore, the range of use scenarios is wider, improving the applicability of the QR code.
[0081] In one embodiment, the plurality of circumferences include a first circumference and a second circumference, and the radius of the first circumference is greater than the radius of the second circumference. Figure 3 As shown, multiple circles are divided into sub-grids, and multiple sub-grids are obtained within the five-pointed star frame, including:
[0082] Step 300, for any corner of the five-pointed star frame, the first circle is divided into sub-grids based on multiple parallel and equally spaced first line segments to obtain multiple sub-grids, the starting point of one of the first line segments is the center point of the first arc, the end point is the intersection of the second line segment and the first circle with the smallest radius, the second line segment is the line segment formed by the center point of the first arc and the center of the circle, and the first arc corresponds to the first circle with the largest radius in the corner.
[0083] For example, see Figure 4, the first circle with the largest radius in the angle is the circle where point P is located, the first arc is arc AB, and the center point of the first arc is point P. The second line segment is the line segment OP formed by the center point P of the first arc and the center O. The first circle with the smallest radius is the second circle from the inner ring to the outer ring in the outer frame of the five-pointed star. The intersection of the second line segment and the first circle with the smallest radius is point E. The starting point of one of the first line segments is point P, and the end point is point E. Line segment PE is a first line segment. With a fixed unit distance w as the spacing, multiple line segments parallel to line segment PE are made to obtain multiple first line segments. At any angle of the outer frame of the five-pointed star, multiple first line segments intersect and divide the first circle to obtain multiple sub-grids.
[0084] Step 302, divide the second circle into sub-grids based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection point of each fourth line segment and the second circle with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
[0085] For example, see Figure 4 , the second circle with the smallest radius is the first circle c in the direction from the inner ring to the outer ring in the outer frame of the five-pointed star. Taking the first line segment with the end point E as an example, the fourth line segment with the end point of the first line segment as the starting point is the line segment EO. The intersection F of the line segment EO and the circle c is the end point of one of the line segments in the third line segment, and the starting point of the third line segment is point E, that is, the line segment ED is one of the line segments in the third line segment. The method for the other line segments in the third line segment is the same as that for the above-mentioned line segment ED, which will not be repeated here.
[0086] The second circle is divided into multiple sub-grids by multiple third line segments. The interval between the multiple sub-grids is w. At this time, the first circle is all the circles between the circle where point P is located and the circle where point E is located (including the circle where point P is located and the circle where point E is located), and the second circle is the circle where point F is located. It is obvious that the radius of the first circle is greater than the radius of the second circle.
[0087] It should be noted that the second circumference may include 1, 2 or 3 circles in the direction from the inner ring to the outer ring within the five-pointed star frame, and the second circumference is not specifically limited in the embodiment of the present application.
[0088] In one embodiment, Figure 5 As shown, in step 106, data is filled in the information filling sub-grid to obtain a two-dimensional code, including:
[0089] Step 500: Encode the two-dimensional code information to be filled to obtain a binary sequence.
[0090] In the disclosed embodiment, the two-dimensional code information of the computer-generated two-dimensional code can be numbers, letters, symbols, binary information, etc. The encoding format is determined according to the data type of the two-dimensional code information to be filled. For example, if the two-dimensional code information is all numbers and letters, the two-dimensional code information is encoded by ASCII (American Standard Code for Information Interchange) to obtain a binary sequence. If the two-dimensional code information contains Chinese characters, etc., the two-dimensional code information is encoded by UTF8 (8 bits, Universal Character Set / Unicode Transformation Format) to obtain a binary sequence. The encoded binary sequence is a group of 8 binary digits, and if the binary digits are less than 8, 0 is added. The two-dimensional code can introduce the Reed-Solomon error correction algorithm to implement the error correction code. The specific implementation scheme of the error correction code is consistent with the error correction code of the existing QR Code (Quick Response Code, Quick Response Matrix Code), which will not be repeated in this application. The binary sequence after the introduction of the error correction code cannot exceed 20 groups. After the two-dimensional code information is encoded, a maximum of 20 sets of binary sequences are obtained. If there are less than 20 sets, the following two bytes are repeated: 11101100 and 00010001, until 20 sets of binary sequences are obtained after the two-dimensional code information is encoded.
[0091] Step 502, taking every four information-filled sub-grids in the form of a square as an information storage unit, and sequentially filling each binary digit in the binary sequence into the information storage unit to obtain a temporary code.
[0092] Among them, one information storage unit is filled with one binary digit. Different color blocks are filled in the information storage unit according to different binary digits. Every four information-filled sub-grids in a grid are an information storage unit, and a row of separator sub-grids can be included between every two rows of information storage units, so that the information in the generated two-dimensional code is easier to read. It can be understood that the five-pointed star outer frame is filled with color blocks in a grid, and the upper and lower layers of color blocks are separated by a layer of ring (that is, a row of separator sub-grids is separated between every two rows of information storage units). Five layers of color blocks can be filled in each corner of the five-pointed star outer frame (from the vertex of the corner to the inscribed circle b), and the number of information storage units in each layer is 3, 4, 5, 6, and 7 respectively. The area inside the five-pointed star outer frame but below each corner (from the inscribed circle b to the circumference with the smallest radius in the five-pointed star outer frame) can be filled with a layer of color blocks, and each layer can be filled with 7 color blocks (that is, the number of information storage units in each layer is 7), and a total of 160 color blocks can be filled in the five-pointed star outer frame.
[0093] The temporary code is obtained by sequentially filling each binary digit in the binary sequence into the information storage unit. The temporary code is the two-dimensional code obtained after the two-dimensional code information is sequentially filled into all the information storage units. The temporary code may have large areas of connected color blocks or blanks.
[0094] Step 504, masking the temporary code to obtain a two-dimensional code.
[0095] The masking process is to perform XOR processing on the temporary code with the template code. Figure 6 , the final QR code obtained after masking with the template code is shown in Figure 7 . The exclusive OR (XOR) process is to compare the information storage units at the same position in the template code and the temporary code. If the binary numbers filled in the two information storage units are the same, they are taken as 0, and if they are different, they are taken as 1. For example, the binary number filled in an information storage unit in the temporary code is 0, and the filled color is white (that is, no filling is performed). If the binary number filled in the information storage unit at the same position in the template code is 1, and the filled color is black, then the binary number filled in the information storage unit of the final two-dimensional code is 1, and the filled color is black. Alternatively, if the binary number filled in the information storage unit at the same position in the template code is 0, and the filled color is white, then the binary number filled in the information storage unit of the final two-dimensional code is 0, and the filled color is white. The image finally obtained by the above-mentioned mask processing, after removing the sub-grids and circular lines, is a two-dimensional code. Mask processing avoids the appearance of large areas of connected color blocks or blanks in the two-dimensional code.
[0096] In one embodiment, the method for generating a two-dimensional code further includes:
[0097] For three adjacent corners of the five-pointed star frame, the first center is determined on the line connecting the corner vertex and the center point of the five-pointed star frame, and the first radius is used to make the third circumference, and each third circumference is filled with color to obtain a positioning mark.
[0098] For example, see Figure 8 , among the three adjacent corners of the five-pointed star frame, the middle corner is ranked, and the line connecting the vertex of the corner and the center point of the five-pointed star frame is the line segment OC. Take the point G in the line segment OC that is 0.3d away from the vertex C as the first center of the circle, and the first radius is 2w. With point G as the center of the circle, make a circle with a radius of 2w, which is the third circle. Fill each third circle with color to get a positioning mark.
[0099] The present application does not specifically limit the color of the third circumference filling, and the color of the third circumference filling is different from the background color of the five-pointed star frame. The setting method of the positioning marks in the other two corners of the three adjacent corners of the five-pointed star frame can refer to the above method, and this will not be repeated in the embodiments of the present application. The positioning marks in the three adjacent corners of the five-pointed star frame can be used for QR code positioning and marking.
[0100] In one embodiment, Fig. 9 As shown, in step 502, each binary digit in the binary sequence is sequentially filled into the information storage unit to obtain a temporary code, including:
[0101] Step 900: Determine the starting information storage unit filled with the binary sequence based on the positioning mark.
[0102] Among them, the three positioning marks are located in three adjacent corners of the five-pointed star frame. For example, you can refer to Figure 8 As shown, the middle corner of the three corners where the three positioning marks are located is used as the starting corner, and the information storage unit at the upper left corner of the starting corner is used as the starting information storage unit.
[0103] Step 902, starting from the starting information storage unit, filling the binary numbers in the binary sequence into the information storage unit in order.
[0104] For example, see Figure 8 , starting from the starting information storage unit, fill the information storage units in the row where the starting information storage unit is located from left to right with the binary digits in the binary sequence. After the information storage units in this row are filled, skip the separator sub-grid, and start filling from the leftmost information storage unit in the next row from left to right, until all the information storage units in the corner where the starting information storage unit is located are filled, repeat the above process in the second corner clockwise, and fill all the information storage units in the five corners of the five-pointed star frame in turn.
[0105] Step 904, in the process of filling the binary digits in the binary sequence into the information storage unit, when the binary digit is 1, the information storage unit is filled with the first color, and when the binary digit is 0, the information storage unit is filled with the second color to obtain a temporary code.
[0106] Exemplarily, the background color inside the five-pointed star frame is white, the first color is black, the second color is white, and the positioning mark filling color is black. After the QR code information is encoded, 20 groups of binary sequences are obtained, with a total of 160 binary digits. When the binary digit filled in the information storage unit is 1, the information storage unit is filled with black, and when the binary digit filled in the information storage unit is 0, the information storage unit is filled with white (or not filled, that is, the information storage unit is white at this time). According to the above filling order, start filling from the starting information storage unit until all the information storage units in the five-pointed star frame are filled with 160 binary digits to obtain a temporary code. The QR code obtained after masking the temporary code is as follows Figure 7 The five-pointed star-shaped positive relief QR code shown.
[0107] The background color inside the five-pointed star frame is red, the first color can also be white, the second color is red, and the positioning mark filling color is white. When the binary digit filled in the information storage unit is 1, the information storage unit is filled with white, and when the binary digit filled in the information storage unit is 0, the information storage unit is filled with red (or not filled, that is, the information storage unit is red at this time). According to the above filling order, start filling from the starting information storage unit until all the information storage units in the five-pointed star frame are filled with 160 binary digits to obtain a temporary code. The two-dimensional code obtained after masking the temporary code is as follows Fig.10 The five-pointed star-shaped negative text QR code shown. The negative text QR code is more beautiful than the positive text QR code.
[0108] The method for generating a QR code in the embodiment of the present application can generate a five-pointed star-shaped QR code, which enriches the generation method and style of the QR code. Since the five-pointed star-shaped QR code can be applied not only to the scenarios where the square QR code is applied, but also to the scenarios where the square QR code cannot be applied, for example, the scenario where the five-pointed star area in the seal is applied, the seal can be combined with the seal in some certification business scenarios, such as deposit certificates, transaction vouchers, contracts, etc., and the information related to the business scenario can be added through the QR code without affecting the overall beauty of the seal, thereby increasing the characteristic of being tamper-proof. Therefore, the scope of use scenarios is wider, and the applicability of the QR code is improved.
[0109] It should be noted that the embodiments of the present application do not specifically limit the first color and the second color. As long as the method for generating the QR code of the present application can be implemented, it is applicable to the embodiments of the present application.
[0110] Exemplarily, the method for reading a two-dimensional code in an embodiment of the present application is the inverse operation of the method for generating a two-dimensional code. First, an inverse mask process is performed, that is, the two-dimensional code image is subjected to an XOR process again, the two-dimensional code is restored to a temporary code, and a binary sequence in the information storage unit is obtained. The complementary code is removed, that is, the bytes supplemented in the binary sequence due to the fact that the original two-dimensional code information is encoded with less than 20 groups of binary sequences and the 0 supplemented by less than eight binary digits are removed. The two-dimensional code information is read, and the error correction code is combined with the error correction code during the reading process to perform verification and error correction, and finally the binary sequence of the correct two-dimensional code is obtained. The binary sequence of the correct two-dimensional code is decoded to obtain the original two-dimensional code information to be filled.
[0111] In one embodiment, the QR code includes an avatar placement area. The QR code generation method further includes:
[0112] The area within the circle with the smallest radius among the multiple circles is used as the avatar placement area.
[0113] The area within the circle with the smallest radius does not contain information-filled sub-grids and separated sub-grids. This area is a blank circular area, which is used as an avatar placement area. The avatar placement area can be used to place avatars, pictures, or trademark LOGOs.
[0114] The present application also provides a two-dimensional code. The two-dimensional code includes a five-pointed star outer frame. The five-pointed star outer frame includes information filling sub-grids and separation sub-grids, and a row of separation sub-grids is set between every two rows of information filling sub-grids. The information filling sub-grid is used to fill in data.
[0115] In the embodiments of the present application, the specific structure of the two-dimensional code may refer to the relevant description of the aforementioned embodiments, and will not be repeated here in the embodiments of the present application.
[0116] The QR code provided in the embodiment of the present application includes a five-pointed star outer frame. The five-pointed star outer frame includes information filling sub-grids and separation sub-grids, and a row of separation sub-grids is set between every two rows of information filling sub-grids. The information filling sub-grid is used to fill in data. The QR code provided in the embodiment of the present application is a five-pointed star-shaped QR code, which enriches the generation method and style of the QR code. Since the five-pointed star-shaped QR code can not only be applied to the scenarios of square QR code applications, but also to the scenarios that square QR codes cannot be applied to, for example: the scene of the five-pointed star area in the seal, therefore, the scope of use scenarios is wider, and the applicability of the QR code is improved. Based on the same inventive concept, the present application also provides a QR code generation device for implementing the above-mentioned QR code generation method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more QR code generation devices provided below can refer to the limitations of the QR code generation method in the above text, which will not be repeated here.
[0117] In one embodiment, see Fig.11 , a two-dimensional code generation device 1100 is provided, wherein the two-dimensional code has a five-pointed star frame. The two-dimensional code generation device 1100 comprises: a circle division module 1101, a segmentation module 1102 and a data processing module 1103, wherein:
[0118] The circle division module 1101 is used to make multiple circles with different radii using the center point of the five-pointed star frame as the center of the circle.
[0119] The segmentation module 1102 is used to segment the multiple circles into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame. Within the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids within the ring formed by the innermost two circles are determined as separation sub-grids, and the sub-grids within the two rings formed by the outermost three circles are determined as information filling sub-grids.
[0120] The data processing module 1103 is used to fill in data in the information filling sub-grid to obtain a two-dimensional code.
[0121] In the above-mentioned QR code generation device, the circumference division module is used to make multiple circles with different radii with the center point of the five-pointed star outer frame as the center of the circle; the segmentation module is used to segment the multiple circles into sub-grids to obtain multiple sub-grids in the five-pointed star outer frame; the data processing module is used to fill data in the information-filled sub-grid to obtain a QR code. The QR code generation device provided in the embodiment of the present application can generate a five-pointed star-shaped QR code, enriching the generation method and style of the QR code. Since the five-pointed star-shaped QR code can be applied not only to the scenarios of square QR code application, but also to the scenarios that square QR code cannot be applied to, for example: the scenario of the five-pointed star area in the seal, therefore, the range of use scenarios is wider, improving the applicability of the QR code.
[0122] In one embodiment, the multiple circumferences include a first circumference and a second circumference, and the radius of the first circumference is greater than the radius of the second circumference. The segmentation module 1102 is also used to segment a circumference into sub-grids based on multiple parallel and equally spaced first line segments at any corner of the five-pointed star frame to obtain multiple sub-grids, wherein the starting point of one of the first line segments is the center point of the first arc, and the end point is the intersection point of the second line segment and the first circumference with the smallest radius, the second line segment is a line segment formed by the center point of the first arc and the center of the circle, and the first arc corresponds to the first circumference with the largest radius in the angle. The segmentation module 1102 is also used to segment the second circumference into sub-grids based on multiple third line segments to obtain multiple sub-grids, wherein the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection point of each fourth line segment and the second circumference with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
[0123] In one embodiment, the data processing module 1103 is also used to encode the two-dimensional code information to be filled to obtain a binary sequence; take every four information-filled sub-grids in the form of a square as an information storage unit, and fill the binary digits in the binary sequence into the information storage unit in sequence to obtain a temporary code; and perform mask processing on the temporary code to obtain a two-dimensional code.
[0124] In one embodiment, the QR code generation device further includes a positioning mark setting module. The positioning mark setting module is used to determine the first center of the circle on the line connecting the vertex of the corner and the center point of the five-pointed star frame for three adjacent corners of the five-pointed star frame, and use the first radius to make the third circumference, and fill each third circumference with color to obtain a positioning mark.
[0125] In one embodiment, the data processing module 1103 is also used to determine the starting information storage unit filled with the binary sequence based on the positioning mark; starting from the starting information storage unit, the binary numbers in the binary sequence are filled into the information storage unit in order; in the process of filling the binary numbers in the binary sequence into the information storage unit, when the binary number is 1, the information storage unit is filled with the first color, and when the binary number is 0, the information storage unit is filled with the second color to obtain a temporary code.
[0126] In one embodiment, the two-dimensional code includes an avatar placement area, and the two-dimensional code generation device further includes an avatar placement area setting module. The avatar placement area setting module is used to use the area within the circle with the smallest radius among the multiple circles as the avatar placement area.
[0127] Each module in the above-mentioned two-dimensional code generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0128] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.12As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for generating a two-dimensional code is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0129] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In one embodiment, a computer device is provided. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0131] Take the center point of the five-pointed star frame as the center of the circle and use different radii to make multiple circles;
[0132] Divide multiple circles into sub-grids to obtain multiple sub-grids within the outer frame of the five-pointed star;
[0133] In the outer frame of the five-pointed star, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids;
[0134] Fill in the data in the information filling sub-grid to obtain a QR code.
[0135] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the multiple circumferences include a first circumference and a second circumference, and the radius of the first circumference is greater than the radius of the second circumference. For any corner of the five-pointed star outer frame, the first circumference is sub-divided based on multiple parallel and equally spaced first line segments to obtain multiple sub-grids, the starting point of one of the first line segments is the center point of the first arc, the end point is the intersection of the second line segment and the first circumference with the smallest radius, the second line segment is a line segment formed by the center point of the first arc and the center of the circle, and the first arc corresponds to the first circumference with the largest radius in the corner; the second circumference is sub-divided based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection of each fourth line segment and the second circumference with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
[0136] In one embodiment, when the processor executes the computer program, the following steps are also implemented: encoding the two-dimensional code information to be filled to obtain a binary sequence; taking every four information-filled sub-grids in the form of a square as an information storage unit, and filling each binary digit in the binary sequence into the information storage unit in sequence to obtain a temporary code; and masking the temporary code to obtain a two-dimensional code.
[0137] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for three adjacent corners of the five-pointed star frame, the first center of the circle is determined on the line connecting the vertex of the corner and the center point of the five-pointed star frame, and the third circumference is made using the first radius respectively, and each third circle is filled with color to obtain a positioning mark.
[0138] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the positioning mark, determining the starting information storage unit filled with the binary sequence; starting from the starting information storage unit, filling the binary numbers in the binary sequence into the information storage unit in order; in the process of filling the binary numbers in the binary sequence into the information storage unit, when the binary number is 1, filling the information storage unit with a first color, and when the binary number is 0, filling the information storage unit with a second color, to obtain a temporary code.
[0139] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the two-dimensional code includes an avatar placement area, and the area within the circle with the smallest radius among the multiple circles is used as the avatar placement area.
[0140] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0141] Take the center point of the five-pointed star frame as the center of the circle and use different radii to make multiple circles;
[0142] Divide multiple circles into sub-grids to obtain multiple sub-grids within the outer frame of the five-pointed star;
[0143] In the outer frame of the five-pointed star, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids;
[0144] Fill in the data in the information filling sub-grid to obtain a QR code.
[0145] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the multiple circumferences include a first circumference and a second circumference, and the radius of the first circumference is greater than the radius of the second circumference. For any corner of the five-pointed star frame, the first circumference is divided into sub-grids based on multiple parallel and equally spaced first line segments to obtain multiple sub-grids, the starting point of one of the first line segments is the center point of the first arc, the end point is the intersection of the second line segment and the first circumference with the smallest radius, the second line segment is a line segment formed by the center point of the first arc and the center of the circle, and the first arc corresponds to the first circumference with the largest radius in the corner; the second circumference is divided into sub-grids based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection of each fourth line segment and the second circumference with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
[0146] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: encoding the two-dimensional code information to be filled to obtain a binary sequence; taking every four information-filled sub-grids in the form of a square as an information storage unit, and filling each binary digit in the binary sequence into the information storage unit in sequence to obtain a temporary code; and masking the temporary code to obtain a two-dimensional code.
[0147] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for three adjacent corners of the five-pointed star frame, the first center of the circle is determined on the line connecting the vertex of the corner and the center point of the five-pointed star frame, and the third circumference is made using the first radius respectively, and each third circle is filled with color to obtain a positioning mark.
[0148] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the positioning mark, the starting information storage unit for filling the binary sequence is determined; starting from the starting information storage unit, the binary numbers in the binary sequence are filled into the information storage unit in order; in the process of filling the binary numbers in the binary sequence into the information storage unit, when the binary number is 1, the information storage unit is filled with the first color, and when the binary number is 0, the information storage unit is filled with the second color to obtain a temporary code.
[0149] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the QR code includes an avatar placement area, and the area within the circle with the smallest radius among the multiple circles is used as the avatar placement area.
[0150] In one embodiment, a computer program product is provided. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0151] Take the center point of the five-pointed star frame as the center of the circle and use different radii to make multiple circles;
[0152] Divide multiple circles into sub-grids to obtain multiple sub-grids within the outer frame of the five-pointed star;
[0153] In the outer frame of the five-pointed star, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids;
[0154] Fill in the data in the information filling sub-grid to obtain a QR code.
[0155] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the multiple circumferences include a first circumference and a second circumference, and the radius of the first circumference is greater than the radius of the second circumference. For any corner of the five-pointed star frame, the first circumference is divided into sub-grids based on multiple parallel and equally spaced first line segments to obtain multiple sub-grids, the starting point of one of the first line segments is the center point of the first arc, the end point is the intersection of the second line segment and the first circumference with the smallest radius, the second line segment is a line segment formed by the center point of the first arc and the center of the circle, and the first arc corresponds to the first circumference with the largest radius in the corner; the second circumference is divided into sub-grids based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection of each fourth line segment and the second circumference with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
[0156] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: encoding the two-dimensional code information to be filled to obtain a binary sequence; taking every four information-filled sub-grids in the form of a square as an information storage unit, and filling each binary digit in the binary sequence into the information storage unit in sequence to obtain a temporary code; and masking the temporary code to obtain a two-dimensional code.
[0157] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for three adjacent corners of the five-pointed star frame, the first center of the circle is determined on the line connecting the vertex of the corner and the center point of the five-pointed star frame, and the third circumference is made using the first radius respectively, and each third circle is filled with color to obtain a positioning mark.
[0158] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the positioning mark, the starting information storage unit for filling the binary sequence is determined; starting from the starting information storage unit, the binary numbers in the binary sequence are filled into the information storage unit in order; in the process of filling the binary numbers in the binary sequence into the information storage unit, when the binary number is 1, the information storage unit is filled with the first color, and when the binary number is 0, the information storage unit is filled with the second color to obtain a temporary code.
[0159] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the QR code includes an avatar placement area, and the area within the circle with the smallest radius among the multiple circles is used as the avatar placement area.
[0160] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0161] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0162] The above-described embodiments only express several implementation methods of the present application, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present application, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the attached claims.
Claims
1. A method for generating a two-dimensional code, characterized in that: The two-dimensional code has a five-pointed star frame, and the method comprises: Taking the center point of the five-pointed star outer frame as the center of the circle and using different radii to make multiple circles; Dividing the multiple circles into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame; In the five-pointed star outer frame, from the outer ring to the inner ring, every four circles are taken as a group, and the sub-grids in the circle formed by the innermost two circles are determined as the separation sub-grids, and the sub-grids in the two circles formed by the outermost three circles are determined as the information filling sub-grids; Filling data in the information filling sub-grid to obtain the QR code; The multiple circumferences include a first circumference and a second circumference, the radius of the first circumference is greater than the radius of the second circumference, and the multiple circumferences are divided into sub-grids to obtain multiple sub-grids within the five-pointed star outer frame, including: For any corner of the five-pointed star outer frame, the first circumference is divided into sub-grids based on a plurality of parallel first line segments with equal spacing to obtain a plurality of sub-grids, wherein the starting point of one of the first line segments is the center point of the first circular arc, and the end point is the intersection point of a second line segment and the first circumference with the smallest radius, the second line segment is a line segment formed by the center point of the first circular arc and the center of the circle, and the first circular arc corresponds to the first circumference with the largest radius in the corner; The second circle is divided into sub-grids based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection point of each fourth line segment and the second circle with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
2. The method for generating a two-dimensional code according to claim 1, wherein: The step of filling data in the information filling sub-grid to obtain the two-dimensional code includes: Encode the QR code information to be filled to obtain a binary sequence; Taking each of the four information-filled sub-grids in the form of a square as an information storage unit, and sequentially filling each binary digit in the binary sequence into the information storage unit to obtain a temporary code; The temporary code is masked to obtain the two-dimensional code.
3. The method for generating a two-dimensional code according to claim 2, wherein: The method further comprises: For the three adjacent corners of the five-pointed star outer frame, the first center of the circle is determined on the line connecting the corner vertex and the center point of the five-pointed star outer frame, and the third circumference is made with a first radius, and each of the third circumferences is filled with color to obtain a positioning mark.
4. The method for generating a two-dimensional code according to claim 3, wherein: The step of sequentially filling each binary digit in the binary sequence into the information storage unit to obtain a temporary code includes: Based on the positioning mark, determining the starting information storage unit filled with the binary sequence; Starting from the starting information storage unit, sequentially filling the information storage unit with binary digits in the binary sequence; In the process of filling the binary digits in the binary sequence into the information storage unit, when the binary digit is 1, the information storage unit is filled with a first color, and when the binary digit is 0, the information storage unit is filled with a second color to obtain a temporary code.
5. The method for generating a two-dimensional code according to claim 1, wherein: The two-dimensional code includes an avatar placement area, and the method further includes: The area within the circle with the smallest radius among the multiple circles is used as the avatar placement area.
6. A device for generating a two-dimensional code, characterized in that: The two-dimensional code has a five-pointed star frame, and the generating device comprises: A circle division module, used to make multiple circles with different radii with the center point of the five-pointed star outer frame as the center of the circle; a segmentation module, configured to segment the plurality of circles into sub-grids, obtain a plurality of sub-grids within the five-pointed star outer frame, and take every four circles as a group in a direction from the outer ring to the inner ring within the five-pointed star outer frame, determine the sub-grids within the circular ring formed by the innermost two circles as separation sub-grids, and determine the sub-grids within the two circular rings formed by the outermost three circles as information filling sub-grids; A data processing module, used for filling data in the information filling sub-grid to obtain the two-dimensional code; The multiple circles include a first circle and a second circle, the radius of the first circle is greater than the radius of the second circle, and the segmentation module is specifically used to segment the first circle into sub-grids based on multiple parallel and equally spaced first line segments for any corner of the five-pointed star outer frame to obtain multiple sub-grids, the starting point of one of the first line segments is the center point of the first arc, and the end point is the intersection point of the second line segment and the first circle with the smallest radius, the second line segment is a line segment formed by the center point of the first arc and the center of the circle, and the first arc corresponds to the first circle with the largest radius in the corner; the second circle is segmented into sub-grids based on multiple third line segments to obtain multiple sub-grids, the starting point of the third line segment is the end point of each first line segment, the end point of the third line segment is the intersection point of each fourth line segment and the second circle with the smallest radius, and each fourth line segment is a line segment formed by the end point of each first line segment and the center of the circle.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Two-dimensional code, encoding and identification method thereof and product with anti-counterfeiting function
CN108764420A
Five-pointed star encryption code generation method
CN110942129A
Two-dimensional code generation method, device and equipment, and two-dimensional code decoding method, device and equipment
CN112926715A