CN110335189B - Method, device, computer equipment and storage medium for filling anti-counterfeiting information - Google Patents
Method, device, computer equipment and storage medium for filling anti-counterfeiting information Download PDFInfo
- Publication number
- CN110335189B CN110335189B CN201910470652.4A CN201910470652A CN110335189B CN 110335189 B CN110335189 B CN 110335189B CN 201910470652 A CN201910470652 A CN 201910470652A CN 110335189 B CN110335189 B CN 110335189B
- Authority
- CN
- China
- Prior art keywords
- preset
- pictures
- fragments
- counterfeiting information
- fragment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 239000012634 fragment Substances 0.000 claims description 268
- 239000011159 matrix material Substances 0.000 claims description 56
- 238000004590 computer program Methods 0.000 claims description 12
- 238000006243 chemical reaction Methods 0.000 claims description 10
- 238000012163 sequencing technique Methods 0.000 claims description 5
- 238000005192 partition Methods 0.000 description 16
- 238000000605 extraction Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000000638 solvent extraction Methods 0.000 description 4
- 125000006850 spacer group Chemical group 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000013467 fragmentation Methods 0.000 description 2
- 238000006062 fragmentation reaction Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009977 dual effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/06103—Constructional details the marking being embedded in a human recognizable image, e.g. a company logo with an embedded two-dimensional code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Editing Of Facsimile Originals (AREA)
Abstract
The application discloses a method, a device, computer equipment and a storage medium for filling anti-counterfeiting information, wherein the method for filling the anti-counterfeiting information comprises the following steps: generating a two-dimensional code according to the anti-counterfeiting information and a preset two-dimensional code rule; acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers; hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information; and displaying a preset picture carrying the anti-counterfeiting information. The anti-counterfeiting information is generated into the two-dimensional code, and the numbers corresponding to the two-dimensional code are sequentially hidden in the preset picture according to the arrangement sequence, so that the hidden protection of the anti-counterfeiting information is realized.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a computer device, and a storage medium for filling anti-counterfeiting information.
Background
The existing document provides complete and reliable attribution evidence for copyright-protected information products, and the multi-purpose watermark is processed. Watermarking is the addition of certain digital information to data multimedia (such as images, sounds, video signals, etc.) to achieve the functions of authentication, copyright protection, etc. The embedded watermark information is hidden in the host document, so that the observability and the integrity of the original document are not affected. The watermark algorithm can identify the security information (e.g., registered user numbers, product logos, or meaningful text, etc.) of the owner embedded in the protected object and can extract the security information and destroy it when needed. The watermark can be used to determine whether an object is protected and to monitor the spread of the protected data, authentication, illegal copy control, etc. However, at present, an attacker can completely destroy the watermark in the document or copy a theoretically existing 'original watermark', and at present, the spatial watermark method of the document can be clearly identified by naked eyes, so that the anti-counterfeiting information is easy to imitate and imitate, which leads to that the document owner cannot convincingly provide effective evidence of copyright attribution.
Disclosure of Invention
The main purpose of the application is to provide a method for filling anti-counterfeiting information, which aims to solve the technical problem that the anti-counterfeiting information of the existing watermark is easy to imitate and destroy.
The application provides a method for filling anti-counterfeiting information, which comprises the following steps:
generating a two-dimensional code according to the anti-counterfeiting information and a preset two-dimensional code rule;
acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers;
hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information;
and displaying a preset picture carrying the anti-counterfeiting information.
Preferably, the preset picture is formed by splicing a specified number of fragments, and the step of hiding the numbers in the preset picture in sequence according to a preset rule respectively includes:
sequentially judging whether a first fragment contains a preset pixel area according to a preset sequence, wherein the first fragment is contained in the specified number of fragments;
if the first fragments contain the preset pixel areas, sorting the first fragments, and forming a first sorting according to the positions of the first fragments in the preset picture and a preset sequence;
Acquiring a sequence number of the first fragment in the first sequencing;
acquiring a first number in a corresponding sequence number in the array according to the sequence number;
hiding the first number in a preset pixel area in the first fragment.
Preferably, before the step of sequentially determining whether the first tile includes the preset pixel area according to the preset order, the method includes:
uniformly and parallelly cutting the preset pictures along a first direction according to a first preset interval to form a plurality of rows of pictures, and performing first coding on each row of pictures according to the number of rows of pictures in the preset pictures;
cutting each row of pictures along a second direction according to a second preset interval to form fragments, and performing second coding on each fragment according to the arrangement sequence of each fragment in the row of pictures, wherein the first direction and the second direction are mutually perpendicular;
and forming coordinate codes corresponding to the fragments respectively according to the first codes and the second codes.
Preferably, the preset pictures are text pictures, the first preset space is a row space in the text pictures, the second preset space is a word space between two adjacent words in the same row in the text pictures, the line pictures are cut along a second direction according to the second preset space to form fragments, and the second coding is performed on the fragments according to the arrangement order of the fragments in the line pictures, including:
Identifying a first interval between two adjacent characters according to the second preset interval;
and cutting two adjacent characters from the first interval along the direction perpendicular to the rows to form fragments, and performing second coding on each fragment according to the sequence of each fragment in the row pictures.
Preferably, the preset pictures are text pictures, the first preset interval is a row interval in the text pictures, the line pictures are cut along a second direction according to a second preset interval to form fragments, and the step of performing second coding on the fragments according to the arrangement order of the fragments in the line pictures comprises the following steps:
judging whether a second interval between two adjacent characters and a third interval in the characters are larger than the second preset interval or not;
if the number is larger than the number, cutting two adjacent characters along the direction perpendicular to the row from the second interval, cutting the same character along the direction perpendicular to the row from the third interval, forming fragments, sorting the fragments in the row pictures according to the positions of the fragments, and performing second coding on the fragments.
Preferably, the step of uniformly and parallelly cutting the preset pictures along the first direction according to the first preset interval to form a plurality of rows of pictures, and performing the first coding on each row of pictures according to the number of rows of each row of pictures in the preset pictures includes:
judging whether the text of the anti-counterfeiting information to be filled is in a picture format or not;
if not, converting the file to be encrypted into a picture format according to a preset conversion mode to form the text picture.
Preferably, the preset pixel area is a full black pixel matrix with a preset matrix size, the digits include binary digits of 0 and/or 1, and the step of hiding the first digits in the preset pixel area in the first tile includes:
judging whether the first number is 1;
if the first number is 1, converting the pixel value of the central point of the full black pixel matrix into a pixel value corresponding to a white pixel to mark 1;
if the first number is not 1, the first number is judged to be 0, and the all black pixel matrix is marked as 0.
The application also provides a device for filling anti-counterfeiting information, which comprises:
the generation module is used for generating the anti-counterfeiting information into a two-dimensional code according to a preset two-dimensional code rule;
The first acquisition module is used for acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers;
the hiding module is used for hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information;
and the display module is used for displaying a preset picture carrying the anti-counterfeiting information.
The present application also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the above method when executing the computer program.
The present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above-described method.
According to the scheme, the anti-counterfeiting information can be hidden in the preset picture and is not easy to perceive, the rights of the preset picture can be protected to the greatest extent, and the anti-counterfeiting information is not easy to imitate. The anti-fake information processing method and device have the advantages that the numbers corresponding to the anti-fake information are hidden in fragments containing the preset pixel areas respectively, fragments not containing the preset pixel areas are not used for hiding the numbers, when the anti-fake information is analyzed, the corresponding hidden numbers are conveniently obtained through identifying the preset pixel areas, the numbers are restored to two-dimensional codes, and the corresponding anti-fake information is obtained through analyzing the two-dimensional codes. The first preset spacing according to the line cutting of the application is the line spacing of the text. The second preset distance is a preset distance perpendicular to the longitudinal direction of the rows and is smaller than the character distance of the text. The requirement that is greater than second in this application and predetermines the interval then can carry out the slitting in interval department, even if there is the interval district that is greater than second in the same word on the vertical direction of perpendicular to line and predetermine the interval, also can be by the slitting, the cutting rule conceals and is difficult to perceive, realizes the inhomogeneous subregion to predetermineeing the picture, and the subregion size is different, and the cutting rule is more concealed, and the fake person is difficult to draw anti-fake information, is difficult to be imitated or destroyed.
Drawings
FIG. 1 is a schematic flow chart of a method for filling anti-counterfeiting information according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a device for filling anti-counterfeiting information according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an internal structure of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Referring to fig. 1, a method for filling anti-counterfeiting information according to an embodiment of the present application includes:
s1: and generating the two-dimensional code according to the anti-counterfeiting information according to a preset two-dimensional code rule.
The anti-counterfeiting information in this embodiment includes any information capable of generating a two-dimensional code, such as text password information, digital password, logo, and the like. The preset two-dimensional code rules are different according to different types of the anti-counterfeiting information, but at least comprise three parts, namely a two-dimensional code positioning pattern, two-dimensional code functional data and two-dimensional code data content, so that corresponding two-dimensional codes are generated according to the preset two-dimensional code rules. The two-dimensional code technology is similar to the existing two-dimensional code generation process, and is not repeated. The two-dimensional code of the embodiment can store more anti-counterfeiting information, and the integrity of the anti-counterfeiting information can be ensured by converting the anti-counterfeiting information into the two-dimensional code. The two-dimensional code has 40 sizes, the unit size is named Version, the two-dimensional code size and Version have a linear relation, for example, version1 is a matrix of 21×21, version 2 is a matrix of 25×25, each time one Version is added, the size is increased by 4, and the maximum value of Version is 40, so the maximum value of the two-dimensional code size is (40-1) 4+21=177, namely, matrix of 177×177.
S2: and acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers.
According to the embodiment, the two-dimensional code is analyzed into the array consisting of binary digits 0 and/or 1, array ordering is formed according to the specified ordering rule, for example, the two-dimensional code is sequentially analyzed from left to right and from top to bottom, the black pattern in the two-dimensional code corresponds to 1, and the white pattern corresponds to 0, so that the two-dimensional code is analyzed into the binary number array.
S3: and hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information.
S4: and displaying a preset picture carrying the anti-counterfeiting information.
According to the embodiment, the numbers corresponding to the two-dimensional codes are sequentially hidden in the preset pictures according to the arrangement sequence, so that the hidden protection of the anti-counterfeiting information is realized. For example, the anti-counterfeiting information of the embodiment can form a corresponding two-dimensional code, and compared with the existing watermark anti-counterfeiting technology, the anti-counterfeiting information can be hidden in the preset picture and is not easy to perceive, the rights of the preset picture can be protected to the greatest extent, the anti-counterfeiting information is not easy to imitate, the preset picture added with the anti-counterfeiting information and the original preset picture are printed out and cannot be distinguished directly from the surface, and the anti-counterfeiting information is not easy to imitate and destroy. The preset pictures comprise product pictures, data pictures, contract document pictures and the like.
Further, the preset picture is formed by splicing a specified number of fragments, and the step S3 of hiding each number in the preset picture in sequence according to a preset rule includes:
s31: and sequentially judging whether the first fragments contain preset pixel areas according to a preset sequence, wherein the first fragments are contained in the specified number of fragments.
The preset picture in this embodiment is formed by splicing fragments, that is, the preset picture is divided into a plurality of small partitions by virtual fragments, and the number of the partitions is greater than or equal to the total number of the corresponding numbers in the array, so that the numbers and the fragments are matched one by one, the numbers are conveniently hidden in the picture in order, and the hidden array is convenient to manage. In this embodiment, the numbers are hidden in fragments containing the preset pixel area, fragments not containing the preset pixel area are not used for hiding the numbers, so that when the anti-counterfeiting information is analyzed, the corresponding hidden numbers are conveniently obtained by identifying the preset pixel area, the numbers are restored to the two-dimensional code, and the corresponding anti-counterfeiting information is obtained by analyzing the two-dimensional code. The preset pixel area comprises a pixel matrix with a specified size, and the pixel matrix contained in each fragment or most fragments can be satisfied, so that the purposes of hiding numbers through fragments and conveniently managing the hidden numbers are satisfied. Such as a 3×3 pixel matrix, a 5×5 pixel matrix, etc., the preset pixel area may be implemented in a preset manner.
S32: and if the first fragments contain the preset pixel areas, sorting the first fragments, and forming a first sorting according to the position of each first fragment in the preset picture and the preset sequence.
According to the embodiment, whether the preset pixel area exists in each fragment is judged sequentially according to the position of the first fragment in the preset picture through the preset sequence from left to right and from top to bottom, and if so, the fragments are counted into the first sorting so as to hide each number in the array sequentially according to the first sorting. The first sorting in this embodiment sorts the coordinate data of each first fragment in the preset picture, for example, the third fragment in the first row slice, which corresponds to the sequence number 3 in the first sorting; the fifth fragment in the first row slice corresponds to the sequence number 4 in the first order, and the third fragment in the first row slice is the coordinate data of the first fragment in the preset picture. The effect of the "first" in the "first fragment" is different from the "third" in the "third fragment", and the "first" in the "first fragment" is used for distinction only, and is not limited, and similar terms in other places have the same effect and are not repeated.
S33: and acquiring the sequence number of the first fragment in the first sequencing.
S34: and acquiring a first number in the corresponding sequence number in the array according to the sequence number.
According to the embodiment, the sequence numbers of the fragments in the first sequence are obtained, and then the one-to-one correspondence is formed according to the preset corresponding relation between the sequence numbers and the number sequence, so that the ordered hiding of the numbers is realized, the management and the extraction are convenient, and the reliability and the consistency of the anti-counterfeiting information are improved. For example, the preset corresponding relation is that the same direction sequence corresponds to the number ordering in the array one by one, namely, the number of fragments 1 to 100 is one by one from small to large, so as to form a first ordering; the number ordering is the number arrangement order formed from left to right in the array, namely the fragment numbers 1 to 100 form a first ordering, the number ordering in the corresponding array is 1 to 100, namely the 1 st number in the fragment hiding array with the fragment number 1, the 2 nd number in the fragment hiding array with the fragment number 2, and so on, so that each fragment is correspondingly hidden with one number. In other embodiments of the present application, the preset correspondence is a reverse order one-to-one correspondence to the number ordering in the array, that is, the sequence number of the fragments from small to large in the first ordering, one-to-one correspondence to the sequence number from large to small in the number ordering, that is, the number reverse order in the array is hidden in each fragment, so that the difficulty of acquiring the anti-counterfeiting information from the fragment is increased, and the difficulty coefficient of destroying the anti-counterfeiting information is improved.
S35: hiding the first number in a preset pixel area in the first fragment.
In this embodiment, the identification of different numbers is implemented by changing the pixel characteristic values of the corresponding preset pixel areas, for example, a full black pixel matrix with a designated size is selected, the identification number 0 is corresponding, some pixel points in the full black pixel matrix are changed to white, so as to correspond to the identification number 1, and all binary digits corresponding to the array are hidden in each fragment through the change rule of the pixel characteristic values. The fragments at least comprise one preset pixel area, and if the fragments comprise a plurality of preset pixel areas, the preset pixel areas arranged in the first sequence are selected as the preset pixel areas of the fragments according to the sequence from left to right and from top to bottom, so that a corresponding number is hidden. In other embodiments of the present application, the digital symbol itself may be photocopied to a preset pixel area to achieve hiding. For example, the pixels corresponding to the first palace lattice in the preset pixel area are changed from black to white, and the anti-counterfeiting information or the encryption information is photocopied on the first palace lattice in black fonts, wherein the first palace lattice is any one of all the corresponding palace lattices in the preset pixel area.
Further, before step S31 of sequentially determining whether the first tile includes a preset pixel area according to a preset sequence, the method includes:
and S30a, uniformly and parallelly cutting the preset pictures along a first direction according to a first preset interval to form a plurality of rows of pictures, and carrying out first coding on each row of pictures according to the row number of each row of pictures in the preset pictures.
And S30b, cutting each row of pictures along a second direction according to a second preset interval to form fragments, and performing second coding on each fragment according to the arrangement sequence of each fragment in the row of pictures, wherein the first direction and the second direction are mutually perpendicular.
And S30c, forming coordinate codes corresponding to the fragments respectively according to the first codes and the second codes.
The fragments in this embodiment are virtual partitions of the preset picture, i.e., the preset picture is virtually cut to form the partitions according to a preset rule. In this embodiment, the preset picture is divided into a plurality of rectangular partitions by line cutting and longitudinal cutting perpendicular to the line direction, and the row numbers of the lines and the longitudinal columns where the fragments are located are identified as the coordinate codes of each fragment, so that the fragments are spliced and directly restored into the preset picture by the coordinate codes. The first preset distance and the second preset distance are not limited by direct size relation, but the first preset distance and the second preset distance are kept unchanged during cutting, so that sequential and regular partitioning of preset pictures is realized.
Further, the preset picture is a text picture, the first preset interval is a line interval in the text picture, the second preset interval is a word interval between two adjacent words in the same line in the text picture, the line pictures are cut along a second direction according to the second preset interval to form fragments, and the step S30b of performing second encoding on the fragments according to the arrangement order of the fragments in the line picture includes:
s301: and identifying a first interval between two adjacent characters according to the second preset interval.
S302: and cutting two adjacent characters from the first interval along the direction perpendicular to the rows to form fragments, and performing second coding on each fragment according to the sequence of each fragment in the row pictures.
The preset picture in this embodiment is a text picture, that is, the preset picture is a picture formed by text files, including text of a large paragraph. The first preset interval according to the line cutting of the embodiment is the line interval of the text. The second preset distance in this embodiment is the word distance between two adjacent words in the same row in the text picture, and each word in the text is correspondingly cut into fragments by line cutting and longitudinal cutting, so that uniform partitioning of the preset picture is realized, and the partition sizes are the same.
Further, the preset pictures are text pictures, the first preset interval is a line interval in the text pictures, the line pictures are cut along a second direction according to a second preset interval to form fragments, and the step S30b of performing second encoding on the fragments according to the arrangement order of the fragments in the line pictures includes:
s303: judging whether a second interval between two adjacent characters and a third interval in the characters are larger than the second preset interval or not;
s304: if the number is larger than the number, cutting two adjacent characters along the direction perpendicular to the row from the second interval, cutting the same character along the direction perpendicular to the row from the third interval, forming fragments, sorting the fragments in the row pictures according to the positions of the fragments, and performing second coding on the fragments.
In this embodiment, the second preset distance in the longitudinal direction perpendicular to the rows is smaller than the character distance of the text. In this embodiment, at the interval position larger than the second preset interval, longitudinal cutting is performed at the interval position, even if a spacing region larger than the second preset interval exists in the longitudinal direction perpendicular to the rows in the same word, the spacing region is also longitudinally cut, the cutting rule is hidden and is not easy to perceive, uneven partition of the preset picture is realized, the partition sizes are different, and the cutting rule is more hidden, for example, three to four fragments are corresponding after being longitudinally cut. For example, a certain line of text after line cutting is written as "center area limited company", and the fragments are formed by longitudinal cutting as one fragment corresponding to "middle", two fragments corresponding to "heart", one fragment corresponding to "area", one fragment corresponding to "have", two fragments corresponding to "limit", one fragment corresponding to "male", and one fragment corresponding to "span". The "heart" and "limit" are slit into two fragments from the spacer because the word includes a spacer larger than the second preset pitch.
Further, before the step S30a of uniformly and parallelly cutting the preset pictures along the first direction according to the first preset interval to form a plurality of rows of pictures, and performing the first encoding on each row of pictures according to the number of rows of each row of pictures in the preset pictures, the method includes:
s30d: judging whether the text of the anti-counterfeiting information to be filled is in a picture format or not.
S30e: if the text of the anti-counterfeiting information to be filled is not in the picture format, converting the file to be encrypted into the picture format according to a preset conversion mode to form the text picture.
The document to be encrypted in this embodiment is a document intended to pass anti-counterfeit filling anti-counterfeit information, for example, a text document such as a contract document, and the format of the text document needs to be converted into a picture format. If the text file is in a format such as Word or Excel, converting the text file into a picture format by a PDF conversion mode.
Further, the step S35 of hiding the first number in the preset pixel area in the first tile, where the preset pixel area is a full black pixel matrix with a preset matrix size, and the number includes binary digits 0 and/or 1, includes:
S351: and judging whether the first number is 1.
S352: and if the first number is 1, converting the pixel value of the central point of the full black pixel matrix into the pixel value corresponding to the white pixel to mark 1.
S353: if the first number is not 1, the first number is judged to be 0, and the all black pixel matrix is marked as 0.
In this embodiment, the preset matrix size is 3×3, the preset pixel area is a 3×3 full black pixel matrix, including a 9-grid distributed full black pixel area, and the fragments containing the 3×3 full black pixel matrix are fragments with hidden numbers. If the corresponding hidden number in the current number ordering is 1, the black pixel value of the center grid in the 9 grids is converted into a white pixel value, such as converting 255 x 255 into 0 x 0, the black pixel value is converted into a white pixel value. The identification and hiding of the numbers 1 and 0 are realized by changing the pixel characteristic values corresponding to the preset pixel areas.
Further, after step S3, hiding each number in the preset picture in turn according to a preset rule, the method includes:
s4: and obtaining a first picture added with the anti-counterfeiting information.
S5: and forming fragments of the first picture according to a preset cutting rule.
S6: and sequentially extracting hidden numbers from the fragments to form a first array.
S7: and converting the first array into a specified two-dimensional code.
S8: and identifying the anti-counterfeiting information corresponding to the appointed two-dimensional code.
The embodiment also provides a process of extracting the anti-counterfeiting information from the first picture added with the anti-counterfeiting information, which is reciprocal to the hiding process, comprises a fragmentation process with the same principle, acquires hidden numbers from fragments, forms a first array according to the extraction sequence, converts the first array into a specified two-dimensional code, and obtains an azimuth mark by de-specifying the two-dimensional code. The process of obtaining the hidden number from the fragment is reciprocal to the process of obtaining the hidden number, for example, whether a 3×3 full black pixel matrix or a matrix with a 3×3 center point being a white pixel value exists in the fragment is identified, if so, the discovery order is sequentially recorded as the arrangement order of the numbers in the array, the 3×3 full black pixel matrix is counted as the number 1, and the matrix with the 3×3 center point being the white pixel value is counted as 0. In the process of de-designating the two-dimensional code in this embodiment, symmetric encryption can be performed by AES (Advanced Encryption Standard ), so as to improve security. The process of acquiring the anti-counterfeiting information from the specified two-dimensional code has fault tolerance, and can still accurately acquire the anti-counterfeiting information under the condition that numbers within 30% are lost.
According to the embodiment, the two-dimensional code is generated by the anti-counterfeiting information, the numbers corresponding to the two-dimensional code are sequentially hidden in the preset picture according to the arrangement sequence, so that the hidden protection of the anti-counterfeiting information is realized. According to the embodiment, the numbers corresponding to the anti-counterfeiting information are hidden in fragments containing the preset pixel areas respectively, fragments not containing the preset pixel areas are not used for hiding the numbers, when the anti-counterfeiting information is analyzed, the corresponding hidden numbers are conveniently obtained through identifying the preset pixel areas, the numbers are restored to two-dimensional codes, and the corresponding anti-counterfeiting information is obtained through analyzing the two-dimensional codes. The first preset interval according to the line cutting of the embodiment is the line interval of the text. The second preset distance is a preset distance perpendicular to the longitudinal direction of the rows and is smaller than the character distance of the text. In this embodiment, the requirement that the spacing is larger than the second preset spacing is longitudinally cut at the interval, even if the spacing area which is larger than the second preset spacing exists in the same word and is perpendicular to the longitudinal direction of the line, the spacing area is also longitudinally cut, the cutting rule is hidden and is not easy to perceive, the uneven partition of the preset picture is realized, the partition size is different, the cutting rule is more hidden, the counterfeiter is not easy to extract the anti-counterfeiting information, and the counterfeiter is not easy to imitate or destroy.
Referring to fig. 2, an apparatus for filling anti-counterfeiting information according to an embodiment of the present application includes:
the generation module 1 is used for generating the two-dimension code according to the preset two-dimension code rule from the anti-counterfeiting information.
The anti-counterfeiting information in this embodiment includes any information capable of generating a two-dimensional code, such as text password information, digital password, logo, and the like. The preset two-dimensional code rules are different according to different types of the anti-counterfeiting information, but at least comprise three parts, namely a two-dimensional code positioning pattern, two-dimensional code functional data and two-dimensional code data content, so that corresponding two-dimensional codes are generated according to the preset two-dimensional code rules. The two-dimensional code technology is similar to the existing two-dimensional code generation process, and is not repeated. The two-dimensional code of the embodiment can store more anti-counterfeiting information, and the integrity of the anti-counterfeiting information can be ensured by converting the anti-counterfeiting information into the two-dimensional code. The two-dimensional code has 40 sizes, the unit size is named as Version, the two-dimensional code size and Version have a linear relation, for example, version1 is a matrix of 21×21, version 2 is a matrix of 25×25, each time one Version is added, the size is increased by 4, the maximum value of Version is 40, so the maximum value of the two-dimensional code size is (40-1) 4+21=177, namely, matrix of 177×177.
The first obtaining module 2 is configured to obtain an array corresponding to the two-dimensional code, where the array is formed by arranging a plurality of numbers.
According to the embodiment, the two-dimensional code is analyzed into the array consisting of binary digits 0 and/or 1, array ordering is formed according to the specified ordering rule, for example, the two-dimensional code is sequentially analyzed from left to right and from top to bottom, the black pattern in the two-dimensional code corresponds to 1, and the white pattern corresponds to 0, so that the two-dimensional code is analyzed into the binary number array.
And the hiding module 3 is used for hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information.
And the display module is used for displaying a preset picture carrying the anti-counterfeiting information.
According to the embodiment, the numbers corresponding to the two-dimensional codes are sequentially hidden in the preset pictures according to the arrangement sequence, so that the hidden protection of the anti-counterfeiting information is realized. For example, the anti-counterfeiting information of the embodiment can form a corresponding two-dimensional code, and compared with the existing watermark anti-counterfeiting technology, the anti-counterfeiting information can be hidden in the preset picture and is not easy to perceive, the rights of the preset picture can be protected to the greatest extent, the anti-counterfeiting information is not easy to imitate, the preset picture added with the anti-counterfeiting information and the original preset picture are printed out and cannot be distinguished directly from the surface, and the anti-counterfeiting information is not easy to imitate and destroy. The preset pictures comprise product pictures, data pictures, contract document pictures and the like.
Further, the hiding module 3 includes:
and the first judging unit is used for sequentially judging whether the first fragments contain preset pixel areas according to a preset sequence, wherein the first fragments are contained in the specified number of fragments.
The preset picture in this embodiment is formed by splicing fragments, that is, the preset picture is divided into a plurality of small partitions by virtual fragments, and the number of the partitions is greater than or equal to the total number of the corresponding numbers in the array, so that the numbers and the fragments are matched one by one, the numbers are conveniently hidden in the picture in order, and the hidden array is convenient to manage. In this embodiment, the numbers are hidden in fragments containing the preset pixel area, fragments not containing the preset pixel area are not used for hiding the numbers, so that when the anti-counterfeiting information is analyzed, the corresponding hidden numbers are conveniently obtained by identifying the preset pixel area, the numbers are restored to the two-dimensional code, and the corresponding anti-counterfeiting information is obtained by analyzing the two-dimensional code. The preset pixel area comprises a pixel matrix with a specified size, and the pixel matrix contained in each fragment or most fragments can be satisfied, so that the purposes of hiding numbers through fragments and conveniently managing the hidden numbers are satisfied. Such as a 3×3 pixel matrix, a 5×5 pixel matrix, etc., the preset pixel area may be implemented in a preset manner.
And the first forming unit is used for counting the first fragments into a sequence if the first fragments contain the preset pixel area, and forming a first sequence according to the position of each first fragment in the preset picture and the preset sequence.
According to the embodiment, whether the preset pixel area exists in each fragment is judged sequentially according to the position of the first fragment in the preset picture through the preset sequence from left to right and from top to bottom, and if so, the fragments are counted into the first sorting so as to hide each number in the array sequentially according to the first sorting. The first sorting in this embodiment sorts the coordinate data of each first fragment in the preset picture, for example, the third fragment in the first row slice, which corresponds to the sequence number 3 in the first sorting; the fifth fragment in the first row slice corresponds to the sequence number 4 in the first order, and the third fragment in the first row slice is the coordinate data of the first fragment in the preset picture. The effect of the "first" in the "first fragment" is different from the "third" in the "third fragment", and the "first" in the "first fragment" is used for distinction only, and is not limited, and similar terms in other places have the same effect and are not repeated.
A first obtaining unit, configured to obtain a sequence number of the first fragment in the first ordering.
And the second acquisition unit is used for acquiring the first number in the corresponding sequence number in the array according to the sequence number.
According to the embodiment, the sequence numbers of the fragments in the first sequence are obtained, and then the one-to-one correspondence is formed according to the preset corresponding relation between the sequence numbers and the number sequence, so that the ordered hiding of the numbers is realized, the management and the extraction are convenient, and the reliability and the consistency of the anti-counterfeiting information are improved. For example, the preset corresponding relation is that the same direction sequence corresponds to the number ordering in the array one by one, namely, the number of fragments 1 to 100 is one by one from small to large, so as to form a first ordering; the number ordering is the number arrangement order formed from left to right in the array, namely the fragment numbers 1 to 100 form a first ordering, the number ordering in the corresponding array is 1 to 100, namely the 1 st number in the fragment hiding array with the fragment number 1, the 2 nd number in the fragment hiding array with the fragment number 2, and so on, so that each fragment is correspondingly hidden with one number. In other embodiments of the present application, the preset correspondence is a reverse order one-to-one correspondence to the number ordering in the array, that is, the sequence number of the fragments from small to large in the first ordering, one-to-one correspondence to the sequence number from large to small in the number ordering, that is, the number reverse order in the array is hidden in each fragment, so that the difficulty of acquiring the anti-counterfeiting information from the fragment is increased, and the difficulty coefficient of destroying the anti-counterfeiting information is improved.
And the hiding unit is used for hiding the first number in a preset pixel area in the first fragment.
In this embodiment, the identification of different numbers is implemented by changing the pixel characteristic values of the corresponding preset pixel areas, for example, a full black pixel matrix with a designated size is selected, the identification number 0 is corresponding, some pixel points in the full black pixel matrix are changed to white, so as to correspond to the identification number 1, and all binary digits corresponding to the array are hidden in each fragment through the change rule of the pixel characteristic values. The fragments at least comprise one preset pixel area, and if the fragments comprise a plurality of preset pixel areas, the preset pixel areas arranged in the first sequence are selected as the preset pixel areas of the fragments according to the sequence from left to right and from top to bottom, so that a corresponding number is hidden. In other embodiments of the present application, the digital symbol itself may be photocopied to a preset pixel area to achieve hiding. For example, the pixels corresponding to the first palace lattice in the preset pixel area are changed from black to white, and the anti-counterfeiting information or the encryption information is photocopied on the first palace lattice in black fonts, wherein the first palace lattice is any one of all the corresponding palace lattices in the preset pixel area.
Further, the hiding module 3 includes:
the second forming unit is used for uniformly and parallelly cutting the preset pictures along the first direction according to the first preset interval to form a plurality of rows of pictures, and carrying out first coding on each row of pictures according to the row number of each row of pictures in the preset pictures.
And the third forming unit is used for cutting each row of pictures along a second direction according to a second preset interval to form fragments, and carrying out second coding on each fragment according to the arrangement sequence of each fragment in the row of pictures, wherein the first direction and the second direction are mutually perpendicular.
And a fourth forming unit, configured to form coordinate codes corresponding to the fragments respectively according to the first code and the second code.
The fragments in this embodiment are virtual partitions of the preset picture, i.e., the preset picture is virtually cut to form the partitions according to a preset rule. In this embodiment, the preset picture is divided into a plurality of rectangular partitions by line cutting and longitudinal cutting perpendicular to the line direction, and the row numbers of the lines and the longitudinal columns where the fragments are located are identified as the coordinate codes of each fragment, so that the fragments are spliced and directly restored into the preset picture by the coordinate codes. The first preset distance and the second preset distance are not limited by direct size relation, but the first preset distance and the second preset distance are kept unchanged during cutting, so that sequential and regular partitioning of preset pictures is realized.
Further, the preset picture is a text picture, the first preset distance is a line distance in the text picture, the second preset distance is a word distance between two adjacent words in the same line in the text picture, and the third forming unit includes:
and the identification subunit is used for identifying the first interval between two adjacent characters according to the second preset interval.
And the first cutting subunit is used for cutting two adjacent characters from the first interval along the direction perpendicular to the row to form fragments, and performing second coding on the fragments according to the ordering of the fragments in the row pictures.
The preset picture in this embodiment is a text picture, that is, the preset picture is a picture formed by text files, including text of a large paragraph. The first preset interval according to the line cutting of the embodiment is the line interval of the text. The second preset distance in this embodiment is the word distance between two adjacent words in the same row in the text picture, and each word in the text is correspondingly cut into fragments by line cutting and longitudinal cutting, so that uniform partitioning of the preset picture is realized, and the partition sizes are the same.
Further, the preset picture is a text picture, the first preset interval is a line interval in the text picture, and the third forming unit includes:
A first judging subunit, configured to judge whether a second interval between two adjacent characters and a third interval in the characters are greater than the second preset interval;
and the second cutting subunit is used for cutting two adjacent characters along the direction vertical to the row from the second interval and cutting the same character along the direction vertical to the row from the third interval if the second interval between the two adjacent characters and the third interval in the characters are larger than the second preset interval, so as to form fragments, and sorting the fragments in the row pictures according to the positions of the fragments, and performing second coding on the fragments.
In this embodiment, the second preset distance in the longitudinal direction perpendicular to the rows is smaller than the character distance of the text. In this embodiment, at the interval position larger than the second preset interval, longitudinal cutting is performed at the interval position, even if a spacing region larger than the second preset interval exists in the longitudinal direction perpendicular to the rows in the same word, the spacing region is also longitudinally cut, the cutting rule is hidden and is not easy to perceive, uneven partition of the preset picture is realized, the partition sizes are different, and the cutting rule is more hidden, for example, three to four fragments are corresponding after being longitudinally cut. For example, a certain line of text after line cutting is written as "center area limited company", and the fragments are formed by longitudinal cutting as one fragment corresponding to "middle", two fragments corresponding to "heart", one fragment corresponding to "area", one fragment corresponding to "have", two fragments corresponding to "limit", one fragment corresponding to "male", and one fragment corresponding to "span". The "heart" and "limit" are slit into two fragments from the spacer because the word includes a spacer larger than the second preset pitch.
Further, the hiding module 3 includes:
and the second judging unit is used for judging whether the text to be filled with the anti-counterfeiting information is in a picture format.
And the conversion unit is used for converting the file to be encrypted into a picture format according to a preset conversion mode if the text to be filled with the anti-counterfeiting information is not in the picture format, so as to form the text picture.
The document to be encrypted in this embodiment is a document intended to pass through the anti-counterfeiting information, for example, a text document such as a contract document, and the format of the text document needs to be converted into a picture format. If the text file is in a format such as Word or Excel, converting the text file into a picture format by a PDF conversion mode.
Further, the preset pixel area is a full black pixel matrix with a preset matrix size, the digits include binary digits of 0 and/or 1, and the hidden units include:
and the second judging subunit is used for judging whether the first number is 1.
And the first marking subunit is used for converting the pixel value of the central point of the all-black pixel matrix into the pixel value corresponding to the white pixel to mark 1 if the first number is 1.
And the second marking subunit is used for marking the all-black pixel matrix as 0 if the first number is not 1 and is judged to be 0.
In this embodiment, the preset matrix size is 3×3, the preset pixel area is a 3×3 full black pixel matrix, including a 9-grid distributed full black pixel area, and the fragments containing the 3×3 full black pixel matrix are fragments with hidden numbers. If the corresponding hidden number in the current number ordering is 1, the black pixel value of the center grid in the 9 grids is converted into a white pixel value, such as converting 255 x 255 into 0 x 0, the black pixel value is converted into a white pixel value. The identification and hiding of the numbers 1 and 0 are realized by changing the pixel characteristic values corresponding to the preset pixel areas.
Further, the device for filling anti-counterfeiting information comprises:
and the second acquisition module is used for acquiring the first picture added with the anti-counterfeiting information.
And the cutting module is used for forming fragments of the first picture according to a preset cutting rule.
And the extraction module is used for sequentially extracting hidden numbers from the fragments to form a first array.
And the conversion module is used for converting the first array into a specified two-dimensional code.
And the identification module is used for identifying the anti-counterfeiting information corresponding to the appointed two-dimensional code.
The embodiment also provides a process of extracting the anti-counterfeiting information from the first picture added with the anti-counterfeiting information, which is reciprocal to the hiding process, comprises a fragmentation process with the same principle, acquires hidden numbers from fragments, forms a first array according to the extraction sequence, converts the first array into a specified two-dimensional code, and obtains an azimuth mark by de-specifying the two-dimensional code. The process of obtaining the hidden number from the fragment is reciprocal to the process of obtaining the hidden number, for example, whether a 3×3 full black pixel matrix or a matrix with a 3×3 center point being a white pixel value exists in the fragment is identified, if so, the discovery order is sequentially recorded as the arrangement order of the numbers in the array, the 3×3 full black pixel matrix is counted as the number 1, and the matrix with the 3×3 center point being the white pixel value is counted as 0. In the process of de-designating the two-dimensional code in the embodiment, the security can be improved through AES symmetric encryption. The process of acquiring the anti-counterfeiting information from the specified two-dimensional code has fault tolerance, and can still accurately acquire the anti-counterfeiting information under the condition that numbers within 30% are lost.
Referring to fig. 3, a computer device is further provided in the embodiment of the present application, where the computer device may be a server, and the internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer is configured 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, computer programs, and a database. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store all the data required for the process of filling the anti-counterfeiting information. The network interface of the computer device is for communicating with an external terminal via a network connection. The computer program is executed by a processor to implement a method of filling anti-counterfeiting information.
The method for filling the anti-counterfeiting information by the processor comprises the following steps: generating a two-dimensional code according to the anti-counterfeiting information and a preset two-dimensional code rule; acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers; hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information; and displaying a preset picture carrying the anti-counterfeiting information.
According to the computer equipment, the two-dimensional code is generated through the anti-counterfeiting information, the numbers corresponding to the two-dimensional code are sequentially hidden in the preset picture according to the arrangement sequence, so that the hidden protection of the anti-counterfeiting information is realized. The corresponding numbers of the anti-counterfeiting information are hidden in fragments containing the preset pixel areas respectively, fragments not containing the preset pixel areas are not used for hiding the numbers, when the anti-counterfeiting information is analyzed, the corresponding hidden numbers are conveniently obtained through identifying the preset pixel areas, the numbers are restored to two-dimensional codes, and the corresponding anti-counterfeiting information is obtained through analyzing the two-dimensional codes. The first preset interval according to the line cutting is the line interval of the text. The second preset distance is a preset distance perpendicular to the longitudinal direction of the rows and is smaller than the character distance of the text. Through will be greater than the second requirement of predetermineeing the interval then can carry out the slitting in interval department, even if there is the interval district that is greater than the second and predetermine the interval in the longitudinal direction of being perpendicular to line in same word, also can be by the slitting, the cutting rule is hidden and is difficult to perceive, realizes the inhomogeneous subregion to predetermineeing the picture, and the subregion size is different, and the cutting rule is more hidden, and the fake person is difficult to draw anti-fake information, is difficult to be imitated or destroyed.
In one embodiment, the preset pictures of the processor are formed by splicing a specified number of fragments, and the step of hiding the numbers in the preset pictures in sequence according to preset rules respectively includes: sequentially judging whether a first fragment contains a preset pixel area according to a preset sequence, wherein the first fragment is contained in the specified number of fragments; if the first fragments contain the preset pixel areas, sorting the first fragments, and forming a first sorting according to the positions of the first fragments in the preset picture and a preset sequence; acquiring a sequence number of the first fragment in the first sequencing; acquiring a first number in a corresponding sequence number in the array according to the sequence number; hiding the first number in a preset pixel area in the first fragment.
In one embodiment, before the step of sequentially determining whether the first tile includes the preset pixel area according to the preset order, the processor includes: uniformly and parallelly cutting the preset pictures along a first direction according to a first preset interval to form a plurality of rows of pictures, and performing first coding on each row of pictures according to the number of rows of pictures in the preset pictures; cutting each row of pictures along a second direction according to a second preset interval to form fragments, and performing second coding on each fragment according to the arrangement sequence of each fragment in the row of pictures, wherein the first direction and the second direction are mutually perpendicular; and forming coordinate codes corresponding to the fragments respectively according to the first codes and the second codes.
In one embodiment, the preset pictures are text pictures, the first preset space is a row space in the text pictures, the second preset space is a word space between two adjacent words in the same row in the text pictures, the processor cuts each of the row pictures along a second direction according to the second preset space to form fragments, and the step of performing second encoding on each of the fragments according to an arrangement order in which each of the fragments is located in the row pictures includes: identifying a first interval between two adjacent characters according to the second preset interval; and cutting two adjacent characters from the first interval along the direction perpendicular to the rows to form fragments, and performing second coding on each fragment according to the sequence of each fragment in the row pictures.
In one embodiment, the preset pictures are text pictures, the first preset interval is a line interval in the text pictures, the processor cuts each line picture along a second direction according to a second preset interval to form the fragments, and the step of performing second encoding on each fragment according to an arrangement order of each fragment in the line pictures includes: judging whether a second interval between two adjacent characters and a third interval in the characters are larger than the second preset interval or not; if the number is larger than the number, cutting two adjacent characters along the direction perpendicular to the row from the second interval, cutting the same character along the direction perpendicular to the row from the third interval, forming fragments, sorting the fragments in the row pictures according to the positions of the fragments, and performing second coding on the fragments.
In one embodiment, the step of the processor cutting the preset pictures uniformly and parallelly along a first direction according to a first preset interval to form a plurality of rows of pictures, and performing first encoding on each row of pictures according to the number of rows of each row of pictures in the preset pictures includes: judging whether the text of the anti-counterfeiting information to be filled is in a picture format or not; if not, converting the file to be encrypted into a picture format according to a preset conversion mode to form the text picture.
In one embodiment, the preset pixel area is a full black pixel matrix with a preset matrix size, the digits include binary digits 0 and/or 1, and the step of hiding the first digits in the preset pixel area in the first tile by the processor includes: judging whether the first number is 1; if the first number is 1, converting the pixel value of the central point of the full black pixel matrix into a pixel value corresponding to a white pixel to mark 1; if the first number is not 1, the first number is judged to be 0, and the all black pixel matrix is marked as 0.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is merely a block diagram of a portion of the architecture in connection with the present application and is not intended to limit the computer device to which the present application is applied.
An embodiment of the present application further provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements a method of filling anti-counterfeiting information, including: generating a two-dimensional code according to the anti-counterfeiting information and a preset two-dimensional code rule; acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers; hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information; and displaying a preset picture carrying the anti-counterfeiting information.
According to the computer readable storage medium, the two-dimensional codes are generated through the anti-counterfeiting information, the numbers corresponding to the two-dimensional codes are sequentially hidden in the preset pictures according to the arrangement sequence, so that the hidden protection of the anti-counterfeiting information is realized. The corresponding numbers of the anti-counterfeiting information are hidden in fragments containing the preset pixel areas respectively, fragments not containing the preset pixel areas are not used for hiding the numbers, when the anti-counterfeiting information is analyzed, the corresponding hidden numbers are conveniently obtained through identifying the preset pixel areas, the numbers are restored to two-dimensional codes, and the corresponding anti-counterfeiting information is obtained through analyzing the two-dimensional codes. The first preset interval according to the line cutting is the line interval of the text. The second preset distance is a preset distance perpendicular to the longitudinal direction of the rows and is smaller than the character distance of the text. Through will be greater than the second requirement of predetermineeing the interval then can carry out the slitting in interval department, even if there is the interval district that is greater than the second and predetermine the interval in the longitudinal direction of being perpendicular to line in same word, also can be by the slitting, the cutting rule is hidden and is difficult to perceive, realizes the inhomogeneous subregion to predetermineeing the picture, and the subregion size is different, and the cutting rule is more hidden, and the fake person is difficult to draw anti-fake information, is difficult to be imitated or destroyed.
In one embodiment, the preset pictures of the processor are formed by splicing a specified number of fragments, and the step of hiding the numbers in the preset pictures in sequence according to preset rules respectively includes: sequentially judging whether a first fragment contains a preset pixel area according to a preset sequence, wherein the first fragment is contained in the specified number of fragments; if the first fragments contain the preset pixel areas, sorting the first fragments, and forming a first sorting according to the positions of the first fragments in the preset picture and a preset sequence; acquiring a sequence number of the first fragment in the first sequencing; acquiring a first number in a corresponding sequence number in the array according to the sequence number; hiding the first number in a preset pixel area in the first fragment.
In one embodiment, before the step of sequentially determining whether the first tile includes the preset pixel area according to the preset order, the processor includes: uniformly and parallelly cutting the preset pictures along a first direction according to a first preset interval to form a plurality of rows of pictures, and performing first coding on each row of pictures according to the number of rows of pictures in the preset pictures; cutting each row of pictures along a second direction according to a second preset interval to form fragments, and performing second coding on each fragment according to the arrangement sequence of each fragment in the row of pictures, wherein the first direction and the second direction are mutually perpendicular; and forming coordinate codes corresponding to the fragments respectively according to the first codes and the second codes.
In one embodiment, the preset pictures are text pictures, the first preset space is a row space in the text pictures, the second preset space is a word space between two adjacent words in the same row in the text pictures, the processor cuts each of the row pictures along a second direction according to the second preset space to form fragments, and the step of performing second encoding on each of the fragments according to an arrangement order in which each of the fragments is located in the row pictures includes: identifying a first interval between two adjacent characters according to the second preset interval; and cutting two adjacent characters from the first interval along the direction perpendicular to the rows to form fragments, and performing second coding on each fragment according to the sequence of each fragment in the row pictures.
In one embodiment, the preset pictures are text pictures, the first preset interval is a line interval in the text pictures, the processor cuts each line picture along a second direction according to a second preset interval to form the fragments, and the step of performing second encoding on each fragment according to an arrangement order of each fragment in the line pictures includes: judging whether a second interval between two adjacent characters and a third interval in the characters are larger than the second preset interval or not; if the number is larger than the number, cutting two adjacent characters along the direction perpendicular to the row from the second interval, cutting the same character along the direction perpendicular to the row from the third interval, forming fragments, sorting the fragments in the row pictures according to the positions of the fragments, and performing second coding on the fragments.
In one embodiment, the step of the processor cutting the preset pictures uniformly and parallelly along a first direction according to a first preset interval to form a plurality of rows of pictures, and performing first encoding on each row of pictures according to the number of rows of each row of pictures in the preset pictures includes: judging whether the text of the anti-counterfeiting information to be filled is in a picture format or not; if not, converting the file to be encrypted into a picture format according to a preset conversion mode to form the text picture.
In one embodiment, the preset pixel area is a full black pixel matrix with a preset matrix size, the digits include binary digits 0 and/or 1, and the step of hiding the first digits in the preset pixel area in the first tile by the processor includes: judging whether the first number is 1; if the first number is 1, converting the pixel value of the central point of the full black pixel matrix into a pixel value corresponding to a white pixel to mark 1; if the first number is not 1, the first number is judged to be 0, and the all black pixel matrix is marked as 0.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in embodiments may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.
Claims (9)
1. A method of filling security information, comprising:
generating a two-dimensional code according to the anti-counterfeiting information and a preset two-dimensional code rule;
acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers;
Hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information;
displaying a preset picture carrying the anti-counterfeiting information;
the step of hiding the numbers in the preset pictures in sequence according to the preset rule respectively comprises the following steps:
sequentially judging whether a first fragment contains a preset pixel area according to a preset sequence, wherein the first fragment is contained in a specified number of fragments;
if the first fragments contain the preset pixel areas, sorting the first fragments, and forming a first sorting according to the positions of the first fragments in the preset picture and a preset sequence;
acquiring a sequence number of the first fragment in the first sequencing;
acquiring a first number in a corresponding sequence number in the array according to the sequence number;
hiding the first number in a preset pixel area in the first fragment.
2. A method for filling anti-counterfeiting information according to claim 1, wherein before the step of sequentially determining whether the first fragment includes the preset pixel area according to the preset order, the method comprises:
Uniformly and parallelly cutting the preset pictures along a first direction according to a first preset interval to form a plurality of rows of pictures, and performing first coding on each row of pictures according to the number of rows of pictures in the preset pictures;
cutting each row of pictures along a second direction according to a second preset interval to form fragments, and performing second coding on each fragment according to the arrangement sequence of each fragment in the row of pictures, wherein the first direction and the second direction are mutually perpendicular;
and forming coordinate codes corresponding to the fragments respectively according to the first codes and the second codes.
3. The method for filling anti-counterfeiting information according to claim 2, wherein the preset pictures are text pictures, the first preset space is a line space in the text pictures, the second preset space is a word space between two adjacent words in the same line in the text pictures, the line pictures are cut along a second direction according to the second preset space to form fragments, and the step of performing second encoding on the fragments according to an arrangement order in which the fragments are located in the line pictures comprises:
Identifying a first interval between two adjacent characters according to the second preset interval;
and cutting two adjacent characters from the first interval along the direction perpendicular to the rows to form fragments, and performing second coding on each fragment according to the sequence of each fragment in the row pictures.
4. The method of filling anti-counterfeiting information according to claim 2, wherein the preset pictures are text pictures, the first preset space is a line space in the text pictures, the steps of cutting each line picture along a second direction according to a second preset space to form fragments, and performing second encoding on each fragment according to an arrangement order in which each fragment is located in the line picture, include:
judging whether a second interval between two adjacent characters and a third interval in the characters are larger than the second preset interval or not;
if the number is larger than the number, cutting two adjacent characters along the direction perpendicular to the row from the second interval, cutting the same character along the direction perpendicular to the row from the third interval, forming fragments, sorting the fragments in the row pictures according to the positions of the fragments, and performing second coding on the fragments.
5. A method for filling anti-counterfeiting information according to claim 3 or 4, wherein the step of uniformly and parallelly cutting the preset pictures along the first direction according to a first preset interval to form a plurality of rows of pictures, and performing first encoding on each row of pictures according to the number of rows of each row of pictures in the preset pictures comprises:
judging whether the text of the anti-counterfeiting information to be filled is in a picture format or not;
if not, converting the file to be encrypted into a picture format according to a preset conversion mode to form the text picture.
6. A method of filling anti-counterfeiting information according to claim 1, wherein the predetermined pixel area is a full black pixel matrix of a predetermined matrix size, the digits comprise binary digits 0 and/or 1, and the step of hiding the first digit in the predetermined pixel area in the first fragment comprises:
judging whether the first number is 1;
if the first number is 1, converting the pixel value of the central point of the full black pixel matrix into a pixel value corresponding to a white pixel to mark 1;
if the first number is not 1, the first number is judged to be 0, and the all black pixel matrix is marked as 0.
7. A device for filling security information for performing a method of filling security information as claimed in any one of claims 1 to 6, comprising:
the generation module is used for generating the anti-counterfeiting information into a two-dimensional code according to a preset two-dimensional code rule;
the first acquisition module is used for acquiring an array corresponding to the two-dimensional code, wherein the array is formed by arranging a plurality of numbers;
the hiding module is used for hiding the numbers in preset pictures in sequence according to preset rules, wherein the preset pictures are pictures needing to be filled with the anti-counterfeiting information;
and the display module is used for displaying a preset picture carrying the anti-counterfeiting information.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910470652.4A CN110335189B (en) | 2019-05-31 | 2019-05-31 | Method, device, computer equipment and storage medium for filling anti-counterfeiting information |
PCT/CN2019/103453 WO2020237881A1 (en) | 2019-05-31 | 2019-08-29 | Method and apparatus for injecting anti-counterfeit information, computer device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910470652.4A CN110335189B (en) | 2019-05-31 | 2019-05-31 | Method, device, computer equipment and storage medium for filling anti-counterfeiting information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110335189A CN110335189A (en) | 2019-10-15 |
CN110335189B true CN110335189B (en) | 2024-01-16 |
Family
ID=68140706
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910470652.4A Active CN110335189B (en) | 2019-05-31 | 2019-05-31 | Method, device, computer equipment and storage medium for filling anti-counterfeiting information |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110335189B (en) |
WO (1) | WO2020237881A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112529757B (en) * | 2020-12-04 | 2024-01-19 | 平安科技(深圳)有限公司 | Screen information protection method, device, computer equipment and readable storage medium |
CN113076528A (en) * | 2021-03-24 | 2021-07-06 | 珠海奔图电子有限公司 | Anti-counterfeiting information embedding method, anti-counterfeiting information extracting method, anti-counterfeiting information embedding device, anti-counterfeiting information extracting device and storage medium |
WO2024040474A1 (en) * | 2022-08-24 | 2024-02-29 | 京东方科技集团股份有限公司 | Encrypted image watermark processing method and apparatus, and display device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1840817A1 (en) * | 2006-03-29 | 2007-10-03 | Fujitsu Limited | Method and apparatus for processing image, and printed material |
CN101488214A (en) * | 2008-01-15 | 2009-07-22 | 中国科学院软件研究所 | Method for expanding anti-fake digital watermark and electronic seal information content |
CN101770589A (en) * | 2009-12-31 | 2010-07-07 | 华中科技大学 | Method for carrying out image-text hiding according to encrypted and converted phase position |
CN101930587A (en) * | 2009-06-19 | 2010-12-29 | 株式会社理光 | Watermark information extended coding, embedding, evaluating and detection extracting method and device thereof |
WO2015062424A1 (en) * | 2013-10-28 | 2015-05-07 | 汝思信息技术(上海)有限公司 | Method and system for using feature images to achieve printing stock anti-fake |
WO2018076409A1 (en) * | 2016-10-28 | 2018-05-03 | 深圳大学 | Method for realizing two dimensional code copy prevention and realization system thereof |
CN109190736A (en) * | 2018-08-02 | 2019-01-11 | 北京三友恒瑞科技有限公司 | Anti-fake two-dimension code and its generation method and generation application system |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1013690A (en) * | 1996-06-27 | 1998-01-16 | Tec Corp | Article image display system |
JP4576318B2 (en) * | 2005-10-26 | 2010-11-04 | 富士通株式会社 | Encoding device |
US8774451B2 (en) * | 2011-04-28 | 2014-07-08 | King Abdul Aziz City for Science and Technology (KACST) | Method and apparatus for embedding a watermark image in a host image |
CN105095936B (en) * | 2015-07-22 | 2018-01-16 | 黄鹤南 | A kind of two-dimensional image code and its generation method and system based on Information hiding |
CN107358284A (en) * | 2017-07-11 | 2017-11-17 | 北京捷润科技有限公司 | Generation method, read method, generating means and the reading device of Quick Response Code |
CN108549920A (en) * | 2018-03-13 | 2018-09-18 | 福建新大陆电脑股份有限公司 | A kind of two-dimensional code data hidden method, data extraction method and equipment |
CN108764422A (en) * | 2018-05-15 | 2018-11-06 | 普联技术有限公司 | Quick Response Code insertion, extracting method and the device of image |
CN109359715A (en) * | 2018-12-22 | 2019-02-19 | 北京印刷学院 | Invalid code hides the dimension code anti-counterfeit method of the complementary identification of planar graph segmentation |
-
2019
- 2019-05-31 CN CN201910470652.4A patent/CN110335189B/en active Active
- 2019-08-29 WO PCT/CN2019/103453 patent/WO2020237881A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1840817A1 (en) * | 2006-03-29 | 2007-10-03 | Fujitsu Limited | Method and apparatus for processing image, and printed material |
CN101488214A (en) * | 2008-01-15 | 2009-07-22 | 中国科学院软件研究所 | Method for expanding anti-fake digital watermark and electronic seal information content |
CN101930587A (en) * | 2009-06-19 | 2010-12-29 | 株式会社理光 | Watermark information extended coding, embedding, evaluating and detection extracting method and device thereof |
CN101770589A (en) * | 2009-12-31 | 2010-07-07 | 华中科技大学 | Method for carrying out image-text hiding according to encrypted and converted phase position |
WO2015062424A1 (en) * | 2013-10-28 | 2015-05-07 | 汝思信息技术(上海)有限公司 | Method and system for using feature images to achieve printing stock anti-fake |
WO2018076409A1 (en) * | 2016-10-28 | 2018-05-03 | 深圳大学 | Method for realizing two dimensional code copy prevention and realization system thereof |
CN109190736A (en) * | 2018-08-02 | 2019-01-11 | 北京三友恒瑞科技有限公司 | Anti-fake two-dimension code and its generation method and generation application system |
Also Published As
Publication number | Publication date |
---|---|
CN110335189A (en) | 2019-10-15 |
WO2020237881A1 (en) | 2020-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110335189B (en) | Method, device, computer equipment and storage medium for filling anti-counterfeiting information | |
CN111008923B (en) | Watermark embedding method, watermark extracting method, watermark embedding device, watermark extracting device and watermark extracting equipment | |
US5765176A (en) | Performing document image management tasks using an iconic image having embedded encoded information | |
US8385592B2 (en) | Digital watermarking system and method | |
CN109379642B (en) | Method and device for adding and detecting video watermark and computer readable medium | |
Kim et al. | Watermarking two dimensional data object identifier for authenticated distribution of digital multimedia contents | |
US20170103293A1 (en) | Method of securing a two-dimensional barcode | |
CN106326961A (en) | Method for protecting the authenticity of an object, item, document, packaging and/or a label from imitation, forgery and theft | |
CN109325898A (en) | Write-in and the method and device for reading digital watermarking | |
EP3113083A2 (en) | Method for protecting the authenticity of an object, item, document, packaging and/or a label from imitation, forgery and theft | |
CN106599727B (en) | A kind of map vector completeness certification method | |
CN116089984B (en) | Anti-disclosure management method and system for administrative files | |
Jaiswal et al. | Implementation of a new technique for web document protection using unicode | |
Ansari et al. | PSO optimized multipurpose image watermarking using SVD and chaotic sequence | |
JP4220661B2 (en) | Electronic document falsification detection method and apparatus | |
KR100988309B1 (en) | Inserting method of document identifier and decoding method thereof | |
CN110991590B (en) | Image data processing method and pixel image and application system obtained by same | |
Kozachok et al. | Estimation of Watermark Embedding Capacity with Line Space Shifting | |
CN113988244A (en) | Anti-counterfeiting dot matrix generation and verification method, system, equipment and medium | |
Mantoro et al. | Real-time printed document authentication using watermarked qr code | |
CN113076528A (en) | Anti-counterfeiting information embedding method, anti-counterfeiting information extracting method, anti-counterfeiting information embedding device, anti-counterfeiting information extracting device and storage medium | |
CN116235169A (en) | Digital watermarking of text data | |
CN106952214B (en) | Towards the digital watermark embedding and extracting method of remote sensing images SHP faces file | |
Chroni et al. | Tamper Detection and Localization in Forensic Images | |
Khan et al. | Increased PSNR with improved DWT digital watermarking technique |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |