CN110400157A - A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain - Google Patents

A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain Download PDF

Info

Publication number
CN110400157A
CN110400157A CN201910673017.6A CN201910673017A CN110400157A CN 110400157 A CN110400157 A CN 110400157A CN 201910673017 A CN201910673017 A CN 201910673017A CN 110400157 A CN110400157 A CN 110400157A
Authority
CN
China
Prior art keywords
ticket
circulation
block chain
intelligent contract
holder
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.)
Pending
Application number
CN201910673017.6A
Other languages
Chinese (zh)
Inventor
冯国东
杨高赟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Four Piece Technology (shenzhen) Co Ltd
Original Assignee
Four Piece Technology (shenzhen) Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Four Piece Technology (shenzhen) Co Ltd filed Critical Four Piece Technology (shenzhen) Co Ltd
Priority to CN201910673017.6A priority Critical patent/CN110400157A/en
Publication of CN110400157A publication Critical patent/CN110400157A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • G06K17/0022Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device
    • G06K17/0029Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device the arrangement being specially adapted for wireless interrogation of grouped or bundled articles tagged with wireless record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Accounting & Taxation (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a kind of product traceability method based on block chain, it include: when the first ticket holder calls ticket circulation interface, the first ticket circulation record identification is obtained, and judges that the first ticket holder calls whether ticket circulation interface is valid operation using intelligent contract;If valid operation, then judge whether ticket circulates normal according to the first ticket circulation record identification using intelligent contract;If ticket circulation is normal, circulates and record to the first ticket of block Web broadcast, the second ticket holder to circulate is stored using intelligent contract, and stores the first ticket circulation record into block chain;Receive ticket querying command;If judging that all ticket datas of ticket are fed back to the initiator of ticket querying command there are ticket querying command corresponding ticket using intelligent contract.Present invention also provides product traceability device, electronic equipment and computer readable storage mediums based on block chain, all have above-mentioned beneficial effect, details are not described herein.

Description

A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain
Technical field
This application involves product traceability technical field, in particular to a kind of product traceability method based on block chain is based on Product traceability device, electronic equipment and the computer readable storage medium of block chain.
Background technique
The true and false pain spot for always being that every profession and trade is urgently to be resolved of product, high-frequency, large-scale commodity are faked, so that public Crowd increasingly improves the demand that commodity are traced to the source.How effectively retrospect is at industry is realized to the production of commodity and transit information Research emphasis.Existing tracing mode be by merchandise news storage in the server, user terminal can transfer merchandise news with Product information is obtained, still, the information of storage is easy to be tampered.
Therefore, how to provide a kind of scheme of solution above-mentioned technical problem is that those skilled in the art need to solve at present Problem.
Summary of the invention
The purpose of the application is to provide a kind of product traceability method based on block chain, the product traceability dress based on block chain It sets, electronic equipment and computer readable storage medium, can guarantee the accurate of data, and by storage ticket circulation record, it is complete It has been apt to information of tracing to the source, has improved product false proof performance.Its concrete scheme is as follows:
In a first aspect, this application provides a kind of product traceability methods based on block chain, comprising:
When the first ticket holder calls ticket circulation interface, the first ticket circulation record identification is obtained, and utilize intelligence Energy contract judges that first ticket holder calls whether the ticket circulation interface is valid operation;
If valid operation, then ticket stream is judged according to first ticket circulation record identification using the intelligent contract Whether normal turn;
If the ticket circulation is normal, circulates and record to the first ticket described in block Web broadcast, utilize the intelligence Contract stores the second ticket holder to circulate, and stores the first ticket circulation record into block chain;
Receive ticket querying command;
If using the intelligent contract judgement, there are the corresponding tickets of the ticket querying command, by the institute of the ticket There is ticket data to feed back to the initiator of the ticket querying command.
Optionally, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record identification it Before, further includes:
The production source data acquired using video capture device is stored in IPFS system, the IPFS system is obtained and returns Return cryptographic Hash, wherein the production source data include environment temperature, humidity, composition of air, geographical location, video information, when Between information;
If judging that corresponding first ticket holder of the production source data is legal holds using the intelligent contract The cryptographic Hash is then stored in the ticket additional information of the block chain by the person of having.
Optionally, when the first ticket holder calls ticket circulation interface, the first ticket circulation record identification, packet are obtained It includes:
When reading the RFID label tag of product, judge that the RFID label tag of the product and the RFID label tag in the ticket are It is no consistent, wherein the product is a product or multiple similar-type products;
If consistent, when first ticket holder calls the ticket circulation interface, first ticket is obtained Circulate record identification.
Optionally, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record identification it Before, comprising:
When the product is fresh, and when reading the fresh RFID label tag, judge the fresh RFID label tag and Whether the RFID label tag in the ticket is consistent;
If consistent, multiple fresh tickets with the associated preset weight of the ticket are established;
When third ticket holder calls the ticket circulation interface, then to the block Web broadcast quality inspection ticket stream Turn record, store quality inspection ticket holder using the intelligent contract, and stores the quality inspection ticket circulation record to the area In block chain;
Quality testing certificate is got, is stored the quality testing certificate into the block chain using the intelligent contract.
Optionally, it if ticket circulation is normal, circulates and records to the first ticket described in block Web broadcast, utilize institute It states intelligent contract and stores the second ticket holder to circulate, and store the first ticket circulation and record into block chain it Afterwards, further includes:
When second ticket holder calls the ticket circulation interface, the second ticket circulation record identification is obtained, And judge that second ticket holder calls whether the ticket circulation interface is valid operation using the intelligent contract;
If valid operation, then ticket stream is judged according to second ticket circulation record identification using the intelligent contract Whether normal turn;
If ticket circulation is normal, circulates and record to the second ticket described in the block Web broadcast, using described Intelligent contract stores the 4th ticket holder, and stores the second ticket circulation record into the block chain.
Optionally, judge that first ticket holder calls whether the ticket circulation interface is to close using intelligent contract Method operation, comprising:
Judge current date whether within ticket validity period using the intelligent contract;
If the current date judges that first ticket is held within the ticket validity period, using the intelligent contract Person calls whether the ticket circulation interface is valid operation.
Second aspect, the application provide a kind of product traceability device based on block chain, comprising:
First operation judges module, for obtaining the first ticket when the first ticket holder calls ticket circulation interface Circulate record identification, and judges that first ticket holder calls whether the ticket circulation interface is to close using intelligent contract Method operation;
First ticket circulation judgment module, if being used for valid operation, then using the intelligent contract according to described first Ticket circulation record identification judges whether ticket circulation is normal;
First broadcast and memory module, if normal for ticket circulation, to the first ticket described in block Web broadcast Card circulation record stores the second ticket holder to circulate using the intelligent contract, and stores the first ticket circulation Record is into block chain;
Receiving module, for receiving ticket querying command;
Feedback module, if for being judged using the intelligent contract there are the corresponding ticket of the ticket querying command, All ticket datas of the ticket are fed back to the initiator of the ticket querying command.
Optionally, further includes:
Cryptographic Hash obtains module, for the production source data for utilizing video capture device to acquire to be stored in IPFS system In, obtain the cryptographic Hash that the IPFS system returns, wherein the production source data include environment temperature, humidity, air at Divide, geographical location, video information, temporal information;
Cryptographic Hash memory module, if for judging the production source data corresponding described first using the intelligent contract Ticket holder is legitimate holder, then is stored in the cryptographic Hash in the ticket additional information of the block chain.
Optionally, the first operation judges module includes:
Label judging unit, for when reading the RFID label tag of product, judge the RFID label tag of the product with it is described Whether the RFID label tag in ticket is consistent, wherein the product is a product or multiple similar-type products;
First ticket circulation record identification acquiring unit, if for consistent, when first ticket holder calls institute When stating ticket circulation interface, the first ticket circulation record identification is obtained.
Optionally, further includes:
Label judgment module, for when the product is fresh, and when reading the fresh RFID label tag, described in judgement Whether fresh RFID label tag and the RFID label tag in the ticket are consistent;
Ticket obtains module, if establishing multiple fresh tickets with the associated preset weight of the ticket for consistent;
Quality inspection ticket circulation record storage module is used for when third ticket holder calls the ticket circulation interface, It then circulates and records to the block Web broadcast quality inspection ticket, store quality inspection ticket holder using the intelligent contract, and deposit The quality inspection ticket circulation record is stored up into the block chain;
Quality testing certificate memory module is deposited the quality testing certificate using the intelligent contract for getting quality testing certificate Storage is into the block chain.
Optionally, further includes:
Second operation judges module, for obtaining when second ticket holder calls the ticket circulation interface Second ticket circulation record identification, and judge that second ticket holder calls the ticket to circulate using the intelligent contract Whether interface is valid operation;
Second ticket circulation judgment module, if being used for valid operation, then using the intelligent contract according to described second Ticket circulation record identification judges whether ticket circulation is normal;
Second broadcast and memory module module, if normal for ticket circulation, to the block Web broadcast institute The second ticket circulation record is stated, stores the 4th ticket holder using the intelligent contract, and store the second ticket circulation Record is into the block chain.
Optionally, the first operation judges module includes:
Validity period judging unit, for judging current date whether within ticket validity period using the intelligent contract;
Valid operation judging unit, if utilizing the intelligence for the current date within the ticket validity period Contract judges that first ticket holder calls whether the ticket circulation interface is valid operation.
The third aspect, the application provide a kind of electronic equipment, comprising:
Memory, for storing computer program;
Processor is performed the steps of when for executing the computer program when the first ticket holder calls ticket When circulation interface, the first ticket circulation record identification is obtained, and judge that first ticket holder calls using intelligent contract Whether the ticket circulation interface is valid operation;If valid operation, then using the intelligent contract according to first ticket Card circulation record identification judges whether ticket circulation is normal;If ticket circulation is normal, to described in block Web broadcast the One ticket circulation record stores the second ticket holder to circulate using the intelligent contract, and stores first ticket Circulation record is into block chain;Receive ticket querying command;If using the intelligent contract judgement, there are ticket inquiries Corresponding ticket is ordered, then all ticket datas of the ticket are fed back to the initiator of the ticket querying command.
Optionally, when the processor executes the computer subprogram saved in the memory, can implement with Lower step: the production source data acquired using video capture device is stored in IPFS system, is obtained the IPFS system and is returned Return cryptographic Hash, wherein the production source data include environment temperature, humidity, composition of air, geographical location, video information, when Between information;If judging that corresponding first ticket holder of the production source data is legal holds using the intelligent contract The cryptographic Hash is then stored in the ticket additional information of the block chain by person.
Optionally, when the processor executes the computer subprogram saved in the memory, can implement with Lower step: when reading the RFID label tag of product, judge that the RFID label tag of the product and the RFID label tag in the ticket are It is no consistent, wherein the product is a product or multiple similar-type products;If consistent, when first ticket is held When person calls the ticket circulation interface, the first ticket circulation record identification is obtained.
Optionally, when the processor executes the computer subprogram saved in the memory, can implement with Lower step: when the product is fresh, and when reading the fresh RFID label tag, judge the fresh RFID label tag and institute Whether the RFID label tag stated in ticket is consistent;If consistent, multiple fresh tickets with the associated preset weight of the ticket are established Card;When third ticket holder calls the ticket circulation interface, then circulates and remember to the block Web broadcast quality inspection ticket Record stores quality inspection ticket holder using the intelligent contract, and stores the quality inspection ticket circulation record to the block chain In;Quality testing certificate is got, is stored the quality testing certificate into the block chain using the intelligent contract.
Optionally, when the processor executes the computer subprogram saved in the memory, can implement with Lower step: when second ticket holder calls the ticket circulation interface, obtaining the second ticket circulation record identification, and Judge that second ticket holder calls whether the ticket circulation interface is valid operation using the intelligent contract;If Valid operation then judges whether ticket circulates normal according to second ticket circulation record identification using the intelligent contract; If the ticket circulation is normal, circulates and record to the second ticket described in the block Web broadcast, utilizes the intelligent contract The 4th ticket holder is stored, and stores the second ticket circulation record into the block chain.
Optionally, when the processor executes the computer subprogram saved in the memory, can implement with Lower step: judge current date whether within ticket validity period using the intelligent contract;If the current date is in the ticket Demonstrate,prove in validity period, then using the intelligent contract judge first ticket holder call the ticket circulate interface whether be Valid operation.
Fourth aspect, the application provide a kind of computer readable storage medium, deposit on the computer readable storage medium Computer program is contained, the computer program is performed the steps of when being executed by processor when the first ticket holder calls When ticket circulation interface, the first ticket circulation record identification is obtained, and judge first ticket holder using intelligent contract Call whether the ticket circulation interface is valid operation;If valid operation, then using the intelligent contract according to described the One ticket circulation record identification judges whether ticket circulation is normal;If the ticket circulation is normal, to block Web broadcast institute The first ticket circulation record is stated, stores the second ticket holder to circulate using the intelligent contract, and store described first Ticket circulation record is into block chain;Receive ticket querying command;If using the intelligent contract judgement, there are the tickets All ticket datas of the ticket are then fed back to the initiator of the ticket querying command by the corresponding ticket of querying command.
It optionally, can be with when the computer subprogram saved in the computer readable storage medium is executed by processor Specific implementation following steps: the production source data acquired using video capture device is stored in IPFS system, described in acquisition IPFS system return cryptographic Hash, wherein the production source data include environment temperature, humidity, composition of air, geographical location, Video information, temporal information;If judging that corresponding first ticket of the production source data is held using the intelligent contract Person is legitimate holder, then is stored in the cryptographic Hash in the ticket additional information of the block chain.
It optionally, can be with when the computer subprogram saved in the computer readable storage medium is executed by processor It implements following steps: when reading the RFID label tag of product, judging in RFID label tag and the ticket of the product Whether RFID label tag is consistent, wherein the product is a product or multiple similar-type products;If consistent, when described the When one ticket holder calls the ticket circulation interface, the first ticket circulation record identification is obtained.
It optionally, can be with when the computer subprogram saved in the computer readable storage medium is executed by processor It implements following steps: when the product is fresh, and when reading the fresh RFID label tag, judging described fresh Whether RFID label tag and the RFID label tag in the ticket are consistent;If consistent, establish and the associated preset weight of the ticket Multiple fresh tickets;When third ticket holder calls the ticket circulation interface, then to the block Web broadcast matter Ticket checking card circulation record stores quality inspection ticket holder using the intelligent contract, and stores the quality inspection ticket circulation record To in the block chain;Quality testing certificate is got, is stored the quality testing certificate to the block chain using the intelligent contract In.
It optionally, can be with when the computer subprogram saved in the computer readable storage medium is executed by processor It implements following steps: when second ticket holder calls the ticket circulation interface, obtaining the circulation of the second ticket Record identification, and judge that second ticket holder calls whether the ticket circulation interface is to close using the intelligent contract Method operation;If valid operation, then ticket stream is judged according to second ticket circulation record identification using the intelligent contract Whether normal turn;If the ticket circulation is normal, circulates and record to the second ticket described in the block Web broadcast, utilize institute It states intelligent contract and stores the 4th ticket holder, and store the second ticket circulation record into the block chain.
It optionally, can be with when the computer subprogram saved in the computer readable storage medium is executed by processor Specific implementation following steps: judge current date whether within ticket validity period using the intelligent contract;If described work as the day before yesterday Phase within the ticket validity period, then judges that first ticket holder calls the ticket to circulate using the intelligent contract Whether interface is valid operation.
The application provides a kind of product traceability method based on block chain, comprising: when the first ticket holder calls ticket When circulation interface, the first ticket circulation record identification is obtained, and judge that the first ticket holder calls ticket using intelligent contract Whether the interface that circulates is valid operation;If valid operation, then sentenced using intelligent contract according to the first ticket circulation record identification Whether disconnected ticket circulation is normal;If ticket circulation is normal, circulates and record to the first ticket of block Web broadcast, utilize intelligent conjunction The second ticket holder to circulate is about stored, and stores the first ticket circulation record into block chain;Receive ticket inquiry Order;If using the judgement of intelligent contract, there are the corresponding tickets of ticket querying command, and all ticket datas of ticket are fed back To the initiator of ticket querying command.
As it can be seen that the application is by judging the legitimacy of operation using intelligent contract, according to first when calling circulation interface Ticket circulation record identification judges whether ticket circulation is normal, and when legal and normal, broadcast the first ticket circulation is recorded and protected It deposits into block chain, guarantees that the first ticket circulation record is not tampered, realize full-range retrospect, it is ensured that entirely circulate process Transparence, realize the monitoring of each link, and then by obtaining ticket querying command, inquire all ticket datas, energy It is enough in the authenticity for guaranteeing data, the acquisition efficiency of data can not be improved, improve the antifalsification of product under tamper, safety Energy.The application additionally provides a kind of product traceability device based on block chain, a kind of electronic equipment simultaneously and computer-readable deposits Storage media all has above-mentioned beneficial effect, and details are not described herein.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of the product traceability method based on block chain provided by the embodiment of the present application;
Fig. 2 is the flow chart of product traceability method of the another kind based on block chain provided by the embodiment of the present application;
Fig. 3 is the flow chart of product traceability method of the another kind based on block chain provided by the embodiment of the present application;
Fig. 4 is the flow chart of another product traceability method based on block chain provided by the embodiment of the present application;
Fig. 5 is the flow chart of another product traceability method based on block chain provided by the embodiment of the present application;
Fig. 6 is the flow chart of another product traceability method based on block chain provided by the embodiment of the present application;
Fig. 7 is a kind of structural schematic diagram of the product traceability device based on block chain provided by the embodiments of the present application;
Fig. 8 is the structure chart of a kind of electronic equipment provided by the embodiments of the present application;
Fig. 9 is the structure chart of another electronic equipment provided by the embodiments of the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Existing tracing mode is to store merchandise news in the server, and user terminal can transfer merchandise news to obtain To product information, still, the information of storage is easy to be tampered, and is based on above-mentioned technical problem, and the present embodiment provides one kind to be based on area The product traceability method of block chain is specific referring to FIG. 1, Fig. 1 is a kind of production based on block chain provided by the embodiment of the present application The flow chart of product source tracing method, specifically includes:
S101, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record identification, and benefit Judge that the first ticket holder calls whether ticket circulation interface is valid operation with intelligent contract.
The present embodiment is not defined the first ticket holder, can be first ticket during products in circulation and holds The person of having, the ticket holder being also possible to during products in circulation, user can customize setting, as long as being that by this implementation The purpose of example.Only current ticket holder can call ticket circulation interface, realize ticket circulation.First ticket Circulation record identification refers to mark during ticket circulates, and can use one or more of letter, number, symbol It is identified, can be normal mark, pause mark, revolution mark, advance mark, end of identification etc., naturally it is also possible to be Other marks, as long as the problems in ticket circulation process can be characterized.The only legal ticket of the calling of ticket circulation interface Card holder can just call, therefore judge whether it is valid operation using intelligent contract.The ticket data of ticket is stored in area In block chain, data is prevented to be tampered, guarantees the safety of data.The present embodiment is not defined ticket, as long as can flow Logical, corresponding product can be the products such as tobacco and wine, medical supplies, pork, milk, melon and fruit be fresh, naturally it is also possible to be it Its product.
If S102, valid operation, then judge that ticket circulates according to the first ticket circulation record identification using intelligent contract It is whether normal.
When being illegal operation, then stop.When being valid operation, is then circulated and remembered according to the first ticket using intelligent contract Record mark judges whether the process of ticket circulation is normal, for example, not supporting when ticket circulation record identification is end of identification Circulation, then ticket circulation is abnormal;When ticket circulation record mark be pause mark, then also do not support to circulate at this time, ticket stream Turn abnormal.
If the circulation of S103, ticket is normal, circulates and record to the first ticket of block Web broadcast, is stored using intelligent contract The second ticket holder to circulate, and the first ticket circulation record is stored into block chain.
When ticket circulates exception, then terminate.When ticket circulation is normal, then circulate to the first ticket of block Web broadcast Record stores the second ticket holder to circulate using intelligent contract, circulates and records with the first ticket, at this point, current ticket Demonstrate,proving holder is the second ticket holder, and only the second ticket holder is able to carry out ticket circulation, saves the functions such as information, when So, the first holder in S101-S103 can be first ticket holder, second ticket holder either The last one ticket holder can also be the information preservation in source, in production process, processing during the circulation of entire ticket Link, examines batch, logistics turnover complete to third party's quality inspection, customs, entry and exit, distribution channel, StoreFront etc. at kitchen information The retrospect of journey, and relevant information is stored in block chain, it ensure that data can not be tampered.
S104, ticket querying command is received.
The application is not defined the acquisition form of ticket querying command, can be by scanning the two-dimensional code, bar code, Or be directly configured in the client, as long as being that by the purpose of the present embodiment.It, can be with by taking two dimensional code as an example It is after scanning the two-dimensional code, system obtains ticket querying command.The mode of two-dimensional code scanning, which can be, to be scanned by wechat, is led to It crosses Baidu to be scanned, then jumps to corresponding client or small routine, so as to obtain all ticket datas, either It carries out directly acquiring all ticket datas after wechat scans the scanning of the latter Baidu.When scanning the two-dimensional code, it can be seen that the product All ticket datas, the data such as video including circulation information and source acquisition, if checking less than illustrating that product is asked Topic, system auto-alarming.After terminal user buys commodity, dealer needs a corresponding ticket to circulate to terminal user, so as to Terminal can take ticket to go to exchange integral or other prizes.
Ticket querying command can be all ticket datas of one ticket of inquiry, can be all tickets of multiple tickets Data are demonstrate,proved, ticket querying command further includes the uniqueness ID of ticket.For example, ticket querying command is all numbers for inquiring a ticket According to ticket querying command is the b1 ticket for inquiring same type, all ticket datas of b2 ticket, b3 ticket.
If S105, using the judgement of intelligent contract, there are the corresponding tickets of ticket querying command, by all tickets of ticket Data feedback to ticket querying command initiator.
When there is ticket corresponding with ticket querying command, then all ticket datas of ticket are fed back into ticket inquiry life The initiator of order.At this point, ticket data includes the unique ID of ticket, ticket symbol, ticket validity period, ticket holder's information, ticket Card circulation record, ticket additional information.
Specifically, it is understood that all data being stored in block chain can not be modified, and ticket is unique ID, ticket symbol, ticket validity period cannot add, and ticket holder's information determines that ticket belongs to which account is held, only There is ticket holder that could add ticket additional information;Ticket circulation record, has recorded a ticket and ties from validity period is created to In beam, all account informations (corresponding ticket holder's information) and timestamp flowed through have recorded ticket in circulation process In all ticket holders and corresponding timestamp;Ticket additional information can be the picture file of ticket, certificate file Deng.The unique ID of ticket is to discriminate between the mark of different tickets, is unique in entire block chain.Ticket symbol is certain one kind of characterization Ticket can issue the needs of ticket of the unique ID of multiple and different tickets is to meet same line of business under same class ticket.Ticket When being film ticket, by the way to manage for determining the type of ticket data according to intelligent contract and being stored, it can pass through Data can not be modified to be associated with intelligent contract, for non-homogeneous data, i.e. can not modify data realizes the uniqueness of ticket, It places and distorts and solve the problems, such as the validity and authenticity that the ticket pot life ensure that ticket data using ticket validity period.
Based on the above-mentioned technical proposal, the present embodiment is by when calling circulation interface, utilizing the judgement operation of intelligent contract Legitimacy judges whether ticket circulation is normal according to the first ticket circulation record identification, when legal and normal, broadcasts the first ticket Card circulation is recorded and saved into block chain, is guaranteed that the first ticket circulation record is not tampered, is realized full-range retrospect, really The transparence for protecting entire circulation process, realizes the monitoring of each link, and then by obtaining ticket querying command, inquires all Ticket data, can in the authenticity for guaranteeing data, the acquisition efficiency of data can not be improved under tamper, safety, improve The anti-counterfeiting performance of product.
It is specific referring to FIG. 2, Fig. 2 is that the application is real the present embodiment provides a kind of product traceability method based on block chain Apply the flow chart of product traceability method of the another kind provided by example based on block chain, comprising:
S201, the production source data acquired using video capture device is stored in IPFS system, obtains IPFS system The cryptographic Hash of return.
Wherein, production source data includes environment temperature, humidity, composition of air, geographical location, video information, temporal information.
It since data packet is larger, is not easy to be stored in block chain, therefore, ticket proof information is stored in IPFS In file system, IPFS file system, which returns to unique cryptographic Hash mark ticket, proves information.Cryptographic Hash is received, intelligence is utilized Cryptographic Hash is stored in block chain by contract, is fed back to ticket holder and is indexed ID, utilizes the available index of intelligent contract Unique cryptographic Hash in the ticket additional information that ID is directed toward can be demonstrate,proved in the acquisition ticket in IPFS file system based on content addressed Bright information.It is worth noting that, only ticket holder can just add ticket additional information.It further, can be by testing Whether the cryptographic Hash in card block chain is consistent with the cryptographic Hash that the ticket in IPFS file system proves that information generates again, only Unanimously, it just can guarantee that the authenticity of the file stored in IPFS file system, effective verify data distort phenomenon, improve data Discrimination power.Video information with sensing in the present embodiment acquires equipment, in conjunction with block chain and IPFS distributed storage network, very Convenient acquisition beginning of production information, and anti-tamper, support stores big file;Further, traditional RFID technique can be combined, Have extremely strong anti-counterfeit capability, and only need a step that can inquire all intermediate links, more to the accessory informations of commodity of tracing to the source Add abundant, enhances the desire to purchase of terminal user, increase best buy sales volume.
Video capture device is the video capture device with sensor, specifically, having data-handling capacity, depositing Storage, sensor, the equipment with communication function;Specifically, video capture device includes data processor, memory, temperature sensing Therefore device, humidity sensor, gas sensor, video collector etc. can acquire environment temperature, humidity, composition of air, geography The data such as position, and automatically snap live video.There is block chain client-side program in equipment, and is assigned with account and private key.
If S202, judging that corresponding first ticket holder of production source data is legitimate holder using intelligent contract, Cryptographic Hash is stored in the ticket additional information of block chain.
S203, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record identification, and benefit Judge that the first ticket holder calls whether ticket circulation interface is valid operation with intelligent contract.
If S204, valid operation, then judge that ticket circulates according to the first ticket circulation record identification using intelligent contract It is whether normal.
If the circulation of S205, ticket is normal, circulates and record to the first ticket of block Web broadcast, is stored using intelligent contract The second ticket holder to circulate, and the first ticket circulation record is stored into block chain.
S206, ticket querying command is received.
If S207, using the judgement of intelligent contract, there are the corresponding tickets of ticket querying command, by all tickets of ticket Data feedback to ticket querying command initiator.
By ticket, a ticket querying command is only needed, the corresponding all tickets of the ticket can be viewed from block chain Data, including all intermediate links of product.To check the details of beginning of production acquisition, the additional letter of ticket need to be only read Breath, finds source data file cryptographic Hash, corresponding original is then obtained from IPFS file system.For product Block chain is added, the corresponding ticket of raw material, in product export, same other information in these suppliers by raw material retrospect It is associated with the product ticket together.
Based on the above-mentioned technical proposal, the present embodiment is stored in IPFS file system by that will produce source data, and will be right The cryptographic Hash answered is stored in the ticket additional information of block chain, solves the problems, such as that block chain is not easy to storage big data packet, Improve the public credibility of data preservation.
It is specific referring to FIG. 3, Fig. 3 is that the application is real the present embodiment provides a kind of product traceability method based on block chain Apply the flow chart of product traceability method of the another kind provided by example based on block chain, comprising:
S301, when reading the RFID label tag of product, judge RFID label tag in the RFID label tag and ticket of product is whether Unanimously, wherein product is a product or multiple similar-type products.
RFID Radio Frequency Identification Technology is mature, and cost is also lower and lower, in addition reading conveniently, high safety is applicable in various evils Bad environment is widely used in tradition is traced to the source.RFID reads equipment, can once read more in packing case even container A RFID label tag is highly suitable for logistic storage use.RFID label tag is sticked in shipment, for every product by source producer, and The corresponding label data of RFID label tag is stored in IPFS file system by client-side program, then this data is utilized Intelligent contract is associated with the ticket data in block chain.
Product is sent out to logistics company by source producer, while the corresponding ticket of product is passed through the progress ticket circulation of block network To logistics company;When logistics company warehouse receives cargo, production RFID label is read by RFID label tag reading device first;Its Secondary, by client-side program, inquiry receives associated RFID label tag inside ticket, and the RFID label tag read with front compares.
If S302, consistent, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record Mark;And judge that the first ticket holder calls whether ticket circulation interface is valid operation using intelligent contract.
If inconsistent, the markup information on ticket, ticket cannot circulate intelligent contract again automatically, and notify associated It is people, the present embodiment is not defined Related Contact, can be the technical staff of current operation, it may be possible to next technology Personnel are also possible to be uploaded to system and put on record;If consistent, ticket circulation record, including logistics are stored on block chain Company's relevant information includes geographical location, and ticket circulation to next link.
If S303, valid operation, then judge that ticket circulates according to the first ticket circulation record identification using intelligent contract It is whether normal.
If the circulation of S304, ticket is normal, circulates and record to the first ticket of block Web broadcast, is stored using intelligent contract The second ticket holder to circulate, and the first ticket circulation record is stored into block chain.
S305, ticket querying command is received.
If S306, using the judgement of intelligent contract, there are the corresponding tickets of ticket querying command, by all tickets of ticket Data feedback to ticket querying command initiator.
Above-described embodiment specifically is please referred to, the present embodiment is no longer repeated.
Based on the above-mentioned technical proposal, when the present embodiment is by utilizing RFID label tag consistent with the RFID label tag in ticket, Ticket circulation interface can be called, user is avoided and needs to register in advance, and the retrospect of the logistics links in dynamic mapping The problem of loss of information.
It is specific referring to FIG. 4, Fig. 4 is that the application is real the present embodiment provides a kind of product traceability method based on block chain Apply the flow chart of product traceability method of the another kind provided by example based on block chain, comprising:
S401, when product is fresh, and reads fresh RFID label tag, judge in fresh RFID label tag and ticket Whether RFID label tag is consistent.
It is fresh at this time to can be the products such as chicken, pig, duck, fish, since live-bird needs the then cutting by butchering, and pass through National quality inspection organization is examined.Live-bird class ticket circulates after butchering mechanism and receiving ticket, reads fresh RFID label tag first, so Judge whether the RFID label tag in fresh RFID label tag and ticket is consistent afterwards.
If S402, consistent, multiple fresh tickets of foundation and the associated preset weight of ticket.
If inconsistent, the markup information on ticket, ticket cannot circulate intelligent contract again automatically, and notify associated It is people;If consistent, ticket can be understood as recycling automatically at this time, and establish multiple fresh tickets with the associated preset weight of ticket Card.
S403, when third ticket holder call ticket circulate interface when, then to block Web broadcast quality inspection ticket circulate Record stores quality inspection ticket holder using intelligent contract, and stores quality inspection ticket circulation record into block chain,
Specifically, corresponding is the circulation of multiple fresh tickets when third ticket holder calls ticket circulation interface, this When, third ticket holder is quality inspection organization, and then circulates and record to block Web broadcast quality inspection ticket, is deposited using intelligent contract Quality inspection ticket holder is stored up, and stores quality inspection ticket circulation record into block chain.
S404, quality testing certificate is got, is stored quality testing certificate into block chain using intelligent contract.
Quality inspection organization gets quality testing certificate after the completion of establishing, and is stored quality testing certificate to block using intelligent contract In chain, further, it can circulate to mechanism is butchered, then be circulated again to dealer.Specific the present embodiment is no longer gone to live in the household of one's in-laws on getting married It states.
S405, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record identification, and benefit Judge that the first ticket holder calls whether ticket circulation interface is valid operation with intelligent contract.
If S406, valid operation, then judge that ticket circulates according to the first ticket circulation record identification using intelligent contract It is whether normal.
If the circulation of S407, ticket is normal, circulates and record to the first ticket of block Web broadcast, is stored using intelligent contract The second ticket holder to circulate, and the first ticket circulation record is stored into block chain.
S408, ticket querying command is received.
Ticket querying command at this time corresponds to multiple fresh tickets.
If S409, using the judgement of intelligent contract, there are the corresponding tickets of ticket querying command, by all tickets of ticket Data feedback to ticket querying command initiator.
Based on the above-mentioned technical proposal, the present embodiment is illustrated by saving to the data during fresh circulation, Guarantee that the first ticket circulation record is not tampered, realize full-range retrospect, it is ensured that the transparence of entire circulation process is realized The monitoring of each link, and then by obtaining ticket querying command, all ticket datas are inquired, can guarantee data Authenticity can not improve the acquisition efficiency of data, improve the anti-counterfeiting performance of product under tamper, safety.
It is specific referring to FIG. 5, Fig. 5 is that the application is real the present embodiment provides a kind of product traceability method based on block chain Apply the flow chart of product traceability method of the another kind provided by example based on block chain, comprising:
S501, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record identification, and benefit Judge that the first ticket holder calls whether ticket circulation interface is valid operation with intelligent contract.
If S502, valid operation, then judge that ticket circulates according to the first ticket circulation record identification using intelligent contract It is whether normal.
If the circulation of S503, ticket is normal, circulates and record to the first ticket of block Web broadcast, is stored using intelligent contract The second ticket holder to circulate, and the first ticket circulation record is stored into block chain.
S504, when the second ticket holder call ticket circulate interface when, obtain the second ticket circulation record identification, and benefit Judge that the second ticket holder calls whether ticket circulation interface is valid operation with intelligent contract.
If S505, valid operation, then judge that ticket circulates according to the second ticket circulation record identification using intelligent contract It is whether normal.
If the circulation of S506, ticket is normal, circulates and record to the second ticket of block Web broadcast, is stored using intelligent contract 4th ticket holder, and the second ticket circulation record is stored into block chain.
S507, ticket querying command is received.
If S508, using the judgement of intelligent contract, there are the corresponding tickets of ticket querying command, by all tickets of ticket Data feedback to ticket querying command initiator.
The present embodiment is not defined the 4th ticket holder, when the second ticket holder is sole distributor, the 4th Ticket holder can be a point dealer.
Based on the above-mentioned technical proposal, the present embodiment can once have this holder of multiple tickets, realize the circulation of ticket, Meet the actual demand of people.
It is specific referring to FIG. 6, Fig. 6 is that the application is real the present embodiment provides a kind of product traceability method based on block chain Apply the flow chart of product traceability method of the another kind provided by example based on block chain, comprising:
S601, when the first ticket holder call ticket circulate interface when, obtain the first ticket circulation record identification, and benefit Judge current date whether within ticket validity period with intelligent contract.
Ticket validity period can not be changed, and only ticket can circulate within ticket validity period, when solving ticket Effect problem.
If S602, current date judge that the first ticket holder calls ticket within ticket validity period, using intelligent contract Whether card circulation interface is valid operation.
If S603, valid operation, then judge that ticket circulates according to the first ticket circulation record identification using intelligent contract It is whether normal.
If the circulation of S604, ticket is normal, circulates and record to the first ticket of block Web broadcast, is stored using intelligent contract The second ticket holder to circulate, and the first ticket circulation record is stored into block chain.
S605, ticket querying command is received.
If S606, using the judgement of intelligent contract, there are the corresponding tickets of ticket querying command, by all tickets of ticket Data feedback to ticket querying command initiator.
Based on the above-mentioned technical proposal, the present embodiment solves the problems, such as that the ticket pot life ensure that ticket using ticket validity period The validity of data is demonstrate,proved, and by ticket circulation record storage in block chain, data can not be distorted, and ensure that ticket circulation record Authenticity, realize it is anti-fake trace to the source, stay card, get true ticket circulation record convenient for user, improve user experience.
A kind of product traceability device based on block chain provided by the embodiments of the present application is introduced below, is described below Reference can be corresponded to each other with the above-described product traceability method based on block chain based on the product traceability device of block chain, With reference to Fig. 7, Fig. 7 is a kind of structural schematic diagram of the product traceability device based on block chain provided by the embodiment of the present application, packet It includes:
First operation judges module 710, for obtaining the first ticket when the first ticket holder calls ticket circulation interface Card circulation record identification, and judge that the first ticket holder calls whether ticket circulation interface is legal behaviour using intelligent contract Make;
First ticket circulation judgment module 720, if being used for valid operation, then using intelligent contract according to the first ticket stream Turn record identification and judges whether ticket circulation is normal;
If first broadcast and memory module 730 circulate normal for ticket circulation to the first ticket of block Web broadcast Record stores the second ticket holder to circulate using intelligent contract, and stores the first ticket circulation record into block chain;
Receiving module 740, for receiving ticket querying command;
Feedback module 750, if for there are the corresponding tickets of ticket querying command using the judgement of intelligent contract, by ticket All ticket datas feed back to the initiator of ticket querying command.
The present embodiment is by judging the legitimacy of operation using intelligent contract, according to the first ticket when calling circulation interface Card circulation record identification judges whether ticket circulation is normal, and when legal and normal, broadcast the first ticket circulation is recorded and saved Into block chain, guarantees that the first ticket circulation record is not tampered, realize full-range retrospect, it is ensured that entire circulation process Transparence realizes the monitoring of each link, and then by acquisition ticket querying command, inquires all ticket datas, can In the authenticity for guaranteeing data, the acquisition efficiency of data can not be improved, the anti-counterfeiting performance of product is improved under tamper, safety.
In some specific embodiments, further includes:
Cryptographic Hash obtains module, for the production source data for utilizing video capture device to acquire to be stored in IPFS system In, obtain the cryptographic Hash that IPFS system returns, wherein production source data includes environment temperature, humidity, composition of air, geographical position It sets, video information, temporal information;
Cryptographic Hash memory module, if for judging that corresponding first ticket holder of production source data is using intelligent contract Cryptographic Hash is then stored in the ticket additional information of block chain by legitimate holder.
In some specific embodiments, the first operation judges module 710 includes:
Label judging unit, for judging in the RFID label tag and ticket of product when reading the RFID label tag of product Whether RFID label tag is consistent, wherein product is a product or multiple similar-type products;
First ticket circulation record identification acquiring unit, if for consistent, when the first ticket holder calls ticket stream When converting interface, the first ticket circulation record identification is obtained.
In some specific embodiments, further includes:
Label judgment module, for when product is fresh, and reads fresh RFID label tag, judging fresh RFID mark It signs whether consistent with the RFID label tag in ticket;
Ticket obtains module, if establishing multiple fresh tickets with the associated preset weight of ticket for consistent;
Quality inspection ticket circulate record storage module, for when third ticket holder call ticket circulate interface when, then to Block Web broadcast quality inspection ticket circulation record, stores quality inspection ticket holder using intelligent contract, and store quality inspection ticket stream Turn record into block chain;
Quality testing certificate memory module is stored quality testing certificate to block using intelligent contract for getting quality testing certificate In chain.
In some specific embodiments, further includes:
Second operation judges module, for obtaining the second ticket when the second ticket holder calls ticket circulation interface Circulate record identification, and judges that the second ticket holder calls whether ticket circulation interface is valid operation using intelligent contract;
Second ticket circulation judgment module is then circulated using intelligent contract according to the second ticket if being used for valid operation Record identification judges whether ticket circulation is normal;
Second broadcast and memory module module, if normal for ticket circulation, to block Web broadcast the second ticket stream Turn record, store the 4th ticket holder using intelligent contract, and stores the second ticket circulation record into block chain.
In some specific embodiments, the first operation judges module 710 includes:
Validity period judging unit, for judging current date whether within ticket validity period using intelligent contract;
Valid operation judging unit, if judging first using intelligent contract for current date within ticket validity period Ticket holder calls whether ticket circulation interface is valid operation.
Embodiment due to the product traceability device part based on block chain and the product traceability method portion based on block chain The embodiment divided corresponds to each other, therefore the embodiment of the product traceability device part based on block chain is referred to based on block chain The description of the embodiment of product traceability method part, wouldn't repeat here.
Present invention also provides a kind of electronic equipment, and referring to Fig. 8, Fig. 8 is that a kind of electronics provided by the embodiments of the present application is set Standby structure chart, comprising:
Memory 100, for storing computer program;
Step provided by above-described embodiment may be implemented in processor 200 when for executing computer program.
Specifically, memory 100 includes non-volatile memory medium, built-in storage.Non-volatile memory medium storage There are operating system and computer-readable instruction, which is that the operating system and computer in non-volatile memory medium can The operation of reading instruction provides environment.Processor 200 provides calculating and control ability for electronic equipment, executes and protects in memory 100 When the computer program deposited, following steps may be implemented: when the first ticket holder calls ticket circulation interface, obtaining first Ticket circulation record identification, and judge that the first ticket holder calls whether ticket circulation interface is legal behaviour using intelligent contract Make;If valid operation, then judge whether ticket circulates normal according to the first ticket circulation record identification using intelligent contract;If Ticket circulation is normal, then circulates and record to the first ticket of block Web broadcast, and the second ticket to circulate is stored using intelligent contract Holder is demonstrate,proved, and stores the first ticket circulation record into block chain;Receive ticket querying command;If being sentenced using intelligent contract Break there are the corresponding ticket of ticket querying command, then all ticket datas of ticket are fed back to the initiation of ticket querying command Side.
The present embodiment is by judging the legitimacy of operation using intelligent contract, according to the first ticket when calling circulation interface Card circulation record identification judges whether ticket circulation is normal, and when legal and normal, broadcast the first ticket circulation is recorded and saved Into block chain, guarantees that the first ticket circulation record is not tampered, realize full-range retrospect, it is ensured that entire circulation process Transparence realizes the monitoring of each link, and then by acquisition ticket querying command, inquires all ticket datas, can In the authenticity for guaranteeing data, the acquisition efficiency of data can not be improved, the anti-counterfeiting performance of product is improved under tamper, safety.
It, can when processor 200 executes the computer subprogram saved in memory 100 in some specific embodiments It is stored in IPFS system with performing the steps of the production source data that will be acquired using video capture device, obtains IPFS system Unite return cryptographic Hash, wherein production source data include environment temperature, humidity, composition of air, geographical location, video information, when Between information;If judging that corresponding first ticket holder of production source data is legitimate holder using intelligent contract, by Hash Value is stored in the ticket additional information of block chain.
It, can when processor 200 executes the computer subprogram saved in memory 100 in some specific embodiments To perform the steps of when reading the RFID label tag of product, judge that the RFID label tag in the RFID label tag and ticket of product is It is no consistent, wherein product is a product or multiple similar-type products;If consistent, when the first ticket holder calls ticket When card circulation interface, the first ticket circulation record identification is obtained.
It, can when processor 200 executes the computer subprogram saved in memory 100 in some specific embodiments To perform the steps of when product is fresh, and reads fresh RFID label tag, judge in fresh RFID label tag and ticket RFID label tag it is whether consistent;If consistent, multiple fresh tickets with the associated preset weight of ticket are established;When third ticket When holder calls ticket circulation interface, then circulates and record to block Web broadcast quality inspection ticket, intelligent contract is utilized to store matter Ticket holder is examined, and stores quality inspection ticket circulation record into block chain;Quality testing certificate is got, using intelligent contract by matter Probatio inspectionem pecuoarem book is stored into block chain.
It, can when processor 200 executes the computer subprogram saved in memory 100 in some specific embodiments To perform the steps of when the second ticket holder calls ticket circulation interface, the second ticket circulation record identification is obtained, and Judge that the second ticket holder calls whether ticket circulation interface is valid operation using intelligent contract;If valid operation, then Judge whether ticket circulates normal according to the second ticket circulation record identification using intelligent contract;If ticket circulation is normal, to The second ticket of block Web broadcast circulation record stores the 4th ticket holder using intelligent contract, and stores the second ticket stream Turn record into block chain.
It, can when processor 200 executes the computer subprogram saved in memory 100 in some specific embodiments Judge current date whether within ticket validity period using intelligent contract to perform the steps of;If current date has in ticket In the effect phase, then judge that the first ticket holder calls whether ticket circulation interface is valid operation using intelligent contract.
Embodiment due to electronics portion and the embodiment of the product traceability method part based on block chain are mutually right It answers, therefore the embodiment of electronics portion refers to the description of the embodiment of the product traceability method part based on block chain, Here it wouldn't repeat.
It on the basis of the above embodiments, preferably, is provided by the embodiments of the present application referring to Fig. 9, Fig. 9 The structure chart of another electronic equipment, the electronic equipment further include:
Input interface 300 is connected with processor 200, for obtaining computer program, parameter and the instruction of external importing, It saves through the control of processor 200 into memory 100.The input interface 300 can be connected with input unit, and it is manual to receive user The parameter or instruction of input.The input unit can be the touch layer covered on display screen, be also possible to be arranged in terminal enclosure Key, trace ball or Trackpad, be also possible to keyboard, Trackpad or mouse etc..
Display unit 400 is connected with processor 200, the data sent for video-stream processor 200.The display unit 400 It can be display screen, liquid crystal display or the electric ink display screen etc. in PC machine.
The network port 500 is connected with processor 200, for being communicatively coupled with external each terminal device.The communication link The communication technology used by connecing can be cable communicating technology or wireless communication technique, and such as mobile high definition chained technology (MHL) leads to It is blue with universal serial bus (USB), high-definition media interface (HDMI), adopting wireless fidelity technology (WiFi), Bluetooth Communication Technology, low-power consumption The tooth communication technology, communication technology based on IEEE802.11s etc..
Disclosed herein as well is a kind of computer readable storage mediums, have computer program thereon, the computer program It is performed and step provided by above-described embodiment may be implemented.The storage medium may include: USB flash disk, mobile hard disk, read-only deposit Reservoir (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or The various media that can store program code such as CD.Computer program is stored on the storage medium, computer program is located Reason device is performed the steps of when executing when the first ticket holder calls ticket circulation interface, obtains the first ticket circulation note Record mark, and judge that the first ticket holder calls whether ticket circulation interface is valid operation using intelligent contract;If closing Method operation then judges whether ticket circulates normal according to the first ticket circulation record identification using intelligent contract;If ticket circulates Normally, then it circulates and records to the first ticket of block Web broadcast, the second ticket holder to circulate is stored using intelligent contract, And the first ticket circulation record is stored into block chain;Receive ticket querying command;If using the judgement of intelligent contract, there are tickets The corresponding ticket of querying command is demonstrate,proved, then all ticket datas of ticket are fed back to the initiator of ticket querying command.
The present embodiment is by judging the legitimacy of operation using intelligent contract, according to the first ticket when calling circulation interface Card circulation record identification judges whether ticket circulation is normal, and when legal and normal, broadcast the first ticket circulation is recorded and saved Into block chain, guarantees that the first ticket circulation record is not tampered, realize full-range retrospect, it is ensured that entire circulation process Transparence realizes the monitoring of each link, and then by acquisition ticket querying command, inquires all ticket datas, can In the authenticity for guaranteeing data, the acquisition efficiency of data can not be improved, the anti-counterfeiting performance of product is improved under tamper, safety.
It optionally, can be specific when the computer subprogram saved in computer readable storage medium is executed by processor It performs the steps of the production source data that will be acquired using video capture device to be stored in IPFS system, obtains IPFS system The cryptographic Hash of return, wherein production source data includes environment temperature, humidity, composition of air, geographical location, video information, time Information;If judging that corresponding first ticket holder of production source data is legitimate holder using intelligent contract, by cryptographic Hash It is stored in the ticket additional information of block chain.
It optionally, can be specific when the computer subprogram saved in computer readable storage medium is executed by processor It performs the steps of when reading the RFID label tag of product, judges whether is RFID label tag in the RFID label tag and ticket of product Unanimously, wherein product is a product or multiple similar-type products;If consistent, when the first ticket holder calls ticket When circulation interface, the first ticket circulation record identification is obtained.
It optionally, can be specific when the computer subprogram saved in computer readable storage medium is executed by processor It performs the steps of when product is fresh, and reads fresh RFID label tag, judges in fresh RFID label tag and ticket Whether RFID label tag is consistent;If consistent, multiple fresh tickets with the associated preset weight of ticket are established;When third ticket is held When the person of having calls ticket circulation interface, then circulates and record to block Web broadcast quality inspection ticket, intelligent contract is utilized to store quality inspection Ticket holder, and quality inspection ticket circulation record is stored into block chain;Quality testing certificate is got, using intelligent contract by quality inspection Certificate is stored into block chain.
It optionally, can be specific when the computer subprogram saved in computer readable storage medium is executed by processor It performs the steps of when the second ticket holder calls ticket circulation interface, obtains the second ticket circulation record identification, and benefit Judge that the second ticket holder calls whether ticket circulation interface is valid operation with intelligent contract;It is if valid operation, then sharp Judge whether ticket circulation is normal according to the second ticket circulation record identification with intelligent contract;If ticket circulation is normal, the area Ze Xiang The second ticket of block Web broadcast circulation record stores the 4th ticket holder using intelligent contract, and stores the circulation of the second ticket Record is into block chain.
It optionally, can be specific when the computer subprogram saved in computer readable storage medium is executed by processor It performs the steps of and judges current date whether within ticket validity period using intelligent contract;If current date is effective in ticket In phase, then judge that the first ticket holder calls whether ticket circulation interface is valid operation using intelligent contract.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration .It should be pointed out that for those skilled in the art, under the premise of not departing from the application principle, also Can to the application, some improvement and modification can also be carried out, these improvement and modification also fall into the protection scope of the claim of this application It is interior.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.Under the situation not limited more, the element limited by sentence "including a ..." is not arranged Except there is also other identical elements in the process, method, article or equipment for including element.

Claims (10)

1. a kind of product traceability method based on block chain characterized by comprising
When the first ticket holder calls ticket circulation interface, the first ticket circulation record identification is obtained, and close using intelligence About judge that first ticket holder calls whether the ticket circulation interface is valid operation;
If valid operation, then judge that ticket circulation is according to first ticket circulation record identification using the intelligent contract It is no normal;
If the ticket circulation is normal, circulates and record to the first ticket described in block Web broadcast, utilizes the intelligent contract The second ticket holder to circulate is stored, and stores the first ticket circulation record into block chain;
Receive ticket querying command;
If using the intelligent contract judgement, there are the corresponding tickets of the ticket querying command, by all tickets of the ticket Demonstrate,prove the initiator of data feedback to the ticket querying command.
2. the product traceability method according to claim 1 based on block chain, which is characterized in that as the first ticket holder Call ticket circulation interface when, obtain the first ticket circulation record identification before, further includes:
The production source data acquired using video capture device is stored in IPFS system, obtains what the IPFS system returned Cryptographic Hash, wherein the production source data includes environment temperature, humidity, composition of air, geographical location, video information, time letter Breath;
If judging that corresponding first ticket holder of the production source data is legitimate holder using the intelligent contract, Then the cryptographic Hash is stored in the ticket additional information of the block chain.
3. the product traceability method according to claim 1 based on block chain, which is characterized in that as the first ticket holder When calling ticket circulation interface, the first ticket circulation record identification is obtained, comprising:
When read product RFID label tag when, judge the product RFID label tag and the ticket in RFID label tag whether one It causes, wherein the product is a product or multiple similar-type products;
If consistent, when first ticket holder calls the ticket circulation interface, the first ticket circulation is obtained Record identification.
4. the product traceability method according to claim 1 based on block chain, which is characterized in that as the first ticket holder Call ticket circulation interface when, obtain the first ticket circulation record identification before, comprising:
When the product is fresh, and when reading the fresh RFID label tag, judge the fresh RFID label tag with it is described Whether the RFID label tag in ticket is consistent;
If consistent, multiple fresh tickets with the associated preset weight of the ticket are established;
When third ticket holder calls the ticket circulation interface, then circulates and remember to the block Web broadcast quality inspection ticket Record stores quality inspection ticket holder using the intelligent contract, and stores the quality inspection ticket circulation record to the block chain In;
Quality testing certificate is got, is stored the quality testing certificate into the block chain using the intelligent contract.
5. the product traceability method according to claim 3 based on block chain, which is characterized in that if ticket circulation is just Often, then it circulates and records to the first ticket described in block Web broadcast, store the second ticket to circulate using the intelligent contract Holder, and after storing first ticket circulation record into block chain, further includes:
When second ticket holder calls the ticket circulation interface, the second ticket circulation record identification, and benefit are obtained Judge that second ticket holder calls whether the ticket circulation interface is valid operation with the intelligent contract;
If valid operation, then judge that ticket circulation is according to second ticket circulation record identification using the intelligent contract It is no normal;
If the ticket circulation is normal, circulates and record to the second ticket described in the block Web broadcast, utilize the intelligence Contract stores the 4th ticket holder, and stores the second ticket circulation record into the block chain.
6. the product traceability method according to any one of claims 1 to 5 based on block chain, which is characterized in that utilize intelligence Energy contract judges that first ticket holder calls whether the ticket circulation interface is valid operation, comprising:
Judge current date whether within ticket validity period using the intelligent contract;
If the current date judges first ticket holder within the ticket validity period, using the intelligent contract Call whether the ticket circulation interface is valid operation.
7. a kind of product traceability device based on block chain characterized by comprising
First operation judges module, for obtaining the circulation of the first ticket when the first ticket holder calls ticket circulation interface Record identification, and judge that first ticket holder calls whether the ticket circulation interface is legal behaviour using intelligent contract Make;
First ticket circulation judgment module, if being used for valid operation, then using the intelligent contract according to first ticket Circulation record identification judges whether ticket circulation is normal;
First broadcast and memory module, if normal for ticket circulation, to the first ticket stream described in block Web broadcast Turn record, stores the second ticket holder to circulate using the intelligent contract, and store the first ticket circulation record Into block chain;
Receiving module, for receiving ticket querying command;
Feedback module, if for there are the corresponding tickets of the ticket querying command using the intelligent contract judgement, by institute All ticket datas for stating ticket feed back to the initiator of the ticket querying command.
8. the product traceability device according to claim 7 based on block chain, which is characterized in that further include:
Cryptographic Hash obtains module, for the production source data for utilizing video capture device to acquire to be stored in IPFS system, obtains The cryptographic Hash for taking the IPFS system to return, wherein the production source data includes environment temperature, humidity, composition of air, geography Position, video information, temporal information;
Cryptographic Hash memory module, if for judging corresponding first ticket of the production source data using the intelligent contract Holder is legitimate holder, then is stored in the cryptographic Hash in the ticket additional information of the block chain.
9. a kind of electronic equipment characterized by comprising
Memory, for storing computer program;
Processor realizes the production based on block chain as described in any one of claim 1 to 6 when for executing the computer program The step of product source tracing method.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes the product based on block chain as described in any one of claim 1 to 6 when the computer program is executed by processor The step of source tracing method.
CN201910673017.6A 2019-07-24 2019-07-24 A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain Pending CN110400157A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910673017.6A CN110400157A (en) 2019-07-24 2019-07-24 A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910673017.6A CN110400157A (en) 2019-07-24 2019-07-24 A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain

Publications (1)

Publication Number Publication Date
CN110400157A true CN110400157A (en) 2019-11-01

Family

ID=68325853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910673017.6A Pending CN110400157A (en) 2019-07-24 2019-07-24 A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain

Country Status (1)

Country Link
CN (1) CN110400157A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879902A (en) * 2019-11-25 2020-03-13 北京工商大学 Grain, oil and food full supply chain information safety management system and method based on trusted identification and IPFS
CN110930171A (en) * 2020-01-09 2020-03-27 烟台大学 Whole-process traceability monitoring system for ticket payment flow three-chain cross verification product security
CN111127047A (en) * 2020-01-09 2020-05-08 烟台大学 Whole-process traceability supervision method for ticket payment flow three-chain cross verification product security
CN111967991A (en) * 2020-09-08 2020-11-20 浙江大学 Communication processing method for seafood food information monitoring based on Internet of things and block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197913A (en) * 2017-12-18 2018-06-22 深圳前海微众银行股份有限公司 Method of payment, system and computer readable storage medium based on block chain
CN108537523A (en) * 2018-04-18 2018-09-14 北京奇虎科技有限公司 Token transactions method and device based on block chain
CN108681847A (en) * 2018-08-19 2018-10-19 北京元链科技有限公司 A kind of retrospect of cold fresh food and shelf-life inquiry system based on block chain technology
CN109151526A (en) * 2018-09-30 2019-01-04 深圳市元征科技股份有限公司 A kind of video transmission method, system, equipment and computer readable storage medium
CN109191003A (en) * 2018-09-25 2019-01-11 仲恺农业工程学院 Fruit and vegetable agricultural product quality safety traceability system based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197913A (en) * 2017-12-18 2018-06-22 深圳前海微众银行股份有限公司 Method of payment, system and computer readable storage medium based on block chain
CN108537523A (en) * 2018-04-18 2018-09-14 北京奇虎科技有限公司 Token transactions method and device based on block chain
CN108681847A (en) * 2018-08-19 2018-10-19 北京元链科技有限公司 A kind of retrospect of cold fresh food and shelf-life inquiry system based on block chain technology
CN109191003A (en) * 2018-09-25 2019-01-11 仲恺农业工程学院 Fruit and vegetable agricultural product quality safety traceability system based on block chain
CN109151526A (en) * 2018-09-30 2019-01-04 深圳市元征科技股份有限公司 A kind of video transmission method, system, equipment and computer readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879902A (en) * 2019-11-25 2020-03-13 北京工商大学 Grain, oil and food full supply chain information safety management system and method based on trusted identification and IPFS
CN110879902B (en) * 2019-11-25 2022-01-28 北京工商大学 Grain, oil and food full supply chain information safety management system and method based on trusted identification and IPFS
CN110930171A (en) * 2020-01-09 2020-03-27 烟台大学 Whole-process traceability monitoring system for ticket payment flow three-chain cross verification product security
CN111127047A (en) * 2020-01-09 2020-05-08 烟台大学 Whole-process traceability supervision method for ticket payment flow three-chain cross verification product security
CN111967991A (en) * 2020-09-08 2020-11-20 浙江大学 Communication processing method for seafood food information monitoring based on Internet of things and block chain

Similar Documents

Publication Publication Date Title
CN110400157A (en) A kind of product traceability method, apparatus and readable storage medium storing program for executing based on block chain
CN103473684B (en) A kind of bottled water anti-fake traceability system
Chen et al. A novel deployment of smart cold chain system using 2G-RFID-Sys
CN101727637B (en) Anti-counterfeit recognition system for mobile phone two-dimensional code
CN104517234B (en) Organic farm products quality tracing system
CN109034843A (en) A kind of generation method, verification method and the system of article anti-counterfeit information
CN110827042A (en) Wine source tracing and evidence storing solution system and method based on block chain
CN112163801A (en) Cargo warehouse management method and system based on block chain
CN203350906U (en) Product quality tracing anti-counterfeit label
CN107977845B (en) Food traceability system and method based on label information
CN105046459A (en) Method for warning and confirming storage and taking of bins based on electronic paper passive tags
CN104835045A (en) Method and system for merchandise anti-counterfeiting authentication based on internet of things identity service
CN201383158Y (en) Tobacco monopoly license anti-counterfeiting device and authenticating mobile terminal thereof
CN104574097A (en) Anti-fake method for wine
CN108305084A (en) A kind of bottled water traceability system Internet-based and its implementation
CN110991840A (en) Takeout platform, equipment and medium based on block chain
CN201449627U (en) Two-dimension code anti-counterfeit identification system of mobile phone
KR100524176B1 (en) Mobile phone capable of reading genuine article verifying information stored in a RF-tag and method for administrating service management executable in a computer communicating with the same phone
CN106504007A (en) A kind of commodity counterfeit prevention management system based on NFC electronic tags
CN106355416A (en) Visual tracking system based on RFID and two-dimensional code technology
CN111210239B (en) After-sales information processing method, equipment and medium
CN109770577A (en) It is a kind of based on cloud can online management intelligent consumable reagent cabinet
CN111047196A (en) Visual management and risk early warning system of supply chain product quality based on thing networking
CN110598814A (en) System is bound with two-dimensional code to real object asset
CN110377608A (en) A kind of approaches to IM based on block chain, device and readable storage medium storing program for executing

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191101