CN104391935A - Implementation method and device of range lock - Google Patents

Implementation method and device of range lock Download PDF

Info

Publication number
CN104391935A
CN104391935A CN201410677262.1A CN201410677262A CN104391935A CN 104391935 A CN104391935 A CN 104391935A CN 201410677262 A CN201410677262 A CN 201410677262A CN 104391935 A CN104391935 A CN 104391935A
Authority
CN
China
Prior art keywords
interval
authority information
lock authority
lock
information
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.)
Granted
Application number
CN201410677262.1A
Other languages
Chinese (zh)
Other versions
CN104391935B (en
Inventor
杨晗
冯锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410677262.1A priority Critical patent/CN104391935B/en
Publication of CN104391935A publication Critical patent/CN104391935A/en
Application granted granted Critical
Publication of CN104391935B publication Critical patent/CN104391935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses an implementation method and an implementation device of a range lock. The implementation method of the range lock includes: receiving a first request which includes range information and lock permission information of a first range; comparing the first range with an authorized range locally stored; if the first range is a subset of a second range in the authorized range, conforming whether the lock permission information of the first range and lock permission information of the second range conflict according to a preset conflict judgment rule; if the lock permission information of the first range and the lock permission information of the second range do not conflict, returning the range information and the lock permission information of the first range. The implementation method and the implementation device of the range lock can improve conflict detection performance of the range lock.

Description

A kind of implementation method of scope lock and device
Technical field
The present invention relates to electronic technology field, particularly relate to implementation method and the device of a kind of scope lock.
Background technology
Distributed lock is a kind of mode realizing cross-node exclusive reference shared resource in group system.In large-scale application system, the concurrent requirement of height of system cannot be met to Single document (as database file) the cross-node exclusive reference that take file as granularity, therefore create scope lock, realize locking by bytes range to large files/resource, at utmost to meet the Concurrency Access requirement of application system.
Scope in scope lock, can also non-" byte " expand for unit, as description band, block etc.
Because the granularity locked is no longer "Yes" or " non-", but numerous at random, possible overlapping or adjacent, discrete interval, different holders (hereinafter referred to as owner) may be there is again in each interval, therefore the tissue of scope lock data structure wants complicated more than non-scope lock, its performance that locks also declines to a great extent.
In prior art, the scheme of scope of organization lock data structure can be realized by RBTree, and specific implementation can be:
All intervals are organized in RBTree, utilize searching of the characteristic acceleration area of balanced binary tree.Such RBTree is also Interval Tree, and typical Interval Tree as shown in Figure 1.In Interval Tree, each node at least will comprise three attributes:
Block information: interval initial end points (start) and end caps (end), as the node of first in Fig. 1 [5,10], wherein initial end points is 5, end caps is 10;
Maximum end points (MaxEnd): have recorded endpoint value maximum in this node and all child nodes of this node.So [start, MaxEnd] describes the maximum interval that this node and right subtree can describe
Holder's list (OwnerList): have recorded the current all holder information holding this interval, namely a holder is the applicant in this interval.
Use RBTree, the search performance of O (logn) can be obtained, be applicable in the distributed system of large gauge.In order to search conflict, need to find all intervals overlapping with between given area in tree, because interval overlapping in tree may be distributed in different branches, therefore may need to travel through multiple branch and just can complete this and search, traversal whole tree (interval of such as applying for is very large, all overlapping with all intervals in tree) is needed under worst case.To sum up: after the data structure records scope organized by RBTree lock, if when locking to a new scope again, need to travel through many trees in red-black tree table and multiple branch, so the problem of the complicated inconvenience realization of operation can be caused.
Summary of the invention
The invention provides implementation method and the device of a kind of scope lock, after the data structure records scope organized by RBTree in method and apparatus solution prior art provided by the present invention is locked, if when locking to a new scope again, need to travel through many trees in red-black tree table and multiple branch, so the problem that the complicated inconvenience of operation realizes can be caused.
First aspect, provide the implementation method that a kind of scope is locked, the method comprises:
Receive the first request, wherein, described first request comprises block information and the lock authority information in the first interval;
What stored in described first interval and this locality compares between empowered zone;
If described first interval be described between empowered zone in the subset in the second interval, then determine whether the lock authority information in described first interval conflicts with the lock authority information in described second interval according to the conflict judgment rule preset;
If the lock authority information in described first interval does not conflict with the lock authority information in described second interval, then return block information and the lock authority information in described first interval.
In conjunction with first aspect, in the implementation that the first is possible, described block information between empowered zone and lock authority information are with the mode record of RBTree;
Described method also comprises: the block information in described first interval and lock authority information are joined in RBTree.
In conjunction with first aspect, or the first possible implementation of first aspect, in the implementation that the second is possible, when described have multiple between empowered zone time, wherein, any two exist lap between empowered zone, then described any two lock authority informations between empowered zone do not conflict.
In conjunction with first aspect, or the implementation that the first to the second of first aspect is possible, in the implementation that the third is possible, described lock authority information comprises: lock authority information data being performed to read operation or write operation.
In conjunction with first aspect, or first of first aspect to the third possible implementation, in the 4th kind of possible implementation, determine whether the lock authority information in described first interval has to conflict with the lock authority information in described second interval according to the conflict judgment rule preset and comprise:
When the lock authority information in described first interval is not identical with the lock authority information in described second interval, then determine that the lock authority information in described first interval conflicts with the lock authority information in described second interval;
When identical with the lock authority information in described second interval to the lock authority information in described first interval, then determine whether the lock authority information in the first interval and the lock authority information in described second interval are read operation, if so, then determine that the lock authority information in described first interval does not conflict with the lock authority information in described second interval; Otherwise the lock authority information in described first interval conflicts with the lock authority information in described second interval.
In conjunction with first aspect, or first to fourth of first aspect kind of possible implementation, in the 5th kind of possible implementation, the method also comprises:
If described between empowered zone in do not comprise described first interval, then return block information and the lock authority information in described first interval; Or
There is intersection with described first interval between empowered zone if described, then travel through between empowered zone, determine the block information in described first interval and lock authority information whether with described block information between empowered zone with lock authority information and conflict; If conflict, described first request is put into waiting list or returned the response message of refusal; If do not conflicted, return block information and the lock authority information in described first interval.
Second aspect, provides the implement device that a kind of scope is locked, and this device comprises:
Receiver module, for receiving the first request, wherein, described first request comprises block information and the lock authority information in the first interval;
Comparing module, what store for and this locality interval by described first compares between empowered zone;
Conflict judge module, if for described first interval be described between empowered zone in the subset in the second interval, then determine whether the lock authority information in described first interval conflicts with the lock authority information in described second interval according to the conflict judgment rule preset;
Authorization module, if do not conflicted with the lock authority information in described second interval for the lock authority information in described first interval, then returns block information and the lock authority information in described first interval.
In conjunction with second aspect, in the implementation that the first is possible, this device also comprises memory module, for the block information described in the mode record of RBTree between empowered zone and lock authority information, and by the block information in described first interval and lock authority information join in RBTree.
In conjunction with second aspect, or the first possible implementation of first aspect, in the implementation that the second is possible, conflict judge module is not identical with the lock authority information in described second interval specifically for the lock authority information when described first interval, then determine that the lock authority information in described first interval conflicts with the lock authority information in described second interval; When identical with the lock authority information in described second interval to the lock authority information in described first interval, then determine whether the lock authority information in the first interval and the lock authority information in described second interval are read operation, if so, then determine that the lock authority information in described first interval does not conflict with the lock authority information in described second interval; Otherwise the lock authority information in described first interval conflicts with the lock authority information in described second interval.
In conjunction with second aspect, or the implementation that the first to the second of first aspect is possible, in the implementation that the third is possible, this device also comprises:
Spider module, for traveling through the interval of having authorized, if described between empowered zone in do not comprise described first interval, then return block information and the lock authority information in described first interval; There is intersection with described first interval between empowered zone if described, then travel through between empowered zone, determine the block information in described first interval and lock authority information whether with described block information between empowered zone with lock authority information and conflict; If conflict, described first request is put into waiting list or returned the response message of refusal; If do not conflicted, return block information and the lock authority information in described first interval.
One or two in technique scheme, at least has following technique effect:
The authority of each scope lock is denoted in the default tree table that the method and apparatus that the embodiment of the present invention provides provides, and be that the interval that authority is not conflicted just can be inserted in same tree table, if so there is the first scope lock, and second scope of rights conflict overlapping with the interval that the first scope is locked just can not be there is and locks.So, when the interval of scope lock request is comprised by the scope lock that the authority that has been authorized away is not conflicted, then can determine to there will not be the mandate of new request collision with this in tree, as long as so traversal process in find comprise and authority do not conflict scope lock, then can stop traversal, authorize to the scope lock of the new application of row.So the scheme adopting the embodiment of the present invention to provide can improve the collision detection performance of scope lock.
Accompanying drawing explanation
The structural representation of the red-black tree table that Fig. 1 provides for prior art;
Fig. 2 is the schematic flow sheet of the implementation method of a kind of scope lock of the embodiment of the present invention;
Fig. 3 is the schematic diagram presetting a node in tree table in the embodiment of the present invention;
Fig. 4 is the structural representation of the implement device of a kind of scope lock in the embodiment of the present invention;
Fig. 5 is the structural representation of the implement device of another kind of scope lock in the embodiment of the present invention;
Fig. 6 is the instantiation schematic diagram that the embodiment of the present invention presets tree table.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Below in conjunction with Figure of description, the embodiment of the present invention is described in further detail.
As shown in Figure 2, the implementation method that the embodiment of the present invention provides a kind of scope to lock, the method specifically comprises following performing step:
Step 201, receives the first request, and wherein, described first request comprises block information and the lock authority information in the first interval;
Step 202, what stored in described first interval and this locality compares between empowered zone;
In embodiments of the present invention, can be stored in this locality by the mode presetting table between empowered zone, and this preset in table comprise block information between empowered zone and lock authority information; Described block information between empowered zone and lock authority information are with the mode record of RBTree.In tree table, each node at least will comprise three attributes: the lock authority information (in this tree table, each node can be the structure shown in Fig. 3, and the complete structure of tree table as shown in Figure 4) of the block information between empowered zone, maximum end points and each interval lock.Wherein:
Block information: interval initial end points (start) and end caps (end), as the node of first in Fig. 2 [5,10], wherein initial end points is 5, end caps is 10;
Maximum end points (MaxEnd): have recorded endpoint value maximum in this node and all child nodes of this node.So [start, MaxEnd] describes the maximum interval that this node and right subtree can describe.
The lock authority information of interval lock: lock authority information data being performed to read operation or write operation.Wherein, read operation or write operation is mainly utilized to be described; Such as: being denoted as " R " of the lock authority information that in first node, interval is locked, then represent that holder can perform read operation to the data in interval [5,10].
In addition, when realizing scheme provided by the invention, if having multiple between empowered zone in RBTree, wherein, any two exist lap between empowered zone, then described any two lock authority informations between empowered zone do not conflict.Namely when certain between empowered zone and other have lap between empowered zone, then corresponding two the lock authority informations between empowered zone do not conflict, then described some between empowered zone with described other are not overlapping between empowered zone.
Step 203, if described first interval be described between empowered zone in the subset in the second interval, then determine whether the lock authority information in described first interval conflicts with the lock authority information in described second interval according to the conflict judgment rule preset;
In embodiments of the present invention, determine that whether the first interval is the mode of the subset in the second interval and can is:
By the initial end points (start) in block information and end caps (end), the scope included by each interval can be determined.When determining that the scope included by the first interval is in the scope included by the second interval, then can determine that whether the first interval is the subset in the second interval.
Step 204, if the lock authority information in described first interval does not conflict with the lock authority information in described second interval, then returns block information and the lock authority information in described first interval.
In addition, if do not comprise between empowered zone of the first interval, then further judge whether that mandate first is asked by the mode traveled through between empowered zone, specific implementation can be:
If described between empowered zone in do not comprise described first interval, then return block information and the lock authority information in described first interval; Or
There is intersection with described first interval between empowered zone if described, then travel through between empowered zone, determine the block information in described first interval and lock authority information whether with described block information between empowered zone with lock authority information and conflict; If conflict, described first request is put into waiting list or returned the response message of refusal; If do not conflicted, return block information and the lock authority information in described first interval.
The authority of each scope lock is denoted in RBTree in embodiment of the present invention method, and be that the interval that authority is not conflicted just can be inserted in same tree table, if so there is the first scope lock, and second scope of rights conflict overlapping with the interval that the first scope is locked just can not be there is and locks.So, when the interval of scope lock request is comprised by the scope lock that the authority that has been authorized away is not conflicted, then can determine to there will not be the mandate of new request collision with this in tree, as long as so traversal process in find comprise and authority do not conflict scope lock, then can stop traversal, authorize to the scope lock of new application.So the scheme adopting the embodiment of the present invention to provide can improve the collision detection performance of scope lock.
Be further described a kind of scope lock implementation method provided by the invention below in conjunction with concrete example, specific implementation can be:
In the application of concrete scope lock, carrying out that read and write operation locks to data is the most general phenomenon.There is following characteristics in read and write operation:
Because reading data is nondestructive operations, several program reads a file simultaneously, and data can not be caused inconsistent.If but when a user is performing read operation, b user performs write operation, the two is concurrent carries out.What this scene will cause a user to read is old data, but storage may be the new data revised after b user performs write operation, thus data will be caused inconsistent.
Such as: have individual file, an alphabetical X has only been deposited in the inside.A user reads this file, and b user carries out write operation to this file simultaneously.The read operation of a user first occurs, and a user has just read alphabetical X; After a user completes read operation, b user is Y data modification, then the data of this file that now b user and a user see just there occurs inconsistent, thus occur the problem of data corruption.So, need to carry out locking protection to file.
In embodiments of the present invention, for the lock authority information of interval lock for read operation and write operation, then the conflict judgment rule preset can be:
When the lock authority information in described first interval is not identical with the lock authority information in described second interval, then determine that the lock authority information in described first interval conflicts with the lock authority information in described second interval;
When identical with the lock authority information in described second interval to the lock authority information in described first interval, then determine whether the lock authority information in the first interval and the lock authority information in described second interval are read operation, if so, then determine that the lock authority information in described first interval does not conflict with the lock authority information in described second interval; Otherwise the lock authority information in described first interval conflicts with the lock authority information in described second interval.
When specific implementation, as shown in Figure 4, if the scope of lock that user will apply for is [8,9], the authority of application is for reading (R).According to Fig. 4, first node of tree table can be determined, existing subscriber has applied for [5,10] authority is the scope lock of read operation, the scope of [8,9] belongs to the subset of scope lock [5,10], and scope lock [8,9] the lock authority information of R and scope lock [5,10] R is all read operation, so two scope locks do not conflict.To sum up, the scope of scope lock [8,9] R and scope lock [5,10] R is relation of inclusion, and authority is not conflicted, so scope lock [8,9] R that user will apply for can lock.
Because in the default tree table that the embodiment of the present invention provides, access limit is placed in same tree, and be read and write the interval of not conflicting just can be inserted in same tree table, if so existence range lock [0,10] R, just can not exist and lock with the interval range of writing of [0,10] R overlap.So, when a read request is contained by a read request packet of having authorized away, then can determine do not have with the mandate of this new request collision in tree, as long as so traversal process in find comprise and authority do not conflict scope lock, then can stop traversal, authorize to the scope lock of the new application of row.
As shown in Figure 4, according to the implement device that the said method embodiment of the present invention also provides a kind of scope to lock, this device comprises:
Receiver module 401, for receiving the first request, wherein, described first request comprises block information and the lock authority information in the first interval;
Comparing module 402, what store for and this locality interval by described first compares between empowered zone;
Conflict judge module 403, if for described first interval be described between empowered zone in the subset in the second interval, then determine whether the lock authority information in described first interval conflicts with the lock authority information in described second interval according to the conflict judgment rule preset;
When lock claim only includes two kinds: when read operation authority and write operation authority, then the judge module that conflicts specifically carries out conflict judgement and comprises:
When the lock authority information in described first interval is not identical with the lock authority information in described second interval, then determine that the lock authority information in described first interval conflicts with the lock authority information in described second interval; When identical with the lock authority information in described second interval to the lock authority information in described first interval, then determine whether the lock authority information in the first interval and the lock authority information in described second interval are read operation, if so, then determine that the lock authority information in described first interval does not conflict with the lock authority information in described second interval; Otherwise the lock authority information in described first interval conflicts with the lock authority information in described second interval.
Authorization module 404, if do not conflicted with the lock authority information in described second interval for the lock authority information in described first interval, then returns block information and the lock authority information in described first interval.
Conveniently comparison, when storing the interval lock of having authorized, can store, so this device also comprises interval institute according to certain rule:
Memory module, for the block information described in the mode record of RBTree between empowered zone and lock authority information, and by the block information in described first interval and lock authority information join in RBTree.
Wherein, when having multiple between empowered zone, wherein, if any two exist lap between empowered zone, then described any two lock authority informations between empowered zone do not conflict.
Aforesaid way is interval by situation about having comprised between empowered zone to current request, and for current interval not by situation about having comprised completely between empowered zone, this device can realize the mandate of interval lock by the mode of traversal, then this device can also comprise:
Spider module, for traveling through the interval of having authorized, if described between empowered zone in do not comprise described first interval, then return block information and the lock authority information in described first interval; There is intersection with described first interval between empowered zone if described, then travel through between empowered zone, determine the block information in described first interval and lock authority information whether with described block information between empowered zone with lock authority information and conflict; If conflict, described first request is put into waiting list or returned the response message of refusal; If do not conflicted, return block information and the lock authority information in described first interval.
As shown in Figure 5, the implement device that the present invention also provides another scope to lock, the implement device of described scope lock can be the subscriber equipment in previous embodiment, for performing the scope lock implementation method in foregoing individual embodiments, this device comprises at least one processor 501 (such as CPU), at least one network interface 502 or other communication interfaces, storer 503, with at least one communication bus 504, for realizing the connection communication between these devices.The executable module of processor 501 for storing in execute store 503, such as computer program.Storer 503 may comprise high-speed random access memory (RAM:RandomAccess Memory), still may comprise non-labile storer (non-volatile memory), such as at least one magnetic disk memory.Realize the communication connection between this system gateway and at least one other network element by least one network interface 502 (can be wired or wireless), can internet be used, wide area network, local network, Metropolitan Area Network (MAN) etc.
In some embodiments, the storer in device provided by the present invention stores program 5031, and program can be executed by processor, and this program comprises:
Receive the first request, wherein, described first request comprises block information and the lock authority information in the first interval;
What stored in described first interval and this locality compares between empowered zone;
If described first interval be described between empowered zone in the subset in the second interval, then determine whether the lock authority information in described first interval conflicts with the lock authority information in described second interval according to the conflict judgment rule preset;
If the lock authority information in described first interval does not conflict with the lock authority information in described second interval, then return block information and the lock authority information in described first interval.
Above-mentioned one or more technical scheme in the embodiment of the present application, at least has following technique effect:
As shown in Figure 6, if the scope lock that user newly applies for is [8,9] R, because interval [8,9] all overlapping with the major part interval in tree, scope is only had to lock [0,2] W not overlapping with interval [8,9], so when using the scheme of prior art to travel through, the locking request of scope lock [8,9] R needs traversal 6 tree nodes could determine Lothrus apterus (6 nodes in tree shown in Fig. 4 outside [0,2]).Use the scheme that the embodiment of the present invention provides, then only needs and first node [5,10] more once, save 5 compare operations.So the scheme adopting the embodiment of the present invention to provide can improve the collision detection performance of scope lock.
When tree be on a grand scale and add latching operation very frequent time (as up to ten thousand times per second lock), the detection perform that great expanded reach can be locked by the scheme that the application embodiment of the present invention provides.
It should be noted that, in the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.In this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
The above, above embodiment is only in order to be described in detail the technical scheme of the application, but the explanation of above embodiment just understands method of the present invention and core concept thereof for helping, and should not be construed as limitation of the present invention.Those skilled in the art are in the technical scope that the present invention discloses, and the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.

Claims (10)

1. an implementation method for scope lock, it is characterized in that, the method comprises:
Receive the first request, wherein, described first request comprises block information and the lock authority information in the first interval;
What stored in described first interval and this locality compares between empowered zone;
If described first interval be described between empowered zone in the subset in the second interval, then determine whether the lock authority information in described first interval conflicts with the lock authority information in described second interval according to the conflict judgment rule preset;
If the lock authority information in described first interval does not conflict with the lock authority information in described second interval, then return block information and the lock authority information in described first interval.
2. the method for claim 1, is characterized in that, described block information between empowered zone and lock authority information are with the mode record of RBTree;
Described method also comprises: the block information in described first interval and lock authority information are joined in RBTree.
3. method as claimed in claim 1 or 2, is characterized in that, when described have multiple between empowered zone time, wherein, any two exist lap between empowered zone, then described any two lock authority informations between empowered zone do not conflict.
4. the method as described in as arbitrary in claims 1 to 3, it is characterized in that, described lock authority information comprises: lock authority information data being performed to read operation or write operation.
5. the method as described in as arbitrary in Claims 1 to 4, is characterized in that, determines whether the lock authority information in described first interval conflicts with the lock authority information in described second interval comprise according to the conflict judgment rule preset:
When the lock authority information in described first interval is not identical with the lock authority information in described second interval, then determine that the lock authority information in described first interval conflicts with the lock authority information in described second interval;
When identical with the lock authority information in described second interval to the lock authority information in described first interval, then determine whether the lock authority information in the first interval and the lock authority information in described second interval are read operation, if so, then determine that the lock authority information in described first interval does not conflict with the lock authority information in described second interval; Otherwise the lock authority information in described first interval conflicts with the lock authority information in described second interval.
6. the method as described in as arbitrary in Claims 1 to 5, is characterized in that, also comprise:
If described between empowered zone in do not comprise described first interval, then return block information and the lock authority information in described first interval; Or
There is intersection with described first interval between empowered zone if described, then travel through between empowered zone, determine the block information in described first interval and lock authority information whether with described block information between empowered zone with lock authority information and conflict; If conflict, described first request is put into waiting list or returned the response message of refusal; If do not conflicted, return block information and the lock authority information in described first interval.
7. an implement device for scope lock, it is characterized in that, this device comprises:
Receiver module, for receiving the first request, wherein, described first request comprises block information and the lock authority information in the first interval;
Comparing module, what store for and this locality interval by described first compares between empowered zone;
Conflict judge module, if for described first interval be described between empowered zone in the subset in the second interval, then determine whether the lock authority information in described first interval conflicts with the lock authority information in described second interval according to the conflict judgment rule preset;
Authorization module, if do not conflicted with the lock authority information in described second interval for the lock authority information in described first interval, then returns block information and the lock authority information in described first interval.
8. device as claimed in claim 7, it is characterized in that, this device also comprises memory module, for the block information described in the mode record of RBTree between empowered zone and lock authority information, and by the block information in described first interval and lock authority information join in RBTree.
9. device as claimed in claim 7 or 8, it is characterized in that, conflict judge module is not identical with the lock authority information in described second interval specifically for the lock authority information when described first interval, then determine that the lock authority information in described first interval conflicts with the lock authority information in described second interval; When identical with the lock authority information in described second interval to the lock authority information in described first interval, then determine whether the lock authority information in the first interval and the lock authority information in described second interval are read operation, if so, then determine that the lock authority information in described first interval does not conflict with the lock authority information in described second interval; Otherwise the lock authority information in described first interval conflicts with the lock authority information in described second interval.
10. the device as described in as arbitrary in claim 7 ~ 9, it is characterized in that, this device also comprises:
Spider module, for traveling through the interval of having authorized, if described between empowered zone in do not comprise described first interval, then return block information and the lock authority information in described first interval; There is intersection with described first interval between empowered zone if described, then travel through between empowered zone, determine the block information in described first interval and lock authority information whether with described block information between empowered zone with lock authority information and conflict; If conflict, described first request is put into waiting list or returned the response message of refusal; If do not conflicted, return block information and the lock authority information in described first interval.
CN201410677262.1A 2014-11-21 2014-11-21 A kind of implementation method and device of scope lock Active CN104391935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410677262.1A CN104391935B (en) 2014-11-21 2014-11-21 A kind of implementation method and device of scope lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410677262.1A CN104391935B (en) 2014-11-21 2014-11-21 A kind of implementation method and device of scope lock

Publications (2)

Publication Number Publication Date
CN104391935A true CN104391935A (en) 2015-03-04
CN104391935B CN104391935B (en) 2017-12-12

Family

ID=52609839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410677262.1A Active CN104391935B (en) 2014-11-21 2014-11-21 A kind of implementation method and device of scope lock

Country Status (1)

Country Link
CN (1) CN104391935B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096231A (en) * 2019-04-25 2019-08-06 新华三云计算技术有限公司 The processing method and processing device of disk lock
CN110968563A (en) * 2018-09-29 2020-04-07 华为技术有限公司 Data storage method, metadata server and client
CN113127210A (en) * 2019-12-31 2021-07-16 阿里巴巴集团控股有限公司 Storage management method, device and storage medium of distributed system
CN113467960A (en) * 2021-05-28 2021-10-01 济南浪潮数据技术有限公司 Multi-path storage method, system, terminal and storage medium based on shared lock
CN113918530A (en) * 2021-12-14 2022-01-11 北京达佳互联信息技术有限公司 Method and device for realizing distributed lock, electronic equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5193188A (en) * 1989-01-05 1993-03-09 International Business Machines Corporation Centralized and distributed wait depth limited concurrency control methods and apparatus
US5983225A (en) * 1998-01-26 1999-11-09 Telenor As Parameterized lock management system and method for conditional conflict serializability of transactions
US20100030988A1 (en) * 2008-07-31 2010-02-04 Fujitsu Limited Virtualizing switch and computer system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5193188A (en) * 1989-01-05 1993-03-09 International Business Machines Corporation Centralized and distributed wait depth limited concurrency control methods and apparatus
US5983225A (en) * 1998-01-26 1999-11-09 Telenor As Parameterized lock management system and method for conditional conflict serializability of transactions
US20100030988A1 (en) * 2008-07-31 2010-02-04 Fujitsu Limited Virtualizing switch and computer system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
钱迎进: ""大规模Lustre集群文件系统关键技术的研究"", 《中国博士学位论文全文数据库》 *
钱迎进等: ""Lustre 分布式锁管理器的分析与改进"", 《计算机工程与科学》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968563A (en) * 2018-09-29 2020-04-07 华为技术有限公司 Data storage method, metadata server and client
CN110968563B (en) * 2018-09-29 2023-11-17 华为技术有限公司 Data storage method, metadata server and client
CN110096231A (en) * 2019-04-25 2019-08-06 新华三云计算技术有限公司 The processing method and processing device of disk lock
CN113127210A (en) * 2019-12-31 2021-07-16 阿里巴巴集团控股有限公司 Storage management method, device and storage medium of distributed system
CN113127210B (en) * 2019-12-31 2024-03-29 阿里巴巴集团控股有限公司 Storage management method, device and storage medium of distributed system
CN113467960A (en) * 2021-05-28 2021-10-01 济南浪潮数据技术有限公司 Multi-path storage method, system, terminal and storage medium based on shared lock
CN113467960B (en) * 2021-05-28 2024-02-27 济南浪潮数据技术有限公司 Multi-path storage method, system, terminal and storage medium based on shared lock
CN113918530A (en) * 2021-12-14 2022-01-11 北京达佳互联信息技术有限公司 Method and device for realizing distributed lock, electronic equipment and medium
CN113918530B (en) * 2021-12-14 2022-05-13 北京达佳互联信息技术有限公司 Method and device for realizing distributed lock, electronic equipment and medium

Also Published As

Publication number Publication date
CN104391935B (en) 2017-12-12

Similar Documents

Publication Publication Date Title
CN107273455B (en) Block chain data access method and device
US11163749B2 (en) Managing multiple locks for data set members in a data set index
CN104391935A (en) Implementation method and device of range lock
CN103518364B (en) The data-updating method of distributed memory system and server
CN101593260B (en) Method and system for applying privileges of management system
CN108984639B (en) Data processing method and device for server cluster
US20090037366A1 (en) Online index builds and rebuilds without blocking locks
CN105868421A (en) Data management method and data management device
WO2016095365A1 (en) Authorization processing method and apparatus
CN108614976A (en) Authority configuring method, device and storage medium
CN103544153A (en) Data updating method and system based on database
US8666958B2 (en) Approaches to reducing lock communications in a shared disk database
CN103886109A (en) Method and device for realizing row lock of database
US20150234898A1 (en) Apparatus and method for processing query in database with hybrid storage
CN103559319A (en) Cache synchronization method and equipment for distributed cluster file system
CN108089926A (en) A kind of method, apparatus, equipment and readable storage medium storing program for executing for obtaining distributed lock
CN102486753B (en) Build and allow the method for access cache, equipment and storage system
US20170116255A1 (en) System and method for use of lock-less techniques with a multidimensional database
US8676847B2 (en) Visibility control of resources
CN104657435A (en) Storage management method for application data and network management system
CN113127848A (en) Storage method of permission system data and related equipment
CN109032526B (en) Data processing method and device for distributed file system
CN110020272A (en) Caching method, device and computer storage medium
CN106294189B (en) Memory defragmentation method and device
CN107239568A (en) Distributed index implementation method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant