A kind of method for anti-counterfeit of tracing to the source based on big data correlation analysis
Technical field
The present invention relates to big data analysis technical field, more particularly, to a kind of based on big data correlation analysis
It traces to the source method for anti-counterfeit.
Background technology
Food security is significant for people's daily life, judge commodity trace to the source information the true and false all the time all be food
Product are traced to the source the hot spot of area research.Although having possessed various traceability systems, antifalsification label and anti-counterfeiting technology at present,
For example, outer code is anti-fake in pork traceability system, RFID tag, Quick Response Code, stochastic and dynamic Quick Response Code, logistic track are anti-fake etc.,
But one general character of these antifalsification labels and anti-counterfeiting technology generally existing:Antifalsification label cost of manufacture is too high, operating process is too complicated,
Without lasting Antiforge inquiry authentication function.
Invention content
The present invention is at least one defect overcome described in the above-mentioned prior art, is provided a kind of based on the big data degree of association point
The method for anti-counterfeit of tracing to the source of analysis.
In order to solve the above technical problems, technical scheme is as follows:
A kind of method for anti-counterfeit of tracing to the source based on big data correlation analysis, includes the following steps:
S1:Acquisition is traced to the source code, and according to tracing to the source, code obtains sequence number of tracing to the source;
S2:Data item with degree of association when tracing terminal application obtains commodity circulation or sells;
S3:Tracing terminal sends the data item of trace to the source sequence number and the associated degree that obtain to traceability system platform;
S4:Antiforge function interface of tracing to the source in traceability system platform receives trace to the source sequence number and the associated number of degrees of tracing terminal transmission
According to progress matching inquiry;
S5:To sequence number and the analysis of commodity association degrees of data item degree of being associated of tracing to the source;
S6:Tracing terminal shows result.
In a kind of preferred scheme, in step S1, tracing terminal application is opened, items scanning packing box traces back source code,
Obtain sequence number of tracing to the source.
In a kind of preferred scheme, in step S1, tracing terminal application is opened, code inquiry button of tracing to the source is clicked, obtains
It traces to the source sequence number.
In a kind of preferred scheme, in step S1, the sequence number of tracing to the source is by coding rule and the random sequence of tracing to the source
The code of tracing to the source generated is generated by encryption, bit arithmetic, and steps are as follows:
S11:Code of tracing to the source is converted into byte sequence by cryptographic calculation;
S12:Bit arithmetic is carried out for the byte sequence, is converted into character;
S13:The character converted every time is stitched together, sequence number of tracing to the source is generated.
In a kind of preferred scheme, the matching inquiry step of trace to the source described in step S4 sequence number and commodity association degrees of data
It is rapid as follows:
S41:Antiforge function module of tracing to the source whether there is in database lookup sequence number of tracing to the source first, if sequence number of tracing to the source is not deposited
It is then returning to " sequence number of tracing to the source is not present, and merchandise news is false " and is being shown to tracing terminal, poll-final;
S42:If sequence number of tracing to the source exists, according to the preset degree of association data item of commodity actual conditions, matching inquiry is traced to the source end
Whether the sequence number degree of association data item of tracing to the source that end is sent meets preset condition, if being unsatisfactory for preset condition, returns to that " inquiry is traced back
Source sequence number degree of association data item is unsatisfactory for preset condition " it is shown to tracing terminal, prompt consumer to trace to the source the sequence number degree of association
The preset condition of data item, poll-final;
S43:If sequence number of tracing to the source exists and current sequence number degree of association data item of tracing to the source meets the practical preset condition of commodity, carry out
Step S5.
In a kind of preferred scheme, in step s 5, inquiry database trace to the source sequence number be corresponding to it encryption, position fortune
Code of tracing to the source before calculation, obtains the batch number of the code of tracing to the source;According to batch number of tracing to the source, tracing to the source sequence number and degree of association data item is write
Enter in trace to the source sequence number and the degree of association collection of data items scanned and carry out big data correlation analysis, steps are as follows:
S51:Reading is traced to the source sequence number and degree of association collection of data items, according to trace to the source batch number trace to the source sequence number be associated with the number of degrees
It is distributed in each calculate node of big data platform according to item set;
S52:Big data platform each calculate node statistics each batch is traced to the source a yard frequency of occurrence for degree of association data item, and is converted into pass
Connection degree index;
S53:Compare that sequence number is traced to the source in this inquiry and whether degree of association data item meets the degree of association of big data correlation analysis
Index " traces to the source sequence number and degree of association data item is unsatisfactory for the degree of association of big data correlation analysis and refers to if not satisfied, then return
Mark " prompts the degree of association relationship that consumer should trace to the source sequence number and degree of association data item should meet, poll-final;If conversely, full
Foot then returns to the relevant information of tracing to the source for sequence number of tracing to the source.
Compared with prior art, the advantageous effect of technical solution of the present invention is:One kind is traced back based on big data correlation analysis
Source method for anti-counterfeit uses the label of tracing to the source on tracing terminal run-down commodity by consumer, so that it may while obtaining sequence of tracing to the source
Row number and degree of association data item;Sequence number is traced to the source in inquiry and degree of association data item whether there is and meet that commodity are practical presets item
Part, so that it is guaranteed that whether inquiry data are effective;According to query result, then trace to the source sequence number and degree of association collection of data items carry out it is big
Data correlation degree is analyzed;According to analysis result, compare this inquiry trace to the source sequence number and whether degree of association data item meets pass
Connection degree analysis result achievees the effect that merchandise news is traced to the source anti-fake, this method is fabricated to so that it is guaranteed that the true and false of merchandise news
This is relatively low, operating process is simple, has and continues Antiforge inquiry authentication function.
Description of the drawings
Fig. 1 is that correlation analysis of the present invention is traced to the source method for anti-counterfeit structure diagram.
Fig. 2 is that the correlation analysis of the present invention is traced to the source method for anti-counterfeit flow chart.
Fig. 3 is 2 Quick Response Code of embodiment decoding decoding flow chart.
Fig. 4 is 2 big data platform correlation analysis processing structure block diagram of embodiment.
Fig. 5 is embodiment 2 towards big data correlation analysis traceability anti-fake system structure diagram.
Specific implementation mode
The attached figures are only used for illustrative purposes and cannot be understood as limitating the patent;
In order to more preferably illustrate that the present embodiment, the certain components of attached drawing have omission, zoom in or out, the ruler of actual product is not represented
It is very little;
To those skilled in the art, the omitting of some known structures and their instructions in the attached drawings are understandable.
The following further describes the technical solution of the present invention with reference to the accompanying drawings and examples.
Embodiment 1
As shown in Figure 1 and 2, a kind of method for anti-counterfeit of tracing to the source based on big data correlation analysis, includes the following steps:
S1:Acquisition is traced to the source code, and according to tracing to the source, code obtains sequence number of tracing to the source;
S2:Data item with degree of association when tracing terminal application obtains commodity circulation or sells;
S3:Tracing terminal sends the data item of trace to the source sequence number and the associated degree that obtain to traceability system platform;
S4:Antiforge function interface of tracing to the source in traceability system platform receives trace to the source sequence number and the associated number of degrees of tracing terminal transmission
According to progress matching inquiry;
S5:To sequence number and the analysis of commodity association degrees of data item degree of being associated of tracing to the source;
S6:Tracing terminal shows result.
In specific implementation process, in step S1, tracing terminal application is opened, items scanning packing box traces back source code, obtains
To sequence number of tracing to the source.
In specific implementation process, in step S1, tracing terminal application is opened, code inquiry button of tracing to the source is clicked, is traced back
Source sequence number.
In specific implementation process, in step S1, the sequence number of tracing to the source is by coding rule and the random sequence life of tracing to the source
At trace to the source code by encryption, bit arithmetic generate, steps are as follows:
S11:Code of tracing to the source is converted into byte sequence by cryptographic calculation;
S12:Bit arithmetic is carried out for the byte sequence, is converted into character;
S13:The character converted every time is stitched together, sequence number of tracing to the source is generated.
In specific implementation process, the matching inquiry step of trace to the source described in step S4 sequence number and commodity association degrees of data
It is as follows:
S41:Antiforge function module of tracing to the source whether there is in database lookup sequence number of tracing to the source first, if sequence number of tracing to the source is not deposited
It is then returning to " sequence number of tracing to the source is not present, and merchandise news is false " and is being shown to tracing terminal, poll-final;
S42:If sequence number of tracing to the source exists, according to the preset degree of association data item of commodity actual conditions, matching inquiry is traced to the source end
Whether the sequence number degree of association data item of tracing to the source that end is sent meets preset condition, if being unsatisfactory for preset condition, returns to that " inquiry is traced back
Source sequence number degree of association data item is unsatisfactory for preset condition " it is shown to tracing terminal, prompt consumer to trace to the source the sequence number degree of association
The preset condition of data item, poll-final;
S43:If sequence number of tracing to the source exists and current sequence number degree of association data item of tracing to the source meets the practical preset condition of commodity, carry out
Step S5.
In specific implementation process, in step s 5, inquiry database sequence number of tracing to the source is corresponding to it encryption, bit arithmetic
Preceding code of tracing to the source, obtains the batch number of the code of tracing to the source;According to batch number of tracing to the source, sequence number and the write-in of degree of association data item of tracing to the source
In trace to the source sequence number and the degree of association collection of data items that have scanned and big data correlation analysis is carried out, steps are as follows:
S51:Reading is traced to the source sequence number and degree of association collection of data items, according to trace to the source batch number trace to the source sequence number be associated with the number of degrees
It is distributed in each calculate node of big data platform according to item set;
S52:Big data platform each calculate node statistics each batch is traced to the source a yard frequency of occurrence for degree of association data item, and is converted into pass
Connection degree index;
S53:Compare that sequence number is traced to the source in this inquiry and whether degree of association data item meets the degree of association of big data correlation analysis
Index " traces to the source sequence number and degree of association data item is unsatisfactory for the degree of association of big data correlation analysis and refers to if not satisfied, then return
Mark " prompts the degree of association relationship that consumer should trace to the source sequence number and degree of association data item should meet, poll-final;If conversely, full
Foot then returns to the relevant information of tracing to the source for sequence number of tracing to the source.
One kind is traced to the source method for anti-counterfeit based on big data correlation analysis, and tracing terminal run-down quotient is used by consumer
Label of tracing to the source on product, so that it may while obtaining trace to the source sequence number and degree of association data item;Inquiry trace to the source sequence number be associated with the number of degrees
It whether there is and meet the practical preset condition of commodity according to item, so that it is guaranteed that whether inquiry data are effective;According to query result, then
Trace to the source sequence number and degree of association collection of data items carries out big data correlation analysis;According to analysis result, this inquiry is compared
It traces to the source sequence number and degree of association data item whether meets correlation analysis as a result, so that it is guaranteed that the true and false of merchandise news, that is, reach
Merchandise news is traced to the source anti-fake effect.
Embodiment 2
Source code is traced back by tracing terminal items scanning label, parsing decodes out the sequence number of tracing to the source in tracing to the source code, and Fig. 3 is two dimension
Code decoding decodes flow chart, such as the Serial No. of tracing to the source of parsing:
"faeded7e66b906cad1075b96c84a67b0";
Sequence number of wherein tracing to the source is according to the code of tracing to the source of trace to the source coding rule and random sequence generation is encrypted, bit arithmetic is given birth to
At;Such as the code of tracing to the source generated according to coding rule is encrypted, bit arithmetic for " daxuecheng09105n90j833 " by md5
Serial No. of tracing to the source afterwards:" faeded7e66b906cad1075b96c84a67b0 ", sequence number of tracing to the source are traced to the source as consumer
Antiforge inquiry entrance ensures that code of tracing to the source to the irreversible of sequence number of tracing to the source so that counterfeiter can not be by tracing to the source in this way
Sequence decodes to obtain a yard coding rule of tracing to the source, to prevent counterfeiter from generating sequence number of tracing to the source in advance;Counterfeiter can only obtain
The limited sequence number of tracing to the source taken is scanned in market at present, before thus being provided for big data association analysis hereinafter is anti-fake
It carries;
Commodity contiguous items are obtained, for example, temporal information, geographical location information etc., what is chosen in the present embodiment is the time
And geographical location information, different commodity can carry out the selection of commodity association data item item according to different demands;
Trace to the source sequence number and contiguous items of tracing terminal transmission are traced to the source antiforge function interface to traceability system;
It traces to the source antiforge function interface polls database, judges that the sequence number of tracing to the source sent whether there is, if being not present, return
" code of tracing to the source is not present, and commodity are the information of vacation " is to tracing terminal;
Conversely, judging whether the relevant associated data item item of commodity meets the practical preset condition of commodity, for example, temporal information is compared
Whether sequence number of tracing to the source in the database corresponding inquiry time limit expires, if not satisfied, then returning, " the commodity contiguous items are discontented
The sufficient practical preset condition of commodity " arrives tracing terminal.
It should be noted that the preset condition of sequence number of tracing to the source, associated data item item can be set with foundation commodity actual conditions
It is fixed;For example, sequence number expired time of tracing to the source, can set, this mode can make consumer according to the shelf-life durations of commodity
Whether it is counterfeit and shoddy goods according to this kind of commodity of time automatic decision of Current Scan commodity.
If sequence number of tracing to the source exists, and commodity contiguous items meet the practical preset condition of commodity, then inquire sequence of tracing to the source
The corresponding original of row number is traced to the source code, is obtained the commerical batches number traced to the source corresponding to sequence number in tracing to the source code from original, is obtained the batch
Number scanning validation already existing trace to the source sequence number and contiguous items data acquisition system call big data platform to carry out sequence of tracing to the source
Row number and collection of data items are associated analysis, which includes mainly:
Acquisition is traced to the source sequence number and associated data item item set, and according to tracing to the source, batch number distribution data calculate section to big data platform
In point, the data of reading are distributed to next calculate node by big data platform calculate node by actual requirement.For example, in this example
What is selected in implementation is Storm stream calculation big data platforms, can select other big data platforms as needed.Fig. 4 is to use
Storm big data association analysis processing structure block diagrams, the wherein figure are the processing frame model reacted in embodiment, specific detailed
Thin calculate node number deployment should carry out planning and designing according to data volume size;Node Spout is obtained by batch number and is closed
Join collection of data items, pretreatment associated data item is distributed to next processing node Bolt;Processing node Bolt counts each batch
Secondary sequence number associated data item frequency of occurrence of tracing to the source eventually forms association analysis as a result, for example, trace to the source sequence number and geographical location
Incidence relation;
Sequence number is traced to the source in inquiry and whether associated data item item meets association analysis result.For example, the Serial No. of tracing to the source of inquiry
" faeded7e66b906cad1075b96c84a67b0 ", associated data Xiang Xiangwei:" 20170215, Guangzhou railway station " are passed through
After big data association analysis, it is found that commodity association geographical location is:" Guangzhou south railway station, Guangzhou northern station ".As can be known from the results, this kind of quotient
The sale geographical location that product occurred when meeting the practical preset condition of commodity, such consumer is it is known that oneself purchase
Whether commodity were bought in the above place, to judge the true and false of commodity.
As shown in figure 5, Response Code scan module is mainly subject to noted earlier, commodity association data item item, for example, geographical
Position, can be scanned positioning using tracing terminal LBS positioning units, and back-tracing anti-fake module carries out query unit, sentences successively
Order member, query counts unit, correlation analysis unit, association results comparing unit, finally return to anti-fake result of tracing to the source.
The same or similar label correspond to the same or similar components;
The terms describing the positional relationship in the drawings are only for illustration, should not be understood as the limitation to this patent;
Obviously, the above embodiment of the present invention be only to clearly illustrate example of the present invention, and not be to this hair
The restriction of bright embodiment.For those of ordinary skill in the art, it can also do on the basis of the above description
Go out other various forms of variations or variation.There is no necessity and possibility to exhaust all the enbodiments.It is all in the present invention
Spirit and principle within made by all any modification, equivalent and improvement etc., should be included in the guarantor of the claims in the present invention
Within the scope of shield.