WO2021031313A1 - Transaction processing method and related apparatus - Google Patents

Transaction processing method and related apparatus Download PDF

Info

Publication number
WO2021031313A1
WO2021031313A1 PCT/CN2019/110755 CN2019110755W WO2021031313A1 WO 2021031313 A1 WO2021031313 A1 WO 2021031313A1 CN 2019110755 W CN2019110755 W CN 2019110755W WO 2021031313 A1 WO2021031313 A1 WO 2021031313A1
Authority
WO
WIPO (PCT)
Prior art keywords
account
information
sub
token
blockchain
Prior art date
Application number
PCT/CN2019/110755
Other languages
French (fr)
Chinese (zh)
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 WO2021031313A1 publication Critical patent/WO2021031313A1/en

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • G06Q20/3672Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes initialising or reloading thereof
    • 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
    • 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

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Computer Security & Cryptography (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Telephonic Communication Services (AREA)

Abstract

An account data processing method employing a blockchain and a related apparatus, for optimizing a transaction process in a blockchain system. A method according to an embodiment of the present application comprises: acquiring an access instruction of a first account, the first account comprising an account sub-account and/or a UTXO sub-account in a first blockchain system, wherein the Account sub-account and the UTXO sub-account each comprise at least one token, and the access instruction comprises identification information corresponding to the first account; when it is determined that the identification information of the first account meets a preconfigured condition, acquiring account information of the first account, wherein the account information of the first account comprises a synchronized block height; when the synchronized block height of the first account is less than a maximum block height of the first blockchain system, acquiring an unsynchronized block by means of a full node of the first blockchain system; and updating the account information of the first account according to the unsynchronized block.

Description

一种交易处理方法及相关设备A transaction processing method and related equipment
本申请要求于2019年8月20日提交中国专利局、申请号为201910770184.2、发明名称为“一种交易处理方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on August 20, 2019, the application number is 201910770184.2, and the invention title is "a transaction processing method and related equipment", the entire content of which is incorporated into this application by reference in.
技术领域Technical field
本申请涉及区块链技术领域,尤其涉及一种交易处理方法及相关设备。This application relates to the field of blockchain technology, in particular to a transaction processing method and related equipment.
背景技术Background technique
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链本质上是一个去中心化的数据库,同时作为比特币的底层技术,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次比特币网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database. At the same time, as the underlying technology of Bitcoin, it is a series of data blocks that are generated using cryptographic methods. Each data block contains a batch of Bitcoin network transactions. Information, used to verify the validity of the information (anti-counterfeiting) and generate the next block.
在区块链技术中,Token指的是通过区块链中的智能合约发布的一种令牌、积分、代币等,可以在区块链生态系统中进行流通,在进行流通的时候,一般可以将Token视为代币,例如比特币、以太币等。在当前的区块链系统中,token就是用户进行交易的资产证明,其主要有两种记录保存方式,即未被使用的交易输出(UTXO,Unspent Transaction Output)模式和Account模式,在进行交易的时候,系统通过区块链节点调用智能合约来对各个进行交易,智能合约代码中指定发行数量,通胀率等。token往往还具有交换的特质,token在不同用户之间交换的过程也都在token合约中进行(合约中记录每个用户的token余额)。In blockchain technology, Token refers to a kind of tokens, points, tokens, etc., issued through smart contracts in the blockchain, which can be circulated in the blockchain ecosystem. When circulating, generally Tokens can be regarded as tokens, such as Bitcoin, Ethereum, etc. In the current blockchain system, the token is the asset proof for the user’s transaction. There are two main types of record storage methods, namely the unused transaction output (UTXO, Unspent Transaction Output) mode and the Account mode. At that time, the system calls smart contracts through blockchain nodes to perform transactions on each, and the number of issuances and inflation rates are specified in the smart contract code. Token often has the characteristics of exchange, and the process of token exchange between different users is also carried out in the token contract (the contract records the token balance of each user).
然而,现有技术中一个智能合约对应于一个token,此外,同一个用户在同一个区块链系统中创建多个账户分别进行交易时,由于将token信息完全记录在合约中,使得后续对token进行操作都是需要使用特殊的智能合约去调用,而不同的智能合约可能调用方式不一样,且接口不统一,导致必须通过多次调用智能合约与区块链系统进行连接且需要反复登录验证才可以进行交易,使得用户在区块链中的交易过程过于繁琐,从而影响用 户体验。However, in the prior art, a smart contract corresponds to a token. In addition, when the same user creates multiple accounts in the same blockchain system to perform transactions, the token information is completely recorded in the contract, which makes subsequent transactions to the token All operations require the use of special smart contracts to call, and different smart contracts may be called in different ways, and the interfaces are not uniform. As a result, the smart contract must be called multiple times to connect with the blockchain system and repeated login verification is required. Transactions can be carried out, making the user's transaction process in the blockchain too cumbersome, thus affecting the user experience.
发明内容Summary of the invention
本申请实施例提供了一种基于区块链的账户数据处理方法及相关设备,用于优化在区块链系统中的交易过程。The embodiment of the application provides a blockchain-based account data processing method and related equipment, which are used to optimize the transaction process in the blockchain system.
本申请实施例第一方面提供了一种基于区块链的账户数据处理方法,所述方法包括:The first aspect of the embodiments of the present application provides a blockchain-based account data processing method, the method includes:
获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;Acquire an access instruction for a first account, where the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, wherein the Account sub-account and the UTXO sub-account both include at least one A token, the access instruction includes identification information corresponding to the first account;
当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;When it is determined that the identification information of the first account meets a preset condition, acquiring account information of the first account, where the account information of the first account includes the synchronized block height;
当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;When the height of the synchronized block of the first account is less than the highest block height of the first blockchain system, obtain an unsynchronized block through all nodes of the first blockchain system;
根据所述未同步区块更新所述第一账户的账户信息。Update the account information of the first account according to the unsynchronized block.
可选地,当确定所述第一账户包括所述Account子账户时,所述获取所述第一账户的账户信息包括:Optionally, when it is determined that the first account includes the Account sub-account, the acquiring account information of the first account includes:
获取所述Account子账户的结构体信息,所述Account子账户包括第一token;Acquiring structure information of the Account sub-account, where the Account sub-account includes a first token;
解析所述Account子账户的结构体信息,得到所述第一token的账户信息;Parse the structural information of the Account sub-account to obtain the account information of the first token;
所述根据所述未同步区块更新所述第一账户的账户信息包括:The updating account information of the first account according to the unsynchronized block includes:
解析所述未同步区块,得到与所述第一token的关联交易信息;Parsing the unsynchronized block to obtain related transaction information with the first token;
利用与所述第一token的关联交易信息更新所述第一token的账户信息。Update the account information of the first token by using the associated transaction information with the first token.
可选地,当确定所述第一账户包括所述UTXO子账户时,所述获取所述第一账户的账户信息包括:Optionally, when it is determined that the first account includes the UTXO sub-account, the acquiring account information of the first account includes:
获取所述UTXO子账户的结构体信息,所述UTXO子账户包括第二 token;Acquiring structure information of the UTXO sub-account, where the UTXO sub-account includes a second token;
解析所述UTXO子账户的结构体信息,得到所述第二token的账户信息;Parse the structure information of the UTXO sub-account to obtain the account information of the second token;
所述根据所述未同步区块更新所述第一账户的账户信息包括:The updating account information of the first account according to the unsynchronized block includes:
解析所述未同步区块,得到与所述第二token的关联交易信息;Analyze the unsynchronized block to obtain related transaction information with the second token;
利用与所述第二token的关联交易信息更新第二token的账户信息。Update the account information of the second token by using the associated transaction information with the second token.
可选地,所述接入指令还包括解锁信息,所述方法还包括:Optionally, the access instruction further includes unlocking information, and the method further includes:
根据所述解锁信息解锁所述第一账户的密钥文件得到所述第一账户的密钥信息;Unlocking the key file of the first account according to the unlocking information to obtain the key information of the first account;
所述根据所述未同步区块更新所述第一账户的账户信息包括:The updating account information of the first account according to the unsynchronized block includes:
使用所述第一账户的密钥信息解析所述未同步区块,得到待更新区块信息;Parse the unsynchronized block using the key information of the first account to obtain block information to be updated;
使用所述待更新区块信息更新所述第一账户的账户信息。The account information of the first account is updated using the block information to be updated.
可选地,在根据所述未同步区块更新所述第一账户的账户信息之后,所述方法还包括:Optionally, after updating the account information of the first account according to the unsynchronized block, the method further includes:
获取初始交易信息;Obtain initial transaction information;
根据所述初始交易信息从所述第一区块链中的全量节点中获取交易手续费;Obtaining transaction fees from all nodes in the first blockchain according to the initial transaction information;
使用所述第一账户的密钥信息对所述初始交易信息和所述交易手续费进行签名打包,得到第一交易信息;Use the key information of the first account to sign and package the initial transaction information and the transaction fee to obtain the first transaction information;
将所述第一交易信息发送至所述第一区块链系统的全量节点,以使得所述第一区块链系统的全量节点将所述第一交易信息进行广播。The first transaction information is sent to all nodes of the first blockchain system, so that all nodes of the first blockchain system broadcast the first transaction information.
可选地,所述获取所述第一账户的账户信息具体包括:Optionally, the acquiring account information of the first account specifically includes:
获取至少两个账户的预存信息,所述至少两个账户包括所述第一账户,所述至少两个账户一一对应于至少两个区块链系统,所述至少两个区块链系统包括所述第一区块链系统;Obtain pre-stored information of at least two accounts, the at least two accounts include the first account, the at least two accounts correspond to at least two blockchain systems one by one, and the at least two blockchain systems include The first blockchain system;
根据所述第一账户的标识信息在所述至少两个账户的预存信息中获取所述第一账户的账户信息。Acquire the account information of the first account from the pre-stored information of the at least two accounts according to the identification information of the first account.
本申请实施例第二方面提供了一种资产管理设备,所述设备包括存储 器和处理器,所述存储器上存储有可在所述处理器上运行的基于区块链的账户数据处理程序,所述基于区块链的账户数据处理程序被所述处理器执行时实现如第一方面及其实施例任一项所述的方法。The second aspect of the embodiments of the present application provides an asset management device. The device includes a memory and a processor. The memory stores a blockchain-based account data processing program that can run on the processor. When the block chain-based account data processing program is executed by the processor, the method according to any one of the first aspect and its embodiments is implemented.
可选地,所述设备为组成CDN网络或者区块链网络的节点。Optionally, the device is a node forming a CDN network or a blockchain network.
本申请实施例第三方面提供了一种基于区块链的账户数据处理系统,所述方法包括:The third aspect of the embodiments of the present application provides a blockchain-based account data processing system, and the method includes:
第一获取单元,用于获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;The first obtaining unit is configured to obtain an access instruction of a first account, where the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, wherein the Account sub-account and the Each UTXO sub-account includes at least one token, and the access instruction includes identification information corresponding to the first account;
第二获取单元,用于当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;A second acquiring unit, configured to acquire account information of the first account when it is determined that the identification information of the first account meets a preset condition, where the account information of the first account includes the synchronized block height;
第三获取单元,用于当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;The third obtaining unit is used to obtain unsynchronized blocks through all nodes of the first blockchain system when the height of the synchronized block of the first account is less than the highest block height of the first blockchain system ;
更新单元,用于根据所述未同步区块更新所述第一账户的账户信息。The update unit is used to update the account information of the first account according to the unsynchronized block.
可选地,当确定所述第一账户包括所述Account子账户时,所述第二获取单元具体用于:Optionally, when it is determined that the first account includes the Account sub-account, the second obtaining unit is specifically configured to:
获取所述Account子账户的结构体信息,所述Account子账户包括第一token;Acquiring structure information of the Account sub-account, where the Account sub-account includes a first token;
解析所述Account子账户的结构体信息,得到所述第一token的账户信息;Parse the structural information of the Account sub-account to obtain the account information of the first token;
所述更新单元具体用于:The update unit is specifically used for:
解析所述未同步区块,得到与所述第一token的关联交易信息;Parsing the unsynchronized block to obtain related transaction information with the first token;
利用与所述第一token的关联交易信息更新所述第一token的账户信息。Update the account information of the first token by using the associated transaction information with the first token.
可选地,当确定所述第一账户包括所述UTXO子账户时,所述第二获取单元具体用于:Optionally, when it is determined that the first account includes the UTXO sub-account, the second acquiring unit is specifically configured to:
获取所述UTXO子账户的结构体信息,所述UTXO子账户包括第二token;Acquiring structure information of the UTXO sub-account, where the UTXO sub-account includes a second token;
解析所述UTXO子账户的结构体信息,得到所述第二token的账户信息;Parse the structure information of the UTXO sub-account to obtain the account information of the second token;
所述更新单元具体用于:The update unit is specifically used for:
解析所述未同步区块,得到与所述第二token的关联交易信息;Analyze the unsynchronized block to obtain related transaction information with the second token;
利用与所述第二token的关联交易信息更新第二token的账户信息。Update the account information of the second token by using the associated transaction information with the second token.
可选地,所述接入指令还包括解锁信息,所述系统还包括:Optionally, the access instruction further includes unlocking information, and the system further includes:
解锁单元,用于根据所述解锁信息解锁所述第一账户的密钥文件得到所述第一账户的密钥信息;An unlocking unit, configured to unlock the key file of the first account according to the unlocking information to obtain the key information of the first account;
所述更新单元具体用于:The update unit is specifically used for:
使用所述第一账户的密钥信息解析所述未同步区块,得到待更新区块信息;Parse the unsynchronized block using the key information of the first account to obtain block information to be updated;
使用所述待更新区块信息更新所述第一账户的账户信息。The account information of the first account is updated using the block information to be updated.
可选地,所述系统还包括:Optionally, the system further includes:
第四获取单元,用于获取初始交易信息;The fourth acquiring unit is used to acquire initial transaction information;
第五获取单元,用于根据所述初始交易信息从所述第一区块链中的全量节点中获取交易手续费;A fifth acquiring unit, configured to acquire transaction fees from all nodes in the first blockchain according to the initial transaction information;
签名单元,用于使用所述第一账户的密钥信息对所述初始交易信息和所述交易手续费进行签名打包,得到第一交易信息;A signature unit, configured to use the key information of the first account to sign and package the initial transaction information and the transaction fee to obtain the first transaction information;
发送单元,用于将所述第一交易信息发送至所述第一区块链系统的全量节点,以使得所述第一区块链系统的全量节点将所述第一交易信息进行广播。The sending unit is configured to send the first transaction information to all the nodes of the first blockchain system, so that all the nodes of the first blockchain system broadcast the first transaction information.
可选地,所述第二获取单元具体用于:Optionally, the second acquiring unit is specifically configured to:
获取至少两个账户的预存信息,所述至少两个账户包括所述第一账户,所述至少两个账户一一对应于至少两个区块链系统,所述至少两个区块链系统包括所述第一区块链系统;Obtain pre-stored information of at least two accounts, the at least two accounts include the first account, the at least two accounts correspond to at least two blockchain systems one by one, and the at least two blockchain systems include The first blockchain system;
根据所述第一账户的标识信息在所述至少两个账户的预存信息中获取所述第一账户的账户信息。Acquire the account information of the first account from the pre-stored information of the at least two accounts according to the identification information of the first account.
本申请实施例第四方面提供一种计算机可读存储介质,所述计算机可读存储介质上存储有基于区块链的账户数据处理程序,所述基于区块链的账户数据处理程序可被一个或者多个处理器执行,以实现如第一方面及其实施例中任一项所述的基于区块链的账户数据处理方法。The fourth aspect of the embodiments of the present application provides a computer-readable storage medium. The computer-readable storage medium stores a blockchain-based account data processing program. The blockchain-based account data processing program can be Or executed by multiple processors to implement the blockchain-based account data processing method as described in the first aspect and any of the embodiments thereof.
本申请实施例第五方面提供了一种计算机程序产品,其特征在于,包括计算机指令,当其在计算机上运行时,使得计算机可以如第一方面及其实施例中任一项所述的基于区块链的账户数据处理方法。The fifth aspect of the embodiments of the present application provides a computer program product, which is characterized in that it includes computer instructions, which, when run on a computer, enables the computer to be based on the computer as described in the first aspect and any one of its embodiments. Block chain account data processing method.
从以上技术方案可以看出,本申请实施例具有以下优点:获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;根据所述未同步区块更新所述第一账户的账户信息。其中,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,且所述Account子账户和所述UTXO子账户均包括至少一种token,因此可以通过第一账户来对该账户中的多个子账户的token进行资产管理,与现有技术中通过调用智能合约的方式获取账户信息的方式相比,通过一个账户就可以实现多个token账户信息的处理,从而优化了token资产的管理过程,提升了用户体验。It can be seen from the above technical solutions that the embodiments of the present application have the following advantages: obtaining access instructions for a first account, the first account including Account sub-account and/or UTXO sub-account located in the first blockchain system, where , Both the Account sub-account and the UTXO sub-account include at least one token, and the access instruction includes identification information corresponding to the first account; when it is determined that the identification information of the first account meets a preset condition When the account information of the first account is acquired, the account information of the first account includes the synchronized block height; when the synchronized block height of the first account is less than the highest zone of the first blockchain system At the block height, the unsynchronized block is obtained through all nodes of the first blockchain system; the account information of the first account is updated according to the unsynchronized block. Wherein, the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, and both the Account sub-account and the UTXO sub-account include at least one type of token. The account is used for asset management of the tokens of multiple sub-accounts in the account. Compared with the method of obtaining account information by calling smart contracts in the prior art, the processing of multiple token account information can be realized through one account, thus Optimized the management process of token assets and improved user experience.
附图说明Description of the drawings
图1为本申请实施例中一种基于区块链的账户数据处理方法实施例的一个示意图;FIG. 1 is a schematic diagram of an embodiment of a blockchain-based account data processing method in an embodiment of the application;
图2为本申请实施例中一种基于区块链的账户数据处理方法实施例的另一个示意图;FIG. 2 is another schematic diagram of an embodiment of a blockchain-based account data processing method in an embodiment of the application;
图3为本申请实施例中一种基于区块链的账户数据处理方法实施例的另一个示意图;FIG. 3 is another schematic diagram of an embodiment of a blockchain-based account data processing method in an embodiment of the application;
图4为本申请实施例中一种基于区块链的账户数据处理方法实施例的另一个示意图;FIG. 4 is another schematic diagram of an embodiment of a blockchain-based account data processing method in an embodiment of the application;
图5为本申请实施例中一种基于区块链的账户数据处理方法实施例的另一个示意图;FIG. 5 is another schematic diagram of an embodiment of a blockchain-based account data processing method in an embodiment of the application;
图5-1为本申请实施例中一种基于区块链的账户数据处理方法实施例的另一个示意图;Figure 5-1 is another schematic diagram of an embodiment of a blockchain-based account data processing method in an embodiment of the application;
图5-2为本申请实施例中一种基于区块链的账户数据处理方法实施例的另一个示意图;Figure 5-2 is another schematic diagram of an embodiment of a blockchain-based account data processing method in an embodiment of the application;
图6为本申请实施例中一种资产管理设备实施例的一个示意图;FIG. 6 is a schematic diagram of an embodiment of an asset management device in an embodiment of the application;
图7为本申请实施例中一种基于区块链的账户数据处理系统实施例的一个示意图。FIG. 7 is a schematic diagram of an embodiment of a blockchain-based account data processing system in an embodiment of the application.
具体实施方式detailed description
在区块链技术中,Token指的是通过区块链中的智能合约发布的一种令牌、积分、代币等,可以在区块链生态系统中进行流通,在进行流通的时候,一般可以将Token视为代币,例如比特币、以太币等。在当前的区块链系统中,token就是用户进行交易的资产证明,其主要有两种记录保存方式,即未被使用的交易输出(UTXO,Unspent Transaction Output)模式和Account模式,在进行交易的时候,系统通过区块链节点调用智能合约来对各个进行交易,智能合约代码中指定发行数量,通胀率等。token往往还具有交换的特质,token在不同用户之间交换的过程也都在token合约中进行(合约中记录每个用户的token余额)。然而,现有技术中一个智能合约对应于一个token,此外,同一个用户在同一个区块链系统中创建多个账户分别进行交易时,必须通过多个客户端与区块链系统进行连接且需要反复登录验证才可以进行交易,使得用户在区块链中的交易过程过于繁琐,从而影响用户体验。为此,本申请实施例提供了一种基于区块链的账户数据处理方法及相关设备,用于优化在区块链系统中的交易过程。In blockchain technology, Token refers to a kind of tokens, points, tokens, etc., issued through smart contracts in the blockchain, which can be circulated in the blockchain ecosystem. When circulating, generally Tokens can be regarded as tokens, such as Bitcoin, Ethereum, etc. In the current blockchain system, the token is the asset proof for the user’s transaction. There are two main types of record storage methods, namely the unused transaction output (UTXO, Unspent Transaction Output) mode and the Account mode. At that time, the system calls smart contracts through blockchain nodes to perform transactions on each, and the number of issuances and inflation rates are specified in the smart contract code. Token often has the characteristics of exchange, and the process of token exchange between different users is also carried out in the token contract (the contract records the token balance of each user). However, in the prior art, a smart contract corresponds to a token. In addition, when the same user creates multiple accounts in the same blockchain system to perform transactions, multiple clients must be connected to the blockchain system and It requires repeated login verifications to conduct transactions, which makes the user's transaction process in the blockchain too cumbersome and affects the user experience. To this end, the embodiments of the present application provide a blockchain-based account data processing method and related equipment for optimizing the transaction process in the blockchain system.
请参阅图1,本申请实施例中一种基于区块链的账户数据处理方法的一个实施例包括:Referring to Fig. 1, an embodiment of a blockchain-based account data processing method in an embodiment of the present application includes:
101、获取第一账户的接入指令;101. Obtain an access instruction for the first account;
本实施例中,资产管理设备获取第一账户的接入指令,其中,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息。In this embodiment, the asset management device obtains the access instruction of the first account, where the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, wherein the Account sub-account Both the UTXO sub-account include at least one token, and the access instruction includes identification information corresponding to the first account.
具体地,该资产管理设备可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、掌上电脑、便携计算机、智能路由器、矿机、网络存储设备终端设备。Specifically, the asset management device may be a PC (Personal Computer, personal computer), or a smart phone, a tablet computer, a palmtop computer, a portable computer, a smart router, a mining machine, or a network storage device terminal device.
在该终端设备上运行有软件程序来执行本申请实施例中的相关步骤。以该资产管理设备为智能手机为例,本实施例及后续实施例中仅以通过智能手机上的wallet APP即wallet本地钱包服务APP来实现作为说明。具体可参阅图5-1中的系统连接架构,wallet本地钱包服务505通过全量节点504与区块链系统503进行通信。作为一个优选的实施方案,这个全量节点504(peer节点),可以是使用官方开源的代码编译而成的本地peer节点,或者使用受信任第三方公开peer节点,钱包505进程示例性地可以通过RPC接口与peer节点进行通信。A software program runs on the terminal device to execute the relevant steps in the embodiments of the present application. Taking the asset management device as an example of a smart phone, this embodiment and subsequent embodiments only use the wallet APP on the smart phone, that is, the wallet local wallet service APP, as an illustration. For details, refer to the system connection architecture in FIG. 5-1. The wallet local wallet service 505 communicates with the blockchain system 503 through the full node 504. As a preferred embodiment, this full node 504 (peer node) can be a local peer node compiled using official open source code, or a trusted third party to publicly disclose the peer node. The wallet 505 process can exemplarily pass RPC The interface communicates with peer nodes.
此外,该接入指令可以包括对应于该第一账户的标示信息,例如可以是该第一账户的账户和或密码等相关信息,钱包APP在后续步骤中可以使用该第一账户的标示信息来进行解锁等相关操作,在其中,第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,也就是说,该第一账户对应于第一区块链,在该第一区块链中的区块中,包含有Account子账户和/或UTXO子账户对应的token信息,示例性地,该各个Account子账户和/或UTXO子账户可以包括一个或者多个token账户。In addition, the access instruction may include identification information corresponding to the first account, for example, it may be related information such as the account and or password of the first account, and the wallet APP may use the identification information of the first account in subsequent steps. Perform unlocking and other related operations, where the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, wherein the Account sub-account and the UTXO sub-account both include at least one token That is to say, the first account corresponds to the first blockchain, and the blocks in the first blockchain contain the token information corresponding to the Account sub-account and/or UTXO sub-account, for example, The respective Account sub-account and/or UTXO sub-account may include one or more token accounts.
102、当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;102. When it is determined that the identification information of the first account meets a preset condition, acquire account information of the first account, where the account information of the first account includes the synchronized block height;
具体地,该设备可以是根据预存的数据对该第一账户的标示信息进行验证,当该第一账户的标示信息与预存信息相匹配时,可以确定其符合预设条件。此外,当确定该第一账户的标识信息符合预设条件时,即确认此 次账户接入相关操作是合法的,此时,可以在第一区块链系统中加载该第一账户的账户信息,即进行账户的初始化操作,加载钱包运行的一些数据,从而获取到第一账户的账户信息。Specifically, the device may verify the identification information of the first account according to pre-stored data, and when the identification information of the first account matches the pre-stored information, it may be determined that it meets the preset conditions. In addition, when it is determined that the identification information of the first account meets the preset conditions, it is confirmed that this account access related operation is legal. At this time, the account information of the first account can be loaded in the first blockchain system , That is, to initialize the account, load some data of the wallet operation, and obtain the account information of the first account.
在本步骤中,具体可以是用户调用钱包的unlock_account接口来使得该设备获取第一账户的接入指令,其中,第一账户包括位于一个区块链系统中的子账户对应的token账户。此外,该设备可以在本步骤中首先获取到本地数据,也就是说从钱包本地的账户数据库中获取得到第一账户的账户信息,其中,该第一账户的账户信息包括已同步的区块高度,也就是说,在本地数据库中找到历史已完成更新的最高区块,并获取该区块的高度。In this step, specifically, the user calls the unlock_account interface of the wallet to make the device obtain the access instruction of the first account, where the first account includes a token account corresponding to a sub-account in a blockchain system. In addition, the device can first obtain the local data in this step, that is, obtain the account information of the first account from the local account database of the wallet, where the account information of the first account includes the synchronized block height In other words, find the highest block in the local database that has been updated in history, and get the height of the block.
103、当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;103. When the height of the synchronized block of the first account is less than the highest block height of the first blockchain system, obtain an unsynchronized block through all nodes of the first blockchain system;
本实施例中,当该设备发现所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,则通过所述第一区块链系统的全量节点获取未同步区块。In this embodiment, when the device finds that the height of the synchronized block of the first account is less than the highest block height of the first blockchain system, it will obtain the unsynchronized block height through all nodes of the first blockchain system. Block.
也就是说,该设备通过钱包与第一区块链系统中的全量节点进行连接,并查询在该全量节点中的最高区块高度,也就是在第一区块链系统中已达成共识的最高区块的区块高度,若发现步骤102中获取得到的第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,则通过该第一区块链系统的全量节点获取未同步区块,也就是说可以从第一区块链系统中将未同步区块下载到本地。In other words, the device is connected to the full number of nodes in the first blockchain system through the wallet, and queries the highest block height in the full number of nodes, which is the highest consensus reached in the first blockchain system The block height of the block, if it is found that the synchronized block height of the first account obtained in step 102 is less than the highest block height of the first blockchain system, then pass the full node of the first blockchain system Obtain unsynchronized blocks, which means that unsynchronized blocks can be downloaded locally from the first blockchain system.
104、根据所述未同步区块更新所述第一账户的账户信息。104. Update the account information of the first account according to the unsynchronized block.
本实施例中,该设备根据步骤103得到的所述未同步区块更新所述第一账户的账户信息,也就是说,使用未同步区块对本地数据库中的第一账户的账户信息进行更新,从而使得本地数据库中的第一账户的账户信息对应的最高区块高度与第一区块链相匹配。In this embodiment, the device updates the account information of the first account according to the unsynchronized block obtained in step 103, that is, uses the unsynchronized block to update the account information of the first account in the local database , So that the highest block height corresponding to the account information of the first account in the local database matches the first blockchain.
此外,作为一个优选方案,在步骤101获取到的第一账户的接入指令还可以包括解锁信息,从而根据解锁所述第一账户的密钥文件得到所述第一账户的密钥信息。在本步骤中,具体可以是使用所述第一账户的密钥信息解析所述未同步区块,得到待更新区块信息,然后再使用所述待更新区 块信息更新所述第一账户的账户信息。In addition, as a preferred solution, the access instruction of the first account obtained in step 101 may further include unlocking information, so that the key information of the first account is obtained according to the key file for unlocking the first account. In this step, specifically, the key information of the first account may be used to parse the unsynchronized block to obtain the block information to be updated, and then use the block information to be updated to update the first account. account information.
本实施例中,获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;根据所述未同步区块更新所述第一账户的账户信息。其中,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,且所述Account子账户和所述UTXO子账户均包括至少一种token,因此可以通过第一账户来对该账户中的多个子账户的token进行资产管理,与现有技术中通过调用智能合约的方式获取账户信息的方式相比,通过一个账户就可以实现多个token账户信息的处理,从而优化了token资产的管理过程,提升了用户体验。In this embodiment, the access instruction of the first account is obtained, and the first account includes an Account sub-account and/or UTXO sub-account located in the first blockchain system, wherein the Account sub-account and the UTXO sub-account Each account includes at least one token, and the access instruction includes identification information corresponding to the first account; when it is determined that the identification information of the first account meets a preset condition, the account information of the first account is acquired , The account information of the first account includes the synchronized block height; when the synchronized block height of the first account is less than the highest block height of the first blockchain system, pass the first block All nodes of the chain system obtain unsynchronized blocks; and update the account information of the first account according to the unsynchronized blocks. Wherein, the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, and both the Account sub-account and the UTXO sub-account include at least one type of token. The account is used for asset management of the tokens of multiple sub-accounts in the account. Compared with the method of obtaining account information by calling smart contracts in the prior art, the processing of multiple token account information can be realized through one account, thus Optimized the management process of token assets and improved user experience.
基于图1所述实施例,在其中步骤102中获取所述第一账户的账户信息可以进一步地根据第一账户中包含的子账户的账户类型来加载,也就是说识别出子账户的账户类型,其中,账户类型包括UTXO或Account,在此之后,根据子账户的账户类型在根据所述未同步区块更新子账户的账户信息。也就是说,具体根据第一账户内至少两个token的类型进行个性化的账户处理,对于常用的账户类型来说,有UTXO,Account这两种,下面将分别通过图2和图3具体的实施例对这两种账户类型的账户数据处理过程进行描述。Based on the embodiment of FIG. 1, the account information of the first account obtained in step 102 can be further loaded according to the account type of the sub-account contained in the first account, that is, the account type of the sub-account is identified , Where the account type includes UTXO or Account. After that, the account information of the sub-account is updated according to the unsynchronized block according to the account type of the sub-account. That is to say, personalized account processing is performed according to the types of at least two tokens in the first account. For commonly used account types, there are two types of UTXO and Account. The following will refer to Figure 2 and Figure 3 respectively. The embodiment describes the account data processing process of these two account types.
一、当确定所述第一账户包括所述Account子账户时;1. When it is determined that the first account includes the Account sub-account;
请参阅图2,基于图1所述实施例,在一种账户数据处理方法的另一个实施例中,步骤102所述获取所述第一账户的账户信息包括:Referring to Fig. 2, based on the embodiment described in Fig. 1, in another embodiment of an account data processing method, the acquiring account information of the first account in step 102 includes:
201、获取所述Account子账户的结构体信息;201. Obtain structure information of the Account sub-account;
本实施例中,该设备获取所述Account子账户的结构体信息,所述Account子账户包括第一token。In this embodiment, the device obtains the structure information of the Account sub-account, and the Account sub-account includes the first token.
具体地,本实施例中可以获取到Account子账户的结构体信息,并且在其中,Account子账户可以包含至少一个token,此处以其中的一个token设为第一token。Specifically, in this embodiment, the structure information of the Account sub-account can be obtained, and the Account sub-account can include at least one token, and one of the tokens is set as the first token here.
202、解析所述Account子账户的结构体信息,得到所述第一token的账户信息;202. Parse the structure information of the Account sub-account to obtain the account information of the first token.
本实施例中,该设备解析步骤201得到的Account子账户的结构体信息,得到所述第一token的账户信息。In this embodiment, the device parses the structure information of the Account sub-account obtained in step 201 to obtain the account information of the first token.
具体来说,可以在Account子账户的结构体信息中的“Tokens”字段中直接读取获取到第一token的账户信息,Specifically, the account information of the first token can be directly read in the "Tokens" field in the structure information of the Account sub-account,
Account账户结构定义:Account structure definition:
type Account struct{type Account struct{
Address common.Address//Account账户地址Address common.Address//Account account address
Nonce uint64//交易序号Nonce uint64//transaction serial number
Tokens map[common.Address]*big.Int//保存Token对应余额的mapTokens map[common.Address]*big.Int//Save the map corresponding to the Token balance
}}
其中,该Account子账户的结构体信息可以保存有至少一个token的账户信息,也就是说,在该Account子账户的结构体信息中可以对应有多个token,本实施例中其中仅以第一token作为其中的一个作为示例。Among them, the structure information of the Account sub-account can store account information of at least one token, that is, there can be multiple tokens corresponding to the structure information of the Account sub-account. In this embodiment, only the first Take token as one of them as an example.
步骤104根据所述未同步区块更新所述第一账户的账户信息包括:Step 104 updating the account information of the first account according to the unsynchronized block includes:
203、解析所述未同步区块,得到与所述第一token的关联交易信息;203. Parse the unsynchronized block to obtain related transaction information with the first token;
本实施例中,该设备对步骤103获取得到的未同步区块中进行解析,可以在其中获取到与第一token的关联交易信息,也就是说,获取第一账户在第一token的历史交易记录、当前的余额等关联交易信息。In this embodiment, the device parses the unsynchronized block obtained in step 103, and can obtain associated transaction information with the first token, that is, obtain the historical transaction of the first account in the first token. Related transaction information such as records and current balances.
204、利用与所述第一token的关联交易信息更新所述第一token的账户信息;204. Use the associated transaction information with the first token to update the account information of the first token;
本实施例中,该设备具体是使用第一token的关联交易信息更新第一token的的账户信息,由于第一token的账户类型为Account账户,因此,更新过程可以是直接使用与所述第一token的关联交易信息替换掉在步骤202获取得到的第一账户的账户信息,以完成数据更新。In this embodiment, the device specifically uses the associated transaction information of the first token to update the account information of the first token. Since the account type of the first token is an Account account, the update process can be directly used with the first token. The associated transaction information of the token replaces the account information of the first account obtained in step 202 to complete the data update.
二、当确定所述第一账户包括所述UTXO子账户时;2. When it is determined that the first account includes the UTXO sub-account;
请参阅图3,基于图1所述实施例,在一种账户数据处理方法的另一个实施例中,步骤102所述获取所述第一账户的账户信息包括:Referring to FIG. 3, based on the embodiment described in FIG. 1, in another embodiment of an account data processing method, obtaining account information of the first account in step 102 includes:
301、获取所述UTXO子账户的结构体信息;301. Obtain structure information of the UTXO sub-account;
本实施例中,该设备获取所述UTXO子账户的结构体信息,所述UTXO子账户包括第二token。In this embodiment, the device obtains the structure information of the UTXO sub-account, and the UTXO sub-account includes a second token.
具体地,本实施例中可以获取到UTXO子账户的结构体信息,并且在其中,UTXO子账户可以包含至少一个token,此处以其中的一个token设为第二token。Specifically, in this embodiment, the structure information of the UTXO sub-account can be obtained, and the UTXO sub-account can contain at least one token, and one of the tokens is set as the second token here.
302、解析所述UTXO子账户的结构体信息,得到所述第二token的账户信息;302. Parse the structure information of the UTXO sub-account to obtain the account information of the second token.
本实施例中,该设备解析步骤201得到的Account子账户的结构体信息,得到所述第一token的账户信息。In this embodiment, the device parses the structure information of the Account sub-account obtained in step 201 to obtain the account information of the first token.
具体来说,可以在UTXO子账户的结构体信息中的“Tokens”字段中直接读取获取到第二token的账户信息,Specifically, the account information of the second token can be directly read in the "Tokens" field in the structure information of the UTXO sub-account,
UTXO账户结构定义UTXO account structure definition
type UTXO struct{type UTXO struct{
Address common.Address//UTXO账户地址Address common.Address//UTXO account address
Tokens map[common.Address]*big.Int//保存Token对应余额的mapTokens map[common.Address]*big.Int//Save the map corresponding to the Token balance
Transfers[]*tctypes.UTXOOutputDetail//所有本账户相关UTXO交易数组Transfers[]*tctypes.UTXOOutputDetail//All UTXO transaction arrays related to this account
}}
其中,among them,
UTXOOutputDetail交易详细结构UTXOOutputDetail transaction detailed structure
Figure PCTCN2019110755-appb-000001
Figure PCTCN2019110755-appb-000001
Figure PCTCN2019110755-appb-000002
Figure PCTCN2019110755-appb-000002
具体在其中,该UTXO子账户的结构体信息可以保存有至少一个token的账户信息,也就是说,在该UTXO子账户的结构体信息中可以对应有多个token,本实施例中其中仅以第二token作为其中的一个作为示例。Specifically, the structure information of the UTXO sub-account can store account information of at least one token, that is, there can be multiple tokens corresponding to the structure information of the UTXO sub-account. In this embodiment, only Take the second token as an example.
步骤104根据所述未同步区块更新所述第一账户的账户信息包括:Step 104 updating the account information of the first account according to the unsynchronized block includes:
303、解析所述未同步区块,得到与所述第二token的关联交易信息;303. Parse the unsynchronized block to obtain associated transaction information with the second token;
本实施例中,该设备对步骤103获取得到的未同步区块中进行解析,可以在其中获取到与第一token的关联交易信息,也就是说,获取第一账户在第一token的历史交易记录、当前的余额等关联交易信息。In this embodiment, the device parses the unsynchronized block obtained in step 103, and can obtain associated transaction information with the first token, that is, obtain the historical transaction of the first account in the first token. Related transaction information such as records and current balances.
304、利用与所述第二token的关联交易信息更新所述第二token的账户信息;304. Use the associated transaction information with the second token to update the account information of the second token;
本实施例中,该设备具体是使用第二token的关联交易信息更新第一token的账户信息,由于第一token的账户类型为UTXO账户,因此,更新过程需要将与所述第二token的关联交易信息和步骤202中获取得到的第二账户的账户信息进行融合计算,从而计算出该第一账户对应第二token的账户信息,已完成对第二token的账户信息的数据更新。In this embodiment, the device specifically uses the associated transaction information of the second token to update the account information of the first token. Since the account type of the first token is a UTXO account, the update process needs to be associated with the second token The transaction information and the account information of the second account obtained in step 202 are fused and calculated to calculate the account information corresponding to the second token of the first account, and the data update of the account information of the second token has been completed.
本申请实施例中,基于图1至图3所述实施例,具体在步骤104根据所述未同步区块更新所述第一账户的账户信息之后,也就是说该设备以及 完成第一账户的账户信息的同步,此时,可以使用该第一账户进行交易,即对该账户中子账户对应的token进行转账等操作。下面请参阅图4,基于图1至图3所述实施例,在一种账户数据处理方法的另一个实施例中,具体在步骤104根据所述未同步区块更新所述第一账户的账户信息之后,该方法还可以包括:In the embodiment of this application, based on the embodiments described in Figures 1 to 3, specifically after step 104 updates the account information of the first account according to the unsynchronized block, that is to say, the device and the completion of the first account The account information is synchronized. At this time, the first account can be used for transactions, that is, the token corresponding to the sub-account in the account can be transferred and other operations. 4, based on the embodiments described in FIGS. 1 to 3, in another embodiment of an account data processing method, specifically in step 104, the account of the first account is updated according to the unsynchronized block After the information, the method can also include:
401、获取初始交易信息;401. Obtain initial transaction information;
本实施例中,该设备可以通过接收用户的输入信息直接获取到该初始交易信息,也可以是通过接受其他终端发送的信息进而获取到该初始交易信息,此处不做限定。此外,该初始交易信息可以包括第一账户的收款方地址、交易数量、交易手续费上限或者是其他的交易相关信息,此处不做限定。In this embodiment, the device may directly obtain the initial transaction information by receiving user input information, or may obtain the initial transaction information by accepting information sent by other terminals, which is not limited here. In addition, the initial transaction information may include the payee address of the first account, the number of transactions, the upper limit of transaction fees, or other transaction-related information, which is not limited here.
402、根据所述初始交易信息从所述目标区块链中的全量节点中获取交易手续费;402. Obtain transaction fees from all nodes in the target blockchain according to the initial transaction information.
本实施例中,该设备根据步骤401获取到的初始交易信息从所述目标区块链中的全量节点中获取交易手续费,具体来说,该钱包可以按照标准流程与全量节点建立连接,而后将该初始交易信息的相关内容发送至该全量节点,使得该全量节点按照标准流程将交易手续费的相关信息返回至该设备。In this embodiment, the device obtains transaction fees from all nodes in the target blockchain according to the initial transaction information obtained in step 401. Specifically, the wallet can establish a connection with all nodes according to a standard process, and then The relevant content of the initial transaction information is sent to the full amount node, so that the full amount node returns the related information of the transaction fee to the device according to the standard process.
403、使用所述第一账户的密钥信息对所述初始交易信息和所述交易手续费进行签名打包,得到第一交易信息;403. Use the key information of the first account to sign and package the initial transaction information and the transaction fee to obtain first transaction information.
本实施例中,该设备使用步骤104中得到的第一账户的密钥信息对初始交易信息和所述交易手续费进行签名打包,得到第一交易信息,用以使得其他节点可以使用预先公布的公钥信息对该第一交易信息进行解密验证。In this embodiment, the device uses the key information of the first account obtained in step 104 to sign and package the initial transaction information and the transaction fee to obtain the first transaction information so that other nodes can use the pre-published The public key information decrypts and verifies the first transaction information.
404、将所述第一交易信息发送至所述第一区块链系统的全量节点;404. Send the first transaction information to all nodes of the first blockchain system.
本实施例中,该设备将所述第一交易信息发送至所述第一区块链系统的全量节点,以使得所述第一区块链系统的全量节点将所述第一交易信息进行广播。In this embodiment, the device sends the first transaction information to all nodes of the first blockchain system, so that all nodes of the first blockchain system broadcast the first transaction information .
具体地,该设备将第一交易信息发送至第一区块链系统中的全量节点 之后,使得该全量节点可以将该第一交易信息进行广播,并根据其他节点的反馈信息进而生成对于该第一交易信息交易状态的哈希值,并将该哈希值返回至该设备,以使得该设备获取到第一交易信息的交易状态等相关信息。Specifically, after the device sends the first transaction information to the full amount of nodes in the first blockchain system, the full amount of nodes can broadcast the first transaction information, and generate information about the first transaction based on feedback information from other nodes. A hash value of the transaction status of the transaction information, and the hash value is returned to the device, so that the device can obtain relevant information such as the transaction status of the first transaction information.
请参阅图5-2中的交易结构模式,具体在该设备中的钱包wallet APP中可以包括预存的多个账户,其中,一个账户对应一个区块链系统,且一个账户可以对应于该区块链系统中的多个token。设备在进行交易之前,具体可以存在一个选择确认的过程,请参阅图5,基于图1所述实施例,在一种账户数据处理方法的另一个实施例中,步骤102所述获取所述第一账户的账户信息具体包括:Please refer to the transaction structure model in Figure 5-2. Specifically, the wallet APP in the device can include multiple pre-stored accounts, where one account corresponds to one blockchain system, and one account can correspond to the block Multiple tokens in the chain system. Before the device performs a transaction, there may be a specific selection confirmation process. Please refer to FIG. 5. Based on the embodiment described in FIG. 1, in another embodiment of an account data processing method, the first step is obtained in step 102. The account information of an account specifically includes:
501、获取至少两个账户的预存信息;501. Obtain pre-stored information of at least two accounts;
本实施例中,该设备获取至少两个账户的预存信息,所述至少两个账户包括所述第一账户,所述至少两个账户一一对应于至少两个区块链系统,所述至少两个区块链系统包括所述第一区块链系统。In this embodiment, the device obtains pre-stored information of at least two accounts, the at least two accounts include the first account, the at least two accounts correspond to at least two blockchain systems one by one, and the at least two accounts The two blockchain systems include the first blockchain system.
具体地,设备可以在自身的数据库中获取到该至少两个账户的预存信息,其中,该预存信息可以包括各个账户的账户、密码等相关的对应信息,其中,所述至少两个账户一一对应于至少两个区块链系统,且所述至少两个区块链系统包括所述第一区块链系统。Specifically, the device may obtain the pre-stored information of the at least two accounts in its own database, where the pre-stored information may include corresponding information related to the account and password of each account, wherein the at least two accounts are one by one. It corresponds to at least two blockchain systems, and the at least two blockchain systems include the first blockchain system.
502、根据所述第一账户的标识信息在所述至少两个账户的预存信息中获取所述第一账户的账户信息。502. Acquire account information of the first account from pre-stored information of the at least two accounts according to the identification information of the first account.
本实施例中,该设备可以根据所述第一账户的标识信息在所述至少两个账户的预存信息中解锁所述第一账户,即根据该第一账户的标示信息可以确定出该解锁指令对应的区块链系统,并且根据预存信息对其进行判断,当确定输入的第一账户的标示信息符合预设条件时,则在该至少两个账户的预存信息中获取第一账户的账户信息,在后续步骤中可以使用第一账户的账户信息后可以进行后续的数据同步更新加载以及上传新的交易等。In this embodiment, the device can unlock the first account in the prestored information of the at least two accounts according to the identification information of the first account, that is, the unlock instruction can be determined according to the identification information of the first account Corresponding to the blockchain system, and judge it based on the pre-stored information, when it is determined that the input identification information of the first account meets the preset conditions, the account information of the first account is obtained from the pre-stored information of the at least two accounts In the subsequent steps, the account information of the first account can be used, and subsequent data can be synchronized, updated, and loaded, and new transactions can be uploaded.
在本实施例中,如图6所示,资产管理设备1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、掌上电脑、便携计算机、智能路由器、矿机、网络存储设备终端设备。In this embodiment, as shown in Figure 6, the asset management device 1 can be a PC (Personal Computer), or a smart phone, a tablet computer, a palmtop computer, a portable computer, a smart router, a mining machine, or a network storage. Equipment terminal equipment.
该设备1可以是组成CDN网络或者区块链网络的节点。The device 1 may be a node forming a CDN network or a blockchain network.
该资产管理设备1可以包括存储器11、处理器12和总线13。The asset management device 1 may include a memory 11, a processor 12, and a bus 13.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是资产管理设备1的内部存储单元,例如该资产管理设备1的硬盘。存储器11在另一些实施例中也可以是资产管理设备1的外部存储设备,例如资产管理设备1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括资产管理设备1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于资产管理设备1的应用软件及各类数据,例如基于区块链的账户数据处理程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the asset management device 1, for example, a hard disk of the asset management device 1. In some other embodiments, the memory 11 may also be an external storage device of the asset management device 1, such as a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD card, Flash Card, etc. Further, the memory 11 may also include both an internal storage unit of the asset management device 1 and an external storage device. The memory 11 can be used not only to store application software and various data installed in the asset management device 1, such as the code of the account data processing program 01 based on the blockchain, etc., but also to temporarily store data that has been output or will be output .
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行基于区块链的账户数据处理程序01等。The processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the execution of blockchain-based account data processing program 01, etc.
该总线13可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 13 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in FIG. 6, but it does not mean that there is only one bus or one type of bus.
进一步地,资产管理设备还可以包括网络接口14(图示中未画出),网络接口14可选的可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该设备1与其他电子设备之间建立通信连接。Further, the asset management equipment may also include a network interface 14 (not shown in the figure). The network interface 14 may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), usually To establish a communication connection between the device 1 and other electronic devices.
可选地,该设备1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting  Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在资产管理设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the device 1 may also include a user interface. The user interface may include a display (Display) and an input unit such as a keyboard (Keyboard). The optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the asset management device 1 and to display a visualized user interface.
图6仅示出了具有组件11-14以及基于区块链的账户数据处理程序01的资产管理设备1,本领域技术人员可以理解的是,图6示出的结构并不构成对资产管理设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。Figure 6 only shows the asset management device 1 with components 11-14 and the blockchain-based account data processing program 01. Those skilled in the art will understand that the structure shown in Figure 6 does not constitute an asset management device The definition of 1 may include fewer or more components than shown, or a combination of certain components, or different component arrangements.
下面从虚拟装置的角度对本申请进行说明,请参阅图7,本申请实施例中的一种基于区块链的账户数据处理系统,所述系统包括:The following describes the application from the perspective of a virtual device. Please refer to FIG. 7. In an embodiment of the application, a blockchain-based account data processing system includes:
第一获取单元701,用于获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;The first obtaining unit 701 is configured to obtain an access instruction of a first account, and the first account includes an Account sub-account and/or a UTXO sub-account located in a first blockchain system, wherein the Account sub-account and the Each of the UTXO sub-accounts includes at least one token, and the access instruction includes identification information corresponding to the first account;
第二获取单元702,用于当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;The second acquiring unit 702 is configured to acquire account information of the first account when it is determined that the identification information of the first account meets a preset condition, where the account information of the first account includes the synchronized block height;
第三获取单元703,用于当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;The third acquiring unit 703 is configured to acquire the unsynchronized area through all nodes of the first blockchain system when the height of the synchronized block of the first account is less than the highest block height of the first blockchain system Piece;
更新单元704,用于根据所述未同步区块更新所述第一账户的账户信息。The update unit 704 is configured to update the account information of the first account according to the unsynchronized block.
本实施例中,第一获取单元701,用于获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;第二获取单元702,用于当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;第三获取单元703,用于当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块; 更新单元704,用于根据所述未同步区块更新所述第一账户的账户信息。其中,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,且所述Account子账户和所述UTXO子账户均包括至少一种token,因此可以通过第一账户来对该账户中的多个子账户的token进行资产管理,与现有技术中通过调用智能合约的方式获取账户信息的方式相比,通过一个账户就可以实现多个token账户信息的处理,从而优化了token资产的管理过程,提升了用户体验。In this embodiment, the first obtaining unit 701 is configured to obtain an access instruction of a first account, where the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, wherein the Both the Account sub-account and the UTXO sub-account include at least one token, and the access instruction includes identification information corresponding to the first account; the second acquiring unit 702 is configured to determine the identification of the first account When the information meets the preset conditions, the account information of the first account is obtained, and the account information of the first account includes the synchronized block height; the third obtaining unit 703 is used for when the first account is synchronized When the block height is less than the highest block height of the first blockchain system, obtain the unsynchronized block through the full nodes of the first blockchain system; the update unit 704 is configured to update all the blocks according to the unsynchronized block Describe the account information of the first account. Wherein, the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, and both the Account sub-account and the UTXO sub-account include at least one type of token. The account is used for asset management of the tokens of multiple sub-accounts in the account. Compared with the method of obtaining account information by calling smart contracts in the prior art, the processing of multiple token account information can be realized through one account, thus Optimized the management process of token assets and improved user experience.
作为一个优选方案,当确定所述第一账户包括所述Account子账户时,所述第二获取单元702具体用于:As a preferred solution, when it is determined that the first account includes the Account sub-account, the second obtaining unit 702 is specifically configured to:
获取所述Account子账户的结构体信息,所述Account子账户包括第一token;Acquiring structure information of the Account sub-account, where the Account sub-account includes a first token;
解析所述Account子账户的结构体信息,得到所述第一token的账户信息;Parse the structural information of the Account sub-account to obtain the account information of the first token;
所述更新单元704具体用于:The updating unit 704 is specifically configured to:
解析所述未同步区块,得到与所述第一token的关联交易信息;Parsing the unsynchronized block to obtain related transaction information with the first token;
利用与所述第一token的关联交易信息更新所述第一token的账户信息。Update the account information of the first token by using the associated transaction information with the first token.
作为一个优选方案,当确定所述第一账户包括所述UTXO子账户时,所述第二获取单元具体702用于:As a preferred solution, when it is determined that the first account includes the UTXO sub-account, the second obtaining unit 702 is specifically configured to:
获取所述UTXO子账户的结构体信息,所述Account子账户包括第二token;Acquiring structure information of the UTXO sub-account, where the Account sub-account includes a second token;
解析所述UTXO子账户的结构体信息,得到所述第二token的账户信息;Parse the structure information of the UTXO sub-account to obtain the account information of the second token;
所述更新单元704具体用于:The updating unit 704 is specifically configured to:
解析所述未同步区块,得到与所述第二token的关联交易信息;Analyze the unsynchronized block to obtain related transaction information with the second token;
利用与所述第二token的关联交易信息更新第二token的账户信息。Update the account information of the second token by using the associated transaction information with the second token.
作为一个优选方案,所述接入指令还包括解锁信息,所述系统还包括:As a preferred solution, the access instruction further includes unlocking information, and the system further includes:
解锁单元705,用于根据所述解锁信息解锁所述第一账户的密钥文件得到所述第一账户的密钥信息;An unlocking unit 705, configured to unlock the key file of the first account according to the unlocking information to obtain the key information of the first account;
所述更新单元704具体用于:The updating unit 704 is specifically configured to:
使用所述第一账户的密钥信息解析所述未同步区块,得到待更新区块信息;Parse the unsynchronized block using the key information of the first account to obtain block information to be updated;
使用所述待更新区块信息更新所述第一账户的账户信息。The account information of the first account is updated using the block information to be updated.
可选地,所述系统还包括:Optionally, the system further includes:
第四获取单元706,用于获取初始交易信息;The fourth obtaining unit 706 is configured to obtain initial transaction information;
第五获取单元707,用于根据所述初始交易信息从所述第一区块链中的全量节点中获取交易手续费;The fifth acquiring unit 707 is configured to acquire transaction fees from all nodes in the first blockchain according to the initial transaction information;
签名单元708,用于使用所述第一账户的密钥信息对所述初始交易信息和所述交易手续费进行签名打包,得到第一交易信息;The signature unit 708 is configured to use the key information of the first account to sign and package the initial transaction information and the transaction fee to obtain the first transaction information;
发送单元709,用于将所述第一交易信息发送至所述第一区块链系统的全量节点,以使得所述第一区块链系统的全量节点将所述第一交易信息进行广播。The sending unit 709 is configured to send the first transaction information to all nodes of the first blockchain system, so that all nodes of the first blockchain system broadcast the first transaction information.
可选地,所述第二获取单元702具体用于:Optionally, the second acquiring unit 702 is specifically configured to:
获取至少两个账户的预存信息,所述至少两个账户包括所述第一账户,所述至少两个账户一一对应于至少两个区块链系统,所述至少两个区块链系统包括所述第一区块链系统;Obtain pre-stored information of at least two accounts, the at least two accounts include the first account, the at least two accounts correspond to at least two blockchain systems one by one, and the at least two blockchain systems include The first blockchain system;
根据所述第一账户的标识信息在所述至少两个账户的预存信息中获取所述第一账户的账户信息。Acquire the account information of the first account from the pre-stored information of the at least two accounts according to the identification information of the first account.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

  1. 一种基于区块链的账户数据处理方法,其特征在于,所述方法包括:A blockchain-based account data processing method, characterized in that the method includes:
    获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;Acquire an access instruction for a first account, where the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, wherein the Account sub-account and the UTXO sub-account both include at least one A token, the access instruction includes identification information corresponding to the first account;
    当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;When it is determined that the identification information of the first account meets a preset condition, acquiring account information of the first account, where the account information of the first account includes the synchronized block height;
    当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;When the height of the synchronized block of the first account is less than the highest block height of the first blockchain system, obtain an unsynchronized block through all nodes of the first blockchain system;
    根据所述未同步区块更新所述第一账户的账户信息。Update the account information of the first account according to the unsynchronized block.
  2. 根据权利要求1所述的方法,其特征在于,当确定所述第一账户包括所述Account子账户时,所述获取所述第一账户的账户信息包括:The method according to claim 1, wherein when it is determined that the first account includes the Account sub-account, the obtaining account information of the first account comprises:
    获取所述Account子账户的结构体信息,所述Account子账户包括第一token;Acquiring structure information of the Account sub-account, where the Account sub-account includes a first token;
    解析所述Account子账户的结构体信息,得到所述第一token的账户信息;Parse the structural information of the Account sub-account to obtain the account information of the first token;
    所述根据所述未同步区块更新所述第一账户的账户信息包括:The updating account information of the first account according to the unsynchronized block includes:
    解析所述未同步区块,得到与所述第一token的关联交易信息;Parsing the unsynchronized block to obtain related transaction information with the first token;
    利用与所述第一token的关联交易信息更新所述第一token的账户信息。Update the account information of the first token by using the associated transaction information with the first token.
  3. 根据权利要求1所述的方法,其特征在于,当确定所述第一账户包括所述UTXO子账户时,所述获取所述第一账户的账户信息包括:The method according to claim 1, wherein when it is determined that the first account includes the UTXO sub-account, the obtaining account information of the first account comprises:
    获取所述UTXO子账户的结构体信息,所述UTXO子账户包括第二token;Acquiring structure information of the UTXO sub-account, where the UTXO sub-account includes a second token;
    解析所述UTXO子账户的结构体信息,得到所述第二token的账户信息;Parse the structure information of the UTXO sub-account to obtain the account information of the second token;
    所述根据所述未同步区块更新所述第一账户的账户信息包括:The updating account information of the first account according to the unsynchronized block includes:
    解析所述未同步区块,得到与所述第二token的关联交易信息;Analyze the unsynchronized block to obtain related transaction information with the second token;
    利用与所述第二token的关联交易信息更新第二token的账户信息。Update the account information of the second token by using the associated transaction information with the second token.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述接入指令还包括解锁信息,所述方法还包括:The method according to any one of claims 1 to 3, wherein the access instruction further includes unlocking information, and the method further includes:
    根据所述解锁信息解锁所述第一账户的密钥文件得到所述第一账户的密钥信息;Unlocking the key file of the first account according to the unlocking information to obtain the key information of the first account;
    所述根据所述未同步区块更新所述第一账户的账户信息包括:The updating account information of the first account according to the unsynchronized block includes:
    使用所述第一账户的密钥信息解析所述未同步区块,得到待更新区块信息;Parse the unsynchronized block using the key information of the first account to obtain block information to be updated;
    使用所述待更新区块信息更新所述第一账户的账户信息。The account information of the first account is updated using the block information to be updated.
  5. 根据权利要求4所述的方法,其特征在于,在根据所述未同步区块更新所述第一账户的账户信息之后,所述方法还包括:The method according to claim 4, wherein after the account information of the first account is updated according to the unsynchronized block, the method further comprises:
    获取初始交易信息;Obtain initial transaction information;
    根据所述初始交易信息从所述第一区块链中的全量节点中获取交易手续费;Obtaining transaction fees from all nodes in the first blockchain according to the initial transaction information;
    使用所述第一账户的密钥信息对所述初始交易信息和所述交易手续费进行签名打包,得到第一交易信息;Use the key information of the first account to sign and package the initial transaction information and the transaction fee to obtain the first transaction information;
    将所述第一交易信息发送至所述第一区块链系统的全量节点,以使得所述第一区块链系统的全量节点将所述第一交易信息进行广播。The first transaction information is sent to all nodes of the first blockchain system, so that all nodes of the first blockchain system broadcast the first transaction information.
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述获取所述第一账户的账户信息具体包括:The method according to any one of claims 1 to 5, wherein the acquiring account information of the first account specifically comprises:
    获取至少两个账户的预存信息,所述至少两个账户包括所述第一账户,所述至少两个账户一一对应于至少两个区块链系统,所述至少两个区块链系统包括所述第一区块链系统;Obtain pre-stored information of at least two accounts, the at least two accounts include the first account, the at least two accounts correspond to at least two blockchain systems one by one, and the at least two blockchain systems include The first blockchain system;
    根据所述第一账户的标识信息在所述至少两个账户的预存信息中获取所述第一账户的账户信息。Acquire the account information of the first account from the pre-stored information of the at least two accounts according to the identification information of the first account.
  7. 一种资产管理设备,其特征在于,所述设备包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的基于区块链的账户数据处理程序,所述基于区块链的账户数据处理程序被所述处理器执行时实现如权利要求1-6任一项所述的方法。An asset management device, characterized in that the device includes a memory and a processor, and a blockchain-based account data processing program that can be run on the processor is stored in the memory. When the account data processing program is executed by the processor, the method according to any one of claims 1-6 is implemented.
  8. 根据权利要求7所述的设备,其特征在于,所述设备为组成CDN网络或者区块链网络的节点。The device according to claim 7, wherein the device is a node forming a CDN network or a blockchain network.
  9. 一种基于区块链的账户数据处理系统,其特征在于,所述系统包括:A blockchain-based account data processing system, characterized in that the system includes:
    第一获取单元,用于获取第一账户的接入指令,所述第一账户包括位于第一区块链系统的Account子账户和/或UTXO子账户,其中,所述Account子账户和所述UTXO子账户均包括至少一种token,所述接入指令包括对应于所述第一账户的标识信息;The first obtaining unit is configured to obtain an access instruction of a first account, where the first account includes an Account sub-account and/or a UTXO sub-account located in the first blockchain system, wherein the Account sub-account and the Each UTXO sub-account includes at least one token, and the access instruction includes identification information corresponding to the first account;
    第二获取单元,用于当确定所述第一账户的标识信息符合预设条件时,获取所述第一账户的账户信息,所述第一账户的账户信息包括已同步的区块高度;A second acquiring unit, configured to acquire account information of the first account when it is determined that the identification information of the first account meets a preset condition, where the account information of the first account includes the synchronized block height;
    第三获取单元,用于当所述第一账户已同步的区块高度小于第一区块链系统的最高区块高度时,通过所述第一区块链系统的全量节点获取未同步区块;The third obtaining unit is used to obtain unsynchronized blocks through all nodes of the first blockchain system when the height of the synchronized block of the first account is less than the highest block height of the first blockchain system ;
    更新单元,用于根据所述未同步区块更新所述第一账户的账户信息。The update unit is used to update the account information of the first account according to the unsynchronized block.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有基于区块链的账户数据处理程序,所述基于区块链的账户数据处理程序可被一个或者多个处理器执行,以实现如权利要求1至6中任一项所述的基于区块链的账户数据处理方法。A computer-readable storage medium, characterized in that a blockchain-based account data processing program is stored on the computer-readable storage medium, and the blockchain-based account data processing program can be processed by one or more The device executes to implement the blockchain-based account data processing method according to any one of claims 1 to 6.
PCT/CN2019/110755 2019-08-20 2019-10-12 Transaction processing method and related apparatus WO2021031313A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910770184.2 2019-08-20
CN201910770184.2A CN110473104B (en) 2019-08-20 2019-08-20 Transaction processing method and related equipment

Publications (1)

Publication Number Publication Date
WO2021031313A1 true WO2021031313A1 (en) 2021-02-25

Family

ID=68512927

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/110755 WO2021031313A1 (en) 2019-08-20 2019-10-12 Transaction processing method and related apparatus

Country Status (2)

Country Link
CN (1) CN110473104B (en)
WO (1) WO2021031313A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874365B (en) * 2019-11-20 2023-11-17 深圳市迅雷网络技术有限公司 Information query method and related equipment thereof
CN111275414A (en) * 2019-12-31 2020-06-12 深圳市网心科技有限公司 Block chain-based digital currency exchange method, device and system
CN111475575B (en) 2020-04-09 2021-08-10 腾讯科技(深圳)有限公司 Data synchronization method and device based on block chain and computer readable storage medium
CN112487010B (en) * 2020-12-14 2024-02-23 深圳前海微众银行股份有限公司 Block chain user data table updating method, equipment and storage medium
CN112749967A (en) * 2021-01-19 2021-05-04 矩阵元技术(深圳)有限公司 Transaction data processing method and device, user terminal and server
CN114708773A (en) * 2021-10-11 2022-07-05 深圳市海凌科电子有限公司 Block chain teaching system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503992A (en) * 2016-10-18 2017-03-15 北京天德科技有限公司 A kind of block chain that Transaction Information and accounts information are stored respectively
WO2018128539A1 (en) * 2017-01-08 2018-07-12 Bernard Rene F A method for checking and/or updating information relating to assets
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109493054A (en) * 2018-11-27 2019-03-19 深圳链报科技有限公司 Multichain approaches to IM, device, storage medium and block chain identity resolution device
CN109784020A (en) * 2019-02-15 2019-05-21 上海优扬新媒信息技术有限公司 A kind of block chain right management method and device
CN110084599A (en) * 2019-04-28 2019-08-02 百度在线网络技术(北京)有限公司 Cipher key processing method, device, equipment and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170091726A1 (en) * 2015-09-07 2017-03-30 NXT-ID, Inc. Low bandwidth crypto currency transaction execution and synchronization method and system
WO2017134281A1 (en) * 2016-02-04 2017-08-10 Nasdaq Technology Ab Systems and methods for storing and sharing transactional data using distributed computer systems
AU2018101669A4 (en) * 2017-01-08 2018-12-13 Rene F. Bernard A method for checking and/ or updating information relating to assets
CN107248074A (en) * 2017-03-29 2017-10-13 阿里巴巴集团控股有限公司 A kind of method for processing business and equipment based on block chain
CN107679857B (en) * 2017-10-10 2021-04-27 马晶瑶 Block chain cross-chain transaction method and storage medium
US11386405B2 (en) * 2017-12-19 2022-07-12 International Business Machines Corporation Dynamic blockchain transactional policy management
CN108335106A (en) * 2018-01-24 2018-07-27 深圳壹账通智能科技有限公司 The more account books of Zero Knowledge based on block chain exchange transfer account method, device and storage medium
CN111899012B (en) * 2018-10-26 2024-04-05 创新先进技术有限公司 Block chain-based money transfer method and device
CN109741038A (en) * 2018-12-12 2019-05-10 深圳市网心科技有限公司 Token processing method, computer readable storage medium and electronic equipment based on block chain account
CN109859047A (en) * 2019-01-31 2019-06-07 北京瑞卓喜投科技发展有限公司 A kind of block chain update method and block chain more new system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503992A (en) * 2016-10-18 2017-03-15 北京天德科技有限公司 A kind of block chain that Transaction Information and accounts information are stored respectively
WO2018128539A1 (en) * 2017-01-08 2018-07-12 Bernard Rene F A method for checking and/or updating information relating to assets
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109493054A (en) * 2018-11-27 2019-03-19 深圳链报科技有限公司 Multichain approaches to IM, device, storage medium and block chain identity resolution device
CN109784020A (en) * 2019-02-15 2019-05-21 上海优扬新媒信息技术有限公司 A kind of block chain right management method and device
CN110084599A (en) * 2019-04-28 2019-08-02 百度在线网络技术(北京)有限公司 Cipher key processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110473104B (en) 2023-11-17
CN110473104A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
WO2021031313A1 (en) Transaction processing method and related apparatus
CN107430657B (en) Authentication by proxy
US11558181B2 (en) Method and system for state associated device identification for digital payments using blockchain technology
CA3011600C (en) Information transaction infrastructure
JP2019185774A (en) Integrated log-in method for block chain infrastructure, terminal, and server using the same
JP2022520656A (en) Computer-implemented systems and methods for performing transfers over the blockchain network
US10778603B2 (en) Systems and methods for controlling access to broker resources
CN106296184A (en) Electronic money management method and electronic-monetary system
US11979485B2 (en) Electronic device providing blockchain account information and method of operating the same
TW202022753A (en) Invoice creating method and device based on block chain and electronic device
US20230368197A1 (en) Method and system for mediated cross ledger stable coin atomic swaps using hashlocks
CN113474804A (en) Transaction and account verification method, device and storage medium of digital currency
CN107644263A (en) Method and server are handled in banking reservation
TWI736608B (en) Method and device for facilitating expansion of payment subject
US20190114627A1 (en) Foreign currency transaction system and method
CN110493008B (en) Block chain authentication method, device, equipment and medium
JP7308977B2 (en) Method, transaction management device and computer readable medium for facilitating concurrent trading
US11238423B2 (en) Method and system for device micropayment aggregation based on tangle network
WO2021031429A1 (en) Blockchain account address generation method, system and apparatus and computer-readable storage medium
TW201939415A (en) Service verification method and device
US20230244859A1 (en) System and method for automatically sharing verified user information across remote systems
WO2024066749A1 (en) Blockchain transaction execution method and apparatus, program product, device, and medium
CN109461222A (en) Information access method of checking card, system and electronic equipment based on equipment of checking card
WO2022156696A1 (en) Data processing method and apparatus, computer device, and readable storage medium
CN112785380B (en) Transaction processing method and device

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: 19942599

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19942599

Country of ref document: EP

Kind code of ref document: A1