CN113761581A - Authority control method and device in block chain and electronic equipment - Google Patents

Authority control method and device in block chain and electronic equipment Download PDF

Info

Publication number
CN113761581A
CN113761581A CN202111123541.XA CN202111123541A CN113761581A CN 113761581 A CN113761581 A CN 113761581A CN 202111123541 A CN202111123541 A CN 202111123541A CN 113761581 A CN113761581 A CN 113761581A
Authority
CN
China
Prior art keywords
transaction
authority
target
type
blockchain
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
CN202111123541.XA
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.)
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd, Ant Blockchain Technology Shanghai Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202111123541.XA priority Critical patent/CN113761581A/en
Publication of CN113761581A publication Critical patent/CN113761581A/en
Priority to PCT/CN2022/109840 priority patent/WO2023045575A1/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/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

Abstract

The specification discloses a method and a device for managing and controlling authority in a block chain and electronic equipment, wherein the method comprises the following steps: a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type; initiating a consensus operation for the first transaction in the blockchain; after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.

Description

Authority control method and device in block chain and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for controlling permissions in a blockchain, and an electronic device.
Background
At present, the blockchain platform does not perform authority control on the transaction, that is, any user can send the transaction to the blockchain platform to perform operations such as account creation, contract deployment and execution as long as the user has a blockchain flat account. However, for some federation chains with multiple different federation party enterprises, the requirements and rights of different federation party enterprises may often differ, such as some federation party enterprises not allowing an account to be created in the federation chain and some federation party enterprises not allowing a contract to be deployed or executed in the federation chain.
However, how to accurately manage and control the authority of the alliance parties with different authorities needs to provide a further solution.
Disclosure of Invention
The embodiment of the specification provides a method and a device for authority control in a block chain and electronic equipment, and aims to solve the problem that an existing block chain platform lacks accurate authority control on transactions and corresponding transaction accounts.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
in a first aspect, a method for managing and controlling permissions in a blockchain is provided, where the method is applied to a consensus node in the blockchain, and the method includes:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
In a second aspect, an apparatus for managing and controlling permissions in a blockchain is provided, including:
the system comprises a transaction fetching module, a first transaction processing module and a second transaction processing module, wherein the transaction fetching module fetches a first transaction from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
a transaction consensus module that initiates a consensus operation for the first transaction in the blockchain;
a contract execution module that sets the target privilege type in the blockchain through a privilege management and control intelligence contract after the first transaction passes consensus in the blockchain; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
In a third aspect, an electronic device is provided, which includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
In a fourth aspect, a computer-readable storage medium is presented, the computer-readable storage medium storing one or more programs that, when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
The embodiment of the specification can achieve at least the following technical effects by adopting the technical scheme:
by adopting the authority control method provided by the embodiment of the specification, the common identification node in the block chain can be used for fishing out a first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries an authority setting request aiming at a target authority type; the consensus node initiates a consensus operation aiming at the first transaction in the block chain; after the first transaction passes the consensus in the blockchain, the permission control intelligent contract used for setting the permission based on the permission setting request in the transaction after passing the consensus is used, the target permission type is set in the blockchain, and the setting and the control of the permission type in the blockchain are realized, so that whether the transaction has the corresponding permission or not can be determined when a certain transaction is executed subsequently.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
fig. 1 is a schematic flow chart of an implementation of a method for managing and controlling permissions in a block chain according to an embodiment of the present specification;
fig. 2 is a schematic flowchart illustrating a flow of applying the method for managing and controlling permissions in a block chain provided in an embodiment of the present specification to an actual scene;
fig. 3 is a schematic structural diagram of a privilege management apparatus in a block chain according to an embodiment of the present specification;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the purpose, technical solutions and advantages of this document more clear, the technical solutions of this specification will be clearly and completely described below with reference to specific embodiments of this specification and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of this document, and not all embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in this description belong to the protection scope of this document.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
In order to solve the problem that an existing blockchain platform lacks accurate authority control over transactions and corresponding transaction accounts, an embodiment of the specification provides an authority control method in a blockchain, and by adopting the authority control method provided by the embodiment of the specification, a common node in the blockchain can obtain a first transaction from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type; the consensus node initiates a consensus operation aiming at the first transaction in the block chain; after the first transaction passes the consensus in the blockchain, the permission control intelligent contract used for setting the permission based on the permission setting request in the transaction after passing the consensus is used, the target permission type is set in the blockchain, and the setting and the control of the permission type in the blockchain are realized, so that whether the transaction has the corresponding permission or not can be determined when a certain transaction is executed subsequently.
Specifically, an implementation flow diagram of a method for managing and controlling permissions in a blockchain, which is provided by one or more embodiments of the present specification and applied to a consensus node in the blockchain, is shown in fig. 1, and includes:
s110, a first transaction is fished from the transaction pool, the first transaction is sent by the client, and the first transaction carries an authority setting request aiming at the target authority type.
The target authority types can include authority types such as transfer transaction, account creation, white list setting, black list setting and the like.
Optionally, in this embodiment of the present specification, when creating the starting block, a part of the authority types and the corresponding authority accounts may be set, specifically, before the first transaction is retrieved from the transaction pool, the method provided in this embodiment of the present specification further includes:
when a starting block is created, deploying a permission control intelligent contract, wherein the permission control intelligent contract is used for setting permission based on a permission setting request;
setting and storing a first authority type and/or an authority account of the first authority type through an authority control intelligent contract;
an administrator user is created.
Optionally, in order to avoid that the method for managing and controlling permissions in the blockchain is damaged by some malicious users, the first transaction may be sent by the administrator user through the client. That is, after creating the starting block, the block chain may set an administrator user, where the administrator user has an authority to set the authority type and the corresponding authority account or change the set authority type and/or the authority account corresponding to the set authority type, and other general users do not have such authority.
And S120, initiating a consensus operation aiming at the first transaction in the block chain.
Optionally, the embodiment of the present specification does not limit a specific algorithm corresponding to the consensus operation.
S130, after the first transaction passes the consensus in the block chain, setting a target permission type in the block chain through a permission management and control intelligent contract; the authority control intelligent contract is used for setting the authority based on the authority setting request in the transaction after consensus.
Optionally, after the target permission type is set by the permission management and control intelligent contract, the transaction corresponding to the target permission type may be executed in the block chain. Taking the example that the target authority type contains the transfer transaction, before the authority type of the transfer transaction is set in the block chain, the block chain cannot execute the transaction; and after the authority type of the transfer transaction is set in the blockchain, the transaction can be executed in the blockchain.
Optionally, in order to facilitate an administrator user to obtain feedback information of an authority setting result of a target authority type, and facilitate the administrator user to manage and control the authority in the block chain, after an authority account of the target authority type is set in the block chain through an authority management and control intelligent contract, the method provided in the embodiment of the present specification further includes:
and returning the permission setting result aiming at the target permission type to the client.
Optionally, after the permission type is set, a corresponding permission account may be set for the permission type to perfect permission management and control and provide a more accurate permission management and control scheme. Specifically, after a target permission type is set in a block chain by a permission management and control intelligent contract, the method provided in the embodiment of the present specification further includes:
a second transaction is fished from the transaction pool, the second transaction is sent by the client, and the second transaction carries an authority setting request aiming at the authority account of the target authority type;
initiating a consensus operation for the second transaction in a blockchain;
after the second transaction passes the consensus in the blockchain, setting an authority account of a target authority type in the blockchain through an authority control intelligent contract; the authority control intelligent contract is used for setting the authority based on the authority setting request in the transaction after consensus.
The permission account for the target permission type may include setting a white list for the target permission type, only the permission account in the white list has a permission to execute the transaction corresponding to the target permission type, and the permission account for the target permission type may further include setting a black list for the target permission type, where the permission account in the black list does not have a permission to execute the transaction corresponding to the target permission type.
For example, a white list capable of executing the transfer transaction may be set for the transfer transaction, including the account a and the account b, that is, only the account a and the account b may execute the transfer transaction; a blacklist, including the c-account and the d-account, on which the transfer transaction cannot be performed, may also be set for the transfer transaction, that is, the c-account and the d-account cannot perform the transfer transaction.
Optionally, after setting the authority account of the target authority type in the block chain through the authority management and control intelligent contract, in order to facilitate an administrator user to obtain a setting condition of the authority account corresponding to the target authority type in time, the method provided in the embodiment of the present specification further includes:
and returning the setting result of the authority account corresponding to the target authority type to the client.
Optionally, the second transaction relates to setting of the authority, and in order to avoid malicious modification of the authority by another general account, the second transaction may be sent by the administrator user through the client.
Optionally, after setting the authority account of the target authority type in the block chain by the authority management intelligent contract, in order to facilitate authority management of subsequent transactions, the embodiments of the present specification provide further methods further including:
and recording the target authority type and the mapping relation between the authority accounts of the target authority type in a state database of the consensus node.
For example, the transfer transaction and the mapping relationship between the white list account and the black list account of the transfer transaction can be recorded in the state database of the consensus node
Optionally, after the state database of the consensus node records the target authority type and the mapping relationship between the authority accounts of the target authority type, the method provided in the embodiment of the present specification further includes:
the target transaction sent by the target user is fished from the transaction pool, and the target transaction carries the transaction type of the target transaction;
inquiring an authority type corresponding to the transaction type of the target transaction from a state database;
if the authority type corresponding to the transaction type of the target transaction exists in the authority types of the state database, inquiring an authority account corresponding to the transaction type of the target transaction based on the mapping relation, and determining whether the target user has the authority of the target transaction;
and if the target user has the authority of the target transaction, initiating a consensus operation aiming at the target transaction in the block chain.
The following describes in detail a method for managing and controlling permissions in a block chain according to an embodiment of the present disclosure with reference to an application scenario shown in fig. 2. Fig. 2 includes a client, a blockchain platform, and an intelligent contract for rights management, including:
s21, the blockchain platform deploys the intelligent contract for authority control in the blockchain after the creation of the starting block;
after the authority control intelligent contract is deployed, some authority types can be set, authority accounts corresponding to the authority types can be set, the authority accounts corresponding to the authority types can not be set, and the authority accounts corresponding to one or more of the authority types can be set.
In order to better manage and control the permissions in the blockchain, the embodiments of the present specification may set an account of an administrator user after creating the starting block, and only the administrator user has the permission to set and change the permission type and the corresponding permission account.
S22, the client sends the transaction with the set authority type to the blockchain platform;
the set permission type transaction may be sent by an administrator user to the blockchain platform through a client.
For example, an administrator user may send a transaction to the blockchain platform through a client that carries a set request for the type of authority for the transfer transaction.
S23, the consensus node in the block chain initiates consensus operation aiming at the transaction of the set authority type;
the embodiment of the present specification does not limit the specific algorithm corresponding to the consensus operation.
S24, after the transaction with the set authority type reaches consensus in the block chain, the authority control intelligent contract sets and stores the authority contract;
s25, synchronizing the execution result at each consensus node in the block chain;
each consensus node in the block chain may store the set permission type in a state database in the consensus node.
S26, the block chain platform returns the execution result to the client;
for example, the blockchain platform returns a result that the permission type setting for the transfer transaction is successful to the client.
S27, the client sends the transaction of the authority account corresponding to the set authority type to the block chain platform;
the transaction of the authority account corresponding to the set authority type can be sent to the blockchain platform by the administrator user through the client.
For example, an administrator user may send a transaction carrying a setting request including an account a, an account b, and an account c for an authority account corresponding to a transfer transaction to the blockchain platform through the client.
S28, the consensus node in the block chain initiates a consensus operation aiming at the transaction of the authority account corresponding to the set authority type;
s29, after the transaction of the authority account corresponding to the set authority type reaches consensus in the block chain, the authority control intelligent contract sets and stores the authority account corresponding to the authority type;
s210, synchronizing the execution result at each consensus node in the block chain;
each consensus node in the block chain can store the authority account corresponding to the set authority type in a state database in the consensus node. For example, each consensus node in the blockchain may maintain a mapping between the set transfer transaction and the a, b, and c accounts in a status database in the consensus node.
S211, the block chain platform returns an execution result to the client;
for example, the blockchain platform returns the result that the setting of the authority account for the transfer transaction comprises the account a, the account b and the account c to the client successfully.
S212, the client sends a transaction to the blockchain platform, wherein the transaction carries a transaction type and a corresponding transaction account;
for example, the transaction type is a transfer transaction, and the transaction account comprises an account a and an account b.
S213, the consensus node in the block chain checks whether the transaction has the corresponding authority type and authority account.
For example, whether the authority type of the transfer transaction is set or not can be inquired from a state database in the consensus node, when the authority type of the transfer transaction is determined to be stored in the state database, whether the authority account corresponding to the transfer transaction comprises an account a and an account b or not is determined, if the authority account corresponding to the transfer transaction comprises the account a and the account b, consensus operation aiming at the transaction can be initiated in a block chain, and otherwise, a result of transaction execution failure is returned.
By adopting the authority control method provided by the embodiment of the specification, the common identification node in the block chain can be used for fishing out a first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries an authority setting request aiming at a target authority type; the consensus node initiates a consensus operation aiming at the first transaction in the block chain; after the first transaction passes the consensus in the blockchain, the permission control intelligent contract used for setting the permission based on the permission setting request in the transaction after passing the consensus is used, the target permission type is set in the blockchain, and the setting and the control of the permission type in the blockchain are realized, so that whether the transaction has the corresponding permission or not can be determined when a certain transaction is executed subsequently.
Fig. 3 is a schematic structural diagram of a rights management unit 300 in a block chain according to an embodiment of the present disclosure. Referring to fig. 3, in a software implementation, the privilege management apparatus 300 in a block chain may include a transaction fetching module 310, a transaction consensus module 320, and a contract execution module 330, where:
the transaction fetching module 310 fetches a first transaction from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request for a target authority type;
a transaction consensus module 320 that initiates a consensus operation for the first transaction in the blockchain;
a contract execution module 330 that sets the target privilege type in the blockchain by a privilege management intelligence contract after the first transaction passes consensus in the blockchain; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
The apparatus 300 for regulating authority in a block chain provided based on the embodiments of the present specification can know that:
a common node in a block chain can obtain a first transaction from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type; the consensus node initiates a consensus operation aiming at the first transaction in the block chain; after the first transaction passes the consensus in the blockchain, the permission control intelligent contract used for setting the permission based on the permission setting request in the transaction after passing the consensus is used, the target permission type is set in the blockchain, and the setting and the control of the permission type in the blockchain are realized, so that whether the transaction has the corresponding permission or not can be determined when a certain transaction is executed subsequently.
Optionally, in an embodiment, after the contract execution module 330 sets the target permission type in the blockchain through a permission management intelligence, the apparatus further includes:
the first transaction fetching module fetches a second transaction from a transaction pool, the second transaction is sent by the client, and the second transaction carries an authority setting request aiming at an authority account of a target authority type;
a first transaction consensus module that initiates a consensus operation for the second transaction in the blockchain;
a first contract execution module that, after the second transaction passes consensus in the blockchain, restricts, by the entitlement control intelligence, an entitlement account in the blockchain that sets the target entitlement type; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
Optionally, in an embodiment, before the transaction fishing module 310 fishes the first transaction from the transaction pool, the apparatus further includes:
the contract deployment module is used for deploying an authority control intelligent contract when the starting block is created, wherein the authority control intelligent contract is used for setting authority based on an authority setting request;
the authority setting module is used for setting and storing a first authority type and/or an authority account of the first authority type through the authority control intelligent contract;
and the administrator user creating module is used for creating administrator users.
Optionally, in one embodiment, the first transaction is sent by the administrator user through the client;
the second transaction is sent by the administrator user through the client.
Optionally, in an embodiment, after the first contract execution module sets, through an authority management intelligence, an authority account corresponding to the target authority type in the blockchain, the apparatus further includes:
and the authority recording module is used for recording the target authority type and the mapping relation between the authority accounts of the target authority type in a state database of the consensus node.
Optionally, in an embodiment, after the rights recording module records the mapping relationship between the target rights type and the rights account of the target rights type in the status database of the consensus node, the apparatus further includes:
the second transaction fetching module is used for fetching a target transaction sent by a target user from a transaction pool, wherein the target transaction carries the transaction type of the target transaction;
the authority inquiry module inquires an authority type corresponding to the transaction type of the target transaction from the state database;
the authority determining module is used for inquiring an authority account corresponding to the transaction type of the target transaction based on the mapping relation and determining whether the target user has the authority of the target transaction if the authority type corresponding to the transaction type of the target transaction exists in the authority types of the state database;
and the second transaction consensus module initiates consensus operation aiming at the target transaction in the block chain if the target user has the authority of the target transaction.
Optionally, in an embodiment, after the contract execution module 330 sets the target permission type in the blockchain through a permission management intelligent contract, the apparatus further includes:
and the first execution result returning module returns the permission setting result aiming at the target permission type to the client.
Optionally, in an embodiment, after the first contract execution module sets the authority account of the target authority type in the block chain through the authority management intelligence, the apparatus further includes:
and the second execution result returning module returns the setting result of the authority account corresponding to the target authority type to the client.
The permission management and control device 300 in the block chain can implement the method in the embodiment of the method in fig. 1 to fig. 2, and specifically refer to the permission management and control method in the block chain in the embodiment shown in fig. 1 to fig. 2, which is not described again.
Fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification. Referring to fig. 4, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the nonvolatile memory to the memory and then runs the computer program to form the authority control device in the block chain on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
By adopting the electronic equipment provided by the embodiment of the specification, the common identification node in the block chain can obtain a first transaction from the transaction pool, the first transaction is sent by the client, and the first transaction carries the permission setting request aiming at the target permission type; the consensus node initiates a consensus operation aiming at the first transaction in the block chain; after the first transaction passes the consensus in the blockchain, the permission control intelligent contract used for setting the permission based on the permission setting request in the transaction after passing the consensus is used, the target permission type is set in the blockchain, and the setting and the control of the permission type in the blockchain are realized, so that whether the transaction has the corresponding permission or not can be determined when a certain transaction is executed subsequently.
The method for managing permissions in a block chain as disclosed in the embodiment shown in fig. 1 of this specification may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method for managing and controlling permissions in the block chain of fig. 1, which is not described herein again.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, and in particular to perform the following:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
By using the computer-readable storage medium provided by the embodiment of the present specification, it can be known that a consensus node in a blockchain can retrieve a first transaction from a transaction pool, where the first transaction is sent by a client and carries an authority setting request for a target authority type; the consensus node initiates a consensus operation aiming at the first transaction in the block chain; after the first transaction passes the consensus in the blockchain, the permission control intelligent contract used for setting the permission based on the permission setting request in the transaction after passing the consensus is used, the target permission type is set in the blockchain, and the setting and the control of the permission type in the blockchain are realized, so that whether the transaction has the corresponding permission or not can be determined when a certain transaction is executed subsequently.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present disclosure should be included in the scope of protection of one or more embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (11)

