CN111222109A - Operation method of block chain account, node equipment and storage medium - Google Patents

Operation method of block chain account, node equipment and storage medium Download PDF

Info

Publication number
CN111222109A
CN111222109A CN201911149892.0A CN201911149892A CN111222109A CN 111222109 A CN111222109 A CN 111222109A CN 201911149892 A CN201911149892 A CN 201911149892A CN 111222109 A CN111222109 A CN 111222109A
Authority
CN
China
Prior art keywords
target account
client
target
account
authority
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911149892.0A
Other languages
Chinese (zh)
Inventor
周开班
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911149892.0A priority Critical patent/CN111222109A/en
Publication of CN111222109A publication Critical patent/CN111222109A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

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

Abstract

The embodiment of the invention provides an operation method of a block chain account, node equipment and a storage medium, wherein the method comprises the following steps: receiving an operation request which is sent by a client and aims at a target account in a block chain network, wherein the operation request carries a requested target operation; calling a first intelligent contract related to the target account in the block chain network to detect whether the client side has the operation authority of the target account, and obtaining a detection result; and if the detection result indicates that the client side has the operation authority for the target account, executing the target operation on the target account. The embodiment of the invention can not only improve the authority detection efficiency, but also increase the diversity of the authority detection modes.

Description

Operation method of block chain account, node equipment and storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to an operation method for a blockchain account, a node device, and a storage medium.
Background
Blockchains are a decentralized infrastructure that is widely used in emerging digital cryptocurrency and are receiving attention and research as bitcoins are gradually accepted. The blockchain technology has the characteristics of decentralization, basically untrustworthy and distrusted block data and the like, and is considered to be subversion of a computer mode after the Internet.
At present, whether a certain terminal has an operation authority is mainly detected by calling an authority management module at the bottom layer of the block chain, but in the process of calling the authority control module to detect the authority, the authority control module needs to be compiled, and the compiling process consumes longer time, so that the authority detection efficiency is low.
Disclosure of Invention
The embodiment of the invention provides an operation method of a block chain account, a node device and a storage medium, which can improve the authority detection efficiency and increase the diversity of authority detection modes.
In one aspect, an embodiment of the present invention provides an operation method for a blockchain account, where the method includes:
receiving an operation request which is sent by a client and aims at a target account in a block chain network, wherein the operation request carries a requested target operation;
calling a first intelligent contract related to the target account in the block chain network to detect whether the client side has the operation authority of the target account, and obtaining a detection result;
and if the detection result indicates that the client side has the operation authority for the target account, executing the target operation on the target account.
In an embodiment, the method further comprises: if the detection result indicates that the client does not have the operation authority on the target account, broadcasting a message that the operation request does not have the authority to a node in the block chain network; and/or adding an identifier without permission to the operation request in the block chain network.
In an embodiment, the invoking a first smart contract related to the target account in the blockchain network to detect whether the client has an operation right to the target account, and obtaining a detection result includes:
calling a first intelligent contract related to the target account in the blockchain network to obtain an authorization list of the target account, wherein the authorization list comprises a plurality of authorization identifications having operation permission on the target account;
calling a first intelligent contract related to the target account in the blockchain network to detect whether the identification of the client is the authorized identification in the authorization list;
if so, obtaining a detection result indicating that the client has the operation authority of the target account; and if not, obtaining a detection result indicating that the client does not have the operation authority of the target account.
In an embodiment, the invoking of the first smart contract related to the target account in the blockchain network detects whether the client has the operation right to the target account, and after a detection result is obtained, the method further includes: and adding an identification of completed execution to a first intelligent contract related to the target account in the block chain network.
In an embodiment, the method further comprises: and when the authorization list of the target account is changed, issuing a second intelligent contract related to the changed target account in the block chain network.
In an embodiment, the method further comprises: and when an operation request which is sent by the client and aims at the changed target account is received, calling the second intelligent contract to detect whether the client has the operation authority of the changed target account or not, and obtaining a detection result.
In an embodiment, the change of the authorization list of the target account includes adding a new authorization identifier in the authorization list or subtracting an authorization identifier in the authorization list. In an embodiment, the target operation comprises any one of: reading the resource data in the target account, transferring the resource data into the target account, and transferring the resource data from the target block chain account.
In another aspect, an embodiment of the present invention provides an operating apparatus for a blockchain account, including a unit configured to execute the method for operating a blockchain account, where the apparatus specifically includes:
the system comprises a receiving and sending unit, a processing unit and a processing unit, wherein the receiving and sending unit is used for receiving an operation request which is sent by a client and aims at a target account in a block chain network, and the operation request carries a requested target operation;
the detection unit is used for calling a first intelligent contract related to the target account in the block chain network to detect whether the client side has the operation authority of the target account or not so as to obtain a detection result;
and the processing unit is used for executing the target operation on the target account if the detection result indicates that the client side has the operation authority on the target account.
In another aspect, an embodiment of the present invention provides a node device, including: the system comprises a processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are connected with each other, executable program codes are stored in the memory, and the processor is used for calling the executable program codes and executing the operation method of the block chain account.
Correspondingly, the embodiment of the invention also provides a storage medium, wherein the storage medium stores instructions, and when the storage medium runs on a computer, the storage medium enables the computer to execute the operation method of the block chain account.
According to the embodiment of the invention, when the operation request which is sent by the client and aims at the target account in the block chain network is received, the first intelligent contract in the block chain network is called to detect whether the client has the operation authority of the target account, and when the client has the operation authority of the target account, the target operation requested by the operation request is executed on the target account, so that the authority detection is realized by using the intelligent contract, the authority detection efficiency can be improved, and the diversity of the authority detection mode can be increased.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a block chain network according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a distributed system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a block chain block according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating an operation method of a blockchain account according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for detecting a permission according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an operating device for a blockchain account according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a node device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
With the coming of the scientific and technological era and the development of the mobile internet, the pace of network revolution is getting faster and faster, the information fusion of the same field or multiple fields is realized, and the process of providing an all-dimensional informatization scheme for customers also faces new challenges of improving the system structure, supporting gravity center transfer and the like. Therefore, the blockchain technology, as a specific implementation of the distributed ledger, is gradually becoming the preferred way to store data and transaction data in various fields by virtue of its natural advantages of storing and managing data.
The block chain network shown in fig. 1 is described as an example. As shown in fig. 1, the node devices in the block chain network may include banks, insurance companies, government buildings, shops, schools, hospitals, and the like. Banks, insurance companies, government buildings, shops, schools and hospitals all participate in the management and processing of the same blockchain network, and can also participate in monitoring the legality of transactions so as to achieve the fairness of processing or storing transaction data by the blockchain network. Meanwhile, the bank, the insurance company, the government building, the shop, the school and the hospital belong to different fields, and the quality and the efficiency of social work can be better improved through information fusion and interaction in the different fields. Any node device in the blockchain network may check the acquired transaction data, and when the obtained check result is that the check is successful, a block (such as the block shown in fig. 1) may be generated based on the transaction data and issued to the blockchain, so that each other node device in the blockchain network may perform distributed storage on the block. For example, as shown in fig. 1, the node devices in the block chain network may include banks, insurance companies, government buildings, shops, schools, and hospitals, and the banks, insurance companies, government buildings, shops, schools, and hospitals may store the identity information of the same user a in a distributed manner, so that the user a may query the identity information of any organization.
The embodiment of the invention provides a distributed system, which can be formed by connecting a client and a plurality of node devices (any type of computing devices in an access network, such as a server and a user terminal) in a network communication mode. Taking a distributed system as an example of a blockchain system, referring to fig. 2, fig. 2 is an optional architecture schematic diagram of the distributed system applied to the blockchain system (or blockchain network) provided by the embodiment of the present invention, and the architecture schematic diagram is formed by a client and a plurality of node devices. A point-To-point (P2P, Peer To Peer) network is formed among the node devices, and the P2P Protocol is an application layer Protocol operating on a Transmission Control Protocol (TCP). In a distributed system, any machine, such as a server or a terminal, can join to become a node, and the node comprises a hardware layer, a middle layer, an operating system layer and an application layer. The client may also be a node device in the blockchain network.
Referring to the functions of each node in the blockchain system shown in fig. 2, the functions involved include:
1) routing, a basic function that a node has, is used to support communication between nodes.
Besides the routing function, the node may also have the following functions:
2) and the Block chain comprises a series of blocks (blocks) which are mutually connected according to the generated chronological order, new blocks cannot be removed once being added into the Block chain, and recorded data submitted by nodes in the Block chain system are recorded in the blocks.
Referring to fig. 3, fig. 3 is an optional schematic diagram of a Block Structure (Block Structure) according to an embodiment of the present invention, where each Block includes a hash value of a data record stored in the Block (hash value of the Block) and a hash value of a previous Block, and the blocks are connected by the hash values to form a Block chain. The block may include information such as a time stamp at the time of block generation. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using cryptography, and each data block contains related information for verifying the validity (anti-counterfeiting) of the information and generating a next block.
3) The application is used for being deployed in a block chain, realizing specific services according to actual service requirements, recording data related to the realization functions to form recording data, carrying a digital signature in the recording data to represent a source of task data, and sending the recording data to other nodes in the block chain system, so that the other nodes add the recording data to a temporary block when the source and integrity of the recording data are verified successfully.
For example, the services implemented by the application include:
3.1) a wallet for providing functions of transaction of electronic money, which includes initiating transaction (i.e. sending the transaction record of the current transaction to other nodes in the blockchain system, and storing the record data of the transaction in a temporary block of the blockchain as a response for confirming that the transaction is valid after the other nodes are successfully verified; of course, the wallet also supports the querying of the remaining electronic money in the electronic money address;
and 3.2) sharing the account book, wherein the shared account book is used for providing functions of operations such as storage, inquiry and modification of account data, the recorded data of the operations on the account data are sent to other nodes in the block chain system, and after the other nodes verify the validity, the recorded data are stored in the temporary block as a response for acknowledging that the account data are valid, and confirmation can be sent to the node initiating the operations.
3.3) Intelligent contracts, computerized agreements, which can execute the terms of a certain contract, are realized by codes deployed on a shared book for execution when certain conditions are met, and are used for completing automated transactions according to actual business requirement codes, such as inquiring the logistics state of goods purchased by a buyer and transferring the electronic money of the buyer to the address of a merchant after the buyer signs the goods; of course, smart contracts are not limited to executing contracts for trading, but may also execute contracts that process received information.
In addition, rights management is the core content of blockchain technology. At present, whether a client has an operation authority for a blockchain account is mainly detected by calling an authority management module at the bottom layer of a blockchain, but in the process of calling the authority control module to detect the authority of the client, the authority control module needs to be compiled, and the compiling process consumes longer time, so that the authority detection efficiency is low. Based on this, an embodiment of the present invention provides an operation method for a blockchain account, including the following steps: receiving an operation request which is sent by a client and aims at a target account in a block chain network, wherein the operation request carries a target operation requested by the operation request, and the target operation comprises reading resource data in the target account, transferring the resource data into the target account, transferring the resource data out of the target block chain account and the like; and calling a first intelligent contract related to the target account in the block chain network to detect whether the client side has the operation right on the target account, and executing the target operation on the target account when the client side has the operation right on the target account. In the method, the contract related to the authority management is written into the intelligent contract in advance, and the intelligent contract is directly called in the subsequent authority detection process to carry out the authority detection, so that the diversity of the authority detection mode is increased; in addition, the compiling time can be saved, and the authority detection efficiency can be improved, which is explained in detail below.
Referring to fig. 4, fig. 4 is a flowchart illustrating an operation method of a blockchain account according to an embodiment of the present invention. The operation method of the blockchain account described in the embodiment of the present invention may be applied to a node device, where the node device may be any node device of a blockchain network in the distributed system shown in fig. 2. In other embodiments, the node device is an optimal node device determined according to a load condition, a response time, and a distance from a client of each node device in the block chain network. The operation method of the blockchain account described in the embodiment of the invention comprises the following steps:
s401, receiving an operation request which is sent by a client and aims at a target account in a block chain network, wherein the operation request carries a requested target operation.
In the embodiment of the invention, the target account is a block chain account in a block chain network; the target operation requested by the operation request may be an operation of reading resource data in a target account, transferring resource data into the target account, or transferring resource data out of the target blockchain account. The node device may obtain the requested target operation carried by the operation request immediately after receiving the operation request for the target account sent by the client; or, when it is detected that the client has the operation right for the target account in the following, the requested target operation carried by the client is obtained from the operation request.
S402, calling a first intelligent contract related to the target account in the block chain network to detect whether the client side has the operation authority of the target account, and obtaining a detection result.
In the embodiment of the invention, the first intelligent contract is a permission management contract which is issued in advance in the block chain network, is related to the target account and can be used for permission detection. In one embodiment, the node device calls a first intelligent contract related to a target account in the blockchain network to obtain an authorization list of the target account, wherein the authorization list comprises a plurality of authorization identifications having operation permission for the target account. The authorization identifier is an identifier of a terminal with an operation authority to the target account; the identifier can be a character string which can uniquely identify the terminal, such as an IP address or an MAC address of the terminal, and the identifier can also be obtained after the character string is subjected to encryption, Hash algorithm, signature and other processing; the terminal may be a node device in a blockchain network.
Further, the node device invokes the first intelligent contract to detect whether the identity of the client initiating the operation request is an authorized identity in the authorization list. The identification of the client can be a character string which can uniquely identify the client, such as an IP address or an MAC address of the client, and the identification can also be obtained after the character string is subjected to encryption, Hash algorithm, signature and the like; the identification of the client is consistent with the calculation mode of the authorization identification. If the identifier of the client is detected to be the authorization identifier in the authorization list, a detection result indicating that the client has the operation authority for the target account is obtained, and step S403 is executed. And if the identification of the client is not the authorization identification in the authorization list, obtaining a detection result indicating that the client does not have the operation authority of the target account.
In an embodiment, if the detection result indicates that the client does not have the operation permission for the target account, the node device issues the operation request to the blockchain, and broadcasts a message that the operation request does not have the permission to a node in the blockchain network, and/or adds an identifier without permission to the operation request in the blockchain network. By the method, whether the target operation requested by the operation request is executed or not can be verified conveniently and quickly. In other embodiments, when the detection result indicates that the client does not have the operation right for the target account, the node device may reject the operation request of the client for the target account, and send a prompt message of operation failure to the client.
In another embodiment, after receiving an operation request for a target account sent by a client, a node device issues the operation request to a blockchain, and invokes the first intelligent contract to detect whether the client has an operation right for the target account after the issuance is completed, so as to obtain a detection result. Through the mode, the on-chain authority detection can be realized, the on-chain authority detection public trust is higher than the off-chain authority detection, and the safety of the block chain account can be improved.
In an embodiment, the node device invokes the first intelligent contract to detect whether the client has the operation right on the target account, and after obtaining a detection result, adds an executed identifier to the first intelligent contract related to the target account in the blockchain network. Or when the detection result indicates that the client has the operation right on the target account, adding an executed identifier for a first intelligent contract related to the target account in the block chain network. After the first intelligent contract is added with the identification of the completion of execution, the first intelligent contract will not be executed any more later. By the method, the authority management contract has timeliness, and the condition that the authority management contract is tampered can be avoided to a certain extent, so that the safety of the block chain account can be further improved.
S403, if the detection result indicates that the client has the operation authority on the target account, executing the target operation on the target account.
For example, the target operation is to read the fund balance in the target account, the node device reads the fund balance in the target account, and sends the obtained fund balance to the client. For another example, the target operation is to transfer funds of a first value into the target account, the node device adds the first value to the fund balance in the target account, and sends the updated fund balance to the client. For another example, the target operation is to transfer a second amount of funds from the target account, and the node device subtracts the second amount from the balance of funds in the target account and sends the updated balance of funds to the client. The node device may read the fund balance in the target account before transferring the fund from the target account, and detect whether the fund balance is greater than or equal to the second value; when the fund balance is greater than or equal to the second value, the node device subtracts the second value from the fund balance in the target account. And when the fund balance is smaller than the second value, the node equipment refuses the operation request of transferring the fund from the target account and sends prompt information of operation failure to the client. In other embodiments, after the node device rejects the operation request for transferring funds from the target account, the node device issues the operation request for transferring funds from the target account to the blockchain, and broadcasts a message to nodes in the blockchain network that the operation request is not responded to, and/or adds an identification of non-response to the operation request in the blockchain network. By the mode, whether the fund transfer-out operation requested by the operation request is executed or not can be verified conveniently and quickly.
The embodiment of the invention writes the contract related to the authority management into the intelligent contract in advance, and directly calls the intelligent contract to carry out the authority detection in the subsequent authority detection process, thereby increasing the diversity of the authority detection mode; in addition, the intelligent contract runs on the virtual machine, so that the compiling time can be saved to a certain extent, and the authority detection efficiency is improved.
In other embodiments, a node device receives an operation request for a target account in a blockchain network, where the operation request carries a requested target operation, and the operation request is sent by a client; calling a first intelligent contract related to a target account in a block chain network to detect whether a client side has an operation authority on the target account, and obtaining a detection result; if the detection result indicates that the client side has the operation authority on the target account, calling the first intelligent contract to detect whether the client side has the authority on executing the target operation on the target account; if yes, the target operation is executed on the target account. Otherwise, the target operation is refused to be executed on the target account.
In one embodiment, when a client does not have an operation authority for a target account or does not have an authority for executing the target operation on the target account, a node device receives an authority endowing request sent by the client, wherein the authority endowing request is used for requesting to endow the client with the authority for executing the target operation on the target account; the node equipment calls the first intelligent contract to endow the client with the authority to execute the target operation on the target account; specifically, the identification of the client may be added to the authorization list of the target account. In other embodiments, before the node device invokes the first smart contract to give the client the right to perform the target operation on the target account, it is detected whether the identifier of the client is in a target list, where the target list includes identifiers of terminals that cannot give the operation right to the target account. If the identification of the client is not in the target list, judging whether the authority for executing the target operation on the target account is the authority in the preset authority group or not according to the preset authority group; the authority in the preset authority group is an operation authority which can be automatically given to the target account. If the authority for executing the target operation on the target account is the authority in the preset authority group, the first intelligent energy contract is called to endow the client with the authority for executing the target operation on the target account. Through the mode, the authority management contract written into the intelligent contract can also realize the authority endowing function.
In another embodiment, when a client has a right to perform a target operation on a target account, a node device receives a right revoking request sent by the client, where the right revoking request is used to request to revoke a right of the client to perform the target operation on the target account or revoke an operation right of the client to the target account; and the node equipment responds to the permission revocation request, and calls the first intelligent contract to revoke the permission of the client to execute the target operation on the target blockchain account or revoke the operation permission of the client to the target account. The revoking of the operation authority of the client on the target account may specifically be to delete the identifier of the client from an authorization list of the target account. In other embodiments, if the node device detects that the client has a security risk, the node device automatically invokes the first intelligent contract to revoke the operation permission of the client on the target block chain account. The node device may detect whether the client has a security risk according to data related to the client in the blockchain network; or when receiving a message that the client has a security risk and is broadcasted by other node devices, determining that the client has the security risk. By the mode, the authority management contract written into the intelligent contract can also realize the function of authority revocation.
In other embodiments, the method for operating a blockchain account in the embodiments of the present invention may further include the following steps as shown in fig. 5:
s501, when the authorization list of the target account is changed, issuing a second intelligent contract related to the changed target account in the block chain network.
In the embodiment of the invention, the change of the authorization list of the target account comprises adding an authorization identifier in the authorization list or reducing the authorization identifier in the authorization list; the changed authorization list comprises one or more authorization identifications having operation authority for the target account; the second intelligent contract is associated with the changed target account and may be used for a rights management contract for rights detection, rights assignment, and rights revocation.
In one embodiment, before or after the node device issues a second intelligent contract related to the changed target account in the blockchain network, whether the first intelligent contract adds an identification of the executed completion is detected; and if the executed identification is not added to the first intelligent contract, adding an invalid identification to the first intelligent contract. After the first smart contract is added with the invalid identifier, it will not be executed any more later. By adopting the mode, the selection conflict between the intelligent contracts can be avoided.
S502, when an operation request which is sent by the client and aims at the changed target account is received, the second intelligent contract is called to detect whether the client has the operation authority of the changed target account, and a detection result is obtained.
In the embodiment of the invention, the node equipment calls the second intelligent contract to acquire the changed authorization list of the target account, and calls the second intelligent contract to detect whether the identifier of the client initiating the operation request is the authorization identifier in the changed authorization list. And if the identification of the client is detected to be the authorization identification in the changed authorization list, obtaining a detection result indicating that the client has the operation authority for the changed target account, and executing the operation requested by the operation request on the changed target account. If the fact that the identification of the client is not the authorization identification in the changed authorization list is detected, a detection result indicating that the client does not have the operation authority of the changed target account is obtained, the operation request of the client to the changed target account is refused, and prompt information of operation failure is sent to the client.
By adopting the mode, when the authorization list of the target account is changed, a new authority management contract can be reissued, and the new authority management contract is utilized to respond to a new operation request, so that the authority management contract related to the target account in the block chain network can be updated when the updating condition is met, the authority management contract has timeliness and is more in line with the actual requirement, the condition that the authority management contract is tampered can be avoided to a certain extent, and the safety of the block chain account is further improved.
According to the embodiment of the invention, when the operation request which is sent by the client and aims at the target account in the block chain network is received, the intelligent contract in the block chain network is called to detect whether the client has the operation authority of the target account, and when the client has the operation authority of the target account, the target operation requested by the operation request is executed on the target account, so that the authority detection is realized by using the intelligent contract, the authority detection efficiency can be improved, and the diversity of the authority detection mode can be increased.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an operation device for a blockchain account according to an embodiment of the present invention. The device for operating a blockchain account described in the embodiment of the present invention is applied to the node device in the above method embodiment, and the device includes:
a transceiver 601, configured to receive an operation request for a target account in a blockchain network sent by a client, where the operation request carries a requested target operation;
a detecting unit 602, configured to invoke a first intelligent contract related to the target account in the blockchain network to detect whether the client has an operation permission on the target account, so as to obtain a detection result;
a processing unit 603, configured to execute the target operation on the target account if the detection result indicates that the client has the operation permission on the target account.
In an embodiment, the transceiver 601 is further configured to broadcast, to a node in the blockchain network, a message that the operation request does not have the authority if the detection result indicates that the client does not have the operation authority on the target account;
the processing unit 603 is further configured to add an identifier without permission to the operation request in the blockchain network.
In an embodiment, the detecting unit 602 is specifically configured to:
calling a first intelligent contract related to the target account in the blockchain network to obtain an authorization list of the target account, wherein the authorization list comprises a plurality of authorization identifications having operation permission on the target account; calling a first intelligent contract related to the target account in the blockchain network to detect whether the identification of the client is the authorized identification in the authorization list; if so, obtaining a detection result indicating that the client has the operation authority of the target account; and if not, obtaining a detection result indicating that the client does not have the operation authority of the target account.
In an embodiment, the processing unit 603 is further configured to add an identification of completed execution to a first intelligent contract related to the target account in the blockchain network.
In an embodiment, the processing unit 603 is further configured to:
and when the authorization list of the target account is changed, issuing a second intelligent contract related to the changed target account in the block chain network.
In an embodiment, the detecting unit 602 is further configured to:
when the transceiver 601 receives an operation request for the changed target account sent by the client, the second intelligent contract is invoked to detect whether the client has an operation authority for the changed target account, so as to obtain a detection result.
In an embodiment, the change of the authorization list of the target account includes adding a new authorization identifier in the authorization list or subtracting an authorization identifier in the authorization list.
In an embodiment, the target operation comprises any one of:
reading the resource data in the target account, transferring the resource data into the target account, and transferring the resource data from the target block chain account.
It can be understood that the functions of each functional unit of the operation device for a blockchain account according to the embodiment of the present invention can be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process of the method can refer to the related description of the foregoing method embodiment, which is not described herein again.
According to the embodiment of the invention, when the operation request which is sent by the client and aims at the target account in the block chain network is received, the intelligent contract in the block chain network is called to detect whether the client has the operation authority of the target account, and when the client has the operation authority of the target account, the target operation requested by the operation request is executed on the target account, so that the authority detection is realized by using the intelligent contract, the authority detection efficiency can be improved, and the diversity of the authority detection mode can be increased.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a node device according to an embodiment of the present invention. The node device described in the embodiment of the present invention includes: a processor 701, a communication interface 702, and a memory 703. The processor 701, the communication interface 702, and the memory 703 may be connected by a bus or other methods, and the embodiment of the present invention is exemplified by being connected by a bus.
The processor 701 (or referred to as a Central Processing Unit (CPU)) is a computing core and a control core of the node device, and can analyze various instructions in the node device and various data of the node device, for example: the CPU may transmit various types of interactive data between the internal structures of the node devices, and so on. The communication interface 702 may optionally include a standard wired interface, a wireless interface (e.g., Wi-Fi, mobile communication interface, etc.), controlled by the processor 701 for transceiving data. A Memory 703(Memory) is a Memory device in the node device for storing programs and data. It is understood that the memory 703 herein may include a built-in memory of the node device, and may also include an expansion memory supported by the node device. Memory 703 provides storage space that stores the operating system of the node device, which may include, but is not limited to: android system, iOS system, Windows Phone system, etc., which are not limited in this respect.
In the embodiment of the present invention, the processor 701 executes the executable program code in the memory 703 to perform the following operations:
receiving an operation request which is sent by a client and aims at a target account in a block chain network through a communication interface 702, wherein the operation request carries a requested target operation; calling a first intelligent contract related to the target account in the block chain network to detect whether the client side has the operation authority of the target account, and obtaining a detection result; and if the detection result indicates that the client side has the operation authority for the target account, executing the target operation on the target account.
In an embodiment, the processor 701 is further configured to: if the detection result indicates that the client does not have the operation authority on the target account, broadcasting a message that the operation request does not have the authority to a node in the block chain network through a communication interface 702; and/or adding an identifier without permission to the operation request in the block chain network.
In an embodiment, the processor 701 invokes a first intelligent contract related to the target account in the blockchain network to detect whether the client has the operation right to the target account, and when a detection result is obtained, the processor is specifically configured to: calling a first intelligent contract related to the target account in the blockchain network to obtain an authorization list of the target account, wherein the authorization list comprises a plurality of authorization identifications having operation permission on the target account; calling a first intelligent contract related to the target account in the blockchain network to detect whether the identification of the client is the authorized identification in the authorization list; if so, obtaining a detection result indicating that the client has the operation authority of the target account; and if not, obtaining a detection result indicating that the client does not have the operation authority of the target account.
In another embodiment, the processor 701 invokes a first smart contract related to the target account in the blockchain network to detect whether the client has an operation right on the target account, and after obtaining a detection result, the processor is further configured to: and adding an identification of completed execution to a first intelligent contract related to the target account in the block chain network.
In an embodiment, the processor 701 is further configured to:
and when the authorization list of the target account is changed, issuing a second intelligent contract related to the changed target account in the block chain network.
In an embodiment, the processor 701 is further configured to:
when an operation request for the changed target account sent by the client is received through the communication interface 702, the second intelligent contract is called to detect whether the client has the operation authority for the changed target account, and a detection result is obtained.
In an embodiment, the change of the authorization list of the target account includes adding a new authorization identifier in the authorization list or subtracting an authorization identifier in the authorization list. In an embodiment, the target operation comprises any one of: reading the resource data in the target account, transferring the resource data into the target account, and transferring the resource data from the target block chain account.
In a specific implementation, the processor 701, the communication interface 702, and the memory 703 described in this embodiment of the present invention may execute the implementation manner of the node device described in the operation method for a blockchain account provided in this embodiment of the present invention, and may also execute the implementation manner described in the operation apparatus for a blockchain account provided in this embodiment of the present invention, which is not described herein again.
According to the embodiment of the invention, when the operation request which is sent by the client and aims at the target account in the block chain network is received, the intelligent contract in the block chain network is called to detect whether the client has the operation authority of the target account, and when the client has the operation authority of the target account, the target operation requested by the operation request is executed on the target account, so that the authority detection is realized by using the intelligent contract, the authority detection efficiency can be improved, and the diversity of the authority detection mode can be increased.
Embodiments of the present invention further provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer is caused to execute the method for operating a blockchain account according to an embodiment of the present invention.
Embodiments of the present invention also provide a computer program product including instructions, which when run on a computer, cause the computer to execute the method for operating a blockchain account according to an embodiment of the present invention.
It should be noted that, for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts or combinations, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above disclosure is intended to be illustrative of only some embodiments of the invention, and is not intended to limit the scope of the invention.

Claims (10)

1. A method of operating a blockchain account, the method comprising:
receiving an operation request which is sent by a client and aims at a target account in a block chain network, wherein the operation request carries a requested target operation;
calling a first intelligent contract related to the target account in the block chain network to detect whether the client side has the operation authority of the target account, and obtaining a detection result;
and if the detection result indicates that the client side has the operation authority for the target account, executing the target operation on the target account.
2. The method of claim 1, wherein the method further comprises:
if the detection result indicates that the client does not have the operation authority on the target account, broadcasting a message that the operation request does not have the authority to a node in the block chain network; and/or the presence of a gas in the gas,
and adding an identifier without permission to the operation request in the block chain network.
3. The method as claimed in claim 1 or 2, wherein the invoking of the first intelligent contract related to the target account in the blockchain network detects whether the client has the operation right to the target account, and obtains a detection result, including:
calling a first intelligent contract related to the target account in the blockchain network to obtain an authorization list of the target account, wherein the authorization list comprises a plurality of authorization identifications having operation permission on the target account;
calling a first intelligent contract related to the target account in the blockchain network to detect whether the identification of the client is the authorized identification in the authorization list;
if so, obtaining a detection result indicating that the client has the operation authority of the target account;
and if not, obtaining a detection result indicating that the client does not have the operation authority of the target account.
4. The method of claim 1, wherein the invoking of the first smart contract associated with the target account in the blockchain network detects whether the client has an operation right for the target account, and after obtaining the detection result, the method further comprises:
and adding an identification of completed execution to a first intelligent contract related to the target account in the block chain network.
5. The method of claim 1 or 4, wherein the method further comprises:
and when the authorization list of the target account is changed, issuing a second intelligent contract related to the changed target account in the block chain network.
6. The method of claim 5, wherein the method further comprises:
and when an operation request which is sent by the client and aims at the changed target account is received, calling the second intelligent contract to detect whether the client has the operation authority of the changed target account or not, and obtaining a detection result.
7. The method of claim 5, wherein the change in the authorization list for the target account comprises a new authorization identifier added to the authorization list or a reduced authorization identifier from the authorization list.
8. The method of claim 1, wherein the target operation comprises any one of: reading the resource data in the target account, transferring the resource data into the target account, and transferring the resource data from the target block chain account.
9. A node apparatus, comprising: a processor, a communication interface and a memory, the processor, the communication interface and the memory being interconnected, wherein the memory stores executable program code, and the processor is configured to invoke the executable program code to perform the method of operation of a blockchain account according to any one of claims 1 to 8.
10. A storage medium having stored therein instructions that, when executed on a computer, cause the computer to perform the method of operation of a blockchain account of any one of claims 1 to 8.
CN201911149892.0A 2019-11-21 2019-11-21 Operation method of block chain account, node equipment and storage medium Pending CN111222109A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911149892.0A CN111222109A (en) 2019-11-21 2019-11-21 Operation method of block chain account, node equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911149892.0A CN111222109A (en) 2019-11-21 2019-11-21 Operation method of block chain account, node equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111222109A true CN111222109A (en) 2020-06-02

Family

ID=70827733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911149892.0A Pending CN111222109A (en) 2019-11-21 2019-11-21 Operation method of block chain account, node equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111222109A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111741015A (en) * 2020-07-21 2020-10-02 百度在线网络技术(北京)有限公司 Operation processing method, device, equipment and medium in block chain network
CN112200578A (en) * 2020-09-23 2021-01-08 裴俊伟 Financial service checking method and financial service checking platform based on block chain
WO2020169127A3 (en) * 2020-06-08 2021-04-01 Alipay Labs (singapore) Pte. Ltd. User management of blockchain-based custom clearance service platform
US11307775B2 (en) 2020-06-08 2022-04-19 Alipay Labs (singapore) Pte. Ltd. Distributed storage of custom clearance data
US11356270B2 (en) 2020-06-08 2022-06-07 Alipay Labs (singapore) Pte. Ltd. Blockchain-based smart contract pools
US11372695B2 (en) 2020-06-08 2022-06-28 Alipay Labs (singapore) Pte. Ltd. Blockchain-based import custom clearance data processing
US11416418B2 (en) 2020-06-08 2022-08-16 Alipay Labs (singapore) Pte. Ltd. Managing user authorizations for blockchain-based custom clearance services
US11449911B2 (en) 2020-06-08 2022-09-20 Alipay Labs (singapore) Pte. Ltd. Blockchain-based document registration for custom clearance

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020169127A3 (en) * 2020-06-08 2021-04-01 Alipay Labs (singapore) Pte. Ltd. User management of blockchain-based custom clearance service platform
US11307775B2 (en) 2020-06-08 2022-04-19 Alipay Labs (singapore) Pte. Ltd. Distributed storage of custom clearance data
US11356270B2 (en) 2020-06-08 2022-06-07 Alipay Labs (singapore) Pte. Ltd. Blockchain-based smart contract pools
US11372695B2 (en) 2020-06-08 2022-06-28 Alipay Labs (singapore) Pte. Ltd. Blockchain-based import custom clearance data processing
US11416418B2 (en) 2020-06-08 2022-08-16 Alipay Labs (singapore) Pte. Ltd. Managing user authorizations for blockchain-based custom clearance services
US11418511B2 (en) 2020-06-08 2022-08-16 Alipay Labs (singapore) Pte. Ltd. User management of blockchain-based custom clearance service platform
US11449911B2 (en) 2020-06-08 2022-09-20 Alipay Labs (singapore) Pte. Ltd. Blockchain-based document registration for custom clearance
CN111741015A (en) * 2020-07-21 2020-10-02 百度在线网络技术(北京)有限公司 Operation processing method, device, equipment and medium in block chain network
CN112200578A (en) * 2020-09-23 2021-01-08 裴俊伟 Financial service checking method and financial service checking platform based on block chain

