WO2023045575A1 - 区块链中的权限管控 - Google Patents

区块链中的权限管控 Download PDF

Info

Publication number
WO2023045575A1
WO2023045575A1 PCT/CN2022/109840 CN2022109840W WO2023045575A1 WO 2023045575 A1 WO2023045575 A1 WO 2023045575A1 CN 2022109840 W CN2022109840 W CN 2022109840W WO 2023045575 A1 WO2023045575 A1 WO 2023045575A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
permission
target
authority
type
Prior art date
Application number
PCT/CN2022/109840
Other languages
English (en)
French (fr)
Inventor
孙赫
Original Assignee
蚂蚁区块链科技(上海)有限公司
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 蚂蚁区块链科技(上海)有限公司, 支付宝(杭州)信息技术有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023045575A1 publication Critical patent/WO2023045575A1/zh

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/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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

Definitions

  • This document relates to the field of blockchain technology, and in particular to a permission control method, device and electronic equipment in the blockchain.
  • the blockchain platform does not have authority control over transactions, that is, any user who has a blockchain platform account can send transactions to the blockchain platform for account creation, contract deployment and execution, and other operations.
  • any user who has a blockchain platform account can send transactions to the blockchain platform for account creation, contract deployment and execution, and other operations.
  • the needs and permissions of different consortium institutions are usually different. For example, some consortium institutions are not allowed to create accounts in consortium chains, while some Institutions are not allowed to deploy contracts or execute certain contracts in the consortium chain.
  • the embodiments of this specification provide a permission management and control method, device and electronic equipment in the blockchain to solve the problem that the existing blockchain platform lacks relatively accurate permission management and control for transactions and corresponding transaction accounts.
  • a permission control method in the blockchain is proposed, the method is applied to the consensus nodes in the blockchain, and the method includes: obtaining the first transaction from the transaction pool, and the first transaction is obtained by The client sends, and the first transaction carries a permission setting request for the target permission type; initiates a consensus operation for the first transaction in the block chain; After the consensus is passed in the chain, the target authority type is set in the block chain through the authority control smart contract; wherein, the authority control smart contract is used to set the authority based on the authority setting request in the transaction after passing the consensus.
  • a permission management and control device in the blockchain including: a transaction retrieval module, which retrieves the first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries A permission setting request for the target permission type; a transaction consensus module, initiating a consensus operation for the first transaction in the block chain; a contract execution module, passing a consensus in the block chain for the first transaction Afterwards, the target authority type is set in the block chain through the authority control smart contract; wherein, the authority control smart contract is used to set authority based on the authority setting request in the transaction after passing the consensus.
  • an electronic device in a third aspect, includes a processor and a memory arranged to store computer-executable instructions, the executable instructions, when executed, cause the processor to perform the following operations: Get the first transaction in the middle, the first transaction is sent by the client, and the first transaction carries the permission setting request for the target permission type; initiate the consensus operation for the first transaction in the block chain ; After the first transaction passes consensus in the block chain, set the target authority type in the block chain through the authority control smart contract; wherein, the authority control smart contract is used to Permission settings in the following transaction request to set permissions.
  • a computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including a plurality of application programs, the The electronic device performs the following operations: obtain a first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries a permission setting request for the target permission type; in the blockchain Initiate a consensus operation for the first transaction; after the first transaction passes consensus in the block chain, set the target permission type in the block chain through the authority control smart contract; wherein, the The authority control smart contract described above is used to set authority based on the authority setting request in the transaction after passing the consensus.
  • the embodiment of this specification uses the above technical solution to at least achieve the following technical effects: using the authority control method provided by the embodiment of this specification, the consensus node in the blockchain can obtain the first transaction from the transaction pool, and the first transaction is provided by the client. and the first transaction carries a permission setting request for the target permission type; the consensus node then initiates a consensus operation for the first transaction in the blockchain; and after the first transaction passes the consensus in the blockchain , it is possible to set the target permission type in the blockchain through the permission control smart contract used to set the permission based on the permission setting request in the transaction after passing the consensus, so as to realize the setting and control of the permission type in the blockchain, so that the subsequent When executing a transaction, it can be determined whether the transaction has the corresponding authority.
  • Fig. 1 is a schematic diagram of the implementation flow of a permission control method in a block chain provided by an embodiment of this specification;
  • FIG. 2 is a schematic flow diagram of the application of the authority control method in the blockchain provided in an embodiment of this specification to an actual scenario;
  • FIG. 3 is a schematic structural diagram of an authority management and control device in a blockchain provided by an embodiment of this specification;
  • Fig. 4 is a schematic structural diagram of an electronic device provided by an embodiment of this specification.
  • the embodiment of this specification provides a method for authority control in the blockchain, using the authority control method provided by the embodiment of this specification method, the consensus node in the blockchain can obtain the first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries a permission setting request for the target permission type; Initiate a consensus operation for the first transaction in the block chain; and after the first transaction passes the consensus in the block chain, it can be used to set the authority based on the permission setting request in the transaction after the consensus. Control the smart contract, in Set the target permission type in the blockchain to realize the setting and control of the permission type in the blockchain, so that when a transaction is executed later, it can be determined whether the transaction has the corresponding permission.
  • a block chain authority control method provided by one or more embodiments of this specification is applied to a consensus node in a block chain implementation flow diagram as shown in Figure 1, including the following steps.
  • the target authority type may include authority types such as transfer transaction, account creation, whitelist setting, and blacklist setting.
  • the embodiment of this specification can also set a part of the permission type and the corresponding permission account when creating the genesis block.
  • the method provided by the embodiment of this specification also includes: At the time of the block, the authority control smart contract is deployed, and the authority control smart contract is used to set the authority based on the authority setting request; set and save the first authority type and/or the authority account of the first authority type through the authority control smart contract; create an administrator user.
  • the above-mentioned first transaction can be sent by the administrator user through the client. That is to say, the blockchain can set an administrator user after the genesis block is created, and the administrator user has the set permission type and the corresponding permission account or changes these set permission types and/or the set permission types The authority of the corresponding authority account, while other ordinary users do not have this authority.
  • the transaction corresponding to the target permission type can be executed in the blockchain.
  • the target permission type including transfer transaction as an example, before setting the permission type of the transfer transaction in the blockchain, such transactions cannot be executed in the blockchain; after setting the permission type of the transfer transaction in the blockchain, the blockchain Only then can such transactions be executed.
  • the method provided in this embodiment of the specification further includes: returning the permission setting result for the target permission type to the client.
  • the method provided by the embodiment of this specification further includes: obtaining a second transaction from the transaction pool, the second transaction is sent by the client, and the second The transaction carries the authority setting request for the authority account of the target authority type; initiates a consensus operation for the second transaction in the blockchain; after the second transaction passes the consensus in the blockchain, the authority control smart contract is Set the authority account of the target authority type in the blockchain; among them, the authority control smart contract is used to set the authority based on the authority setting request in the transaction after passing the consensus.
  • the permission account for the target permission type can include setting a whitelist for the target permission type. Only the permission account in the whitelist has the permission to execute the transaction corresponding to the target permission type.
  • the permission account for the target permission type can also be included as the target permission type Set up a blacklist, and the permission accounts in the blacklist do not have the permission to execute transactions corresponding to the target permission type.
  • the blacklist includes account c and account d, that is to say, account c and account d cannot perform transfer transactions.
  • the method provided by the embodiment of this specification also includes: The setting result of the permission account corresponding to the target permission type is returned to the client.
  • the above-mentioned second transaction involves the setting of permissions, in order to prevent other ordinary accounts from maliciously changing the permissions, the above-mentioned second transaction can be sent by the administrator user through the client.
  • the embodiment of this specification provides more methods including: recording in the state database of the consensus node The mapping relationship between the target permission type and the permission account of the target permission type.
  • the transfer transaction and the mapping relationship between the whitelist account and the blacklist account of the transfer transaction can be recorded in the state database of the consensus node.
  • the method provided by the embodiment of this specification further includes: obtaining the target transaction sent by the target user from the transaction pool , the target transaction carries the transaction type of the target transaction; query the permission type corresponding to the transaction type of the target transaction from the state database; if there is a permission type corresponding to the transaction type of the target transaction in the permission type of the state database, then Based on the mapping relationship, query the authority account corresponding to the transaction type of the target transaction to determine whether the target user has the authority of the target transaction; if the target user has the authority of the target transaction, initiate a consensus operation for the target transaction in the blockchain.
  • the blockchain platform deploys the authority control smart contract in the blockchain after the creation of the genesis block; after deploying the authority control smart contract, some authority types can be set, and the authority accounts corresponding to these authority types can also be set.
  • the permission accounts corresponding to these permission types are not set, or only the permission accounts corresponding to one or several permission types in these permission types can be set.
  • the embodiment of this specification can set up an account of an administrator user after the creation block is created, and only the administrator user has the ability to set and change permission types and corresponding permissions Account permissions.
  • the client sends a transaction of setting permission type to the blockchain platform; the transaction of setting permission type can be sent by the administrator user to the blockchain platform through the client.
  • the administrator user can send a transaction carrying a permission type setting request for the transfer transaction to the blockchain platform through the client.
  • the consensus node in the blockchain initiates a consensus operation for the transaction of the set permission type; the embodiment of this specification does not limit the specific algorithm corresponding to the consensus operation.
  • the permission control smart contract sets and saves the permission contract.
  • each consensus node in the blockchain synchronizes the execution result; each consensus node in the blockchain can save the set permission type in the state database of the consensus node.
  • the block chain platform returns an execution result to the client; for example, the block chain platform returns to the client a result that the permission type of the transfer transaction is successfully set.
  • the client sends the transaction of the permission account corresponding to the set permission type to the blockchain platform; the transaction of the permission account corresponding to the set permission type can be sent to the blockchain platform by the administrator user through the client.
  • the administrator user can send a transaction to the blockchain platform through the client to carry a transaction that includes a setting request for the corresponding authority account of the transfer transaction, including account a, account b, and account c.
  • the consensus node in the blockchain initiates a consensus operation for the transaction of the permission account corresponding to the set permission type.
  • the permission control smart contract sets and saves the permission account corresponding to the permission type.
  • each consensus node in the block chain synchronizes the execution result; each consensus node in the block chain can save the permission account corresponding to the set permission type in the state database of the consensus node.
  • each consensus node in the blockchain can save the mapping relationship between the set transfer transaction and account a, account b, and account c in the state database of the consensus node.
  • the block chain platform returns an execution result to the client; for example, the block chain platform returns to the client a result that the authorized accounts for the transfer transaction include account a, account b, and account c are successfully set.
  • the client sends a transaction to the blockchain platform, and the transaction carries a transaction type and a corresponding transaction account; for example, the transaction type is a transfer transaction, and the transaction account includes account a and account b.
  • the consensus node in the blockchain checks whether the transaction has a corresponding permission type and permission account.
  • the consensus node in the blockchain can obtain the first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries the authority for the target authority type Setting request; the consensus node initiates a consensus operation for the first transaction in the blockchain; Set the authority control smart contract of the authority, set the target authority type in the blockchain, and realize the setting and control of the authority type in the blockchain, so that when a transaction is executed later, it can be determined whether the transaction has the corresponding permission.
  • Fig. 3 is a schematic structural diagram of an authority management and control device 300 in the blockchain provided by the embodiment of this specification.
  • the authority management and control device 300 in the blockchain may include a transaction retrieval module 310, a transaction consensus module 320, and a contract execution module 330, wherein: the transaction retrieval module 310, from the transaction pool Fetch the first transaction, the first transaction is sent by the client, and the first transaction carries a permission setting request for the target permission type; the transaction consensus module 320 initiates a request for the first transaction in the block chain Consensus operation of the transaction; the contract execution module 330, after the first transaction passes the consensus in the block chain, sets the target permission type in the block chain through the authority control smart contract; wherein, the The permission control smart contract is used to set permission based on the permission setting request in the transaction after passing the consensus.
  • the consensus node in the blockchain can obtain the first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carry the authority setting request for the target authority type; the consensus node then initiates a consensus operation for the first transaction in the blockchain; and after the first transaction passes the consensus in the blockchain, it can be used to The permission setting in the subsequent transaction requests to set the permission control smart contract of the permission, set the target permission type in the blockchain, and realize the setting and control of the permission type in the blockchain, so that when a certain transaction is executed later , to determine whether the transaction has the corresponding authority.
  • the device further includes: a first transaction acquisition module, which acquires The second transaction, the second transaction is sent by the client, and the second transaction carries a permission setting request for the permission account of the target permission type; the first transaction consensus module initiates in the block chain For the consensus operation of the second transaction; the first contract execution module, after the second transaction passes the consensus in the blockchain, sets the An authority account of the target authority type; wherein, the authority control smart contract is used to set authority based on the authority setting request in the transaction after passing the consensus.
  • the device before the transaction fetching module 310 fetches the first transaction from the transaction pool, the device further includes: a contract deployment module that deploys an authority management smart contract when creating a genesis block, and the authority management The smart contract is used to set permissions based on the permission setting request; the permission setting module sets and saves the first permission type and/or the permission account of the first permission type through the permission control smart contract; the administrator user creation module creates and manages user.
  • a contract deployment module that deploys an authority management smart contract when creating a genesis block, and the authority management The smart contract is used to set permissions based on the permission setting request; the permission setting module sets and saves the first permission type and/or the permission account of the first permission type through the permission control smart contract; the administrator user creation module creates and manages user.
  • the first transaction is sent by the administrator user through the client; the second transaction is sent by the administrator user through the client.
  • the device further includes: a permission recording module,
  • the state database of the consensus node records the mapping relationship between the target permission type and the permission account of the target permission type.
  • the device further includes: 2.
  • the transaction fishing module which fishes the target transaction sent by the target user from the transaction pool, and the target transaction carries the transaction type of the target transaction;
  • the authority query module queries the transaction type related to the target transaction from the state database Corresponding permission type;
  • permission determination module if there is a permission type corresponding to the transaction type of the target transaction in the permission type of the state database, then based on the mapping relationship, query the transaction type of the target transaction
  • the corresponding authority account determines whether the target user has the authority of the target transaction;
  • the second transaction consensus module if the target user has the authority of the target transaction, initiates a transaction for the target transaction in the block chain The consensus operation of the target transaction.
  • the device further includes: a first execution result return module, which will The permission setting result of the target permission type is returned to the client.
  • the device further includes: a second execution result A return module, returning the setting result of the permission account corresponding to the target permission type to the client.
  • the authority management and control device 300 in the blockchain can implement the methods in the method embodiments shown in FIGS. 1 to 2 .
  • the authority management and control device 300 in the blockchain can implement the methods in the method embodiments shown in FIGS. 1 to 2 .
  • Fig. 4 is a schematic structural diagram of an electronic device provided by an embodiment of this specification.
  • the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory.
  • the memory may include a memory, such as a high-speed random-access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM random-Access Memory
  • non-volatile memory such as at least one disk memory.
  • the electronic device may also include hardware required by other services.
  • the processor, the network interface and the memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture, industry standard architecture) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnection standard) bus or an EISA (Extended Industry Standard Architecture, extended industry standard architecture) bus, etc.
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one double-headed arrow is used in FIG. 4 , but it does not mean that there is only one bus or one type of bus.
  • Memory for storing programs.
  • the program may include program code, and the program code includes computer operation instructions.
  • Storage which can include internal memory and nonvolatile storage, provides instructions and data to the processor.
  • the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming an authority control device in the blockchain on a logical level.
  • the processor executes the program stored in the memory, and is specifically configured to perform the following operations: retrieve a first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries the target authority type Permission setting request; Initiate a consensus operation for the first transaction in the block chain; After the first transaction passes the consensus in the block chain, control the smart contract in the block chain through the authority control Set the target permission type in ; Wherein, the permission control smart contract is used to set permission based on the permission setting request in the transaction after passing the consensus.
  • the consensus node in the blockchain can retrieve the first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries the target permission type Permission setting request; the consensus node then initiates a consensus operation for the first transaction in the blockchain; and after the first transaction passes the consensus in the blockchain, it can be used to Request permission control smart contracts for setting permissions, set the target permission type in the blockchain, and realize the setting and control of permission types in the blockchain, so that when a transaction is executed later, it can be determined whether the transaction has corresponding permissions.
  • the permission management and control method in the blockchain disclosed in the above-mentioned embodiment shown in FIG. 1 of this specification can be applied to a processor, or implemented by a processor.
  • a processor may be an integrated circuit chip with signal processing capabilities.
  • each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
  • the above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processor, DSP), a dedicated integrated Circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the method disclosed in conjunction with one or more embodiments of this specification may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the electronic device can also execute the authority control method in the block chain shown in FIG. 1 , which will not be repeated here in this specification.
  • the electronic equipment in this specification does not exclude other implementations, such as logic devices or the combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, It can also be a hardware or logic device.
  • the embodiment of this specification also proposes a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs include instructions, and the instructions are used when a portable electronic device including multiple application programs When executing, the portable electronic device can be made to execute the method of the embodiment shown in FIG.
  • the management and control smart contract sets the target permission type in the block chain; wherein, the permission management and control smart contract is used to set permissions based on the permission setting request in the transaction after passing the consensus.
  • the consensus node in the blockchain can obtain the first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries the target A permission setting request of the permission type; the consensus node initiates a consensus operation for the first transaction in the blockchain; and after the first transaction passes the consensus in the blockchain, it can be used in transactions based on the consensus
  • the authority setting request sets the authority control smart contract of the authority, sets the target authority type in the blockchain, and realizes the setting and control of the authority type in the blockchain, so that when a certain transaction is executed later, it can be determined. Whether the transaction has the corresponding permissions.
  • a typical implementing device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Combinations of any of these devices.
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

Landscapes

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

Abstract

本说明书公开了一种区块链中的权限管控方法、装置和电子设备,该方法包括:从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;在所述区块链中发起针对所述第一交易的共识操作;在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。

Description

区块链中的权限管控 技术领域
本文件涉及区块链技术领域,尤其涉及一种区块链中的权限管控方法、装置和电子设备。
背景技术
目前,区块链平台对交易没有进行权限管控,即任何用户只要有区块链平的账户即可向区块链平台发送交易进行账户的创建、合约的部署和执行等操作。但是对于某些有多个不同的联盟方机构参与的联盟链,由于不同联盟方机构的需求和权限通常会有所不同,比如有些联盟方机构不允许在联盟链中创建账户,而有些联盟方机构不允许在联盟链中部署合约或者执行某个合约。
而如何对这些具备不同权限的联盟方机构进行准确的权限管控,则需要提供进一步的解决方案。
发明内容
本说明书实施例提供了一种区块链中的权限管控方法、装置和电子设备,以解决现有的区块链平台对交易和对应的交易账户缺乏较为准确的权限管控的问题。
为解决上述技术问题,本说明书实施例是这样实现的。第一方面,提出了一种区块链中的权限管控方法,所述方法应用于区块链中的共识节点,所述方法包括:从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;在所述区块链中发起针对所述第一交易的共识操作;在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
第二方面,提出了一种区块链中的权限管控装置,包括:交易捞取模块,从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;交易共识模块,在所述区块链中发起针对所述第一交易的共识操作;合约执行模块,在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
第三方面,提出了一种电子设备,该电子设备包括处理器以及被安排成存储计算机 可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;在所述区块链中发起针对所述第一交易的共识操作;在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
第四方面,提出了一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行以下操作:从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;在所述区块链中发起针对所述第一交易的共识操作;在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
本说明书实施例采用上述技术方案至少可以达到下述技术效果:采用本说明书实施例提供的权限管控方法,区块链中的共识节点能够从交易池中捞取第一交易,该第一交易由客户端发送,且该第一交易中携带针对目标权限类型的权限设置请求;该共识节点再在区块链中发起针对第一交易的共识操作;以及在第一交易在区块链中通过共识之后,能够通过用于基于通过共识后的交易中的权限设置请求设置权限的权限管控智能合约,在区块链中设置目标权限类型,实现对区块链中的权限类型的设置和管控,使得后续在对某一交易进行执行时,能够确定该交易是否具备对应的权限。
附图说明
此处所说明的附图用来提供对本说明书的进一步理解,构成本说明书的一部分,本说明书的示意性实施例及其说明用于解释本说明书,并不构成对本说明书的不当限定。在附图中:
图1为本说明书一个实施例提供的一种区块链中的权限管控方法的实现流程示意图;
图2为本说明书一个实施例提供的区块链中的权限管控方法应用于实际场景中的流程示意图;
图3为本说明书一个实施例提供的一种区块链中的权限管控装置的结构示意图;
图4为本说明书一个实施例提供的一种电子设备的结构示意图。
具体实施方式
为使本文件的目的、技术方案和优点更加清楚,下面将结合本说明书具体实施例及相应的附图对本说明书技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本文件一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本文件保护的范围。
以下结合附图,详细说明本说明书各实施例提供的技术方案。
为了解决现有的区块链平台对交易和对应的交易账户缺乏较为准确的权限管控的问题,本说明书实施例提供一种区块链中的权限管控方法,采用本说明书实施例提供的权限管控方法,区块链中的共识节点能够从交易池中捞取第一交易,该第一交易由客户端发送,且该第一交易中携带针对目标权限类型的权限设置请求;该共识节点再在区块链中发起针对第一交易的共识操作;以及在第一交易在区块链中通过共识之后,能够通过用于基于通过共识后的交易中的权限设置请求设置权限的权限管控智能合约,在区块链中设置目标权限类型,实现对区块链中的权限类型的设置和管控,使得后续在对某一交易进行执行时,能够确定该交易是否具备对应的权限。
具体地,本说明书一个或多个实施例提供的一种区块链中的权限管控方法应用于区块链中的共识节点的实现流程示意图如图1所示,包括以下步骤。
S110,从交易池中捞取第一交易,该第一交易由客户端发送,且第一交易中携带针对目标权限类型的权限设置请求。
其中,目标权限类型可包括转账交易、创建账户、设置白名单、设置黑名单等权限类型。
本说明书实施例还可以在创建创始区块时即设置一部分权限类型和对应的权限账户,具体地,从交易池中捞取第一交易之前,本说明书实施例提供的方法还包括:在创建创始区块时,部署权限管控智能合约,权限管控智能合约用于基于权限设置请求设置权限;通过权限管控智能合约设置并保存第一权限类型和/或第一权限类型的权限账户;创建管理员用户。
为避免区块链中的权限管控方法被一些恶意的用户所破坏,上述第一交易可由管理员用户通过客户端发送。也就是说,区块链在创建创始区块之后便可以设置管理员用户,该管理员用户具备有设置权限类型和对应的权限账户或更改这些已设置的权限类型和/或已设置的权限类型对应的权限账户的权限,而其他普通用户则不具备这种权限。
S120,在区块链中发起针对第一交易的共识操作。
本说明书实施例对共识操作对应的具体算法不做限定。
S130,在第一交易在区块链中通过共识之后,通过权限管控智能合约在区块链中设置目标权限类型;其中,权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
在通过权限管控智能合约设置目标权限类型之后,区块链中才可以执行目标权限类型对应的交易。以目标权限类型包含转账交易为例,在区块链中设置转账交易的权限类型之前,区块链中不能执行这类交易;而在区块链中设置转账交易的权限类型之后,区块链中才可以执行这类交易。
为便于管理员用户得到目标权限类型的权限设置结果的反馈信息,便于管理员用户对区块链中的权限管控,在通过权限管控智能合约在区块链中设置目标权限类型的权限账户之后,本说明书实施例提供的方法还包括:将针对目标权限类型的权限设置结果返回至客户端。
在设置权限类型之后,还可针对该权限类型设置对应的权限账户,以完善权限管控,提供更精准的权限管控方案。具体地,通过权限管控智能合约在区块链中设置目标权限类型之后,本说明书实施例提供的方法还包括:从交易池中捞取第二交易,该第二交易由客户端发送,且第二交易中携带针对目标权限类型的权限账户的权限设置请求;在区块链中发起针对所述第二交易的共识操作;在第二交易在区块链中通过共识之后,通过权限管控智能合约在区块链中设置目标权限类型的权限账户;其中,权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
针对目标权限类型的权限账户可包括为目标权限类型设置白名单,只有白名单中的权限账户才具备执行目标权限类型对应的交易的权限,针对目标权限类型的权限账户还可包括为目标权限类型设置黑名单,该黑名单中的权限账户不具备执行目标权限类型对应的交易的权限。
比如可以针对转账交易设置能够执行该转账交易的白名单,包括a账户和b账户,也就是说,只有a账户和b账户才可以执行转账交易;也可以针对转账交易设置不能执行该转账交易的黑名单,包括c账户和d账户,也就是说,c账户和d账户不能执行转账交易。
在通过权限管控智能合约在区块链中设置目标权限类型的权限账户之后,为了便于管理员用户及时获取目标权限类型对应的权限账户的设置情况,本说明书实施例提供的方法还包括:将针对目标权限类型对应的权限账户的设置结果返回至客户端。
上述第二交易由于涉及到权限的设置,为避免其他普通账户对权限进行恶意更改,上述第二交易可由管理员用户通过客户端发送。
在通过权限管控智能合约在区块链中设置目标权限类型的权限账户之后,为了便于对后续的交易的权限管控,本说明书实施例提供更多方法还包括:在本共识节点的状态数据库中记录目标权限类型、以及目标权限类型的权限账户之间的映射关系。
比如,可以在本共识节点的状态数据库中记录转账交易、以及转账交易的白名单账户与黑名单账户之间的映射关系。
在本共识节点的状态数据库中记录所述目标权限类型、以及目标权限类型的权限账户之间的映射关系之后,本说明书实施例提供的方法还包括:从交易池中捞取目标用户发送的目标交易,该目标交易中携带目标交易的交易类型;从状态数据库中查询与目标交易的交易类型相对应的权限类型;如果状态数据库的权限类型中存在与目标交易的交易类型相对应的权限类型,则基于映射关系,查询与目标交易的交易类型相对应的权限账户,确定目标用户是否具备目标交易的权限;如果目标用户具备目标交易的权限,则在区块链中发起针对目标交易的共识操作。
下面结合图2所示的应用场景,对本说明书实施例提供的区块链中的权限管控方法进行详细说明。在图2中包含客户端、区块链平台和权限管控智能合约,包括以下步骤。
S21,区块链平台在创始区块创建之后在区块链中部署权限管控智能合约;在部署权限管控智能合约之后便可以设置一些权限类型,还可以设置这些权限类型对应的权限账户,也可以不对这些权限类型对应的权限账户进行设置,也可以只针对这些权限类型中的一个或几个权限类型对应的权限账户进行设置。
为了更好地对区块链中的权限进行管控,本说明书实施例可在创建创始区块之后就设置一个管理员用户的账户,只有该管理员用户才具备设置和更改权限类型和对应的权限账户的权限。
S22,客户端向区块链平台发送设置权限类型的交易;该设置权限类型的交易可由管理员用户通过客户端向区块链平台发送。
比如,管理员用户可通过客户端向区块链平台发送携带针对转账交易的权限类型的设置请求的交易。
S23,区块链中的共识节点发起针对设置权限类型的交易的共识操作;本说明书实施例对共识操作对应具体算法不做限定。
S24,在设置权限类型的交易在所述区块链中达成共识之后,权限管控智能合约设置并保存权限合约。
S25,在区块链中的各个共识节点同步该执行结果;区块链中的各个共识节点可在本共识节点中的状态数据库中保存设置的权限类型。
S26,区块链平台向客户端返回执行结果;比如,区块链平台向客户端返回针对转账交易的权限类型设置成功的结果。
S27,客户端向区块链平台发送设置权限类型对应的权限账户的交易;该设置权限类型对应的权限账户的交易可由管理员用户通过客户端向区块链平台发送。
比如,管理员用户可通过客户端向区块链平台发送携带针对转账交易对应的权限账户包含a账户、b账户和c账户的设置请求的交易。
S28,区块链中的共识节点发起针对设置权限类型对应的权限账户的交易的共识操作。
S29,在设置权限类型对应的权限账户的交易在所述区块链中达成共识之后,权限管控智能合约设置并保存权限类型对应的权限账户。
S210,在区块链中的各个共识节点同步该执行结果;区块链中的各个共识节点可在本共识节点中的状态数据库中保存设置的权限类型对应的权限账户。比如区块链中的各个共识节点可在本共识节点中的状态数据库中保存设置的转账交易与a账户、b账户和c账户之间的映射关系。
S211,区块链平台向客户端返回执行结果;比如,区块链平台向客户端返回针对转账交易的权限账户包含a账户、b账户和c账户设置成功的结果。
S212,客户端向区块链平台发送交易,该交易中携带交易类型和对应的交易账户;比如交易类型为转账交易,交易账户包含a账户和b账户。
S213,区块链中的共识节点检查该交易是否具备对应的权限类型和权限账户。
比如可以从本共识节点中的状态数据库中查询是否已设置转账交易的权限类型,当确定状态数据库中存储有转账交易的权限类型,再确定该转账交易对应的权限账户是否包含a账户和b账户,如果转账交易对应的权限账户包含a账户和b账户,则可以在区块链中发起针对该交易的共识操作,否则返回交易执行失败的结果。
采用本说明书实施例提供的权限管控方法,区块链中的共识节点能够从交易池中捞取第一交易,该第一交易由客户端发送,且该第一交易中携带针对目标权限类型的权限设置请求;该共识节点再在区块链中发起针对第一交易的共识操作;以及在第一交易在区块链中通过共识之后,能够通过用于基于通过共识后的交易中的权限设置请求设置权限的权限管控智能合约,在区块链中设置目标权限类型,实现对区块链中的权限类型的设置和管控,使得后续在对某一交易进行执行时,能够确定该交易是否具备对应的权限。
图3是本说明书实施例提供的区块链中的权限管控装置300的结构示意图。请参考图3,在一种软件实施方式中,区块链中的权限管控装置300可包括交易捞取模块310、交易共识模块320和合约执行模块330,其中:交易捞取模块310,从交易池中捞取第 一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;交易共识模块320,在所述区块链中发起针对所述第一交易的共识操作;合约执行模块330,在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
基于本说明书实施例提供的区块链中的权限管控装置300可以知道:区块链中的共识节点能够从交易池中捞取第一交易,该第一交易由客户端发送,且该第一交易中携带针对目标权限类型的权限设置请求;该共识节点再在区块链中发起针对第一交易的共识操作;以及在第一交易在区块链中通过共识之后,能够通过用于基于通过共识后的交易中的权限设置请求设置权限的权限管控智能合约,在区块链中设置目标权限类型,实现对区块链中的权限类型的设置和管控,使得后续在对某一交易进行执行时,能够确定该交易是否具备对应的权限。
在一种实施方式中,所述合约执行模块330通过权限管控智能合约在所述区块链中设置所述目标权限类型之后,所述装置还包括:第一交易捞取模块,从交易池中捞取第二交易,所述第二交易由所述客户端发送,且所述第二交易中携带针对目标权限类型的权限账户的权限设置请求;第一交易共识模块,在所述区块链中发起针对所述第二交易的共识操作;第一合约执行模块,在所述第二交易在所述区块链中通过共识之后,通过所述权限管控智能合约在所述区块链中设置所述目标权限类型的权限账户;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
在一种实施方式中,所述交易捞取模块310从交易池中捞取第一交易之前,所述装置还包括:合约部署模块,在创建创始区块时,部署权限管控智能合约,所述权限管控智能合约用于基于权限设置请求设置权限;权限设置模块,通过所述权限管控智能合约设置并保存第一权限类型和/或所述第一权限类型的权限账户;管理员用户创建模块,创建管理员用户。
在一种实施方式中,所述第一交易由所述管理员用户通过所述客户端发送;所述第二交易由所述管理员用户通过所述客户端发送。
在一种实施方式中,所述第一合约执行模块通过权限管控智能合约在所述区块链中设置所述目标权限类型对应的权限账户之后,所述装置还包括:权限记录模块,在本共识节点的状态数据库中记录所述目标权限类型、以及所述目标权限类型的权限账户之间的映射关系。
在一种实施方式中,在所述权限记录模块本共识节点的状态数据库中记录所述目标 权限类型、以及所述目标权限类型的权限账户之间的映射关系之后,所述装置还包括:第二交易捞取模块,从交易池中捞取目标用户发送的目标交易,所述目标交易中携带所述目标交易的交易类型;权限查询模块,从所述状态数据库中查询与所述目标交易的交易类型相对应的权限类型;权限确定模块,如果所述状态数据库的权限类型中存在与所述目标交易的交易类型相对应的权限类型,则基于所述映射关系,查询与所述目标交易的交易类型相对应的权限账户,确定所述目标用户是否具备所述目标交易的权限;第二交易共识模块,如果所述目标用户具备所述目标交易的权限,则在所述区块链中发起针对所述目标交易的共识操作。
在一种实施方式中,在所述合约执行模块330通过权限管控智能合约在所述区块链中设置所述目标权限类型之后,所述装置还包括:第一执行结果返回模块,将针对所述目标权限类型的权限设置结果返回至所述客户端。
在一种实施方式中,在所述第一合约执行模块通过所述权限管控智能合约在所述区块链中设置所述目标权限类型的权限账户之后,所述装置还包括:第二执行结果返回模块,将针对所述目标权限类型对应的权限账户的设置结果返回至所述客户端。
区块链中的权限管控装置300能够实现图1~图2的方法实施例的方法,具体可参考图1~图2所示实施例的区块链中的权限管控方法,不再赘述。
图4是本说明书的一个实施例提供的电子设备的结构示意图。请参考图4,在硬件层面,该电子设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该电子设备还可能包括其他业务所需要的硬件。
处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(Extended Industry Standard Architecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图4中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。
存储器,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可以包括内存和非易失性存储器,并向处理器提供指令和数据。
处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成区块链中的权限管控装置。处理器,执行存储器所存放的程序,并具体用于执行以下操作:从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中 携带针对目标权限类型的权限设置请求;在所述区块链中发起针对所述第一交易的共识操作;在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
采用本说明书实施例提供的电子设备可知道,区块链中的共识节点能够从交易池中捞取第一交易,该第一交易由客户端发送,且该第一交易中携带针对目标权限类型的权限设置请求;该共识节点再在区块链中发起针对第一交易的共识操作;以及在第一交易在区块链中通过共识之后,能够通过用于基于通过共识后的交易中的权限设置请求设置权限的权限管控智能合约,在区块链中设置目标权限类型,实现对区块链中的权限类型的设置和管控,使得后续在对某一交易进行执行时,能够确定该交易是否具备对应的权限。
上述如本说明书图1所示实施例揭示的区块链中的权限管控方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本说明书一个或多个实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本说明书一个或多个实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
该电子设备还可执行图1的区块链中的权限管控方法,本说明书在此不再赘述。
当然,除了软件实现方式之外,本说明书的电子设备并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
本说明书实施例还提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序,该一个或多个程序包括指令,该指令当被包括多个应用程序的便携式电 子设备执行时,能够使该便携式电子设备执行图1所示实施例的方法,并具体用于执行以下操作:从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;在所述区块链中发起针对所述第一交易的共识操作;在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
采用本说明书实施例提供的计算机可读存储介质可知道,区块链中的共识节点能够从交易池中捞取第一交易,该第一交易由客户端发送,且该第一交易中携带针对目标权限类型的权限设置请求;该共识节点再在区块链中发起针对第一交易的共识操作;以及在第一交易在区块链中通过共识之后,能够通过用于基于通过共识后的交易中的权限设置请求设置权限的权限管控智能合约,在区块链中设置目标权限类型,实现对区块链中的权限类型的设置和管控,使得后续在对某一交易进行执行时,能够确定该交易是否具备对应的权限。
总之,以上所述仅为本说明书的较佳实施例而已,并非用于限定本说明书的保护范围。凡在本说明书一个或多个实施例的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例的保护范围之内。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包 含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。

Claims (11)

  1. 一种区块链中的权限管控方法,所述方法应用于区块链中的共识节点,所述方法包括:
    从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;
    在所述区块链中发起针对所述第一交易的共识操作;
    在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
  2. 如权利要求1所述的方法,通过权限管控智能合约在所述区块链中设置所述目标权限类型之后,所述方法还包括:
    从交易池中捞取第二交易,所述第二交易由所述客户端发送,且所述第二交易中携带针对目标权限类型的权限账户的权限设置请求;
    在所述区块链中发起针对所述第二交易的共识操作;
    在所述第二交易在所述区块链中通过共识之后,通过所述权限管控智能合约在所述区块链中设置所述目标权限类型的权限账户;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
  3. 如权利要求2所述的方法,从交易池中捞取第一交易之前,所述方法还包括:
    在创建创始区块时,部署权限管控智能合约,所述权限管控智能合约用于基于权限设置请求设置权限;
    通过所述权限管控智能合约设置并保存第一权限类型和/或所述第一权限类型的权限账户;
    创建管理员用户。
  4. 如权利要求3所述的方法,
    所述第一交易由所述管理员用户通过所述客户端发送;
    所述第二交易由所述管理员用户通过所述客户端发送。
  5. 如权利要求2所述的方法,在通过所述权限管控智能合约在所述区块链中设置所述目标权限类型的权限账户之后,所述方法还包括:
    在本共识节点的状态数据库中记录所述目标权限类型、以及所述目标权限类型的权限账户之间的映射关系。
  6. 如权利要求5所述的方法,在本共识节点的状态数据库中记录所述目标权限类 型、以及所述目标权限类型的权限账户之间的映射关系之后,所述方法还包括:
    从交易池中捞取目标用户发送的目标交易,所述目标交易中携带所述目标交易的交易类型;
    从所述状态数据库中查询与所述目标交易的交易类型相对应的权限类型;
    如果所述状态数据库的权限类型中存在与所述目标交易的交易类型相对应的权限类型,则基于所述映射关系,查询与所述目标交易的交易类型相对应的权限账户,确定所述目标用户是否具备所述目标交易的权限;
    如果所述目标用户具备所述目标交易的权限,则在所述区块链中发起针对所述目标交易的共识操作。
  7. 如权利要求1所述的方法,在通过权限管控智能合约在所述区块链中设置所述目标权限类型之后,所述方法还包括:
    将针对所述目标权限类型的权限设置结果返回至所述客户端。
  8. 如权利要求2所述的方法,在通过所述权限管控智能合约在所述区块链中设置所述目标权限类型的权限账户之后,所述方法还包括:
    将针对所述目标权限类型对应的权限账户的设置结果返回至所述客户端。
  9. 一种区块链中的权限管控装置,包括:
    交易捞取模块,从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;
    交易共识模块,在所述区块链中发起针对所述第一交易的共识操作;
    合约执行模块,在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
  10. 一种电子设备,该电子设备包括:
    处理器;以及
    被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:
    从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;
    在所述区块链中发起针对所述第一交易的共识操作;
    在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易 中的权限设置请求设置权限。
  11. 一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被包括多个应用程序的电子设备执行时,使得所述电子设备执行以下操作:
    从交易池中捞取第一交易,所述第一交易由客户端发送,且所述第一交易中携带针对目标权限类型的权限设置请求;
    在所述区块链中发起针对所述第一交易的共识操作;
    在所述第一交易在所述区块链中通过共识之后,通过权限管控智能合约在所述区块链中设置所述目标权限类型;其中,所述权限管控智能合约用于基于通过共识后的交易中的权限设置请求设置权限。
PCT/CN2022/109840 2021-09-24 2022-08-03 区块链中的权限管控 WO2023045575A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111123541.XA CN113761581A (zh) 2021-09-24 2021-09-24 区块链中的权限管控方法、装置和电子设备
CN202111123541.X 2021-09-24

Publications (1)

Publication Number Publication Date
WO2023045575A1 true WO2023045575A1 (zh) 2023-03-30

Family

ID=78797324

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/109840 WO2023045575A1 (zh) 2021-09-24 2022-08-03 区块链中的权限管控

Country Status (2)

Country Link
CN (1) CN113761581A (zh)
WO (1) WO2023045575A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113761581A (zh) * 2021-09-24 2021-12-07 支付宝(杭州)信息技术有限公司 区块链中的权限管控方法、装置和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180089256A1 (en) * 2013-09-23 2018-03-29 David D. Wright, SR. Management Of Entitlements Using Blockchain
CN111383031A (zh) * 2020-05-29 2020-07-07 支付宝(杭州)信息技术有限公司 一种区块链中的智能合约执行方法、系统和电子设备
CN112822159A (zh) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 区块链账户的权限控制方法、装置、电子设备和存储介质
CN113761581A (zh) * 2021-09-24 2021-12-07 支付宝(杭州)信息技术有限公司 区块链中的权限管控方法、装置和电子设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018120121A1 (zh) * 2016-12-30 2018-07-05 深圳前海达闼云端智能科技有限公司 区块链权限控制方法、装置及节点设备
CN110008665B (zh) * 2019-03-05 2024-02-06 深圳前海微众银行股份有限公司 一种区块链的权限控制方法及装置
CN110807188A (zh) * 2019-11-12 2020-02-18 北京芯际科技有限公司 一种基于区块链的权限管理方法及系统
CN111383120A (zh) * 2020-05-29 2020-07-07 支付宝(杭州)信息技术有限公司 基于区块链的资产管理方法、装置及电子设备
CN113055190B (zh) * 2021-06-02 2021-07-30 支付宝(杭州)信息技术有限公司 针对客户端的访问控制方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180089256A1 (en) * 2013-09-23 2018-03-29 David D. Wright, SR. Management Of Entitlements Using Blockchain
CN111383031A (zh) * 2020-05-29 2020-07-07 支付宝(杭州)信息技术有限公司 一种区块链中的智能合约执行方法、系统和电子设备
CN112822159A (zh) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 区块链账户的权限控制方法、装置、电子设备和存储介质
CN113761581A (zh) * 2021-09-24 2021-12-07 支付宝(杭州)信息技术有限公司 区块链中的权限管控方法、装置和电子设备

Also Published As

Publication number Publication date
CN113761581A (zh) 2021-12-07

Similar Documents

Publication Publication Date Title
US20210049608A1 (en) Transaction method and system based on centralized clearing and blockchain record keeping
US11042876B2 (en) Transaction method and system based on centralized settlement and blockchain deposit certificates
US20210049595A1 (en) Transaction method and system based on centralized settlement and block chain storage
US10789244B1 (en) Asset management system, method, apparatus, and electronic device
US20210160252A1 (en) Cross-blockchain interaction systems
US11200226B2 (en) Data read and write method and apparatus, and electronic device
US11626972B2 (en) Data processing method and apparatus
TWI715217B (zh) 基於區塊鏈的螢幕錄製取證方法、系統和電子設備
US11138323B2 (en) Blockchain-based content management system, method, apparatus, and electronic device
US11093558B2 (en) Providing accountability of blockchain queries
US20210149882A1 (en) Field update method and apparatus, and electronic device
TWI722592B (zh) 資料結構的讀取及更新方法、裝置、電子設備
US11354447B2 (en) Data authorization information acquisition methods, apparatuses, and devices
TWI724570B (zh) 資料結構的讀取及更新方法、裝置、電子設備及儲存媒體
WO2020108152A1 (zh) 身份数据的防误用方法及装置、电子设备
WO2023045575A1 (zh) 区块链中的权限管控
CN109145621B (zh) 文档管理方法及装置
CN115174158B (zh) 基于多云管理平台的云产品配置检查方法
WO2020108055A1 (zh) 一种基于多个区块链网络的数据读取方法及系统
US9600508B1 (en) Data layer service availability
US11663310B2 (en) Entitlement system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22871633

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE