基于区块链的食品溯源研究与应用

资讯 2024-06-28 阅读:86 评论:0
1. 引言从20世纪90年代开始,许多国家和地区已经应用可追溯系统进行食品以及农产品质量安全管理。在市场经济高度发达的美国,农产品可追溯系统主要是企业自愿建立,政府主要起到推动和促进作用。美国的行业协会和企业建立了自愿性可追溯系统。由70多...
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

1. 引言

从20世纪90年代开始,许多国家和地区已经应用可追溯系统进行食品以及农产品质量安全管理。在市场经济高度发达的美国,农产品可追溯系统主要是企业自愿建立,政府主要起到推动和促进作用。美国的行业协会和企业建立了自愿性可追溯系统。由70多个协会、组织和100余名畜牧兽医专业人员组成了家畜开发标识小组(USAIP),共同参与制定并建立家畜标识与可追溯工作计划,其目的是在发现外来疫病的情况下,能够在48小时内确定所有涉及与其有直接接触的企业。2003年5月FDA公布了《食品安全跟踪条例》,要求所有涉及食品运输、配送和进口的企业要建立并保全相关食品流通的全过程记录。

Since the 1990s, many countries and regions have applied retroactive systems for the safe management of food and agricultural products. In the United States, where the market economy is highly developed, the traceability system for agricultural products is largely voluntary, with the Government acting as a catalyst and catalyst. Industry associations and businesses in the United States have established a voluntary traceability system.

而我国对食品溯源系统也在不断地完善,2016年10月,阿里健康联合天猫医药共同启动“滋补中国”品牌战略,并宣布建立“滋补中国追溯体系”,实现对滋补品“一品一码”的追溯。借助阿里健康“码上放心”平台,可以实现对相关滋补品的溯源,相当于滋补品都有了“身份证”。虽然现在溯源越来越被看重但是传统的溯源方式还是存在很多问题未解决,将食品信息集中存储在一个中心数据库里有被人为篡改的风险,造成消费者或者监管者对食品信息的信息不对称从而带来很多危害,而区块链技术的分布式存储的结构形成了去中心化的数据存储 [1] ,极大的保证了信息对称性。

My country is also improving its food traceability system, and in October 2016 Ali’s Healthy United Skycat Medicines jointly launched a brand-new strategy to “get China” and announced the creation of a “get China back together” system to provide a “one-size-fits-all” retroactive response to the supplement. Through the Ali’s health “code-by-code” platform, it is possible to trace the supplement, which is equivalent to a “identity card” for the supplement. While it is now increasingly valued, there are many unresolved problems with traditional traceability, with centralized food information stored in a central database at risk of being tampered with, causing many hazards to consumers or regulators asymmetrics of food information, while the distributional structure of block-chain technology has created decentralized data storage [1], which provides a great guarantee of symmetry of information.

本文将区块链与食品溯源相结合构建一个基于区块链技术的溯源系统,其核心是三层架构,能够解决现有溯源系统的部分痛点。该系统架构分为应用层、管理层、网络层三层,实现食品从采摘、加工以及销售过程都可从手机App查询进而达到有效溯源。

This paper combines block chains with food traceability to construct a system of traceability based on block chain technology, the core of which is a three-storey structure capable of addressing some of the pains of the existing traceability system. The system is structured into three layers: application, management, network, and the process of extracting, processing, and selling food can be accessed from a mobile phone app to an effective traceability.

2. 区块链

2.1. 区块链的意义

区块链技术是密码学、计算机科学、经济学等多个学科发展到一定阶段后的产物,有效融合了多个学科的杰出成果。区块链技术的出现为解决人类社会的信任问题提供了有力工具,进而将人类社会带入群智时代。

Block chain technology is the product of a number of disciplines, such as cryptology, computer science, and economics, that have evolved to a certain stage, effectively integrating outstanding results from multiple disciplines. The emergence of block chain technology provides a powerful tool for solving the problems of trust in human society, thus bringing human society into the age of intelligence.

区块链系统本身能产生信用,这种具有信用的产品不是来自第三方,而是来自程序(算法),因为区块链记录信息的产生需要全网络节点确认,而一旦生成将永久记录,无法篡改。互联网的底层协议是TCP/IP协议,实现了信息的低成本高效率传播;区块链可认为是一种新的底层技术,建立了新的信用体系。区块链取代了目前互联网对中心服务器的依赖,使所有数据信息都被记录在一个云系统之上,理论上实现了数据传输中的数据自我证明,从深远意义上讲,这超越了传统和常规意义上需要依赖第三方的信息验证模式,降低了建立全球信用体系的成本。

