Good antifalse label generation method based on computerized algorithm
Technical field
The good antifalse label generation method based on computerized algorithm that the present invention relates to a kind of.
Background technique
With the high speed development of Internet of Things, the daily shopping of people more convenient and efficient, and the development of commodity economy, it is false
It is prevailing therewith to emit counterfeit product, therefore people are increasingly concerned with how to avoid buying the counterfeit commodity of personation, how easily examine
Authenticity of products.Pseudo label life can effectively check fakement phenomena, the merchandise news feature and know method for distinguishing that antifalsification label includes
It is the important means that counterfeit commodity are palmed off in identification, anti-fake carried out to those for the purpose of deception and without owner's allowance
Imitated or duplication activity and the Prevention method taken.Existing antifalsification label be mostly in printing process to paper, text,
The change of the physical behaviors such as pattern, decorative pattern is so that antifalsification label includes merchandise news feature, and then realizes anti-fake purpose.But
Such antifalsification label is by a relatively simple, and be easily cracked imitation, to lose the function of checking fakement phenomena.
Summary of the invention
Technical problem to be solved by the invention is to provide a kind of good antifalse label generation side based on computerized algorithm
Method, this method using computerized algorithm combination merchandise news feature generation antifalsification label, improve the complexity of antifalsification label and
Facilitate identification, increases the difficulty for cracking imitation, effectively check the fakement phenomena of commodity.
In order to solve the above technical problems, including as follows the present invention is based on the good antifalse label generation method of computerized algorithm
Step:
Step 1: working out length according to merchandise news feature as the security code of 32 bit bytes and importing computer, by counting
Calculation machine calculates the cryptographic Hash of the security code, and the length of cryptographic Hash is 512 bit bytes;
Step 2: cryptographic Hash is split as 16 × 32 groups of data, every group of data describe two points so that it is determined that straight line,
The a plurality of straight line of 16 × 32 groups of data is drawn in drawing area;
Step 3: computer, which reads system time, obtains 14 characters of system time, to 14 characters group two-by-two at random
It closes, multiple polygon center point coordinates is generated in drawing area, the random number of edges for setting polygon, side length and adjacent edge folder
Angle and multiple polygon is drawn in drawing area;
Step 4: defining the radius of the color of every straight line and each polygon, line width and Intersection Point at random, generate
One width random pattern, computer save the random pattern and generate picture file by specified format;
Step 5: picture file inputs print publishing system, print to obtain antifalsification label by print publishing system.
Further, merchandise news feature includes commodity unique sequence numbers, product name, commercial specification, manufacturer's information, pin
Sell quotient's information, commodity are traced to the source information and material flow tracking information.
Further, cryptographic Hash is calculated by computer using MD5 One-way encryption algorithm.
Further, the specified format of picture file includes JPG file, PNG file or pdf document.
Since the present invention is based on the good antifalse label generation methods of computerized algorithm to use above-mentioned technical proposal, i.e., originally
Method works out security code according to merchandise news feature first and imports computer, calculates the 512 of the security code by computer
Bit byte cryptographic Hash;Cryptographic Hash is split as 16 × 32 groups of data, every group of data describe two points so that it is determined that straight line,
Drawing area draws a plurality of straight line of 16 × 32 groups of data;Computer reads system time and obtains 14 characters, to 14 characters
Random combination of two generates multiple polygon center point coordinates, and draws multiple polygon in drawing area;Random definition
The radius of the color of every straight line and each polygon, line width and Intersection Point, generates a width random pattern, and computer saves
The random pattern and generate picture file;Picture file, which inputs print publishing system and prints, obtains antifalsification label.This method
Antifalsification label is generated using computerized algorithm combination merchandise news feature, the complexity of antifalsification label is improved and facilitates identification,
The difficulty for cracking imitation is increased, the fakement phenomena of commodity is effectively checked.
Detailed description of the invention
The present invention will be further described in detail below with reference to the accompanying drawings and embodiments:
Fig. 1 is that the present invention is based on the flow diagrams of the good antifalse label generation method of computerized algorithm.
Specific embodiment
Embodiment is as shown in Figure 1, include following step the present invention is based on the good antifalse label generation method of computerized algorithm
It is rapid:
Step 1: working out length according to merchandise news feature as the security code of 32 bit bytes and importing computer, by counting
Calculation machine calculates the cryptographic Hash of the security code, and the length of cryptographic Hash is 512 bit bytes;
Step 2: cryptographic Hash is split as 16 × 32 groups of data, every group of data describe in drawing area two points to
It determines straight line, draws a plurality of straight line of 16 × 32 groups of data in drawing area;
Step 3: computer, which reads system time, obtains 14 characters of system time, the system time include year, the moon,
Day, when, minute, second data X axis coordinate point and Y axis coordinate point in drawing area are obtained to 14 random combination of two of character,
To generate multiple polygon center point coordinates in drawing area, random number of edges, side length and the adjacent edge for setting polygon
Angle and multiple polygon is drawn in drawing area;
Step 4: defining the radius of the color of every straight line and each polygon, line width and Intersection Point at random, generate
One width random pattern, computer save the random pattern and generate picture file by specified format;
Step 5: picture file inputs print publishing system, print to obtain antifalsification label by print publishing system.
Preferably, merchandise news feature includes commodity unique sequence numbers, product name, commercial specification, manufacturer's information, pin
Sell quotient's information, commodity are traced to the source information and material flow tracking information.
Preferably, cryptographic Hash is calculated by computer using MD5 One-way encryption algorithm.
Preferably, the specified format of picture file includes JPG file, PNG file or pdf document.
This method combines the factors such as merchandise news feature and time series, generates antifalsification label using computerized algorithm,
Wherein MD5 One-way encryption algorithm has the characteristics that anti-modification property and strong impact resistant, such as makes any change to former data, even only
A byte is modified, obtained cryptographic Hash has very big difference to want to find a tool that is, from known former data and its cryptographic Hash
The data (i.e. data falsification) of identical cryptographic Hash are very difficult, therefore significantly improve the safety of antifalsification label and easy
In popularization.For client by scanning antifalsification label, whether the picture on comparison antifalsification label is consistent with the content of scanning display, if
It is consistent then prompt for certified products, and the inquiry times and query time of the antifalsification label can be prompted;If inconsistent, vacation is prompted for
Emit product.Meanwhile this method generate antifalsification label can also integrated two-dimensional code, corresponding net can be linked by scanning the two-dimensional code
Page by the relevant merchandise news feature of web displaying, and can carry out merchandise news verifying by product database, to identify quotient
The product true and false.This method operation is convenient, and the antifalsification label of generation cracks that difficulty of reproduction is big, so that the fraud for effectively checking commodity is existing
As.