Method and device for asset smart contract

By maintaining the contract account list of the asset smart contract based on the consensus mechanism in the blockchain network, and using the asset account period information to execute the processing logic, the problem of on-chain processing of ticket assets is solved, and the flexible and universal on-chain operation capabilities of ticket assets are realized. .

CN111932256BActive Publication Date: 2024-10-18ZHEJIANG E COMMERCE BANK CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010817077.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-14
Publication Date
2024-10-18
Estimated Expiration
2040-08-14

AI Technical Summary

Technical Problem

Existing blockchain network methods cannot support on-chain processing of ticket assets, such as issuance, splitting, merging, circulation, and redemption.

Method used

By maintaining the contract account list of asset smart contracts based on the consensus mechanism in the blockchain network, using asset account period information to execute relevant processing logic, it supports on-chain processing of ticket assets.

Benefits of technology

It achieves flexible and universal on-chain processing capabilities for ticket assets, and enhances the management efficiency and flexibility of asset smart contracts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111932256B_ABST
    Figure CN111932256B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a method and device applied to an asset smart contract, wherein the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information. The method includes: receiving a request to execute the processing logic of the asset smart contract on an asset; and according to the request, executing the processing logic on the asset using the asset account period information of the asset.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and more particularly to a method for asset smart contracts. One or more embodiments of this specification also relate to an apparatus for asset smart contracts, a computing device, and a computer-readable storage medium. Background Art

[0002] The blockchain network is a decentralized peer-to-peer network based on P2P (Peer to Peer) technology, which is composed of several network nodes. Each of these network nodes maintains a chain of blockchains generated by cryptographic methods. These network nodes obtain the latest block number and block information through broadcasting, so as to ensure that the blockchain and account list between each network node are maintained synchronously. Therefore, transactions based on the blockchain network have the advantages of being trustworthy and tamper-proof.

[0003] Based on these advantages of blockchain networks, some methods have emerged to move offline assets to the chain for trading. However, these methods cannot support the on-chain processing of certain assets, such as the issuance, splitting, merging, circulation, and redemption of ticket assets. Summary of the invention

[0004] In view of this, the present specification provides a method for asset smart contracts. One or more embodiments of the present specification also relate to an apparatus for asset smart contracts, a computing device, and a computer-readable storage medium to solve the technical defects in the prior art.

[0005] According to the first aspect of the embodiments of this specification, a method applied to an asset smart contract is provided, wherein the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information. The method comprises: receiving a request to execute the processing logic of the asset smart contract on an asset; and according to the request, executing the processing logic on the asset using the asset account period information of the asset.

[0006] Optionally, the processing logic includes: any one or more processing logics of ticket asset issuance logic, ticket asset merging logic, ticket asset splitting logic, ticket asset circulation logic and ticket asset redemption logic.

[0007] Optionally, the asset smart contract has an asset model, and the asset model is used to set the asset attributes of the asset in the contract account. The asset attributes include: asset basic attributes, and the information corresponding to the asset basic attributes includes: amount information, holder information and asset account period information.

[0008] Optionally, the method further includes: in response to receiving a request for adding a new attribute, calling the asset model, and adding the asset attribute required to be added by the request for adding a new attribute to the asset model.

[0009] Optionally, the asset attributes also include: either or both of asset flow attributes and asset traceability attributes; the information corresponding to the asset flow attributes includes: status information before and after asset changes; the information corresponding to the asset traceability attributes includes: original information, transfer-out information, transfer-in information and amount information in asset transactions.

[0010] Optionally, the method further includes: in response to receiving a request to execute the evidence logic of the asset smart contract on an asset, obtaining information required for asset evidence from the asset attributes, and executing the asset evidence logic based on the obtained information.

[0011] Optionally, the method further includes: using a blockchain account list maintained by the blockchain network to perform login verification on the blockchain account requested for use; when the blockchain account logs in to the blockchain network, using a list of contract accounts maintained by the blockchain network to perform login verification on the contract account requested for use; when the contract account login verification is successful, controlling the behavior of the contract account in the asset smart contract according to the user authority information granted to the contract account.

[0012] Optionally, the method also includes: receiving a request to create a contract account; determining whether the contract account that issues the creation request is an administrator account; if it is an administrator account, determining whether the contract account to be created by the creation request already exists in the list of contract accounts maintained by the blockchain network; if it already exists, feeding back an account existence message to the issuer of the creation request; if it does not exist, determining whether the blockchain account used by the contract account to be created by the creation request exists in the list of blockchain accounts maintained by the blockchain network; if it exists and the blockchain account status allows the creation of a contract account, adding the contract account to be created to the list of contract accounts maintained by the blockchain network and setting corresponding permissions.

[0013] Optionally, the asset smart contract provides an extension interface, and the method further includes: adding custom processing logic to the asset smart contract through the extension interface.

[0014] Optionally, the asset smart contract provides a pre-processing process and / or a post-processing process on the interface of the processing logic; the pre-processing process is used to add a custom pre-processing logic; the post-processing process is used to add a custom post-processing logic; the method also includes: before the ticket processing logic is executed, the custom pre-processing logic is executed according to the custom pre-processing logic added in the pre-processing process; and / or, after the ticket processing logic is executed, the custom post-processing logic is executed according to the custom post-processing logic added in the post-processing process.

[0015] According to the second aspect of the embodiments of this specification, a device applied to an asset smart contract is provided, wherein the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information. The device includes: a receiving module, configured to receive a request for executing the processing logic of the asset smart contract on an asset; and a processing module, configured to execute the processing logic on the asset using the asset account period information of the asset according to the request.

[0016] According to the third aspect of the embodiments of this specification, a computing device is provided, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions: receiving a request to execute the processing logic of the asset smart contract on an asset, the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information; according to the request, the processing logic is executed on the asset using the asset account period information of the asset.

[0017] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, which, when executed by a processor, implement the steps of any one of the methods described for applying to asset smart contracts.

[0018] One embodiment of this specification provides a method for applying to asset smart contracts. Since the blockchain network where the asset smart contract is located in this method maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, the assets in the contract account have corresponding asset account information, thereby providing an information basis for on-chain processing for assets with account attributes such as ticket assets. Therefore, when the method receives a request to execute processing logic on an asset, it can execute the processing logic on the asset using the asset account information according to the request. It can be seen that the asset smart contract implemented by this method can use the asset account information to support on-chain processing of ticket assets such as splitting, merging, and circulation, etc., which increases the flexibility and versatility of asset smart contracts. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of a method applied to asset smart contracts provided by one embodiment of this specification;

[0020] Figure 2 This is a functional diagram of an asset smart contract provided by an embodiment of this specification;

[0021] Figure 3 is a process flow chart of a method applied to asset smart contracts provided by one embodiment of this specification;

[0022] Figure 4 is a processing flow chart of a method applied to asset smart contracts provided by another embodiment of this specification;

[0023] Figure 5 is a processing flow chart of a method applied to asset smart contracts provided by another embodiment of this specification;

[0024] Figure 6 It is a schematic diagram of an asset model provided by an embodiment of this specification;

[0025] Figure 7 is a schematic diagram of an asset model provided by another embodiment of this specification;

[0026] Figure 8 It is a schematic diagram of the asset creation process provided by an embodiment of this specification;

[0027] Fig. 9 This is a schematic diagram of the asset smart contract architecture provided by an embodiment of this specification;

[0028] Fig.10 This is a schematic diagram of a contract use case provided by an embodiment of this specification;

[0029] Fig.11 This is a schematic diagram of an interface definition provided by an embodiment of this specification;

[0030] Fig.12 It is a pseudo code diagram of the "credit certificate" circulation logic provided by an embodiment of this specification;

[0031] Fig.13 It is a structural diagram of a device applied to asset smart contracts provided by an embodiment of this specification;

[0032] Fig.14 It is a structural diagram of a device applied to asset smart contracts provided by another embodiment of this specification;

[0033] Fig.15 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0034] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0035] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0036] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0037] First, the terms involved in one or more embodiments of this specification are explained.

[0038] Smart contracts are a set of promises defined in digital form, on which the contract participants can execute the promised agreements. Smart contracts are connected to the blockchain network in a digital form, and the characteristics of blockchain technology ensure that the entire process of storage, reading, and execution is transparent, traceable, and cannot be tampered with. At the same time, the consensus mechanism of the blockchain itself builds a state machine system, which enables smart contracts to run efficiently.

[0039] The asset smart contract described in the embodiments of this specification, the blockchain network where it is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the ticket assets in the contract account have corresponding asset account period information, such as the start time and end time of the ticket asset account period.

[0040] In this specification, a method applied to an asset smart contract is provided. This specification also relates to an apparatus applied to an asset smart contract, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0041] Figure 1 A flowchart of a method applied to an asset smart contract provided according to an embodiment of the present specification is shown, including steps 102 to 104.

[0042] Step 102: Receive a request to execute the processing logic of the asset smart contract on the asset.

[0043] Step 104: According to the request, the processing logic is executed on the asset using the asset account period information of the asset.

[0044] Since the blockchain network where the asset smart contract described in this method is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, the assets in the contract account have corresponding asset account information, thereby providing an information basis for on-chain processing for assets with account attributes such as ticket assets. Therefore, when the method receives a request to execute processing logic on an asset, it can use the asset account information to execute the processing logic on the asset according to the request. It can be seen that the asset smart contract implemented by this method can use the asset account information to support on-chain processing of ticket assets such as splitting, merging, and circulation, etc., which increases the flexibility and versatility of the asset smart contract.

[0045] In one or more embodiments of this specification, the processing logic may include: any one or more of the ticket processing logics of ticket asset issuance logic, ticket asset merging logic, ticket asset splitting logic, ticket asset circulation logic, and ticket asset redemption logic. In this embodiment, the asset smart contract is combined with the blockchain to provide the asset account period information of the asset in the contract account, which can realize the rapid chaining of the ticket assets and realize the implementation of the blockchain and asset smart contract in the ticket asset scenario. For example, it realizes Figure 2 The asset smart contract function diagram shown in the figure shows the basic ticket asset operation capabilities such as ticket asset issuance, merger, splitting, circulation, and redemption.

[0046] In order to make the method provided in the embodiments of this specification easier to understand, the method provided in the embodiments of this specification is schematically explained below by taking the processing flow of ticket asset issuance logic, ticket asset circulation logic and ticket asset redemption logic as examples.

[0047] The following combination Figure 3 Taking the application of the method for asset smart contract provided in this specification to the issuance of ticket assets as an example, the method for asset smart contract is further explained. Figure 3 A processing flow chart of a method applied to an asset smart contract provided by an embodiment of the present specification is shown, and the specific steps include steps 302 to 316.

[0048] Step 302: Receive a request to execute the ticket asset issuance logic of the asset smart contract on the ticket asset.

[0049] Step 304: Check whether the sender of the request is an administrator.

[0050] Step 306: Check whether the holder of the ticket asset exists in the contract account maintained by the blockchain network.

[0051] Step 308: If not, it is determined that the user is not legitimate and the issuance fails.

[0052] Step 310: If yes, then obtain the amount of the ticket asset and the asset account period information according to the request, and determine whether the amount of the ticket asset and the asset account period information are legal.

[0053] Step 312: If it is illegal, the issuance of the ticket asset fails.

[0054] Step 314: If legal, add the ticket asset and the asset account period information corresponding to the ticket asset to the contract account specified in the request.

[0055] Step 316: Feedback a message indicating that the ticket asset is successfully issued to the request issuer.

[0056] The ticket asset issuance logic in this embodiment exemplarily includes the above steps 304 to 316. In actual application scenarios, the ticket asset issuance logic may include more or fewer steps. In this embodiment, the issuance of the ticket asset is achieved by adding the ticket asset and the corresponding asset account period information to the contract account.

[0057] It should be noted that since the asset smart contract itself runs on the blockchain, in the embodiments of this specification, the request for confirmation can be confirmed by sending a broadcast in the blockchain network, which will not be repeated here.

[0058] The following combination Figure 4 Taking the application of the method for asset smart contract provided in this specification to the circulation of ticket assets as an example, the method for asset smart contract is further explained. Figure 4 A processing flow chart of a method applied to an asset smart contract provided in another embodiment of the present specification is shown, and the specific steps include step 402 to step 432.

[0059] Step 402: receiving a request for executing ticket asset transfer logic, the request comprising: transferring a ticket asset with a first amount of money and expiring at a preset time from a first account to a second account.

[0060] Step 404: Check whether the first account and the second account are legal accounts.

[0061] Step 406: If it is illegal, the transfer fails.

[0062] Step 408: If legal, use the asset account period information recorded in the contract account maintained by the blockchain network to determine whether the first account has a ticket asset that meets the requested balance and account period.

[0063] If there are available ticket assets that satisfy the request, the process proceeds through the following steps 410 to 416 .

[0064] If there is no available ticket asset that satisfies the request, the following steps 418 to 432 are used to try to calculate the available accumulated assets for circulation.

[0065] Step 410: If there is a first asset that satisfies the request, find out the first asset under the first account.

[0066] Step 412: deduct the first amount from the available balance of the first asset under the first account maintained by the blockchain network.

[0067] Step 414: Add a second asset with a first amount and a preset expiration date to a second account maintained by the blockchain network.

[0068] Step 416: Return a message indicating that the second asset transaction is successful to the sender of the request.

[0069] Step 418: If there is no ticket asset that satisfies the request, query the first account maintained by the blockchain network for all ticket assets whose asset account period information is within the preset time.

[0070] Step 420: Calculate whether the total amount of all the queried ticket assets satisfies the first amount.

[0071] Step 422: If not satisfied, a transaction failure message is returned to the sender of the request.

[0072] Step 424: If satisfied, the greedy method deducts the queried ticket assets until the first amount is met.

[0073] Step 426: Using the deducted ticket assets that satisfy the first amount, generate a third asset that satisfies the first amount and expires within a preset time in the first account.

[0074] Step 428: deduct the first amount from the available balance of the third asset in the first account.

[0075] Step 430: Add a second asset with a first amount and a preset expiration date to the second account.

[0076] Step 432: Return a message indicating that the second asset transaction is successful to the sender of the request.

[0077] In this embodiment, the ticket asset transfer logic exemplarily includes the above steps 404 to 432. In actual application scenarios, the ticket asset transfer logic may include more or fewer steps. In this embodiment, the assets that meet the transfer request are queried through the asset account period information, thereby realizing the transfer of the ticket assets.

[0078] The following combination Figure 5 Taking the application of the method for asset smart contract provided in this specification to the redemption of ticket assets as an example, the method for asset smart contract is further explained. Figure 5 A processing flow chart of a method applied to an asset smart contract provided by another embodiment of the present specification is shown, and the specific steps include steps 502 to 514.