The block chain system itself generates credit, not from a third party, but from a process (arithmetic), because the creation of information in the block chain records requires full network nodes to confirm, and once generated it will be permanent, and cannot be tampered with. The bottom protocol on the Internet is the TCP/IP protocol, which achieves cost-effective and efficient dissemination of information; the block chain can be seen as a new bottom technology, creating a new credit system. The block chain replaces the current reliance on central servers on the Internet, allowing all data information to be recorded on a cloud system, theoretical self-proven data in data transmission, which in far-reaching terms goes beyond the traditional and conventional information verification model that relies on third parties and reduces the cost of establishing a global credit system.

区块链还创造了一种新的价值交互方式基于“弱中心化” [2] ,但这并非意味着传统社会里各种“中心”的完全消失,未来区块链将出现大量的“多中心”体系,以联盟链、私有链或混合链为主,区块链将会进一步提高“中心”的运行效率,并降低其相当一部分成本。

Block chains have also created a new value interface based on “weak centralization” [2], but this does not mean that the various “centres” in traditional societies have disappeared altogether, that there will be a large number of “centres” in the future, and that the “centres” will be more efficient and reduce a significant portion of their costs, depending on the alliance chain, the private chain or the mixed chain.

区块链是一种由多方共同维护,以块链结构存储数据,使用密码学保证传输和访问安全,能够实现数据一致存储,无法篡改,无法抵赖的技术体系。这种技术给世界带来了无限的遐想空间,全球对区块链的关注热度持续升温,全球主要经济体从国家战略层面开始对区块链技术及发展趋势进行研究。

Block chains are technological systems that are jointly maintained by multiple actors, store data in a chain structure, use cryptography to secure transmission and access, and are capable of achieving consistent data storage that cannot be tampered with or denied. This technology provides the world with unlimited room for imagination, global interest in block chains continues to warm up, and major global economies begin to conduct research on block chain technologies and trends at the national strategic level.

可以这样说,第一次工业革命是蒸汽机的发明为标志,第二次工业革命是以电力的产生,第三次工业革命是电脑与互联网信息技术的出现,那么第四次工业革命将是区块链技术的诞生。

It could be argued that the first industrial revolution was marked by the invention of a steam engine, the second industrial revolution by the generation of electricity, and the third industrial revolution by the advent of computer and Internet information technology, and that the fourth industrial revolution would be the birth of block-chain technology.

2.2. 区块链特点

基于区块链的系统和以往的其他系统有很多的不同之处,以区块链为核心的有以下几大特点:

There are many differences in the systems based on the block chain and other systems of the past, with the following main features at the heart of the block chain:

1) 分布式的(Distributed):区块链没有中心节点,数据分布式的存储在各个节点上,即使绝大部分节点毁灭了,只要还有一个节点存在就可以重新建立并且还原区块链数据。

1) Distributed (Distributed): The block chain has no central nodes and the data distribution is stored on all nodes, even if most nodes are destroyed, so long as there is one node, it can be recreated and the chain of blocks restored.

2) 自治的(Autonomous):区块链是一种去中心化的、自治的体系 [3] ,所有节点是对等的,每个节点可以自由的加入或者离开但不会影响整个区块链系统,并且当系统运作起来可自行产生区块并同步数据,无需人工参与。

2) Autonomous: The block chain is a decentralised, autonomous system[3], all nodes are reciprocal, each node can be freely joined or left without affecting the entire block chain system, and when the system functions, it can generate blocks and synchronize data without manual involvement.

3) 按照合约执行(Contractual):区块链是完全按照合约执行的,各个节点都有运行规则,一旦不符合规则就会被抛弃,其中最重要的便是智能合约,智能合约是一种可程序化的合同条款、规则或规定。

3) Performance under contract (Contractual): The block chain is performed in full compliance with the contract, with operating rules at all nodes, which are abandoned if they do not comply, the most important of which is an intelligent contract, which is a procedural contractual term, rule or provision.

4) 可追溯(Trackable):区块链中的数据是公开透明的,不能被篡改 [4] ,并且相关区块之间有一定的关联性,因而和容易被追溯。

4) Retroactivity: The data in the block chain are open and transparent, cannot be tampered with[4] and there is some correlation between the blocks in question, which makes them easily retraceable.

若我们把每一个区块看作是一个账本上面记录着所有的交易记录,那不同区块之间的联系也可以看作不同的交易,则其工作的原理如图1所示。

If we see each block as a book of records of all transactions, then the link between the different blocks can also be considered a different transaction, as shown in figure 1 .

Figure 1. Blockchain schematic

图1. 区块链原理图

区块链(blockchain)是由多个区块链链接而成的连表结构,除了首区块(“创世区块”)之外,每个区块都由前一个区块的输出脚本控制,如图1所示每个区块都可以看成一个账本上面都有对应的交易记录a, b, c...n,每个区块都由前一区块的输出脚本与后一个区块的输入脚本联系起来,此时我们可以形象的把输出脚本和输入脚本看作一把锁和钥匙之间的关系,只有正确的钥匙才能打开正确的锁,以区块1,区块2为例如果区块2输入脚本是区块1的正确的钥匙那么区块1,区块2之间的交易才有效,否则交易无效,交易有效之后交易b也会包含一部分交易a的信息,这时候我们就可以根据区块2溯源到区块1。

The block chain (blockchain) is a table structure linked to multiple block chains, with each block controlled by an output script of the former block, such as . Each block can be seen as having a corresponding transaction record on the book, a _self' . Each block can be seen as having a proper link to the trading block, b, c.n. Each block can be linked by an output script from the previous block to a later block.

2.3. 共识机制

近几年区块链技术从1.0时代发展到2.0时代再到正在到来的3.0时代,其共识机制扮演着不可或缺的角色,整个区块链网络是靠区块之间的节点通过共识机制维持着稳定。现在主流的共识算法有以下几种 [5] :

In recent years, block chain technology has evolved from the 1.0 to the 2.0 to the 3.0 that is coming, with consensus mechanisms playing an indispensable role. The entire network of block chains is stabilized through consensus mechanisms by nodes between blocks. The following consensus algorithms are now in the mainstream [5]:

1) POW算法:工作量证明算法,是最早提出的一种共识机制,靠参与者(矿工)进行挖矿为区块链网络提供算力,随着矿工的人数增加整个网络就越稳定,系统会给矿工的付出给予一定的奖励机制,以比特币和早期的以太坊为代表。

1) POW algorithm: Workload proof algorithm is the first consensus mechanism to be proposed, where mining by the participants (miners) provides arithmetic for the network of blocks. The more stable the entire network is as the number of miners increases, the system will give miners a certain incentive mechanism, represented by Bitcoin and the early Ether.

2) POS算法:股权证明算法,是根据参与者持有整个系统的代币的数量和时间来确定记账权的算法。

2) POS algorithm: The equity certificate algorithm is an algorithm for determining the rights to account based on the number and time of a participant holding a token throughout the system.

3) PBFT算法:实用型拜占庭容错共识算法,是根据BFT (拜占庭容错)改进得到,此算法不像前两种算法会对发行代币,但PBFT具有极高的安全性,节点容错率和最终性。以Hyperledger的Fabric框架为代表。

3) PBFT algorithm: A functional Byzantine Consensual Error Algorithm, improved according to BFT (Byzantine Error), which is not like the first two algorithms for the issuance of tokens, but PBFT is extremely secure, node tolerance and final. It is represented by the Hyperledger Fabric framework.

本文溯源系统为长远打算选取的是根据POS改进得到的DPOS算法即股权授权算法,是在参与者里通过类似居委会选举制度,选举一部分人为代表人进行投票确定记账权,优化了POS算法中可能出现的中心化现象。

The long-term intention of this system is to optimize the centralization that may occur in the POS algorithms by electing a part of the participants through a system similar to that of the Communal Electoral Commission to determine rights to vote for their representatives, in accordance with the DPOS algorithm, which has been improved.

DPOS算法可分两部分:如何选择一群区块生产者及调度区块生产。选择过程要确保利益持有方拥有局面最终控制权,因为当网络非正常运行时,利益持有方的损失最大。由于选择过程本身对实际如何达成共识几乎没有影响 [6] 。

The DPOS algorithm can be divided into two parts: how to select a group of block producers and how to schedule block production. The selection process ensures that the interest holders have the ultimate control of the situation, because the loss to the interest holders is the greatest when the network is not functioning properly. Because the selection process itself has little impact on how the actual consensus is reached [6].

为更好的解释这个算法,假设有3个区块生产者 A,B和C。因为达成共识要求2/3 + 1多数来裁决所有情况,在这个简化的模型中假设生产者C是打破僵局的角色。在现实中,会有21个或更多的区块生产者。类似工作量证明,一般规则是链最长者胜出。任何时候,当一个诚实节点看到一个更长的有效链时,它都会从当前分叉切换到更长的这条有效链。当大多数生产者不合格时,DPOS还是可以继续行使功能的。这样,社区可以投票替换掉不合格的生产者,直到恢复100%参与率。

To better explain the algorithm, it assumes that there are three block producers A, B, and C. Because consensus requires a two-thirds + 1 majority to rule on all cases, in this simplified model, producer C is assumed to be the role of breaking the deadlock. In reality, there are 21 or more block producers. Similar workloads prove that the rule is that the longest of the chain wins. At any time, when an honest node sees a longer effective chain, it changes the effective chain from the current fork to the longer.

说到底,DPOS之所以有如此强大的安全性,是来自于其选择区块生产者和验证节点质量的算法。赞成投票过程可以确保一个人即使拥有50%的有效投票权也无法独自挑选指定哪怕一个生产者。DPOS的设计旨在优化强劲网络连接的诚实节点100%参与共识的机制。这使得DPOS能够在平均只有1.5秒的时间内以99.9%的确定性确认交易,同时以优雅和可检测的方式降级,从降级中恢复到正常也不过是小事一桩。

In the end, the security of DOS is so strong that it is derived from its algorithm of selecting block producers and authenticating node quality. A vote-in-vote process ensures that a single person, even with 50% of valid voting rights, cannot single out even one producer. The DPOS design aims to optimize the honest nodes of strong network connections by 100% participating in consensus mechanisms.

2.4. 数字签名

数字签名实际上就是非对称加密的算法,即生成公钥和密钥一对密钥,公钥是根据私钥生成的一个地址,所以用私钥对数据进行加密,只有拿到对应的公钥才能进行解密,私钥是只能自己持有,同时生成的公钥由交易发起方公布给交易对象,交易对象通过公钥解密才能看到区块中的信息,从而保证了数据的真实性和可追溯性。

Digital signatures are in fact asymmetric encryption algorithms, that is, the generation of a public key and a key pair, which is an address generated from a private key, so that the data can be encrypted using a private key, which can only be declassified if the corresponding public key is obtained, and the resulting public key is only held by itself, while the public key is published by the originator to the object of the transaction, which can only see the information in the block through a public key decryption, thus ensuring the authenticity and traceability of the data.

当区块内的信息状态要发生转移时,为保证数据信息的安全性与真实性,区块链节点之间在共识机制的依托之下需要对区块信息进行签名,而交易方必须拿到对应的公钥才能解密才能看到真实的数据信息,验证过程由脚本语言控制其执行的原理如图2所示。

In order to ensure the security and authenticity of data information when the information state within a block is to be transferred, signature of block information between block chain nodes is required under the mechanism of consensus, and the trader must have the corresponding public key in order to decipher the true data information. The principle that the authentication process is controlled by script language is as

Figure 2. Script execution diagram

图2. 脚本执行图

我们可以将脚本看作是一个栈,栈是一个后进先出的容器,那么脚本执行过程我们亦可以看成是一个对栈的操作过程 [7] ,中间过程由相应的合约代码(规则)命令,要成功执行脚本关键点有两个,其一是公钥,公钥实际上就是一个地址,当产生一个交易时就会产生一个公钥,在确认交易合法性是需要出示公钥验证,验证合法交易才能继续。其二是私钥也称作交易签名,私钥也是交易时所必需的,但是私钥只有交易发起人自己拥有,具有唯一性,不可复制性,公钥是交易双方都可拥有的,所有在确保交易的合法性的时候需要公钥和私钥同时验证,均合后法交易才有效,反之无效。

We can see the script as a back-to-back container, so that the script execution process can also be seen as an operation of a counter-store [7], with the intermediate process ordered by the corresponding contract code (rules) to successfully execute the script with two key points, one of which is a public key, the public key is actually an address, when a transaction arises, and a public key is created in order to verify the legitimacy of the transaction if it requires proof of the public key, which is also called the signature of the transaction, and the private key is necessary at the time of the transaction, but only if the private key is owned by the originator of the transaction, is unique, non-copyable, the public key is owned by both parties to the transaction, all public and private keys are required to verify the transaction at the same time in order to verify the legitimacy of the transaction, and the latter is valid and not valid.

所以脚本执行过程如图2所示第一步先将私钥公钥依次入栈,在通过OP_DUP命令复制栈顶元素,然后通过OP_HASH160命令对公钥进行hash算法加密,此过程保证了公钥的安全性,防止恶性攻击偷取公钥。

So the script execution process is , which ensures the security of public keys and prevents malicious attacks from stealing them.

公钥加密后只有交易双方知道,所以当发起交易者想要进行交易时需要交易的另一方提供同样的公钥,因此第四步 就是交易的另一方提供的公钥,此时脚本需要通过OP_EQUALVERIFY命令验证此时两个公钥是否相等,相等则交易继续,否则交易不合法。最后一步就是通过OP_CHECKSIG命令检查栈顶元素是否执行签名校验操作,此时的签名一定需要发起交易这提供自己的私钥进行签名,若操作之后相等,则返回TRUE,否则返回FALSE。以上所有步骤执行完了也就说明区块之间的交易成功了也就是 图1的区块1到区块2的步骤完成了。很显然区块链的这种交易方式是具有极高的安全性,并且是可追溯的。

Once the public key is encrypted, only the parties to the transaction know that the same public key is required from the other party to the transaction when the initiating party wishes to carry out the transaction, so step four is the public key provided by the other party to the transaction, at which point the script is required to verify whether the two public keys are equal at this time by an OP_EQUALVERIFY command, or the transaction is not legal. The last step is to check whether the top element of the container is authenticated by an OP_CHECKSIG command, so the signature must then be initiated to provide its own private key for signature and, if it is equal, return to TRUE. If all the above steps are completed, then the transaction between blocks will be successful, namely [s]1 [s.int.int.html>[s.]

3. 区块链 + 食品溯源

3.1. 传统的食品溯源

民以食为天,食品安全十三五时期上升为国家重大战略。随着史上最严《食品安全法》的实施,全国各地都在就食品安全采取各项措施。其中食品溯源体系的建设成为食品安全工作中必不可少的项目。随之,食品安全溯源追溯平台市场前景可观,行业将迎来大机遇。食品安全源溯追溯平台的创立保证了食品从田地到餐桌的全程可追溯 [8] ,在相当程度上遏制了假冒伪劣产品的流通,同时也为消费者提供食品生产全程数据而设立的数字化动态追踪、监控系统。

With the implementation of the most stringent Food Safety Act in history, measures have been taken throughout the country on food safety. The construction of the food traceability system has become an essential component of food safety. With this, the market outlook for the food safety traceability platform is considerable, and the industry will have great opportunities. The creation of the food safety traceability platform has ensured that food is traced from the field to the table[8] and has considerably curbed the flow of counterfeit products, as well as the digital dynamic tracking and surveillance system that has been set up to provide consumers with data on the full course of food production.

食品溯源系统在物联网的技术支撑下被越来越多的企业所应用,传统的溯源体系现在主要有利用二维码或者RFID技术给食品印上“身份证”,用户可以在手机APP上查询食品的生命周期信息做到全面的了解,做到消费更透明,同时食品追溯体系的建立,当发生质量事故时能够提出恰当的应对措施,降低消费者的损失,使得消费者的利益能够得到保障。传统的溯源体系如图3所示。

Food traceability systems are being used by an increasing number of enterprises, supported by technology for networking, and traditional traceability systems are now mainly “identity cards” printed on food using two-dimensional codes or RFID technologies. Users can access information on the life cycle of food on mobile phones for comprehensive understanding and transparency of consumption, while food traceability systems can be set up to provide appropriate responses in the event of a quality accident to reduce consumer losses and safeguard consumer interests. Traditional traceability systems such as .

Figure 3. Traceability system diagram

图3. 溯源系统图

可以看到传统溯源系统中有个特点就是有一个核心数据库,食品的所有信息都存储在这个数据库里,消费者通过手机的API接口连接到数据库进行信息查询,但是中心化数据库的内容是可以被更改的,一旦数据库的数据被更改那么消费者看到的数据信息也不一定是真实的,从而发生食品的质量问题,大大的降低了消费者对该食品和企业的信任度,同时传统的溯源系统无法看到食品从生产、加工、销售每一段的情况,中间许多过程也存在个各种风险和隐患。

One feature of the traditional traceability system is that there is a core database in which all information on food is stored, that consumers connect to the database for information queries via the API interface of mobile phones, but that the content of the centralized database can be changed, and that once data from the database are changed, the data information that consumers see is not necessarily real, thus creating problems in the quality of food, significantly reducing consumer confidence in the food and business, and that the traditional traceability system does not see every segment of the food produced, processed and sold, and that there are risks and risks in many of the processes in the middle.

为了解决以上问题,本文提出了将区块链技术融入互联网的溯源系统。因为区块链具有分布式共享总账、去中心化共识机制、智能合约、时间戳不可篡改等特征,将其融入基于互联网的溯源系统中就能使消费者看到自己食品从生产、加工到销售的每一步情况,并且能保证每一步自己所查询到的信息都是真实有效的,使得溯源系统更加数字化、智能化、规范化。

In order to address these problems, this paper proposes the integration of block chain technology into the Internet back-to-back system. Because the block chain has the characteristics of a distributed shared general ledger, decentralised consensus mechanisms, smart contracts, time stampes, etc., integration into an Internet-based back-to-back system allows consumers to see every step of their food from production to processing to marketing, and ensures that the information they search for is real and effective, making the system more digital, intelligent, standardized.

3.2. 基于区块链的食品溯源系统

为解决基于传统食品溯源系统的缺陷,可以构建基于区块链的食品溯源系统,区块链中可以任意添加或者减少区块而不影响整个系统可以使得系统更具有动态性和实效性,每生成一个区块都由唯一的不可更改的时间戳保证了其不可篡改 [9] 、不可复制性。将各类信息都放在区块链上,其公开透明的数据可以使用户直观的看到,使得消费者对食品,基于以上特点本文设计出如图4所示的基于区块链的溯源系统框架。

To address deficiencies based on traditional food traceability systems, a system of food traceability based on block chains can be constructed in which blocks can be added or reduced at will without compromising the system's dynamic and effectiveness. Each block generated by a single unalterable time stamp guarantees its immutable [9], non-repelicable nature. The transparent data placed on the block chains allows users to visualize the food by allowing consumers to be designed on the basis of the above-mentioned text, as

Figure 4. Traceability frame

图4. 溯源框架图

将该系统架构分为应用层、管理层、网络层三层,其应用层是消费者通过手机APP直观的看到食品的原产地,食品加工厂的加工状态再到各大食品代理商以及他们的销售渠道等所有过程,每一个环节都会有一个区块记录着相同的账本,并且这个账本只允许追加而无法修改,每个区块之间都是通过满足共识机制的节点维护者整个网络不需要人为的介入,加上每个区块信息都包含有唯一的时间戳更加保证了信息的安全性 [10] 。区块上的信息内容是通过hash加密保存在默克尔树上,在极大的保证了数据真实性的情况下还防止了数据的泄露,因为只有交易方的公钥才能解密看到信息,也就是说只有交易双方能看到信息,也凸显一定的隐私性。

The system's architecture is divided into application layers, management levels, network layers, and the application layer is that consumers see the origin of the food through mobile phone APP visualization, the processing state of food processing plants to major food agents and their distribution channels. Each link has a block that records the same account book, and the account book allows only for additions that cannot be modified. The entire network of nodes that meet the consensus mechanism does not require artificial intervention, and each block contains the only time stamp that ensures the security of the information [10]. The information on the block is stored on the Merkel Tree via hash encryption and also prevents the disclosure of data with great assurance of data authenticity, since only the public key of the transaction is capable of deciphering the information, which means that only the parties to the transaction can see the information and highlight a certain degree of privacy.

对于管理层第三方的监管则只需要监管者加入区块链系统并且拿到相应的公钥便能查询,但即便是监管者也是无权、无法篡改信息内容的,也避免了监管者在食品出现质量问题进行食品溯源追责的时候出现徇私舞弊的情况。

The regulation of third parties in management only requires that the regulator joins the block chain system and obtains the corresponding public key to access it, but even the regulator has no right to tamper with the content of the information and avoids abuse by the regulator when food quality problems arise.

网络层

此处的网络层亦可称作是合约层,其包含了脚本代码、智能合约、共识算法等机制共同制定了控制管理层的规则,利用脚本代码使每个区块连接起来并且使其可追溯,共识算法是一种去中性化机制,提高了该系统的可信任性,智能合约则是通过代码控制输出日志记录,对于后面的溯源和监管起着至关重要的作用。

The network layer here can also be called the contract layer, which contains such mechanisms as script codes, smart contracts, consensus algorithms, which together establish rules for the control of management, use script codes to connect each block and make it traceable. Consensus algorithms are a de-neutralization mechanism that enhances the trustability of the system, and smart contracts are recorded through code control of output logs, which play a crucial role in subsequent traceability and regulation.

3.3. 实现机制

在溯源系统中,每一样商品在区块链网络中都是数字化的,包括其各种参数信息。数字化后形成的电子文档在区块链中是只能追加但不可修改的形式。利用相应的信息文档,认证授权中心可以通过智能合约的方式自动对商品当前担责节点开放权限,保证数据维护的有序性与可靠性,防止相关节点违规操作,实现系统有序、严谨、全面的跟踪商品。

In the retrospective system, every commodity is digitized in a network of block chains, including information on its parameters. Digitalized electronic files are only additional but unmodifiable forms in the block chain. Using the corresponding information files, the authentication authorization centre can automatically open its rights to the current node of liability for the commodity by means of an intelligent contract, guaranteeing the orderly and reliable nature of data maintenance, preventing irregularities at the node concerned, and achieving systematic, rigorous and comprehensive tracking of the commodity.

针对本文的食品溯源而言,图4里的管理层的每一个环节都是被授权参与者,当被授权的参与者要维护食品的信息文档时,必须需要此参与者的私钥连接网络后,进行数据信息的输入,在进行数字签名。系统要收集一系列的信息,包括但不限于商品当前状态、产品类型、行业标准等。一旦参与者发起了产品转移,通过智能合约对数据进行审核、验证,之后将信息打包录入。被授权的节点在与另一节点进行“交易”时,两节点之间需要达成统一的协议并进行数字签名。数字签名此处采用ECDSA (非对称数字加密)技术,保证了信息不被篡改且两节点之间信息无需公开。当“交易”在区块链网络中被核心层节点公证并进行全网广播之后 [11] ,包含交易信息的区块按照时间戳顺序成为区块链上的最新环节。双方交易信息的加密通过非对称加密完成的,即用私钥加密在用相应的公钥解密,保证了信息无法被恶意篡改,解决了交易过程中的诚信问题。

For the food retrospective sources in this paper, 数据访问

在此系统中还涉及第三方的监管,就需要对区块链系统进行数据访问,因为商品的每条信息的输入都有相应的时间戳并且有相应的参与节点的数字签名。每个环节的数据都是通过参与者的私钥进行非对成加密的,那么第三方监管想要访问数据是需要拿到相应参与者的公钥进行解密,获取相应的权限之后就能看到食品信息,这种方式有利于发生食品安全问题的时候监管部门访问此类信息进行追责。

Third-party regulation also involves third-party regulation, which requires data access to block chain systems, since every input to a commodity has a corresponding time stamp and a corresponding digital signature of the participating node. The data for each segment is encrypted by means of a private key of the participant.

4. 结语

如今,我国对区块链的研究也是很重视,许多区块链的公司企业应声而起。随着区块链2.0甚至3.0的到来,区块链+的应用也蓬勃发展,其中基于区块链的食品溯源与防伪是国家重点支持的项目 [13] 。而人们对食品品质的要求越来越高,“绿色”、“健康”、“天然”、“口感佳”逐渐成为人们挑选商品和食物的标准。影响这些标准的根本就在于食品从生产、加工再到销售这一系列的供应链的操作是否安全。根据本文的方案设计的基于区块链的三层架构能够有效地保证食品从农田到餐桌的每一步的可追溯性。该系统包含了区块链技术的去中心化、不可篡改的特点,将数据进行存储,保证数据的可靠性 [14] 。本系统有较好的扩展性和可移植性,为用户提供方便的App手机查询,现在主要提供食品的数字信息的溯源查询,以后将加入图片信息的查询,使得此系统更智慧化。后期同样需要对系统的吞吐量、溯源效率等方面进行优化,实现更加有效、智能的食品溯源系统。

The application of block chain+ has also flourished with the advent of block chains of 2.0 or 3.0, with food traceability and forgery based on block chains being a priority project supported by the state [13]. The increasing demand for food quality, “green”, “health,” “natural,” and “sport sense”, has gradually become a criterion for people to select goods and food.

NOTES

*通讯作者。

Correspondent.

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
随机文章
热门文章
最近发表
标签列表