Similar Documents

Publication Publication Date Title
CN111222109A (en) Operation method of block chain account, node equipment and storage medium
CN110535872B (en) Method and apparatus for processing data requests in a blockchain network
CN109472572B (en) Contract system based on block chain main chain and parallel multiple sub-chains
CN112887160B (en) Block chain all-in-one machine, multi-node deployment method and device thereof, and storage medium
CN113409045B (en) Data processing method and device based on block chain and electronic equipment
CN111507717B (en) Data processing method, device, block node and computer readable storage medium
CN111740966B (en) Data processing method based on block chain network and related equipment
CN110955724A (en) Data processing method and device based on block chain, node equipment and storage medium
CN111698315B (en) Data processing method and device for block and computer equipment
CN109155731A (en) The management of password transaction
CN113271311B (en) Digital identity management method and system in cross-link network
CN111383021A (en) Node management method, device, equipment and medium based on block chain network
KR101976787B1 (en) Method for distributing an electronic document using a smart contract in a blockchain
CN112101942A (en) Transaction request processing method, system, device and equipment based on block chain
CN113255014B (en) Data processing method based on block chain and related equipment
CN111324661A (en) User cooperation method, device and medium based on block chain
CN113114796B (en) Active identification carrier, management method thereof and service platform
CN111178840A (en) Service processing method, device, system, electronic equipment and storage medium
JP2024516119A (en) Secure Sensor Data Distribution
CN112700251A (en) Identity confirmation method, device and system in financial scene
CN115514608A (en) Block consensus method, device, equipment and storage medium
CN112040015B (en) Consensus node list generation method and related device
WO2023019903A1 (en) Cross-chain transaction system and method, and device and storage medium
JP2024514858A (en) blockchain key generation
CN113672988B (en) Information management method, system, medium and electronic equipment based on block chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40024324

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination