CN-121981143-A - Square octagon information encoding and decoding method and system for commodity outer package
Abstract
The invention provides a square octagon information encoding and decoding method and system for commodity outer package, and relates to the technical field of data encoding and information storage. The method comprises the steps of constructing a basic coding unit by splicing regular octagons in a square, uniformly dividing the regular octagons into eight areas, and checking and correcting data according to whether independent subareas are blacked or not, wherein four triangular areas at corners of the square are blacked or not to represent 4-bit check bits to form (12, 8) Hamming codes. The four basic coding units are spliced to form an integral coding structure, so that 32bit information can be completely represented. The invention combines the intuitiveness of geometric figure coding and the error correction capability of Hamming code, can efficiently and reliably finish encoding and decoding of data under the scenes of commodity storage, logistics circulation and the like, and greatly improves the traceability of commodities and the accuracy of information identification.
Inventors
- SHAO JUN
- LU ZHONGYANG
- ZHOU YONGSHENG
Assignees
- 江苏鼎昌科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260409
Claims (10)
- 1. A square octagon information encoding and decoding method for commodity outer package, characterized by comprising the following steps: S1, constructing a basic coding unit, wherein the basic coding unit consists of an external square with coincident geometric centers and a regular octagon with connected interiors, eight vertexes of the regular octagon respectively fall on four sides of the square, so that four right angles of the square form four independent and congruent isosceles right triangle areas as corner areas; s2, taking the geometric center of the regular octagon as an origin, making eight dividing lines which pass through the origin and are connected with eight vertexes of the regular octagon, uniformly dividing the regular octagon into eight equal isosceles triangle subregions, wherein each subregion corresponds to 1bit commodity coding data; S3, taking four corner areas of the square as check bits, wherein the check bits are generated according to a Hamming code coding rule based on regular octagon 8bit commodity coding data; s4, repeating the steps S1 to S3, constructing four basic coding units, and splicing according to a preset splicing sequence to form an integral coding structure, wherein the integral coding structure corresponds to 32bit commodity coding data; s5, determining boundaries of four basic coding units through an image recognition algorithm, splitting the whole structure into four independent basic coding units, and respectively reading image features; s6, for a single basic coding unit, firstly identifying the black states of eight subregions of the regular octagon, and converting the black states into 8-bit binary original data according to a preset arrangement sequence; S7, checking and correcting the extracted 4bit Hamming code and 8bit binary original data based on a Hamming code coding rule; and S8, integrating the 8-bit data of the four basic coding units subjected to verification and error correction according to a preset splicing sequence to obtain complete 32-bit commodity coding data, and finishing the decoding process.
- 2. The method for encoding and decoding square octagon information for outer package of commodity according to claim 1, wherein in S2, eight isosceles triangle subregions divided by regular octagon form 8bit information bits from top to bottom in clockwise direction from left.
- 3. The method for encoding and decoding square octagon information for outer package of commodity according to claim 1, wherein in S3, the hamming code encoding rule is that 8bit data is calculated according to hamming code (12, 8) encoding algorithm to obtain 4bit check bits, and the 4bit check bits sequentially correspond to four corner regions of square in order of clockwise order from top left-top right-bottom left.
- 4. The square octagon information encoding and decoding method for commodity outer packing according to claim 1, wherein in S4, constructing four basic coding units, and splicing according to a preset splicing order to form an integral coding structure comprises: The first basic coding unit is taken as a reference, the second basic coding unit is spliced on the right side of the first basic coding unit, the third basic coding unit is spliced on the lower side of the second basic coding unit, the fourth basic coding unit is spliced on the lower side of the first basic coding unit, and the edges of the four squares are mutually attached after splicing, and the four squares are free of overlapping and have no gaps.
- 5. The method according to claim 4, wherein the first basic coding unit corresponds to 8-bit data of bit31-bit24 in the 32-bit commodity coding data, the second basic coding unit corresponds to 8-bit data of bit23-bit16 in the 32-bit commodity coding data, the third basic coding unit corresponds to 8-bit data of bit15-bit8 in the 32-bit commodity coding data, and the fourth basic coding unit corresponds to 8-bit data of bit7-bit0 in the 32-bit commodity coding data.
- 6. The method according to claim 1, wherein in S6, the step of identifying the black state of the eight sub-areas of the regular octagon includes determining whether each sub-area is black by gray value detection, determining that the sub-area is black when the gray value of the sub-area is less than or equal to a first gray threshold, determining that the sub-area is not black when the gray value of the sub-area is greater than or equal to a second gray threshold, and determining that the sub-area is not black when the gray value of the sub-area is greater than or equal to the second gray threshold.
- 7. The method for encoding and decoding square octagon information for commodity outer packing according to claim 1, wherein the black of the sub-area is represented by 1, whereas the black of the sub-area is represented by 0, eight sub-areas encode 8bit data altogether, the black of the corner area is represented by 1, whereas the black of the sub-area is represented by 0, and four corner areas encode 4bit check bits altogether.
- 8. The method for encoding and decoding square octagon information for outer package of commodity according to claim 3, wherein in S3, hamming code (12, 8) encoding algorithm is specifically: The generated 4bit check bits are sequentially P0, P1, P2 and P3 from low to high and are sequentially arranged at the position of 2 i of a 12bit Hamming code, i represents 0, 1, 2 and 3, the 8bit commodity coding data are sequentially D7, D6, D5, D4, D3, D2, D1 and D0 from high to low, and the rest positions are sequentially filled from high to low, and the standard code word format is as follows: [D7,D6,D5,D4,P3,D3,D2,D1,P2,D0,P1,P0], Wherein, each check bit calculation formula is as follows: P3=d7 # -d6 # -d4, p2=d7 # -d3 # -d1, p1=d6 # -d5 # -d3 # -d0, p0=d6 # -d4 # -d3 # -d1 # -d0, # represents an exclusive or operation.
- 9. The square octagon information encoding and decoding method for commodity outer packing according to claim 1, wherein in S7, the verification of the extracted 4bit Hamming code and 8bit binary original data based on Hamming code encoding rules comprises error correction based on Hamming code encoding rules if 1bit errors exist in the 8bit binary original data to obtain accurate 8bit data, and judging that the basic encoding unit data is invalid and prompting if multiple bit errors are detected.
- 10. A square octagon information codec system for commodity overwrap, implementing the square octagon information codec method for commodity overwrap according to any one of claims 1 to 9, said system comprising: The construction module is used for constructing a basic coding unit, the basic coding unit consists of an external square with a coincident geometric center and a regular octagon with an internal joint, eight vertexes of the regular octagon respectively fall on four sides of the square, so that four right angles of the square form four independent and congruent isosceles right triangle areas as corner areas; The regular octagon region information bit coding module is used for taking the geometric center of the regular octagon as an origin, making eight points to pass through the origin and connecting the dividing lines of eight vertexes of the regular octagon, uniformly dividing the regular octagon into eight equal isosceles triangle subregions, and each subregion corresponds to 1bit commodity coding data; the corner region check bit coding module is used for taking four corner regions of a square as check bits, and the check bits are generated according to a Hamming code coding rule based on regular octagon 8bit commodity coding data; The system comprises an integral coding structure splicing module, a coding module and a coding module, wherein the integral coding structure splicing module is used for constructing four basic coding units and splicing the four basic coding units according to a preset splicing sequence to form an integral coding structure, and the integral coding structure corresponds to 32bit commodity coding data; the overall structure identification and splitting module is used for determining boundaries of four basic coding units through an image identification algorithm, splitting the overall structure into four independent basic coding units and respectively reading image characteristics; The data extraction module is used for identifying the black state of the eight subregions of the regular octagon firstly, and converting the black state into 8bit binary original data according to a preset arrangement sequence; the Hamming code checking and correcting module is used for checking and correcting the extracted 4-bit Hamming code and the 8-bit binary original data based on a Hamming code coding rule; And the integral information integration module is used for integrating the 8-bit data of the four basic coding units subjected to verification and error correction according to a preset splicing sequence to obtain complete 32-bit commodity coding data and complete the decoding process.
Description
Square octagon information encoding and decoding method and system for commodity outer package Technical Field The invention relates to the technical field of data coding and information identification, in particular to a coding and decoding method based on geometric figure splicing, which is suitable for information storage and reading in the scenes of commodity outer packaging, logistics identification, product tracing and the like, and particularly relates to a square octagon information coding and decoding method and system for commodity outer packaging. Background With the rapid development of the socioeconomic level, the storage and circulation scale of commodities is gradually enlarged. In the commodity circulation process, product information (such as batch, tracing code, specification and the like) is often required to be stored in a coded manner on the commodity outer package. Although the traditional coding modes such as bar codes and two-dimensional codes are widely applied, the problems of easy abrasion, dependence on special equipment for identification, poor customization of redundancy error correction capability and the like exist, and small economic loss is brought to manufacturers. The commodity tracking by means of RFID (Radio-Frequency Identification) tag technology has the characteristics of non-line-of-sight reading, strong environmental adaptability and the like, but the tag is easy to damage, the initial deployment cost is too high, and privacy security risks possibly exist. The coding and decoding method based on the geometric figure is paid attention to gradually by virtue of the advantages of intuitiveness, strong abrasion resistance and the like, and the scheme for representing data by utilizing different states of a polygonal region in the prior art mostly has the problems of limited data capacity and imperfect error correction mechanism, namely, partial scheme only utilizes single graph region coding and has small data volume, and partial scheme introduces redundancy check, but has the disadvantages of compact combination mode of check codes and data bits, complex graph structure and inconvenience for quick identification and coding and decoding. Therefore, a coding and decoding method with compact graphic structure, moderate data capacity and reliable error correction capability is needed to meet the practical requirements of commodity outer package information coding. Disclosure of Invention The invention aims to overcome the defect that the data capacity and the error correction capability of the geometric figure coding and decoding method in the prior art are difficult to be compatible, and provides a square information coding and decoding method and a square information coding and decoding system for commodity outer package, the data coding and decoding method based on a square-regular octagon splicing structure, through optimizing graphic structure design, introduce hamming error correction code, integrate 8bit data bits and 4bit check bit in single basic coding unit, further realize 32bit information storage through four unit concatenation, compromise data capacity and error correction reliability, and graphic structure is regular, be convenient for discern fast and encode and decode. In order to achieve the above purpose, the invention adopts the technical scheme that: the first aspect of the invention provides a square octagon information encoding and decoding method for commodity outer package, comprising the following steps: S1, constructing a basic coding unit, wherein the basic coding unit consists of an external square with coincident geometric centers and a regular octagon with connected interiors, eight vertexes of the regular octagon respectively fall on four sides of the square, so that four right angles of the square form four independent and congruent isosceles right triangle areas as corner areas; s2, taking the geometric center of the regular octagon as an origin, making eight dividing lines which pass through the origin and are connected with eight vertexes of the regular octagon, uniformly dividing the regular octagon into eight equal isosceles triangle subregions, wherein each subregion corresponds to 1bit commodity coding data; S3, taking four corner areas of the square as check bits, wherein the check bits are generated according to a Hamming code coding rule based on regular octagon 8bit commodity coding data; s4, repeating the steps S1 to S3, constructing four basic coding units, and splicing according to a preset splicing sequence to form an integral coding structure, wherein the integral coding structure corresponds to 32bit commodity coding data; s5, determining boundaries of four basic coding units through an image recognition algorithm, splitting the whole structure into four independent basic coding units, and respectively reading image features; s6, for a single basic coding unit, firstly identifying the black states of eight subregions of th