CN112506998A - 一种基于区块链智能合约的数据上链方法 - Google Patents

一种基于区块链智能合约的数据上链方法 Download PDF

Info

Publication number
CN112506998A
CN112506998A CN202011489355.3A CN202011489355A CN112506998A CN 112506998 A CN112506998 A CN 112506998A CN 202011489355 A CN202011489355 A CN 202011489355A CN 112506998 A CN112506998 A CN 112506998A
Authority
CN
China
Prior art keywords
data
intelligent contract
block
block chain
key value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011489355.3A
Other languages
English (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.)
Fuzhou Lingyun Data Technology Co ltd
Original Assignee
Fuzhou Lingyun Data 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 Fuzhou Lingyun Data Technology Co ltd filed Critical Fuzhou Lingyun Data Technology Co ltd
Priority to CN202011489355.3A priority Critical patent/CN112506998A/zh
Publication of CN112506998A publication Critical patent/CN112506998A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Strategic Management (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Fuzzy Systems (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本发明涉及一种基于区块链智能合约的数据上链方法,包括以下步骤:S1,在调用数据保存时,智能合约会自动将数据写入到区块链的存储区中,并且调用uuid算法随机生成一个key值返回;S2,在调用数据查询时,将key值传入,此时智能合约可以根据key值查询对应的数据并且返回;S3,在上层应用层保存key值以及智能合约调用时所包含在的区块高度或者区块哈希作为区块添加的溯源字段,可以直接调用区块链浏览器查看区块信息。本发明采用区块链的智能合约进行数据上链操作,智能合约是事先发布到区块链上的一段代码,该代码可以接受来自矿工的调用从而执行一些特性的操作。在该应用有事先定义好的数据上链接口,可以随时访问该接口并将数据写入到链上。

Description

一种基于区块链智能合约的数据上链方法
技术领域
本发明涉及区块链技术领域,尤其是涉及一种基于区块链智能合约的数据上链方法。
背景技术
区块链技术的快速发展使区块链有可能应用于各行各业中,在实际应用区块链时,通常要把数据给上传到区块链上,通过区块链的特性来保证数据的不可篡改,这个过程称之为数据上链。
现有的技术中,是通过区块链的交易过程让一些基础的数据跟随每笔交易进行数据上链,此种方式在每次上链一条数据都要进行一次交易,这样导致过程非常缓慢,上链的数据量非常有限,而且类型还是固定的字符串。此种上链方式在很多的实际应用场景难以适用,而且因为数据的局限性,从而导致区块链的利用也相当简单,无法真正使用区块链的各种高级特性,比如去中心化特性。
发明内容
针对现有技术存在的不足,本发明的目的是提供一种基于区块链智能合约的数据上链方法,使得区块链能够承载除了基础数据之外的更多类型的数据,不在局限于基础的字符串。并且不止可以将数据上链,还可以将一些可以用代码实现的逻辑上链,让区块链自动执行某些合约以实现完全去中心化的业务逻辑。
本发明的上述发明目的是通过以下技术方案得以实现的:
一种基于区块链智能合约的数据上链方法,包括以下步骤:
S1,在调用数据保存时,智能合约会自动将数据写入到区块链的存储区中,并且调用uuid算法随机生成一个key值返回;
S2,在调用数据查询时,将所述key值传入,此时所述智能合约可以根据所述key值查询对应的数据并且返回;
S3,在上层应用层保存所述key值以及所述智能合约调用时所包含在的区块高度或者区块哈希作为区块添加的溯源字段,可以直接调用区块链浏览器查看区块信息。
通过上述技术方案,本发明采用区块链的智能合约进行数据上链操作,智能合约是事先发布到区块链上的一段代码,该代码可以接受来自矿工的调用从而执行一些特性的操作。在该应用有事先定义好的数据上链接口,可以随时访问该接口并将数据写入到链上。
本发明在一较佳示例中可以进一步配置为:所述智能合约包含一个数据保存接口,一个数据查询接口。
本发明在一较佳示例中可以进一步配置为:所述智能合约为区块链上的智能合约,可以运行在支持智能合约的区块链上。
综上所述,本发明包括以下至少一种有益技术效果:
1.本发明实现的上链过程中,可以使用各种各样的数据类型,不在局限于基础的字符串。
2.本发明可以自定义键值的生成方式,以便于后续数据的分析。
3.本发明不止可以将数据上链,还可以将一些可以用代码实现的逻辑上链,让区块链自动执行某些合约以实现完全去中心化的业务逻辑。
附图说明
图1为本发明的流程简图。
具体实施方式
以下结合附图对本发明作进一步详细说明。
参照图1,为本发明公开的一种基于区块链智能合约的数据上链方法,包括以下步骤:
S1,在调用数据保存时,智能合约会自动将数据写入到区块链的存储区中,并且调用uuid算法随机生成一个key值返回;
S2,在调用数据查询时,将key值传入,此时智能合约可以根据key值查询对应的数据并且返回;
S3,在上层应用层保存key值以及智能合约调用时所包含在的区块高度或者区块哈希作为区块添加的溯源字段,可以直接调用区块链浏览器查看区块信息。
其中,智能合约包含一个数据保存接口,一个数据查询接口。智能合约为区块链上的智能合约,可以运行在支持智能合约的区块链上。本发明实现的上链过程中,可以使用各种各样的数据类型,不在局限于基础的字符串。
并且可以自定义键值的生成方式,以便于后续数据的分析。同时不止可以将数据上链,还可以将一些可以用代码实现的逻辑上链,让区块链自动执行某些合约以实现完全去中心化的业务逻辑。
本实施例的实施原理为:本发明采用区块链的智能合约进行数据上链操作,智能合约是事先发布到区块链上的一段代码,该代码可以接受来自矿工的调用从而执行一些特性的操作。在该应用有事先定义好的数据上链接口,可以随时访问该接口并将数据写入到链上。
本具体实施方式的实施例均为本发明的较佳实施例,并非依此限制本发明的保护范围,故:凡依本发明的结构、形状、原理所做的等效变化,均应涵盖于本发明的保护范围之内。

Claims (3)

1.一种基于区块链智能合约的数据上链方法,其特征在于:包括以下步骤:
S1,在调用数据保存时,智能合约会自动将数据写入到区块链的存储区中,并且调用uuid算法随机生成一个key值返回;
S2,在调用数据查询时,将所述key值传入,此时所述智能合约可以根据所述key值查询对应的数据并且返回;
S3,在上层应用层保存所述key值以及所述智能合约调用时所包含在的区块高度或者区块哈希作为区块添加的溯源字段,可以直接调用区块链浏览器查看区块信息。
2.根据权利要求1所述的一种基于区块链智能合约的数据上链方法,其特征在于:所述智能合约包含一个数据保存接口,一个数据查询接口。
3.根据权利要求1所述的一种基于区块链智能合约的数据上链方法,其特征在于:所述智能合约为区块链上的智能合约,可以运行在支持智能合约的区块链上。
CN202011489355.3A 2020-12-16 2020-12-16 一种基于区块链智能合约的数据上链方法 Pending CN112506998A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011489355.3A CN112506998A (zh) 2020-12-16 2020-12-16 一种基于区块链智能合约的数据上链方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011489355.3A CN112506998A (zh) 2020-12-16 2020-12-16 一种基于区块链智能合约的数据上链方法

Publications (1)

Publication Number Publication Date
CN112506998A true CN112506998A (zh) 2021-03-16

Family

ID=74972809

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011489355.3A Pending CN112506998A (zh) 2020-12-16 2020-12-16 一种基于区块链智能合约的数据上链方法

Country Status (1)

Country Link
CN (1) CN112506998A (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113450113A (zh) * 2021-06-28 2021-09-28 上海计算机软件技术开发中心 一种跨链交互的智能合约交互模型及协同执行系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220837A (zh) * 2017-05-31 2017-09-29 北京汇通金财信息科技有限公司 一种目标对象溯源方法及装置
CN111177275A (zh) * 2020-01-02 2020-05-19 肖光昱 基于区块链的管理方法、终端、装置及存储介质
US10824746B1 (en) * 2017-01-25 2020-11-03 State Farm Mutual Automobile Insurance Company Systems and methods for controlled access to blockchain data
CN112069262A (zh) * 2020-09-09 2020-12-11 上海万向区块链股份公司 基于区块链智能合约的对账数据上链方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10824746B1 (en) * 2017-01-25 2020-11-03 State Farm Mutual Automobile Insurance Company Systems and methods for controlled access to blockchain data
CN107220837A (zh) * 2017-05-31 2017-09-29 北京汇通金财信息科技有限公司 一种目标对象溯源方法及装置
CN111177275A (zh) * 2020-01-02 2020-05-19 肖光昱 基于区块链的管理方法、终端、装置及存储介质
CN112069262A (zh) * 2020-09-09 2020-12-11 上海万向区块链股份公司 基于区块链智能合约的对账数据上链方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
大侠区块链: ""Nebulas 101 - 04 智能合约存储区 --》星云链开发"", 《HTTPS://BLOG.CSDN.NET/TAOANBANG/ARTICLE/DETAILS/80253262 》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113450113A (zh) * 2021-06-28 2021-09-28 上海计算机软件技术开发中心 一种跨链交互的智能合约交互模型及协同执行系统

Similar Documents

Publication Publication Date Title
CN107526624B (zh) 一种基于Java虚拟机的智能合约执行引擎
CN108491320A (zh) 应用程序的异常分析方法、装置、计算机设备和存储介质
CN111563368A (zh) 报表生成方法、装置、计算机设备和存储介质
CN103714290B (zh) 一种软件行为获取、监控与验证方法
CN101526963A (zh) 网页编码识别方法、装置和终端设备
CN107665216A (zh) 一种数据库访问方法及中间件
CN110309631B (zh) 一种编程语言结构混淆处理方法、智能终端及存储介质
CN109255107A (zh) 组态软件处理方法、装置、计算机设备和存储介质
CN112527781B (zh) 一种智能合约数据迁移方法及系统
CN112506998A (zh) 一种基于区块链智能合约的数据上链方法
CN111651296A (zh) 数据删除操作的拦截备份方法、装置、设备及存储介质
CN106843993A (zh) 一种逆向解析gpu指令的方法及系统
CN104850498A (zh) 一种填充信息测试方法及系统
CN111240772A (zh) 一种基于区块链的数据处理方法、装置及存储介质
CN104572102A (zh) Java中的中文乱码解决方法
CN117033249A (zh) 一种测试用例生成方法、装置、计算机设备及存储介质
CN107294905A (zh) 一种识别用户的方法及装置
CN112765270A (zh) 区块链数据处理方法、装置、计算机设备及介质
CN108053034A (zh) 模型参数处理方法、装置、电子设备及存储介质
CN101794240A (zh) 一种聚合数据内容的方法和系统
CN101739589A (zh) 生成智能卡数据的方法及装置
CN111709026A (zh) 静态安全检测方法、装置、计算机设备和存储介质
CN116450723A (zh) 数据提取方法、装置、计算机设备及存储介质
CN109933528A (zh) 一种自动化脚本封装的方法及装置
CN107463578A (zh) 应用下载量统计数据去重方法、装置和终端设备

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210316