CN112015822B - Block chain data deleting method and device - Google Patents

Block chain data deleting method and device Download PDF

Info

Publication number
CN112015822B
CN112015822B CN202011126773.6A CN202011126773A CN112015822B CN 112015822 B CN112015822 B CN 112015822B CN 202011126773 A CN202011126773 A CN 202011126773A CN 112015822 B CN112015822 B CN 112015822B
Authority
CN
China
Prior art keywords
blockchain
account
virtual
resources
transaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011126773.6A
Other languages
Chinese (zh)
Other versions
CN112015822A (en
Inventor
卓海振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202011126773.6A priority Critical patent/CN112015822B/en
Priority to CN202110827166.0A priority patent/CN113553378A/en
Publication of CN112015822A publication Critical patent/CN112015822A/en
Application granted granted Critical
Publication of CN112015822B publication Critical patent/CN112015822B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • 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

Abstract

The present specification provides a method and an apparatus for deleting block chain data, which are applied to a management platform for managing node devices of a block chain, where a system resource and a virtual resource carried by the node devices of the block chain are subjected to value anchoring; the method comprises the steps of obtaining a data deletion transaction triggered by a blockchain client, wherein the data deletion transaction comprises identification information of target data to be deleted; calculating a first amount of system resources of a node device of the blockchain consumed to process the data deletion transaction and determining a second amount of the virtual resources anchored to the first amount of system resource value; and sending the data deletion transaction to the blockchain so that the node equipment of the blockchain executes the data deletion transaction, and deleting the target data corresponding to the identification information from the target intelligent contract account managed by the user.

Description

Block chain data deleting method and device
Technical Field
One or more embodiments of the present disclosure relate to the field of blockchain technologies, and in particular, to a method and an apparatus for deleting blockchain data.
Background
The block chain technology, also called distributed ledger technology, is an emerging technology in which several computing devices participate in "accounting" together, and a complete distributed database is maintained together. The blockchain technology has been widely used in many fields due to its characteristics of decentralization, transparency, participation of each computing device in database records, and rapid data synchronization between computing devices.
Disclosure of Invention
In view of this, one or more embodiments of the present specification provide a method, an apparatus, and a computer device for deleting blockchain data.
In order to achieve the above purpose, one or more embodiments of the present specification provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, a method for deleting blockchain data is provided, where the method is applied to a management platform that manages node devices of a blockchain, and system resources and virtual resources carried by the node devices of the blockchain are subjected to value anchoring; the method comprises the following steps:
acquiring a data deletion transaction triggered by a block chain client, wherein the data deletion transaction comprises identification information of target data to be deleted;
calculating a first amount of system resources of a node device of the blockchain consumed to process the data deletion transaction and determining a second amount of the virtual resources anchored to the first amount of system resource value;
after the second amount of virtual resources are deducted from the virtual resource account of the user, sending the data deletion transaction to the blockchain, so that the node device of the blockchain executes the data deletion transaction, and deleting the target data corresponding to the identification information from the target intelligent contract account managed by the user.
According to a second aspect of one or more embodiments of the present specification, a method for deleting blockchain data is provided, where the method is applied to a management platform that manages node devices of a blockchain, and system resources and virtual resources carried by the node devices of the blockchain are subjected to value anchoring; the method comprises the following steps:
acquiring a data deletion transaction triggered by a block chain client, wherein the data deletion transaction comprises identification information of target data to be deleted;
sending the data deletion transaction to the blockchain so that node equipment of the blockchain executes the data deletion transaction, and deleting the target data corresponding to the identification information from the target intelligent contract account managed by the user;
after the data deletion transaction is executed by the node device of the blockchain, calculating a first amount of system resources of the node device of the blockchain actually consumed by processing the data deletion transaction, and determining a second amount of the virtual resources anchored with the system resource value of the first amount, so that the virtual resource account of the user is deducted by the second amount of the virtual resources.
According to a third aspect of one or more embodiments of the present specification, there is provided a device for deleting blockchain data, which is applied to a management platform that manages node devices of a blockchain, where a system resource and a virtual resource carried by a node device of the blockchain are value-anchored; the device comprises:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring data deletion transaction triggered by a block chain client, and the data deletion transaction comprises identification information of target data to be deleted;
a calculation unit to calculate a first amount of system resources of a node device of the blockchain consumed to process the data deletion transaction and to determine a second amount of the virtual resources anchored to the first amount of system resource value;
a sending unit, configured to send the data deletion transaction to the blockchain after the second amount of virtual resources are deducted from a virtual resource account of the user, so that a node device of the blockchain executes the data deletion transaction, and delete the target data corresponding to the identification information from a target intelligent contract account managed by the user.
According to a fourth aspect of one or more embodiments of the present specification, there is provided a device for deleting blockchain data, which is applied to a management platform that manages node devices of a blockchain, where a system resource and a virtual resource carried by a node device of the blockchain are value-anchored; the device comprises:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring data deletion transaction triggered by a block chain client, and the data deletion transaction comprises identification information of target data to be deleted;
a sending unit, configured to send the data deletion transaction to the blockchain, so that a node device of the blockchain executes the data deletion transaction, and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user;
a calculating unit, configured to calculate, after the node device executes the data deletion transaction, a first amount of system resources of the node device of the blockchain actually consumed by processing the data deletion transaction, and determine a second amount of the virtual resources anchored to the system resource value of the first amount, so that the virtual resource account of the user is deducted by the second amount of the virtual resources.
According to a fifth aspect of one or more embodiments of the present specification, there is provided a computer device comprising: a memory and a processor; the memory having stored thereon a computer program executable by the processor; when the computer program is executed by the processor, the method for deleting the blockchain data executed by the management platform is executed according to the embodiment provided by the first aspect.
According to a sixth aspect of one or more embodiments of the present specification, there is provided a computer apparatus comprising: a memory and a processor; the memory having stored thereon a computer program executable by the processor; when the computer program is executed by the processor, the method for deleting the blockchain data executed by the management platform according to the embodiment of the second aspect is executed.
Based on the method, the apparatus, the computer device, and the computer-readable storage medium for deleting block chain data in one or more embodiments, the management platform performs value anchoring on the system resources and the virtual resources carried by the node devices of the block chain, so that a first amount of system resources of the node devices of the block chain consumed by the node devices for processing data deletion transactions can be anchored, a second amount of virtual resources can be anchored, and the management platform charges the user for the second amount of virtual resources, so that the user can optimally manage the account storage space of the intelligent contract based on the needs of the user.
Drawings
FIG. 1 is a schematic diagram of creating an intelligent contract provided by an exemplary embodiment;
FIG. 2 is a schematic diagram of invoking an intelligent contract, provided by an exemplary embodiment;
FIG. 3 is a schematic diagram of creating an intelligent contract and invoking an intelligent contract provided by an exemplary embodiment;
FIG. 4 is a flowchart illustrating a method for deleting blockchain data according to an exemplary embodiment;
FIG. 5 is a diagram illustrating an exemplary embodiment of a device for deleting blockchain data applied to a management platform;
FIG. 6 is a diagram illustrating an apparatus for deleting blockchain data applied to a management platform according to yet another exemplary embodiment;
fig. 7 is a hardware block diagram of an embodiment of a calling device running a smart contract as provided herein.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
The block chain or block chain network described in one or more embodiments of the present specification may specifically refer to a P2P network system having a distributed data storage structure, where each node device achieves through a common recognition mechanism, the book data in the block chain is distributed within temporally consecutive "blocks", and the latter block may include a data digest of the former block, and according to a difference of a specific common recognition mechanism (such as POW, POS, DPOS, PBFT, or the like), a full backup of data of all or part of nodes is achieved.
Blockchains are generally divided into three types: public chain (Public Blockchain), Private chain (Private Blockchain) and alliance chain (Consortium Blockchain). Furthermore, there may be a combination of the above types, such as private chain + federation chain, federation chain + public chain, and so on.
Among them, the most decentralized is the public chain. The public chain is represented by bitcoin and ether house, and participants (also called nodes in the block chain) joining the public chain can read data records on the chain, participate in transactions, compete for accounting rights of new blocks, and the like. Moreover, each node can freely join or leave the network and perform related operations.
Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain may be a weakly centralized system with strict restrictions on nodes and a small number of nodes. This type of blockchain is more suitable for use within a particular establishment.
A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in a federation chain typically has a physical organization or organization corresponding to it; the nodes are authorized to join the network and form a benefit-related alliance, and block chain operation is maintained together.
It is contemplated that the embodiments provided herein can be implemented in any suitable type of blockchain network.
The computing device may construct the data into a standard transaction (transaction) format supported by the blockchain, then issue the transaction to the blockchain, perform consensus processing on the received transaction by the node devices in the blockchain, and package the transaction into a block by the node devices serving as accounting nodes in the blockchain after the consensus is achieved, and perform persistent evidence storage in the blockchain.
Regardless of which consensus algorithm is adopted by the block chain, the accounting node can pack the received transaction to generate a latest block and send the latest block to other node devices for consensus verification. If the latest block is received by other node equipment and no problem is proved, the latest block can be added to the tail of the original block chain, so that the accounting process of the block chain is completed. The transactions contained in the block may also be performed during the process of the other nodes verifying the new block sent by the accounting node.
It should be noted that, each time a block chain generates a latest block, after a transaction in the latest block is executed, the corresponding status of the executed transactions in the block chain changes accordingly, for example, in the block chain structured by an account model, the account status of an external account or an intelligent contract account usually changes correspondingly with the execution of the transaction.
For example, when a "transfer transaction" is completed in a block, the balances of the transferring party account and the transferring party account associated with the "transfer transaction" (i.e., the field values of the Balance fields of these accounts) are usually changed.
For another example, the "intelligent contract invocation transaction" in the block is used to invoke an intelligent contract deployed on the blockchain, invoke the intelligent contract in the EVM corresponding to the node device to execute the "intelligent contract invocation transaction", and update the account status of the intelligent contract account in the account of the intelligent contract after the execution of the intelligent contract invocation transaction.
In practical applications, whether public, private, or alliance, it is possible to provide the functionality of a Smart contract (Smart contract). An intelligent contract on a blockchain is a contract on a blockchain that can be executed triggered by a transaction. An intelligent contract may be defined in the form of code.
Taking an Etherhouse as an example, a user is supported to create and call some complex logic in the Etherhouse network. The ethernet workshop is used as a programmable block chain, and the core of the ethernet workshop is an ethernet workshop virtual machine (EVM), and each ethernet workshop node can run the EVM. The EVM is a well-behaved virtual machine through which various complex logic can be implemented. The user issuing and invoking smart contracts in the etherhouse is running on the EVM. In fact, the EVM directly runs virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"), so the intelligent contract deployed on the blockchain may be bytecode.
After Bob sends a Transaction (Transaction) containing information to create a smart contract to the ethernet network, each node can execute the Transaction in the EVM, as shown in fig. 1. The From field of the transaction in the figure is used for recording the address of the account initiating the creation of the intelligent contract, the contract code stored in the field value of the Data field of the transaction can be byte code, and the field value of the To field of the transaction is a null account. After the nodes reach the agreement through the consensus mechanism, the intelligent contract is successfully created, and the follow-up user can call the intelligent contract.
After the intelligent contract is established, a contract account corresponding to the intelligent contract appears on the block chain, and the block chain has a specific address; for example, "0 x68e12cf284 …" in each node in fig. 1 represents the address of the contract account created; the contract Code (Code) and account store (Storage) will be maintained in the account store for that contract account. The behavior of the intelligent contract is controlled by the contract code, while the account storage of the intelligent contract preserves the state of the contract. In other words, the intelligent contract causes a virtual account to be generated on the blockchain that contains the contract code and account storage.
As mentioned above, the Data field containing the transaction that created the intelligent contract may hold the byte code of the intelligent contract. A bytecode consists of a series of bytes, each of which can identify an operation. Based on the multiple considerations of development efficiency, readability and the like, a developer can select a high-level language to write intelligent contract codes instead of directly writing byte codes. For example, the high-level language may employ a language such as Solidity, Serpent, LLL, and the like. For intelligent contract code written in a high-level language, the intelligent contract code can be compiled by a compiler to generate byte codes which can be deployed on a blockchain.
Taking the Solidity language as an example, the contract code written by it is very similar to a Class (Class) in the object-oriented programming language, and various members including state variables, functions, function modifiers, events, etc. can be declared in one contract. A state variable is a value permanently stored in an account Storage (Storage) field of an intelligent contract to save the state of the contract.
As shown in FIG. 2, still taking the Etherhouse as an example, after Bob sends a transaction containing the information of the calling intelligent contract to the Etherhouse network, each node can execute the transaction in the EVM. The From field of the transaction in the figure is used for recording the address of the account initiating the intelligent contract calling, the To field is used for recording the address of the intelligent contract called, and the Data field of the transaction is used for recording the method and the parameters for calling the intelligent contract. After invoking the smart contract, the account status of the contract account may change. Subsequently, a client may check the account status of the contract account through the accessed block link points, for example, the account status may be stored in the Storage tree of the intelligent contract in the form of a Key-Value pair. The results of the execution of the transaction that invokes the smart contract, which may be in the form of a transaction receipt (receipt), are stored in the MPT receipt tree.
The intelligent contract can be independently executed at each node in the blockchain network in a specified mode, and all execution records and data are stored on the blockchain, so that after the transaction is executed, transaction certificates which cannot be tampered and lost are stored on the blockchain.
A schematic diagram of creating an intelligent contract and invoking the intelligent contract is shown in fig. 3. An intelligent contract is created in an Ethernet workshop and needs to be subjected to the processes of compiling the intelligent contract, changing the intelligent contract into byte codes, deploying the intelligent contract to a block chain and the like. The intelligent contract is called in the Ethernet workshop, a transaction pointing to the intelligent contract address is initiated, the EVM of each node can respectively execute the transaction, and the intelligent contract code is distributed and operated in the virtual machine of each node in the Ethernet workshop network.
For accounts in a blockchain, the account status of the account is usually maintained through a structure. When a transaction in a block is executed, the status of the account associated with the transaction in the block chain is also typically changed.
Taking etherhouses as an example, the structure of an account usually includes fields such as Balance, Nonce, Code and Storage. Wherein:
a Balance field for maintaining the current account Balance of the account;
a Nonce field for maintaining a number of transactions for the account; the counter is used for guaranteeing that each transaction can be processed only once, and replay attack is effectively avoided;
a Code field for maintaining a contract Code for the account; in practical applications, only the hash value of the contract Code is typically maintained in the Code field; thus, the Code field is also commonly referred to as the Codhash field.
A Storage field for maintaining the Storage contents of the account (default field value is null); for a contract account, a separate storage space is usually allocated to store the storage content of the contract account; this separate storage space is often referred to as the account storage of the contract account. The storage content of the contract account is usually constructed into a data structure of an MPT (Merkle Patricia Trie) tree and stored in the independent storage space; in which, the Storage content based on the contract account is constructed into an MPT tree, which is also commonly referred to as a Storage tree. Whereas the Storage field typically maintains only the root node of the Storage tree; thus, the Storage field is also commonly referred to as the Storage root field.
Wherein, for the external account, the field values of the Code field and the Storage field shown above are both null values.
For most blockchain models, Merkle trees are typically used; alternatively, the data is stored and maintained based on the data structure of the Merkle tree. Taking etherhouses as an example, the etherhouses use MPT tree (a Merkle tree variation) as a data organization form for organizing and managing important data such as account status, transaction information, and the like.
The Etherhouse designs three MPT trees, namely an MPT state tree, an MPT transaction tree and an MPT receipt tree, aiming at data needing to be stored and maintained in a block chain. In addition to the three MPT trees, there is actually a Storage tree constructed based on the Storage content of the contract account.
An MPT state tree, which is an MPT tree organized by account state data of all accounts in a blockchain; an MPT transaction tree, which is an MPT tree organized by transaction (transaction) data in a blockchain; the MPT receipt tree is organized into transaction (receipt) receipts corresponding to each transaction generated after the transactions in the block are executed. The hash values of the root nodes of the MPT state tree, the MPT transaction tree, and the MPT receipt tree shown above are eventually added to the block header of the corresponding block.
The MPT transaction tree and the MPT receipt tree correspond to the blocks, namely each block has the MPT transaction tree and the MPT receipt tree. For the MPT transaction tree, the MPT receipt tree and the MPT state tree which are organized, the MPT transaction tree, the MPT receipt tree and the MPT state tree are finally stored in a Key-Value type database (such as a levelDB) which adopts a multi-level data storage structure.
In the public chain field, the miners are often encouraged to carry out block chaining out through gas, token and other modes, and the miners can select higher-commission-cost transactions such as gas or token to preferentially pack in blocks so as to increase self income; for the non-miner nodes, although the storage and consensus resources are contributed, corresponding benefits are not obtained. In a token-free (token) -based blockchain model, such as a federation chain, especially in an open federation chain environment, how to count blockchain resources provided by node devices and cover corresponding node costs is also an urgent issue to be solved. At present, there is no method for resource management and charging for users of the blockchain based on the use or occupation of blockchain resources.
In view of the above, one or more embodiments of the present specification provide various resource charging approaches in a blockchain system. It is contemplated that the embodiments provided herein can be implemented in a suitable type of blockchain network, such as a public chain, a federation chain, a private chain, and so forth.
The management platform according to one or more embodiments provided in this specification may include a platform that is provided in or connected to each node device of the blockchain, so as to manage each node device of the blockchain. Optionally, the management platform includes a cloud computing management platform, and correspondingly, the node device of the block chain includes a virtual machine created on a physical host managed by the cloud computing management platform.
The blockchain client described in one or more embodiments provided in this specification may be connected to a node device of a blockchain through the management platform, so as to send a transaction to a blockchain network or obtain a transaction execution result in the blockchain network based on communication with the management platform.
In the blockchain provided in this specification, the management platform performs value anchoring on system resources and virtual resources carried by node devices of the blockchain.
The virtual resources may include digitized forms of real assets circulating under the blockchain, such as assets in the form of currency, real estate, stocks, bonds, loan contracts, notes, accounts receivable, and the like; virtual resources circulating over the blockchain may also be included, such as virtual tokens (e.g., bitcoins, ethercoins, etc.) that begin circulating over the blockchain based on a mine excavation reward that is earned by a billing node (or miner node) of the blockchain packing and successfully adding blocks. Virtual tokens generated based on mineworker node mining typically do not have a value-anchoring relationship with real assets outside the chain; thus, in yet another illustrative embodiment, virtual resources published on a blockchain may include blockchain assets having a value-anchoring relationship with off-chain real assets held by a user, and virtual resources anchored to the frozen real assets and capable of circulation on the chain may be published on the chain by freezing real-world real assets (including assets in the form of currency, real property, stocks, loan contracts, tickets, accounts receivable, and the like).
When the method is realized, the user client side can perform an asset freezing exchange process with the management platform, freeze a certain amount of real assets and send a freezing certificate to the management platform; after receiving the frozen voucher, the management platform can instruct the node device to add virtual resources corresponding to the frozen real asset amount value to the balance of the user's blockchain account on the blockchain based on the frozen voucher.
The virtual resource corresponding to the frozen real asset amount value is added into the balance of the user's blockchain account based on the frozen certificate, and the method can be further realized by the interaction between the user and an intelligent contract: the management platform triggers a virtual resource exchange transaction sent to a blockchain network, wherein the virtual resource exchange transaction comprises the asset freezing voucher; responding to the virtual resource exchange transaction, the node equipment of the blockchain calls a virtual resource exchange contract deployed on the blockchain, executes the resource exchange logic declared by the intelligent contract, and adds virtual resources corresponding to the real asset amount value frozen by the asset freezing voucher into the account balance of the blockchain of the user.
Based on the mode, the user can obtain virtual resources which can be anchored with the value of the real assets in the block chain network based on the real assets held by the user, and the virtual resources can be expressed as the balance of the account on the chain of the user.
In the blockchain network system, the system resources provided by the blockchain node devices for the blockchain service can be value-anchored with the virtual resources. For example, the storage resources provided by the node device for the data on the blockchain may perform value anchoring with the virtual resources, and the blockchain data per storage unit capacity may obtain the virtual resources corresponding thereto; for another example, the CPU computational resources provided by the node device for executing any transaction on the blockchain may perform value anchoring with the virtual resources, and each CPU instruction set of the execution unit number may obtain the virtual resources corresponding thereto; for another example, the node device may perform value anchoring with the virtual resource for a network resource provided by broadcast or consensus of any transaction on the block chain, and may obtain the corresponding virtual resource based on network traffic consumed in the broadcast or consensus process of the uplink transaction.
The block chain developer or the management platform may quantify the system resources in the form of the storage resources, the computing resources, the network resources, and the like, and price the number of virtual resources corresponding to each unit of the storage resources, the computing resources, the network resources, or the system resources in other forms in the block chain network. For a federation chain, whose federation members are relatively fixed, the system resource pricing resulting from the anchoring can remain fixed for a longer period of time; for a public link system, nodes enter or exit a blockchain network more frequently, and after a blockchain developer performs unit pricing on the system resources in various forms, the blockchain developer performs real-time virtual resource transfer based on the blockchain scale when a user uses the blockchain, or performs periodic virtual resource transfer according to a shorter period. Those skilled in the art can also deduct virtual resources from the actual cost requirement to the user for the blockchain service provided by the blockchain node device based on any form of system resources having a value anchor relationship with the virtual resources, which is not limited in the present specification.
As shown in fig. 4, the method for deleting blockchain data according to an exemplary embodiment of the present disclosure, executed by the management platform, may include:
step 402, acquiring a data deletion transaction triggered by a blockchain client, wherein the data deletion transaction includes identification information of target data to be deleted.
The target data to be deleted is target data stored in a target intelligent contract maintained and managed by a user, for example, data stored in an account storage space (in the storage tree) of the target intelligent contract. The data of the account storage space of the intelligent contract may be stored in a Key-Value format, and the identification information of the target data may include a Key Value of the target data, such as a hash Value of the target data. The identification information of the target data may also include other identifications, such as a serial number of the data stored in the target intelligent contract, and the like.
Optionally, the data deletion transaction may further include an account address of a target intelligent contract in which the target data to be deleted is located. At this time, the identification information of the target data may further include other identifications, such as a serial number of the data stored in the target smart contract, and the like.
The embodiment does not limit the builder identity of the data deletion transaction. In an illustrated embodiment, the data deletion transaction may be constructed by the blockchain client, and after construction, the data deletion transaction is sent to the management platform based on a trigger operation of a user at the client, so that the management platform can forward the transaction to a blockchain network after acquiring the data deletion transaction.
In another illustrated embodiment, the blockchain client may send the identification information of the target data to be deleted to a management platform, so as to trigger the management platform to construct a data deletion transaction based on the identification information of the target data, and send the constructed data deletion transaction to a blockchain network.
Step 404, calculating a first amount of system resources of node devices of the blockchain consumed for processing the data deletion transaction, and determining a second amount of the virtual resources anchored to the first amount of system resource values.
The process of processing the data deletion transaction by the node device of the block chain may include one or more of receiving, forwarding (broadcasting) the data deletion transaction, performing consensus verification on the data deletion transaction, executing the data deletion transaction based on the identification information of the target data, storing the execution result of the data deletion transaction to a state database of the block chain, listing the data deletion transaction in a new block, and the like. Because the value of the system resources carried by the node equipment is anchored with the virtual resources, and the node equipment of the block chain provides own system resources in the whole process of processing the data deletion transaction, the management platform can calculate the first quantity of the system resources consumed or provided by the node equipment in the process of processing the data deletion transaction, and determine the second quantity of the virtual resources anchored with the value of the first quantity of the system resources.
In particular, the system resources of the node device consumed by processing the data deletion transaction described above may include a combination of one or more of the following:
processing computational resources of the node device consumed for the data deletion transaction, which may include a number of instructions in a CPU instruction set consumed for the node device to perform the data deletion transaction based on the identification information of the target data. For example, the blockchain system or management platform may price the computing resources provided by the node devices: m (virtual resource units)/instruction, the node device may first calculate the number N of instructions in the CPU instruction set consumed to perform the data deletion transaction, and then calculate the number of virtual resources corresponding to the N instructions, anchored to the value of the computational resources of the node device consumed to process the data deletion transaction: m N (virtual resource units).
Processing network resources of the node device consumed by the data deletion transaction, where the network resources may include network traffic of a blockchain consumed during transmission of the data deletion transaction in broadcasting, consensus, or the like, and the network resources are positively correlated with the number of nodes of the blockchain. For example, the blockchain system or management platform may price network resources provided by the node devices: m (virtual resource units)/megaflow, the node device may first calculate a total network flow N megameters consumed to perform the data deletion transaction, and then calculate a number of virtual resources corresponding to the N megaflows, anchored to a network resource value of the node device consumed to process the data deletion transaction: m N (virtual resource units).
Processing storage resources of the node device consumed by the data deletion transaction, which may include storage resources consumed by the node device to perform the data deletion transaction.
If the block chain executes the data deletion transaction, the target data is directly deleted from the account storage space of the target intelligent contract without other backup storage, and the storage resource of the node equipment consumed for processing the data deletion transaction is not considered when the system resource of the node equipment consumed for processing the data deletion transaction is calculated; if the block chain executes the data deletion transaction, the target data is moved from the account storage space of the target intelligent contract to the backup database of the block chain for storage, and then the virtual resource anchored with the value of the storage resource consumed by the target data in the backup database maintained by the block chain can be considered when calculating the system resource of the node equipment consumed by processing the data deletion transaction.
The blockchain system or the management platform can price the storage resources in the backup database provided by the node device: m (virtual resource units)/Gb, when the target data has a capacity of NGb, the node device may calculate a second number of virtual resources anchored to the value of the storage resources of the node device consumed for processing the smart contract creation transaction, including: m N (virtual resource units).
In order to customize the specific duration that the node device may provide backup storage service for the target data based on the user's needs, in yet another illustrated embodiment, the data deletion transaction further comprises: requesting the effective duration of the target data to be stored in the backup database by a user; the effective duration of the storage resources of the backup database carried by the node equipment is also subjected to value anchoring with the virtual resources issued on the block chain; accordingly, the calculating the amount of virtual resources anchored to the account storage resource value includes: and calculating the number of storage resources consuming the block chain backup data with the target data and the virtual resources anchored by the effective duration value.
For example, the blockchain system or the management platform may price the storage resources and the storage validity duration in the backup database provided by the node device: m (virtual resource unit)/Gb/day, the user data deletion transaction is summarized as the valid duration of one year requested by the target data, and when the capacity of the target data is NGb, the node device may calculate a second number of virtual resources anchored to the storage resource value of the node device consumed to process the intelligent contract creation transaction, including: m × N × 365 (virtual resource unit).
It is noted that the data deletion transaction may include a field corresponding to a validity duration of the user request to store the target data in the backup database being null, so as to perform the calculation of the second amount of virtual resources by the node device based on the validity duration default for the blockchain system.
The pricing of the system resources provided by the node devices by the blockchain system or the management platform can be related to the number of nodes of the blockchain system, and it can be expected that the more node devices of the blockchain, the more the total amount of system resources actually consumed for performing the data deletion transaction, and therefore, the blockchain system can adjust the pricing of each unit of system resources charged to the user based on the number of the node devices.
The present embodiment does not specifically limit the form of the system resource, and the management platform may receive the virtual resource anchored by the system resource in another form based on the system resource in another form of the block link point device consumed in the process of deleting the target data stored in the intelligent contract, in addition to the storage resource, the effective time of storage, the calculation resource, or the network resource.
In an illustrated embodiment, a calculation model may be deployed in the management platform or in a bottom-layer protocol of the blockchain, and is configured to calculate a quantity of virtual resources anchored to a system resource value of a node device consumed for processing the data deletion transaction, and after the management platform obtains the data deletion transaction triggered by the blockchain client, the management platform may calculate, based on invoking the calculation model, a second quantity of virtual resources corresponding to system resources consumed for processing the data deletion transaction.
Or, an intelligent contract (hereinafter referred to as a resource computation contract) for computing virtual resource consumption for the data deletion transaction may be further deployed on the blockchain, where execution logic corresponding to the contract code of the resource computation contract includes computation logic for computing the amount of virtual resources anchored to the system resources of the node device consumed for processing the data deletion transaction;
accordingly, the above-mentioned computing platform calculating a first amount of system resources of the node device consumed for processing the data deletion transaction and determining a second amount of the virtual resources anchored with the first amount of system resource value comprises:
invoking the resource calculation contract, executing the billing logic, calculating a first amount of system resources of the node device consumed to execute the data deletion transaction, and determining a second amount of the virtual resources anchored to the first amount of system resource value.
It should be noted that, when the management platform invokes the resource computation intelligent contract, a Local Transaction (Local Transaction or Local call) may be constructed in response to the obtained intelligent contract creation Transaction, and the resource computation intelligent contract deployed on the blockchain is invoked locally at the node device to determine the first quantity of the virtual resource anchored by the system resource value of the node device consumed for executing the intelligent contract creation Transaction. At this time, the management platform may obtain the call execution result of the resource computation contract locally without recognizing the call execution result of the resource computation contract on the blockchain.
Step 406, obtaining a message that the virtual resource account of the user is deducted from the second amount of virtual resources.
The virtual resource account of the user is an account storing the same type of resources as the virtual resources; when the virtual resource is an out-of-chain real resource, the virtual resource account may include a currency account (such as a bank account), or a virtual point account established by the user on the management platform, and virtual points in the virtual point account may be exchanged by the user using currency; when the virtual resource is a virtual resource issued on a blockchain, the virtual resource account may include a user's blockchain account.
When the virtual resource account of the user is a money account, the entity that deducts the second amount of virtual resources from the virtual resource account of the user may be a financial institution such as a bank, and may transfer the deducted second amount of virtual resources to a money account corresponding to a management platform; when the virtual resource account of the user is a virtual point account established on the management platform, the virtual points in the virtual point account are exchanged by the user using money, and at this time, the entity for deducting the second amount of virtual resources from the virtual resource account of the user may be the management platform; when the virtual resource account of the user is a blockchain account, the entity that performs deduction of the second amount of virtual resources from the virtual resource account of the user may be a node device of a blockchain, and may transfer the deducted second amount of virtual resources to a blockchain account corresponding to a management platform.
The present embodiment does not limit the execution body, the deduction time and the specific manner of deducting the second amount of virtual resources from the virtual resource account of the user.
Step 408, sending the data deletion transaction to the blockchain, so that the node device of the blockchain executes the data deletion transaction, and deleting the target data corresponding to the identification information from the target intelligent contract account managed by the user.
And sending the data deletion transaction to a blockchain at the management platform so that the data deletion transaction can be broadcasted in a blockchain network, subjected to consensus verification, and executed by node equipment of the blockchain based on the identification information of the target data after the consensus verification is passed, so as to delete the target data corresponding to the identification information from the target intelligent contract account managed by the user.
As previously described, a structure of a smart contract account may generally include fields such as Balance, Nonce, Code, and Storage. A Balance field for maintaining the current account Balance of the account; a Nonce field for maintaining a number of transactions for the account; the counter is used for guaranteeing that each transaction can be processed only once, and replay attack is effectively avoided; a Code field for maintaining a contract Code for the account; in practice, only the hash value of the contract Code is typically maintained in the Code field (the Code of the smart contract is then stored in the block that contains the data delete transaction).
A Storage field for maintaining the Storage contents of the account (default field value is null); for a contract account, a separate storage space is usually allocated to store the storage content of the contract account; this separate storage space is often referred to as the account storage of the contract account. The storage content of the contract account is usually constructed into a data structure of an MPT (Merkle Patricia Trie) tree and stored in the independent storage space; in which, the Storage content based on the contract account is constructed into an MPT tree, which is also commonly referred to as a Storage tree. Whereas the Storage field typically maintains only the root node of the Storage tree; thus, the Storage field is also commonly referred to as the Storage root field.
The user maintaining the target intelligent contract may include a creating user of the target intelligent contract or a user declared in the target intelligent contract as having data deletion rights. The node device of the blockchain executes the data deletion transaction in the virtual machine based on the identification information of the target data, and stores the execution result of the data deletion transaction in the state database of the blockchain, for example, the node device may delete the target data in the account storage space of the target smart contract in the blockchain state database, and record a transaction receipt (receive) including the execution result of the data deletion transaction in an MPT receipt tree of the blockchain.
In an illustrated embodiment, the aforementioned deleting of the target data corresponding to the identification information from the target intelligent contract account managed by the user may include permanently deleting the target data from the account storage space of the target intelligent contract, but in a subsequent blockchain blocking process, this operation may cause certain call transactions to the target intelligent contract to be unable to be executed; thus, in this embodiment, if certain invoked transactions to the target smart contract are subsequently rendered inoperable, the user may initiate a data recovery request, such as a replay execution (or block rollback) of the transactions that were included in an existing block of the block chain, to restore the target data to the account space of the target smart contract.
The hot data in the block chain may include data (also referred to as real-time data) required by the intelligent contract invocation, such as data included in an intelligent contract account, data in the latest blocks required by the intelligent contract invocation, and the hot data in the block chain is usually stored in storage hardware with superior performance, such as an SSD hard disk, by the node device, so that the node device can efficiently and quickly execute the intelligent contract invocation transaction; the cold data in the blockchain comprises non-real-time data which is set by a blockchain system and cannot be directly called by an intelligent contract, such as transactions in a historical block, historical state data corresponding to the historical block and the like; in order to save storage cost, the cold data can be stored in the storage hardware with lower performance configuration.
Therefore, in yet another illustrated embodiment, the deleting the target data corresponding to the identification information from the target intelligent contract account managed by the user may include removing the target data from an account storage space of the target intelligent contract and storing the target data in a backup database maintained by the blockchain. For example, the account storage space may store "hot data" that the smart contract calls for, and the user may move to the database collecting "cold data" of the blockchain as target data of the hot data based on data deletion transactions sent by the user for the purpose of saving the storage space of the target smart contract managed by the user. If the data deletion transaction subsequently causes some invoking transactions for the target intelligent contract to be unable to be executed, the user may initiate a data recovery request, for example, migrate the target data in the listing and cold data database back to the account storage space of the target intelligent contract, so as to further execute the invoking transactions for the target intelligent contract.
Based on the method for deleting blockchain data described in steps 402 to 406, a transaction of a data deletion type may be configured in the blockchain system (for example, a system developer expands a transaction type executable on a blockchain in a bottom layer protocol, and expands a transaction of a development data deletion type except for a transfer transaction, an intelligent contract creation transaction, and an intelligent contract invocation transaction), initiated by a user who maintains and manages a target intelligent contract, and deletes target data in an account storage space of the target intelligent contract, so that the user may optimize data storage of the account storage space of the target intelligent contract; since the data storage resources allocated by the blockchain node device to the intelligent contract account are usually high-quality storage resources, such as SSD hot storage resources, so as to facilitate fast and efficiently executing the call execution of the intelligent contract, the block chain data deletion method according to the embodiment reduces the occupation of the high-quality storage resources of each node device, and further optimizes the storage configuration of the node devices in the blockchain.
In yet another illustrative embodiment, the execution logic corresponding to the contract code of the target intelligent contract comprises data deletion logic; the foregoing data deletion transaction is a call transaction of an intelligent contract, and at this time, the node device of the block chain executes the data deletion transaction, and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user, the method includes:
and the node equipment of the block chain calls the target intelligent contract, executes the data deleting logic and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
The target data stored in the target intelligent contract is deleted by calling the data deletion logic of the target intelligent contract, so that the requirement on transaction type expansion of a block chain system protocol layer is avoided, and the development difficulty of a block chain system is reduced.
During the existence period of the target intelligent contract, the user can obtain the set storage resource capacity which can be allocated by the node device for the target intelligent contract by paying the virtual resource to the management platform according to the management requirement of the target intelligent contract. In order to facilitate the management of the set account storage resources allocated by the node device for the target intelligent contract by the user, the management platform may maintain the remaining (unused) storage capacity in the account storage resources allocated by the node device for the target intelligent contract.
After the node device of the block chain executes the data deletion transaction, the management platform may further monitor an occupation state of the account storage capacity of the obtained target intelligent contract, and further update the remaining storage capacity of the account storage resource allocated to the target intelligent contract by the node device maintained by the management platform: for example, a value of the remaining storage capacity of the account storage resource maintained by the management platform is increased based on the target data being deleted.
In the method for deleting block chain data according to one or more embodiments, the system resources hosted by the node devices of the block chain and the virtual resources published on the block chain are subjected to value anchoring, so that a first amount of system resources of the node devices consumed by data deletion transactions can be deleted based on the node devices, and a second amount of virtual resources can be anchored, and the management platform collects the second amount of virtual resources from users on behalf of the node devices of the block chain. Due to the fact that the user randomly deletes the hot data resources contained in the intelligent contract in the non-charging mode, system faults are easily caused in the follow-up calling execution of the intelligent contract, the false deletion operation is reduced and the success probability of the transaction execution on the block chain is improved on the basis of the precondition that the second quantity of virtual resources are required to be transferred in the deletion operation, and the configuration of the block chain storage resources distributed to the target intelligent contract by the node equipment is optimized by deleting the redundant or wrong hot data resources.
In one or more embodiments, after the virtual resource account of the user is successfully deducted from the second amount of virtual resources, the virtual resource account of the management platform may correspondingly receive the second amount of virtual resources. The management platform may hold a virtual resource account of a user or an institution entity corresponding to the node device allocated to the blockchain in a preset period (including real-time or periodically), so as to complete allocation of virtual resources to the user or institution entity providing system resources in the blockchain system.
The present embodiment does not limit the specific manner in which the virtual resources are allocated. For example, the management platform may allocate the received currency cash or the currency cash corresponding to the deducted virtual credits to a currency cash account of a user or institution entity corresponding to the node device of the blockchain, or the management platform may allocate virtual resources issued on the chain received in the blockchain account to a blockchain account of a user or institution entity corresponding to the node device of the blockchain, and then, in response to a redemption request of the user or institution, redeem the virtual resources allocated in the blockchain account thereof to entity assets outside the chain, and perform logout processing on the redeemed virtual resources on the chain.
The specification does not specifically limit the rule that the management platform allocates the second amount of virtual resources to the blockchain account corresponding to each node device in the blockchain. For example, the management platform may equally allocate the deducted second amount of virtual resources to virtual resource accounts of users or organization entities corresponding to each node device of the block chain to hold the virtual resource accounts respectively.
Or, based on the storage medium performance attribute of the account storage resource allocated to the intelligent contract by each node device of the block chain, the management platform allocates the second number of virtual resources to the virtual resource accounts of the user or the organization entity corresponding to each node device of the block chain to hold the virtual resource accounts respectively. For example, because the storage medium configurations of the node devices are different, the management platform may rank the storage medium of each node device based on the storage medium performance attribute (e.g., hard disk performance attribute such as hdd, ssd, or nvm) of each node device obtained by monitoring each node device, so as to allocate a higher proportion of virtual resources to the node device providing the high-level storage medium and allocate a lower proportion of virtual resources to the node device providing the low-level storage medium.
The management platform carries out unified receiving of the virtual resources on behalf of the node equipment of the block chain, and therefore payment operation of users on the second quantity of virtual resources is facilitated; moreover, the management platform can allocate the virtual resources received by the blockchain node users in real time or regularly based on preset allocation rules, so that each node user providing system resources for the blockchain can obtain corresponding benefits. Therefore, compared with the existing mode that the miner node only charges the transaction commission fee, each node device in the block chain is encouraged to contribute corresponding system resources in a more fair virtual resource allocation mode.
It should be noted that the execution sequence of steps 404, 406 and 408 is not limited in the above embodiment.
In an illustrated embodiment, after acquiring a data deletion transaction triggered by a blockchain client, a management platform calculates a first quantity of system resources of node devices of a blockchain consumed for processing the data deletion transaction, and determines a second quantity of virtual resources anchored with a system resource value of the first quantity; after the message that the second amount of virtual resources is successfully deducted from the virtual resource account of the user is acquired, the data deletion transaction is sent to the block chain, so that the node equipment of the block chain executes the data deletion transaction, and the target data corresponding to the identification information is deleted from the target intelligent contract account managed by the user.
After calculating the first amount of system resources of the node device of the blockchain consumed for processing the data deletion transaction and determining the second amount of virtual resources anchored to the value of the first amount of system resources, the management platform may issue an instruction to pay the second amount of virtual resources to the user client, for example, push a cash money payment page on a user interface of the client, so that in response to payment verification information (such as a digital password and biometric identification information) input by the user at the client, a financial institution corresponding to the cash money account of the user performs deduction of the second amount of virtual resources from the cash money account of the user. For another example, a virtual point payment page circulating on the management platform is pushed on a user interface of the client, where the virtual point is obtained by the user exchanging money and cash on the management platform and is stored in a virtual point account opened on the management platform by the user, so that the second amount of virtual resources is deducted from the virtual point account of the user on the management platform by the management platform in response to payment verification information (such as a digital password and biometric identification information) input by the user on the client.
When the virtual resource is a virtual resource issued on a blockchain, the management platform may construct a page for the transfer transaction on the blockchain, which is pushed on a user interface of the client, so that the blockchain client may further send the transfer transaction to the blockchain through the management platform, so that after the transfer transaction is verified by the blockchain, the node device of the blockchain deducts the virtual resource of the second quantity from the blockchain account of the user, or deducts the virtual resource of the second quantity from the blockchain account of the user and transfers the virtual resource of the second quantity to the blockchain account corresponding to the management platform. The management platform may then learn from the node device whether the transfer transaction was successfully executed.
If the deduction process fails due to the fact that the number of the virtual resources held by the virtual resource account of the user is smaller than the second number, or the management platform does not acquire a message that the virtual resource account of the client user is deducted from the second number of the virtual resources within a preset time limit, the management platform may return a prompt that the execution of the data deletion transaction fails to the blockchain client.
It should be noted that, because the system resources consumed by the node device to execute the data deletion transaction include various forms such as computing resources, network resources, storage resources, and the like, some resource forms may be calculated based on the code of the intelligent contract before the data deletion transaction is executed, and some resource forms may be accurately known only after the data deletion transaction is executed. Thus, in this embodiment, the deducted second amount of virtual resources is derived based on the system resource forecast that may be consumed to execute the data delete transaction, as described in step 406; the block chain may also set a subsequent system resource consumption verification link to check whether the actually consumed system resource after the target data is deleted obviously does not conform to the estimated system resource, so as to perform corresponding virtual resource supplement or return operation, which is not limited in this specification.
In yet another illustrated embodiment, after obtaining a data deletion transaction triggered by a blockchain client, a management platform may first send the data deletion transaction to the blockchain, so that a node device of the blockchain executes the data deletion transaction, delete the target data corresponding to the identification information from a target intelligent contract account managed by the user, and temporarily store an account status of the target intelligent contract after deleting the target data and a transaction receipt (receive) generated based on an execution result of the data deletion transaction in a memory; then, the management platform calculates a first quantity of system resources of the node device of the block chain consumed for processing the data deletion transaction, and determines a second quantity of the virtual resources anchored with the value of the first quantity of system resources, so that the second quantity of virtual resources is deducted from the virtual resource account of the user, thereby further obtaining a message that the second quantity of virtual resources is deducted from the virtual resource account of the user.
The above-described process of calculating the first amount of system resources of the node device of the blockchain consumed for processing the data deletion transaction and determining the second amount of virtual resources that the user needs to transfer may be performed based on statistical calculation of the system resources actually consumed for processing the data deletion transaction by the node device of the blockchain.
When the virtual resource is an entity asset outside a block chain, or the management platform issues a circulating credit or token anchored to an entity asset, after learning the account status of the target intelligent contract from which the target data has been deleted by the node device and temporarily storing a transaction receipt (receipt) generated based on the execution result of the data deletion transaction in the memory of the node device, the management platform may issue a second amount of payment instruction of the virtual resource to the client, for example, a cash money payment page is pushed on a user interface of the client, the management platform issues a circulating virtual credit payment page, in response to payment verification information (such as a digital password and biometric identification information) input by the user at the client, the financial institution corresponding to the cash money account of the user completes the second amount of payment from the cash money account of the user, or the management platform completes the second amount of payment from the virtual credit account of the user at the management platform Deduction of the amount of virtual resources. When the virtual resource is currency cash, the second amount of virtual resource can be transferred to a currency cash account corresponding to the management platform.
If the management platform acquires the message that the second amount of virtual resources are successfully deducted from the cash account of the user or the virtual resources held by the virtual point account of the management platform, the management platform may instruct the node device to update the account status of the target intelligent contract in the blockchain, and store a transaction receipt (receipt) generated after the data deletion transaction is executed in an MPT receipt tree of the blockchain, where the transaction receipt may include execution results that the target data is deleted from the account storage space of the target intelligent contract, the target data is moved to a backup database of the blockchain (if any), and the like. After the transaction receipt is obtained, the management platform may return a prompt indicating that the data deletion transaction is completed to the blockchain client, or return an execution result of the data deletion transaction contained in the transaction receipt.
If the cash account of the user, or the amount of the virtual resources held by the user in the virtual point account of the management platform is smaller than the second amount, or the management platform does not receive a message of successfully deducting the second amount of the virtual resources within a preset payment period, the management platform may instruct the node device to delete the account status of the target smart contract and a transaction receipt (receive) corresponding to the data deletion transaction from the memory; at this time, the management platform may return a prompt that the execution of the data deletion transaction fails to the blockchain client.
When the virtual resource is a virtual resource issued on a blockchain, the data deletion transaction may further include an account identifier of a user's blockchain account. The account identifier is an account identifier of a user account that pays the second amount of virtual resources for the data deletion transaction; the account id may include an account id of the data deletion transaction issuer, and may also include account ids of other users specified by the data deletion transaction issuer.
In this embodiment, after temporarily storing, in the memory, the account status of the target smart contract after the data deletion transaction is executed and a transaction receipt (receive) corresponding to the data deletion transaction, the node device may deduct the second amount of virtual resources from the blockchain account corresponding to the data deletion transaction including the account identifier, and add the second amount of virtual resources to the blockchain account corresponding to the management platform.
If the second amount of virtual resources are successfully deducted from the virtual resources held by the blockchain account corresponding to the account identifier, the node device may update the account status of the target intelligent contract in the blockchain, and store a transaction receipt (receive) generated after the data deletion transaction is executed in an MPT receipt tree of the blockchain; at this time, after obtaining the transaction receipt of the data deletion transaction stored in the blockchain, the management platform may return a prompt indicating that the data deletion transaction is completed to the blockchain client;
if the amount of the virtual resources held by the blockchain account corresponding to the account identifier is smaller than the second amount, the node device cannot deduct the second amount of the virtual resources from the blockchain account corresponding to the account identifier, and at this time, the node device can delete the account state of the target intelligent contract stored in the memory and a transaction receipt (receipt) corresponding to the data deletion transaction and notify the management platform; at this time, the management platform may return a prompt that the execution of the data deletion transaction fails to the blockchain client.
Or, when the amount of the virtual resources held by the virtual resource account is less than the second amount and the second amount of the virtual resources cannot be deducted in a sufficient amount, the management platform may instruct the node device to temporarily store the transaction receipt and the account status, send a balance supplement reminder to the blockchain client, after the blockchain client completes balance supplement on the user account, perform deduction of the second amount of the virtual resources, update the account status of the target intelligent contract in the blockchain after successful deduction, and store the transaction receipt (receipt) in an MPT receipt tree of the blockchain, so that the management platform returns a prompt of completing data deletion transaction execution to the blockchain client.
In another embodiment, when the virtual resource is a virtual resource published on a blockchain, and the node device performs an operation of deducting a second amount of virtual resource from a blockchain account of the user, and after the data deletion transaction is sent to the blockchain by the management platform, the broadcasting, consensus verification, and execution processes in the blockchain may specifically include:
after receiving the data deletion transaction, the node equipment can broadcast and transmit the data deletion transaction in a blockchain network;
after receiving the data deletion transaction, the consensus node in the block chain can perform consensus verification on the data deletion transaction;
if the consensus verification for the data deletion transaction passes, the blockchain node device deducts the second amount of virtual resources from the user account corresponding to the user identification based on the second amount of virtual resources anchored to the value of the system resources of the blockchain node device consumed to process the data deletion transaction; and executing the data deletion transaction after the deduction is successful, and deleting the target data corresponding to the identification information from the target intelligent contract account managed by the user.
In this embodiment, in order to reduce the waste of system resources of a node device due to a failure of invoking the intelligent contract and a failure of the intelligent contract caused by insufficient balance of virtual resources in the blockchain account corresponding to the user identifier to pay for the second amount of virtual resources required to be transferred for processing the data deletion transaction, the consensus verification process performed by the consensus node of the blockchain may include: verifying whether the number of virtual resources held by a blockchain user account corresponding to the identifier included in the data deletion transaction is not less than a preset threshold value.
The preset threshold may be a fixed virtual resource threshold set by the blockchain developer for the data deletion type transaction, for example, the preset threshold may be set based on the minimum system resource consumption of the data deletion type transaction, or the number of virtual resources anchored by the average system resource consumption; under the condition, in order to enable the intelligent contract to be successfully invoked and executed, the virtual resource quantity meeting the preset threshold value needs to be held in the block chain account corresponding to the user identifier, so that when the virtual resource quantity in the user account is less than the preset threshold value, a prompt that the consensus verification fails is directly returned, and further consumption of system resources due to processing of the data deletion transaction after the node equipment is in the consensus verification stage is avoided.
In some embodiments, although the data deletion transaction passes the consensus verification that the balance of the user account is not less than the preset threshold, the transaction may be executed unsuccessfully due to the fact that the newly added storage resource required for the data deletion transaction is too large or the logic for invoking the intelligent contract execution is too complex, and the second amount of the virtual resource determined by calculation is larger than the balance of the user account.
Optionally, the consensus verification may further include the process of calculating the first amount of the system resource of the node device consumed for processing the data deletion transaction and determining the second amount of the virtual resource anchored to the first amount of the system resource value, as described in step 404, for example, when the underlying protocol of the blockchain deploys a calculation model for calculating the amount of the virtual resource anchored to the system resource value of the node device consumed for processing the data deletion transaction, and the consensus node acquires the data deletion transaction, the second amount of the system resource anchored virtual resource consumed for processing the intelligent contract by the node device and calculated and determined by the underlying protocol of the blockchain may be acquired, and in this case, the preset threshold may be the second amount of the virtual resource determined by the calculation process, so that the consensus node of the blockchain is in the consensus verification, and executing consensus verification whether the payment is enough or not directly based on the second amount of the virtual resources required to be deducted for processing the data deletion transaction, thereby providing more accurate consensus verification and improving the execution success rate of the data deletion transaction passing the consensus verification.
In one or more of the embodiments shown above, the management platform performs a second number of virtual resource charges on behalf of the node device of the blockchain based on the system resources provided by the node device of the blockchain; the management platform may further set a corresponding virtual resource allocation rule, and allocate the received virtual resource to the node user of the blockchain based on a preset period (including real-time or periodically), so that the node user of the blockchain may acquire the corresponding virtual resource based on the system resource provided by the node user for processing the data deletion transaction. The present specification does not specifically limit the allocation manner of the virtual resources, and for example, the virtual resources may be allocated to the blockchain accounts of the node devices by a linked bank account or by a management platform through a system administrator-level instruction.
Corresponding to the above flow implementation, the embodiments of the present specification further provide deletion apparatuses 50 and 60 for blockchain data. The means 50 and 60 may be implemented by software, by hardware or by a combination of both. Taking a software implementation as an example, the logical device is formed by reading a corresponding computer program instruction into a memory for running through a Central Processing Unit (CPU) of the device. In terms of hardware, the device in which the apparatus is located generally includes other hardware such as a chip for transmitting and receiving wireless signals and/or other hardware such as a board for implementing a network communication function, in addition to the CPU, the memory, and the storage shown in fig. 7.
As shown in fig. 5, the present specification further provides a device for deleting blockchain data, which is applied to a management platform for managing node devices of a blockchain, where a system resource and a virtual resource carried by the node devices of the blockchain are value-anchored; the device comprises:
the acquiring unit 502 is configured to acquire a data deletion transaction triggered by a blockchain client, where the data deletion transaction includes identification information of target data to be deleted;
a calculating unit 504 that calculates a first amount of system resources of a node device of the blockchain consumed to process the data deletion transaction and determines a second amount of the virtual resources that are anchored to the first amount of system resource value;
a sending unit 506, configured to send the data deletion transaction to the blockchain after the virtual resource account of the user is deducted from the second amount of virtual resources, so that a node device of the blockchain executes the data deletion transaction, and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
In yet another illustrated embodiment, the data deletion transaction is a smart contract invocation transaction, and the execution logic corresponding to the contract code of the target smart contract includes data deletion logic;
the data deletion transaction is executed by the node device of the blockchain, and the target data corresponding to the identification information is deleted from the target intelligent contract account managed by the user, and the method comprises the following steps:
and the node equipment of the block chain calls the target intelligent contract, executes the data deleting logic and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
In yet another illustrated embodiment, the deleting the target data corresponding to the identification information from the target smart contract account managed by the user includes:
and removing the target data from the account storage space of the target intelligent contract managed by the user, and storing the target data to a backup database maintained by the block chain.
In yet another illustrated embodiment, the apparatus 50 further includes a returning unit 508, before sending the data deletion transaction to the blockchain, if the virtual resource account of the user is not successfully deducted the second amount of virtual resources within a preset time limit, returning a prompt that the intelligent contract invocation transaction execution fails to the blockchain client.
In yet another illustrated embodiment, processing system resources of the node device consumed by the data deletion transaction includes a combination of one or more of the following:
processing storage resources of the node device consumed by the smart contract creation transaction, the storage resources including storage resources consumed by the target data in the backup database maintained by the blockchain;
processing computing resources of a node device consumed by the smart contract creation transaction;
processing the smart contract to create network resources of the node device consumed by the transaction.
In yet another illustrated embodiment, the blockchain deploys a resource computation contract, and execution logic corresponding to contract code of the resource computation contract includes computation logic;
the calculating unit 504 is further configured to:
invoking the resource computation contract, executing the computation logic, computing a first amount of system resources of the node device consumed to process the data deletion transaction, and determining a second amount of the virtual resources anchored to the second amount of system resource values.
In yet another illustrated embodiment, the apparatus 50 further comprises a distribution unit 510:
allocating the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the block chain for holding, and further executing the intelligent contract creation transaction after the allocation is finished.
In yet another illustrated embodiment, the allocating unit 510 is further configured to:
averagely distributing the second quantity of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource accounts corresponding to the node devices of the block chain for holding respectively;
or, based on the storage medium performance attribute of the account storage resource allocated to the intelligent contract by each node device of the block chain, allocating the second number of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to each node device of the block chain for holding respectively.
In a further illustrated embodiment, the management platform maintains a remaining storage capacity of the account storage resources allocated by the node device for the target intelligent contract;
the apparatus further includes an updating unit 512, configured to update the remaining storage capacity of the account storage resource allocated to the target intelligent contract by the node device maintained by the management platform after the target data is deleted.
In yet another illustrated embodiment, the management platform comprises a cloud computing management platform; the node devices of the blockchain include virtual machines created on physical hosts managed by a cloud computing management platform.
The implementation process of the functions and actions of each unit in the apparatus 50 for processing the node device consumed by the intelligent contract creation transaction, where the node device consumed by the intelligent contract creation transaction is processed, is specifically described in the implementation manner of sending the data deletion transaction to the block chain after the virtual resource account of the user is deducted by the second amount of virtual resources, and the implementation process of the corresponding step in the block chain data deletion method executed by the management platform may refer to the partial description of the method embodiment, and details are not described herein.
As shown in fig. 6, the present specification further provides a device 60 for deleting blockchain data, which is applied to a management platform for managing node devices of a blockchain, where a system resource and a virtual resource carried by the node devices of the blockchain are value-anchored; the apparatus 60 comprises:
the acquiring unit 602 acquires a data deletion transaction triggered by a blockchain client, where the data deletion transaction includes identification information of target data to be deleted;
a sending unit 604, configured to send the data deletion transaction to the blockchain, so that a node device of the blockchain executes the data deletion transaction, and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user;
a calculating unit 606, configured to calculate a first amount of system resources of the node devices of the blockchain consumed for processing the data deletion transaction after the node devices of the blockchain perform the data deletion transaction, and determine a second amount of the virtual resources anchored to the system resource values of the first amount.
In yet another illustrated embodiment, the data deletion transaction is a smart contract invocation transaction, and the execution logic corresponding to the contract code of the target smart contract includes data deletion logic;
the data deletion transaction is executed by the node device of the blockchain, and the target data corresponding to the identification information is deleted from the target intelligent contract account managed by the user, and the method comprises the following steps:
and the node equipment of the block chain calls the target intelligent contract, executes the data deleting logic and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
In yet another illustrated embodiment, the deleting the target data corresponding to the identification information from the target smart contract account managed by the user includes:
and removing the target data from the account storage space of the target intelligent contract managed by the user, and storing the target data to a backup database maintained by the block chain.
In yet another illustrated embodiment, the virtual resource is a blockchain asset published on a blockchain anchored as value to an off-chain asset held by a user;
the data deletion transaction also includes an account identification of the user;
the virtual resource account of the user comprises a blockchain user account corresponding to the account identification.
In a further illustrated embodiment, the apparatus 60 further comprises a return unit 608,
if the virtual resource account of the user is successfully deducted by the second amount of virtual resources, instructing the node equipment to store the generated transaction receipt of the data deletion transaction to a blockchain, and returning an execution result of the intelligent contract calling transaction to the blockchain client based on the transaction receipt;
and if the number of the virtual resources held by the virtual resource account of the user is less than the second number, indicating the node equipment to delete the generated transaction receipt of the data deletion transaction, and returning a prompt of failure in calling the intelligent contract to the blockchain client.
In yet another illustrated embodiment, processing system resources of the node device consumed by the data deletion transaction includes a combination of one or more of the following:
processing storage resources of the node device consumed by the smart contract creation transaction, the storage resources including storage resources consumed by the target data in the backup database maintained by the blockchain;
processing computing resources of a node device consumed by the smart contract creation transaction;
processing the smart contract to create network resources of the node device consumed by the transaction.
In yet another illustrated embodiment, the blockchain deploys a resource computation contract, and execution logic corresponding to contract code of the resource computation contract includes computation logic;
the calculating unit 606 is further configured to:
invoking the resource computation contract, executing the computation logic, computing a first amount of system resources of the node device consumed to process the data deletion transaction, and determining a second amount of the virtual resources anchored to the second amount of system resource values.
In yet another illustrated embodiment, the apparatus 60 further includes an allocating unit 610, which allocates the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the block chain for holding, and further executes the intelligent contract creation transaction after the allocation is completed.
In yet another illustrated embodiment, the allocation unit 610 is further configured to:
averagely distributing the second quantity of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource accounts corresponding to the node devices of the block chain for holding respectively;
or, based on the storage medium performance attribute of the account storage resource allocated to the intelligent contract by each node device of the block chain, allocating the second number of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to each node device of the block chain for holding respectively.
In a further illustrated embodiment, the management platform maintains a remaining storage capacity of the account storage resources allocated by the node device for the target intelligent contract;
the apparatus 60 further includes an updating unit 612, configured to update the remaining storage capacity of the account storage resource allocated by the node device maintained by the management platform for the target intelligent contract after the target data is deleted.
In yet another illustrated embodiment, the management platform comprises a cloud computing management platform; the node devices of the blockchain include virtual machines created on physical hosts managed by a cloud computing management platform.
The implementation process of the functions and actions of each unit in the device 60 is specifically described in the implementation manner of deducting the second amount of virtual resources from the virtual resource account of the user after the data deletion transaction is executed by the node device of the blockchain, and the implementation process of the corresponding step in the block chain data deletion method executed by the management platform may be referred to in the description of the method embodiment, and details are not described herein again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the units or modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The apparatuses, units and modules illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the above method embodiment, the embodiment of the present specification further provides a computer device, as shown in fig. 7, including a memory and a processor. Wherein the memory has stored thereon a computer program executable by the processor; when running the stored computer program, the processor executes the steps of the block chain data deletion method executed by the management platform in which the apparatus shown in fig. 5 is located. For a detailed description of each step of the method for deleting blockchain data performed by the management platform, please refer to the previous contents, which is not repeated.
Corresponding to the above method embodiment, the embodiment of the present specification further provides a computer device, as shown in fig. 7, including a memory and a processor. Wherein the memory has stored thereon a computer program executable by the processor; when running the stored computer program, the processor executes the steps of the method for deleting blockchain data executed by the management platform in which the apparatus shown in fig. 6 is located. For a detailed description of each step of the method for deleting blockchain data performed by the management platform, please refer to the previous contents, which is not repeated.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data.
Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.

Claims (36)

1. A method for deleting block chain data is applied to a management platform for managing each node device of a block chain, wherein the management platform is connected with each node device; the system resources and the virtual resources carried by the node equipment of the block chain are subjected to value anchoring; the method comprises the following steps:
acquiring a data deletion transaction triggered by a block chain client, wherein the data deletion transaction comprises identification information of target data to be deleted;
calculating a first amount of system resources of a node device of the blockchain consumed to process the data deletion transaction and determining a second amount of the virtual resources anchored to the first amount of system resource value;
after the virtual resource account of the user is deducted from the second amount of virtual resources, sending the data deletion transaction to the blockchain, so that node equipment of the blockchain executes the data deletion transaction, deleting the target data corresponding to the identification information from a target intelligent contract account managed by the user, and storing the target data in a backup database maintained by the blockchain;
wherein processing system resources of the node device consumed by the data deletion transaction comprises:
processing storage resources of the node device consumed by the data deletion transaction, the storage resources including storage resources consumed by the target data in a backup database maintained by the blockchain; or processing the data to delete the network resources of the node device consumed by the transaction.
2. The method of claim 1, wherein the data deletion transaction is a smart contract invocation transaction, and the execution logic corresponding to the contract code of the target smart contract comprises data deletion logic;
the data deletion transaction is executed by the node device of the blockchain, and the target data corresponding to the identification information is deleted from the target intelligent contract account managed by the user, and the method comprises the following steps:
and the node equipment of the block chain calls the target intelligent contract, executes the data deleting logic and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
3. The method of claim 1, prior to sending the data deletion transaction to the blockchain, returning a prompt to the blockchain client that the smart contract invocation transaction failed to execute if the virtual resource account of the user was not successfully deducted the second amount of virtual resources within a preset time limit.
4. The method of claim 1, the blockchain deploying a resource computation contract, execution logic corresponding to contract code of the resource computation contract comprising computational logic;
the computing processing a first amount of system resources of the node device consumed by the data deletion transaction and determining a second amount of the virtual resources anchored to the first amount of system resource value includes:
invoking the resource computation contract, executing the computation logic, computing a first amount of system resources of the node device consumed to process the data deletion transaction, and determining a second amount of the virtual resources anchored to the first amount of system resource value.
5. The method of claim 1, further comprising:
allocating the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the block chain for holding, and further executing the intelligent contract creation transaction after the allocation is finished.
6. The method of claim 5, wherein allocating the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the block chain for holding comprises:
averagely distributing the second quantity of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource accounts corresponding to the node devices of the block chain for holding respectively;
or, based on the storage medium performance attribute of the account storage resource allocated to the intelligent contract by each node device of the block chain, allocating the second number of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to each node device of the block chain for holding respectively.
7. The method of claim 1, wherein the management platform maintains a remaining storage capacity of account storage resources allocated by a node device for the target intelligent contract;
the method further comprises the following steps:
and after the target data is deleted, updating the residual storage capacity of the account storage resources allocated to the target intelligent contract by the node equipment maintained by the management platform.
8. The method of claim 1, the management platform comprising a cloud computing management platform; the node devices of the blockchain include virtual machines created on physical hosts managed by a cloud computing management platform.
9. A method for deleting block chain data is applied to a management platform for managing each node device of a block chain, wherein the management platform is connected with each node device; the system resources and the virtual resources carried by the node equipment of the block chain are subjected to value anchoring; the method comprises the following steps:
acquiring a data deletion transaction triggered by a block chain client, wherein the data deletion transaction comprises identification information of target data to be deleted;
sending the data deletion transaction to the blockchain so that node equipment of the blockchain executes the data deletion transaction, deleting the target data corresponding to the identification information from a target intelligent contract account managed by a user, and storing the target data to a backup database maintained by the blockchain;
after the data deletion transaction is executed by the node device of the blockchain, calculating a first amount of system resources of the node device of the blockchain actually consumed by processing the data deletion transaction, and determining a second amount of the virtual resources anchored with the system resource value of the first amount, so that the virtual resource account of the user is deducted by the second amount of the virtual resources;
wherein processing system resources of the node device consumed by the data deletion transaction comprises:
processing storage resources of the node device consumed by the data deletion transaction, the storage resources including storage resources consumed by the target data in a backup database maintained by the blockchain; or processing the data to delete the network resources of the node device consumed by the transaction.
10. The method of claim 9, wherein the data deletion transaction is a smart contract invocation transaction, and the execution logic corresponding to the contract code of the target smart contract comprises data deletion logic;
the data deletion transaction is executed by the node device of the blockchain, and the target data corresponding to the identification information is deleted from the target intelligent contract account managed by the user, and the method comprises the following steps:
and the node equipment of the block chain calls the target intelligent contract, executes the data deleting logic and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
11. The method of claim 9, the virtual resource is a blockchain asset published on a blockchain anchored as value to an off-chain asset held by a user;
the data deletion transaction also includes an account identification of the user account;
the virtual resource account of the user comprises a blockchain user account corresponding to the account identification.
12. The method of claim 9 or 11, instructing a node device to save a transaction receipt for the generated data deletion transaction to a blockchain and return an execution result for the data deletion transaction to the blockchain client based on the transaction receipt if the virtual resource account of the user is successfully deducted by the second amount of virtual resources;
and if the number of the virtual resources held by the virtual resource account of the user is less than the second number, indicating the node equipment to delete the generated transaction receipt of the data deletion transaction, and returning a prompt of failure in calling the intelligent contract to the blockchain client.
13. The method of claim 9, the blockchain deploying a resource computation contract, execution logic corresponding to contract code of the resource computation contract comprising resource computation logic;
the computing processing a first amount of system resources of the node device consumed by the data deletion transaction and determining a second amount of the virtual resources anchored to the first amount of system resource value includes:
invoking the resource computation contract, executing the resource computation logic, computing a first amount of system resources of the node device consumed to process the data deletion transaction, and determining a second amount of the virtual resources anchored to the first amount of system resource values.
14. The method of claim 9, further comprising:
allocating the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the block chain for holding.
15. The method of claim 14, allocating the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the blockchain for holding, comprising:
averagely distributing the second quantity of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource accounts corresponding to the node devices of the block chain for holding respectively;
or, based on the storage medium performance attribute of the account storage resource allocated to the intelligent contract by each node device of the block chain, allocating the second number of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to each node device of the block chain for holding respectively.
16. The method of claim 9, wherein the management platform maintains a remaining storage capacity of account storage resources allocated by a node device for the target intelligent contract;
the method further comprises the following steps:
and after the target data is deleted, updating the residual storage capacity of the account storage resources allocated to the target intelligent contract by the node equipment maintained by the management platform.
17. The method of claim 9, the management platform comprising a cloud computing management platform; the node devices of the blockchain include virtual machines created on physical hosts managed by a cloud computing management platform.
18. A device for deleting block chain data is applied to a management platform for managing each node device of a block chain, wherein the management platform is connected with each node device; the system resources and the virtual resources carried by the node equipment of the block chain are subjected to value anchoring; the device comprises:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring data deletion transaction triggered by a block chain client, and the data deletion transaction comprises identification information of target data to be deleted;
a calculation unit to calculate a first amount of system resources of a node device of the blockchain consumed to process the data deletion transaction and to determine a second amount of the virtual resources anchored to the first amount of system resource value;
a sending unit, configured to send the data deletion transaction to the blockchain after the second amount of virtual resources are deducted from a virtual resource account of a user, so that a node device of the blockchain executes the data deletion transaction, delete the target data corresponding to the identification information from a target intelligent contract account managed by the user, and store the target data in a backup database maintained by the blockchain;
wherein processing system resources of the node device consumed by the data deletion transaction comprises:
processing storage resources of the node device consumed by the data deletion transaction, the storage resources including storage resources consumed by the target data in a backup database maintained by the blockchain; or processing the data to delete the network resources of the node device consumed by the transaction.
19. The apparatus of claim 18, wherein the data deletion transaction is a smart contract invocation transaction, and the execution logic corresponding to the contract code of the target smart contract comprises data deletion logic;
the data deletion transaction is executed by the node device of the blockchain, and the target data corresponding to the identification information is deleted from the target intelligent contract account managed by the user, and the method comprises the following steps:
and the node equipment of the block chain calls the target intelligent contract, executes the data deleting logic and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
20. The apparatus of claim 18, further comprising a return unit to return a prompt to the blockchain client that the intelligent contract invocation transaction failed to execute if the virtual resource account of the user was not successfully deducted the second amount of virtual resource within a preset time limit before sending the data deletion transaction to the blockchain.
21. The apparatus of claim 18, the blockchain deploying a resource computation contract, execution logic corresponding to contract code of the resource computation contract comprising computational logic;
the computing unit is further configured to:
invoking the resource computation contract, executing the computation logic, computing a first amount of system resources of the node device consumed to process the data deletion transaction, and determining a second amount of the virtual resources anchored to the first amount of system resource value.
22. The apparatus according to claim 18, further comprising an allocation unit that allocates the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the block chain for holding, and further executes the smart contract creation transaction after allocation is completed.
23. The apparatus of claim 22, the allocation unit, further to:
averagely distributing the second quantity of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource accounts corresponding to the node devices of the block chain for holding respectively;
or, based on the storage medium performance attribute of the account storage resource allocated to the intelligent contract by each node device of the block chain, allocating the second number of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to each node device of the block chain for holding respectively.
24. The apparatus of claim 18, wherein the management platform maintains a remaining storage capacity of account storage resources allocated by a node device for the target intelligent contract;
the device further comprises an updating unit, and after the target data is deleted, the residual storage capacity of the account storage resources allocated to the target intelligent contract by the node equipment maintained by the management platform is updated.
25. The apparatus of claim 18, the management platform comprising a cloud computing management platform; the node devices of the blockchain include virtual machines created on physical hosts managed by a cloud computing management platform.
26. A device for deleting block chain data is applied to a management platform for managing each node device of a block chain, wherein the management platform is connected with each node device; the system resources and the virtual resources carried by the node equipment of the block chain are subjected to value anchoring; the device comprises:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring data deletion transaction triggered by a block chain client, and the data deletion transaction comprises identification information of target data to be deleted;
the sending unit is used for sending the data deletion transaction to the block chain so as to enable the node equipment of the block chain to execute the data deletion transaction, deleting the target data corresponding to the identification information from a target intelligent contract account managed by a user, and storing the target data in a backup database maintained by the block chain;
a calculating unit, configured to calculate, after the node device executes the data deletion transaction, a first amount of system resources of the node device of the blockchain consumed for processing the data deletion transaction, and determine a second amount of the virtual resources anchored to the system resource value of the first amount, so that the second amount of the virtual resources is deducted from the virtual resource account of the user;
wherein processing system resources of the node device consumed by the data deletion transaction comprises:
processing storage resources of the node device consumed by the data deletion transaction, the storage resources including storage resources consumed by the target data in a backup database maintained by the blockchain; or processing the data to delete the network resources of the node device consumed by the transaction.
27. The apparatus of claim 26, wherein the data deletion transaction is a smart contract invocation transaction, and the execution logic corresponding to the contract code of the target smart contract comprises data deletion logic;
the data deletion transaction is executed by the node device of the blockchain, and the target data corresponding to the identification information is deleted from the target intelligent contract account managed by the user, and the method comprises the following steps:
and the node equipment of the block chain calls the target intelligent contract, executes the data deleting logic and deletes the target data corresponding to the identification information from the target intelligent contract account managed by the user.
28. The apparatus of claim 26, the virtual resource is a blockchain asset published on a blockchain anchored as value to an off-chain asset held by a user;
the data deletion transaction also includes an account identification of the user;
the virtual resource account of the user comprises a blockchain user account corresponding to the account identification.
29. The apparatus of claim 26 or 28, further comprising a return unit,
if the virtual resource account of the user is successfully deducted by the second amount of virtual resources, instructing the node device to store the generated transaction receipt of the data deletion transaction to a blockchain, and returning an execution result of the data deletion transaction to the blockchain client based on the transaction receipt;
and if the number of the virtual resources held by the virtual resource account of the user is less than the second number, indicating the node equipment to delete the generated transaction receipt of the data deletion transaction, and returning a prompt of failure in calling the intelligent contract to the blockchain client.
30. The apparatus of claim 26, the blockchain deploying a resource computation contract, execution logic corresponding to contract code of the resource computation contract comprising computational logic;
the computing unit is further configured to:
invoking the resource computation contract, executing the computation logic, computing a first amount of system resources of the node device consumed to process the data deletion transaction, and determining a second amount of the virtual resources anchored to the first amount of system resource value.
31. The apparatus according to claim 26, further comprising an allocating unit, configured to allocate the second amount of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to the node device of the block chain for holding, and further execute the smart contract creation transaction after allocation is completed.
32. The apparatus of claim 31, the allocation unit, further to:
averagely distributing the second quantity of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource accounts corresponding to the node devices of the block chain for holding respectively;
or, based on the storage medium performance attribute of the account storage resource allocated to the intelligent contract by each node device of the block chain, allocating the second number of virtual resources deducted from the virtual resources held by the virtual resource account of the user to the virtual resource account corresponding to each node device of the block chain for holding respectively.
33. The apparatus of claim 26, wherein the management platform maintains a remaining storage capacity of account storage resources allocated by node devices for the target smart contract;
the device further comprises an updating unit, and after the target data is deleted, the residual storage capacity of the account storage resources allocated to the target intelligent contract by the node equipment maintained by the management platform is updated.
34. The apparatus of claim 26, the management platform comprising a cloud computing management platform; the node devices of the blockchain include virtual machines created on physical hosts managed by a cloud computing management platform.
35. A computer device, comprising: a memory and a processor; the memory having stored thereon a computer program executable by the processor; the processor, when executing the computer program, performs the method of any of claims 1 to 8.
36. A computer device, comprising: a memory and a processor; the memory having stored thereon a computer program executable by the processor; the processor, when executing the computer program, performs the method of any of claims 9 to 17.
CN202011126773.6A 2020-10-20 2020-10-20 Block chain data deleting method and device Active CN112015822B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011126773.6A CN112015822B (en) 2020-10-20 2020-10-20 Block chain data deleting method and device
CN202110827166.0A CN113553378A (en) 2020-10-20 2020-10-20 Block chain data deleting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011126773.6A CN112015822B (en) 2020-10-20 2020-10-20 Block chain data deleting method and device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202110827166.0A Division CN113553378A (en) 2020-10-20 2020-10-20 Block chain data deleting method and device

Publications (2)

Publication Number Publication Date
CN112015822A CN112015822A (en) 2020-12-01
CN112015822B true CN112015822B (en) 2021-05-25

Family

ID=73528122

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202011126773.6A Active CN112015822B (en) 2020-10-20 2020-10-20 Block chain data deleting method and device
CN202110827166.0A Pending CN113553378A (en) 2020-10-20 2020-10-20 Block chain data deleting method and device

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202110827166.0A Pending CN113553378A (en) 2020-10-20 2020-10-20 Block chain data deleting method and device

Country Status (1)

Country Link
CN (2) CN112015822B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153827B (en) * 2021-10-11 2023-01-10 北京天德科技有限公司 Transaction data removing method based on block chain system
CN115098483A (en) * 2022-06-29 2022-09-23 蚂蚁区块链科技(上海)有限公司 Pre-execution cache data cleaning method and block link point
CN115934849B (en) * 2023-03-13 2023-05-30 安徽中科晶格技术有限公司 Method, device, node and storage medium for block workload certification consensus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376008A (en) * 2018-09-25 2019-02-22 阿里巴巴集团控股有限公司 A kind of distribution method and device of virtual resource
CN109615352A (en) * 2019-01-21 2019-04-12 深圳市祥云万维科技有限公司 A kind of resource aggregation networks and method
CN110597888A (en) * 2019-09-29 2019-12-20 腾讯科技(深圳)有限公司 Method, device, medium and equipment for acquiring virtual resources based on block chains

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11256551B2 (en) * 2019-04-22 2022-02-22 Advanced New Technologies Co., Ltd. Blockchain-based virtual resource allocation
CN110163483A (en) * 2019-04-22 2019-08-23 阿里巴巴集团控股有限公司 Virtual resource allocation method and apparatus based on block chain
US10785168B2 (en) * 2019-07-15 2020-09-22 Alibaba Group Holding Limited Allocating virtual resource based on block chain
CN111639125A (en) * 2020-05-06 2020-09-08 支付宝实验室(新加坡)有限公司 Resource circulation method and device based on block chain
CN111383019A (en) * 2020-05-28 2020-07-07 支付宝(杭州)信息技术有限公司 Transaction execution method and system based on alliance link network
CN111539730A (en) * 2020-05-29 2020-08-14 支付宝(杭州)信息技术有限公司 Data processing method and device based on block chain and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376008A (en) * 2018-09-25 2019-02-22 阿里巴巴集团控股有限公司 A kind of distribution method and device of virtual resource
CN109615352A (en) * 2019-01-21 2019-04-12 深圳市祥云万维科技有限公司 A kind of resource aggregation networks and method
CN110597888A (en) * 2019-09-29 2019-12-20 腾讯科技(深圳)有限公司 Method, device, medium and equipment for acquiring virtual resources based on block chains

Also Published As

Publication number Publication date
CN112015822A (en) 2020-12-01
CN113553378A (en) 2021-10-26

Similar Documents

Publication Publication Date Title
WO2021008122A1 (en) Virtual resource allocation method and device employing blockchain, and electronic apparatus
US10986177B2 (en) Systems and methods of self-forking blockchain protocol
US11336589B2 (en) Allocating virtual resource based on blockchain
CN112015823B (en) Block chain data deleting method and device
CN112015822B (en) Block chain data deleting method and device
CN111966538B (en) Block chain data recovery method and device
CN111476667B (en) Block chain-based original work transaction method and device and electronic equipment
CN111966757B (en) Method and device for managing storage space of intelligent contract account
CN110458631B (en) Bill number distribution method and device based on block chain and electronic equipment
CN111967995A (en) Intelligent contract creating method and device
CN112015596B (en) Block chain data recovery method and device
CN111966503B (en) Method and device for managing storage space of intelligent contract account
CN112015576A (en) Calling method and device of intelligent contract
CN112200567B (en) Resource management method and device based on block chain and electronic equipment
CN112200571A (en) Resource distribution method and device based on block chain and electronic equipment
CN112200568B (en) Block chain based account creation method and device and electronic equipment
CN112200572A (en) Resource distribution method and device based on block chain and electronic equipment
CN110443612B (en) Block chain-based reimbursement expense segmentation method and device and electronic equipment
CN112015577B (en) Intelligent contract calling method and device
CN111967994B (en) Intelligent contract creating method and device
CN112070503A (en) Contract execution method, device, equipment and storage medium based on block chain
CN112200570A (en) Resource distribution method and device based on block chain and electronic equipment
CN112365353A (en) Block chain-based content propagation method and device
CN111523052A (en) Block chain-based user recommendation method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40041864

Country of ref document: HK