WO2019223401A1 - 一种基于区块链的对象关联封装存储方法 - Google Patents

一种基于区块链的对象关联封装存储方法 Download PDF

Info

Publication number
WO2019223401A1
WO2019223401A1 PCT/CN2019/077931 CN2019077931W WO2019223401A1 WO 2019223401 A1 WO2019223401 A1 WO 2019223401A1 CN 2019077931 W CN2019077931 W CN 2019077931W WO 2019223401 A1 WO2019223401 A1 WO 2019223401A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
transaction
item
program
business
Prior art date
Application number
PCT/CN2019/077931
Other languages
English (en)
French (fr)
Inventor
郭光武
程文彬
张伟
Original Assignee
深圳前海益链网络科技有限公司
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 深圳前海益链网络科技有限公司 filed Critical 深圳前海益链网络科技有限公司
Publication of WO2019223401A1 publication Critical patent/WO2019223401A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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

Definitions

  • the invention relates to the field of blockchain, and in particular to a method of object-associated encapsulation and storage based on the blockchain.
  • Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanisms, and encryption algorithms.
  • the so-called consensus mechanism is a mathematical algorithm in the blockchain system to establish trust and obtain rights between different nodes.
  • Blockchain is an important concept of Bitcoin.It is essentially a decentralized database and at the same time serves as the underlying technology of Bitcoin.
  • the blockchain is a series of data blocks that are generated by using cryptographic methods. Each data block contains information about a Bitcoin network transaction. It is used to verify the validity of the information (anti-counterfeiting) and generate the next block.
  • Blockchain technology is a distributed ledger technology, which is an Internet database technology. It is characterized by decentralization, openness and transparency, allowing everyone to participate in database records.
  • the blockchain programs developed by major companies and institutions only support the issuance of tokens and the transfer of digital currency in virtual machines. There is no practical application. For example, a track record of the life cycle of an item object, and records the association between each item object and how it is stored on the blockchain.
  • the object of the present invention is to provide a method of object-associated encapsulation and storage based on a blockchain, so as to solve the problems raised in the background art described above.
  • the present invention provides the following technical solutions:
  • a method for encapsulating and storing objects based on a blockchain includes the following steps:
  • S10 The action of establishing a connection between the upper-layer business system and the lower-level blockchain
  • S50 The business layer queries whether the object is on the chain by calling the rpc provided by the blockchain program.
  • step S10 the action of establishing a connection is a code assignment service and a Bitcoin program, running a business system and the underlying blockchain program, and then establishing socket communication through the TCP / IP protocol, and the connection supervision is completed.
  • step S20 according to the object object provided by the user, apply for a unique Object ID for this item in the business layer, and set the latitude and longitude of the item, time, key information, item status label, and third-party URL
  • the information is formatted into a JSON string, which is sent to the underlying blockchain program for processing through the socket connection.
  • step S30 after the blockchain program receives the JSON string, it parses it, fills it into the corresponding object structure, creates a transaction, stores the item object in the corresponding transaction object, and When the transaction is signed, the item object hash is signed together to ensure that the transaction cannot be tampered with, and the transaction is broadcast to the mining node and packaged into the blockchain.
  • step S40 after the item is confirmed by 7 blocks, the transaction where the item object is located and the block hash are returned to the business layer through a socket.
  • the blockchain-based object-associated encapsulation storage method has a reasonable structure, easy data packaging, efficient data storage, easy chaining, and cannot be tampered with; any object can use the object structure, and then write it to the blockchain after formatting , To provide a basis for later deposit certificates, and can use compression algorithms such as snappy, zip, lz4 to compress and store, saving space.
  • FIG. 1 is a flowchart of a method for associatively encapsulating and storing objects with native coding in an embodiment of the method.
  • FIG. 1 is a flowchart (associated with a given item code) of a native object in an embodiment. The method includes the following steps:
  • S10 The action of establishing a connection between the upper-layer business system and the lower-level blockchain
  • code assignment service and Bitcoin program For example: code assignment service and Bitcoin program, the specific steps are: run the business system and the underlying blockchain program, and then establish socket communication through the TCP / IP protocol, and the connection supervision is completed.
  • the information is formatted into a JSON string, which is sent to the underlying blockchain program for processing through the socket connection.
  • the blockchain program After the blockchain program receives the JSON string, it parses it, fills it into the corresponding object structure, creates a transaction, stores the item object in the corresponding transaction object, and signs the item object hash together when the transaction is signed , To ensure that the transaction cannot be tampered with, and broadcast the transaction to the mining node and package it into the blockchain.
  • the transaction and block hash of the item object are returned to the business layer through the socket.
  • S50 The business layer queries whether the object is on the chain by calling the rpc provided by the blockchain program.
  • Object-oriented language (c ++) is used to describe the objects.
  • Each item's code is generated by a unified code service, and the corresponding tags are used to mark the items such as splitting, packaging, breathing, and transformation. If new items are generated during this process, apply for code assignment, then format this series of information through JSON object markup language and format the information in the corresponding fields, save it in the transaction, and finally pass the miner Mining is packaged and written on the blockchain, and the transaction where the object is located and the hash return of the block are recorded later to provide a basis for later retrieval.
  • These data can be configured to be compressed when written to the disk to fully store the storage space. use.
  • Native code Assign a code to a given item.
  • Breathing code Breathing of the coded items generates new items.
  • Conversion code The coded items are converted into other items.
  • Flag 1, the position of the coded item is changed / status changed;
  • Flag 3, code multiple items to aggregate into a new item and code (boxing);
  • Flag 4, the coded item is split into multiple new items and coded, which can be understood as the reverse process of 3;
  • Flag 6/7, single item association / disassociation, item delivery note / temporary container, etc., the change of the waybill position is equivalent to the change of the item position;
  • the blockchain-based object-associated encapsulation storage method has a reasonable structure, easy data packaging, efficient data storage, easy chaining, and cannot be tampered with; any object can use the object structure, and then write it to the blockchain after format , To provide a basis for later deposit certificates, and can use compression algorithms such as snappy, zip, lz4 to compress and store, saving space.

Abstract

本发明公开了一种基于区块链的对象关联封装存储方法,包括以下步骤:上层业务系统与底层区块链建立连接的动作;根据用户提供的物品,业务系统封装对象JSON串,传入区块链程序;区块链程序将业务数据上链;返回对象所在交易和区块的哈希;业务层通过调用区块链程序提供的rpc查询该对象是否上链。本发明结构合理,数据易于封装,数据高效存储,轻松上链,无法篡改;任何物品都可以使用该对象结构,然后经过格式化后写入区块链,为后期存证提供依据,并且可以使用snappy、zip、lz4等压缩算法进行压缩存储,节约空间。

Description

一种基于区块链的对象关联封装存储方法 技术领域
本发明涉及区块链领域,具体是一种基于区块链的对象关联封装存储方法。
背景技术
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。所谓共识机制是区块链系统中实现不同节点之间建立信任、获取权益的数学算法。
区块链(Blockchain)是比特币的一个重要概念,它本质上是一个去中心化的数据库,同时作为比特币的底层技术。区块链是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一次比特币网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。
区块链技术为分布式账本技术,是一种互联网数据库技术,其特点是去中心化、公开透明,让每个人均可参与数据库记录。目前各大公司机构开发的区块链程序只支持发行Token,虚拟机数字货币的转移,没有实际的应用。比如对某个物品对象的生命周期的追踪记录,并且记录各个物品对象之间的关联和如何存储在区块链上。
因此,针对这一现状,迫切需要开发一种基于区块链的对象关联封装存储方法,以克服当前实际应用中的不足。
发明内容
本发明的目的在于提供一种基于区块链的对象关联封装存储方法,以解决上述背景技术中提出的问题。
为实现上述目的,本发明提供如下技术方案:
一种基于区块链的对象关联封装存储方法,包括以下步骤:
S10:上层业务系统与底层区块链建立连接的动作;
S20:根据用户提供的物品,业务系统封装对象JSON串,传入区块链程序;
S30:区块链程序将业务数据上链;
S40:返回对象所在交易和区块的哈希;
S50:业务层通过调用区块链程序提供的rpc查询该对象是否上链。
作为本发明进一步的方案:在步骤S10中,建立连接的动作为赋码服务和比特币程序,运行业务系统和底层区块链程序,然后通过tcp/ip协议建立socket通信,连接监理完毕。
作为本发明进一步的方案:在步骤S20中,根据用户提供的物品对象,在业务层为这个物品申请一个唯一Object ID,并将物品的经纬度、时间、关键信息、物品的状态标签、第三方URL信息格式化成一个JSON串,通过socket连接发送JSON串给底层区块链程序处理。
作为本发明进一步的方案:在步骤S30中,区块链程序接收到JSON串之后,将它解析,填充到对应的对象结构中,创建交易,将物品对象保存到对应的交易对象中,并在交易签名的时候,把物品对象哈希一起签名,保证交易的不可篡改,将交易广播至挖矿节点打包至区块链内。
作为本发明进一步的方案:在步骤S40中,物品经过7个区块确认之后,将该物品对象所在交易和区块哈希通过socket返回给业务层。
与现有技术相比,本发明的有益效果是:
该基于区块链的对象关联封装存储方法,其结构合理,数据易于封装,数据高效存储,轻松上链,无法篡改;任何物品都可以使用该对象结构,然后经过格式化后写入区块链,为后期存证提供依据,并且可以使用snappy、zip、lz4等压缩算法进行压缩存储,节约空间。
附图说明
图1为本方法实施例中对象原生赋码关联封装存储方法的流程图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1是一个实施例中原生对象关联封装存储的流程图(给定物品付赋码),该方法包括以下步骤:
S10:上层业务系统与底层区块链建立连接的动作;
例如:赋码服务和比特币程序,其具体步骤为:运行业务系统和底层区块链程序,然后通过tcp/ip协议建立socket通信,连接监理完毕。
S20:根据用户提供的物品,业务系统封装对象JSON串,传入区块链程序;
其具体步骤为:根据用户提供的物品对象,在业务层为这个物品申请一个唯一Object ID,并将物品的经纬度、时间、关键信息、物品的状态标签(原生Flag=0)、第三方URL等信息格式化成一个JSON串,通过socket连接发送JSON串给底层区块链程序处理。
S30:区块链程序将业务数据上链;
区块链程序接收到JSON串之后,将它解析,填充到对应的对象结构中,创建交易,将物品对象保存到对应的交易对象中,并在交易签名的时候,把物品对象哈希一起签名,保证交易的不可篡改,将交易广播至挖矿节点打包至区块链内。
S40:返回对象所在交易和区块的哈希;
物品经过7个区块确认之后,将该物品对象所在交易和区块哈希通过socket返回给业务层。
S50:业务层通过调用区块链程序提供的rpc查询该对象是否上链。
利用面向对象语言(c++),对物品进行对象化描述,每一个物品的赋码由统一的赋码服务生成,并使用相应的标签对物品的拆分、打包、孳息、转化等动作进行标记,如果在这个过程中有新的物品生成,申请赋码,然后将这一系列的信息通过JSON对象标记语言将这些信息进行格式化并存储在相应的字段中,保存在交易中,最后通过矿工挖矿打包写入区块链上,后面将这个对象所在的交易和区块的哈希返回记录下来,为后期检索提供依据,这些数据在写入磁盘时可以配置是否压缩,对存储空间进行充分利用。
名词解释:
【1】原生赋码:给一个定物品赋码。
【2】聚合赋码:已赋码多物品聚合成一个新物品并赋码(打包装箱)。
【3】拆分赋码:已赋码物品拆分成多个新物品并赋码,可以理解为聚合的逆过程。
【4】孳息赋码:已赋码物品孳息,生成新物品。例:鸡生蛋。
【5】转化赋码:已赋码物品转化为其他物品。例:鸡蛋孵化出小鸡。
设计原则-基于比特币区块链做扩展,扩展字段经简单解码后,有简要信息供用户识读,物物之间关系分类;
Flag=0,给定物品付赋码;
Flag=1,赋码物品位置流转/状态变化;
Flag=2,赋码物品权利流转;
Flag=3,赋码多物品聚合成一个新物品并赋码(打包装箱);
Flag=4,赋码物品拆分成多个新物品并赋码,可以理解为3的逆过程;
Flag=5,物品孳息,生成新物品;
Flag=6/7,单物关联/解关联,物品贴运单/临时盛放容器等,运单位置变化等同于物品位置变化;
Flag=8,物品转化赋码,鸡蛋孵出小鸡。
需要下载一份开源的区块链代码(bitcoin),自己定义一个类用于封装物品对象,然后找到交易结构,在其属性中增加对象封装的对象,并增加交易类型,如果是普通交易,此对象可以不创建,由于增加这些属性之后,整个交易的哈希值变动了,创世区块需要重新计算,然后创建交易时,需要对其签名,防止恶意节点攻击。
该基于区块链的对象关联封装存储方法,其结构合理,数据易于封装,数据高效存储,轻松上链,无法篡改;任何物品都可以使用该对象结构,然后经过格式化后写入区块链,为后期存证提供依据,并且可以使用snappy、zip、lz4等压缩算法进行压缩存储,节约空间。
以上的仅是本发明的优选实施方式,应当指出,对于本领域的技术人员来说,在不脱离本发明构思的前提下,还可以作出若干变形和改进,这些也应该视为本发明的保护范围, 这些都不会影响本发明实施的效果和专利的实用性。

Claims (5)

  1. 一种基于区块链的对象关联封装存储方法,其特征在于,包括以下步骤:
    S10:上层业务系统与底层区块链建立连接的动作;
    S20:根据用户提供的物品,业务系统封装对象JSON串,传入区块链程序;
    S30:区块链程序将业务数据上链;
    S40:返回对象所在交易和区块的哈希;
    S50:业务层通过调用区块链程序提供的rpc查询该对象是否上链。
  2. 根据权利要求1所述的基于区块链的对象关联封装存储方法,其特征在于,在步骤S10中,建立连接的动作为赋码服务和比特币程序,运行业务系统和底层区块链程序,然后通过tcp/ip协议建立socket通信,连接监理完毕。
  3. 根据权利要求1所述的基于区块链的对象关联封装存储方法,其特征在于,在步骤S20中,根据用户提供的物品对象,在业务层为这个物品申请一个唯一Object ID,并将物品的经纬度、时间、关键信息、物品的状态标签、第三方URL信息格式化成一个JSON串,通过socket连接发送JSON串给底层区块链程序处理。
  4. 根据权利要求1所述的基于区块链的对象关联封装存储方法,其特征在于,在步骤S30中,区块链程序接收到JSON串之后,将它解析,填充到对应的对象结构中,创建交易,将物品对象保存到对应的交易对象中,并在交易签名的时候,把物品对象哈希一起签名,保证交易的不可篡改,将交易广播至挖矿节点打包至区块链内。
  5. 根据权利要求1所述的基于区块链的对象关联封装存储方法,其特征在于,在步骤S40中,物品经过7个区块确认之后,将该物品对象所在交易和区块哈希通过socket返回给业务层。
PCT/CN2019/077931 2018-05-24 2019-03-13 一种基于区块链的对象关联封装存储方法 WO2019223401A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810510888.1 2018-05-24
CN201810510888.1A CN108829749A (zh) 2018-05-24 2018-05-24 一种基于区块链的对象关联封装存储方法

Publications (1)

Publication Number Publication Date
WO2019223401A1 true WO2019223401A1 (zh) 2019-11-28

Family

ID=64145518

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/077931 WO2019223401A1 (zh) 2018-05-24 2019-03-13 一种基于区块链的对象关联封装存储方法

Country Status (2)

Country Link
CN (1) CN108829749A (zh)
WO (1) WO2019223401A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108829749A (zh) * 2018-05-24 2018-11-16 深圳前海益链网络科技有限公司 一种基于区块链的对象关联封装存储方法
CN110032581A (zh) * 2019-01-18 2019-07-19 阿里巴巴集团控股有限公司 一种基于区块链的业务文件存储方法及装置
CN111935000B (zh) 2020-09-25 2021-01-08 支付宝(杭州)信息技术有限公司 消息传输方法及装置
CN113079079B (zh) 2020-09-25 2022-08-02 支付宝(杭州)信息技术有限公司 消息传输方法及装置
CN113079081B (zh) 2020-09-25 2022-08-02 支付宝(杭州)信息技术有限公司 消息传输方法及装置
CN111934996B (zh) 2020-09-25 2021-01-12 支付宝(杭州)信息技术有限公司 消息传输方法及装置
CN111935315B (zh) 2020-09-25 2021-01-12 支付宝(杭州)信息技术有限公司 区块同步方法及装置
CN111935314B (zh) 2020-09-25 2021-01-12 支付宝(杭州)信息技术有限公司 区块链系统、消息传输方法及装置
CN111934997B (zh) 2020-09-25 2021-01-12 支付宝(杭州)信息技术有限公司 消息传输方法及装置
CN111934998B (zh) * 2020-09-25 2021-02-09 支付宝(杭州)信息技术有限公司 消息传输方法及装置
CN117251889B (zh) * 2023-11-13 2024-03-01 腾讯科技(深圳)有限公司 区块链共识方法、相关装置和介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104320262A (zh) * 2014-11-05 2015-01-28 中国科学院合肥物质科学研究院 基于加密数字货币公开账本技术的用户公钥地址绑定、检索和校验的方法及系统
CN106230852A (zh) * 2016-08-29 2016-12-14 中国银联股份有限公司 基于以太坊区块链技术的金融服务应用系统
CN107395353A (zh) * 2017-04-24 2017-11-24 阿里巴巴集团控股有限公司 一种区块链共识方法及装置
CN108829749A (zh) * 2018-05-24 2018-11-16 深圳前海益链网络科技有限公司 一种基于区块链的对象关联封装存储方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106339875B (zh) * 2016-08-25 2019-09-06 江苏通付盾科技有限公司 基于公有区块链的操作记录审查方法及装置
CN106357612B (zh) * 2016-08-25 2019-07-16 江苏通付盾科技有限公司 基于公有区块链的认证记录审查方法及装置
CN106991164A (zh) * 2017-03-31 2017-07-28 北京京东金融科技控股有限公司 基于区块链的用于金融数据处理的方法、装置及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104320262A (zh) * 2014-11-05 2015-01-28 中国科学院合肥物质科学研究院 基于加密数字货币公开账本技术的用户公钥地址绑定、检索和校验的方法及系统
CN106230852A (zh) * 2016-08-29 2016-12-14 中国银联股份有限公司 基于以太坊区块链技术的金融服务应用系统
CN107395353A (zh) * 2017-04-24 2017-11-24 阿里巴巴集团控股有限公司 一种区块链共识方法及装置
CN108829749A (zh) * 2018-05-24 2018-11-16 深圳前海益链网络科技有限公司 一种基于区块链的对象关联封装存储方法

Also Published As

Publication number Publication date
CN108829749A (zh) 2018-11-16

Similar Documents

Publication Publication Date Title
WO2019223401A1 (zh) 一种基于区块链的对象关联封装存储方法
CN106980669B (zh) 一种数据的存储、获取方法及装置
CN111507709B (zh) 一种数据溯源系统
US10313410B2 (en) Systems and methods using binary dynamic rest messages
US20190043011A1 (en) Method and system for storing and retrieving packaging and re-packaging relations
US20210081938A1 (en) Method and apparatus for computer-assisted provision of a security-protected digital twin
CN112686671B (zh) 基于区块链的智能合约部署方法、装置、设备以及介质
WO2008151016A2 (en) Transporting table valued parameter over tabular data stream protocol
CN110377666A (zh) 基于cmsp消息中间件进行异源数据库间数据同步的方法
EP3907689A1 (en) Rights management method, device and system, and storage medium
CN114465941B (zh) 基于收发包协同的集群计算流量仿真方法、系统与装置
EP3120267B1 (en) Communication of binary dynamic rest messages
TW202101350A (zh) 基於處理模組跨鏈發送可認證訊息的方法和裝置
US20230289782A1 (en) Smart contract-based data processing
WO2022218227A1 (zh) 基于区块链的存证方法、装置及电子设备
CN108876371B (zh) 基于区块链的消费数据存储、数据校验、数据溯源方法
CN115840787B (zh) 基于区块链的供应链数据共享方法、装置、设备及介质
CN103001945A (zh) 一种多元化资源标识安全访问方法
CN109344268A (zh) 图形数据库写入的方法、电子设备及计算机可读存储介质
Cui et al. Protecting vaccine safety: An improved, blockchain-based, storage-efficient scheme
Betti et al. Smart contracts-enabled simulation for hyperconnected logistics
TW202101441A (zh) 跨鏈發送可認證訊息的方法和裝置
TWI673988B (zh) 區塊鏈的生成方法及系統
CN104298718B (zh) 一种基于soa的分布式图档系统
CN108446815A (zh) 一种基于云制造资源的制造能力建模方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19806893

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19/05/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19806893

Country of ref document: EP

Kind code of ref document: A1