A computer device, comprising a memory, a processor, and computer-readable instructions that are stored in the memory and that are capable of running on the processor, wherein when executing the computer-readable instructions, the processor implements:
- steps:
- converting data to be encoded into binary data;
- determining a two-dimensional bar code version of a two-dimensional bar code to be generated, wherein the two-dimensional bar code to be generated comprises a plurality of rings corresponding to a same center, and each ring is corresponding to a plurality of data bits;
- determining a plurality of valid data bits of the plurality of rings according to the two-dimensional bar code version;
- dividing the plurality of valid data bits into a plurality of data segments, wherein the plurality of data segments comprise a reserved field and a content data segment, the reserved field is used to encode metadata, and the content data segment is used to encode the binary data;
- and
- generating corresponding code element patterns at the plurality of valid data bits according to the metadata and the binary data, so as to obtain the circular two-dimensional bar code;
- and/or steps:
- obtaining a circular two-dimensional bar code, wherein the circular two-dimensional bar code comprises a plurality of rings, the plurality of rings are corresponding to a same center, and each ring is corresponding to a plurality of data bits;
- determining a plurality of valid data bits of the plurality of rings according to a two-dimensional bar code version of the circular two-dimensional bar code, wherein the plurality of valid data bits are divided into a plurality of data segments, the plurality of data segments comprise a reserved field and a content data segment, the reserved field is used to store metadata, and the content data segment is used to store binary data;
- and
- obtaining binary data of the circular two-dimensional bar code according to a plurality of valid code element patterns corresponding to the plurality of valid data bits.