Unlock instant, AI-driven research and patent intelligence for your innovation.

Distributed lock implementation method and device, electronic equipment and storage medium

A technology of distributed locks and implementation methods, which is applied in the directions of multi-programming devices, program control design, and electronic digital data processing, etc., which can solve problems such as lock loss, inability to actively release locks, and lock inability to expire, and achieve the effect of reducing consumption

Pending Publication Date: 2022-05-10
CHEZHI HULIAN BEIJING SCI & TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In a distributed environment, the processes may not even be on the same physical machine, so it is necessary to store the mark in a place that all processes can see. After one thread, the lock cannot expire, or the lock cannot be actively released, or the lock is lost

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Distributed lock implementation method and device, electronic equipment and storage medium
  • Distributed lock implementation method and device, electronic equipment and storage medium
  • Distributed lock implementation method and device, electronic equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0049] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0050] figure 1 is a block diagram of an example computing device 100 . In a basic configuration 102 , computing device 100 typically includes system memory 106 and one or more processors 104 . A memory bus 108 may be used for communication between the processor 104 and the system memory 106 .

[0051] Depending on the desired configuration, processor 104 may be any type of processing including, but not limited to, a microprocess...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a distributed lock implementation method and device, electronic equipment and a storage medium. The method comprises the steps that a configured distributed data storage cluster and a connection address and a connection pool of a cluster management mechanism are acquired, keywords of threads needing to be locked are created, and lock calling information is acquired; acquiring an asynchronous monitoring task released by the lock according to the lock calling information; according to the asynchronous monitoring task of the lock release, obtaining information that the service logic execution of the locking thread is completed and the lock release is performed; and deleting the asynchronous monitoring task released by the lock, and obtaining other threads waiting for obtaining the lock to obtain the lock. According to the method and the device, the lock can be automatically continued before the service logic execution of the locking thread is not finished, so that the lock cannot be released in advance, and after the execution of the locking thread is finished, other threads waiting for obtaining the lock timely obtain the message, so that the thread waiting for obtaining the lock is prevented from circularly waiting for requesting for locking all the time, and the consumption of a processor is reduced.

Description

technical field [0001] The invention relates to the technical field of software testing, in particular to an implementation method, device, electronic equipment and storage medium of a distributed lock. Background technique [0002] A distributed lock is an implementation of a lock that controls access to shared resources between distributed systems, and its main problem is to ensure data consistency. In a single-process system, when there are multiple threads that can change a variable at the same time, it is necessary to synchronize the variable or code block so that it can linearly execute and eliminate concurrent modification of the variable when modifying this variable. In order to realize that multiple threads can only have one thread executable in the same code block at a time, a mark needs to be marked somewhere. This mark must be visible to every thread. When the mark does not exist, the mark can be set , the remaining subsequent threads find that there is already ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/52
CPCG06F9/526G06F2209/521G06F2209/522
Inventor 方利
Owner CHEZHI HULIAN BEIJING SCI & TECH CO LTD