基于区块链技术的应用案例:食品追溯

资讯 2024-06-28 阅读:49 评论:0
  在食品追溯系统中,一般会关心下面几个问题:In the food retroactive system, the following issues are generally taken into account:   1、原产地溯源...
美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

APP下载   官网地址

  在食品追溯系统中,一般会关心下面几个问题:

In the food retroactive system, the following issues are generally taken into account:

  1、原产地溯源,防止假冒伪劣,典型的如高档白酒,进口葡萄酒等。

1. Retroactivity of origin, prevention of counterfeiting, typical of high-quality white wine, importation of wine, etc.

  2、发现问题食品,可以及时快速召回。

2. Discovered food items can be recalled quickly and in a timely manner.

  3、供应链可视化,通过共享数据,可随时知道当前处于供应链的哪个环节,提升效率。

3. Supply chain visualization and, by sharing data, is readily available to know which link in the supply chain is currently in place to enhance efficiency.

  近两年,随着区块链技术的火热,因为区块链防篡改和数据实时共享的特点,采用区块链技术实现食品追溯受到重视。如2017年7月,沃尔玛、京东、IBM和清华大学已经组成区块链联盟,以提高中国食品供应链的可追溯性和透明度。在之前沃尔玛公司和IBM公布了去年在美国和中国推出的食品溯源区块链项目的新消息。该试点项目由沃尔玛、IBM和学术合作伙伴共同开发,旨在利用区块链技术、对供应链中的产品如美国的芒果和中国的猪肉进行跟踪。

In the last two years, with the heat of block chain technology, the use of block chain technology for food was given retroactive attention because of the tampering of block chains and the characteristics of real-time data sharing. For example, in July 2017, Wal-Mart, Kyung-dong, IBM, and Qinghua Universities formed a block chain alliance to improve traceability and transparency in China’s food supply chain.

  据沃尔玛透露,到目前为止,该试点项目的成果令人满意。美国和中国的早期试验表明,区块链技术可以成功地对食品从供应商到零售商、以及终消费者之间的流通过程进行追踪。产品的地产、批号、生产厂家和处理数据、到期日期和运输细节等详细信息都将可以在区块链网络上进行查询。沃尔玛的测试表明,通过应用区块链技术,追溯一袋芒果从农场到门店的过程从以往的几天甚至几星期缩短到了2秒。

According to Wal-Mart, the results of the pilot project have been satisfactory so far. Early tests in the United States and China show that block-chain technology can successfully track the flow of food from suppliers to retailers, as well as final consumers.

  采用区块链与采用传统技术实现食品追溯的区别

Difference between the use of block chains and the use of traditional techniques to achieve food traceability

  前端没什么区别,都是数据采集。主要的区别在后端,区块链从业务层面的本质是去中心化,那么在技术层面的本质是去数据库化。如下图所示:

There is no difference between the front end and the data collection. The main difference is at the back end. The essence of the block chain from the operational level is decentralisation, and the essence at the technical level is dedatamacization.

  传统的三层架构应用一般就是实现UI的客户端,实现业务逻辑的业务层,和存储数据的数据库层。并不断演进,如客户端从字符终端到GUI图形界面到Web浏览器到如今的移动终端。业务逻辑的实现也从开始的Tuxedo服务,J2EE的EJB,Servlet到Web service,Java Bean,REST等,但后端的数据库一直没有变化。近几年,随着并发访问的增大和改善用户体验的需要,对响应时间要求越来越高。增加了缓存层(采用memcache,Redis,Coherence等)。

The traditional three-tier architecture application is typically to achieve the UI client, the business layer for business logic, and the database layer for storing data. It evolves from the character terminal to the GUI GUI interface to the Web browser to the mobile terminal today. The business logic is also realized from the start-up Tuxedo service, J2EE EJB, Servlet to Web Service, Java Bean, REST, etc., but the back-end database has not changed. In recent years, response times have become more demanding as the user experience needs to be increased and improved.

  区块链应用同传统应用不一样的地方是它把数据保存在账本中。通过智能合约(智能合约听起来很高大上,但其实就是一段代码,它实现的功能类似传统应用中的EJB,Servlet,Web service, Java Bean等,也就是实现业务逻辑)对账本进行读写操作。而账本是一个Key-value的状态库加区块链,区块链对应的是文件,以追加的方式写入,不可更改。如下图为Hyperledger Fabric中的账本逻辑示意图:

Block chain applications differ from traditional applications in that they save data in a book. The book is read and written through a smart contract (intelligent contracts sound great, but they are actually a code that performs functions similar to those of EJB, Servlet, Webservice, Java Bean and others in the traditional application, i.e. business logic). The account book is a Key-value state library plus block chain, which corresponds to a file, which is written in an additional and unalterable manner. The following is a logical illustration of the ledger in Hyperledger Fabric:

  如上图所示,账本Ledger主要包含两块:blockchain和state。blockchain就是一系列连在一起的block,用来记录历史交易。state对应账本的当前新状态,它是一个key-value数据库,Fabric默认采用Level DB, 可以替换成其他的Key-value数据库,如Couch DB。举个例子。我们采用区块链实现一个弹珠交易的系统。我们开发了一个智能合约, 每个弹珠有以下几个属性:Name, owner, color, size. 可以定义一个JSON对象,用name做KEY, JSON对象做Value,存储在Level DB或者Couch DB中。所以区块链应用一般采用JSON数据格式,并直接存储在key-value数据库和区块链中。这样就省去了传统应用做O/R Mapping的工作。

As shown in the figure above, the account book Ledger consists mainly of two pieces: Blockchai and State. Blockchai is a series of blocks that are linked to record historical transactions. The state of the current state of the state of the state of the state-record accounts, which is a Key-value database, which Fabric defaults to use as Level DB, which can be replaced with other Key-value databases, such as the Cooch DB. So, for example, we use block chains to achieve a system of marble trading. We develop a smart contract with the following attributes for each marble: name, owner, color, size.  we can define a JSON object and use its name for KEY, JSON objects to do Value, which can be stored in Level DB or Couch DB. So the sector chain is generally based on JSON data formats and stored directly in the key-value database and block chains.

  从部署架构看区块链和传统应用的区别,如下图,传统应用的应用服务器层很容易扩展,但在数据层比较难。而区块链是把应用(智能合约)和数据(账本)分布式部署在每个节点上。

From the point of view of the deployment structure, the distinction between block chains and traditional applications is illustrated below, where the application server layer of the traditional application is easily expanded, but the data layer is more difficult. The block chain is to deploy the application (smart contract) and the data (book) distribution at each node.

  那么这种情况下,如何保证数据的原子操作和一致性。我们知道数据库通过行级锁,事务等机制保证数据的原子操作和一致性。区块链是通过共识机制来保证数据的一致性。

So, in this case, how do we guarantee the atomic operation and consistency of the data? We know that the database guarantees the atomic operation and consistency of the data through a chain of locks, events, etc. The block chain guarantees the consistency of the data through a consensus mechanism.

  一个基于区块链技术的食品追溯DEMO

A grain based on block chain technology retroactive to DEMO

  我们在Oracle的区块链云服务BCS上面做了一个采用区块链技术追溯食品的DEMO.下面做下介绍:

In Oracle, on the block-chain cloud service BCS, we made a DeMO, which uses block-chain technology to trace food, which is described below:

  业务场景

Business scene

  如下图所示,通过区块链技术,农牧场的出栏信息,食品厂的出厂信息,商品信息,超市的上架信息,监管部门的检测检验信息可以在这不同的组织之间共享,消费者也可以实时查询到上面这些信息,进行溯源。当然原产地认证信息,有机食品认证,生产许可证等信息等也可以放到区块链网络中,利用区块链不可篡改的特点。保证查询到信息是真实的。

As shown in the figure below, through block chain technology, information on agricultural pastures, information on food factories, merchandise information, information on supermarkets, monitoring and inspection information on regulators can be shared among these different organizations, and consumers can access this information in real time and trace it. Of course, information on origin certification, organic food certification, production permits, etc. can also be placed in a network of block chains, using characteristics that cannot be tampered with.

  具体实现

Actual realization

  如下图所示,我们在后端采用Oracle的区块链云服务BCS,前端采用Oracle的开源框架JET实现了一个区块链食品追溯的DEMO。前端JET中通过REST调用后端部署在BCS上面的智能合约。智能合约采用Go语言开发,部署在BCS上面。

As shown in the figure below, we use the Oracle block chain cloud service BCS at the back end, and the Oracle open-source framework JET at the front end achieves a block chain food retroactive DEMO. Smart contracts in front JET are deployed on the BCS backend via REST. Smart contracts are developed in Go languages and deployed on the BCS.

  优势总结

Summaries of Strengths

  基于区块链技术实现食品追溯有以下几点优势:

Retroactivity of food based on block chain technology has the following advantages:

  总之,利用区块链的数据不可篡改和数据可以实时同步的特点,很适合用于各种追溯类的应用。如上面介绍的食品追溯,其他的如汽车零部件追溯,贵重物品如珠宝,钻石的追溯,药品追溯等等。

In short, the data from the block chain cannot be tampered with and the data can be synchronized in real time and are well suited for various retroactive applications.

  NBT将物联网大数据打造成流转的数字资产。利用区块链不可篡改,去中心化的机制,将实物资产登记备案,以数字资产形式表征和度量链上的数字化经济活动。通过智能合约(Smart Contract)的方式保证贡献信息的用户都能获得NBT奖励,从而带动用户使用更多硬件设备参与区块链同步记账,终形成增加用户及设备、提高NBT流通效率、提升NBT价值的正向循环模式。

The NBT creates digital assets that flow through large data grids. Using blocks chains that cannot be tampered with, de-centralized mechanisms, physical assets are registered and digitized economic activities are presented and measured in digital asset form. Through smart contracts (Smart Contracting), users of information are guaranteed an NBT reward, thereby enabling users to use more hardware equipment to participate in block chain synchronizations, resulting in a positive circular model that increases users and equipment, improves the efficiency of NBT flows and enhances the value of NBTs.

 

美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

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

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

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

分享:

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

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

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00015693个比特币等于多少人民币/美金

    0.00015693个比特币等于多少人民币/美金
    0.000 15693比特币等于多少人民币?根据比特币对人民币的最新汇率,0.000 15693比特币等于10.6 1678529美元/76.86554996人民币。比特币(BTC)【比特币价格翻倍】美元(USDT)人民币(CNY)0.000/克洛克-0/5693【数字货币矿机】10.6 167852976.8655254996比特币对人民币的最新汇率为:489,807.72 CNY(1比特币= 489,807.72人民币)(1美元=7.24人民币)(0.00015693 U...
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?

    2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?
    GDP作为全球公认的实力基准,就像是一个大国实力的代言人,它是布雷顿森林体系下全球团结的声音。它不仅仅是数字的累积,更是大国综合实力的人格化,默默诉说着每个国家的辉煌与荣耀。虽然GDP不是衡量一个国家综合实力的唯一标准,但无疑是最关键的指标之一。作为一面镜子,它反映了国家的经济实力和发展水平,是国家综合实力的重要体现,不容忽视。2000年,中国GDP迈过/克洛克-0/万亿美元的重要门槛,达到/克洛克-0/。2/克洛克-0/万亿美元(折合人民币7。7万亿元)。然而,在全球经济的...
  • A股利好!证监会连开三场座谈会!五部门发文 事关元宇宙…周末影响一周市场的十大消息(新股+点评)

    A股利好!证监会连开三场座谈会!五部门发文 事关元宇宙…周末影响一周市场的十大消息(新股+点评)
    1   证监会连开三场座谈会!将研究出台更多务实、管用的政策举措 The SEC will hold three talks! More practical and practical policy initiatives will be developed.   近日,中国证监会就活跃资本市场、提振投资者信心召开三场座谈会,分别听取专家学者和投资者意...
  • 1929经济大萧条或许即将重演?

    1929经济大萧条或许即将重演?
    人类似乎陷入了一个历史悖论,即我们总是重复同样的错误,无法真正从过去的错误中吸取教训。近年来,我们对世界各地接连不断的挑战和危机深感不安。20 19年突如其来的疫情,乌克兰的战火硝烟,欧洲的天然气供应危机以及全球少数国家的饥荒,所有这些问题都像洪水一样,一个接一个地涌来。如果你今天感到心情沉重,不要失去希望,因为明天可能会带来更严峻的挑战。首先,让我们深入讨论名为1929大萧条的时期。这场大萧条实际上是指从1929到1933的一场影响深远的经济危机。这场危机首先起源于美国,然...
标签列表