CN104391935B - A kind of implementation method and device of scope lock - Google Patents
A kind of implementation method and device of scope lock Download PDFInfo
- Publication number
- CN104391935B CN104391935B CN201410677262.1A CN201410677262A CN104391935B CN 104391935 B CN104391935 B CN 104391935B CN 201410677262 A CN201410677262 A CN 201410677262A CN 104391935 B CN104391935 B CN 104391935B
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2308—Concurrency control
- G06F16/2336—Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
- G06F16/2343—Locking 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 present invention, which discloses a kind of implementation method of scope lock and device, this method, to be included:The first request is received, wherein, block information of first request bag containing first interval and lock authority information;The first interval is compared with the section of mandate being locally stored;If the first interval is the subset for having authorized second interval in section, determine whether the lock authority information of the first interval conflicts with the lock authority information of the second interval according to default conflict judgment rule;If the lock authority information of the first interval does not conflict with the lock authority information of the second interval, the block information and lock authority information of the first interval are returned.The scheme that the embodiment of the present invention is provided can improve the collision detection performance of scope lock.
Description
Technical field
The present invention relates to electronic technology field, more particularly to the implementation method and device of a kind of scope lock.
Background technology
Distributed lock is a kind of mode that cross-node exclusive reference shared resource is realized in group system.In large-scale application
In system, the height of system can not be met to cross-node exclusive reference of the single file (such as database file) using file as granularity simultaneously
Hair requires, therefore generates scope lock, realizes being locked by bytes range to big file/resource, is at utmost to meet to apply
The concurrent visiting demand of system.
Scope in scope lock, can be extended with non-" byte " for unit, such as describe band, block.
Because the granularity of locking is no longer "Yes" or " non-", but numerous random, may be overlapping or adjacent, discrete areas
Between, each section there may be different holder (hereinafter referred to as owner) again, therefore the tissue of scope lock data structure is more than non-
Scope lock is complicated, and it locks performance and also declined to a great extent.
The scheme of scope of organization lock data structure can realize that specific implementation can be by RBTree in the prior art:
By all sections tissue into RBTree, the lookup of the characteristic acceleration area of balanced binary tree is utilized.It is such red
Black set also is Interval Tree, and typical Interval Tree is as shown in Figure 1.In Interval Tree, each node will at least include three attributes:
Block information:The starting endpoint (start) and end caps (end) in section, as in Fig. 1 first node [5,
10], wherein starting endpoint be 5, end caps 10;
Maximum end points (MaxEnd):It has recorded endpoint value maximum in this node and all child nodes of this node.So
[start, MaxEnd] describes the maximum section that this node and right subtree can describe
Holder's list (OwnerList):All holder informations for currently holding this section are have recorded, one is held
Person is the applicant in this section.
Using RBTree, O (logn) search performance can be obtained, suitable for the distributed system of big specification.In order to
Conflict is searched, it is necessary to find all sections overlapping with given section in tree, because section overlapping in tree is likely distributed in not
With branch in, therefore may need to travel through multiple branches could complete this lookup, need to travel through whole tree (example under worst case
Section such as application is very big, all overlapping with all sections in tree).To sum up:The data structure records scope organized by RBTree
After lock, if, it is necessary to more trees and the multiple branches in red-black tree table be traveled through, so can make when the scope new to one locks again
The problem of being realized into the complicated inconvenience of operation.
The content of the invention
The present invention provides a kind of implementation method and device of scope lock, and method and apparatus provided by the present invention solve existing
After the data structure records scope lock organized in technology by RBTree, if when the scope new to one locks again, it is necessary to time
More trees and the multiple branches gone through in red-black tree table, so can cause to operate the problem of complicated inconvenience is realized.
First aspect, there is provided a kind of implementation method of scope lock, this method include:
The first request is received, wherein, block information of first request bag containing first interval and lock authority information;
The first interval is compared with the section of mandate being locally stored;
If the first interval is the subset for having authorized second interval in section, rule are judged according to default conflict
Then determine whether the lock authority information of the first interval conflicts with the lock authority information of the second interval;
If the lock authority information of the first interval does not conflict with the lock authority information of the second interval, institute is returned
State the block information and lock authority information of first interval.
It is described to have authorized the block information in section and lock to weigh with reference in a first aspect, in the first possible implementation
Limit information is recorded in a manner of RBTree;
Methods described also includes:The block information of the first interval and lock authority information are added in RBTree.
With reference in a first aspect, or first aspect the first possible implementation, second of possible realization side
In formula, when it is described authorized section to have multiple when, wherein, any two has authorized section lap to be present, then described any
Two have authorized the lock authority information in section not conflict.
With reference in a first aspect, or first aspect the first to second possible implementation, it is possible at the third
In implementation, the lock authority information includes:Data are performed with the lock authority information of read operation or write operation.
With reference in a first aspect, or first aspect first to the third possible implementation, it is possible at the 4th kind
In implementation, the lock authority information of the first interval and the second interval are determined according to default conflict judgment rule
Whether lock authority information has conflict to include:
When the lock authority information and the lock authority information of the second interval of the first interval differ, it is determined that described
The lock authority information of first interval conflicts with the lock authority information of the second interval;
When the lock authority information of the first interval is identical with the lock authority information of the second interval, it is determined that the firstth area
Between the lock authority information of lock authority information and the second interval whether be read operation, if it is, determining described first
The lock authority information in section does not conflict with the lock authority information of the second interval;Otherwise, the lock authority letter of the first interval
Breath conflicts with the lock authority information of the second interval.
With reference in a first aspect, or first aspect first to fourth kind of possible implementation, it is possible at the 5th kind
In implementation, this method also includes:
If described authorized does not include the first interval in section, the block information and lock of the first interval are returned
Authority information;Or
If described authorized section and the first interval to have intersection, travel through and authorized section, determine described the
Whether the block information and lock authority information in one section conflict with the block information for having authorized section and lock authority information;Such as
Described first request is then put into waiting list or returns to the response message of refusal by fruit conflict;If do not conflicted, described the is returned
The block information and lock authority information in one section.
Second aspect, there is provided a kind of realization device of scope lock, the device include:
Receiving module, for receiving the first request, wherein, block information and lock of first request bag containing first interval
Authority information;
Comparing module, for the first interval to be compared with the section of mandate being locally stored;
Conflict judge module, if being the subset for having authorized second interval in section for the first interval, root
Determine that the lock authority information of the first interval and the lock authority information of the second interval are according to default conflict judgment rule
No conflict;
Authorization module, if for the first interval lock authority information and the second interval lock authority information not
Conflict, then return to the block information and lock authority information of the first interval.
With reference to second aspect, in the first possible implementation, the device also includes memory module, for red and black
The mode of tree records the block information for having authorized section and lock authority information, and by the block information of the first interval and
Lock authority information is added in RBTree.
With reference to the first possible implementation of second aspect, or first aspect, second of possible realization side
In formula, conflict judge module is specifically used for lock authority information and the lock authority information of the second interval when the first interval
Differ, it is determined that the lock authority information of the first interval conflicts with the lock authority information of the second interval;When described
The lock authority information in one section is identical with the lock authority information of the second interval, it is determined that the lock authority information of first interval with
Whether the lock authority information of the second interval is read operation, if it is, determining the lock authority information of the first interval
Do not conflict with the lock authority information of the second interval;Otherwise, the lock authority information of the first interval and the second interval
Lock authority information conflict.
It is possible at the third with reference to the first to second possible implementation of second aspect, or first aspect
In implementation, the device also includes:
Spider module, for traveling through the section authorized, if described authorized does not include the first interval in section,
Return to the block information and lock authority information of the first interval;If described authorized section and the first interval to have coincidence part
Point, then travel through and authorized section, determine the first interval block information and lock authority information whether with the empowered zone
Between block information and lock authority information conflict;The described first request is put into waiting list if conflict or returns to refusal
Response message;If do not conflicted, the block information and lock authority information of the first interval are returned.
One or two in above-mentioned technical proposal, at least has the following technical effect that:
The power of each scope lock is denoted in the default tree table that the method and apparatus that the embodiment of the present invention is provided are provided
Limit, and be that the section that authority does not conflict can be just inserted into same tree table, so being locked if there is the first scope, cannot deposit
In the section locked with the first scope, overlapping and the second scope of rights conflict is locked.So when the section quilt of a scope lock request
When scope that one authorized authority gone out does not conflict lock includes, then can determine be not in and the new request collision
Authorize in tree, as long as being included and scope that authority does not conflict lock so being found during traversal, then can stop time
Go through, the scope newly applied to row, which is locked, to be authorized.So the scheme provided using the embodiment of the present invention can improve rushing for scope lock
Prominent detection performance.
Brief description of the drawings
Fig. 1 is the structural representation for the red-black tree table that prior art provides;
Fig. 2 is a kind of schematic flow sheet of the implementation method of scope lock of the embodiment of the present invention;
Fig. 3 is the schematic diagram that a node in tree table is preset in the embodiment of the present invention;
Fig. 4 is a kind of structural representation of the realization device of scope lock in the embodiment of the present invention;
Fig. 5 is the structural representation of the realization device of another 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
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
The embodiment of the present invention is described in further detail with reference to Figure of description.
As shown in Fig. 2 the embodiment of the present invention provides a kind of implementation method of scope lock, this method specifically includes implemented below
Step:
Step 201, the first request is received, wherein, block information of first request bag containing first interval and lock authority
Information;
Step 202, the first interval is compared with the section of mandate being locally stored;
In embodiments of the present invention, section has been authorized to be stored in local by way of preset table, and this is default
The lock authority information for the block information sum for having authorized section is included in table;The block information for having authorized section and lock the authority letter
Breath is recorded in a manner of RBTree.Each node will at least include three attributes in tree table:The block information, most in section is authorized
The lock authority information of big end points and each section lock (each node can be the structure shown in Fig. 3 in the tree table, tree table it is complete
Structure is as shown in Figure 4).Wherein:
Block information:The starting endpoint (start) and end caps (end) in section, as in Fig. 2 first node [5,
10], wherein starting endpoint be 5, end caps 10;
Maximum end points (MaxEnd):It has recorded endpoint value maximum in this node and all child nodes of this node.So
[start, MaxEnd] describes the maximum section that this node and right subtree can describe.
The lock authority information of section lock:Data are performed with the lock authority information of read operation or write operation.Wherein, it is main to utilize
Read operation or write operation illustrate;Such as:The lock authority information that section is locked in first node is denoted as " R ", then it represents that
Holder can perform read operation to the data in section [5,10].
In addition, when realizing scheme provided by the invention, if having in RBTree it is multiple authorized section, wherein, arbitrarily
Two have authorized section lap to be present, then any two has authorized the lock authority information in section not conflict.I.e. when certain
Individual to have authorized section to authorize section to have lap with other, then corresponding two have authorized the lock authority information in section not rush
It is prominent, then it is described some authorized section to authorize section not overlapping with described other.
Step 203, if the first interval is the subset for having authorized second interval in section, according to default punching
Prominent judgment rule determines whether the lock authority information of the first interval conflicts with the lock authority information of the second interval;
In embodiments of the present invention, determine whether first interval is that the mode of subset of second interval can be:
Pass through the starting endpoint (start) and end caps (end) in block information, it may be determined that included by each section
Scope.When it is determined that the scope included by first interval can then determine first interval in the scope included by second interval
Whether be second interval subset.
Step 204, if the lock authority information of the first interval does not conflict with the lock authority information of the second interval,
Then return to the block information and lock authority information of the first interval.
It is if further by way of traversal has authorized section in addition, do not include the mandate section of first interval
Judge whether authorize the first request, specific implementation can be:
If described authorized does not include the first interval in section, the block information and lock of the first interval are returned
Authority information;Or
If described authorized section and the first interval to have intersection, travel through and authorized section, determine described the
Whether the block information and lock authority information in one section conflict with the block information for having authorized section and lock authority information;Such as
Described first request is then put into waiting list or returns to the response message of refusal by fruit conflict;If do not conflicted, described the is returned
The block information and lock authority information in one section.
The authority of each scope lock is denoted in present invention method in RBTree, and is the area that authority does not conflict
Between can just be inserted into same tree table, so if there is the first scope lock, cannot exist with the first scope lock section weight
Folded and rights conflict the second scope lock.So when the section of a scope lock request is by authorized authority gone out
The scope lock not conflicted is when including, then can determine be not in the mandate with the new request collision in tree, so traveling through
Find and include and scope that authority does not conflict lock during as long as, then can stop traveling through, be awarded to the scope lock newly applied
Power.So the scheme provided using the embodiment of the present invention can improve the collision detection performance of scope lock.
A kind of scope lock implementation method provided by the invention is further described below in conjunction with specific example, specifically
Realizing to be:
In the lock application of specific scope, it is most common phenomenon that data, which are carried out read and write operation to lock,.Read and write behaviour
Following characteristics be present in work:
Because it is nondestructive operation to read data, several programs read a file simultaneously, are that will not cause data
Inconsistent.But if a user is carrying out read operation, b user performs write operation, and the two is concurrently carried out.This scene is just
Can cause that a user may read is old data, but what is stored is probably that b user performs the new data changed after write operation,
It is inconsistent so as to will result in data.
Such as:There is individual file, an alphabetical X has only been deposited in the inside.A user reads this file, and b user is simultaneously to this file
Carry out write operation.The read operation of a user first occurs, and a user has just read alphabetical X;After a user completes read operation, b user's handle
Data modification is Y, then now the data for this file that b user and a user see are just there occurs inconsistent, so as to data occur
The problem of chaotic.It is therefore desirable to locking protection is carried out to file.
In embodiments of the present invention, so that the lock authority information of section lock is read operation and write operation as an example, then default punching
Prominent judgment rule can be:
When the lock authority information and the lock authority information of the second interval of the first interval differ, it is determined that described
The lock authority information of first interval conflicts with the lock authority information of the second interval;
When the lock authority information of the first interval is identical with the lock authority information of the second interval, it is determined that the firstth area
Between the lock authority information of lock authority information and the second interval whether be read operation, if it is, determining described first
The lock authority information in section does not conflict with the lock authority information of the second interval;Otherwise, the lock authority letter of the first interval
Breath conflicts with the lock authority information of the second interval.
In specific implementation, if as shown in figure 4, the scope of the lock to be applied of user is [8,9], the authority of application is reading
(R).First node of tree table is it was determined that existing subscriber has applied for the model that [5,10] authority is read operation according to Fig. 4
Lock is enclosed, the scope of [8,9] belongs to the subset of scope lock [5,10], and scope lock [8,9] R and scope lock [5,10] R lock power
Limit information is all read operation, so two scope locks do not conflict.To sum up, scope lock [8,9] R and scope lock [5,10] R scope
For inclusion relation, and authority does not conflict, so the user's scope to be applied lock [8,9] R can be locked.
Because in the default tree table that the embodiment of the present invention is provided, access limit is placed in same tree, and is to read and write not
The section of conflict can be just inserted into same tree table, so locking [0,10] R if there is scope, cannot be existed and [0,10] R
Overlapping writes interval range lock.So when a read request is contained by authorized read request packet gone out, then can be true
The fixed not mandate with the new request collision is in tree, as long as being included and authority does not conflict so being found during traversal
Scope lock, then can stop traveling through, lock and authorize to the scope newly applied of row.
As shown in figure 4, also provide a kind of realization device of scope lock, the device bag according to the above method embodiment of the present invention
Include:
Receiving module 401, for receiving the first request, wherein, the block information of first request bag containing first interval
With lock authority information;
Comparing module 402, for the first interval to be compared with the section of mandate being locally stored;
Conflict judge module 403, if being the subset for having authorized second interval in section for the first interval,
The lock authority information and the lock authority information of the second interval of the first interval are determined according to default conflict judgment rule
Whether conflict;
When lock claim only includes two kinds:When read operation authority and write operation authority, then the judge module that conflicts specifically is rushed
Prominent judgement includes:
When the lock authority information and the lock authority information of the second interval of the first interval differ, it is determined that described
The lock authority information of first interval conflicts with the lock authority information of the second interval;When the lock authority information of the first interval
It is identical with the lock authority information of the second interval, it is determined that the lock authority information of first interval is weighed with the lock of the second interval
Whether limit information is read operation, if it is, determining the lock authority information and the lock of the second interval of the first interval
Authority information does not conflict;Otherwise, the lock authority information of the first interval conflicts with the lock authority information of the second interval.
Authorization module 404, if believed for the lock authority information of the first interval and the lock authority of the second interval
Breath does not conflict, then returns to the block information and lock authority information of the first interval.
In order to facilitate comparison, in the section that storage has authorized when lock, section can be carried out according to certain rule
Storage, so the device also includes:
Memory module, for recording the block information for having authorized section and lock authority information in a manner of RBTree,
And the block information of the first interval and lock authority information are added in RBTree.
Wherein, when having authorized section to have multiple, wherein, if any two has authorized section lap to be present,
Any two has authorized the lock authority information in section not conflict.
The situation that aforesaid way has been authorized section to include in current request section, has not been authorized for current interval
The situation that section completely includes, the device can realize the mandate of section lock by way of traversal, then the device can also wrap
Include:
Spider module, for traveling through the section authorized, if described authorized does not include the first interval in section,
Return to the block information and lock authority information of the first interval;If described authorized section and the first interval to have coincidence part
Point, then travel through and authorized section, determine the first interval block information and lock authority information whether with the empowered zone
Between block information and lock authority information conflict;The described first request is put into waiting list if conflict or returns to refusal
Response message;If do not conflicted, the block information and lock authority information of the first interval are returned.
As shown in figure 5, the present invention also provides the realization device of another scope lock, the realization device of the scope lock can
The user equipment in previous embodiment is thought, for performing the lock implementation method of the scope in foregoing individual embodiments, the device bag
Include at least one processor 501 (such as CPU), at least one network interface 502 or other communication interfaces, memory 503, and
At least one communication bus 504, for realizing the connection communication between these devices.Processor 501 is used to perform memory 503
The executable module of middle storage, such as computer program.Memory 503 may include high-speed random access memory (RAM:
Random Access Memory), it is also possible to also including non-labile memory (non-volatile memory), such as
At least one magnetic disk storage.The system gateway is realized by least one network interface 502 (can be wired or wireless)
With the communication connection between at least one other network element, internet, wide area network, LAN, Metropolitan Area Network (MAN) etc. can be used.
In some embodiments, memory storage in device provided by the present invention program 5031, program can be with
It is executed by processor, this program includes:
The first request is received, wherein, block information of first request bag containing first interval and lock authority information;
The first interval is compared with the section of mandate being locally stored;
If the first interval is the subset for having authorized second interval in section, rule are judged according to default conflict
Then determine whether the lock authority information of the first interval conflicts with the lock authority information of the second interval;
If the lock authority information of the first interval does not conflict with the lock authority information of the second interval, institute is returned
State the block information and lock authority information of first interval.
Said one or multiple technical schemes in the embodiment of the present application, at least have the following technical effect that:
As shown in fig. 6, if the scope lock that user newly applies is [8,9] R, because section [8,9] and the major part in tree
Section is all overlapping, and only scope lock [0,2] W is not overlapping with section [8,9], so being traveled through using the scheme of prior art
When, scope lock [8,9] R locking request need to travel through 6 tree nodes just can determine that Lothrus apterus (removed in setting shown in Fig. 4 [0,2] it
6 outer nodes).The scheme provided using the embodiment of the present invention, then only need to compare once with first node [5,10]
, save 5 comparisons operation.So the scheme provided using the embodiment of the present invention can improve the conflict inspection of scope lock
Survey performance.
When tree be on a grand scale and lock operation it is very frequent when (such as per second up to ten thousand time lock), using institute of the embodiment of the present invention
The detection performance that the scheme of offer can lock great expanded reach.
It should be noted that in the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, in some embodiment
The part not being described in detail, it may refer to the associated description of other embodiment.Herein, such as first and second or the like pass
It is that term is used merely to make a distinction an entity or operation and another entity or operate, and not necessarily requires or secretly
Show between these entities or operation any this actual relation or order be present.Moreover, term " comprising ", "comprising" or
Any other variant thereof is intended to cover non-exclusive inclusion so that process, method, article including a series of elements or
Person's equipment not only includes those key elements, but also the other element including being not expressly set out, or it is this mistake also to include
Journey, method, article or the intrinsic key element of equipment.In the absence of more restrictions, by sentence "including a ..."
The key element of restriction, it is not excluded that in addition identical also be present in the process including the key element, method, article or equipment will
Element.
Described above, above example is implemented above only the technical scheme of the application to be described in detail
The explanation of example is only intended to help the method and its core concept for understanding the present invention, should not be construed as limiting the invention.This
Those skilled in the art the invention discloses technical scope in, the change or replacement that can readily occur in should all be covered
Within protection scope of the present invention.
Claims (10)
1. a kind of implementation method of scope lock, it is characterised in that this method includes:
The first request is received, wherein, block information of first request bag containing first interval and lock authority information;
The first interval is compared with the section of mandate being locally stored;
It is true according to default conflict judgment rule if the first interval is the subset for having authorized second interval in section
Whether the lock authority information of the fixed first interval conflicts with the lock authority information of the second interval;
If the lock authority information of the first interval does not conflict with the lock authority information of the second interval, described is returned
The block information and lock authority information in one section.
2. the method as described in claim 1, it is characterised in that the block information for having authorized section and lock authority information with
The mode of RBTree records;
Methods described also includes:The block information of the first interval and lock authority information are added in RBTree.
3. method as claimed in claim 1 or 2, it is characterised in that when it is described authorized section to have multiple when, wherein, arbitrarily
Two have authorized section lap to be present, then any two has authorized the lock authority information in section not conflict.
4. method as claimed in claim 1 or 2, it is characterised in that the lock authority information includes:Read operation is performed to data
Or the lock authority information of write operation.
5. method as claimed in claim 1 or 2, it is characterised in that determine described first according to default conflict judgment rule
The lock authority information in section and the lock authority information of the second interval whether conflict including:
When the lock authority information and the lock authority information of the second interval of the first interval differ, it is determined that described first
The lock authority information in section conflicts with the lock authority information of the second interval;
When the lock authority information of the first interval is identical with the lock authority information of the second interval, it is determined that first interval
Lock whether authority information and the lock authority information of the second interval are read operation, if it is, determining the first interval
Lock authority information do not conflict with the lock authority information of the second interval;Otherwise, the lock authority information of the first interval with
The lock authority information conflict of the second interval.
6. method as claimed in claim 1 or 2, it is characterised in that also include:
If described authorized does not include the first interval in section, the block information and lock authority of the first interval are returned
Information;Or
If described authorized section and the first interval to have intersection, travel through and authorized section, determine firstth area
Between block information and lock authority information whether with the block information for having authorized section and locking authority information and conflicting;If punching
Response message prominent then that the described first request is put into waiting list or return refusal;If do not conflicted, firstth area is returned to
Between block information and lock authority information.
7. a kind of realization device of scope lock, it is characterised in that the device includes:
Receiving module, for receiving the first request, wherein, block information of first request bag containing first interval and lock authority
Information;
Comparing module, for the first interval to be compared with the section of mandate being locally stored;
Conflict judge module, if being the subset for having authorized second interval in section for the first interval, according to pre-
If conflict judgment rule determine whether the lock authority information of the first interval and the lock authority information of the second interval rush
It is prominent;
Authorization module, if the lock authority information and the lock authority information of the second interval for the first interval do not rush
It is prominent, then return to the block information and lock authority information of the first interval.
8. device as claimed in claim 7, it is characterised in that the device also includes memory module, for the side of RBTree
The block information and lock authority information in section have been authorized described in formula record, and by the block information of the first interval and has locked authority
Information is added in RBTree.
9. device as claimed in claim 7 or 8, it is characterised in that conflict judge module is specifically used for working as the first interval
Lock authority information and the lock authority information of the second interval differ, it is determined that the lock authority information of the first interval with
The lock authority information conflict of the second interval;When the lock authority information and the lock authority of the second interval of the first interval
Information is identical, it is determined that and whether the lock authority information of first interval and the lock authority information of the second interval are read operation,
If it is, determine that the lock authority information of the first interval does not conflict with the lock authority information of the second interval;Otherwise, institute
The lock authority information for stating first interval conflicts with the lock authority information of the second interval.
10. device as claimed in claim 7 or 8, it is characterised in that the device also includes:
Spider module, for traveling through the section authorized, if described authorized does not include the first interval in section, return
The block information and lock authority information of the first interval;If described authorized section and the first interval to have intersection,
Then travel through and authorized section, determine the first interval block information and lock authority information whether with the section that authorized
Block information and lock authority information conflict;The described first request is put into waiting list if conflict or returns to the response of refusal
Message;If do not conflicted, the block information and lock authority information of the first interval are returned.
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 CN104391935A (en) | 2015-03-04 |
CN104391935B true 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) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN113127210B (en) * | 2019-12-31 | 2024-03-29 | 阿里巴巴集团控股有限公司 | Storage management method, device and storage medium of distributed system |
CN113467960B (en) * | 2021-05-28 | 2024-02-27 | 济南浪潮数据技术有限公司 | Multi-path storage method, system, terminal and storage medium based on shared lock |
CN113918530B (en) * | 2021-12-14 | 2022-05-13 | 北京达佳互联信息技术有限公司 | Method and device for realizing distributed lock, electronic equipment and medium |
Citations (2)
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010033481A (en) * | 2008-07-31 | 2010-02-12 | Fujitsu Ltd | Virtualized switch and computer system |
-
2014
- 2014-11-21 CN CN201410677262.1A patent/CN104391935B/en active Active
Patent Citations (2)
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 |
Non-Patent Citations (2)
Title |
---|
"Lustre 分布式锁管理器的分析与改进";钱迎进等;《计算机工程与科学》;20091015;第31卷(第A1期);第146-149页 * |
"大规模Lustre集群文件系统关键技术的研究";钱迎进;《中国博士学位论文全文数据库》;20120415(第4期);I137-3页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104391935A (en) | 2015-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104391935B (en) | A kind of implementation method and device of scope lock | |
US11347883B2 (en) | Access controlled graph query spanning | |
US10120956B2 (en) | Methods and systems for distributed computation of graph data | |
CN104735055B (en) | A kind of cross-domain safety access control method based on degree of belief | |
CN104408163B (en) | A kind of data classification storage and device | |
WO2002089013A3 (en) | Method, system, program, and computer readable medium for indexing object oriented objects in an object oriented database | |
CN103701469B (en) | A kind of compression and storage method of large-scale graph data | |
CN103841562B (en) | A kind of time interval resource takes processing method and processing device | |
CN109561403A (en) | A kind of short message dispatching method, equipment and storage medium | |
CN101197675B (en) | Accesses control list configuration method and device | |
CN101944121B (en) | Generating method of finite state automaton, keyword matching method and devices and equipment | |
CN108121788A (en) | Subgraph query method | |
CN110096231A (en) | The processing method and processing device of disk lock | |
CN109688126A (en) | A kind of data processing method, the network equipment and computer readable storage medium | |
CN110119396A (en) | Data managing method and Related product | |
CN111046115A (en) | Knowledge graph-based heterogeneous database interconnection management method | |
CN111708921A (en) | Number selection method, device, equipment and storage medium | |
Jégou et al. | Combining Restarts, Nogoods and Decompositions for Solving CSPs. | |
CN109670339A (en) | The access control method and device towards secret protection based on ontology | |
Firth et al. | Loom: Query-aware partitioning of online graphs | |
CN105912404B (en) | A method of finding strong continune component in the large-scale graph data based on disk | |
CN109101595A (en) | A kind of information query method, device, equipment and computer readable storage medium | |
CN107070987A (en) | Data capture method and system for distributed objects storage system | |
CN103546466B (en) | A kind of method of multi-service interaction process and the network equipment | |
CN103914481B (en) | Date storage 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 |