1. A method for managing and controlling authority in a blockchain is applied to a consensus node in the blockchain, and comprises the following steps:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
2. The method of claim 1, after setting the target privilege type in the blockchain by a privilege management intelligence, the method further comprising:
a second transaction is fished from a transaction pool, the second transaction is sent by the client, and the second transaction carries an authority setting request aiming at an authority account of a target authority type;
initiating a consensus operation for the second transaction in the blockchain;
after the second transaction passes consensus in the blockchain, setting an entitlement account of the target entitlement type in the blockchain by the entitlement management control intelligence; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
3. The method of claim 2, prior to fishing the first transaction from the transaction pool, the method further comprising:
when a starting block is created, deploying a permission management and control intelligent contract, wherein the permission management and control intelligent contract is used for setting permission based on a permission setting request;
setting and storing a first authority type and/or an authority account of the first authority type through the authority control intelligent contract;
an administrator user is created.
4. The method of claim 3, wherein the first and second light sources are selected from the group consisting of a red light source, a green light source, and a blue light source,
the first transaction is sent by the administrator user through the client;
the second transaction is sent by the administrator user through the client.
5. The method of claim 2, after setting the privilege account of the target privilege type in the blockchain by the privilege management intelligence, the method further comprising:
and recording the mapping relation between the target authority type and the authority account of the target authority type in a state database of the consensus node.
6. The method as claimed in claim 5, after recording the mapping relationship between the target permission type and the permission account of the target permission type in the status database of the present consensus node, the method further comprises:
the method comprises the steps that target transactions sent by target users are fished from a transaction pool, and the target transactions carry transaction types of the target transactions;
inquiring an authority type corresponding to the transaction type of the target transaction from the state database;
if the authority type corresponding to the transaction type of the target transaction exists in the authority types of the state database, inquiring an authority account corresponding to the transaction type of the target transaction based on the mapping relation, and determining whether the target user has the authority of the target transaction;
and if the target user has the authority of the target transaction, initiating a consensus operation aiming at the target transaction in the block chain.
7. The method of claim 1, after setting the target privilege type in the blockchain by a privilege management intelligence contract, the method further comprising:
and returning the permission setting result aiming at the target permission type to the client.
8. The method of claim 2, after setting the privilege account of the target privilege type in the blockchain by the privilege management intelligence, the method further comprising:
and returning the setting result of the authority account corresponding to the target authority type to the client.
9. An apparatus for managing permissions in a blockchain, comprising:
the system comprises a transaction fetching module, a first transaction processing module and a second transaction processing module, wherein the transaction fetching module fetches a first transaction from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
a transaction consensus module that initiates a consensus operation for the first transaction in the blockchain;
a contract execution module that sets the target privilege type in the blockchain through a privilege management and control intelligence contract after the first transaction passes consensus in the blockchain; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
10. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
11. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to:
a first transaction is fished from a transaction pool, the first transaction is sent by a client, and the first transaction carries an authority setting request aiming at a target authority type;
initiating a consensus operation for the first transaction in the blockchain;
after the first transaction passes consensus in the blockchain, setting the target permission type in the blockchain by a permission management intelligence rule; the authority control intelligent contract is used for setting authority based on the authority setting request in the transaction after consensus.
CN202111123541.XA 2021-09-24 2021-09-24 Authority control method and device in block chain and electronic equipment Pending CN113761581A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111123541.XA CN113761581A (en) 2021-09-24 2021-09-24 Authority control method and device in block chain and electronic equipment
PCT/CN2022/109840 WO2023045575A1 (en) 2021-09-24 2022-08-03 Permission management and control in blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111123541.XA CN113761581A (en) 2021-09-24 2021-09-24 Authority control method and device in block chain and electronic equipment

Publications (1)

Publication Number Publication Date
CN113761581A true CN113761581A (en) 2021-12-07

Family

ID=78797324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111123541.XA Pending CN113761581A (en) 2021-09-24 2021-09-24 Authority control method and device in block chain and electronic equipment

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045575A1 (en) * 2021-09-24 2023-03-30 蚂蚁区块链科技(上海)有限公司 Permission management and control in blockchain

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106796685A (en) * 2016-12-30 2017-05-31 深圳前海达闼云端智能科技有限公司 Block chain authority control method and device and node equipment
CN110008665A (en) * 2019-03-05 2019-07-12 深圳前海微众银行股份有限公司 A kind of authority control method and device of block chain
CN110807188A (en) * 2019-11-12 2020-02-18 北京芯际科技有限公司 Authority management method and system based on block chain
CN111383120A (en) * 2020-05-29 2020-07-07 支付宝(杭州)信息技术有限公司 Asset management method and device based on block chain and electronic equipment
CN112822159A (en) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 Permission control method and device for block chain account, electronic equipment and storage medium
CN113055190A (en) * 2021-06-02 2021-06-29 支付宝(杭州)信息技术有限公司 Access control method for client

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10872077B2 (en) * 2013-09-23 2020-12-22 David D. Wright, SR. Management of entitlements using blockchain
CN111383031B (en) * 2020-05-29 2020-09-22 支付宝(杭州)信息技术有限公司 Intelligent contract execution method and system in block chain and electronic equipment
CN113761581A (en) * 2021-09-24 2021-12-07 支付宝(杭州)信息技术有限公司 Authority control method and device in block chain and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106796685A (en) * 2016-12-30 2017-05-31 深圳前海达闼云端智能科技有限公司 Block chain authority control method and device and node equipment
CN110008665A (en) * 2019-03-05 2019-07-12 深圳前海微众银行股份有限公司 A kind of authority control method and device of block chain
CN110807188A (en) * 2019-11-12 2020-02-18 北京芯际科技有限公司 Authority management method and system based on block chain
CN111383120A (en) * 2020-05-29 2020-07-07 支付宝(杭州)信息技术有限公司 Asset management method and device based on block chain and electronic equipment
CN112822159A (en) * 2020-12-28 2021-05-18 杭州趣链科技有限公司 Permission control method and device for block chain account, electronic equipment and storage medium
CN113055190A (en) * 2021-06-02 2021-06-29 支付宝(杭州)信息技术有限公司 Access control method for client

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045575A1 (en) * 2021-09-24 2023-03-30 蚂蚁区块链科技(上海)有限公司 Permission management and control in blockchain

Also Published As

Publication number Publication date
WO2023045575A1 (en) 2023-03-30

Similar Documents

Publication Publication Date Title
CN110032880B (en) Screen recording evidence obtaining method and system based on block chain and electronic equipment
US11626972B2 (en) Data processing method and apparatus
CN110035105B (en) Screen recording evidence obtaining method and system based on block chain and electronic equipment
US10812477B2 (en) Blockchain-based enterprise authentication method, apparatus, and device, and blockchain-based authentication traceability method, apparatus, and device
CN109669709B (en) Data migration method and data migration system for block chain upgrading
WO2015043420A1 (en) Permission control method and device
CN111415158B (en) Wind control method and system based on block chain
CN110020544B (en) Hash information processing method and system for storage record in block of block chain
CN110557445A (en) Access request routing method and device, storage medium and electronic equipment
CN111260469A (en) Block chain-based evidence storing method, block chain-based evidence storing query method, corresponding device and electronic equipment
CN113205416A (en) Service processing method and system based on block chain prediction machine
CN110851207B (en) State transition management method and device, electronic equipment and storage medium
CN113761581A (en) Authority control method and device in block chain and electronic equipment
CN109145621B (en) Document management method and device
CN108647102B (en) Service request processing method and device of heterogeneous system and electronic equipment
US9665732B2 (en) Secure Download from internet marketplace
CN111259429A (en) Resource operation authority control method and device and electronic equipment
CN111310137A (en) Block chain associated data evidence storing method and device and electronic equipment
CN109063967B (en) Processing method and device for wind control scene feature tensor and electronic equipment
CN112866265B (en) CSRF attack protection method and device
CN111523138B (en) Method, device and system for protecting private data and electronic equipment
CN112487497A (en) Method and device for managing off-link files based on intelligent contracts and electronic equipment
CN113485758A (en) Micro-service issuing method and device, electronic equipment and storage medium
CN112905984A (en) Authority control method and device and electronic equipment
CN114528264A (en) Data synchronization method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination