Data processing method and device based on blockchain system, medium and electronic equipment
By receiving and processing transaction information through consensus within the blockchain system, on-chain data accounts are migrated from their original on-chain addresses to new on-chain addresses, solving the problem of high migration costs when changing public and private keys and improving the convenience and maintainability of the blockchain.
Patent Information
- Application Number
- CN202111229470.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-21
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2041-10-21
AI Technical Summary
In blockchain technology, the cost of migrating on-chain data when changing public and private keys is high, and existing technologies are unable to effectively reduce it.
By receiving transaction information from blockchain users, performing consensus processing, and after successful verification, adjusting the data account to be migrated from the original on-chain address to the new on-chain address, the migration of on-chain data accounts is achieved.
This significantly reduces the data migration cost when changing on-chain public and private keys, and improves the convenience and maintainability of the blockchain.
Smart Images

Figure CN116010371B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers and communications, in particular to a data processing method and device based on a blockchain system, a medium and an electronic device. BACKGROUND
[0002] In the blockchain technology, a blockchain user needs to use a pair of asymmetric cryptography public and private keys to participate in communication interaction in the blockchain network. The private key is used to sign the on-chain transaction, and the public key is disclosed in the blockchain network. All nodes in the blockchain network can use the public key to verify the validity of the transaction. In this way, the transaction that has been on-chain is packaged into a block and recorded. If the blockchain user wants to replace the public and private keys, it means that the transactions signed on-chain using the original public and private keys need to be discarded. If the on-chain resources corresponding to the original public and private keys are migrated to the on-chain address corresponding to the new public and private keys, a huge migration cost will be generated. SUMMARY
[0003] Embodiments of the present application provide a data processing method and device based on a blockchain system, a medium and an electronic device, which can at least to some extent convert the migration of on-chain data into the migration of on-chain data accounts, greatly reducing the data migration cost when replacing the on-chain public and private keys.
[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0005] According to an aspect of an embodiment of the present application, a data processing method based on a blockchain system is provided. The on-chain address in the blockchain system is associated with a data account for storing data. The method comprises: receiving first transaction information for data account migration sent by a blockchain user, the first transaction information containing a to-be-migrated data account, a first string, a new on-chain address to be migrated to, a public key corresponding to the new on-chain address, and signature information of the first string signed by a private key corresponding to the new on-chain address; performing consensus processing on the first transaction information; after the consensus processing on the first transaction information is completed, verifying the signature information contained in the first transaction information according to the public key corresponding to the new on-chain address, and verifying whether the original on-chain address of the blockchain user is associated with the to-be-migrated data account; if the signature information is verified and the original on-chain address is associated with the to-be-migrated data account, adjusting the to-be-migrated data account from being associated with the original on-chain address to being associated with the new on-chain address.
[0006] According to an aspect of some embodiments of the present application, a data processing apparatus based on a blockchain system is provided. The blockchain system has a chain address associated with a data account for storing data. The apparatus comprises: a receiving unit configured to receive first transaction information for data account migration sent by a blockchain user, the first transaction information containing a data account to be migrated, a first string, a new chain address to which the data account is to be migrated, a public key corresponding to the new chain address, and signature information of the first string signed by a private key corresponding to the new chain address; a first processing unit configured to perform consensus processing on the first transaction information; a verification unit configured to, after the consensus processing on the first transaction information is completed, verify the signature information contained in the first transaction information according to the public key corresponding to the new chain address, and verify whether an original chain address of the blockchain user is associated with the data account to be migrated; and a second processing unit configured to, if the signature information is verified and the original chain address is associated with the data account to be migrated, adjust the data account to be migrated from being associated with the original chain address to being associated with the new chain address.
[0007] In some embodiments of the present application, based on the foregoing scheme, the first transaction information is signed by a private key corresponding to the original chain address of the blockchain user; the first processing unit is configured to, after receiving the first transaction information, perform signature verification on the first transaction information by using a public key corresponding to the original chain address of the blockchain user, and, after the verification is passed, package the first transaction information to perform consensus processing on a block generated by the packaging.
[0008] In some embodiments of the present application, based on the foregoing scheme, the data account comprises a business data account; the receiving unit is further configured to receive second transaction information for creating a business data account, the second transaction information containing business data account information to be created; the first processing unit is further configured to perform verification and consensus processing on the second transaction information; and the data processing apparatus further comprises a third processing unit configured to, after the consensus processing on the second transaction information is completed, create a business data account according to the business data account information to be created contained in the second transaction information, and associate the created business data account with a sending chain address of the second transaction information.
[0009] In some embodiments of the present application, based on the foregoing scheme, the business data account information to be created comprises a business data account identifier to be created and field information required by the business data account to be created; and the third processing unit is configured to, if it is detected according to the business data account identifier to be created that there is no corresponding business data account, create a business data account corresponding to the business data account identifier, and create corresponding fields according to the field information.
[0010] In some embodiments of the present application, based on the foregoing scheme, the third processing unit is further configured to, after creating the business data account according to the to-be-created business data account information contained in the second transaction information, assign operation permissions of the created business data account to a sender of the second transaction information.
[0011] In some embodiments of the present application, based on the foregoing scheme, the data account includes a business data account; the receiving unit is further configured to receive third transaction information for triggering a contract-in registration method of a blockchain smart contract to execute, the registration method contained in the blockchain smart contract being used to create a business data account; the first processing unit is further configured to perform consensus processing on the third transaction information; and the data processing apparatus further includes a fourth processing unit configured to, after consensus processing on the third transaction information is completed, trigger the blockchain smart contract to create a business data account and associate the created business data account with an on-chain address of a sender of the third transaction information.
[0012] In some embodiments of the present application, based on the foregoing scheme, the fourth processing unit is further configured to, after triggering the blockchain smart contract to create a business data account, assign operation permissions of the created business data account to the blockchain smart contract.
[0013] In some embodiments of the present application, based on the foregoing scheme, the fourth processing unit is further configured to, after triggering the blockchain smart contract to create a business data account, generate an identifier of the created business data account according to address information of the blockchain smart contract.
[0014] In some embodiments of the present application, based on the foregoing scheme, the data account includes a system data account, which is automatically generated after an on-chain address is registered in the blockchain system and is used to store data required by the corresponding on-chain address.
[0015] In some embodiments of the present application, based on the foregoing scheme, the receiving unit is further configured to receive fourth transaction information for accessing a data account, the fourth transaction information containing to-be-accessed data account information and access requirement information; the first processing unit is further configured to perform verification and consensus processing on the fourth transaction information; and the data processing apparatus further includes a fifth processing unit configured to, after consensus processing on the fourth transaction information is completed, search for the to-be-accessed data account information according to an on-chain address of a sender of the fourth transaction information, and if the to-be-accessed data account information is found and the sender of the fourth transaction information has permission to access the found data account, access the found data account according to the access requirement information.
[0016] In some embodiments of the present application, based on the foregoing scheme, the access requirement information includes field content information that needs to be changed.
[0017] In some embodiments of the present application, based on the foregoing scheme, the receiving unit is further configured to receive fifth transaction information for triggering execution of the blockchain smart contract; the first processing unit is further configured to perform verification and consensus processing on the fifth transaction information; and the data processing apparatus further includes a sixth processing unit configured to trigger execution of the blockchain smart contract after the verification and consensus processing on the fifth transaction information, and to call a data account access interface to access a data account corresponding to the blockchain smart contract in the execution process of the blockchain smart contract.
[0018] In some embodiments of the present application, based on the foregoing scheme, the data account corresponding to the blockchain smart contract includes a data account corresponding to an identifier of a business data account generated according to address information of the blockchain smart contract; and the data account access interface performs an access operation on the data account corresponding to the blockchain smart contract when it is determined that the blockchain smart contract has the access right to the data account corresponding to the blockchain smart contract.
[0019] In some embodiments of the present application, based on the foregoing scheme, the transaction information sent by the blockchain user contains a transaction type field, and a value of the transaction type field is used to represent a function type of the transaction information.
[0020] In some embodiments of the present application, based on the foregoing scheme, the data account includes a business data account, at least one business data account is associated with a same on-chain address, and different business data accounts correspond to different business types.
[0021] In some embodiments of the present application, based on the foregoing scheme, the blockchain system contains a data account tree, the data account tree is associated with an on-chain address in the blockchain system, and the data account tree contains a root node and at least one data account under the root node.
[0022] According to an aspect of some embodiments of the present application, there is provided a computer readable medium having stored thereon a computer program, which, when executed by a processor, implements the data processing method based on the blockchain system as described in the above embodiments.
[0023] According to an aspect of some embodiments of the present application, an electronic device is provided, comprising: one or more processors; a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the method for data processing based on a blockchain system as described in the above embodiments.
[0024] According to an aspect of some embodiments of the present application, a computer program product or computer program is provided, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for data processing based on a blockchain system provided in the above various optional embodiments.
[0025] In the technical solutions provided by some embodiments of the present application, since the on-chain address in the blockchain system is associated with a data account for storing data, after receiving the first transaction information for data account migration sent by the blockchain user, the blockchain node performs consensus processing on the first transaction information, and after the consensus processing on the first transaction information is completed, if the signature information contained in the first transaction information is verified by the public key corresponding to the new on-chain address, and the original on-chain address is associated with the data account to be migrated, the data account to be migrated is adjusted from being associated with the original on-chain address to being associated with the new on-chain address, so that the migration of on-chain data can be converted into the migration of on-chain data accounts, greatly reducing the data migration cost when the on-chain public and private keys are replaced, and effectively improving the convenience and maintainability of the blockchain.
[0026] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0027] The drawings incorporated in the specification and constituting a part of the specification illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:
[0028] Figure 1 A structural schematic diagram of a blockchain network is shown;
[0029] Figure 2 A connection relationship schematic diagram of blocks in a blockchain is shown;
[0030] Figure 3 An account change schematic diagram in an account model is shown;
[0031] Figure 4 An implementation process diagram of the UTXO model is shown;
[0032] Figure 5 A binding relationship diagram of a data account and an on-chain address is shown;
[0033] Figure 6 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied is shown;
[0034] Figure 7 A flowchart of a data processing method based on a blockchain system according to an embodiment of the present application is shown;
[0035] Figure 8 A process diagram of a data block in consensus according to an embodiment of the present application is shown;
[0036] Figure 9 A flowchart of a data processing method based on a blockchain system according to an embodiment of the present application is shown;
[0037] Figure 10 A flowchart of a data processing method based on a blockchain system according to an embodiment of the present application is shown;
[0038] Figure 11 A flowchart of a data processing method based on a blockchain system according to an embodiment of the present application is shown;
[0039] Figure 12 A flowchart of a data processing method based on a blockchain system according to an embodiment of the present application is shown;
[0040] Figure 13 A structure diagram of Ethereum data is shown;
[0041] Figure 14 A structure diagram of transaction information according to an embodiment of the present application is shown;
[0042] Figure 15 A content diagram of the input field in the transaction information in the business data account creation process triggered by a transaction according to an embodiment of the present application is shown;
[0043] Figure 16 A contract-triggered business data account creation process diagram according to an embodiment of the present application is shown;
[0044] Figure 17 A contract-triggered on-chain data account writing process diagram according to an embodiment of the present application is shown;
[0045] Figure 18 Fig. 1 shows a schematic diagram of on-chain data account migration according to an embodiment of the present application;
[0046] Figure 19 Fig. 2 shows a block diagram of a data processing apparatus based on a blockchain system according to an embodiment of the present application;
[0047] Figure 20 Fig. 3 shows a structural schematic diagram of a computer system of an electronic device suitable for implementing embodiments of the present application. DETAILED DESCRIPTION
[0048] Example embodiments now will be described more fully hereinafter with reference to the accompanying drawings. Example embodiments may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of example embodiments to those skilled in the art.
[0049] In addition, the features, structures, or characteristics described in connection with the present application can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are recited to provide a thorough understanding of embodiments of the application. One skilled in the relevant art, however, will recognize that the application can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth.
[0050] The block diagrams in the drawings show functional entities, which do not necessarily have to correspond to physically independent entities. That is, the functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0051] The flowcharts shown in the drawings are merely exemplary illustrations, and do not necessarily include all contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be further divided, and some operations / steps can be combined or partially combined, so that the actual execution order can be changed according to actual conditions.
[0052] It should be noted that "a plurality of" as referred to herein means two or more. The conjunctive relationship between associated objects is described by "and / or", which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0053] Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, which is a series of data blocks (i.e., blocks) associated using cryptographic methods, each of which contains information about a batch of network transactions, for verifying the validity of the information (anti-fake) and generating the next block. Blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0054] The blockchain underlying platform can include user management, basic services, smart contracts, and operation processing modules. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the correspondence between the real identity of the user and the blockchain address (permission management), and in the case of authorization, supervising and auditing the transaction of certain real identities, providing rule configuration for risk control (risk audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests and record them to the storage after completing the consensus for a valid request. For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts the business information through a consensus algorithm (consensus management), and after encryption, the complete and consistent information is transmitted to the shared ledger (network communication) and recorded and stored; the smart contract module is responsible for the registration and issuance of contracts, as well as the triggering and execution of contracts. Developers can define contract logic through a certain programming language, publish it to the blockchain (contract registration), call keys or other events to trigger execution according to the logic of the contract terms, complete the contract logic, and also provide functions for contract upgrade and cancellation; the operation module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation during product release, and real-time state visualization output during product operation, such as alarms, etc.
[0055] The platform product service layer provides basic capabilities and implementation frameworks for typical applications. Developers can add business features based on these basic capabilities to complete the blockchain implementation of business logic. The application service layer provides application services based on the blockchain solution for business participants to use.
[0056] As mentioned above, blockchain is essentially a decentralized database, and blockchain is maintained by nodes in the blockchain network. For example, in the Bitcoin network, each node in the network maintains a copy of the entire blockchain, and the entire network collaborates to maintain the integrity of the blockchain. Figure 1As shown in the blockchain network, a plurality of nodes 101 can be included, and the plurality of nodes 101 can be various clients forming the blockchain network. Each node 101 can receive input information during normal operation and maintain shared data within the blockchain network based on the received input information. In order to ensure information exchange within the blockchain network, each node in the blockchain network can have an information connection between the nodes, and the nodes can transmit information through the information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network obtain the input information according to a consensus algorithm, store the input information as shared data, and ensure that the data stored on all nodes in the blockchain network is consistent.
[0057] Each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store the node identifiers of other nodes in order to subsequently broadcast the generated block to other nodes in the blockchain network according to the node identifiers of the other nodes. Each node can maintain a node identifier list, and the node name and node identifier are stored in the node identifier list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node.
[0058] Each node in the blockchain network stores a same blockchain. The blockchain is composed of a plurality of blocks, as shown in Figure 2 As shown, the blockchain is composed of a plurality of blocks, the genesis block includes a block header and a block body, the block header stores input information characteristic values, version numbers, timestamps, and difficulty values, and the block body stores input information; the next block of the genesis block takes the genesis block as the parent block, the next block also includes a block header and a block body, the block header stores input information characteristic values of the current block, block header characteristic values of the parent block, version numbers, timestamps, and difficulty values, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.
[0059] The nodes in the blockchain network can be servers or terminal devices. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal device can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like, but is not limited thereto. The nodes can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.
[0060] In the related art, there are mainly two record storage modes for the blockchain, one is an account / balance model, and the other is a UTXO (Unspent Transaction Output) model. In order to illustrate the difference between the two record storage modes, it is assumed that the following scenario exists: Zhang San obtains 12.5 virtual resources. After a few days, Zhang San pays 2.5 virtual resources to Li Si. After a few more days, Zhang San and Li Si each contribute 2.5 virtual resources to make 5 virtual resources to pay to Wang Wu.
[0061] If the account / balance model is designed, then Zhang San, Li Si, and Wang Wu each have an account in the database, and the account changes of the three are as shown in Table 1, that is, only the balance in the account is changed each time. Figure 3
[0062] If the UTXO model is designed, each transaction has several transaction inputs, that is, resource sources, and also has several transaction outputs, that is, resource destinations. Generally, each transaction spends one input and generates one output, and the output generated is the “unspent transaction output”, that is, UTXO.
[0063] Specifically, Figure 4 The transaction with transaction number #1001 shown in Table 2 is the first transaction, that is, Zhang San accidentally obtains 12.5 virtual resources. After the first transaction is confirmed by consensus of the nodes in the blockchain, it is recorded in the blockchain network.
[0064] After a few days, Zhang San intends to pay 2.5 virtual resources to Li Si, and Zhang San initiates a transaction with a transaction number #2001, and the resource source item of this transaction is written as "#1001(1)", that is, the first item UTXO of the #1001 transaction (the transaction in which Zhang San accidentally obtained virtual resources). Then in the transaction output UTXO item of the transaction, the recipient address of 2.5 virtual resources is set as the address of Li Si.
[0065] It should be noted that this transaction must consume all the output items of the 12.5 virtual resources generated before, and since Zhang San only intends to pay 2.5 virtual resources to Li Si, in order to consume the remaining 10 virtual resources, the remaining 10 virtual resources have to be paid to himself, so as to meet the input and output balancing rules.
[0066] After a few days, Zhang San and Li Si intend to pay 5 virtual resources to Wang Wu together. Then Zhang San or Li Si initiates a transaction with a transaction number #3001, and in the transaction input part, there are two resource sources, #2001(1) and #2001(2), representing the (1) and (2) items UTXO of the #2001 transaction. Then in the output part of this transaction, as usual, 5 virtual resources are given to Wang Wu, and the remaining 7.5 virtual resources of Zhang San are returned to himself. If Wang Wu wants to spend the 5 virtual resources again in the future, he must indicate in the transaction that the resource source is #3001(1).
[0067] Therefore, in the UTXO model-based blockchain network, each transaction data has input information and output information, and the input information of the transaction data other than the first transaction references a UTXO, and the output information generates a UTXO. When the input of a new transaction data references a UTXO, the referenced UTXO is deleted, and a new UTXO is generated.
[0068] Whether it is an account / balance model or a UTXO model, the on-chain data resources are generally bound to the on-chain address. If the user of the blockchain needs to change the on-chain address, the data resources of the original address must be migrated to the on-chain address corresponding to the new public and private key pair, and the data resources of the original address are scattered in the blockchain system and various business contracts, which is very difficult to migrate. In order to solve the problem of difficult data resource migration, the present application proposes to construct a chain data account service, and the blockchain needs to implement a data account service on the chain to bind the on-chain address. As shown in Figure 5 The entire on-chain data is composed of all data accounts, and all data of the on-chain address on the chain is carried by multiple data accounts and aggregated under the on-chain address. One on-chain address can bind multiple business data accounts, and a contract can establish a data account used within the contract for the on-chain address (as shown in Figure 5The system data account shown stores data related to the on-chain address within the contract (such as balance). When an on-chain address participates in on-chain data changes, the data in the corresponding data account needs to be modified. Furthermore, the mapping relationship between the data account and the on-chain address is maintained by the node's local world state tree.
[0069] based on Figure 5 The system architecture shown in one embodiment of this application allows for data account migration if a blockchain user wishes to do so. Figure 6 As shown, a blockchain user can use a blockchain user terminal 601 to generate first transaction information for migrating a data account. This first transaction information includes the data account to be migrated, a first string (which can be a random string or a specified string), the new on-chain address to which the data is to be migrated, the public key corresponding to the new on-chain address, and the signature information of the first string by the private key corresponding to the new on-chain address. Then, the blockchain user terminal 601 sends the first transaction information to the blockchain consensus node.
[0070] After receiving the first transaction information sent by the blockchain user terminal 601 for data account migration, the blockchain consensus node can perform consensus processing on the first transaction information in the blockchain network. After the consensus on the first transaction information is completed, the node verifies the signature information contained in the first transaction information (i.e., the signature information of the first string by the private key corresponding to the new on-chain address) based on the public key corresponding to the new on-chain address contained in the first transaction information, and verifies whether the original on-chain address of the blockchain user is associated with the data account to be migrated.
[0071] Once the blockchain consensus node verifies the aforementioned signature information and confirms that the original on-chain address is associated with the data account to be migrated, it will change the association of the data account to be migrated from the original on-chain address to the new on-chain address.
[0072] As can be seen, the technical solution of this application transforms the migration of on-chain data into the migration of on-chain data accounts, which greatly reduces the data migration cost when changing on-chain public and private keys and effectively improves the convenience and maintainability of the blockchain.
[0073] The following details the various implementation details of the technical solutions in the embodiments of this application:
[0074] Figure 7 A flowchart illustrating a data processing method based on a blockchain system according to an embodiment of this application is shown. In this blockchain system, on-chain addresses are associated with data accounts used for storing data. This data processing method based on the blockchain system can be executed by blockchain consensus nodes. Specifically, refer to... Figure 7As shown, the data processing method based on the blockchain system includes steps S710-S740, which are described in detail as follows:
[0075] In step S710, the first transaction information for data account migration sent by the blockchain user is received, and the first transaction information includes the data account to be migrated, the first string, the new on-chain address to be migrated, the public key corresponding to the new on-chain address, and the signature information of the private key corresponding to the new on-chain address to the first string.
[0076] In an embodiment of the present application, the transaction information sent by the blockchain user includes a transaction type field, and the value of the transaction type field is used to indicate the function type of the transaction information. For example, the value of the transaction type field included in the first transaction information is used to indicate that the first transaction information is transaction information for data account migration.
[0077] Optionally, the data account in the blockchain system can include a system data account and a business data account. The system data account is automatically generated after the on-chain address is registered in the blockchain system, and the system data account is used to store the data required for the corresponding on-chain address, such as balance. The business data account is used to store the data corresponding to the business, and the same on-chain address can be associated with at least one business data account, and different business data accounts can correspond to different business types, such as business A corresponding to a business data account 1, which is used to store the business data of business A; business B also corresponds to a business data account 2, which is used to store the business data of business B.
[0078] In an embodiment of the present application, the blockchain system can include a data account tree, which can be referred to in detail as follows Figure 5 As shown, the on-chain address in the blockchain system is associated with external account state information, and the external account state information includes nonce (random number) and data account tree root. The data account tree includes a root node and at least one data account under the root node.
[0079] In an embodiment of the present application, the data account to be migrated is the data account that needs to be migrated, such as the blockchain user 1 needs to replace the public and private keys, and the data account that needs to be migrated can be the data account corresponding to the original public and private keys of the blockchain user 1, that is, the data account associated with the original on-chain address of the blockchain user 1.
[0080] Optionally, the blockchain user can send a key change request through a blockchain user terminal, which can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart home appliance, a vehicle terminal, etc. The first string can be a random string or a specified string information, etc.
[0081] Optionally, if the first transaction information is signed by the private key corresponding to the original on-chain address of the blockchain user, the blockchain consensus node can perform signature verification on the first transaction information through the public key corresponding to the original on-chain address of the blockchain user after receiving the first transaction information, and generate a block by packaging the first transaction information after verification, and then perform consensus processing on the packaged block in the blockchain system.
[0082] In step S720, the first transaction information is consensus processed.
[0083] Optionally, the consensus processing of the first transaction information can be to package the first transaction information to generate a block, and then broadcast in the blockchain system to achieve the verification and confirmation of the transaction in a very short time. In the consensus processing process, the following consensus algorithms can be used: PoW (Proof of Work, proof of work mechanism), PoS (Proof of Stake, proof of stake), DPoS (Delegated Proof of Stake, delegated proof of stake), PBFT (Practical Byzantine Fault Tolerance, practical Byzantine fault tolerance system), etc.
[0084] In the PoW algorithm, each consensus node provides computing power (referred to as computing power) for the entire system, and through a competition mechanism, the node that performs the best computing work obtains the reward of the system, that is, the right to record.
[0085] The PoS algorithm is to determine the probability of a node obtaining the right to record by the number and length of time of holding Token, similar to the stock dividend system, the more stock rights a person holds, the more dividends he can get, Token is equivalent to the equity of the blockchain system.
[0086] The DPoS algorithm is a more professional solution derived from the PoS algorithm, similar to the board of directors voting, which means that people with Token vote for fixed nodes to elect a number of proxy nodes to be responsible for verification and recording. Unlike PoW and PoS, where the entire network can participate in the competition for recording, the DPoS recording nodes are determined within a certain period of time.
[0087] The PBFT algorithm is a state machine replica algorithm, that is, a service is modeled as a state machine, the state machine is replicated on different nodes of a distributed system, each replica of the state machine stores the state of the service, and also implements the operation of the service. The communication mechanism of PBFT is as shown in Figure 8
[0088] A client (which can be a consensus node forming a data block to be recorded on a blockchain) initiates a consensus request and sends the consensus request to a leader consensus node A in a leading state; proceeds to an entity adding stage, and the leader consensus node A broadcasts a data block corresponding to the consensus request to other consensus nodes (consensus nodes B, C, D,...) in the blockchain network that are not in a leading state; proceeds to an additional response stage, and other consensus nodes broadcast the received consensus content to other consensus nodes, and when the consensus content broadcast by the preset number (2f+1) of other consensus nodes is consistent, proceed to a confirmation stage, and each consensus node feeds back the confirmation result to the leader consensus node A. When the leader consensus node A receives the confirmation feedback from the preset number (2f+1) of other blockchain nodes, it is determined that the consensus is completed, and the result of completing the consensus is fed back to the client. Wherein, f is the maximum integer less than (N-1) / 3, N is the number of consensus nodes in the blockchain network, and f is the number of malicious consensus nodes in the blockchain network that the algorithm can tolerate.
[0089] When the consensus is successful, each consensus node in the blockchain network can add a block to the blockchain, that is, complete the on-chain, and store the block in the consensus node.
[0090] Referring to Figure 7 , in step S730, after the consensus of the first transaction information is completed, the signature information contained in the first transaction information is verified according to the public key corresponding to the new on-chain address, and it is verified whether the original on-chain address of the blockchain user is associated with the data account to be migrated.
[0091] It should be noted that verifying the signature information contained in the first transaction information (which is the signature information of the first string by the private key corresponding to the new on-chain address) according to the public key corresponding to the new on-chain address can be inverse signature operation of the signature information according to the public key corresponding to the new on-chain address, to determine whether the original first string can be obtained.
[0092] Verifying whether the original on-chain address of the blockchain user is associated with the data account to be migrated is mainly to verify whether the data account to be migrated is the data account associated with the original on-chain address, to avoid migrating the data account not associated with the original on-chain address, so as to ensure the security of the data account migration.
[0093] In step S740, if the signature information contained in the first transaction information is verified successfully, and the original on-chain address is associated with the data account to be migrated, the data account to be migrated is adjusted from being associated with the original on-chain address to being associated with the new on-chain address.
[0094] In an embodiment of the present application, adjusting the data account to be migrated from being associated with the original on-chain address to being associated with the new on-chain address is to unbind the data account to be migrated from the original on-chain address, and then bind the data account to be migrated to the new on-chain address.
[0095] Optionally, if the signature information contained in the first transaction information is not verified successfully, or the original on-chain address is not associated with the data account to be migrated, the first transaction information can be rejected, or a notification information indicating that the data account migration fails can be returned.
[0096] Figure 7 The technical solution of the illustrated embodiment can convert the migration of on-chain data into the migration of on-chain data accounts, greatly reducing the data migration cost when the on-chain public and private keys are replaced, and effectively improving the convenience and maintainability of the blockchain.
[0097] Figure 9 A flowchart of a data processing method based on a blockchain system is shown, according to an embodiment of the present application. The on-chain addresses in the blockchain system are associated with data accounts for storing data, and the data accounts include business data accounts. The data processing method based on the blockchain system can be executed by a blockchain consensus node. Specifically, referring to Figure 9 As shown, the data processing method based on the blockchain system includes at least steps S910 to S930, which are described in detail as follows:
[0098] In step S910, second transaction information for creating a business data account is received. The second transaction information contains business data account information to be created.
[0099] In an embodiment of the present application, the transaction information sent by the blockchain user contains a transaction type field. The value of the transaction type field is used to indicate the function type of the transaction information. For example, the value of the transaction type field contained in the second transaction information is used to indicate that the second transaction information is used to create a business data account.
[0100] Optionally, the business data account information to be created can include a business data account identifier to be created and field information required by the business data account to be created. The field information can be, for example, a field name, a field type, etc. The field information is used to store corresponding business data.
[0101] In step S920, the second transaction information is verified and consensus processed.
[0102] Optionally, after receiving the second transaction information, the blockchain consensus node can verify the content contained in the second transaction information according to the type of the second transaction information, such as verifying whether the business data account identifier to be created, the field information required for the business data account to be created, and the like are contained in the second transaction information after determining that the second transaction information is transaction information for creating a business data account.
[0103] Optionally, the process of consensus processing of the second transaction information can refer to the technical solutions of the foregoing embodiments, and will not be described herein again.
[0104] In step S930, after the consensus of the second transaction information is completed, a business data account is created according to the business data account information to be created contained in the second transaction information, and the created business data account is associated with the on-chain address of the sender of the second transaction information.
[0105] In an embodiment of the present application, the process of creating a business data account according to the business data account information to be created contained in the second transaction information can be: if it is detected according to the business data account identifier to be created that there is no corresponding business data account, a business data account corresponding to the business data account identifier is created, and a corresponding field is created according to the field information. Optionally, if it is detected according to the business data account identifier to be created that there is already a corresponding business data account, a prompt information of creation failure can be returned.
[0106] In an embodiment of the present application, after creating a business data account according to the business data account information to be created contained in the second transaction information, the operation permission of the created business data account can be assigned to the sender of the second transaction information. The technical solution of this embodiment enables the blockchain user requiring to create a business data account to have the operation permission of the created business data account, which can be read permission, write permission, modification permission, and the like.
[0107] Figure 9 The technical solution of the illustrated embodiment is to trigger the process of creating a business data account through transaction information. The following introduces the process of creating a business data account through an intelligent contract according to an embodiment of the present application: Figure 10 The process of creating a business data account through an intelligent contract according to an embodiment of the present application is introduced as follows:
[0108] Figure 10 A flowchart of a data processing method based on a blockchain system is shown, according to an embodiment of the present application. The on-chain addresses in the blockchain system are associated with data accounts for storing data, the data accounts include business data accounts, and the data processing method based on the blockchain system can be executed by a blockchain consensus node. Specifically, referring to Figure 10As shown, the data processing method based on the blockchain system includes steps S1010 to S1030, which are described in detail as follows.
[0109] In step S1010, third transaction information for triggering a blockchain smart contract to execute a registration method in the contract is received, and the registration method included in the blockchain smart contract is used to create a business data account.
[0110] In an embodiment of the present application, the transaction information sent by the blockchain user includes a transaction type field, and the value of the transaction type field is used to represent the function type of the transaction information. For example, the value of the transaction type field included in the third transaction information is used to represent that the third transaction information is used to trigger the blockchain smart contract to execute the registration method in the contract.
[0111] In step S1020, the third transaction information is subjected to consensus processing.
[0112] Optionally, the process of consensus processing of the third transaction information can refer to the technical solutions of the foregoing embodiments, and will not be described herein.
[0113] In step S1030, after the consensus processing of the third transaction information is completed, the blockchain smart contract creates a business data account, and associates the created business data account with the on-chain address of the sender of the third transaction information.
[0114] In an embodiment of the present application, the business data account created by the blockchain smart contract can be used to store the business data generated by the blockchain smart contract during execution. Optionally, after the blockchain smart contract is triggered to create the business data account, the operation authority of the created business data account can be assigned to the blockchain smart contract, which can be read authority, write authority, modification authority, etc.
[0115] Optionally, after the blockchain smart contract is triggered to create the business data account, the address information of the blockchain smart contract can be used to generate the identifier of the created business data account. For example, the address information of the blockchain smart contract can be used as the identifier of the created business data account, so that the corresponding business data account can be retrieved according to the address information of the blockchain smart contract.
[0116] Figure 10 The technical solution of the embodiment shown is to trigger the process of creating a business data account by a blockchain smart contract.
[0117] Figure 11 A flowchart of a data processing method based on a blockchain system according to an embodiment of the present application is shown, which can be executed by a blockchain consensus node. Specifically, referring to Figure 11As shown, the data processing method based on the blockchain system includes steps S1110-S1140, which are described in detail as follows.
[0118] In step S1110, fourth transaction information for accessing a data account is received, and the fourth transaction information includes data account information to be accessed and access requirement information.
[0119] In an embodiment of the present application, the transaction information sent by the blockchain user includes a transaction type field, and the value of the transaction type field is used to represent the function type of the transaction information. For example, the value of the transaction type field included in the fourth transaction information is used to represent that the fourth transaction information is used to access the data account. The data account information to be accessed can be identification information of the data account to be accessed, and the access requirement information can be field content information to be changed, such as a field to be changed and specific content to be changed for the field.
[0120] In step S1120, the fourth transaction information is verified and consensus processed.
[0121] Optionally, after receiving the fourth transaction information, the blockchain consensus node can verify the content included in the fourth transaction information according to the type of the fourth transaction information, such as verifying whether the data account information to be accessed included in the fourth transaction information exists after determining that the fourth transaction information is used to access the data account.
[0122] Optionally, the process of consensus processing the fourth transaction information can refer to the technical solutions of the foregoing embodiments, which will not be described herein.
[0123] In step S1130, after the consensus processing of the fourth transaction information is completed, the data account information to be accessed is found according to the on-chain address of the sender of the fourth transaction information.
[0124] In an embodiment of the present application, since the on-chain address is associated with the data account, the data account associated with the on-chain address of the sender of the fourth transaction information can be indexed according to the on-chain address of the sender of the fourth transaction information, and then the data account information to be accessed is found therefrom, and then it is judged whether the sender of the fourth transaction information has the right to access the found data account.
[0125] In step S1140, if the data account information to be accessed is found and the sender of the fourth transaction information has the right to access the found data account, the found data account is accessed according to the access requirement information.
[0126] Figure 11 The technical solution of the embodiment shown is to trigger the process of accessing the data account by the transaction information. The following describes the technical solution of the embodiment in combination with the technical solution of the blockchain system. Figure 12The process of triggering data account access through the smart contract in the embodiments of the present application is introduced.
[0127] Figure 12 A flowchart of a data processing method based on a blockchain system is shown, which can be executed by a blockchain consensus node according to an embodiment of the present application. Specifically, as shown in Figure 12 The data processing method based on a blockchain system at least includes steps S1210 to S1240, which are described in detail as follows:
[0128] In step S1210, fifth transaction information for triggering execution of a blockchain smart contract is received.
[0129] In an embodiment of the present application, the transaction information sent by the user of the blockchain contains a transaction type field, and the value of the transaction type field is used to represent the function type of the transaction information. For example, the value of the transaction type field contained in the fifth transaction information is used to indicate that the fifth transaction information is used to trigger the execution of the blockchain smart contract.
[0130] In step S1220, the fifth transaction information is verified and consensus processed.
[0131] Optionally, after receiving the fifth transaction information, the blockchain consensus node can verify the content contained in the fifth transaction information according to the type of the fifth transaction information, such as verifying whether the method for triggering the execution of the smart contract contained therein is valid after determining that the fifth transaction information is used to trigger the execution of the blockchain smart contract.
[0132] Optionally, the process of consensus processing the fifth transaction information can refer to the technical solutions of the foregoing embodiments, which will not be described again.
[0133] In step S1230, after the verification and consensus processing of the fifth transaction information, the execution of the blockchain smart contract is triggered.
[0134] It should be noted that a smart contract is a program that realizes the automatic processing of a traditional contract in the form of computer instructions. Simply put, a smart contract is a piece of code that is triggered for execution on a blockchain. The smart contract program is not only an automatically executable computer program, but also a system participant that responds to received information, can receive and store information, and can send information externally.
[0135] In step S1240, during the execution process of the blockchain smart contract, a data account access interface is called to access the data account corresponding to the blockchain smart contract.
[0136] Optionally, the data account corresponding to the blockchain smart contract comprises a data account corresponding to an identifier of a business data account generated according to address information of the blockchain smart contract. The data account access interface (i.e., Application Programming Interface, API) performs an access operation on the data account corresponding to the blockchain smart contract when it is determined that the blockchain smart contract has the permission to access the data account corresponding to the blockchain smart contract.
[0137] The implementation details of the technical solutions of the embodiments of the present application are described in detail below in combination with the drawings:
[0138] The technical solutions of the embodiments of the present application mainly construct a chain data account service on a blockchain. The chain data account service is described in detail in four parts: chain data account storage structure, chain data account creation, chain data account usage, and chain data migration.
[0139] Chain data account storage structure: the mapping relationship between the chain data account and the chain address needs to be stored and kept globally consistent on the blockchain node, so the mapping relationship needs to be stored on the blockchain, and the storage method needs to comply with the data storage principle of the blockchain. The following takes Ethereum (a public blockchain platform with smart contract function) as an example for illustration:
[0140] As shown in Figure 13 , Ethereum data is organized in units of chain accounts, and changes in account data cause changes in account state, thereby causing changes in Ethereum state. The accounts of Ethereum are divided into external accounts and contract accounts, and the technical solutions of the embodiments of the present application can be used to modify the external accounts controlled and used by users. The index of the external account is a chain address, which is a unique id string mapped by a mapping algorithm from a chain public key. That is, the chain address is associated with the external account state information, and the external account state information contains nonce (nonce), balance (balance), etc.
[0141] As shown in Figure 5 , if the data account scheme is adopted, a data account needs to be established on top of the world state chain account tree. The original chain account tree structure remains unchanged, and the chain account state information contains a data account tree, and the data account tree contains multiple data accounts and their data. When performing a chain data change operation, the corresponding data account tree is indexed by the chain address in the transaction, and the corresponding account data in the data account tree can be changed. It should be noted that in this scheme, the data of the chain account (the Merkle tree of the account storage data) is bound under the data account, so that the data account can be migrated to a new chain address at low cost.
[0142] The on-chain data accounts are divided into system data accounts and business data accounts. The system data account is used to store data required by the blockchain system itself for the on-chain address, including balance and the like. The system data account is automatically created when the on-chain address is initially registered in the world state tree. The business data account is an account created by the on-chain address itself for storing business data. Multiple business data accounts can be established, each corresponding to a different business.
[0143] The structure of transaction information is also modified in the embodiments of the present application. Specifically, taking the transaction information in Ethereum as an example, as shown in Figure 14 Compared with the original address transaction in Ethereum, the transaction based on the data account (i.e., the new transaction) adds a transaction type field (i.e., the tx type field), which is used to identify whether the transaction is a normal on-chain address transaction (consistent with the original transaction) or a special transaction such as data account migration.
[0144] In Figure 14 , the "nonce" is a serial number filled in by the transaction initiator, representing the number of transactions sent by the sender of this transaction; the "gas price" represents the gas price that the transactioner is willing to pay, and the gas is the basic unit of calculation consumed in the process of a transaction; the "start gas" represents the maximum amount of gas that the transactioner is willing to spend, i.e., the maximum amount of gas allowed to be consumed in this transaction; the "to" represents the address of the transaction receiver; the "value" represents the amount of the transaction; the "input" represents the additional data of the transaction; the "from" represents the address of the transaction sender; and the "sign" represents the signature data of the transaction.
[0145] Creation of on-chain data account: The on-chain data account is divided into a system data account and a business data account. The system data account is automatically created and bound with the registration of the on-chain address. The business data account has two creation forms:
[0146] 1. Transaction-triggered business data account creation form: sending a transaction of creating a business data account type to trigger the blockchain system to call the "create business data account" system API (such as CreateDataAccount) to execute the method of creating a business data account;
[0147] 2. Contract-triggered business data account creation form: the blockchain system opens the system API (such as CreateDataAccount) for creating a business data account for the smart contract, and the smart contract can call the method to create a business data account for the blockchain user (corresponding to the on-chain address).
[0148] The two creation forms described above ultimately call the creation business data account method of the blockchain node program. The difference is whether it is triggered directly by a transaction or by a contract. The advantage of contract triggering is that the user state data in the contract can be placed in the data account of the user chain address, and the contract only needs to maintain the global state data of the contract. This realizes the decoupling of contract data and user data. At the same time, when the contract creates a data account on behalf of the user, the account's write and read permissions can be specified to be limited to the contract, avoiding direct malicious manipulation of data in the data account by the user. The transaction-triggered account ownership belongs entirely to the blockchain user, i.e., the blockchain user has full operation permissions.
[0149] The transaction-triggered business data account creation process is as follows:
[0150] 1. The upper chain (i.e., the blockchain user) has a chain address.
[0151] 2. The upper chain constructs a transaction for creating a business data account. The transaction type is "business data account creation". The "input" field in the transaction can include the following parameters: the business data account identifier to be created, and the required field key and field type of the business data account. Fill in the "input" field in the transaction with these parameters, then sign the transaction with the private key of the chain address, and send it to the blockchain.
[0152] As shown in Figure 15 , the "input" field includes the business data account identifier "account id" and the account field list "account fields list", wherein the account field list "account fields list" includes various fields and corresponding types.
[0153] 3. After the consensus node receives the transaction, it verifies the transaction content and signature according to the transaction type, and successfully verifies the transaction content and signature to package it into a block for consensus.
[0154] Specifically, when determining that it is a business data account creation transaction according to the transaction type, the content of the "input" field can be verified, and the private key signature can be verified using the public key of the chain address.
[0155] 4. After successful verification, the consensus node executes the account creation transaction, triggering a system API (such as CreateDataAccount). If the business data account ID to be created already exists or the parameters in the "input" field are invalid, a transaction execution failure notification message is returned. If the business data account ID to be created does not exist and the parameters in the "input" field are valid, the on-chain address is indexed through the global account state tree, a new data account is created in the data account tree of that on-chain address, corresponding fields are created, and operation permissions (such as read permissions, write permissions, etc.) are set to the transaction sender. Then, the consensus node returns a message indicating successful on-chain execution of the transaction, and the entire creation process is complete.
[0156] The business data account creation process triggered by the contract is as follows: Figure 16 As shown, the specific process is as follows:
[0157] 1. Assume there exists a smart contract that uses an on-chain data account system and provides a user registration method. Users wishing to use this smart contract must first register within the smart contract.
[0158] 2. The person on the chain constructs a transaction, triggering the registration method within the contract to send the transaction to the blockchain.
[0159] 3. After a transaction is agreed upon on the blockchain, the node executes the transaction. This is done by running the contract virtual machine and executing the registration method within the smart contract. The method calls the Create Data Account API to create an on-chain data account for the transaction sender. The specified data account ID can be specified by the smart contract itself. Generally, to avoid conflicts, it is more appropriate to use the address of this contract as the data account ID. When creating the data account, the read and write operation permissions must be specified to the address of this contract, and others are prohibited from changing it arbitrarily.
[0160] 4. Once the transaction is completed, the final result is that the contract creates a new data account within this smart contract for the user, and this smart contract has the authority to operate on it.
[0161] Use of on-chain data accounts:
[0162] Assuming the user (i.e., the blockchain user) has already created an on-chain data account (either triggered by a transaction or a contract), there are three ways to use this on-chain data account:
[0163] 1. The on-chain data account is written through a transaction trigger.
[0164] 2. The blockchain system provides APIs (such as UpdateDataAccount) for writing on-chain data accounts to contracts, which are triggered by the contract to complete the writing of on-chain data accounts.
[0165] 3. The on-chain data writing function of the blockchain system itself, which involves user data changes, will trigger the writing of the user's system data account. For example, the transfer function will automatically trigger the change of the balance field of the user's system data account, which is not perceived by the user.
[0166] The following describes the on-chain data account writing process triggered by a transaction and the on-chain data account writing process triggered by a contract:
[0167] The on-chain data account writing process triggered by a transaction is as follows:
[0168] 1. The on-chain constructor constructs a transaction locally. The transaction type is specified as "write on-chain data account type", the data account ID to be changed and the changed data value are filled in the transaction, and the transaction is signed using the private key of the on-chain address and sent to the blockchain.
[0169] 2. After receiving the transaction, the consensus node verifies the transaction content and signature according to the transaction type, i.e. verifies whether the content in the transaction is legal, and verifies the private key signature using the public key of the on-chain address. After successful verification, it is packaged into a block for consensus.
[0170] 3. The consensus node executes the write on-chain data account type transaction, triggers the system API (such as UpdateDataAccount) to index the on-chain address in the global account state tree, and indexes the data account to be changed in the data account tree of the on-chain address. If the sender of the transaction does not have the modification authority, an error message is returned.
[0171] 4. If the sender of the transaction has the modification authority, the changed data value contained in the transaction is modified, and the transaction execution is successful.
[0172] The on-chain data account writing process triggered by a contract is shown in Figure 17 , and the specific process is as follows:
[0173] 1. The on-chain constructor constructs a normal contract transaction locally.
[0174] 2. After receiving the contract transaction, the consensus node verifies the transaction; after verification, the transaction is packaged into the blockchain network for consensus.
[0175] 3. After consensus, all nodes in the blockchain execute the transaction, which triggers the execution of the contract, i.e. executes the smart contract by running the contract virtual machine. During the execution of the smart contract, operations involving user data changes call the API for writing on-chain data accounts.
[0176] 4. The API will verify whether the contract address has the permission to modify the data account (i.e. the data account with the contract address as the data account id), and if not, an error message will be returned.
[0177] Chain data migration process:
[0178] The technical solution of the embodiments of the present application can maximize the reduction of chain data migration cost in the case of user chain address change. The chain data account system is combined to greatly reduce the data migration cost, and the specific process is as follows:
[0179] 1. The on-chain constructor constructs a "data account migration" type transaction, which contains the following parameters: a list of data account IDs to be migrated (if this item is empty, the default is all data accounts associated with the original on-chain address), a new on-chain address to which the data account is migrated, a public key corresponding to the new on-chain address, a random signature string, and a signature information of the random signature string by the private key corresponding to the new on-chain address.
[0180] 2. The original private key is used to sign the entire transaction and sent to the blockchain.
[0181] 3. After receiving the transaction, the consensus node verifies the transaction, packages the transaction into the blockchain for consensus, and executes the transaction after the consensus is completed.
[0182] 4. When executing the migration chain data account type transaction, the system API (such as MoveDataAccount) first verifies the signature string in the transaction parameters (i.e. verifies the signature information of the random signature string by the public key corresponding to the new on-chain address), and whether the original on-chain address has the list of data accounts to be migrated in the parameters. After verification, the original on-chain address will be changed to the new on-chain address.
[0183] 5. After the transaction is executed successfully, it means that the migration is successful, and at this time the new on-chain address inherits the chain data of the original on-chain address.
[0184] As shown in Figure 18 , all data accounts associated with the on-chain address A are migrated to the on-chain address B, and after the migration is completed, the on-chain address A will no longer maintain the data account tree root root, and the account of the on-chain address B will store the data account tree root root.
[0185] The technical solution of the above embodiments of the present application builds a data account service on the blockchain, and one on-chain address can bind multiple data accounts. The on-chain address has the permission to migrate all data of the bound data, and further converts the migration of on-chain data into the migration of on-chain data account, greatly reducing the data migration cost when changing the on-chain public and private keys, and effectively improving the convenience and maintainability of the blockchain.
[0186] The device embodiments of the present application are described below, which can be used to execute the data processing method based on the blockchain system in the above-mentioned embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the above-mentioned embodiments of the data processing method based on the blockchain system.
[0187] Figure 19 A block diagram of a data processing device based on a blockchain system is shown, according to an embodiment of the present application, in which an on-chain address is associated with a data account for storing data, and the data processing device based on the blockchain system can be set in a blockchain consensus node.
[0188] Referring to Figure 19 As shown, the data processing device based on the blockchain system 1900 according to an embodiment of the present application includes a receiving unit 1902, a first processing unit 1904, a verification unit 1906, and a second processing unit 1908.
[0189] The receiving unit 1902 is configured to receive first transaction information for data account migration sent by a blockchain user, the first transaction information containing a to-be-migrated data account, a first string, a new on-chain address to be migrated to, a public key corresponding to the new on-chain address, and signature information of the first string by a private key corresponding to the new on-chain address; the first processing unit 1904 is configured to perform consensus processing on the first transaction information; the verification unit 1906 is configured to, after the consensus processing on the first transaction information is completed, verify the signature information contained in the first transaction information according to the public key corresponding to the new on-chain address, and verify whether the original on-chain address of the blockchain user is associated with the to-be-migrated data account; and the second processing unit 1908 is configured to, if the signature information is verified and the original on-chain address is associated with the to-be-migrated data account, adjust the to-be-migrated data account from being associated with the original on-chain address to being associated with the new on-chain address.
[0190] In some embodiments of the present application, based on the foregoing scheme, the first transaction information is signed by a private key corresponding to the original on-chain address of the blockchain user; and the first processing unit 1904 is configured to, after receiving the first transaction information, perform signature verification on the first transaction information by a public key corresponding to the original on-chain address of the blockchain user, and after verification, package the first transaction information for consensus processing on the packaged block.
[0191] In some embodiments of the present application, based on the foregoing scheme, the data account includes a business data account; the receiving unit 1902 is further configured to receive second transaction information for creating a business data account, the second transaction information containing to-be-created business data account information; the first processing unit 1904 is further configured to perform verification and consensus processing on the second transaction information; the data processing apparatus 1900 further includes a third processing unit configured to, after the consensus processing on the second transaction information is completed, create a business data account according to the to-be-created business data account information contained in the second transaction information, and associate the created business data account with an on-chain address of a sender of the second transaction information.
[0192] In some embodiments of the present application, based on the foregoing scheme, the to-be-created business data account information includes a to-be-created business data account identifier and field information required by the to-be-created business data account; and the third processing unit is configured to, if it is detected according to the to-be-created business data account identifier that there is no corresponding business data account, create a business data account corresponding to the business data account identifier, and create a corresponding field according to the field information.
[0193] In some embodiments of the present application, based on the foregoing scheme, the third processing unit is further configured to, after creating a business data account according to the to-be-created business data account information contained in the second transaction information, assign operation permissions of the created business data account to a sender of the second transaction information.
[0194] In some embodiments of the present application, based on the foregoing scheme, the data account includes a business data account; the receiving unit 1902 is further configured to receive third transaction information for triggering a contract-in registration method of a blockchain smart contract to execute, the registration method contained in the blockchain smart contract being used to create a business data account; the first processing unit 1904 is further configured to perform consensus processing on the third transaction information; and the data processing apparatus 1900 further includes a fourth processing unit configured to, after the consensus processing on the third transaction information is completed, trigger the blockchain smart contract to create a business data account, and associate the created business data account with an on-chain address of a sender of the third transaction information.
[0195] In some embodiments of the present application, based on the foregoing scheme, the fourth processing unit is further configured to, after triggering the blockchain smart contract to create a business data account, assign operation permissions of the created business data account to the blockchain smart contract.
[0196] In some embodiments of the present application, based on the foregoing scheme, the fourth processing unit is further configured to: after triggering the blockchain smart contract to create a business data account, generate an identification of the created business data account according to address information of the blockchain smart contract.
[0197] In some embodiments of the present application, based on the foregoing scheme, the data account includes a system data account, which is automatically generated after a chain address is registered in the blockchain system, and is used to store data required for the corresponding chain address.
[0198] In some embodiments of the present application, based on the foregoing scheme, the receiving unit 1902 is further configured to receive fourth transaction information for accessing a data account, wherein the fourth transaction information includes data account information to be accessed and access requirement information; the first processing unit 1904 is further configured to verify and consensus process the fourth transaction information; and the data processing apparatus 1900 further includes a fifth processing unit configured to, after consensus processing of the fourth transaction information is completed, search for the data account information to be accessed according to a sender chain address of the fourth transaction information, and if the data account information to be accessed is found and the sender of the fourth transaction information has the right to access the found data account, access the found data account according to the access requirement information.
[0199] In some embodiments of the present application, based on the foregoing scheme, the access requirement information includes field content information that needs to be changed.
[0200] In some embodiments of the present application, based on the foregoing scheme, the receiving unit 1902 is further configured to receive fifth transaction information for triggering a blockchain smart contract to execute; the first processing unit 1904 is further configured to verify and consensus process the fifth transaction information; and the data processing apparatus 1900 further includes a sixth processing unit configured to, after verifying and consensus processing of the fifth transaction information, trigger the blockchain smart contract to execute, and in the execution process of the blockchain smart contract, call a data account access interface to access a data account corresponding to the blockchain smart contract.
[0201] In some embodiments of the present application, based on the foregoing scheme, the data account corresponding to the blockchain smart contract includes a data account corresponding to an identification of a business data account generated according to address information of the blockchain smart contract; and the data account access interface performs an access operation on the data account corresponding to the blockchain smart contract when it is determined that the blockchain smart contract has the right to access the data account corresponding to the blockchain smart contract.
[0202] In some embodiments of the present application, based on the foregoing scheme, the transaction information sent by the blockchain user contains a transaction type field, and the value of the transaction type field is used to represent the function type of the transaction information.
[0203] In some embodiments of the present application, based on the foregoing scheme, the data account includes a business data account, and at least one business data account is associated with the same on-chain address, and different business data accounts correspond to different business types.
[0204] In some embodiments of the present application, based on the foregoing scheme, the blockchain system contains a data account tree, the data account tree is associated with the on-chain address in the blockchain system, and the data account tree contains a root node and at least one data account under the root node.
[0205] Figure 20 A structural diagram of a computer system of an electronic device suitable for implementing embodiments of the present application is shown.
[0206] It should be noted that, Figure 20 The computer system 2000 of the electronic device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0207] As Figure 20 shown, the computer system 2000 includes a central processing unit (CPU) 2001, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 2002 or programs loaded from a storage portion 2008 into a random access memory (RAM) 2003, such as performing the methods described in the above embodiments. In the RAM 2003, various programs and data required for system operation are also stored. The CPU 2001, the ROM 2002, and the RAM 2003 are connected to each other through a bus 2004. An input / output (I / O) interface 2005 is also connected to the bus 2004.
[0208] The following components are connected to the I / O interface 2005: an input section 2006 including input devices such as a keyboard and mouse; an output section 2007 including output devices such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 2008 including a hard disk; and a communication section 2009 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 2009 performs communication processing via a network such as the Internet. A drive 2010 is also connected to the I / O interface 2005 as necessary. A removable media 2011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 2010 as necessary, so that a computer program read therefrom is installed into the storage section 2008 as necessary.
[0209] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing a computer program for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 2009, and / or installed from the removable media 2011. When the computer program is executed by the Central Processing Unit (CPU) 2001, various functions defined in the system of the present application are executed.
[0210] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer-readable signal medium can include a data signal carrying computer-readable computer programs in a baseband or as a part of a carrier wave. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, device or apparatus. The computer programs contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.
[0211] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the drawings. For example, two blocks represented in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0212] The units described in the embodiments of the present application can be implemented by software, or by hardware, or by a combination of software and hardware. The units described can also be located in a single processor. In some cases, the names of the units do not limit the units themselves.
[0213] As another aspect, the present application provides a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the method described in the above embodiments.
[0214] It should be noted that although several modules or units for performing actions are mentioned in the above detailed description, the division into the modules or units is not mandatory. In fact, according to the embodiments of the present application, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further divided into a plurality of modules or units.
[0215] From the above description of the embodiments, those skilled in the art will readily appreciate that the example embodiments described herein can be implemented by software and / or by hardware coupled with software. Accordingly, the technical solutions of the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, or the like) or on a network, and includes a number of instructions for causing a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the methods according to the embodiments of the present application.
[0216] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such
[0217] It should be understood that the present application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present application. The scope of the present application is limited only by the appended claims.
Claims
1. A data processing method based on a blockchain system, characterized in that, The on-chain address in the blockchain system is associated with a data account for storing data, and the method comprises: receiving first transaction information for data account migration sent by a blockchain user, the first transaction information containing a data account to be migrated, a first string, a new on-chain address to which the data account is to be migrated, a public key corresponding to the new on-chain address, and signature information of the first string signed by a private key corresponding to the new on-chain address; consensus processing the first transaction information; after consensus processing of the first transaction information is completed, verifying the signature information contained in the first transaction information according to the public key corresponding to the new on-chain address, and verifying whether the original on-chain address of the blockchain user is associated with the data account to be migrated; if the signature information is verified and the original on-chain address is associated with the data account to be migrated, adjusting the data account to be migrated from being associated with the original on-chain address to being associated with the new on-chain address; wherein, verifying whether the original on-chain address of the blockchain user is associated with the data account to be migrated comprises verifying whether the original on-chain address of the blockchain user is bound to the data account to be migrated; adjusting the data account to be migrated from being associated with the original on-chain address to being associated with the new on-chain address comprises unbinding the data account to be migrated from the original on-chain address and binding the data account to be migrated to the new on-chain address. 2.The data processing method based on the blockchain system according to claim 1, characterized in that, The first transaction information is signed by a private key corresponding to the original on-chain address of the blockchain user; the data processing method further comprises: after receiving the first transaction information, verifying the signature of the first transaction information by a public key corresponding to the original on-chain address of the blockchain user, and after verification, packaging the first transaction information for consensus processing of the packaged block. 3.The data processing method based on the blockchain system according to claim 1, characterized in that, The data account comprises a business data account, and the method further comprises: receiving second transaction information for creating a business data account, the second transaction information containing business data account information to be created; verifying and consensus processing the second transaction information; after consensus processing of the second transaction information is completed, creating a business data account according to the business data account information to be created contained in the second transaction information, and associating the created business data account with the on-chain address of the sender of the second transaction information. 4.The data processing method based on the blockchain system according to claim 3, characterized in that, The business data account information to be created comprises a business data account identifier to be created and field information required for the business data account to be created; creating a business data account according to the business data account information to be created contained in the second transaction information comprises: if no corresponding business data account is detected according to the business data account identifier to be created, creating a business data account corresponding to the business data account identifier, and creating corresponding fields according to the field information. 5.The data processing method based on the blockchain system according to claim 3, characterized in that, The method further comprises: After creating the business data account according to the business data account information to be created contained in the second transaction information, operation permissions of the created business data account are assigned to a sender of the second transaction information. 6.The data processing method based on the blockchain system according to claim 1, characterized in that, The data account includes a business data account, and the method further includes: receiving third transaction information for triggering a contract-in registration method of a blockchain smart contract to execute, the registration method contained in the blockchain smart contract being used to create a business data account; performing consensus processing on the third transaction information; after the consensus processing on the third transaction information is completed, triggering the blockchain smart contract to create a business data account, and associating the created business data account with an on-chain address of a sender of the third transaction information. 7.The data processing method based on the blockchain system according to claim 6, characterized in that, The method further includes: after triggering the blockchain smart contract to create a business data account, assigning operation permissions of the created business data account to the blockchain smart contract. 8.The data processing method based on the blockchain system according to claim 6, characterized in that, after triggering the blockchain smart contract to create a business data account, generating an identifier of the created business data account according to address information of the blockchain smart contract. 9.The data processing method based on the blockchain system according to claim 1, characterized in that, The data account includes a system data account, which is automatically generated after an on-chain address is registered in the blockchain system, and is used to store data required for the corresponding on-chain address. 10.The data processing method based on the blockchain system according to claim 1, characterized in that, The method further includes: receiving fourth transaction information for accessing a data account, the fourth transaction information containing data account information to be accessed and access requirement information; performing verification and consensus processing on the fourth transaction information; after the consensus processing on the fourth transaction information is completed, searching for the data account information to be accessed according to an on-chain address of a sender of the fourth transaction information; if the data account information to be accessed is found and the sender of the fourth transaction information has the permission to access the found data account, accessing the found data account according to the access requirement information. 11.The data processing method based on the blockchain system according to claim 10, characterized in that, The access requirement information includes field content information that needs to be changed. 12.The data processing method based on the blockchain system according to claim 1, characterized in that, The method further includes: receiving fifth transaction information for triggering a blockchain smart contract to execute; performing verification and consensus processing on the fifth transaction information; after the verification and consensus processing on the fifth transaction information are completed, triggering the blockchain smart contract to execute; in the execution process of the blockchain smart contract, calling a data account access interface to access a data account corresponding to the blockchain smart contract. 13.The data processing method based on the blockchain system according to claim 12, characterized in that, The data account corresponding to the blockchain smart contract includes a data account corresponding to an identifier of a business data account generated according to address information of the blockchain smart contract; wherein the data account access interface performs an access operation on the data account corresponding to the blockchain smart contract when it is determined that the blockchain smart contract has the permission to access the data account corresponding to the blockchain smart contract. 14.The method of claim 1 to 13, wherein, The transaction information sent by the blockchain user contains a transaction type field, and a value of the transaction type field is used to represent a function type of the transaction information. 15.The blockchain system based data processing method according to any one of claims 1 to 13, characterized in that, The data account includes a business data account, and one chain address is associated with at least one business data account, and different business data accounts correspond to different business types. 16.The blockchain system based data processing method according to any one of claims 1 to 13, wherein, The blockchain system includes a data account tree, the data account tree is associated with a chain address in the blockchain system, and the data account tree includes a root node and at least one data account under the root node. 17.A data processing apparatus based on a blockchain system, characterized in that, The chain address in the blockchain system is associated with a data account for storing data, and the device includes: A receiving unit configured to receive first transaction information for data account migration sent by a blockchain user, the first transaction information including a to-be-migrated data account, a first string, a new chain address to be migrated to, a public key corresponding to the new chain address, and signature information of the first string signed by a private key corresponding to the new chain address; A first processing unit configured to perform consensus processing on the first transaction information; A verification unit configured to, after consensus processing on the first transaction information is completed, verify the signature information included in the first transaction information according to the public key corresponding to the new chain address, and verify whether the original chain address of the blockchain user is associated with the to-be-migrated data account; A second processing unit configured to, if the signature information is verified and the original chain address is associated with the to-be-migrated data account, adjust the to-be-migrated data account from being associated with the original chain address to being associated with the new chain address; The verification of whether the original chain address of the blockchain user is associated with the to-be-migrated data account includes verifying whether the original chain address of the blockchain user is bound to the to-be-migrated data account. The adjustment of the to-be-migrated data account from being associated with the original chain address to being associated with the new chain address includes unbinding the to-be-migrated data account from the original chain address and binding the to-be-migrated data account to the new chain address.
18. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the data processing method based on the blockchain system as claimed in any one of claims 1-16.
19. An electronic device, comprising: Comprise: One or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the data processing method based on the blockchain system as claimed in any one of claims 1-16.
20. A computer program product, characterised in that, The computer program product includes computer instructions stored in a computer readable storage medium, and the processor of the computer device reads and executes the computer instructions from the computer readable storage medium, so that the computer device executes the data processing method based on the blockchain system as claimed in any one of claims 1-16.
Citation Information
Patent Citations
Multi-chain information management method and device, storage medium and block chain identity parser
CN109493054A
Decentralized address mapping method and device
CN111953773A
Blockchain account migration
US20210119807A1