WO2020224249A1 - 基于区块链的事务处理方法、装置、设备及存储介质 - Google Patents
基于区块链的事务处理方法、装置、设备及存储介质 Download PDFInfo
- Publication number
- WO2020224249A1 WO2020224249A1 PCT/CN2019/121996 CN2019121996W WO2020224249A1 WO 2020224249 A1 WO2020224249 A1 WO 2020224249A1 CN 2019121996 W CN2019121996 W CN 2019121996W WO 2020224249 A1 WO2020224249 A1 WO 2020224249A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- service terminal
- target keyword
- transaction processing
- keyword key
- transaction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/524—Deadlock detection or avoidance
Definitions
- This application relates to the field of blockchain technology, in particular to a blockchain-based transaction processing method, device, equipment, and computer-readable storage medium.
- Blockchain can generally be understood as a distributed ledger, and its essence is also a distributed database, and its bottom layer uses a persistent key value Key-Value Database.
- Key-Value Database a persistent key value
- the main purpose of this application is to provide a blockchain-based transaction processing method, device, equipment, and computer-readable storage medium, aiming to solve the existing technical problems that are prone to confusion and conflicts of high-concurrency data.
- this application provides a blockchain-based transaction processing method, wherein the blockchain-based transaction processing method includes the following steps:
- target keyword Key If the target keyword Key is not in an occupied state, write corresponding transaction data into the blockchain according to the target keyword Key;
- the corresponding writing success information is returned to the service terminal, and the distributed lock corresponding to the target keyword Key is allocated to the service terminal for the service terminal to pass through The distributed lock executes the corresponding exclusive transaction.
- the corresponding writing success information is returned to the service terminal, and the distributed lock corresponding to the target keyword Key is allocated to the service terminal for all
- the step of the service terminal executing the corresponding exclusive transaction through the distributed lock includes:
- the corresponding write success information is returned to the service terminal, and the distributed lock corresponding to the target keyword Key is allocated to the service terminal for the service terminal to pass through The distributed lock executes the corresponding exclusive transaction.
- the present application also provides a blockchain-based transaction processing device, which includes: To
- the status judgment module is configured to determine the corresponding target keyword Key according to the transaction processing request when receiving the transaction processing request sent by the service terminal, and determine whether the target keyword Key is in an occupied state;
- a data writing module configured to write corresponding transaction data to the blockchain according to the target keyword Key if the target keyword Key is not in an occupied state;
- the lock allocation module is configured to return the corresponding write success information to the service terminal when the transaction data writing is completed, and allocate the distributed lock corresponding to the target keyword Key to the service terminal to For the service terminal to execute the corresponding exclusive transaction through the distributed lock.
- this application also provides a blockchain-based transaction processing device.
- the blockchain-based transaction processing device includes a processor, a memory, and stored on the memory and can be used by the The computer-readable instructions executed by the processor, where the computer-readable instructions, when executed by the processor, implement the steps of the above-mentioned blockchain-based transaction processing method.
- the present application also provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the implementation is as described above The steps of a blockchain-based transaction processing method.
- This application provides a blockchain-based transaction processing method, that is, when a transaction processing request sent by a service terminal is received, the corresponding target keyword Key is determined according to the transaction processing request, and it is determined whether the target keyword Key is in Occupied state; if the target keyword Key is not in an occupied state, write corresponding transaction data to the blockchain according to the target keyword Key; when the transaction data writing is completed, write to the service terminal Return the corresponding write success information, and allocate the distributed lock corresponding to the target keyword Key to the service terminal, so that the service terminal can execute the corresponding exclusive transaction through the distributed lock.
- the application when the application receives a transaction processing request from a business terminal, it controls and manages the transaction processing process through a distributed lock, so that a certain resource can only be used by one business terminal at the same time under high concurrency.
- To execute so as to ensure the orderliness of transaction processing and the unity of data, and solve the existing technical problems that are prone to confusion and conflicts of high-concurrency data.
- FIG. 1 is a schematic diagram of the hardware structure of a blockchain-based transaction processing device involved in the embodiment of the application;
- FIG. 2 is a schematic flowchart of a first embodiment of a transaction processing method based on blockchain in this application;
- FIG. 3 is a schematic flowchart of a second embodiment of a blockchain-based transaction processing method according to this application.
- FIG. 4 is a schematic flowchart of a third embodiment of a transaction processing method based on blockchain in this application.
- FIG. 5 is a schematic diagram of functional modules of the first embodiment of a transaction processing device based on blockchain in this application.
- the blockchain-based transaction processing methods involved in the embodiments of this application are mainly applied to blockchain-based transaction processing equipment.
- the blockchain-based transaction processing equipment may be a PC, a portable computer, a mobile terminal, etc., with display and processing functions device of.
- FIG. 1 is a schematic diagram of the hardware structure of a blockchain-based transaction processing device involved in the embodiment of the application.
- a blockchain-based transaction processing device may include a processor 1001 (for example, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
- the communication bus 1002 is used to realize the connection and communication between these components;
- the user interface 1003 may include a display (Display), an input unit such as a keyboard (Keyboard);
- the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface);
- the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory.
- the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
- Figure 1 does not constitute a limitation on the blockchain-based transaction processing equipment, and may include more or less components than shown in the figure, or combine certain components, or Different component arrangements.
- the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and computer-readable instructions.
- the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the computer-readable instructions stored in the memory 1005 and execute the blockchain-based transactions provided by the embodiments of the present application Approach.
- the embodiment of the application provides a transaction processing method based on blockchain.
- FIG. 2 is a schematic flowchart of a first embodiment of a blockchain-based transaction processing method of this application.
- the blockchain-based transaction processing method includes the following steps:
- Step S10 upon receiving the transaction processing request sent by the service terminal, determine the corresponding target keyword Key according to the transaction processing request, and determine whether the target keyword Key is in an occupied state;
- this application provides a blockchain-based transaction processing method.
- a transaction processing request from a business terminal is received, the transaction processing process is controlled and managed through a distributed lock, so that a certain resource is high.
- concurrency it can only be executed by one service terminal at the same time, so as to ensure the orderliness of transaction processing and the unity of data, and thus solve the existing technical problems of confusion and conflicts that easily produce high concurrent data.
- the transaction processing method based on the blockchain of this application is applied to the blockchain business system (blockchain business platform).
- the steps of the transaction processing method can be realized through smart contracts.
- the blockchain business system is preset with smart Contract, smart contract can be understood as a collection of code and data, stored in the blockchain node; smart contract can automatically perform some functions driven by time or events, such as the ability to transfer information between nodes and modify the area The state of the blockchain (account information, etc.), and Turing complete calculations (all things that can be done with Turing machines, in general, all things that can be done by general programming languages), etc.
- For each business participant of the blockchain business system they can access the corresponding blockchain node through their respective business terminals and send related business operation instructions to the smart contract of the blockchain business system.
- a business participant when a business participant needs to perform data write operations on the blockchain business system (operate on a certain resource), it can use a certain business terminal (such as PC, laptop, mobile phone, tablet, etc.)
- the smart contract of the blockchain sends transaction processing requests.
- For the transaction processing request there are transaction objects that need to be processed.
- the bottom layer of the blockchain uses a persistent key value Key-Value Database, and the distributed lock used to control the transaction processing flow in this application is set with a keyword (Key), so the transaction object in the transaction processing request may include the target keyword Key.
- the blockchain business system When the blockchain business system (smart contract) receives the transaction processing request, it will first determine the corresponding target keyword Key according to the transaction processing request, and then query whether the target keyword Key already exists in the blockchain ; If it already exists, it can be considered that the target keyword is occupied, and the corresponding lock acquisition failure prompt can be returned to the service terminal; if it does not exist, it can be considered that the target keyword is not in the occupied state, and you can proceed The next step is to write data.
- the blockchain business system smart contract
- Step S20 If the target keyword Key is not in an occupied state, write corresponding transaction data to the blockchain according to the target keyword Key;
- the blockchain business system when it is determined that the target keyword Key is not in an occupied state, the blockchain business system will write corresponding transaction data into the blockchain according to the target keyword Key. It is worth noting that when it is determined that the target keyword Key is not in the occupied state, the corresponding distributed lock is not immediately assigned to the service terminal, but the data writing operation is first attempted.
- Step S30 When the transaction data writing is completed, the corresponding writing success information is returned to the service terminal, and the distributed lock corresponding to the target keyword Key is allocated to the service terminal for the service terminal The service terminal executes the corresponding exclusive transaction through the distributed lock.
- the blockchain business system when the transaction data is written, can determine that the exclusive operation qualification corresponding to the target keyword Key is granted to the business terminal, and the blockchain business system will return the corresponding to the business terminal.
- the successful write information of the target keyword Key is assigned to the service terminal, so that the service terminal can execute the corresponding exclusive transaction through the distributed lock.
- the service terminal receives the write success message, it can perform the logical operation of the specific transaction.
- the business terminal When the operation is completed, the business terminal will send the corresponding operation completion information to the blockchain business system, and the blockchain business system will release the distributed lock according to the operation completion information so that other business terminals can regain the distribution Type lock for operation.
- step S30 it further includes:
- the distributed lock is forcibly recovered to release the lock resource of the distributed lock by the service terminal.
- a timeout period can be preset, that is, a preset time threshold, such as 2 minutes or 30 minutes, etc.
- the preset time threshold can be correspondingly set according to the actual transaction type.
- This embodiment provides a blockchain-based transaction processing method, that is, when a transaction processing request sent by a service terminal is received, the corresponding target keyword Key is determined according to the transaction processing request, and whether the target keyword Key is determined Is in an occupied state; if the target keyword Key is not in an occupied state, the corresponding transaction data is written to the blockchain according to the target keyword Key; when the transaction data writing is completed, the transaction data is written to the business
- the terminal returns corresponding write success information, and allocates the distributed lock corresponding to the target keyword Key to the service terminal, so that the service terminal can execute the corresponding exclusive transaction through the distributed lock.
- the application when the application receives a transaction processing request from a business terminal, it controls and manages the transaction processing process through a distributed lock, so that a certain resource can only be used by one business terminal at the same time under high concurrency.
- To execute so as to ensure the orderliness of transaction processing and the unity of data, and solve the existing technical problems that are prone to confusion and conflicts of high-concurrency data.
- FIG. 3 is a schematic flowchart of a second embodiment of a blockchain-based transaction processing method of this application.
- the step S30 includes:
- Step S31 when the transaction data writing is completed, obtain the number of service terminals that write transaction data into the target keyword Key, and determine whether the number of service terminals is unique;
- an allocation rule is formulated, that is, the distributed lock is assigned to the service terminal that is written first.
- the distribution rule may also be to assign the distributed lock first
- the service terminal, etc., up to the time when the transaction processing request is first initiated, that is, the distribution rule of the distributed lock can be set according to actual service requirements. Specifically, when it is detected that the transaction data writing is completed, the number of service terminals that write transaction data into the target keyword Key is acquired, that is, it is determined whether the service terminal that writes data to the distributed lock is Two or more than two.
- Step S32 If the number of service terminals is unique, return corresponding write success information to the service terminal, and allocate the distributed lock corresponding to the target keyword Key to the service terminal for the service The terminal executes the corresponding exclusive transaction through the distributed lock.
- the distributed lock corresponding to the target keyword Key can be directly assigned to the service terminal. Specifically, Return the corresponding write success information to the service terminal, that is, notify the service terminal that the request for the lock resource of the distributed lock is successful, and then the distributed lock corresponding to the target keyword Key can be allocated to the service Terminal, for the service terminal to execute the corresponding exclusive transaction through the distributed lock.
- Step S33 If the number of service terminals is not unique, return corresponding write success information to the first completed service terminal, and allocate the distributed lock corresponding to the target keyword Key to the first completed The service terminal for the first completed service terminal to execute the corresponding exclusive transaction through the distributed lock.
- the blockchain business system will The service terminal that first completes the data writing operation returns a write success message, and assigns the distributed lock to the service terminal that completes the writing first.
- step S33 it further includes:
- write failure information will be returned to it to indicate that the distributed lock has been acquired by other service terminals At this time, these non-first completed service terminals can try to operate on another resource (another keyword), or wait for the distributed lock to be released.
- FIG. 4 is a schematic flowchart of a third embodiment of a blockchain-based transaction processing method of this application.
- the step S10 specifically includes:
- Step S11 when receiving a transaction processing request sent by the service terminal, determine the corresponding target keyword Key according to the transaction processing request;
- the transaction object in the transaction processing request may include the target keyword Key.
- the blockchain business system smart contract
- receives the transaction processing request it should first determine the corresponding target keyword Key according to the transaction processing request, and then query whether the target keyword Key already exists in the blockchain.
- Step S12 judging whether the target keyword Key already exists in the blockchain, to determine whether the target keyword Key is in an occupied state
- the target keyword Key is in an occupied state by determining whether the target keyword Key already exists in the blockchain.
- Step S13 If the target keyword Key is in an occupied state, a corresponding lock acquisition failure prompt is returned to the service terminal.
- the target keyword is occupied, and the corresponding lock acquisition failure prompt can be returned to the service terminal at this time; if it does not exist, it can be considered that the target keyword is not in the occupied state. At this time, the next data writing operation can be performed.
- step S10 specifically includes:
- the user identity information has the transaction processing authority corresponding to the transaction processing request, determine the corresponding target keyword Key according to the transaction processing request, and determine whether the target keyword Key is in an occupied state;
- a corresponding non-authorization prompt is returned to the service terminal.
- the blockchain business system when it receives the transaction processing request, it can first verify the authority of the user performing the operation, that is, obtain the user identity information corresponding to the business terminal, such as account information or user name, etc. , To compare the user identity information with the information of the authorized user with transaction processing authority corresponding to the transaction processing request to determine whether the user has the transaction processing authority corresponding to the transaction processing request, such as data modification/deletion Permissions. If so, the operation of determining the corresponding target keyword Key according to the transaction processing request and determining whether the target keyword Key is in an occupied state is performed. Otherwise, the corresponding non-authority prompt will be returned to the service terminal; of course, for different transactions, the operation authority may be different.
- the embodiment of the present application also provides a transaction processing device based on blockchain.
- FIG. 5 is a schematic diagram of the functional modules of the first embodiment of a transaction processing device based on blockchain in this application.
- the blockchain-based transaction processing device includes:
- the status judgment module 10 is configured to determine the corresponding target keyword Key according to the transaction processing request when receiving a transaction processing request sent by the service terminal, and determine whether the target keyword Key is in an occupied state;
- the data writing module 20 is configured to write corresponding transaction data to the blockchain according to the target keyword Key if the target keyword Key is not in an occupied state;
- the lock allocation module 30 is configured to return the corresponding write success information to the service terminal when the transaction data writing is completed, and allocate the distributed lock corresponding to the target keyword Key to the service terminal, For the service terminal to execute the corresponding exclusive transaction through the distributed lock.
- block chain-based transaction processing device includes:
- a processing time judgment module configured to obtain the holding time of the distributed lock by the service terminal, and determine whether the holding time exceeds a preset time threshold;
- the timeout resource release module is configured to, if the holding time exceeds a preset time threshold, forcibly reclaim the distributed lock, so as to release the locked resource of the distributed lock by the service terminal.
- lock distribution module 30 specifically includes:
- a terminal quantity judging unit configured to obtain the number of service terminals that write the transaction data into the target keyword Key when the transaction data is written, and determine whether the number of service terminals is unique;
- the first allocation unit is configured to, if the number of service terminals is unique, return corresponding write success information to the service terminal, and allocate the distributed lock corresponding to the target keyword Key to the service terminal to For the service terminal to execute the corresponding exclusive transaction through the distributed lock.
- the second allocation unit is configured to, if the number of service terminals is not unique, return corresponding write success information to the first completed service terminal, and allocate the distributed lock corresponding to the target keyword Key to all The first completed service terminal is used for the first completed service terminal to execute the corresponding exclusive transaction through the distributed lock.
- lock distribution module 30 is also used for:
- state judgment module 10 specifically includes:
- the keyword determining unit is configured to determine the corresponding target keyword Key according to the transaction processing request when the transaction processing request sent by the service terminal is received;
- Occupancy judging unit used to judge whether the target keyword Key already exists in the blockchain, to judge whether the target keyword Key is in an occupied state
- the failure prompt unit is configured to return a corresponding lock acquisition failure prompt to the service terminal if the target keyword Key is in an occupied state.
- state judgment module 10 is also used for:
- the user identity information has the transaction processing authority corresponding to the transaction processing request, determine the corresponding target keyword Key according to the transaction processing request, and determine whether the target keyword Key is in an occupied state;
- a corresponding non-authorization prompt is returned to the service terminal.
- each module in the above-mentioned blockchain-based transaction processing device corresponds to each step in the above-mentioned blockchain-based transaction processing method embodiment, and its functions and implementation processes are not repeated here.
- the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium may be a non-volatile readable storage medium.
- the computer-readable storage medium of the present application stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the above-mentioned blockchain-based transaction processing method are realized.
- the method implemented when the computer-readable instruction is executed can refer to the various embodiments of the blockchain-based transaction processing method of this application, which will not be repeated here.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Claims (20)
- 一种基于区块链的事务处理方法,其中,所述基于区块链的事务处理方法包括以下步骤:在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态;若所述目标关键字Key不处于占用状态,则根据所述目标关键字Key向区块链中写入对应的事务数据;当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务;其中,所述当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务的步骤包括:当所述事务数据写入完成时,获取向所述目标关键字Key中写入事务数据的业务终端数量,并判断所述业务终端数量是否唯一;若所述业务终端数量唯一,则向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求1所述的基于区块链的事务处理方法,其中,所述当所述事务数据写入完成时,获取向所述目标关键字Key中写入事务数据的业务终端数量,并判断所述业务终端数量是否唯一的步骤之后,还包括:若所述业务终端数量不唯一,则向所述最先完成的业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述最先完成的业务终端,以供所述最先完成的业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求2所述的基于区块链的事务处理方法,其中,所述在若所述业务终端数量不唯一,则向所述最先完成的业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述最先完成的业务终端,以供所述最先完成的业务终端通过所述分布式锁执行对应的排他性事务的步骤之后,还包括:向所述最先完成的业务终端以外的其他业务终端返回写入失败信息,并将所述其他业务终端的终端标识添加至所述目标关键字Key对应的待分配列表,以在所述分布式锁被释放后将所述分布式锁对应分配至所述其他业务终端。
- 如权利要求1所述的基于区块链的事务处理方法,其中,所述在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态的步骤包括:在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应的目标关键字Key;判断区块链中所述目标关键字Key是否已存在,以判断所述目标关键字Key是否处于已占用状态;若所述目标关键字Key处于占用状态,则向业务终端返回对应的获取锁失败提示。
- 如权利要求1所述的基于区块链的事务处理方法,其中,所述当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务的步骤之后,还包括:获取所述业务终端对所述分布式锁的持有时间,并判断所述持有时间是否超过预设时间阈值;若所述持有时间超过预设时间阈值,则强制回收所述分布式锁,以释放所述业务终端对所述分布式锁的锁定资源。
- 如权利要求1所述的基于区块链的事务处理方法,其中,所述在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态的步骤具体包括:在接收到业务终端发送的事务处理请求时,获取所述业务终端对应的用户身份信息,并判断所述用户身份信息是否具有所述事务处理请求对应的事务处理权限;若所述用户身份信息具有所述事务处理请求对应的事务处理权限,则根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态;若所述用户身份信息不具有所述事务处理请求对应的事务处理权限,则向业务终端返回对应的无权限提示。
- 一种基于区块链的事务处理装置,其中,所述基于区块链的事务处理装置包括:状态判断模块,用于在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态;数据写入模块,用于若所述目标关键字Key不处于占用状态,则根据所述目标关键字Key向区块链中写入对应的事务数据;锁分配模块,用于当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求7所述的所述基于区块链的事务处理装置,其中,基于区块链的事务处理装置包括:处理时间判断模块,用于获取所述业务终端对所述分布式锁的持有时间,并判断所述持有时间是否超过预设时间阈值;超时资源释放模块,用于若所述持有时间超过预设时间阈值,则强制回收所述分布式锁,以释放所述业务终端对所述分布式锁的锁定资源。
- 如权利要求8所述的所述基于区块链的事务处理装置,其中,所述锁分配模块具体包括:终端数量判断单元,用于当所述事务数据写入完成时,获取向所述目标关键字Key中写入事务数据的业务终端数量,并判断所述业务终端数量是否唯一;第一分配单元,用于若所述业务终端数量唯一,则向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务;第二分配单元,用于若所述业务终端数量不唯一,则向所述最先完成的业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述最先完成的业务终端,以供所述最先完成的业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求7所述的所述基于区块链的事务处理装置,其中,所述锁分配模块还用于:向所述最先完成的业务终端以外的其他业务终端返回写入失败信息,并将所述其他业务终端的终端标识添加至所述目标关键字Key对应的待分配列表,以在所述分布式锁被释放后将所述分布式锁对应分配至所述其他业务终端。
- 如权利要求7所述的所述基于区块链的事务处理装置,其中,所述状态判断模块具体包括:关键字确定单元,用于在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应的目标关键字Key;占用判断单元,用于判断区块链中所述目标关键字Key是否已存在,以判断所述目标关键字Key是否处于已占用状态;失败提示单元,用于若所述目标关键字Key处于占用状态,则向业务终端返回对应的获取锁失败提示。
- 如权利要求7所述的所述基于区块链的事务处理装置,其中,所述状态判断模块还用于:在接收到业务终端发送的事务处理请求时,获取所述业务终端对应的用户身份信息,并判断所述用户身份信息是否具有所述事务处理请求对应的事务处理权限;若所述用户身份信息具有所述事务处理请求对应的事务处理权限,则根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态;若所述用户身份信息不具有所述事务处理请求对应的事务处理权限,则向业务终端返回对应的无权限提示。
- 一种基于区块链的事务处理设备,其中,所述基于区块链的事务处理设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机可读指令,其中所述计算机可读指令被所述处理器执行时,实现如下步骤:在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态;若所述目标关键字Key不处于占用状态,则根据所述目标关键字Key向区块链中写入对应的事务数据;当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务;其中,所述当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务的步骤包括:当所述事务数据写入完成时,获取向所述目标关键字Key中写入事务数据的业务终端数量,并判断所述业务终端数量是否唯一;若所述业务终端数量唯一,则向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求13所述的所述基于区块链的事务处理设备,其中,所述当所述事务数据写入完成时,获取向所述目标关键字Key中写入事务数据的业务终端数量,并判断所述业务终端数量是否唯一的步骤之后,还包括:若所述业务终端数量不唯一,则向所述最先完成的业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述最先完成的业务终端,以供所述最先完成的业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求14所述的所述基于区块链的事务处理设备,其中,所述在若所述业务终端数量不唯一,则向所述最先完成的业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述最先完成的业务终端,以供所述最先完成的业务终端通过所述分布式锁执行对应的排他性事务的步骤之后,还包括:向所述最先完成的业务终端以外的其他业务终端返回写入失败信息,并将所述其他业务终端的终端标识添加至所述目标关键字Key对应的待分配列表,以在所述分布式锁被释放后将所述分布式锁对应分配至所述其他业务终端。
- 如权利要求13所述的所述基于区块链的事务处理设备,其中,所述在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态的步骤包括:在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应的目标关键字Key;判断区块链中所述目标关键字Key是否已存在,以判断所述目标关键字Key是否处于已占用状态;若所述目标关键字Key处于占用状态,则向业务终端返回对应的获取锁失败提示。
- 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如下步骤:在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态;若所述目标关键字Key不处于占用状态,则根据所述目标关键字Key向区块链中写入对应的事务数据;当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务;其中,所述当所述事务数据写入完成时,向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务的步骤包括:当所述事务数据写入完成时,获取向所述目标关键字Key中写入事务数据的业务终端数量,并判断所述业务终端数量是否唯一;若所述业务终端数量唯一,则向所述业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述业务终端,以供所述业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求17所述的所述基于区块链的事务处理设备,其中,所述当所述事务数据写入完成时,获取向所述目标关键字Key中写入事务数据的业务终端数量,并判断所述业务终端数量是否唯一的步骤之后,还包括:若所述业务终端数量不唯一,则向所述最先完成的业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述最先完成的业务终端,以供所述最先完成的业务终端通过所述分布式锁执行对应的排他性事务。
- 如权利要求18所述的所述基于区块链的事务处理设备,其中,所述在若所述业务终端数量不唯一,则向所述最先完成的业务终端返回对应的写入成功信息,并将所述目标关键字Key对应的分布式锁分配至所述最先完成的业务终端,以供所述最先完成的业务终端通过所述分布式锁执行对应的排他性事务的步骤之后,还包括:向所述最先完成的业务终端以外的其他业务终端返回写入失败信息,并将所述其他业务终端的终端标识添加至所述目标关键字Key对应的待分配列表,以在所述分布式锁被释放后将所述分布式锁对应分配至所述其他业务终端。
- 如权利要求17所述的所述基于区块链的事务处理设备,其中,所述在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应目标关键字Key,并判断所述目标关键字Key是否处于占用状态的步骤包括:在接收到业务终端发送的事务处理请求时,根据所述事务处理请求确定对应的目标关键字Key;判断区块链中所述目标关键字Key是否已存在,以判断所述目标关键字Key是否处于已占用状态;若所述目标关键字Key处于占用状态,则向业务终端返回对应的获取锁失败提示。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910376443.3 | 2019-05-07 | ||
| CN201910376443.3A CN110231979A (zh) | 2019-05-07 | 2019-05-07 | 基于区块链的事务处理方法、装置、设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020224249A1 true WO2020224249A1 (zh) | 2020-11-12 |
Family
ID=67860425
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/121996 Ceased WO2020224249A1 (zh) | 2019-05-07 | 2019-11-29 | 基于区块链的事务处理方法、装置、设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110231979A (zh) |
| WO (1) | WO2020224249A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113205417A (zh) * | 2021-04-27 | 2021-08-03 | 华东师范大学 | 一种面向联盟链的交易并行处理方法及系统 |
| CN113781230A (zh) * | 2021-09-24 | 2021-12-10 | 支付宝(杭州)信息技术有限公司 | 基于区块链的交易处理方法和装置 |
| CN117193974A (zh) * | 2023-09-01 | 2023-12-08 | 中国人民财产保险股份有限公司 | 基于多进程/线程的配置请求处理方法及装置 |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110231979A (zh) * | 2019-05-07 | 2019-09-13 | 深圳壹账通智能科技有限公司 | 基于区块链的事务处理方法、装置、设备及存储介质 |
| CN110597923B (zh) * | 2019-09-29 | 2024-02-02 | 腾讯云计算(北京)有限责任公司 | 区块链资源管理方法、装置及存储介质 |
| CN110888858B (zh) * | 2019-10-29 | 2023-06-30 | 北京奇艺世纪科技有限公司 | 数据库的操作方法和装置、存储介质、电子装置 |
| CN111190913A (zh) * | 2019-12-30 | 2020-05-22 | 联动优势(北京)数字科技有限公司 | 一种分布式锁实现方法及系统 |
| CN111210270B (zh) * | 2020-01-02 | 2023-06-20 | 广州虎牙科技有限公司 | 业务处理方法、装置、服务集群、计算机设备和存储介质 |
| CN111209593A (zh) * | 2020-01-10 | 2020-05-29 | 杭州溪塔科技有限公司 | 基于区块链的分布式锁处理方法及相关装置和电子设备 |
| CN111897646A (zh) * | 2020-08-13 | 2020-11-06 | 银联商务股份有限公司 | 异步分布式锁实现方法及其装置、存储介质以及电子设备 |
| CN112486696A (zh) * | 2020-12-11 | 2021-03-12 | 上海悦易网络信息技术有限公司 | 一种获取分布式锁的方法及设备 |
| CN113239059B (zh) * | 2021-05-28 | 2024-05-14 | 北京达佳互联信息技术有限公司 | 一种分布式锁的切换方法、装置、服务器和存储介质 |
| CN113806384A (zh) * | 2021-08-19 | 2021-12-17 | 紫光云(南京)数字技术有限公司 | 基于redis的分配递增整型数据的方法 |
| CN114443180B (zh) * | 2022-01-19 | 2025-08-26 | 北京三快在线科技有限公司 | 一种业务处理方法及装置 |
| CN116881271A (zh) * | 2023-07-27 | 2023-10-13 | 金蝶软件(中国)有限公司 | 一种并发数据的数据处理方法及系统 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108920257A (zh) * | 2018-06-25 | 2018-11-30 | 百度在线网络技术(北京)有限公司 | 事务处理方法、装置、设备及存储介质 |
| US20180359095A1 (en) * | 2017-06-12 | 2018-12-13 | Cisco Technology, Inc. | Dynamically-Changing Identity For IoT Devices With Blockchain Validation |
| CN109165224A (zh) * | 2018-08-24 | 2019-01-08 | 东北大学 | 一种在区块链数据库上针对关键字key的索引方法 |
| CN109213791A (zh) * | 2018-08-22 | 2019-01-15 | 北京京东尚科信息技术有限公司 | 数据处理方法、区块链节点、系统和计算机可读存储介质 |
| CN109684307A (zh) * | 2018-12-26 | 2019-04-26 | 百度在线网络技术(北京)有限公司 | 一种数据存储方法、装置、设备及存储介质 |
| CN110231979A (zh) * | 2019-05-07 | 2019-09-13 | 深圳壹账通智能科技有限公司 | 基于区块链的事务处理方法、装置、设备及存储介质 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104679881B (zh) * | 2015-03-13 | 2019-03-08 | 华为技术有限公司 | 一种并发控制方法及装置 |
| WO2017100978A1 (zh) * | 2015-12-14 | 2017-06-22 | 华为技术有限公司 | 一种集群中锁管理的方法、锁服务器及客户端 |
| US9774578B1 (en) * | 2016-05-23 | 2017-09-26 | Accenture Global Solutions Limited | Distributed key secret for rewritable blockchain |
| CN108769150B (zh) * | 2018-05-14 | 2021-11-12 | 百度在线网络技术(北京)有限公司 | 区块链网络的数据处理方法、装置、集群节点和存储介质 |
| CN108804112B (zh) * | 2018-05-22 | 2022-02-11 | 上海分布信息科技有限公司 | 一种区块链落账处理方法及系统 |
-
2019
- 2019-05-07 CN CN201910376443.3A patent/CN110231979A/zh active Pending
- 2019-11-29 WO PCT/CN2019/121996 patent/WO2020224249A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180359095A1 (en) * | 2017-06-12 | 2018-12-13 | Cisco Technology, Inc. | Dynamically-Changing Identity For IoT Devices With Blockchain Validation |
| CN108920257A (zh) * | 2018-06-25 | 2018-11-30 | 百度在线网络技术(北京)有限公司 | 事务处理方法、装置、设备及存储介质 |
| CN109213791A (zh) * | 2018-08-22 | 2019-01-15 | 北京京东尚科信息技术有限公司 | 数据处理方法、区块链节点、系统和计算机可读存储介质 |
| CN109165224A (zh) * | 2018-08-24 | 2019-01-08 | 东北大学 | 一种在区块链数据库上针对关键字key的索引方法 |
| CN109684307A (zh) * | 2018-12-26 | 2019-04-26 | 百度在线网络技术(北京)有限公司 | 一种数据存储方法、装置、设备及存储介质 |
| CN110231979A (zh) * | 2019-05-07 | 2019-09-13 | 深圳壹账通智能科技有限公司 | 基于区块链的事务处理方法、装置、设备及存储介质 |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113205417A (zh) * | 2021-04-27 | 2021-08-03 | 华东师范大学 | 一种面向联盟链的交易并行处理方法及系统 |
| CN113781230A (zh) * | 2021-09-24 | 2021-12-10 | 支付宝(杭州)信息技术有限公司 | 基于区块链的交易处理方法和装置 |
| WO2023045532A1 (zh) * | 2021-09-24 | 2023-03-30 | 蚂蚁区块链科技(上海)有限公司 | 基于区块链的交易处理 |
| CN117193974A (zh) * | 2023-09-01 | 2023-12-08 | 中国人民财产保险股份有限公司 | 基于多进程/线程的配置请求处理方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110231979A (zh) | 2019-09-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020224249A1 (zh) | 基于区块链的事务处理方法、装置、设备及存储介质 | |
| WO2018036167A1 (zh) | 测试任务执行机分配方法、装置、服务器和存储介质 | |
| WO2021006616A1 (en) | Method for providing relational decentralized identifier service and blockchain node using the same | |
| WO2012111905A2 (ko) | 맵 리듀스를 이용한 분산 메모리 클러스터 제어 장치 및 방법 | |
| WO2012057581A2 (ko) | 클라우드 컴퓨팅 시스템 및 그의 데이터 동기화 방법 | |
| WO2018135766A1 (ko) | 블록 체인을 이용하여 데이터를 관리하는 장치 및 방법 | |
| WO2013048110A2 (en) | Apparatus and method for synchronizing application data | |
| WO2018099067A1 (zh) | 分布式任务调度方法和系统 | |
| WO2019198885A1 (ko) | 블록체인 기반의 다수의 서비스 노드를 사용하는 탈중앙화 서비스 플랫폼 | |
| WO2020119115A1 (zh) | 数据审核方法、装置、设备及存储介质 | |
| WO2020042464A1 (zh) | 数据交互方法、装置、设备及可读存储介质 | |
| WO2018094809A1 (zh) | 一种资源共享方法及装置 | |
| WO2020220412A1 (zh) | 基于零知识证明的公民隐私保护的方法、系统及存储介质 | |
| WO2020224251A1 (zh) | 区块链事务的处理方法、装置、设备及存储介质 | |
| WO2021125502A1 (ko) | 컨테이너 기반의 클라우드 서비스 제공 시스템 및 그 방법 | |
| WO2021040283A1 (ko) | 무선 ap 접속 정보에 기초하여 근태 관리를 수행할 수 있는 근태 관리 시스템 서버 및 그 동작 방법 | |
| WO2020042482A1 (zh) | 坐席业务处理方法、装置、设备及计算机可读存储介质 | |
| WO2020237859A1 (zh) | 基于nbd设备的数据迁移方法、装置、设备及存储介质 | |
| CN107800737A (zh) | 一种服务器集群中主节点的确定方法、装置及服务器集群 | |
| WO2025023426A2 (ko) | 컨테이너 기반 클라우드 접근통제 시스템 및 방법 | |
| WO2013176431A1 (ko) | 단말을 서버에 할당하고 단말로의 효율적인 메시징을 위한 시스템 및 방법 | |
| WO2022010136A1 (ko) | 클라우드 서버 및 이의 제어 방법 | |
| WO2023171973A1 (en) | Apparatus and method of managing non-fungible tokens based on blockchain | |
| WO2014084603A1 (ko) | 어플리케이션 삭제에 연동한 se 애플릿 관리 방법 및 이를 적용한 모바일 기기와 서비스 관리 서버 | |
| WO2025014013A1 (ko) | Qr코드를 이용한 안심전화 서비스를 위한 운영 서버 및 그 동작 방법 |
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: 19928149 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19928149 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 18/03/2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19928149 Country of ref document: EP Kind code of ref document: A1 |