WO2020151313A1 - 基于区块链的锁处理方法、装置、计算机设备及存储介质 - Google Patents
基于区块链的锁处理方法、装置、计算机设备及存储介质 Download PDFInfo
- Publication number
- WO2020151313A1 WO2020151313A1 PCT/CN2019/117300 CN2019117300W WO2020151313A1 WO 2020151313 A1 WO2020151313 A1 WO 2020151313A1 CN 2019117300 W CN2019117300 W CN 2019117300W WO 2020151313 A1 WO2020151313 A1 WO 2020151313A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- lock
- data
- blockchain
- block
- state
- 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
- 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
Definitions
- This application relates to the field of blockchain, and in particular to a lock processing method, device, computer device, and storage medium based on blockchain.
- the traditional distributed lock solution is usually based on centralized redis or database for unified management, specifically through the redis server or database management to realize the lock function lock data, however, when the centralized redis server or database is down, etc.
- the lock data used to implement the lock function cannot be controlled, and the distributed lock scheme based on redis or the database cannot be implemented, so that the function of the aforementioned lock scheme cannot be effectively guaranteed.
- the embodiments of the present application provide a lock processing method, device, computer equipment, and storage medium based on a blockchain, which can effectively ensure that the function of a distributed lock can be implemented, thereby improving the success rate of the implementation of a distributed lock.
- the target item is controlled to be in a locked state through the lock data of the lock block in the blockchain.
- a lock processing device based on blockchain is applied in a lock processing system, the lock processing system further includes a distributed node server cluster, and each node of the distributed node server cluster The server stores the blockchain, and the lock processing device includes:
- the acquiring module is configured to acquire the first lock request, where the first lock request is a request for the first lock operation on the target item;
- the first generation module is configured to generate lock data uniquely corresponding to the target item
- the second generating module is configured to generate a lock block according to the lock data, and the block body of the lock block contains the lock data;
- a broadcasting module for broadcasting the lock block to the blockchain
- the control module is configured to control the target item to be in a locked state through the lock data of the lock block in the blockchain.
- a computer device including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the above-mentioned Block chain lock processing method.
- One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors execute the aforementioned region-based Block chain lock processing method.
- FIG. 1 is a schematic diagram of an application environment of a blockchain-based lock processing method in an embodiment of the present application
- FIG. 2 is a schematic flowchart of a lock processing method based on blockchain in an embodiment of the present application
- FIG. 3 is a schematic flow chart of a lock processing method based on blockchain in an embodiment of the present application
- FIG. 4 is a schematic flowchart of a lock processing method based on a blockchain in an embodiment of the present application
- FIG. 5 is a schematic flow chart of a lock processing method based on blockchain in an embodiment of the present application.
- FIG. 6 is a schematic diagram of a block chain-based lock processing device in an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a computer device in an embodiment of the present application.
- the distributed lock processing system includes a distributed node server cluster and a blockchain processing device.
- the above-mentioned distributed node server cluster forms a distributed system
- the foregoing distributed system may refer to a website distributed system, which is not specifically limited here.
- Each node server in the aforementioned distributed node server cluster can work normally, and each node server can communicate with each other.
- the blockchain-based lock processing method provided by the embodiment of the application can be applied to the blockchain processing device in the system architecture as shown in FIG. 1.
- each of the above-mentioned node servers may be implemented by an independent server or a server cluster composed of multiple servers, which is not limited in the embodiment of the present application.
- Each node server of the distributed node server cluster is provided with a corresponding node identifier.
- each node server of the distributed node server cluster stores the node identifiers of other node servers of the lock processing system for subsequent According to the node identifiers of other node servers, broadcast the generated blocks to other node servers of the lock processing system.
- each node server can maintain a node identification list, and store the node identification and node name of each node server in the lock processing system in the node identification list.
- the hardware of each node server can be used.
- the address or network address or other identification information that can uniquely identify the node server is used as the node identification, which is not specifically limited in the embodiment of the present application.
- each node server in the distributed lock processing system stores the same block chain, where each block chain is composed of multiple blocks, and the founding block includes a block header And the block body, the block header stores the block header feature value, version number and other basic block information, the block body stores the block data, and the next block of the founding block takes the founding block as the parent block ,
- the next block also includes a block header and a block body, and the block header of the next block stores the block header feature value of the current block, the block header feature value of the parent block, the version number and other basic block information , And so on, so that the block data stored in each block in the blockchain is related to the block data stored in the parent block, ensuring the immutability and continuity of the block data in the block .
- This application is to implement the function of a distributed lock through the above-mentioned blockchain processing device, where the lock is a way to control synchronous access to shared resources between distributed systems.
- the lock is a way to control synchronous access to shared resources between distributed systems.
- it is often necessary to coordinate actions between different systems in the distributed system or different hosts (node servers) in the same system. If different systems or different hosts of the same system share one or a group of resources (exemplarily, the resource can refer to a certain calling method, data, or variable) or other mutually exclusive execution of certain tasks
- mutual exclusion is often required to prevent mutual interference to ensure consistency. In this case, distributed locks need to be used.
- FIG. 2 is a schematic diagram of an implementation flow of a lock processing method based on a blockchain in this application. The method is applied to a blockchain processing device in a lock processing system, and the lock processing system also It includes a distributed node server cluster, and each node server of the distributed node server cluster stores the blockchain, including the following steps:
- S10 Acquire a first lock request, where the first lock request is a request for the first lock operation on the target item.
- the above process can be a process triggered by a client or a cluster server.
- the process triggered by the node server is not limited here. It is worth noting that in practical applications, for distributed systems, there are usually situations where multiple processes coexist. When the above multiple processes are used to mutually exclusive access a certain resource or perform a certain task, both Each lock request can be generated, which is used to request a lock operation on the items corresponding to the process.
- a certain message can only be processed by one node server in the cluster server, and processing by multiple node servers may cause serious problems, such as machine crashes.
- a file only a single process is allowed to read and write at the same time. If it is read and written by multiple processes, it will also cause serious problems, so the lock function is required.
- a lock request is generated, and the lock request is sent to the blockchain processing device.
- the blockchain processing device can obtain the above-mentioned lock request.
- the blockchain processing device When the blockchain processing device receives the first lock request, it generates lock data uniquely corresponding to the target item. It should be noted that the blockchain processing device can use a conventional random number generation algorithm to randomly generate the above-mentioned lock data, and use an identifier to uniquely identify the corresponding relationship between the lock data and the target item.
- the above-mentioned random number generation algorithm may specifically be an exponential value probability algorithm, Monte Carlo algorithm, Sherwood algorithm, etc.
- the specific embodiment of the present application is not limited, and the specific process of generating lock data is not described here.
- S30 Generate a lock block according to the lock data, and the block body of the lock block includes the lock data.
- a lock block is generated according to the lock data, and the block body of the lock block includes the lock data.
- the feature value of the lock data can be calculated according to a preset feature value algorithm as the block header feature value of the current block header, and the lock data and the previous block of the lock block in the blockchain can be used to generate the above
- the lock block that is, the block header of the currently generated lock block stores the block header feature value of the current lock block, the block header feature value of the parent block, the version number and other basic block information, so that the blockchain
- the block data stored in the currently generated lock block are all related to the block data stored in the parent block to ensure the immutability and continuity of the block data in the block, specifically regarding the generation of the block The process is not described here.
- S40 Broadcast the lock block to the blockchain.
- the lock block is broadcast to the blockchain.
- S50 Control the target item to be in a locked state through the lock data of the lock block in the blockchain.
- controlling the target item through the lock data and the block chain to be in the locked state refers to storing the lock data in the block chain in the form of a block, and controlling by the lock data stored in the block chain The target item is locked. It can be understood that due to the immutability and decentralization of data in the blockchain, when one of the node servers is down, the blockchain stored by the other node servers still has the above-mentioned lock data, that is, the district Blockchain and lock data can still control the lock state of the target item, including the lock state.
- step S50 that is, the lock data of the lock block in the blockchain is used to control the target item to be in a locked state
- the following methods are used to control all
- the above-mentioned blockchain may adopt Hyperledger
- Hyperledger Fabri is a platform that provides distributed ledger solutions.
- the Hyperledger Fabri serves as the basis for the development of blockchain applications with a modular architecture, which helps to implement components such as consensus and membership services. Plug and play, use container technology to host the smart contracts that constitute the system application logic.
- the smart contract on the blockchain is a set of digitally defined promises (promises), including agreements on which smart contract participants can execute these promises, which are automatically executed when the trigger conditions are met on the blockchain Automation script or code.
- the Go The Go Programming Language, Golang
- Go The Go Programming Language, Golang
- the interface of the smart contract can be used , which is the interface of the block chain, to complete the query and read and write of block data on the block chain.
- a consensus on the block chain can be built in advance and smart contracts can be deployed.
- a preset smart contract can be deployed.
- the preset smart contract defines the state of the lock data corresponding to the target item, including the available state and the unavailable state.
- the preset smart contract interface can be called The way to change the status of the lock data is available or unavailable. It is worth noting that when the state of the lock data is in the available state, the lock data can be queried. When the state of the lock data is in the unavailable state, the above-mentioned lock data cannot be queried, but the lock data cannot be deleted or tampered with.
- each block is controlled by deploying a preset smart contract in the block chain.
- the state of the block the preset smart contract is used to control whether the state of the block data of the block is available.
- the blockchain processing device can call the preset smart contract.
- the interface of the contract is to send status control information to the blockchain.
- S60 Generate an unlock timer for the locked state, and start the unlock timer.
- S70 When the timing duration of the unlocking timer exceeds a preset threshold, set the lock data in the blockchain to an unavailable state, where, when the lock data is in an unavailable state The target item is in the unlocked state.
- the timing duration of the unlocking timer can be pre-configured, which is not specifically limited here.
- the timing duration of the unlocking timer exceeds a preset threshold, the lock data in the blockchain is set to an unusable state.
- the state of each block is controlled by deploying a smart contract in the blockchain.
- the smart contract is used to control whether the state of the block data of the block is available.
- the blockchain processing device can call the above
- the interface of the smart contract is preset to send state control information to the block chain. When the block chain receives the state information that will make the lock data of the lock block unavailable, it will send all the information in the block chain.
- the lock data is set to an unavailable state, where when the lock data is in an unavailable state, the target item is in the unlocked state, and it means that the target item is unlocked at this time.
- the purpose of setting the unlock timer is to cause deadlock and cause other processes to fail to execute the above-mentioned target items.
- the target item is in the unlocked state: when an unlock request for unlocking the target item is received, the lock in the blockchain is locked by calling the preset smart contract interface of the blockchain
- the data is placed in an unavailable state, where the target item is in the unlocked state when the lock data is in the unavailable state, and the unlock request and the first lock request are requests initiated by the same requester.
- the process does not need to occupy the target item (exemplarily, when there is no need to call a certain method, data, variable ) Will generate an unlocking request and send the unlocking request to the blockchain processing device.
- the unlocking request can be received, when the unlocking request for unlocking the target item is received Setting the lock data in the blockchain to an unavailable state, where the target item is in the unlocked state when the lock data is in the unavailable state.
- the blockchain processing device can call the interface of the above-mentioned smart contract to send status control information to the blockchain.
- the lock data in the blockchain is set to an unavailable state, where when the lock data is in an unavailable state, the target item is in the unlocked state, which means that the target item is unlocked at this time.
- the purpose of setting the unlock timer is to cause a deadlock and cause other processes to fail to execute the above-mentioned target items.
- step S50 that is, by calling the preset smart contract interface of the blockchain
- the locked data of the locked block is set to After the available state, it also includes the following steps:
- S80 Obtain a non-first lock request, where the non-first lock request is used to perform a lock operation on the target item.
- the process can continue to initiate the lock request.
- the request is a non-first request for the target item; in addition, after the process initiates the first lock request for the target item to lock, other processes may also initiate a lock for locking the target item.
- Request the lock request at this time is also a non-first request for the target item.
- the aforementioned non-first lock request can be obtained.
- S90 Determine whether the lock data in the block data is available.
- the block data in the blockchain can be obtained. It should be noted that it has been mentioned in the foregoing description If the blockchain processing device has performed a lock operation on the target item according to the first lock request, then the block data in the blockchain already contains the lock data uniquely corresponding to the target item. Specifically, it can be compared by field The method compares the unique lock data of the target item with the block data obtained from the blockchain to determine whether the block data in the blockchain contains the above-mentioned lock data uniquely corresponding to the target item. If the block data in the blockchain does not contain the above-mentioned lock data uniquely corresponding to the target item, it means that the target item has not been checked.
- the target item has been locked, and the lock state of the target item has not been processed. At this time, the target item can be locked according to the above steps S1-S50, which will not be repeated here.
- the block data since it is a non-first lock request for the target item, the block data must include lock data for the target item. Therefore, after the non-first lock request is obtained, the area can be determined Whether the lock data in the block data is available.
- the state of the lock data is a state used to reflect the lock status of the target item corresponding to the lock data.
- the block data in the blockchain can be queried to determine whether the lock can be queried. If the data cannot be queried, it means that the lock data corresponding to the target item is in an unavailable state, which means that the target item is in the locked state. If it is queried, it means that the lock data corresponding to the target item is in the available state, which means that the target item is in Locked state.
- the process that initiated the non-first lock request waits until the target item is unlocked.
- the lock data in the block data is in an unavailable state
- the lock data is set to an available state to lock the target item. At this time, it indicates that the target item is not locked for the first time. The requested process is locked and cannot be occupied by other processes.
- step S40 broadcasting the lock block to the blockchain specifically includes the following steps:
- S41 Obtain the node identifier of each node server in the node server cluster.
- S42 Broadcast the lock block to the blockchain of the node server corresponding to the node identifier according to the node identifier.
- each node server of the blockchain-based lock processing system has a corresponding node identifier.
- each node server stores a blockchain-based lock Place
- the node identifiers of other node servers in the management system can be obtained, therefore, the node identifiers of each node server in the blockchain can be obtained.
- broadcast the newly generated lock block to other node servers in the blockchain-based session data processing system so that other node servers Add the newly generated lock block to the stored blockchain to realize the sharing of blockchain data (that is, the lock data corresponding to each target item) in the base session data processing system.
- a blockchain-based lock processing device is provided.
- the lock processing device is applied to a lock processing system, and the lock processing system further includes a distributed node server cluster.
- Each node server in the node server cluster stores the block chain
- the block chain-based lock processing device corresponds to the block chain-based lock processing method in the foregoing embodiment in a one-to-one correspondence.
- the block chain-based lock processing device 10 includes an acquisition module 101, a first generation module 102, a second generation module 103, a broadcast module 104, and a control module 105.
- the detailed description of each functional module is as follows:
- the obtaining module 101 is configured to obtain a first lock request, where the first lock request is a request for a first lock operation on a target item;
- the first generating module 102 is configured to generate lock data uniquely corresponding to the target item
- the second generation module 103 is configured to generate a lock block according to the lock data generated by the first generation module 102, and the block body of the lock block includes the lock data;
- the broadcasting module 104 is configured to broadcast the lock block generated by the second generation module 103 to the blockchain;
- the control module 105 is configured to control the target item to be in a locked state through the lock data broadcast to the lock block in the blockchain through the broadcast module 104.
- control module is specifically configured to: [0085] By calling the preset smart contract interface of the blockchain, the locked data of the locked block is placed in an available state, where the target item is in the available state when the locked data is in the available state The locked state
- the blockchain-based lock processing device further includes a third generation module
- the third generation module is used for the control module to set the locked data of the lock block to a usable state by calling the preset smart contract interface of the blockchain, and then generate a The unlocking timer in the locked state, and starting the unlocking timer;
- the control module is further configured to: when the timing duration of the unlocking timer exceeds a preset threshold, set the lock data in the blockchain to an unusable state, wherein, when the lock When the data is in an unavailable state, the target item is in the unlocked state.
- control module is further configured to set the locked data of the locked block to a usable state by calling the preset smart contract interface of the blockchain, when When receiving an unlocking request for unlocking the target item, the lock data in the blockchain is set to an unusable state by calling the preset smart contract interface of the blockchain, where: When the lock data is in an unavailable state, the target item is in the unlocked state, and the unlock request and the first lock request are requests initiated by the same requesting party.
- the acquisition module is further configured to: the control module sets the locked data of the lock block to a usable state by calling the preset smart contract interface of the blockchain Afterwards, acquiring a non-first locking request, where the non-first locking request is used to perform a locking operation on the target item;
- the control module is further configured to: determine whether the lock data in the block data is available; if it is determined that the lock data in the block data is available, determine the target The item is in the locked state, and the indication information used to indicate that the target item has been locked is fed back for the non-first lock request; if it is determined that the lock data in the block data is in an unavailable state, then by calling the The preset smart contract interface sets the lock data to a usable state to control the target item to be in a locked state.
- the broadcasting module is specifically configured to: obtain the node identifier of each node server in the node server cluster; and broadcast the lock block to the node corresponding to the node identifier according to the node identifier Node server's blockchain.
- Each module in the above-mentioned block chain-based lock processing device can be implemented in whole or in part by software, hardware, and combinations thereof.
- the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
- a computer device is provided.
- the computer device may be used to implement the function of the above-mentioned block chain-based lock processing device, and its internal structure diagram may be as shown in FIG. 7.
- the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
- the memory of the computer device includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium stores an operating system, computer-readable instructions, and a database.
- the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
- the database of the computer equipment is used to temporarily store lock data and establish the correspondence between corresponding lock data and items.
- the network interface of the computer device is used to communicate with an external terminal through a network connection.
- the computer-readable instructions are executed by the processor to implement a blockchain-based lock processing method.
- a computer device including a memory, a processor, and computer-readable instructions stored on the memory and running on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions :
- the target item is controlled to be in a locked state through the lock data of the lock block in the blockchain.
- one or more readable storage media storing computer readable instructions, where the readable storage medium includes a non-volatile readable storage medium and a volatile readable storage medium, so When the computer-readable instructions are executed by one or more processors, the one or more processors execute the following steps
- the target item is controlled to be in a locked state through the lock data of the lock block in the blockchain.
- Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory can include random access memory (RAM) or external cache memory.
- RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DR AM (SDRAM), double data rate SDRAM (DDRSDRAM), and enhanced SDRAM (ESDR AM) , Synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
- SRAM static RAM
- DRAM dynamic RAM
- SDRAM synchronous DR AM
- DDRSDRAM double data rate SDRAM
- ESDR AM enhanced SDRAM
- SLDRAM Synchronous link
- RDRAM memory bus
- RDRAM direct memory bus dynamic RAM
- RDRAM memory bus dynamic RAM
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种基于区块链的锁处理方法、装置、计算机设备及存储介质,有效地保证能实行分布式锁的功能,从而提高分布式锁实行的成功率。方法部分包括:获取首次加锁请求,其中,所述首次加锁请求为用于请求对目标事项进行第一次加锁操作的请求(S10);生成所述目标事项唯一对应的锁数据(S20);根据所述锁数据生成锁区块,所述锁区块的区块体中包含所述锁数据(S30);将所述锁区块广播至所述区块链中(S40);通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加锁状态(S50)。
Description
说明书
发明名称:基于区块链的锁处理方法、 装置、 计算机设备及存储介 质
[0001] 本申请以 2019年 1月 25日提交的申请号为 201910072940.4, 名称为“基于区块链 的锁处理方法、 装置、 计算机设备及存储介质”的中国发明专利申请为基础, 并 要求其优先权。
技术领域
[0002] 本申请涉及区块链领域, 尤其涉及一种基于区块链的锁处理方法、 装置、 计算 机设备及存储介质。
[0003]
[0004] 背景技术
[0005] 为了实现多个线程在一个时刻同一个代码块只能有一个线程可执行, 那么需要 在某个地方做个标记, 这个标记必须每个线程都能看到, 当标记不存在时可以 设置该标记, 其余后续线程发现已经有标记了则等待拥有标记的线程结束同步 代码块取消标记后再去尝试设置标记。 这个标记可以理解为锁。 在分布式系统 的许多的应用场景中, 为了保证一个方法或数据或变量在同一时间内只能被同 一个线程执行, 需要利用锁的技术控制某一时刻修改数据的进程数。 传统的分 布式锁方案通常是基于集中式的 redis或数据库来统一管理, 具体是通 redis服务器 或数据库管理用于实现锁功能的锁数据, 然而, 当集中式的 redis服务器或数据库 出现宕机等情况时, 用于实现锁功能的锁数据无法被控制, 基于 redis或数据库的 分布式锁方案无法进行, 从而无法有效地保证能实行上述锁方案的功能。
[0006]
[0007] 发明内容
[0008] 本申请实施例提供一种基于区块链的锁处理方法、 装置、 计算机设备及存储介 质, 有效地保证能实行分布式锁的功能, 从而提高分布式锁实行的成功率。
[0009] 一种基于区块链的锁处理方法, 应用于锁处理系统中的区块链处理装置中, 所 述锁处理系统还包括分布式节点服务器集群, 所述分布式节点服务器集群的每
个节点服务器保存有所述区块链, 所述方法包括:
[0010] 获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目标事项进行第一 次加锁操作的请求;
[0011] 生成所述目标事项唯一对应的锁数据;
[0012] 根据所述锁数据生成锁区块, 所述锁区块的区块体中包含所述锁数据;
[0013] 将所述锁区块广播至所述区块链中;
[0014] 通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加锁状态。
[0015] 一种基于区块链的锁处理装置, 所述锁处理装置应用于锁处理系统中, 所述锁 处理系统还包括分布式节点服务器集群, 所述分布式节点服务器集群的每个节 点服务器保存有所述区块链, 所述锁处理装置包括:
[0016] 获取模块, 用于获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目 标事项进行第一次加锁操作的请求;
[0017] 第一生成模块, 用于生成所述目标事项唯一对应的锁数据;
[0018] 第二生成模块, 用于根据所述锁数据生成锁区块, 所述锁区块的区块体中包含 所述锁数据;
[0019] 广播模块, 用于将所述锁区块广播至所述区块链中;
[0020] 控制模块, 用于通过所述区块链中所述锁区块的所述锁数据控制所述目标事项 处于加锁状态。
[0021] 一种计算机设备, 包括存储器、 处理器以及存储在所述存储器中并可在所述处 理器上运行的计算机可读指令, 所述处理器执行所述计算机可读指令时实现上 述基于区块链的锁处理方法。
[0022] 一个或多个存储有计算机可读指令的可读存储介质, 所述计算机可读指令被一 个或多个处理器执行时, 使得所述一个或多个处理器执行时实现上述基于区块 链的锁处理方法。
[0023] 本申请的一个或多个实施例的细节在下面的附图和描述中提出, 本申请的其他 特征和优点将从说明书、 附图以及权利要求变得明显。
[0024]
[0025] 附图说明
[0026] 为了更清楚地说明本申请实施例的技术方案, 下面将对本申请实施例的描述中 所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本申 请的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前 提下, 还可以根据这些附图获得其他的附图。
[0027] 图 1是本申请一实施例中基于区块链的锁处理方法的一应用环境示意图;
[0028] 图 2是本申请一实施例中基于区块链的锁处理方法的一流程示意图;
[0029] 图 3是本申请一实施例中基于区块链的锁处理方法的一流程示意图;
[0030] 图 4是本申请一实施例中基于区块链的锁处理方法的一流程示意图;
[0031] 图 5是本申请一实施例中基于区块链的锁处理方法的一流程示意图;
[0032] 图 6是本申请一实施例中基于区块链的锁处理装置的一结构示意图;
[0033] 图 7是本申请一实施例中计算机设备的一结构示意图。
[0034]
[0035] 具体实施方式
[0036] 下面将结合本申请实施例中的附图, 对本申请实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本申请一部分实施例, 而不是全部的实 施例。 基于本申请中的实施例, 本领域普通技术人员在没有作出创造性劳动前 提下所获得的所有其他实施例, 都属于本申请保护的范围。
[0037] 在对本申请实施例进行描述之前, 先对本申请实施例涉及到的术语、 应用场景 进行简单的介绍:
[0038] 请参阅图 1所示的基于区块链的分布式锁处理系统, 该分布式锁处理系统包括 分布式节点服务器集群以及区块链处理装置, 上述分布式节点服务器集群组成 分布式系统, 示例性的, 上述分布式系统可以是指网站分布式系统, 具体这里 不做限定。 上述分布式节点服务器集群的每个节点服务器均可以正常工作, 且 每个节点服务器之间能进行通信。 本申请实施例提供的基于区块链的锁处理方 法中, 可应用在如图 1的所示的系统架构中的区块链处理装置中, 区块链处理装 置与分布式系统中的各个节点服务器连接。 需要说明的是, 在具体应用中, 上 述各个节点服务器, 可以用独立的服务器或者是多个服务器组成的服务器集群 来实现, 本申请实施例也不做限定。
[0039] 对于分布式节点服务器集群的每个节点服务器均设有对应的节点标识, 另外, 分布式节点服务器集群的每个节点服务器均存储有锁处理系统的其他节点服务 器的节点标识, 以便后续根据其他节点服务器的节点标识, 将生成的区块广播 至锁处理系统的其他节点服务器中。 示例性的, 每个节点服务器可维护一张节 点标识列表, 将锁处理系统中各个节点服务器的节点标识和节点名称对应保存 在该节点标识列表中, 示例性的, 可用每个节点服务器的硬件地址或网络地址 或其他可唯一标识节点服务器的标识信息作为上述节点标识, 在本申请实施例 不做具体限定。
[0040] 需要说明的是, 该分布式锁处理系统中的每个节点服务器均存储一条相同的区 块链, 其中, 每个区块链由多个区块组成, 创始区块中包括区块头和区块体, 区块头中存储有区块头特征值、 版本号等区块基础信息, 区块体中存储有区块 数据, 而创始区块的下一区块以创始区块作为父区块, 下一区块同样包括区块 头和区块体, 而下一区块的区块头中存储有当前区块的区块头特征值、 父区块 的区块头特征值、 版本号等区块基础信息, 并以此类推, 使得区块链中的每个 区块中存储的区块数据均与父区块中存储的区块数据存在关联, 保证区块中区 块数据的不可篡改性和延续性。
[0041] 本申请在于通过上述区块链处理装置实现分布式锁的功能, 其中, 锁是控制分 布式系统之间同步访问共享资源的一种方式。 在分布式系统中, 常常需要协调 分布式系统中不同系统或同个系统不同主机 (节点服务器) 之间的动作。 如果 不同的系统或是同一个系统的不同主机之间共享了一个或一组资源 (示例性的 , 该资源可以是指某个调用方法、 数据、 或变量) 或者其他互斥的执行某种任 务的情形, 那么访问这些资源或互斥的执行某种任务的情形的时候, 往往需要 互斥来防止彼此干扰来保证一致性, 在这种情况下, 便需要使用到分布式锁。
[0042] 在本申请中, 提出了一种基于区块链的锁处理方法, 应用于锁处理系统中的区 块链处理装置中, 通过区块链处理装置以及区块链实现分布式锁的功能, 获取 锁请求, 其中, 所述锁请求用于请求对目标事项进行所述锁请求对应的锁操作 ; 获取所述锁请求对应的锁数据; 并通过所述锁数据以及所述区块链控制所述 目标事项的锁状态。 下面对本申请进行详细的描述:
[0043] 请参阅图 2, 图 2为本申请一种基于区块链的锁处理方法一个实施流程示意图, 该方法应用于锁处理系统中的区块链处理装置中, 所述锁处理系统还包括分布 式节点服务器集群, 所述分布式节点服务器集群的每个节点服务器存储有所述 区块链, 包括如下步骤:
[0044] S10: 获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目标事项进 行第一次加锁操作的请求。
[0045] 可以理解, 在软件领域, 例如大数据计算领域, 经常会有分布式系统的部署, 以便并行高效的进行大数据量的计算、 运行。 在分布式系统中, 经常会有进程 间互斥的访问某种资源 (示例性的, 该资源可以是指某个调用方法或数据或变 量) 或者互斥的执行某种任务的情形, 在本申请实施例中, 将进程需要访问某 种资源或者执行某种任务称为事项, 本申请实施例中的目标事项指的是上述事 项中的其中任意一个, 在进程需要访问某种资源或者执行某种任务称为事项时 会生成加锁请求, 该加锁请求用于请求对目标事项进行加锁操作, 需要说明的 是, 上述进程具体可以是客户端触发的进程、 也可以是指集群服务器中的节点 服务器触发的进程, 具体这里不做限定。 值得注意的是, 在实际应用中, 对于 分布式系统而言, 通常会存在多个进程并存的情况, 当上述多个进程均是用于 互斥访问某种资源或者执行某种任务时, 均可生成各自的加锁请求, 用于请求 对进程对应的事项进行加锁操作。
[0046] 例如对于某个消息, 只能被集群服务器中一台节点服务器处理即可, 多台节点 服务器处理则会造成严重问题, 例如机器崩溃。 又例如对于某个文件, 同一时 间只允许单个进程读写, 如果被多个进程读写, 也会造成严重问题, 因此需要 锁功能。 在本申请实施例中, 当有进程需有进程间互斥的访问某种资源或者互 斥的执行某种任务时, 会生成加锁请求, 并向区块链处理装置发送该加锁请求 , 对于区块链处理装置而言, 区块链处理装置可以获取到上述加锁请求, 具体 地, 在本申请实施例中, 当有进程需有进程间互斥的第一次访问某种资源或者 互斥的执行某种任务且为时, 会生成上述首次加锁请求, 用于请求对目标事项 进行第一次加锁操作的请求。 并向区块链处理装置发送该首次加锁请求, 对于 区块链处理装置而言, 区块链处理装置可以获取到上述首次加锁请求。
[0047] S20: 生成所述目标事项唯一对应的锁数据。
[0048] 在区块链处理装置接收到上述首次加锁请求时, 生成所述目标事项唯一对应的 锁数据。 需要说明的是, 区块链处理装置可以利用常规的随机数生成算法随机 生成上述锁数据, 并用标识唯一标识该锁数据与目标事项的对应关系。 例如, 上述随机数生成算法具体可以是指数值概率算法、 蒙特卡洛算法、 舍伍德算法 等, 具体本申请实施例不做限定, 具体的生成锁数据的过程这里也不展开描述
[0049] S30: 根据所述锁数据生成锁区块, 所述锁区块的区块体中包含所述锁数据。
[0050] 在区块链处理装置生成锁数据后, 根据所述锁数据生成锁区块, 所述锁区块的 区块体中包含所述锁数据。 具体地, 在实现中, 可根据预设特征值算法计算所 述锁数据的特征值作为当前区块头的区块头特征值, 利用锁数据以及区块链中 锁区块的上一区块生成上述锁区块, 也就是说, 当前生成锁区块的区块头中存 储有当前锁区块的区块头特征值、 父区块的区块头特征值、 版本号等区块基础 信息, 使得区块链中的当前生成的锁区块中存储的区块数据均与父区块中存储 的区块数据存在关联, 保证区块中区块数据的不可篡改性和延续性, 具体地关 于生成区块的过程这里不展开描述。
[0051] S40: 将所述锁区块广播至所述区块链中。
[0052] 在生成上述锁区块后, 将所述锁区块广播至所述区块链中。
[0053] S50: 通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加锁 状态。
[0054] 其中, 通过锁数据以及区块链控制目标事项处于加锁状态指的是, 将锁数据以 区块的形式存储至区块链中, 通过存储在区块链中的锁数据来控制目标事项处 于加锁状态。 可以理解, 由于区块链中数据不可篡改性以及去中心化的特点, 当其中一台节点服务器宕机时, 其他节点服务器存储的区块链中任然有上述锁 数据, 也就是说, 区块链以及锁数据任然可控制目标事项的锁状态, 包括加锁 状态, 因此, 通过本申请实施, 可有效地避免集中式的 redis服务器或数据库出现 宕机等情况时, 基于 redis或数据库的分布式锁的功能无法进行的情况, 有效地保 证能实行分布式锁的功能, 从而提高分布式锁实行的成功率。
[0055] 在一实施例中, 步骤 S50中, 也即所述通过所述区块链中所述锁区块的所述锁 数据控制所述目标事项处于加锁状态, 具体通过以下方式控制所述目标事项处 于加锁状态: 通过调用所述区块链的预设智能合约接口将所述锁区块的所述加 锁数据置为可用状态, 其中, 当所述加锁数据为可用状态时所述目标事项处于 所述加锁状态。
[0056] 在一实施例中, 上述区块链可以采用 Hyperledger
Fabri的区块链结构, Hyperledger Fabri是一个提供分布式账本解决方案的平台, 该 Hyperledger Fabri作为开发模块化体系结构的区块链应用程序的基础, 有助于 诸如共识和会员服务等组件实现即插即用, 使用容器技术来托管构成系统应用 逻辑的智能合约。 需要说明的是, 区块链上的智能合约是一套以数字形式定义 的承诺 (promises) , 包括智能合约参与方可以在上面执行这些承诺的协议, 是 区块链上满足触发条件会自动执行的自动化脚本或代码。 本实施例中, 示例性 的, 可以使用 Go (The Go Programming Language, Golang) 语言开发智能合约 , 当需要对区块链进行查询或写入区块数据 (也即) 时, 可以智能合约的接口 , 也就是区块链的接口, 以完成对该区块链上区块数据的查询和读写, 基于 Hyp erledger Fabri的共识机制, 可以预先搭建区块链的共识, 并部署智能合约。 具体 地, 在本申请实施例中, 可通过部署预设智能合约, 该预设智能合约定义了目 标事项对应的锁数据的状态, 包括可用状态以及不可用状态, 可通过调用预设 智能合约接口的方式改变锁数据的状态是处于可用状态还是不可用状态。 值得 注意的是, 锁数据的状态处于可用状态时, 可查询到该锁数据, 锁数据的状态 为不可用状态时, 查询不到上述锁数据, 但锁数据无法被删除或篡改。
[0057] 其中, 当所述锁数据为可用状态时所述目标事项处于所述加锁状态, 此时说明 该目标事项已经被锁定, 其他进程无法执行上述目标事项, 直至该目标事项被 解锁。 将锁区块广播至区块链之后, 锁区块作为区块链中新增的区块, 锁区块 对应的锁数据也存储在区块链上。 可用理解的是, 区块链中的区块数据不可删 除, 也不可修改, 但可以控制区块数据的状态, 在本申请实施例中, 通过在区 块链中部署预设智能合约控制各个区块的状态, 该预设智能合约用于控制区块 的区块数据的状态是否可用, 具体地, 区块链处理装置可调用上述预设智能合
约的接口, 向区块链发送状态控制信息, 当区块链当接收到将使得锁区块的锁 数据为可用状态时的状态信息时, 将所述区块链中的所述锁数据置为可用状态
[0058] 结合上述实施例, 在一实施例中, 如图 3所示, S50之后, 也即所述通过调用所 述区块链的预设智能合约接口将所述锁区块的所述加锁数据置为可用状态之后 , 具体包括如下步骤:
[0059] S60: 生成针对所述加锁状态的解锁定时器, 并启动所述解锁定时器。
[0060] S70: 当所述解锁定时器的定时时长超过预设阈值时, 将所述区块链中的所述 锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时所述目标事项处 于所述解锁状态。
[0061] 其中, 解锁定时器的定时时长可以预先配置, 具体这里不做限定。 当所述解锁 定时器的定时时长超过预设阈值时, 将所述区块链中的所述锁数据置为不可用 状态。 本申请实施例中, 通过在区块链中部署智能合约控制各个区块的状态, 该智能合约用于控制区块的区块数据的状态是否可用, 具体地, 区块链处理装 置可调用上述预设智能合约的接口, 向区块链发送状态控制信息, 当区块链当 接收到将使得锁区块的锁数据为不可用状态时的状态信息时, 将所述区块链中 的所述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时所述目标 事项处于所述解锁状态, 此时说明目标事项被解锁。 通过设置解锁定时器的目 的是在于带来造成死锁, 造成其他进程无法执行上述目标事项。
[0062] 在一实施例中, 也即所述通过调用所述区块链的预设智能合约接口将所述锁区 块的所述加锁数据置为可用状态之后, 还可以通过以下方式控制所述目标事项 处于解锁状态: 当接收到用于对所述目标事项进行解锁操作的解锁请求时, 通 过调用所述区块链的预设智能合约接口将所述区块链中的所述锁数据置为不可 用状态, 其中, 当所述锁数据为不可用状态时所述目标事项处于所述解锁状态 , 所述解锁请求与所述首次加锁请求为同一请求方发起的请求。 可用理解, 在 本申请实施例中, 请求方针对某个事项的进行加锁操作时, 只有相同的请求方 才可以对该某个事项进行解锁操作。 因此对目标事项进行加锁后, 当该进程不 需要再占用该目标事项时 (示例性的, 当不需要再调用某个方法、 数据、 变量
) 会生成解锁请求, 并向区块链处理装置发送该解锁请求, 对于区块链处理装 置而言, 可以接收到解锁请求, 当接收到用于对所述目标事项进行解锁操作的 解锁请求时, 将所述区块链中的所述锁数据置为不可用状态, 其中, 当所述锁 数据为不可用状态时所述目标事项处于所述解锁状态。 具体地, 区块链处理装 置可调用上述智能合约的接口, 向区块链发送状态控制信息, 当区块链当接收 到将使得锁区块的锁数据为不可用状态时的状态信息时, 将所述区块链中的所 述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时所述目标事项 处于所述解锁状态, 此时说明目标事项被解锁。 通过设置解锁定时器的目的是 在于带来造成死锁, 造成其他进程无法执行上述目标事项。
[0063] 在一实施例中, 如图 4所示, 步骤 S50之后, 也即所述通过调用所述区块链的预 设智能合约接口将所述锁区块的所述加锁数据置为可用状态之后, 还包括如下 步骤:
[0064] S80: 获取非首次加锁请求, 所述非首次加锁请求用于对所述目标事项进行加 锁操作。
[0065] 可以理解, 由于各个进程间存在竞争关系, 当进程在针对目标事项发起首次加 锁请求进行加锁且该目标事项被解锁后, 该进程可继续发起加锁请求, 此时的 加锁请求为针对目标事项的非首次请求; 另外, 当进程在针对目标事项发起首 次加锁请求进行加锁之后, 其他进程也可有可能会发起用于对所述目标事项进 行加锁操作的加锁请求, 此时的加锁请求也是针对目标事项的非首次请求, 对 于区块链处理装置而言, 可获取到上述非首次加锁请求。
[0066] S90: 确定所述区块数据中的所述锁数据是否为可用状态。
[0067] 当接收到用于对所述目标事项进行加锁操作的非首次加锁请求时, 可以获取所 述区块链中的区块数据, 需要说明的是, 在前述描述中已经提到, 若区块链处 理装置曾根据首次加锁请求对目标事项进行加锁操作过, 则区块链中的区块数 据已经包含上述与目标事项唯一对应的锁数据, 具体地, 可通过字段对比的方 式将目标事项唯一的锁数据与从区块链中获取的区块数据进行查询对比, 以确 定区块链中的区块数据是否包含上述与目标事项唯一对应的锁数据。 若区块链 中的区块数据未包含上述与目标事项唯一对应的锁数据, 则说明未曾对所述目
标事项进行加锁操作过, 该目标事项的锁状态未被处理过, 此时可按照上述步 骤 S1-S50的方式对目标事项进行加锁操作, 具体这里不再重复赘述。 在本申请实 施例中, 由于为针对目标事项的非首次加锁请求, 因此区块数据中肯定包含有 针对目标事项的锁数据, 因此, 当获取非首次加锁请求之后, 可确定所述区块 数据中的所述锁数据是否为可用状态。
[0068] S100: 若确定所述区块数据中的所述锁数据为可用状态, 则确定所述目标事项 处于所述加锁状态, 并针对所述非首次加锁请求反馈用于指示所述目标事项已 被锁的指示信息。
[0069] 可以理解, 锁数据的状态为用于体现该锁数据对应的目标事项的锁情况的状态 , 具体地, 可通过查询区块链中的区块数据, 以确定是否能查询到上述锁数据 , 若查询不到, 说明目标事项对应的锁数据处于不可用状态, 也就是说明目标 事项处于锁状态, 若查询得到, 说明目标事项对应的锁数据处于可用状态, 也 就是说了目标事项处于加锁状态。 若确定所述区块数据中的所述锁数据为可用 状态, 则确定所述目标事项处于加锁状态, 并针对所述非首次加锁请求反馈用 于指示所述目标事项已被锁的指示信息, 此时, 发起非首次加锁请求的进程则 进行等待, 直至目标事项被解锁。
[0070] S110: 若确定区块数据中的锁数据为不可用状态, 则通过调用所述预设智能合 约接口将所述锁数据置为可用状态, 以控制所述目标事项处于加锁状态。
[0071] 若确定区块数据中的锁数据为不可用状态, 则将所述锁数据置为可用状态以对 所述目标事项进行加锁, 此时, 说明该目标事项被发起非首次加锁请求的进程 所锁定, 其他进程无法占用。
[0072] 在一实施例中, 如图 5所示, 步骤 S40中, 将所述锁区块广播至所述区块链中, 具体包括如下步骤:
[0073] S41: 获取所述节点服务器集群中各个节点服务器的节点标识。
[0074] S42: 根据所述节点标识将所述锁区块广播至所述节点标识对应的节点服务器 的区块链中。
[0075] 对于步骤 S41-S42, 如前面所述, 对于基于区块链的锁处理系统的每个节点服 务器均有对应的节点标识, 另外, 每个节点服务器均存储有基于区块链的锁处
理系统的其他节点服务器的节点标识, 因此, 可以获取所述区块链中的各个节 点服务器的节点标识。 也就是说, 根据基于区块链的锁处理系统中其他节点服 务器的节点标识, 将新生成的锁区块广播至基于区块链的会话数据处理系统的 其他节点服务器中, 以使得其他节点服务器将该新生成的锁区块加入存储的区 块链中, 实现区块链数据 (也即每个目标事项对应的锁数据) 在基会话数据处 理系统的共享。 由此可见, 当基于区块链的锁系统的任意一个节点服务器出现 宕机时, 锁数据并不会消失从而影响到锁功能的进行, 有效地保证了各个节点 服务器的锁数据的有效性, 也就有效地保证了锁功能的实现。
[0076] 应理解, 上述实施例中各步骤的序号的大小并不意味着执行顺序的先后, 各过 程的执行顺序应以其功能和内在逻辑确定, 而不应对本申请实施例的实施过程 构成任何限定。
[0077]
[0078] 在一实施例中, 提供一种基于区块链的锁处理装置, 所述锁处理装置应用于锁 处理系统中, 所述锁处理系统还包括分布式节点服务器集群, 所述分布式节点 服务器集群的每个节点服务器保存有所述区块链, 该基于区块链的锁处理装置 与上述实施例中基于区块链的锁处理方法一一对应。 如图 6所示, 该基于区块链 的锁处理装置 10包括获取模块 101、 第一生成模块 102、 第二生成模块 103、 广播 模块 104和控制模块 105。 各功能模块详细说明如下:
[0079] 获取模块 101, 用于获取首次加锁请求, 其中, 所述首次加锁请求为用于请求 对目标事项进行第一次加锁操作的请求;
[0080] 第一生成模块 102, 用于生成所述目标事项唯一对应的锁数据;
[0081] 第二生成模块 103 , 用于根据所述第一生成模块 102生成的所述锁数据生成锁区 块, 所述锁区块的区块体中包含所述锁数据;
[0082] 广播模块 104, 用于将所述第二生成模块 103生成的所述锁区块广播至所述区块 链中;
[0083] 控制模块 105 , 用于通过所述广播模块 104广播至所述区块链中所述锁区块的所 述锁数据控制所述目标事项处于加锁状态。
[0084] 在一实施例中, 所述控制模块具体用于:
[0085] 通过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数据置为可 用状态, 其中, 当所述加锁数据为可用状态时所述目标事项处于所述加锁状态
[0086] 在一实施例中, 所述基于区块链的锁处理装置还包括第三生成模块;
[0087] 所述第三生成模块, 用于所述控制模块通过调用所述区块链的预设智能合约接 口将所述锁区块的所述加锁数据置为可用状态之后, 生成针对所述加锁状态的 解锁定时器, 并启动所述解锁定时器;
[0088] 所述控制模块还用于: 当所述解锁定时器的定时时长超过预设阈值时, 将所述 区块链中的所述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时 所述目标事项处于所述解锁状态。
[0089] 在一实施例中, 所述控制模块, 还用于通过过调用所述区块链的预设智能合约 接口将所述锁区块的所述加锁数据置为可用状态之后, 当接收到用于对所述目 标事项进行解锁操作的解锁请求时, 通过调用所述区块链的预设智能合约接口 将所述区块链中的所述锁数据置为不可用状态, 其中, 当所述锁数据为不可用 状态时所述目标事项处于所述解锁状态, 所述解锁请求与所述首次加锁请求为 同一请求方发起的请求。
[0090] 在一实施例中, 所述获取模块还用于: 所述控制模块通过调用所述区块链的预 设智能合约接口将所述锁区块的所述加锁数据置为可用状态之后, 获取非首次 加锁请求, 所述非首次加锁请求用于对所述目标事项进行加锁操作;
[0091] 所述控制模块还用于: 确定所述区块数据中的所述锁数据是否为可用状态; 若 确定所述区块数据中的所述锁数据为可用状态, 则确定所述目标事项处于所述 加锁状态, 并针对所述非首次加锁请求反馈用于指示所述目标事项已被锁的指 示信息; 若确定区块数据中的锁数据为不可用状态, 则通过调用所述预设智能 合约接口将所述锁数据置为可用状态, 以控制所述目标事项处于加锁状态。
[0092] 在一实施例中, 所述广播模块具体用于: 获取所述节点服务器集群中各个节点 服务器的节点标识; 根据所述节点标识将所述锁区块广播至所述节点标识对应 的节点服务器的区块链中。
[0093] 关于基于区块链的锁处理装置的具体限定可以参见上文中对于基于区块链的锁
处理方法的限定, 在此不再赘述。 上述基于区块链的锁处理装置中的各个模块 可全部或部分通过软件、 硬件及其组合来实现。 上述各模块可以硬件形式内嵌 于或独立于计算机设备中的处理器中, 也可以以软件形式存储于计算机设备中 的存储器中, 以便于处理器调用执行以上各个模块对应的操作。
[0094] 在一个实施例中, 提供了一种计算机设备, 该计算机设备可以是用于实现上述 基于区块链的锁处理装置的功能, 其内部结构图可以如图 7所示。 该计算机设备 包括通过系统总线连接的处理器、 存储器、 网络接口和数据库。 其中, 该计算 机设备的处理器用于提供计算和控制能力。 该计算机设备的存储器包括非易失 性存储介质、 内存储器。 该非易失性存储介质存储有操作系统、 计算机可读指 令和数据库。 该内存储器为非易失性存储介质中的操作系统和计算机可读指令 的运行提供环境。 该计算机设备的数据库用于临时存储锁数据并建立对应锁数 据与事项的对应关系。 该计算机设备的网络接口用于与外部的终端通过网络连 接通信。 该计算机可读指令被处理器执行时以实现一种基于区块链的锁处理方 法。
[0095] 在一个实施例中, 提供了一种计算机设备, 包括存储器、 处理器及存储在存储 器上并可在处理器上运行的计算机可读指令, 处理器执行计算机可读指令时实 现以下步骤:
[0096] 获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目标事项进行第一 次加锁操作的请求;
[0097] 生成所述目标事项唯一对应的锁数据;
[0098] 根据所述锁数据生成锁区块, 所述锁区块的区块体中包含所述锁数据;
[0099] 将所述锁区块广播至所述区块链中;
[0100] 通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加锁状态。
[0101] 在一个实施例中, 一个或多个存储有计算机可读指令的可读存储介质, 所述可 读存储介质包括非易失性可读存储介质和易失性可读存储介质, 所述计算机可 读指令被一个或多个处理器执行时, 使得所述一个或多个处理器执行如下步骤
[0102] 获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目标事项进行第一
次加锁操作的请求;
[0103] 生成所述目标事项唯一对应的锁数据;
[0104] 根据所述锁数据生成锁区块, 所述锁区块的区块体中包含所述锁数据;
[0105] 将所述锁区块广播至所述区块链中;
[0106] 通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加锁状态。
[0107] 本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可 以通过计算机可读指令来指令相关的硬件来完成, 所述的计算机可读指令可存 储于一可读取存储介质中, 该计算机可读指令在执行时, 可包括如上述各方法 的实施例的流程。 其中, 本申请所提供的各实施例中所使用的对存储器、 存储 、 数据库或其它介质的任何引用, 均可包括非易失性和 /或易失性存储器。 非易 失性存储器可包括只读存储器 (ROM) 、 可编程 ROM (PROM) 、 电可编程 RO M (EPROM) 、 电可擦除可编程 ROM (EEPROM) 或闪存。 易失性存储器可包 括随机存取存储器 (RAM) 或者外部高速缓冲存储器。 作为说明而非局限, RA M以多种形式可得, 诸如静态 RAM (SRAM) 、 动态 RAM (DRAM) 、 同步 DR AM (SDRAM) 、 双数据率 SDRAM (DDRSDRAM) 、 增强型 SDRAM (ESDR AM) 、 同步链路 (Synchlink) DRAM (SLDRAM) 、 存储器总线 (Rambus) 直接 RAM (RDRAM) 、 直接存储器总线动态 RAM (DRDRAM) 、 以及存储器 总线动态 RAM (RDRAM) 等。
[0108] 所属领域的技术人员可以清楚地了解到, 为了描述的方便和简洁, 仅以上述各 功能单元、 模块的划分进行举例说明, 实际应用中, 可以根据需要而将上述功 能分配由不同的功能单元、 模块完成, 即将所述装置的内部结构划分成不同的 功能单元或模块, 以完成以上描述的全部或者部分功能。
[0109] 以上所述实施例仅用以说明本申请的技术方案, 而非对其限制; 尽管参照前述 实施例对本申请进行了详细的说明, 本领域的普通技术人员应当理解: 其依然 可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分技术特征进 行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本申请各 实施例技术方案的精神和范围, 均应包含在本申请的保护范围之内。
Claims
[权利要求 1] 一种基于区块链的锁处理方法, 应用于锁处理系统中的区块链处理装 置中, 其特征在于, 所述锁处理系统还包括分布式节点服务器集群, 所述分布式节点服务器集群的每个节点服务器保存有所述区块链, 所 述方法包括:
获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目标事项 进行第一次加锁操作的请求;
生成所述目标事项唯一对应的锁数据;
根据所述锁数据生成锁区块, 所述锁区块的区块体中包含所述锁数据 将所述锁区块广播至所述区块链中;
通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加 锁状态。
[权利要求 2] 如权利要求 1所述的基于区块链的锁处理方法, 其特征在于, 所述通 过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加锁 状态, 包括:
通过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数 据置为可用状态, 其中, 当所述加锁数据为可用状态时所述目标事项 处于所述加锁状态。
[权利要求 3] 如权利要求 2所述的基于区块链的锁处理方法, 其特征在于, 所述通 过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数据 置为可用状态之后, 所述方法还包括:
生成针对所述加锁状态的解锁定时器, 并启动所述解锁定时器; 当所述解锁定时器的定时时长超过预设阈值时, 将所述区块链中的所 述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时所述 目标事项处于所述解锁状态。
[权利要求 4] 如权利要求 2所述的基于区块链的锁处理方法, 其特征在于, 所述通 过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数据
置为可用状态之后, 所述方法还包括:
当接收到用于对所述目标事项进行解锁操作的解锁请求时, 通过调用 所述区块链的预设智能合约接口将所述区块链中的所述锁数据置为不 可用状态, 其中, 当所述锁数据为不可用状态时所述目标事项处于所 述解锁状态, 所述解锁请求与所述首次加锁请求为同一请求方发起的 请求。
[权利要求 5] 如权利要求 1-4任一项所述的基于区块链的锁处理方法, 其特征在于
, 所述通过调用所述区块链的预设智能合约接口将所述锁区块的所述 加锁数据置为可用状态之后, 所述方法还包括: 获取非首次加锁请求, 所述非首次加锁请求用于对所述目标事项进行 加锁操作;
确定所述区块数据中的所述锁数据是否为可用状态;
若确定所述区块数据中的所述锁数据为可用状态, 则确定所述目标事 项处于所述加锁状态, 并针对所述非首次加锁请求反馈用于指示所述 目标事项已被锁的指示信息;
若确定区块数据中的锁数据为不可用状态, 则通过调用所述预设智能 合约接口将所述锁数据置为可用状态, 以控制所述目标事项处于加锁 状态。
[权利要求 6] 如权利要求 1-4任一项所述的基于区块链的锁处理方法, 其特征在于
, 所述将所述锁区块广播至所述区块链中, 包括: 获取所述节点服务器集群中各个节点服务器的节点标识;
根据所述节点标识将所述锁区块广播至所述节点标识对应的节点服务 器的区块链中。
[权利要求 7] —种基于区块链的锁处理装置, 所述锁处理装置应用于锁处理系统中
, 其特征在于, 所述锁处理系统还包括分布式节点服务器集群, 所述 分布式节点服务器集群的每个节点服务器保存有所述区块链, 所述锁 处理装置包括:
获取模块, 用于获取首次加锁请求, 其中, 所述首次加锁请求为用于
请求对目标事项进行第一次加锁操作的请求;
第一生成模块, 用于生成所述目标事项唯一对应的锁数据; 第二生成模块, 用于根据所述第一生成模块生成的所述锁数据生成锁 区块, 所述锁区块的区块体中包含所述锁数据; 广播模块, 用于将所述第二生成模块生成的所述锁区块广播至所述区 块链中;
控制模块, 用于通过所述广播模块广播至所述区块链中所述锁区块的 所述锁数据控制所述目标事项处于加锁状态。
[权利要求 8] 如权利要求 7所述的基于区块链的锁处理装置, 其特征在于, 所述控 制模块具体用于:
通过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数 据置为可用状态, 其中, 当所述加锁数据为可用状态时所述目标事项 处于所述加锁状态。
[权利要求 9] 如权利要求 8所述的基于区块链的锁处理装置, 其特征在于, 所述控 制模块还用于:
通过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数 据置为可用状态之后, 生成针对所述加锁状态的解锁定时器, 并启动 所述解锁定时器;
当所述解锁定时器的定时时长超过预设阈值时, 将所述区块链中的所 述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时所述 目标事项处于所述解锁状态。
[权利要求 10] 如权利要求 8所述的基于区块链的锁处理装置, 其特征在于, 所述控 制模块还用于:
通过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数 据置为可用状态之后, 当接收到用于对所述目标事项进行解锁操作的 解锁请求时, 通过调用所述区块链的预设智能合约接口将所述区块链 中的所述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态 时所述目标事项处于所述解锁状态, 所述解锁请求与所述首次加锁请
求为同一请求方发起的请求。
[权利要求 11] 一种计算机设备, 包括存储器、 处理器以及存储在所述存储器中并可 在所述处理器上运行的计算机可读指令, 其特征在于, 所述处理器执 行所述计算机可读指令时实现如下步骤:
获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目标事项 进行第一次加锁操作的请求;
生成所述目标事项唯一对应的锁数据;
根据所述锁数据生成锁区块, 所述锁区块的区块体中包含所述锁数据 将所述锁区块广播至所述区块链中;
通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加 锁状态。
[权利要求 12] 如权利要求 11所述的计算机设备, 其特征在于, 所述通过所述区块链 中所述锁区块的所述锁数据控制所述目标事项处于加锁状态, 包括: 通过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数 据置为可用状态, 其中, 当所述加锁数据为可用状态时所述目标事项 处于所述加锁状态。
[权利要求 13] 如权利要求 12所述的计算机设备, 其特征在于, 所述通过调用所述区 块链的预设智能合约接口将所述锁区块的所述加锁数据置为可用状态 之后, 所述处理器执行所述计算机可读指令时还实现如下步骤: 生成针对所述加锁状态的解锁定时器, 并启动所述解锁定时器; 当所述解锁定时器的定时时长超过预设阈值时, 将所述区块链中的所 述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时所述 目标事项处于所述解锁状态。
[权利要求 14] 如权利要求 12所述的计算机设备, 其特征在于, 所述通过调用所述区 块链的预设智能合约接口将所述锁区块的所述加锁数据置为可用状态 之后, 所述处理器执行所述计算机可读指令时还实现如下步骤: 当接收到用于对所述目标事项进行解锁操作的解锁请求时, 通过调用
所述区块链的预设智能合约接口将所述区块链中的所述锁数据置为不 可用状态, 其中, 当所述锁数据为不可用状态时所述目标事项处于所 述解锁状态, 所述解锁请求与所述首次加锁请求为同一请求方发起的 请求。
[权利要求 15] 如权利要求 11-14任一项所述的计算机设备, 其特征在于, 所述处理 器执行所述计算机可读指令时还实现如下步骤: 获取所述节点服务器集群中各个节点服务器的节点标识;
根据所述节点标识将所述锁区块广播至所述节点标识对应的节点服务 器的区块链中。
[权利要求 16] 一个或多个存储有计算机可读指令的可读存储介质, 其特征在于, 所 述计算机可读指令被一个或多个处理器执行时, 使得所述一个或多个 处理器执行如下步骤:
获取首次加锁请求, 其中, 所述首次加锁请求为用于请求对目标事项 进行第一次加锁操作的请求;
生成所述目标事项唯一对应的锁数据;
根据所述锁数据生成锁区块, 所述锁区块的区块体中包含所述锁数据 将所述锁区块广播至所述区块链中;
通过所述区块链中所述锁区块的所述锁数据控制所述目标事项处于加 锁状态。
[权利要求 17] 如权利要求 16所述的可读存储介质, 其特征在于, 所述通过所述区块 链中所述锁区块的所述锁数据控制所述目标事项处于加锁状态, 包括 通过调用所述区块链的预设智能合约接口将所述锁区块的所述加锁数 据置为可用状态, 其中, 当所述加锁数据为可用状态时所述目标事项 处于所述加锁状态。
[权利要求 18] 如权利要求 17所述的可读存储介质, 其特征在于, 所述通过调用所述 区块链的预设智能合约接口将所述锁区块的所述加锁数据置为可用状
态之后, 所述计算机可读指令被一个或多个处理器执行时, 使得所述 一个或多个处理器还执行如下步骤:
生成针对所述加锁状态的解锁定时器, 并启动所述解锁定时器; 当所述解锁定时器的定时时长超过预设阈值时, 将所述区块链中的所 述锁数据置为不可用状态, 其中, 当所述锁数据为不可用状态时所述 目标事项处于所述解锁状态。
[权利要求 19] 如权利要求 17所述的可读存储介质, 其特征在于, 所述通过调用所述 区块链的预设智能合约接口将所述锁区块的所述加锁数据置为可用状 态之后, 所述计算机可读指令被一个或多个处理器执行时, 使得所述 一个或多个处理器还执行如下步骤:
当接收到用于对所述目标事项进行解锁操作的解锁请求时, 通过调用 所述区块链的预设智能合约接口将所述区块链中的所述锁数据置为不 可用状态, 其中, 当所述锁数据为不可用状态时所述目标事项处于所 述解锁状态, 所述解锁请求与所述首次加锁请求为同一请求方发起的 请求。
[权利要求 20] 如权利要求 16-19任一项所述的可读存储介质, 其特征在于, 所述计 算机可读指令被一个或多个处理器执行时, 使得所述一个或多个处理 器还执行如下步骤:
获取所述节点服务器集群中各个节点服务器的节点标识;
根据所述节点标识将所述锁区块广播至所述节点标识对应的节点服务 器的区块链中。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910072940.4 | 2019-01-25 | ||
| CN201910072940.4A CN109828847B (zh) | 2019-01-25 | 2019-01-25 | 基于区块链的锁处理方法、装置、计算机设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020151313A1 true WO2020151313A1 (zh) | 2020-07-30 |
Family
ID=66862546
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/117300 Ceased WO2020151313A1 (zh) | 2019-01-25 | 2019-11-12 | 基于区块链的锁处理方法、装置、计算机设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109828847B (zh) |
| WO (1) | WO2020151313A1 (zh) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115269624A (zh) * | 2022-08-09 | 2022-11-01 | 携程旅游信息技术(上海)有限公司 | 一种redis操作的控制方法、系统、电子设备及介质 |
| US20230039066A1 (en) * | 2019-12-10 | 2023-02-09 | Jingdong Technology Information Technology Co., Ltd. | Method, apparatus, adapter and system for cross-chain data access of blockchain |
| CN117151712A (zh) * | 2023-10-26 | 2023-12-01 | 腾讯科技(深圳)有限公司 | 区块链交易处理方法、装置、计算机设备和存储介质 |
| CN117331949A (zh) * | 2023-09-15 | 2024-01-02 | 中国银行股份有限公司 | 分布式锁操作执行方法、装置、计算机设备和存储介质 |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109828847B (zh) * | 2019-01-25 | 2023-09-01 | 平安科技(深圳)有限公司 | 基于区块链的锁处理方法、装置、计算机设备及存储介质 |
| CN110490505A (zh) | 2019-06-25 | 2019-11-22 | 北京京东振世信息技术有限公司 | 物流信息处理方法、装置及设备 |
| CN112365630B (zh) * | 2019-07-24 | 2022-06-14 | 华为技术有限公司 | 锁具控制方法、通信装置、通信设备及存储介质 |
| US11941611B2 (en) | 2019-12-11 | 2024-03-26 | Intuit Inc. | Shareable and nested transactions on hash chains |
| CN111190913A (zh) * | 2019-12-30 | 2020-05-22 | 联动优势(北京)数字科技有限公司 | 一种分布式锁实现方法及系统 |
| CN111209593A (zh) * | 2020-01-10 | 2020-05-29 | 杭州溪塔科技有限公司 | 基于区块链的分布式锁处理方法及相关装置和电子设备 |
| CN111522829B (zh) * | 2020-04-14 | 2023-11-28 | 深圳市启迪网络科技有限公司 | 一种区块链上分布式锁实现方法 |
| CN111639309B (zh) * | 2020-05-26 | 2021-08-24 | 腾讯科技(深圳)有限公司 | 一种数据处理方法、装置、节点设备及存储介质 |
| CN111597527B (zh) * | 2020-07-24 | 2020-10-23 | 江苏荣泽信息科技股份有限公司 | 一种基于redis协议的智能合约系统 |
| CN113918654B (zh) * | 2021-12-07 | 2022-04-01 | 深圳前海微众银行股份有限公司 | 一种区块数据提交的方法及装置 |
| CN114745571B (zh) * | 2022-04-15 | 2024-01-23 | 网易(杭州)网络有限公司 | 直播状态信息同步方法、装置、电子设备和可读存储介质 |
| CN114896080B (zh) * | 2022-06-13 | 2023-07-21 | 深圳信息职业技术学院 | 基于区块链技术的分布式系统避免死锁处理方法及装置 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105573828A (zh) * | 2015-12-17 | 2016-05-11 | 布比(北京)网络技术有限公司 | 一种操作处理方法及装置 |
| CN106789875A (zh) * | 2016-11-15 | 2017-05-31 | 深圳市新国都支付技术有限公司 | 一种区块链服务装置、区块链服务系统及其通信方法 |
| CN107045518A (zh) * | 2016-10-18 | 2017-08-15 | 北京天德科技有限公司 | 一种区块链的扩展设计方法 |
| US20170308566A1 (en) * | 2016-04-22 | 2017-10-26 | Transwarp Technology (Shanghai) Co., Ltd. | Method and device for processing distributed transaction |
| CN109828847A (zh) * | 2019-01-25 | 2019-05-31 | 平安科技(深圳)有限公司 | 基于区块链的锁处理方法、装置、计算机设备及存储介质 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109691015B (zh) * | 2016-08-30 | 2022-02-01 | 联邦科学和工业研究组织 | 一种区块链上的动态访问控制方法及系统 |
| US10628057B2 (en) * | 2017-03-28 | 2020-04-21 | Hewlett Packard Enterprise Development Lp | Capability based locking and access of shared persistent memory |
| US11416832B2 (en) * | 2017-07-18 | 2022-08-16 | nChain Holdings Limited | Systems and methods for blockchain-dependent operation sets |
| CN108769150B (zh) * | 2018-05-14 | 2021-11-12 | 百度在线网络技术(北京)有限公司 | 区块链网络的数据处理方法、装置、集群节点和存储介质 |
-
2019
- 2019-01-25 CN CN201910072940.4A patent/CN109828847B/zh active Active
- 2019-11-12 WO PCT/CN2019/117300 patent/WO2020151313A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105573828A (zh) * | 2015-12-17 | 2016-05-11 | 布比(北京)网络技术有限公司 | 一种操作处理方法及装置 |
| US20170308566A1 (en) * | 2016-04-22 | 2017-10-26 | Transwarp Technology (Shanghai) Co., Ltd. | Method and device for processing distributed transaction |
| CN107045518A (zh) * | 2016-10-18 | 2017-08-15 | 北京天德科技有限公司 | 一种区块链的扩展设计方法 |
| CN106789875A (zh) * | 2016-11-15 | 2017-05-31 | 深圳市新国都支付技术有限公司 | 一种区块链服务装置、区块链服务系统及其通信方法 |
| CN109828847A (zh) * | 2019-01-25 | 2019-05-31 | 平安科技(深圳)有限公司 | 基于区块链的锁处理方法、装置、计算机设备及存储介质 |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20230039066A1 (en) * | 2019-12-10 | 2023-02-09 | Jingdong Technology Information Technology Co., Ltd. | Method, apparatus, adapter and system for cross-chain data access of blockchain |
| CN115269624A (zh) * | 2022-08-09 | 2022-11-01 | 携程旅游信息技术(上海)有限公司 | 一种redis操作的控制方法、系统、电子设备及介质 |
| CN117331949A (zh) * | 2023-09-15 | 2024-01-02 | 中国银行股份有限公司 | 分布式锁操作执行方法、装置、计算机设备和存储介质 |
| CN117151712A (zh) * | 2023-10-26 | 2023-12-01 | 腾讯科技(深圳)有限公司 | 区块链交易处理方法、装置、计算机设备和存储介质 |
| CN117151712B (zh) * | 2023-10-26 | 2024-03-26 | 腾讯科技(深圳)有限公司 | 区块链交易处理方法、装置、计算机设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109828847A (zh) | 2019-05-31 |
| CN109828847B (zh) | 2023-09-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020151313A1 (zh) | 基于区块链的锁处理方法、装置、计算机设备及存储介质 | |
| US11888599B2 (en) | Scalable leadership election in a multi-processing computing environment | |
| US8543773B2 (en) | Distributed shared memory | |
| CN113076303B (zh) | 分布式系统中业务标识的生成方法和装置 | |
| CN105700939A (zh) | 一种分布式系统中多线程同步的方法和系统 | |
| CN115145715B (zh) | 一种分布式事务处理方法、系统及相关设备 | |
| WO2022134797A1 (zh) | 一种数据分片存储方法、装置、计算机设备和存储介质 | |
| US12260268B2 (en) | High-performance remote atomic synchronization | |
| JP2023546897A (ja) | オブジェクト処理方法、装置、及びコンピュータ機器 | |
| CN113360272B (zh) | 共享资源的访问处理方法、装置、电子设备和存储介质 | |
| CN110866011B (zh) | 数据表同步方法、装置、计算机设备和存储介质 | |
| CN114528018A (zh) | 基于redis的分布式锁实现方法及系统 | |
| US8996484B2 (en) | Recursive lock-and-propagate operation | |
| CN114185558A (zh) | 基于K8s的原生应用选主方法、装置及存储介质 | |
| CN111651419A (zh) | 数据存储方法、装置及存储介质 | |
| CN117193974B (zh) | 基于多进程/线程的配置请求处理方法及装置 | |
| CN113076187A (zh) | 分布式锁管理方法及装置 | |
| US8918798B2 (en) | Shared object lock under state machine control | |
| CN113806388A (zh) | 基于分布式锁的业务处理方法及装置 | |
| CN115129453B (zh) | 资源调用方法、装置、计算机设备和存储介质 | |
| CN113703907B (zh) | 虚拟化网络功能部署方法、管理与编排平台和介质 | |
| CN111930766A (zh) | 一种分布式锁的服务实现方法、设备、存储介质 | |
| CN116089084B (zh) | 通过一致性Hash去掉分布式定时任务添加分布式锁的方法 | |
| CN114968403B (zh) | 一种分级级联启动方法、装置、设备及存储介质 | |
| CN111177073A (zh) | 一种网络文件系统状态管理方法与装置 |
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: 19911559 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: 19911559 Country of ref document: EP Kind code of ref document: A1 |