CN113538019B - Food traceability information evidence storing method and device - Google Patents

Food traceability information evidence storing method and device Download PDF

Info

Publication number
CN113538019B
CN113538019B CN202111074025.2A CN202111074025A CN113538019B CN 113538019 B CN113538019 B CN 113538019B CN 202111074025 A CN202111074025 A CN 202111074025A CN 113538019 B CN113538019 B CN 113538019B
Authority
CN
China
Prior art keywords
food
unit
operator
traceability information
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111074025.2A
Other languages
Chinese (zh)
Other versions
CN113538019A (en
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202210880412.3A priority Critical patent/CN115187272A/en
Priority to CN202111074025.2A priority patent/CN113538019B/en
Publication of CN113538019A publication Critical patent/CN113538019A/en
Application granted granted Critical
Publication of CN113538019B publication Critical patent/CN113538019B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The specification discloses a food traceability information evidence storing method and device. The method is applied to a service platform and comprises the following steps: receiving food traceability information to be stored, wherein the food traceability information comprises: a unit identification of a food sale unit; generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to a blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that the blockchain system calls a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier; under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier; and responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a blockchain system for evidence storage.

Description

Food traceability information evidence storing method and device
Technical Field
The present disclosure relates to a blockchain technology, and in particular, to a method and an apparatus for storing food traceability information.
Background
Food safety is a great basic civil problem, and the condition of tracing the food from production to sale plays an extremely important role in monitoring the food safety. Given the non-tamper-able nature of blockchain systems, more and more food traceability information is currently stored to blockchain systems.
Disclosure of Invention
In view of this, the present specification provides a food traceability information evidence storing method and apparatus.
Specifically, the specification is realized through the following technical scheme:
a food traceability information evidence storing method is used for realizing food traceability information evidence storing by combining a food traceability service platform and a block chain system, and comprises the following steps:
receiving food traceability information to be stored, wherein the food traceability information comprises: a unit identification of a food sale unit;
generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to a blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that the blockchain system calls a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier;
under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier;
and responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a blockchain system for evidence storage.
A food traceability information evidence storing method is used for realizing food traceability information evidence storing by combining a food traceability service platform and a block chain system, and comprises the following steps:
receiving an intelligent contract calling transaction sent by a service platform and used for verifying the effectiveness of a food sale unit operator, wherein the intelligent contract calling transaction is generated after the service platform receives food traceability information to be stored, the food traceability information comprises a unit identifier of a food sale unit, and the intelligent contract calling transaction comprises the unit identifier;
calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that a service platform pushes the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
receiving and executing food traceability information deposit transaction sent by a service platform so as to execute deposit operation on the food traceability information, wherein the food traceability information deposit transaction is sent by the service platform after the food selling unit operator confirms the food source information.
The utility model provides a food traceability information deposit evidence device, unites food traceability service platform and block chain system to realize food traceability information deposit evidence, the device is applied to the service platform, includes:
the traceability information acquisition unit receives food traceability information to be stored, and the food traceability information comprises: a unit identification of a food sale unit;
the system comprises an operator verification unit, a block chain system and a data processing unit, wherein the operator verification unit is used for generating an intelligent contract calling transaction used for verifying the validity of a food sale unit operator and sending the intelligent contract calling transaction to the block chain system, and the intelligent contract calling transaction comprises a unit identifier so that the block chain system can call validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier;
the operator confirmation unit is used for pushing the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes validity verification;
and the traceability information sending unit responds to the confirmation of the food traceability information by the food sale unit operator and sends the food traceability information to the block chain system for evidence storage.
The utility model provides a food traceability information deposit evidence device, unites food traceability service platform and block chain system to realize food traceability information deposit evidence, the device is applied to block chain system, includes:
the system comprises a transaction receiving unit, a service platform and a transaction processing unit, wherein the transaction receiving unit is used for receiving an intelligent contract calling transaction which is sent by the service platform and used for verifying the validity of a food selling unit operator, the intelligent contract calling transaction is generated by the service platform after food traceability information to be stored is received, the food traceability information comprises a unit identifier of a food selling unit, and the intelligent contract calling transaction comprises the unit identifier;
the contract calling unit is used for calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that the service platform can push the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
and the traceability information evidence storing unit is used for receiving and executing food traceability information evidence storing transaction sent by the service platform so as to execute evidence storing operation on the food traceability information, and the food traceability information evidence storing transaction is sent by the service platform after the food selling unit operator confirms the food source information.
A food traceability information evidence storage device comprises:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to the evidence-preserving logic of the food traceability information, the processor is caused to:
receiving food traceability information to be stored, wherein the food traceability information comprises: a unit identification of a food sale unit;
generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to a blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that the blockchain system calls a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier;
under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier;
and responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a blockchain system for evidence storage.
A food traceability information evidence storage device comprises:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to the evidence-preserving logic of the food traceability information, the processor is caused to:
receiving an intelligent contract calling transaction sent by a service platform and used for verifying the effectiveness of a food sale unit operator, wherein the intelligent contract calling transaction is generated by the service platform after food traceability information to be stored is received, the food traceability information comprises a unit identifier of a food sale unit, and the intelligent contract calling transaction comprises the unit identifier;
calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that a service platform pushes the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
receiving and executing food traceability information deposit transaction sent by a service platform so as to execute deposit operation on the food traceability information, wherein the food traceability information deposit transaction is sent by the service platform after the food selling unit operator confirms the food source information.
By adopting the embodiment, on one hand, the food traceability information can be manually collected, and for the operator of the food sale unit, the collected food traceability information can be confirmed without learning and uploading operation, so that the food traceability system is simple and convenient.
On the other hand, the food traceability service platform confirms the effectiveness of the operator of the food sale unit by means of the intelligent contract, has higher accuracy, does not need the manual confirmation of an information operator, greatly saves human resources, and can effectively solve the problem of inaccurate food traceability information caused by invalid operation protocols.
Drawings
Fig. 1 is a flowchart illustrating a food traceability information storage method according to an exemplary embodiment of the present disclosure.
Fig. 2 is a system architecture diagram of a food traceability system, according to an exemplary embodiment of the present disclosure.
Fig. 3 is a flowchart illustrating a method for certifying a food sales unit operation agreement according to an exemplary embodiment of the present disclosure.
Fig. 4 is a flow diagram illustrating a method for validating a booth operator in accordance with an exemplary embodiment of the present disclosure.
Fig. 5 is a hardware structure diagram of an electronic device where a food traceability information storage apparatus is located according to an exemplary embodiment of the present specification.
Fig. 6 is a block diagram illustrating a food traceability information storage apparatus according to an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram of another food traceability information storage apparatus according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Food safety is a great basic civil problem, and the condition of tracing the food from production to sale plays an extremely important role in monitoring the food safety. Given the non-tamper-able nature of blockchain systems, more and more food traceability information is currently stored to blockchain systems.
However, food products often pass through multiple food product distribution sites before being distributed to consumers, such as: in a primary wholesale market, a secondary wholesale market and the like, the operators in many food sales places cannot operate the uploading of food traceability information, so that the food traceability is interrupted.
The specification provides a food traceability information evidence storing scheme, which can combine a food traceability service platform and a block chain system to realize food traceability information evidence storing.
The food traceability service platform can be deployed by a food traceability service provider, a physical carrier of the food traceability service platform is usually a server or a server cluster, and the service platform can be in butt joint with the blockchain system to realize storage of food traceability information.
The blockchain system can be any type of blockchain system. In practical applications, any one of a public chain, a private chain, or a federation chain may be employed.
The food traceability information may include: food type, food quantity, production base of food, upstream procurement information of food, unit identification of current food sale unit, and the like.
The food selling unit may be a stall of a farm trade market, a shop of a shopping mall, a store beside the street, and the like, the unit identifier may identify the unique food selling unit, and may be an ID of the food selling unit, for example, a stall ID, a shop ID, a store ID, and the like.
Fig. 1 is a flowchart illustrating a food traceability information storage method according to an exemplary embodiment of the present disclosure.
Referring to fig. 1, the food source tracing information evidence storing method can be applied to a food source tracing service platform, and includes the following steps:
102, receiving food traceability information to be stored, wherein the food traceability information comprises: unit identification of food sale unit.
In this specification, the manager of the food selling unit may dispatch an informant to each food selling unit periodically to manually collect food tracing information of various foods sold by each food selling unit, and the informant may upload the collected food tracing information as food tracing information to be stored to the food tracing service platform.
And 104, generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to the blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that the blockchain system calls a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier.
After receiving food traceability information to be stored and uploaded by an information operator, the food traceability service platform can generate an intelligent contract calling transaction for verifying the effectiveness of a food sale unit operator based on unit identification included in the food traceability information, and sends the intelligent contract calling transaction to the block chain system so as to verify the effectiveness of the food sale unit operator by means of the block chain system.
For example, the blockchain system may search for an operation agreement corresponding to the unit identifier, which is certified in the blockchain system, based on the unit identifier, and then perform validity verification on the corresponding food sale unit operator based on the searched operation agreement.
And 106, under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier.
And step 108, responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a block chain system for evidence storage.
The food traceability service platform can send the collected food traceability information to the food sale unit operator under the condition that the food sale unit operator passes validity verification, and when the food sale unit operator confirms the food traceability information, the food traceability information is sent to the block chain system for storage.
And the food traceability service platform can return an error prompt to the informant and end the subsequent process under the condition that the food sale unit operator does not pass the validity verification.
By adopting the embodiment, on one hand, the food traceability information is manually collected by the information staff, and for the operator of the food sale unit, the food traceability information collected by the information staff can be confirmed without learning and uploading operation, so that the food traceability system is simple and convenient.
On the other hand, the food traceability service platform confirms the effectiveness of the operator of the food sale unit by means of the intelligent contract, the accuracy is higher, the manual confirmation of an information worker is not needed, the human resources are greatly saved, and the problem that the food traceability information is inaccurate due to the invalid operation agreement can be effectively solved.
Fig. 2 is a system architecture diagram of a food traceability system, according to an exemplary embodiment of the present disclosure.
Referring to fig. 2, the food traceability system may include an informant client, an operator client, a food traceability service platform, and a blockchain system.
The above-mentioned informant client can provide service entrances such as food traceability information uploading for APP, small programs and the like and for informants dispatched by the food sale unit manager, and the informants can upload the collected food traceability information to the food traceability service platform through the service entrances.
The operator client can also be an APP, a small program and the like, and the food traceability service platform can display the food traceability information acquired by the informant to the operator of the food sale unit through the operator client so as to be confirmed by the operator.
The block chain system is used for providing evidence storage service for the operation agreement of the food sale unit and the food traceability information. In addition, intelligent contracts can be created in advance in the block chain system, and the intelligent contracts can be used for verifying the validity of the operators of the food sales units.
Wherein an intelligent contract is a contract that can be executed on a blockchain triggered by a transaction. An intelligent contract may be defined in the form of code. The deployment method can refer to the related art, and the description is not repeated herein.
The food traceability service platform can receive food traceability information uploaded by an information person, can use the blockchain system to carry out validity verification on an operator of a food sale unit, can also send the food traceability information to the operator for confirmation, and can send the food traceability information to the blockchain system for storage after the operator confirms the food traceability information.
It should be noted that, in other embodiments, the informant client and the operator client may also interact with the blockchain system directly without going through the food traceability service platform, which is not limited in this specification.
The evidence storing scheme of the food traceability information provided by the specification is described in detail in the following by combining a specific application scenario and respectively from three aspects of operation agreement evidence storage, operation party validity verification and food traceability information confirmation by an operation party.
First, business agreement deposit certificate
In this specification, the operator can acquire the operation right of the food sales unit by purchasing or leasing, and when acquiring the operation right, the operator often needs to sign an operation agreement with the manager of the food sales unit.
Taking the example that the food selling unit is a farm trade market stall, the operator can sign an operation agreement with the management enterprise of the farm trade market. After signing the operation agreement, the management enterprise of the farmer market can send the signed operation agreement to the food traceability service platform.
Wherein, the business agreement may include: the name of the operator, the address of the operator, the identification of the booth, the validity period of the operation and the like.
In one example, when the food traceability service platform is deployed by a food traceability service provider, the management enterprises of each farmer market may be registered in the food traceability service platform in advance. After registration, the management enterprise can send the business agreement signed by the management enterprise and the business party to the food traceability service platform.
In another example, the food traceability service platform can also be deployed by a management enterprise in a farmer market, and the management enterprise can send the operation agreement signed by the management party to the food traceability service platform without registration.
The operation agreement can be signed on line, and information included in the operation agreement and the operation agreement scanning piece can be sent to the food traceability service platform after signing is finished. Of course, the operation agreement scanning piece can also be directly sent, and the food traceability service platform extracts the operation agreement information.
The above-mentioned business agreement can also finish signing on line. For example, the food traceability service platform may provide an operation agreement signing service, and the operator and the management enterprise in the farmer market may use the operation agreement signing interface provided by the food traceability service platform to complete the online signing of the operation agreement. After signing is finished, a management enterprise of the farmer market can authorize the food traceability business platform to obtain the information in the operation agreement.
In this specification, the food traceability service platform may maintain the mapping relationship between booth identifications and corresponding booth food operation agreement information as shown in table 1 below:
Figure 467083DEST_PATH_IMAGE002
TABLE 1
Table 1 is merely an exemplary illustration, and in practical applications, the food traceability service platform may not organize such a table, which is not limited in this specification.
After the operation agreement is obtained, the food traceability service platform can generate operation agreement certificate storage transaction and send the operation agreement certificate storage transaction to the block chain system certificate storage.
The operation agreement deposit certificate transaction carries the booth identification and the operation agreement corresponding to the booth. The specific form of the business agreement is not particularly limited, and the business agreement may be an image in a format such as JPG, JPGE, or the like, or a table file similar to table 1, and this specification does not particularly limit this.
In one example, the operator agreement deposit transaction is an intelligent contract invocation transaction operable to invoke operator agreement deposit logic defined in the intelligent contract to implement the booth identification and deposit of the corresponding booth operator agreement.
By calling the intelligent contract, the operation agreement can be stored in the contract account corresponding to the intelligent contract, and for example, the operation agreement can be used as a value of the contract state in the contract account.
In another example, the accreditation of the business agreement may not be implemented via the smart contract.
After the block chain system receives the operation agreement deposit-certificate transaction, the validity verification can be carried out on the operation agreement deposit-certificate transaction, after the validity verification is passed, the block chain link points in the block chain system can carry out consensus on the operation agreement deposit-certificate transaction, and after the consensus is processed, the operation agreement deposit-certificate transaction is added into the block body of the block, so that the deposit certificate of the booth identification and the operation agreement of the corresponding booth is realized, and the validity verification of an operator can be carried out in the future.
After the operation agreement certificate storage transaction is added into the block body of the block, certificate storage information such as transaction hash, block height of the block where the exchange is located and the like can be returned, and the food traceability service platform can store the mapping relation between the certificate storage information and the booth identification so as to facilitate subsequent searching.
In this specification, when the operation agreement is expired, the farmer market management enterprise may lease the booth again, and after signing a new operation agreement, the food traceability service platform may deposit a certificate of the new operation agreement to the blockchain system.
When the operation agreement is stored by the intelligent contract, the new operation agreement can be adopted to update the expired operation agreement which is already verified in the contract account.
When the accreditation of the operation agreement is not realized through the intelligent contract, the blockchain system can add the operation agreement accreditation transaction of the new operation agreement to the block body of the block.
The process of storing and updating the business agreement can refer to the implementation in the related art, and the description is not repeated herein.
Second, the validity verification of the operator
Fig. 3 is a schematic diagram of an application scenario shown in an exemplary embodiment of the present specification.
Referring to fig. 3, fig. 3 shows two booths, booth 1 and booth 2, respectively, in a farm market, where the operator of booth 1 is operator a and the operator of booth 2 is operator B. A farmer's market manager may periodically send an informant (e.g., informant C) to each booth to manually collect food traceability information for the food products sold by that booth.
For example, an informant may visit each booth in the morning to communicate with the booth operator and verbally query food traceability information each day.
After the informant collects the food traceability information, the food traceability information can be uploaded to a food traceability service platform through the informant client.
For example, the information staff uploads 1-001 catty of booth, 25 catties of cabbage, 20 catties of carrot and 20 catties of tomato to the wholesale market of farm and sideline products purchased in the market to the food source tracing service platform.
After receiving the food tracing information, the food tracing service platform can generate an intelligent contract calling transaction for verifying the effectiveness of the booth operator and send the intelligent contract calling transaction to the block chain system. The intelligent contract invocation transaction includes booth identification 1-001.
After receiving an intelligent contract invoking transaction for booth operator validity verification, the blockchain system may invoke validity verification logic defined in the intelligent contract to perform validity verification on the booth operator based on the booth identification.
Referring to fig. 4, the process of verifying the validity of the booth operator based on the booth identification may include the following steps:
step 402, finding the operating agreement of the corresponding booth based on the booth identification.
In the specification, the blockchain system may first search for an operating agreement corresponding to a booth identifier based on the booth identifier.
When an operational agreement is stored into a contract account, the corresponding operational agreement may be found in the contract account based on the booth identification.
When the operation agreement deposit certificate transaction is added into the block body of the block, the corresponding transaction hash and the block height of the block where the transaction is located can be searched based on the booth identification, then the operation agreement deposit certificate transaction stored in the block is searched based on the information, and then the operation information is extracted from the operation agreement deposit certificate transaction.
In this step, evidence storing information corresponding to the booth identification included in the intelligent contract calling transaction can be found based on the mapping relationship between evidence storing information such as transaction hash stored in the food traceability service platform, block height of a block where the transaction is located and the booth identification, and then the operation agreement corresponding to the booth identification is further found on the chain based on the found evidence storing information.
The above-mentioned search scheme of the business agreement may refer to the implementation manner in the related art, and this description is not repeated herein.
Still taking the operation agreement shown in table 1 as an example, based on the booth identifications 1-001, the operation agreement information corresponding to the booth can be found to be the operator a, and the validity period is 2021 year, 4 month, 30 days, and the like.
Step 404, determine whether the business agreement is valid.
Based on the operation agreement found in the previous step 402, it can be determined whether the operation agreement is valid, for example, whether the operation agreement is within the valid period.
If the business agreement is valid during the validity period, the business agreement may be determined to be valid. For example, if the time for the blockchain system to invoke the validity verification logic defined in the intelligent contract is 2020, 7, and 28 days, then the date is before the operation agreement validity period 2021, 4, and 30 days, it may be determined that the operation agreement is valid.
If not, the business agreement may be determined to be invalid. For example, the time when the blockchain system invokes the validity verification logic defined in the intelligent contract is 2021, 5, and 2 days, and the date is after the business agreement validity period 2021, 4, and 30 days, it may be determined that the business agreement is invalid.
Step 406, determining that the booth operator passes validation if the business agreement is valid.
Based on the verification result of the previous step 404, it can be determined that the booth operator passes the validity verification in case the business agreement is valid.
In this specification, a transaction receipt containing a validation result is generally generated after calling the validation logic defined in the smart contract. The transaction receipt contains events (events), each of which contains a subject (topic) and data (data). After the availability of the booth operator is verified and the availability verification result is obtained, the availability verification result can be stored in the data of the event to which the specified subject belongs in the transaction receipt. The food tracing service platform can find the corresponding event through the specified theme and then acquire the validity verification result from the data of the event.
In the specification, after the food traceability service platform receives the food traceability information, the validity of the booth operator can be verified by means of the block chain system, the accuracy is higher, an informant is not required to verify the validity of the operator, the human resources are greatly saved, and the problems of inaccurate food traceability information and the like caused by invalid operation protocols can be effectively solved.
For example, suppose operator a of booth 1 and the farmer market management company have signed a lease agreement with a valid period of 2021, 4 months and 30 days. After expiration of the 30-day business agreement at 4 months 2021, operator a withdraws from booth 1, and booth 1 has not yet been leased to other operators.
When the operator D sees the booth 1 empty, the operator can sell the food on the booth 1 by means of the machine. The informant collects food traceability information of the booth 1 in 2021, 5 months and 1 days, uploads the food traceability information to the food traceability service platform, the food traceability service platform further generates an intelligent contract calling transaction and sends the intelligent contract calling transaction to the blockchain system, and the blockchain system finds out that the operating agreement validity period of the booth 1 is 2021, 4 months and 30 days, and the operator is overdue, so that the operator of the booth 1 can be determined to be invalid.
After monitoring the invalid validity verification result of the operator, the food traceability service platform cannot execute the subsequent steps, namely, the collected food traceability information of the booth 1 cannot be stored, and the problem of inaccurate food traceability information caused by invalid operation agreement can be effectively solved.
In other examples of this specification, the intelligent contract invoking transaction generated by the food traceability service platform may further include information such as a name and an address of the operator, so that the validity verification logic may further verify whether the information such as the name and the address of the operator in the intelligent contract invoking transaction is consistent with the operation agreement, and may determine that the operator passes the validity verification in the case of consistency. When there is inconsistent business agreement information, it may be determined that the business party has not passed the validity verification.
Third, the confirmation of the food tracing information by the operator
In this specification, when the booth operator passes the validity verification, the food traceability service platform may push the food traceability information to the operator for confirmation based on the booth identifier. After the food traceability information is confirmed by the booth operator, the food traceability service platform can be combined with the block chain system to realize the storage of the food traceability information. If the food traceability information is not confirmed by the booth operator, the food traceability service platform cannot execute the storage of the food traceability information in order to ensure that the food traceability information is accurate.
For example, since the informant is to collect the food traceability information on line, if the mouth sound of the booth operator is serious, the food traceability information may be collected incorrectly, for example, the informant may listen to the cabbage as the cabbage. Even if the food traceability information acquired by the informant on line is correct, the wrong food traceability information can be uploaded carelessly when the food traceability information is uploaded to the food traceability service platform.
In this specification, after signing an operation agreement with a management enterprise in a farmer market, a booth operator may register in a food traceability service platform to obtain an operator account on the food traceability service platform. Of course, if the operator has registered the operator account in the food traceability service platform, the operator account can be bound with the operation agreement. For the food traceability service platform, on the basis of table 1, it can maintain the mapping relationship among the booth identification, the operator account and the operation agreement information shown in table 2.
Figure 725502DEST_PATH_IMAGE004
TABLE 2
The food traceability service platform can search the account number of the booth operator based on the booth identification under the condition that the booth operator passes the validity verification, and then push the food traceability information uploaded by the informant to the operator based on the account number of the booth operator.
Still taking the example that the informant collects 1-001 of the booth, 25 jin of the Chinese cabbage, 20 jin of the carrot, 20 jin of the tomato and 20 jin of the bought farm and sideline product wholesale market, the food traceability service platform finds that the account number of the operator corresponding to the booth 1-001 is 12345, and then can push the food traceability information collected by the informant to the account number.
The operator A can check the food traceability information after logging in the operator account at the operator client, then confirm whether the food traceability information is wrong, and can return a confirmation message to the food traceability service platform after confirming that the food traceability information is correct.
When the operator A finds that the food traceability information is wrong, for example, the carrot is actually 25 jin, the food traceability information can be modified through the operator client. For example, the operator client may provide a modification control in the food traceability information display page, the operator a may trigger the modification of the food traceability information through the modification control, and after the modification is completed, the modified food traceability information may be uploaded to the food traceability service platform, so that the food traceability service platform can store the modified food traceability information.
The food traceability service platform further pushes food traceability information to a booth operator for confirmation under the condition that the booth operator passes validity verification, and can combine a block chain system to realize food traceability information storage under the condition that the food traceability information is confirmed by the operator, so that the problems of inaccurate acquisition and inaccurate food traceability information storage caused by uploading errors of an informant and the like can be effectively solved, and the accuracy of the stored food traceability information is improved, so that accurate traceability can be performed later.
In this specification, when the food traceability service platform pushes food traceability information to a booth operator, the security of the food traceability information confirmation process can be further improved by means of a cryptography technology.
In this specification, the food traceability service platform may generate a key pair for the booth operator to encrypt and decrypt the food traceability information. For example, the food traceability business platform may generate the key pair after receiving an operation agreement signed by the booth operator and the farmer market management enterprise. The key pair may include an encryption key and a decryption key. When a symmetric encryption algorithm is employed, the encryption key and the decryption key are the same. When an asymmetric encryption algorithm is adopted, the encryption key and the decryption key are different, for example, the food tracing service platform may generate a public key and a private key as a key pair.
Taking the food traceability service platform as an example of generating a public key and a private key as a key pair for a booth operator, the food traceability service platform can store the mapping relationship between the operator and the key pair.
Figure DEST_PATH_IMAGE005
TABLE 3
Referring to the example in table 3, the key pair generated by the food traceability service platform for the operator a is the public key 1 and the private key 1, and the key pair generated for the operator B is the public key 2 and the private key 2.
Table 3 is also only an exemplary illustration, and in other examples, the food traceability service platform may also store the mapping relationship between the operator and the key pair thereof together with the business agreement of the operator, which is not limited in this specification.
After the food traceability service platform generates a public key and a private key for the booth operator, the private key can be sent to the operator client for storage.
In one example, before pushing the food tracing information, the food tracing service platform may encrypt the food tracing information by using the operator public key, and then push the encrypted food tracing information to the operator client.
The encrypted food traceability information is a ciphertext, the operator client decrypts the encrypted food traceability information by using a stored private key after receiving the encrypted food traceability information to obtain plaintext food traceability information, and then the plaintext food traceability information is displayed in the operator client for the operator to confirm.
Still taking the example that the informant collects 1-001 of the booth, 25 jin of Chinese cabbage, 20 jin of carrot, 20 jin of tomato and 20 jin of purchased farm and sideline product wholesale market, under the condition that the block chain system confirms that the operator A of the booth 1 passes the validity verification, the public key 1 of the operator A can be used for encrypting the food traceability information to obtain encrypted food traceability information, and then the encrypted food traceability information is pushed to the operator client registered by the operator A.
After receiving the encrypted food traceability information, the client of the operator A can decrypt the encrypted food traceability information by using the stored private key 1 to obtain the food traceability information of the plaintext, and then displays the food traceability information of the plaintext for the operator A to confirm.
Under normal conditions, if the booth 1 is actually operated by the operator a, the operator a can confirm the food traceability information pushed by the operator client.
It is assumed that the operator E actually sells the food at the booth 1, and after receiving the pushed food traceability information through the client, the operator a finds that the food is not sold, and may not confirm the food traceability information. On the other hand, for the actual operator E of the booth 1, since the actual operator E does not sign an operation agreement with the farmer market management enterprise, the food traceability service platform does not push the food traceability information to the operator E, and the operator E cannot confirm the food traceability information. Even if the operator E obtains the food traceability information through some technical means, the client of the operator E cannot encrypt and decrypt the food traceability information and further cannot normally display the encrypted food traceability information because the private key 1 of the operator a is not stored in the client of the operator E, and the operator E cannot confirm the encrypted food traceability information.
In another example, the food traceability service platform can normally push food traceability information, after the operator a confirms the food traceability information, the operator client can sign the food traceability information confirmation result by using a private key, then return the signed food traceability information confirmation result to the food traceability service platform, the food traceability service platform further searches a public key 1 corresponding to the operator a, then verifies the signed food traceability information confirmation result by using the public key 1, after the verification is passed, it can be determined that the food traceability confirmation result is not tampered, and then the subsequent steps are executed according to the food traceability confirmation result.
For example, when the food tracing confirmation result is confirmation, the evidence storing operation can be executed on the food tracing information; and when the food tracing confirmation result is negative confirmation, the evidence storing operation of the food tracing information is not executed.
In the embodiment, the key pair is generated for the operator, so that data tampering in the process of confirming the food traceability information can be effectively prevented, and on the other hand, only the operator signing the operation agreement can confirm the food traceability information, and the problems of inaccurate food traceability information and the like caused by the change of the operator can be effectively solved.
Optionally, in other examples, the food traceability service platform may further set an expiration date for the key pair based on the expiration date of the corresponding operation agreement, and the expiration date of the key pair may be the same as the expiration date of the operation agreement.
Before the food tracing service platform encrypts the food tracing information by using the public key 1, whether the public key 1 is valid or not can be judged based on the validity period of the public key 1.
When the public key 1 is valid, namely the time for executing the judgment operation does not reach the valid period of the public key 1, the public key 1 can be adopted to encrypt the food traceability information;
when the public key 1 is invalid, that is, the time for performing the present judgment operation has exceeded the validity period of the public key 1, an error prompt may be returned to the informant.
Similarly, before signing the confirmation result of the food traceability information of the operator a, the operator client may also determine whether the private 1 is valid.
When the private key 1 is valid, namely the time for executing the judgment operation does not reach the validity period of the private key 1, the private key 1 can be adopted to sign the confirmation result of the food traceability information;
when the private key 1 is invalid, namely the time for executing the judgment operation exceeds the validity period of the private key 1, an error prompt can be returned to the operator A.
By setting the validity period of the key pair to be the same as the validity period of the operation agreement, the food traceability information encryption and/or the signature operation of the food traceability information confirmation result can be executed when the key pair is in the validity period, and the accuracy of the food traceability information confirmation can be further improved.
In this specification, after the operator confirms the food traceability information, the food traceability service platform may send the food traceability information to the blockchain system for deposit, for example, the food traceability service platform may send a food traceability information deposit transaction to the blockchain system.
Similar to the operation agreement deposit evidence, the food traceability information deposit evidence transaction can be an intelligent contract calling transaction, and food traceability information deposit evidence can be realized by calling food traceability information deposit evidence logic defined in an intelligent contract.
The intelligent contract for verifying the effectiveness of the booth operator is a first intelligent contract, and the food traceability information evidence storing logic for storing the food traceability information can be logic in the first intelligent contract, namely the first intelligent contract comprises two logics, namely the effectiveness verifying logic and the food traceability information evidence storing logic.
The food traceability information evidence storing logic for storing the food traceability information may not be the logic in the first intelligent contract, for example, the food traceability information evidence storing logic is the evidence storing logic in the second or third intelligent contract, and the description does not specially limit this.
Optionally, the food source tracing information may be stored without an intelligent contract. After food traceability information deposit transaction is received, legality verification can be carried out on the food traceability information deposit transaction, after the legality verification is passed, the food traceability information deposit transaction is identified by the block chain link points in the block chain system, and the food traceability information deposit transaction can be added into the block body of the block after the identification processing, so that the food traceability information deposit transaction is realized.
In other examples, food traceability information can be stored through a callback of an intelligent contract.
For example, an intelligent contract for verifying the validity of an operator may provide a callback interface, and when performing a food traceability information storage operation, the food traceability service platform may initiate a callback transaction that calls the callback interface as a food traceability information storage transaction, where the callback transaction may include the food traceability information.
After the callback interface is called, the block chain system can call food traceability information evidence storage logic defined in an intelligent contract for verifying the validity of the operator to store the food traceability information.
The intelligent contract used for verifying the availability of the booth operator is still the first intelligent contract, and the food traceability information storage logic is the logic in the first intelligent contract in this example.
The embodiment adopts the intelligent contract callback interface to realize the evidence storage of the food tracing information, can realize the food tracing information and the operation agreement correlation evidence storage, and is convenient for subsequent inquiry.
It can be seen from the above description that, adopting the above farm product market food traceability information storage implementation mode, on the one hand, by the artifical food traceability information of gathering of information person, to the stall management side, confirm the food traceability information that information person gathered can, need not to learn the operation of uploading, simple convenient.
On the other hand, the food traceability service platform confirms the effectiveness of the booth operator by means of an intelligent contract, the accuracy is higher, the manual confirmation of an information operator is not needed, the human resources are greatly saved, and the problem that the food traceability information is inaccurate due to the invalidation of the operation agreement can be effectively solved.
Corresponding to the embodiment of the food traceability information evidence storing method, the specification also provides an embodiment of a food traceability information evidence storing device.
The embodiments of the evidence storing device for food traceability information in the specification can be respectively applied to a food traceability service platform and a block chain system. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. In terms of hardware, as shown in fig. 5, the hardware structure diagram of the electronic device where the food traceability information storage apparatus is located in this specification is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 5, the electronic device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the electronic device, which is not described again.
Fig. 6 is a block diagram illustrating a food traceability information storage apparatus according to an exemplary embodiment of the present disclosure.
Referring to fig. 6, the food traceability information storing device 600 can be applied to an electronic device deployed in a food traceability service platform, and includes: a traceability information acquisition unit 601, an operator verification unit 602, an operator confirmation unit 603, a traceability information transmission unit 604, an operation agreement transmission unit 605, and a key generation unit 606.
Wherein, the information acquisition unit 601 of tracing to the source receives the food information of tracing to the source of waiting to deposit the certificate, the food information of tracing to the source includes: a unit identifier of a food sale unit;
the operation party verification unit 602 is configured to generate an intelligent contract invoking transaction for verifying the validity of the food sale unit operation party, and send the intelligent contract invoking transaction to the blockchain system, where the intelligent contract invoking transaction includes the unit identifier, so that the blockchain system invokes a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operation party based on the unit identifier;
the operator confirmation unit 603 is used for pushing the food traceability information to the food sales unit operator based on the unit identifier under the condition that the food sales unit operator passes validity verification;
the traceability information sending unit 604 is configured to send the food traceability information to the blockchain system for evidence storage in response to the confirmation of the food marketing unit operator on the food traceability information.
Optionally, the tracing information sending unit 604:
and initiating a callback transaction for calling a callback interface of the intelligent contract to the blockchain system, wherein the callback transaction comprises the food traceability information, so that the blockchain system calls a food traceability information evidence storage logic defined in the intelligent contract to store the food traceability information.
Optionally, the operation agreement sending unit 605 generates an operation agreement deposit transaction, where the operation agreement deposit transaction carries the unit identifier and the operation agreement corresponding to the food sale unit; sending the operation agreement deposit transaction to a block chain system for the block chain system to deposit the unit identification and the operation agreement corresponding to the food sale unit;
the operator verification unit 602:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
Optionally, the key generating unit 606 generates a key pair for the operator, where the key pair includes an encryption key and a decryption key; pushing the decryption key to the electronic equipment logged by the operator for storage;
the operator confirmation unit 603:
and encrypting the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier, and pushing the encrypted food tracing information to the electronic equipment logged by the operator so that the electronic equipment can decrypt and display the encrypted food tracing information by adopting the stored decryption key.
Optionally, the key generating unit 606 sets a validity period for the key pair, where the validity period of the key pair is the same as the validity period of the operation agreement;
the operator confirmation unit 603:
searching an encryption key of the operator corresponding to the unit identifier;
judging whether the encryption key is valid or not based on the validity period of the encryption key;
and under the condition that the encryption key is effective, encrypting the food traceability information by adopting the encryption key.
Fig. 7 is a block diagram of another food traceability information storage apparatus according to an exemplary embodiment of the present disclosure.
Referring to fig. 7, the food source tracing information evidence storing apparatus can be applied to a blockchain node deployed in a blockchain system, and includes: a transaction receiving unit 701, a contract calling unit 702, a tracing information evidence storing unit 703 and an operation agreement evidence storing unit 704.
The transaction receiving unit 701 receives an intelligent contract calling transaction which is sent by a service platform and used for verifying the validity of a food selling unit operator, wherein the intelligent contract calling transaction is generated by the service platform after food traceability information to be stored is received, the food traceability information comprises a unit identifier of a food selling unit, and the intelligent contract calling transaction comprises the unit identifier;
the contract calling unit 702 is used for calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier, so that the service platform pushes the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
the traceability information evidence storing unit 703 is configured to receive and execute food traceability information evidence storing transaction sent by the service platform, so as to execute evidence storing operation on the food traceability information, and the food traceability information evidence storing transaction is sent by the service platform after the food selling unit operator confirms the food source information.
Optionally, the food traceability information evidence storing transaction is a callback transaction of calling a callback interface of the intelligent contract, and the traceability information evidence storing unit 703:
and when the callback interface is called, calling the evidence storage logic defined in the intelligent contract to store the food tracing information.
Optionally, the operation agreement deposit-certification unit 704 receives an operation agreement deposit-certification transaction sent by the service platform, where the operation agreement deposit-certification transaction carries the unit identifier and the operation agreement corresponding to the food sale unit; the unit identification and the operation agreement corresponding to the food sale unit are stored;
the contract invoking unit 702:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
The specific details of the implementation process of the functions and actions of each unit in the above device are the implementation processes of the corresponding steps in the above method, and are not described herein again.
For the device embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the present specification. One of ordinary skill in the art can understand and implement without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the embodiment of the aforementioned food traceability information evidence storing method, the present specification further provides a food traceability information evidence storing device, which includes: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, by reading and executing machine executable instructions stored by the memory that correspond to the evidence storage logic of the food tracing information, the processor is caused to:
receiving food traceability information to be stored, wherein the food traceability information comprises: a unit identification of a food sale unit;
generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to a blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that the blockchain system calls a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier;
under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier;
and responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a blockchain system for evidence storage.
Optionally, the sending the food traceability information to a block chain system for storage includes:
and initiating a callback transaction for calling a callback interface of the intelligent contract to the blockchain system, wherein the callback transaction comprises the food traceability information, so that the blockchain system calls a food traceability information evidence storage logic defined in the intelligent contract to store the food traceability information.
Optionally, the method further includes:
generating an operation agreement deposit transaction, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to the food sale unit;
sending the operation agreement deposit transaction to a block chain system for the block chain system to deposit the unit identification and the operation agreement corresponding to the food sale unit;
the validity verification of the food sale unit operator based on the unit identifier comprises the following steps:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
Optionally, the method further includes:
generating a key pair for the operator, the key pair comprising an encryption key and a decryption key;
pushing the decryption key to the electronic equipment logged by the operator for storage;
the pushing the food source information to the food selling unit operator based on the unit identifier comprises:
and encrypting the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier, and pushing the encrypted food tracing information to the electronic equipment logged by the operator so that the electronic equipment can decrypt and display the encrypted food tracing information by adopting the stored decryption key.
Optionally, the method further includes:
setting a validity period for the key pair, wherein the validity period of the key pair is the same as the validity period of the operation agreement;
the encrypting the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier comprises the following steps:
searching an encryption key of the operator corresponding to the unit identifier;
judging whether the encryption key is valid or not based on the validity period of the encryption key;
and under the condition that the encryption key is effective, encrypting the food traceability information by adopting the encryption key.
Corresponding to the embodiment of the aforementioned food traceability information evidence storing method, the present specification further provides a food traceability information evidence storing device, which includes: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, by reading and executing machine executable instructions stored by the memory that correspond to the evidence storage logic of the food tracing information, the processor is caused to:
receiving an intelligent contract calling transaction sent by a service platform and used for verifying the effectiveness of a food sale unit operator, wherein the intelligent contract calling transaction is generated by the service platform after food traceability information to be stored is received, the food traceability information comprises a unit identifier of a food sale unit, and the intelligent contract calling transaction comprises the unit identifier;
calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that a service platform pushes the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
receiving and executing food traceability information deposit transaction sent by a service platform so as to execute deposit operation on the food traceability information, wherein the food traceability information deposit transaction is sent by the service platform after the food selling unit operator confirms the food source information.
Optionally, the food traceability information deposit transaction is a callback transaction of calling a callback interface of the intelligent contract, and the food traceability information deposit transaction sent by the execution management platform includes:
and when the callback interface is called, calling the evidence storage logic defined in the intelligent contract to store the food tracing information.
Optionally, the method further includes:
receiving an operation agreement deposit transaction sent by a service platform, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to a food sale unit;
the unit identification and the operation agreement corresponding to the food sale unit are stored;
the verifying the validity of the food sale unit operator based on the unit identifier comprises:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
In correspondence with the foregoing embodiments of the food traceability information verification method, the present specification further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps:
receiving food traceability information to be stored, wherein the food traceability information comprises: a unit identification of a food sale unit;
generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to a blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that the blockchain system calls a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier;
under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier;
and responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a blockchain system for evidence storage.
Optionally, the sending the food traceability information to a block chain system for storage includes:
and initiating a callback transaction for calling a callback interface of the intelligent contract to a blockchain system, wherein the callback transaction comprises the food traceability information, so that the blockchain system calls food traceability information storage logic defined in the intelligent contract to store the food traceability information.
Optionally, the method further includes:
generating an operation agreement deposit transaction, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to the food sale unit;
sending the operation agreement deposit transaction to a block chain system for the block chain system to deposit the unit identification and the operation agreement corresponding to the food sale unit;
the verifying the validity of the food sale unit operator based on the unit identifier comprises the following steps:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
Optionally, the method further includes:
generating a key pair for the operator, the key pair comprising an encryption key and a decryption key;
pushing the decryption key to the electronic equipment logged by the operator for storage;
the pushing the food source information to the food selling unit operator based on the unit identifier comprises:
and encrypting the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier, and pushing the encrypted food tracing information to the electronic equipment logged by the operator so that the electronic equipment can decrypt and display the encrypted food tracing information by adopting the stored decryption key.
Optionally, the method further includes:
setting a validity period for the key pair, wherein the validity period of the key pair is the same as the validity period of the operation agreement;
the encryption of the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier comprises the following steps:
searching an encryption key of the operator corresponding to the unit identifier;
judging whether the encryption key is valid or not based on the validity period of the encryption key;
and under the condition that the encryption key is effective, encrypting the food traceability information by adopting the encryption key.
In correspondence with the foregoing embodiments of the food traceability information verification method, the present specification further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps:
receiving an intelligent contract calling transaction sent by a service platform and used for verifying the effectiveness of a food sale unit operator, wherein the intelligent contract calling transaction is generated by the service platform after food traceability information to be stored is received, the food traceability information comprises a unit identifier of a food sale unit, and the intelligent contract calling transaction comprises the unit identifier;
calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that a service platform pushes the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
receiving and executing food traceability information deposit transaction sent by a service platform so as to execute deposit operation on the food traceability information, wherein the food traceability information deposit transaction is sent by the service platform after the food selling unit operator confirms the food source information.
Optionally, the food traceability information deposit transaction is a callback transaction of calling a callback interface of the intelligent contract, and the food traceability information deposit transaction sent by the execution management platform includes:
and when the callback interface is called, calling the evidence storage logic defined in the intelligent contract to store the food tracing information.
Optionally, the method further includes:
receiving an operation agreement deposit transaction sent by a service platform, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to a food sale unit;
the unit identification and the operation agreement corresponding to the food sale unit are stored;
the verifying the validity of the food sale unit operator based on the unit identifier comprises:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (14)

1. A method for storing food traceability information is used for realizing the storage of the food traceability information by combining a food traceability service platform and a block chain system, and is applied to the service platform, and comprises the following steps:
receiving food traceability information to be stored, wherein the food traceability information comprises: the unit identification of the food sale unit, wherein the uploading party of the food traceability information is different from the food sale unit operator;
generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to a blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that the blockchain system calls a validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier;
under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier;
responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a blockchain system for storing a certificate;
the method further comprises the following steps:
generating an operation agreement deposit transaction, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to the food sale unit;
sending the operation agreement deposit transaction to a block chain system for the block chain system to deposit the unit identification and the operation agreement corresponding to the food sale unit;
the verifying the validity of the food sale unit operator based on the unit identifier comprises the following steps:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
2. The method of claim 1, wherein sending the food traceability information to a blockchain system warranty comprises:
and initiating a callback transaction for calling a callback interface of the intelligent contract to the blockchain system, wherein the callback transaction comprises the food traceability information, so that the blockchain system calls a food traceability information evidence storage logic defined in the intelligent contract to store the food traceability information.
3. The method of claim 1, further comprising:
generating a key pair for the operator, the key pair comprising an encryption key and a decryption key;
pushing the decryption key to the electronic equipment logged by the operator for storage;
the pushing the food source information to the food selling unit operator based on the unit identifier comprises:
and encrypting the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier, and pushing the encrypted food tracing information to the electronic equipment logged by the operator so that the electronic equipment decrypts the encrypted food tracing information by adopting the stored decryption key and displays the decrypted food tracing information.
4. The method of claim 3, further comprising:
setting a validity period for the key pair, wherein the validity period of the key pair is the same as the validity period of the operation agreement;
the encrypting the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier comprises the following steps:
searching an encryption key of the operator corresponding to the unit identifier;
judging whether the encryption key is valid or not based on the validity period of the encryption key;
and under the condition that the encryption key is effective, encrypting the food traceability information by adopting the encryption key.
5. A food traceability information evidence storing method is used for realizing food traceability information evidence storing by combining a food traceability service platform and a block chain system, and comprises the following steps:
receiving an intelligent contract calling transaction which is sent by a service platform and used for verifying the effectiveness of a food sale unit operator, wherein the intelligent contract calling transaction is generated by the service platform after receiving food traceability information to be verified, an uploading party of the food traceability information is different from the food sale unit operator, the food traceability information comprises a unit identifier of a food sale unit, and the intelligent contract calling transaction comprises the unit identifier;
calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that a service platform pushes the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
receiving and executing food traceability information deposit transaction sent by a service platform so as to execute deposit operation on the food traceability information, wherein the food traceability information deposit transaction is sent by the service platform after the food selling unit operator confirms the food source information;
the method further comprises the following steps:
receiving an operation agreement deposit transaction sent by a service platform, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to a food sale unit;
the unit identification and the operation agreement corresponding to the food sale unit are stored;
the verifying the validity of the food sale unit operator based on the unit identifier comprises:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
6. The method of claim 5, wherein the food traceability information warranty transaction is a callback transaction of calling a callback interface of the intelligent contract, and the food traceability information warranty transaction sent by the execution service platform comprises:
and when the callback interface is called, calling the evidence storage logic defined in the intelligent contract to store the food tracing information.
7. The utility model provides a food traceability information deposit evidence device, unites food traceability service platform and block chain system to realize food traceability information deposit evidence, the device is applied to the service platform, includes:
the traceability information acquisition unit receives food traceability information to be stored, and the food traceability information comprises: the unit identification of the food sale unit, wherein the uploading party of the food traceability information is different from the food sale unit operator;
the system comprises an operator verification unit, a block chain system and a data processing unit, wherein the operator verification unit is used for generating an intelligent contract calling transaction used for verifying the validity of a food sale unit operator and sending the intelligent contract calling transaction to the block chain system, and the intelligent contract calling transaction comprises a unit identifier so that the block chain system can call validity verification logic defined in the intelligent contract to verify the validity of the food sale unit operator based on the unit identifier;
the operator confirmation unit is used for pushing the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes validity verification;
the traceability information sending unit responds to the confirmation of the food traceability information by the food sale unit operator and sends the food traceability information to the block chain system for deposit;
the operation agreement sending unit is used for generating operation agreement deposit and certificate transaction, and the operation agreement deposit and certificate transaction carries unit identification and an operation agreement corresponding to the food sale unit; sending the operation agreement deposit transaction to a block chain system for the block chain system to deposit the unit identification and the operation agreement corresponding to the food sale unit;
the operator verification unit:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
8. The apparatus of claim 7, wherein the tracing information sending unit:
and initiating a callback transaction for calling a callback interface of the intelligent contract to the blockchain system, wherein the callback transaction comprises the food traceability information, so that the blockchain system calls a food traceability information evidence storage logic defined in the intelligent contract to store the food traceability information.
9. The apparatus of claim 7, further comprising:
a key generation unit which generates a key pair for the operator, wherein the key pair comprises an encryption key and a decryption key; pushing the decryption key to the electronic equipment logged by the operator for storage;
the operator confirmation unit:
and encrypting the food tracing information by adopting the encryption key of the operator corresponding to the unit identifier, and pushing the encrypted food tracing information to the electronic equipment logged by the operator so that the electronic equipment can decrypt and display the encrypted food tracing information by adopting the stored decryption key.
10. The apparatus of claim 9, wherein the first and second electrodes are disposed on opposite sides of the substrate,
the key generation unit is used for setting a validity period for the key pair, and the validity period of the key pair is the same as the validity period of the operation protocol;
the operator confirmation unit:
searching an encryption key of the operator corresponding to the unit identifier;
judging whether the encryption key is valid or not based on the validity period of the encryption key;
and under the condition that the encryption key is effective, encrypting the food traceability information by adopting the encryption key.
11. The utility model provides a food traceability information deposit evidence device, unites food traceability service platform and block chain system to realize food traceability information deposit evidence, the device is applied to block chain system, includes:
the contract receiving unit is used for receiving intelligent contract calling transactions which are sent by the service platform and used for verifying the validity of the food selling unit operator, the intelligent contract calling transactions are generated after the service platform receives food traceability information to be stored, the uploading party of the food traceability information is different from the food selling unit operator, the food traceability information comprises unit identification of the food selling unit, and the intelligent contract calling transactions comprise the unit identification;
the contract calling unit is used for calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that the service platform can push the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
the traceability information evidence storing unit is used for receiving and executing food traceability information evidence storing transaction sent by the service platform so as to execute evidence storing operation on the food traceability information, and the food traceability information evidence storing transaction is sent by the service platform after the food selling unit operator confirms the food source information;
the operation agreement deposit-certificate unit is used for receiving the operation agreement deposit-certificate transaction sent by the service platform, wherein the operation agreement deposit-certificate transaction carries the unit identification and the operation agreement corresponding to the food sale unit; the unit identification and the operation agreement corresponding to the food sale unit are stored;
the contract invoking unit:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
12. The apparatus of claim 11, wherein the food traceability information vouching transaction is a callback transaction that invokes a callback interface of the intelligent contract, and the traceability information vouching unit:
and when the callback interface is called, calling the evidence storage logic defined in the intelligent contract to store the food tracing information.
13. The utility model provides a deposit card device of food traceability information, includes:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to the evidence-preserving logic of the food traceability information, the processor is caused to:
receiving food traceability information to be stored, wherein the food traceability information comprises: the unit identification of the food sale unit, wherein the uploading party of the food traceability information is different from the food sale unit operator;
generating an intelligent contract calling transaction for verifying the validity of the food sale unit operator, and sending the intelligent contract calling transaction to a blockchain system, wherein the intelligent contract calling transaction comprises the unit identifier so that validity verification logic defined in the blockchain system calling the intelligent contract can verify the validity of the food sale unit operator based on the unit identifier;
under the condition that the food sale unit operator passes validity verification, pushing the food traceability information to the food sale unit operator based on the unit identifier;
responding to the confirmation of the food selling unit operator to the food tracing information, and sending the food tracing information to a blockchain system for storing a certificate;
further comprising:
generating an operation agreement deposit transaction, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to the food sale unit;
sending the operation agreement deposit transaction to a block chain system for the block chain system to deposit the unit identification and the operation agreement corresponding to the food sale unit;
the verifying the validity of the food sale unit operator based on the unit identifier comprises the following steps:
searching for a business agreement corresponding to the food sale unit based on the unit identifier;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
14. A food traceability information evidence storage device comprises:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to the evidence-preserving logic of the food traceability information, the processor is caused to:
receiving an intelligent contract calling transaction which is sent by a service platform and used for verifying the effectiveness of a food sale unit operator, wherein the intelligent contract calling transaction is generated by the service platform after receiving food traceability information to be verified, an uploading party of the food traceability information is different from the food sale unit operator, the food traceability information comprises a unit identifier of a food sale unit, and the intelligent contract calling transaction comprises the unit identifier;
calling validity verification logic defined in the intelligent contract to carry out validity verification on the food sale unit operator based on the unit identifier so that a service platform pushes the food traceability information to the food sale unit operator based on the unit identifier under the condition that the food sale unit operator passes the validity verification;
receiving and executing food traceability information deposit transaction sent by a service platform so as to execute deposit operation on the food traceability information, wherein the food traceability information deposit transaction is sent by the service platform after the food selling unit operator confirms the food source information;
further comprising:
receiving an operation agreement deposit transaction sent by a service platform, wherein the operation agreement deposit transaction carries a unit identifier and an operation agreement corresponding to a food sale unit;
the unit identification and the operation agreement corresponding to the food sale unit are stored;
the verifying the validity of the food sale unit operator based on the unit identifier comprises:
searching for a corresponding food sale unit operation agreement based on the unit identification;
judging whether the operation agreement is effective or not;
and determining that the food sale unit operator passes validity verification in the case that the operation agreement is valid.
CN202111074025.2A 2021-09-14 2021-09-14 Food traceability information evidence storing method and device Active CN113538019B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210880412.3A CN115187272A (en) 2021-09-14 2021-09-14 Food traceability information evidence storing method and device
CN202111074025.2A CN113538019B (en) 2021-09-14 2021-09-14 Food traceability information evidence storing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111074025.2A CN113538019B (en) 2021-09-14 2021-09-14 Food traceability information evidence storing method and device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210880412.3A Division CN115187272A (en) 2021-09-14 2021-09-14 Food traceability information evidence storing method and device

Publications (2)

Publication Number Publication Date
CN113538019A CN113538019A (en) 2021-10-22
CN113538019B true CN113538019B (en) 2022-06-07

Family

ID=78092509

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202111074025.2A Active CN113538019B (en) 2021-09-14 2021-09-14 Food traceability information evidence storing method and device
CN202210880412.3A Pending CN115187272A (en) 2021-09-14 2021-09-14 Food traceability information evidence storing method and device

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210880412.3A Pending CN115187272A (en) 2021-09-14 2021-09-14 Food traceability information evidence storing method and device

Country Status (1)

Country Link
CN (2) CN113538019B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114448694B (en) * 2022-01-24 2024-04-09 蚂蚁区块链科技(上海)有限公司 Service calling method and device based on block chain

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110807641A (en) * 2018-08-01 2020-02-18 隽名有限公司 Pet food traceability system
CN110516965A (en) * 2019-08-27 2019-11-29 北京工商大学 The credible retrospect model of oil and foodstuffs full supply chain and construction method based on block chain
CN111415170A (en) * 2019-11-21 2020-07-14 山东爱城市网信息技术有限公司 Block chain-based food tracing method and equipment and related storage medium
CN113094365A (en) * 2021-04-02 2021-07-09 北京大学 Food safety tracing system, method and equipment and readable storage medium

Also Published As

Publication number Publication date
CN113538019A (en) 2021-10-22
CN115187272A (en) 2022-10-14

Similar Documents

Publication Publication Date Title
CN109462588B (en) Decentralized data transaction method and system based on block chain
CN110473105B (en) Block chain transaction settlement method, system and related equipment
CN109819443B (en) Registration authentication method, device and system based on block chain
CN110505046B (en) Multi-data provider encrypted data cross-platform zero-knowledge verification method, device and medium
CN111492634A (en) Secure and confidential custody transaction systems, methods, and apparatus using zero-knowledge protocols
AU2020272058A1 (en) Systems, devices, and methods for DLT-based data management platforms and data products
CN110839029B (en) Micro-service registration method and device
CN109495592A (en) Data collaborative method and electronic equipment
CN107967416A (en) The methods, devices and systems of copyright right-safeguarding detection
CN108900533A (en) A kind of shared data method for secret protection, system, terminal and medium
JP2021514510A (en) Logistics tracking and source identification methods, application servers, blockchain nodes and media
CA3090729A1 (en) Smart logistics management using blockchain
CN111488372A (en) Data processing method, device and storage medium
CN110490640A (en) Method, apparatus and system for object distribution processor
CN111340590B (en) Collaborative operation method based on electronic commerce and distributed resale platform thereof
CN112804354A (en) Method and device for data transmission across chains, computer equipment and storage medium
CN109948370A (en) A kind of method for processing business based on block chain, device and electronic equipment
CN113538019B (en) Food traceability information evidence storing method and device
CN107196918A (en) A kind of method and apparatus of matched data
CN108965991B (en) Program ordering state verification method and system, terminal device and storage medium
CN110210976A (en) A kind of method of commerce and its equipment based on block chain
CN113656497A (en) Data verification method and device based on block chain
CN110210975A (en) Data trade method and its equipment on block chain
WO2022241945A1 (en) Data processing method and device, and computer-readable storage medium
CN111131227B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant