# US 10,311,348 B2 · Graphic identification code generation method and apparatus

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,311,348 B2
- Document ID: US10311348B2
- Status: Granted
- Kind: B2
- Application number: 16/026,187
- Filed: 2018-07-03
- Published: 2018-11-01
- Granted: 2019-06-04
- Earliest claimed: 2016-08-31
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Jin Kai Mai; Rui Bang He; Yun Feng Dai; Han Jie Wu; Fang Ning Luo
- Web page: https://patentgrep.com/patent/US10311348B2

## CPC

- G06K 19/06037: {multi-dimensional coding}
- G06K 19/0614: {the marking being selective to wavelength, e.g. color barcode or barcodes only visible under UV or IR (methods or arrangements for sensing record carriers using a selected wavelength, see G06K7/12)}
- G06K 2019/06225: {using wavelength selection, e.g. colour code}
- G06K: GRAPHICAL DATA READING (image or video recognition or understanding G06V); PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS

## Abstract

A graphic identification code generation method and apparatus are provided. The method includes receiving, from a terminal, target information and personalized effect information for a graphic identification code. The target information represents information displayed after the graphic identification code is scanned, and the personalized effect information is used to represent a display effect of the graphic identification code. Lattice data of the graphic identification code is generated according to the target information, and the graphic identification code is generated according to the lattice data and the personalized effect information.

## Claims

### Claim 1

A method comprising:
receiving, by at least one processor from a terminal, target information and personalized effect information for a graphic identification code, the target information representing information displayed after the graphic identification code is scanned, and the personalized effect information being used to represent a display effect of the graphic identification code;
generating, by the at least one processor, lattice data of the graphic identification code according to the target information;
generating, by the at least one processor, a first data lattice according to the lattice data, the first data lattice comprising a plurality of data points, each data point having a value that corresponds to a value in the lattice data;
determining, by the at least one processor, a drawing algorithm according to first-type effect information included in the personalized effect information;
for each data point, invoking, by the at least one processor, the drawing algorithm and performing color filling on the data point according to the value of the data point, to obtain a second data lattice; and
processing, by the at least one processor, the second data lattice according to second-type effect information included in the personalized effect information, to obtain the graphic identification code.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the invoking the drawing algorithm and performing color filling comprises:
in response to the first-type effect information being liquefaction effect information, dividing the data point into a plurality of squares having a same size;
performing, according to the value of the data point, color filling on each of the plurality of squares; and
superposing a rounded corner square with a filled color on the data point, a length of a side of the rounded corner square being the same as a length of a side of the data point, and the filled color of the rounded corner square set according to the value of the data point.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the performing color filling comprises:
in response to the value of the data point being a first value and all values of other data points connected to a current to-be-filled square being a second value, filling the current to-be-filled square with a background color; or
in response to the value of the data point being the first value and the current to-be-filled square not being connected to other data points, filling the current to-be-filled square with a background color; or
in response to the value of the data point being the second value and all values of other data points adjacent to the current to-be-filled square being the first value, filling the current to-be-filled square with a foreground color,
the foreground color being indicated by a foreground color identifier included in the personalized effect information and the background color being indicated by a background color identifier included in the personalized effect information.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the invoking the drawing algorithm and performing color filling comprises:
in response to the first-type effect information being three-dimensional effect information, determining whether the data point is to be filled with a background color, according to the value of the data point;
filling the data point with the background color if the data point is to be filled with the background color;
drawing at least one parallelogram based on an outline of the data point;
performing color filling on each of the at least one parallelogram, according to the value of the data point;
determining whether the data point is to be filled with a foreground color, according to the value of the data point; and
filling the data point with the foreground color if the data point is to be filled with the foreground color,
the foreground color being indicated by a foreground color identifier included in the personalized effect information and the background color being indicated by a background color identifier included in the personalized effect information.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the performing color filling comprises:
in response to the value of the data point being a first value and all values of other data points adjacent to a current to-be-filled parallelogram are a second value, filling the current to-be-filled parallelogram with another color other than the foreground color and the background color.

### Claim 6 (depends on 4)

The method according to claim 4, wherein the performing color filling comprises:
in response to the value of the data point being a first value and a current to-be-filled parallelogram not being adjacent to other data points, filling the current to-be-filled parallelogram with another color other than the foreground color and the background color.

### Claim 7 (depends on 4)

The method according to claim 4, wherein the performing color filling comprises:
in response to the value of the data point being a second value and all values of other data points adjacent to a current to-be-filled parallelogram being a first value, filling the current to-be-filled parallelogram with another color other than the foreground color and the background color.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the performing color filling comprises:
in response to the first-type effect information being rounded corner effect information, changing a shape of the data point from a square to a circle;
in response to the value of the data point being a first value, filling the circle-shaped data point with a foreground color indicated by a foreground color identifier included in the personalized effect information; and
in response to the value of the data point being a second value, filling the circle-shaped data point with a background color indicated by a background color identifier included in the personalized effect information.

### Claim 9 (depends on 1)

The method according to claim 1, wherein the processing the second data lattice comprises:
in response to the second-type effect information being code eye information, determining a code eye type indicated by the code eye information;
obtaining a code eye image and first location information according to the code eye type;
performing horizontally flipping, vertically flipping, and diagonally flipping on the code eye image in response to the code eye image being a non-axially symmetric image, to obtain a first flipped image, a second flipped image, and a third flipped image, respectively; and
adding a code eye in the second data lattice at a vertex angle location indicated by the first location information, based on the code eye image, the first flipped image, the second flipped image, and the third flipped image, to obtain the graphic identification code.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the processing the second data lattice comprises:
in response to the second-type effect information being logo information, obtaining a logo and second location information, and adding the logo in the second data lattice at a location indicated by the second location information, to obtain the graphic identification code.

### Claim 11 (depends on 1)

The method according to claim 1, wherein the processing the second data lattice comprises:
in response to the second-type effect information being size information, performing scaling processing on the second data lattice according to the size information, to obtain the graphic identification code.

### Claim 12 (depends on 1)

The method according to claim 1, wherein the processing the second data lattice comprises:
in response to the second-type effect information being format information, storing the second data lattice as an image format indicated by the format information, to obtain the graphic identification code.

### Claim 13 (depends on 1)

The method according to claim 1, wherein the processing the second data lattice comprises:
in response to the second-type effect information being boundary information, adding a boundary box for the second data lattice according to the boundary information, to obtain the graphic identification code.

### Claim 14 (depends on 1)

The method according to claim 1, wherein the processing the second data lattice comprises:
in response to the second-type effect information being scenario information, obtaining a scenario image and third location information, and embedding the second data lattice in the scenario image at a location indicated by the third location information, to obtain the graphic identification code.

### Claim 15 (depends on 1)

The method according to claim 1, further comprising:
uploading the graphic identification code that is generated to a content delivery network (CDN) server; and
generating a CDN address of the graphic identification code, and transmitting the CDN address to the terminal.

### Claim 16

An apparatus comprising:
at least one memory configured to store computer program code; and
at least one processor configured to access the at least one memory and operate according to the computer program code, the computer program code including:
receiving code configured to cause the at least one processor to receive, from a terminal, target information and personalized effect information for a graphic identification code, the target information representing information displayed after the graphic identification code is scanned, and the personalized effect information being used to represent a display effect of the graphic identification code;
lattice generation code configured to cause the at least one processor to generate lattice data of the graphic identification code according to the target information;
first lattice generation code configured to cause the at least one processor to generate a first data lattice according to the lattice data, the first data lattice comprising a plurality of data points, each data point having a value that corresponds to a value in the lattice data;
determining code configured to cause the at least one processor to determine a drawing algorithm according to first-type effect information included in the personalized effect information;
invoking code configured to cause the at least one processor to, for each data point, invoke the drawing algorithm and perform color filling on the data point according to the value of the data point, to obtain a second data lattice; and
processing code configured to cause the at least one processor to process the second data lattice according to second-type effect information included in the personalized effect information, to obtain the graphic identification code.

### Claim 17 (depends on 16)

The apparatus according to claim 16, wherein to the invoking code is configured to cause the at least one processor to:
in response to the first-type effect information being liquefaction effect information, divide the data point into a plurality of squares having a same size;
perform, according to the value of the data point, color filling on each of the plurality of squares; and
superimpose a rounded corner square with a filled color on the data point, a length of a side of the rounded corner square being the same as a length of a side of the data point, and the filled color of the rounded corner square set according to the value of the data point.

### Claim 18

A non-transitory computer readable medium storing computer program code which, when executed by at least one processor, performs:
receiving, from a terminal, target information and personalized effect information for a graphic identification code, the target information representing information displayed after the graphic identification code is scanned, and the personalized effect information being used to represent a display effect of the graphic identification code;
generating lattice data of the graphic identification code according to the target information;
generating a first data lattice according to the lattice data, the first data lattice comprising a plurality of data points, each data point having a value that corresponds to a value in the lattice data;
determining a drawing algorithm according to first-type effect information included in the personalized effect information;
for each data point, invoking the drawing algorithm and performing color filling on the data point according to the value of the data point, to obtain a second data lattice; and
processing the second data lattice according to second-type effect information included in the personalized effect information, to obtain the graphic identification code.