[0079] Step 502: Receive a request to execute the ticket asset redemption logic of the asset smart contract on the ticket asset.

[0080] Step 504: Check whether the sender of the request is an administrator.

[0081] Step 506: Check whether the holder of the ticket asset exists in the contract account maintained by the blockchain network.

[0082] Step 508: If not, it is determined that the user is not legitimate and the redemption fails.

[0083] Step 510: If yes, check whether the amount of the first account where the ticket asset is located and the asset account period information meet the redemption requirements according to the request.

[0084] Step 512: If satisfied, perform asset redemption processing according to the request, and modify the status and amount of the ticket assets in the first account accordingly.

[0085] Step 514: Feedback a message indicating successful redemption of the ticket assets to the sender of the request.

[0086] The ticket asset redemption logic in this embodiment exemplarily includes the above steps 504 to 514. In actual application scenarios, the ticket asset redemption logic may include more or fewer steps. In this embodiment, the assets that meet the redemption request are queried through the asset account period information, thereby realizing the redemption of the ticket assets.

[0087] Based on the above processing logic example, it can be seen that the asset smart contract implemented according to the method of the embodiment of this specification can maintain the full life cycle of asset transactions such as ticket assets, and realize technical support for the processing of ticket assets with account period attributes such as splitting and circulation. For example, the method provided in the embodiment of this specification can be applied to: the chaining, splitting, merging, circulation, and redemption of accounts receivable assets in the context of trade; the chaining, splitting, storage, and trading of large-denomination certificates of deposit; the chaining, splitting, circulation, and redemption of silver bills, etc.

[0088] In one or more embodiments of this specification, an asset model is further provided in the asset smart contract. The asset model is used to set the asset attributes of the asset in the contract account, and the asset attributes include: asset basic attributes, and the information corresponding to the asset basic attributes includes: amount information, holder information and asset account period information. In this embodiment, based on the highly abstract asset model, it is convenient to set the asset basic attributes of various assets in the contract account, realize life cycle management, and improve asset management efficiency.

[0089] In conjunction with the embodiments of the asset model, in order to further improve the flexibility of asset management and support the expansion of unique attributes of various types of assets, in one or more embodiments of this specification, the asset model provides a flexible expansion point to add new attribute types. Specifically, the method may also include: in response to receiving a request for adding a new attribute, calling the asset model, and adding the asset attribute required to be added by the request for adding a new attribute to the asset model.

[0090] For example, in Figure 6 In the asset model diagram shown, in order to manage credit certificate type assets in the asset smart contract, the "guarantee liability" attribute can be added to the original attribute of the asset model. By setting the "guarantee liability" attribute for the asset, the asset can be made into a "credit certificate" type asset, and then the asset smart contract can realize the basic capabilities of opening, circulating, trading, and redeeming "credit certificate" type assets, so that the asset smart contract can be applied to management scenarios such as logistics and express delivery.

[0091] In conjunction with the embodiments of the asset model, in order to more comprehensively support the life cycle management of various types of assets, in one or more embodiments of this specification, the asset attributes that can be set in the asset model may also include: asset flow attributes and asset traceability attributes. The information corresponding to the asset flow attributes includes: status information before and after asset changes; the information corresponding to the asset traceability attributes includes: original information, transfer-out information, transfer-in information, and amount information in asset transactions.

[0092] For example, in Figure 7 In another asset model diagram shown, the asset model is a ticket model. The basic definition of the ticket model is divided into three parts: ticket assets, ticket flow, and ticket traceability information. The main definitions and detailed attributes are as follows:

[0093] Ticket assets: The ticket master model records the amount and time of each dimension, such as asset account period information, holder information, and other information such as ticket number, which will not be repeated here;

[0094] Ticket transaction: records the information before and after a single change of a single ticket asset, such as transaction ID, etc., which will not be elaborated here;

[0095] Ticket traceability information: records the original ticket, transfer-in and transfer-out tickets, amount information, and other information such as traceability ID during a single ticket transaction, which will not be repeated here.

[0096] In one or more embodiments of this specification, combined with the asset attributes provided by the above asset model, it is possible to provide asset evidence for various asset types. Specifically, the method may also include: in response to receiving a request to execute the evidence logic of the asset smart contract on an asset, obtaining information required for asset evidence from the asset attributes, and executing the asset evidence logic according to the obtained information.

[0097] In one or more embodiments of this specification, a dual-user permission access mechanism is adopted to ensure data security. Specifically, for example, the method may also include: using the blockchain account list maintained by the blockchain network to log in and verify the blockchain account requested to be used; when the blockchain account logs in to the blockchain network, using the list of contract accounts maintained by the blockchain network to log in and verify the contract account requested to be used; when the contract account login verification is successful, controlling the behavior of the contract account in the asset smart contract according to the user permission information granted to the contract account. It can be seen that in this embodiment, only users who have passed both the blockchain account verification and the contract account verification can execute the processing logic of the asset smart contract according to the granted permissions, realizing a dual-user permission access mechanism and effectively ensuring data security.

[0098] Corresponding to the above dual user authority access mechanism, in order to ensure data security, the method provided in the embodiment of this specification can also be implemented as follows: Figure 8 The asset creation process diagram shown in the figure creates a contract account in the following steps:

[0099] Step 802: Receive a request to create a contract account.

[0100] Step 804: Determine whether the contract account that issues the creation request is an administrator account.

[0101] Step 806: Return the blockchain transaction hash value.

[0102] Step 808: If it is an administrator account, determine whether the contract account to be created by the creation request already exists in the list of contract accounts maintained by the blockchain network.

[0103] Step 810: If the contract account to be created already exists, a message indicating that the account exists is fed back to the sender of the creation request.

[0104] Step 812: If the contract account to be created does not exist, determine whether the blockchain account used by the contract account to be created by the creation request exists in the blockchain account list maintained by the blockchain network.

[0105] Step 814: If the blockchain account does not exist, account opening fails.

[0106] Step 816: If the blockchain account exists and the blockchain account status allows the creation of a contract account, the contract account to be created is added to the list of contract accounts maintained by the blockchain network and the corresponding permissions are set.

[0107] Step 818: After adding the contract account, a successful account opening message is fed back.

[0108] It can be seen that in this embodiment, since the administrator only determines that the contract account used by the sender of the creation request is a contract account maintained by the blockchain network and the blockchain account status used by the contract account to be created allows the creation of a contract account, the contract account to be created is added and the corresponding permissions are set, thereby effectively ensuring the data security of the blockchain network.

[0109] In order to expand the management capabilities of asset smart contracts, in one or more embodiments of this specification, the asset smart contract also provides an expansion interface, and the method further includes: adding custom processing logic to the asset smart contract through the expansion interface. Through this embodiment, business contracts can be expanded based on asset smart contracts, and the capabilities can be exposed externally after aggregating the business characteristics of the asset smart contract, which effectively expands the management capabilities of asset smart contracts.

[0110] For example, Fig. 9 The asset smart contract architecture diagram is shown in Figure 1. Fig. 9 As shown in the figure, based on the TBC blockchain account and the contract user account as the base, the MTC asset smart contract provides basic asset processing logic such as ticket asset issuance logic, ticket asset storage logic, ticket asset merging logic, ticket asset splitting logic, ticket asset circulation logic and ticket asset redemption logic. After the business asset contract is connected to MTC, it can expand its own capabilities and expose its capabilities to the outside world after aggregating its own business characteristics. Fig. 9 The external interfaces of the business asset contract shown may include: account creation, asset splitting, asset merging, asset transfer, asset redemption, available consultation, asset occupation, etc. Fig. 9 In the asset smart contract architecture diagram shown, the user roles and permissions within the contract can be controlled based on the contract user's account to ensure user data security. Fig. 9 In the blockchain, the MTC asset contract can be a MyBank ticket contract, which can provide basic asset operation capabilities such as asset issuance, merger, splitting, and circulation. The TBC blockchain can be a MyBank ticket chain, a blockchain that can carry multiple assets such as MyBank, and provide infrastructure for MyBank's external cooperation and data storage.

[0111] Next, from the perspective of user perception of the functions of asset smart contracts, the functions provided by different processing logics of asset smart contracts and the business functions they extend are schematically explained. Fig.10 The contract use case diagram shown in the figure shows an asset smart contract implemented according to the method provided in the embodiment of this specification. The functions available to users may include, for example: MTC account creation, asset issuance, asset merger, asset splitting, asset circulation, asset redemption, etc., creation of blockchain accounts and contract accounts based on MTC account creation, user access based on contract account creation, asset occupation based on asset merger expansion, available consultation based on asset merger and asset split expansion, asset query based on asset split expansion, and other extended functions, which will not be repeated here one by one.

[0112] Corresponding to the above functional diagram, the interface definition of the asset smart contract implemented by the method provided in the embodiment of this specification is as follows: Fig.11 As shown in the interface definition diagram, the interface based on the contract user may include: initializing the administrator, creating users, role maintenance, and role data permissions; the interface based on the MTC asset contract may include: issuance, redemption, splitting, merging, circulation, and evidence storage; the interface based on asset expansion capabilities may include: available consultation and asset freezing.

[0113] In the method provided in the embodiments of this specification, the expansion of asset trading capabilities can, on the one hand, complete the customized business logic based on the expansion interface provided by the asset smart contract in the above embodiments, and on the other hand, can be achieved through the pre-processing flow interface and / or post-processing flow interface provided by the asset smart contract for the processing logic. Specifically, for example: the pre-processing flow interface is used to add customized pre-processing logic; the post-processing flow interface is used to add customized post-processing logic. Accordingly, the method may also include: before the ticket processing logic is executed, according to the customized pre-processing logic added in the pre-processing flow interface, executing the customized pre-processing logic; and / or, after the ticket processing logic is executed, according to the customized post-processing logic added in the post-processing flow interface, executing the customized post-processing logic.

[0114] For example, Fig.12 The pseudo-code diagram of the "credit certificate" circulation logic shown in the figure provides the pre-processing process "preTrade" and the post-processing process "afterTrade" on the core interfaces of the MTC contract such as "issuance", "circulation transaction", and "redemption". Users can implement customized processing logic by copying the "preTrade" and "afterTrade" codes.

[0115] Based on multiple embodiments of this specification, the asset smart contract implemented according to the method provided in the embodiments of this specification combines the trustworthy and tamper-proof characteristics of blockchain, realizes the issuance, splitting, merging, circulation, and redemption of bill-like assets with asset account period attributes, and increases the flexibility of asset transactions; combined with the asset attributes provided by the asset model and the ability to add custom attributes, each asset type can improve its own characteristics and support equivalent transactions between different assets with different unique attributes; the asset smart contract provides expansion points, which can flexibly expand business logic on demand and realize asset life cycle management; through account authority management, data security is effectively guaranteed.

[0116] Corresponding to the above method embodiments, this specification also provides a device embodiment applied to asset smart contracts. Fig.13 The following is a schematic diagram of a device for asset smart contracts provided by an embodiment of the specification. The blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information. Fig.13 As shown, the device includes: a receiving module 1302 and a processing module 1304.

[0117] The receiving module 1302 may be configured to receive a request to execute the processing logic of the asset smart contract on the asset.

[0118] The processing module 1304 may be configured to execute the processing logic on the asset using the asset account period information of the asset according to the request.

[0119] Since the blockchain network where the asset smart contract of the device is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, the assets in the contract account have corresponding asset account information, thereby providing an information basis for on-chain processing for assets with account attributes such as ticket assets. Therefore, when the device receives a request to execute processing logic on an asset, it can use the asset account information to execute the processing logic on the asset according to the request. It can be seen that the asset smart contract implemented by the device can use the asset account information to support on-chain processing of ticket assets such as splitting, merging, and circulation, etc., which increases the flexibility and versatility of the asset smart contract.

[0120] In one or more embodiments of this specification, the processing logic includes: any one or more of the following processing logics: ticket asset issuance logic, ticket asset merging logic, ticket asset splitting logic, ticket asset circulation logic, and ticket asset redemption logic. In this embodiment, the asset smart contract is combined with the blockchain to provide the asset account period information of the asset in the contract account, which can realize the rapid chaining of the ticket assets, realize the implementation of the blockchain and asset smart contracts in the ticket asset scenario, and realize the basic ticket asset operation capabilities such as ticket asset issuance, merging, splitting, circulation, and redemption.

[0121] In one or more embodiments of this specification, an asset model is further provided in the asset smart contract. The asset model is used to set the asset attributes of the asset in the contract account, and the asset attributes include: asset basic attributes, and the information corresponding to the asset basic attributes includes: amount information, holder information and asset account period information. In this embodiment, based on the highly abstract asset model, it is convenient to set the asset basic attributes of various assets in the contract account, realize life cycle management, and improve asset management efficiency.

[0122] In combination with the embodiments of the asset model, in order to further improve the flexibility of asset management and support the expansion of the unique attributes of various types of assets, in one or more embodiments of this specification, Fig.14 A structural diagram of a device applied to an asset smart contract provided by another embodiment of the present specification is shown, and the device also includes: a new attribute module 1306, which can be configured to call the asset model in response to receiving a new attribute request, and add the asset attributes required to be added by the new attribute request to the asset model.

[0123] In combination with the embodiments of the asset model, in order to more comprehensively support the life cycle management of various types of assets, in one or more embodiments of the present specification, the asset attributes that can be set in the asset model may also include: either or both of asset flow attributes and asset traceability attributes; the information corresponding to the asset flow attributes includes: status information before and after the asset changes; the information corresponding to the asset traceability attributes includes: original information, transfer-out information, transfer-in information and amount information in asset transactions.

[0124] In one or more embodiments of this specification, combined with the asset attributes provided by the above-mentioned asset model, the ability to provide asset evidence for various asset types can be realized. Specifically, the device also includes: an evidence module 1308, which is configured to respond to receiving a request to execute the evidence logic of the asset smart contract on the asset, obtain the information required for asset evidence from the asset attributes, and execute the asset evidence logic according to the obtained information.

[0125] In one or more embodiments of this specification, a dual-user permission access mechanism is adopted to ensure data security. Specifically, for example, the device may also include: a blockchain account verification module 1310, a contract account verification module 1312 and a permission control module 1314.

[0126] The blockchain account verification module 1310 may be configured to perform login verification on the requested blockchain account using the blockchain account list maintained by the blockchain network.

[0127] The contract account verification module 1312 can be configured to perform login verification on the contract account requested to be used using a list of contract accounts maintained by the blockchain network when the blockchain account logs in to the blockchain network.

[0128] The permission control module 1314 can be configured to control the behavior of the contract account in the asset smart contract according to the user permission information granted to the contract account when the contract account login verification is successful.

[0129] It can be seen that in this embodiment, only users who have passed both blockchain account verification and contract account verification can execute the processing logic of the asset smart contract according to the granted permissions, realizing a dual-user permission access mechanism and effectively ensuring data security.

[0130] Corresponding to the above-mentioned dual-user permission access mechanism, in order to ensure data security, the device provided in the embodiment of this specification may also include: a creation request receiving module 1316, an administrator judgment module 1318, a contract account judgment module 1320, an account existence message feedback module 1322, a block chain account judgment module 1324 and an account creation execution module 1326.

[0131] The creation request receiving module 1316 may be configured to receive a creation request for a contract account.

[0132] The administrator determination module 1318 may be configured to determine whether the contract account that issues the creation request is an administrator account.

[0133] The contract account determination module 1320 may be configured to determine whether the contract account to be created by the creation request already exists in the list of contract accounts maintained by the blockchain network if the administrator determination module 1318 determines that it is an administrator account.

[0134] The account existence message feedback module 1322 may be configured to feedback an account existence message to the sender of the creation request if the blockchain account determination module 1320 determines that the account already exists.

[0135] The block chain account determination module 1324 may be configured to determine whether the block chain account used by the contract account to be created by the creation request exists in the block chain account list maintained by the block chain network if the contract account determination module 1320 determines that it does not exist;

[0136] The account creation execution module 1326 can be configured to add the contract account to be created to the list of contract accounts maintained by the blockchain network and set corresponding permissions if the contract account judgment module 1324 determines that the contract account exists and the blockchain account status allows the creation of the contract account.

[0137] It can be seen that in this embodiment, since the administrator only determines that the contract account used for the creation request is a blockchain account maintained by the blockchain network and the blockchain account status allows the creation of a contract account, the contract account to be created is added and the corresponding permissions are set, thereby effectively ensuring the data security of the blockchain network.

[0138] In order to expand the management capabilities of asset smart contracts, in one or more embodiments of this specification, the asset smart contract provides an expansion interface, such as Fig.14 As shown, the device also includes: an expansion module 1328, which can be configured to add custom processing logic in the asset smart contract through the expansion interface.

[0139] In the device provided in the embodiments of this specification, the expansion of asset trading capabilities can, on the one hand, complete the customized business logic based on the expansion interface provided by the asset smart contract in the above embodiments, and on the other hand, can be achieved through the pre-processing process interface and / or post-processing process interface provided by the asset smart contract for the processing logic. Specifically, for example: the pre-processing process interface is used to add customized pre-processing logic; the post-processing process interface is used to add customized post-processing logic. Accordingly, the device may also include: a customized process execution module 1330, which can be configured to execute the customized pre-processing logic according to the customized pre-processing logic added in the pre-processing process before the ticket processing logic is executed; and / or, after the ticket processing logic is executed, execute the customized post-processing logic according to the customized post-processing logic added in the post-processing process.

[0140] The above is a schematic scheme of a device applied to an asset smart contract of this embodiment. It should be noted that the technical scheme of the device applied to an asset smart contract and the technical scheme of the method applied to an asset smart contract belong to the same concept. For details not described in detail in the technical scheme of the device applied to an asset smart contract, please refer to the description of the technical scheme of the method applied to an asset smart contract.

[0141] Fig.15 The block diagram of a computing device 1500 according to one embodiment of the present specification is shown. The components of the computing device 1500 include but are not limited to a memory 1510 and a processor 1520. The processor 1520 is connected to the memory 1510 via a bus 1530, and the database 1550 is used to store data.

[0142] The computing device 1500 also includes an access device 1540 that enables the computing device 1500 to communicate via one or more networks 1560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0143] In one embodiment of the present specification, the above components of the computing device 1500 and Fig.15 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.15 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0144] Computing device 1500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 1500 may also be a mobile or stationary server.

[0145] The processor 1520 is used to execute the following computer executable instructions:

[0146] Receive a request to execute the processing logic of the asset smart contract on the asset; the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information;

[0147] According to the request, the processing logic is executed on the asset using the asset account period information of the asset.

[0148] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the method applied to the asset smart contract above belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be found in the description of the technical scheme of the method applied to the asset smart contract above.

[0149] An embodiment of the present specification further provides a computer-readable storage medium storing computer instructions, which are used when executed by a processor to:

[0150] Receive a request to execute the processing logic of the asset smart contract on the asset; the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information;

[0151] According to the request, the processing logic is executed on the asset using the asset account period information of the asset.

[0152] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the method applied to the asset smart contract above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the method applied to the asset smart contract above.

[0153] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0154] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0155] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0156] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0157] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A method applied to an asset smart contract, wherein the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, the assets in the contract account have corresponding asset account period information, the asset smart contract provides an expansion interface, and the asset smart contract has an asset model, which is used to set the asset attributes of assets corresponding to various asset types in the contract account, and the asset attributes include: Asset basic attributes, the information corresponding to the asset basic attributes includes: amount information, holder information and asset account period information, and the method includes: In response to receiving a request for adding a new attribute, calling the asset model, adding a unique asset attribute corresponding to the asset type required by the request for adding the new attribute to the asset model, so that the asset model becomes an asset model of the asset type corresponding to the unique asset attribute; Through the extension interface, add a business asset contract corresponding to the custom processing logic in the asset smart contract; Receiving a request to execute the processing logic of the asset smart contract on the asset; According to the request, the processing logic is executed on the asset using the asset account period information of the asset.

2. The method according to claim 1, wherein the processing logic comprises: Any one or more of the processing logics of ticket asset issuance logic, ticket asset merging logic, ticket asset splitting logic, ticket asset circulation logic, and ticket asset redemption logic.

3. The method according to claim 1, wherein the asset attributes further include: Either or both of the asset flow attribute and asset traceability attribute; The information corresponding to the asset flow attribute includes: status information before and after the asset changes; The information corresponding to the asset traceability attribute includes: original information, transfer-out information, transfer-in information and amount information in the asset transaction.

4. The method according to claim 3, further comprising: In response to receiving a request to execute the evidence logic of the asset smart contract on an asset, information required for asset evidence is obtained from the asset attributes, and the asset evidence logic is executed according to the obtained information.

5. The method according to claim 1, further comprising: Using the blockchain account list maintained by the blockchain network to perform login verification on the blockchain account requested to be used; In the case where the blockchain account logs in to the blockchain network, the contract account requested for use is logged in and verified using the list of contract accounts maintained by the blockchain network; When the contract account login verification is successful, the behavior of the contract account in the asset smart contract is controlled according to the user authority information granted to the contract account.

6. The method according to claim 5, further comprising: Receive a request to create a contract account; Determine whether the contract account that issued the creation request is an administrator account; If it is an administrator account, determine whether the contract account to be created by the creation request already exists in the list of contract accounts maintained by the blockchain network; If the account already exists, a message indicating that the account exists is fed back to the sender of the creation request; If not, determine whether the blockchain account used by the contract account to be created by the creation request exists in the blockchain account list maintained by the blockchain network; If it exists and the blockchain account status allows the creation of a contract account, the contract account to be created is added to the list of contract accounts maintained by the blockchain network and the corresponding permissions are set.

7. According to the method of claim 1, the asset smart contract provides a pre-processing flow and / or a post-processing flow on the interface of the processing logic; The pre-processing flow is used to add custom pre-processing logic; The post-processing flow is used to add custom post-processing logic; The method further comprises: Before the processing logic is executed, the custom pre-processing logic is executed according to the custom pre-processing logic added in the pre-processing flow; and / or, After the processing logic is executed, the customized post-processing logic is executed according to the customized post-processing logic added in the post-processing flow.

8. A device applied to an asset smart contract, wherein the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, the assets in the contract account have corresponding asset account period information, the asset smart contract provides an expansion interface, and the asset smart contract has an asset model, which is used to set the asset attributes of assets corresponding to various asset types in the contract account, and the asset attributes include: Asset basic attributes, the information corresponding to the asset basic attributes includes: amount information, holder information and asset account period information, and the device includes: A new attribute module is configured to, in response to receiving a new attribute request, call the asset model, add the specific asset attribute required by the new attribute request to the asset model, and make the asset model an asset model of the asset type corresponding to the specific asset attribute; An extension module, configured to add a business asset contract corresponding to a custom processing logic in the asset smart contract through the extension interface; A receiving module configured to receive a request to execute the processing logic of the asset smart contract on the asset; The processing module is configured to execute the processing logic on the asset using the asset account period information of the asset according to the request.

9. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions: In response to receiving a request for adding a new attribute, calling an asset model, adding a unique asset attribute corresponding to the asset type required to be added by the request for adding a new attribute to the asset model, so that the asset model becomes an asset model of the asset type corresponding to the unique asset attribute; Through the extension interface, a business asset contract corresponding to the custom processing logic is added to the asset smart contract. The asset smart contract provides the extension interface. The asset smart contract has the asset model. The asset model is used to set the asset attributes of the assets corresponding to various asset types in the contract account. The asset attributes include: asset basic attributes. The information corresponding to the asset basic attributes includes: amount information, holder information and the asset account period information; Receive a request to execute the processing logic of the asset smart contract on an asset, the blockchain network where the asset smart contract is located maintains a list of contract accounts of the asset smart contract based on a consensus mechanism, and the assets in the contract account have corresponding asset account period information; According to the request, the processing logic is executed on the asset using the asset account period information of the asset.

10. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the method applied to asset smart contracts as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method used for managing user smart-contracts at blockchain nodes and equipment

    CN107943580A

  • A method for accessing steel production data based on an intelligent contract

    CN109359860A

  • Intelligent contract configuration method and device, and storage medium

    CN109960696A

  • Bill processing method and device based on blockchain network

    CN110428334A

  • Data processing method and device based on block chain system and electronic equipment

    CN111311407A