CN103716383A - Method and device for accessing shared resources - Google Patents

Method and device for accessing shared resources Download PDF

Info

Publication number
CN103716383A
CN103716383A CN201310689369.3A CN201310689369A CN103716383A CN 103716383 A CN103716383 A CN 103716383A CN 201310689369 A CN201310689369 A CN 201310689369A CN 103716383 A CN103716383 A CN 103716383A
Authority
CN
China
Prior art keywords
lock
node
sign
shared resource
client
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
CN201310689369.3A
Other languages
Chinese (zh)
Other versions
CN103716383B (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 CN201310689369.3A priority Critical patent/CN103716383B/en
Publication of CN103716383A publication Critical patent/CN103716383A/en
Priority to PCT/CN2014/088928 priority patent/WO2015085826A1/en
Application granted granted Critical
Publication of CN103716383B publication Critical patent/CN103716383B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to the field of data communication and discloses a method and a device for accessing shared resources. According to a scheme described in the embodiment of the invention, after receiving a permission lock request sent by a client of a first node, the first node forwards the permission lock request only when a lock identifier including an identifier of shared resource is not found in the first node, that is to say, whether the lock identifier including the identifier of the shared resource exists in the first node is queried first, the permission lock request is forwarded only when the lock identifier including the identifier of the shared resource does not exist in the first node, and the permission lock request is directly allocated when the lock identifier including the identifier of the shared resource exists in the first node. The time for the client to acquire the lock identifier from the first node is less than the time for the client to acquire the lock identifier from other nodes. Therefore, the problem that the existing method for accessing shared resources is highly time-consuming is solved.

Description

A kind of method and device of accessing shared resource
Technical field
The present invention relates to data communication technology field, particularly a kind of method and device of accessing shared resource.
Background technology
Along with the development of memory technology, various data messages are explosive growth, and people are finding a kind of powerful data center's framework.Dual-active data center is exactly a kind of important solution wherein, by dual-active technology, can between data center's (memory device) of a plurality of cross-regions, realize business disaster tolerance and load balancing, and then integrates the storage resources of memory device, as shown in Figure 1A.
Storage array is the memory carrier of memory device, and in the solution of dual-active data center, storage array provides virtualized shared resource for host application.When system is moved, data can be simultaneously written in the storage array of two memory devices, and when one of them memory device breaks down, another memory device still can externally provide service, and then realizes data disaster tolerance.In order to realize virtualization integration and the data disaster tolerance of storage resources, between two memory devices, need to provide a kind of mutual exclusion mechanism, prevent that (each memory device comprises a plurality of nodes for the Concurrency Access of shared resource, each node comprises a plurality of clients, as shown in Figure 1B, wherein, client refers to the process of node visit shared resource), because if a plurality of clients are accessed and operating data simultaneously, just likely there is mutually to cover between each client the situation of shared resource, cause accessed shared resource in inconsistent state.
In group system, lock manager is mutual exclusion protection mechanism between a kind of conventional node, and it makes a certain shared resource can only, by a client-access, realize the process following (as shown in Figure 1 C) of shared resource access by lock manager each time:
Suppose in memory device 1, to there are three nodes: node 1, node 2, node 3
Step a: for shared resource A distributes a lock manager;
Step b: when node 2 need to be accessed shared resource A, to the lock manager application lock authority corresponding with shared resource A;
Step c: node 2, after obtaining the lock authority corresponding with shared resource A, is accessed shared resource A;
Steps d: node 3 is to the lock manager application lock authority corresponding with shared resource A, because lock is authorized, lock manager can be postponed the mandate of the lock request of other authority conflict, only has the lock holder of the conflict of grade to discharge and locks after authority, and new lock request just can be authorized to.
By said process, can find out, when synchronization has a certain shared resource of a plurality of client-access, by lock manager, reach the object of a plurality of clients to the ordering access of same shared resource, guarantee the consistency of the data of access.But, there is following defect in current lock manager: when some node and lock manager node are not same node, when obtaining lock sign corresponding to lock authority for any shared resource, go other nodes to go to obtain lock authority, there is the longer problem that expends time in.
In sum, there is longer problem consuming time in the method for current access shared resource.
Summary of the invention
The embodiment of the present invention provides a kind of method and device of accessing shared resource, can solve the consuming time longer problem of the method existence of current access shared resource.
First aspect, provides a kind of method of accessing shared resource, comprising:
Receive the lock authority request of the sign of carrying shared resource of first node forwarding;
Wherein, described lock authority request is that described first node forwards when the client that receives first node lock sign that send and do not find the sign that comprises described shared resource in first node;
From the lock sign of storage, determine the lock sign of the sign that comprises described shared resource;
The described lock sign of determining is dispensed to described client by described first node, gives described client the described lock of described shared resource is identified to corresponding lock authority, the access for described client to described shared resource.
In conjunction with first aspect, in the possible implementation of the first, lock sign corresponding to lock authority that described first node takies for each client of first node described in buffer memory, or took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
In conjunction with first aspect, or the possible implementation of the first of first aspect, in the possible implementation of the second, the lock authority request of the sign of carrying shared resource that described reception first node forwards, specifically comprises:
Receive the lock authority request of the sign of carrying described shared resource that described first node forwards by Section Point;
Wherein, to be described Section Point forward when described first node sends and do not find in first node the lock sign of the sign that comprises described shared resource receiving described lock authority request.
In conjunction with the possible implementation of the second of first aspect, in the third possible implementation, described Section Point is for lock sign corresponding to the occupied lock authority of lock authority of buffer memory appointment, or, in the lock authority of appointment, took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
In conjunction with first aspect, or first aspect second to the third possible implementation, in the 4th kind of possible implementation, described the described lock sign of determining is dispensed to described client by described first node, specifically comprise:
The described lock sign of determining is sent to described first node by described Section Point, so that described first node is dispensed to described client by described lock sign.
In conjunction with first aspect, or first to fourth kind of possible implementation of first aspect, in the 5th kind of possible implementation, described the described lock sign of determining is dispensed to described client by described first node, specifically comprise:
If the described lock of determining identifies corresponding lock authority while being taken by other clients, to the client that takies described lock authority, send lock authority and recall indication, after completing the described shared resource of access, the client that order takies described lock authority discharges described lock authority;
Second aspect, provides a kind of device of accessing shared resource, comprising:
Receiving element, for receiving the lock authority request of the sign of carrying shared resource of first node forwarding; Wherein, described lock authority request is that described first node forwards when the client that receives first node lock sign that send and do not find the sign that comprises described shared resource in first node;
Determining unit, the lock of determining the sign that comprises described shared resource for the lock sign from storage identifies;
Allocation units, for the described lock sign of determining is dispensed to described client by described first node, give described client the described lock of described shared resource are identified to corresponding lock authority, the access for described client to described shared resource.
In conjunction with second aspect, in the possible implementation of the first, the described lock authority request that receives of described receiving element be that described first node sends, lock sign corresponding to lock authority that described first node takies for each client of first node described in buffer memory, or took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
In conjunction with second aspect, or the possible implementation of the first of second aspect, in the possible implementation of the second, described receiving element specifically for:
Receive the lock authority request of the sign of carrying described shared resource that described first node forwards by Section Point;
Wherein, to be described Section Point forward when described first node sends and do not find in first node the lock sign of the sign that comprises described shared resource receiving described lock authority request.
In conjunction with the possible implementation of the second of second aspect, in the third possible implementation, the described lock authority request that described receiving element receives is that described Section Point sends, described Section Point is for lock sign corresponding to the occupied lock authority of lock authority of buffer memory appointment, or, in the lock authority of appointment, took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
In conjunction with second aspect, or second aspect second to the third possible implementation, in the 4th kind of possible implementation, described allocation units specifically for:
The described lock sign of determining is sent to described first node by described Section Point, so that described first node is dispensed to described client by described lock sign.
In conjunction with second aspect, or first to fourth kind of possible implementation of second aspect, in the 5th kind of possible implementation, described allocation units specifically for:
If the described lock of determining identifies corresponding lock authority while being taken by other clients, to the client that takies described lock authority, send lock authority and recall indication, after completing the described shared resource of access, the client that order takies described lock authority discharges described lock authority;
Lock sign corresponding to lock authority that the client that takies described lock authority is discharged is dispensed to described client by described first node.
Beneficial effect of the present invention is as follows:
In existing technology, when some node and lock manager node are not same node, when obtaining lock sign corresponding to lock authority for any shared resource, go other nodes to go to obtain lock authority, the existence longer problem that expends time in, and the embodiment of the present invention is, first receive the lock authority request of the sign of carrying shared resource of first node forwarding, wherein, described lock authority request is that described first node sends in the client that receives first node, and the lock that does not find the sign that comprises described shared resource in first node forwards while identifying, then, from the lock sign of storage, determine the lock sign of the sign that comprises described shared resource, finally, the described lock sign of determining is dispensed to described client by described first node, give described client the described lock of described shared resource is identified to corresponding lock authority, for the access of described client to described shared resource, in this scheme, after the described lock authority request that first node sends in the client that receives first node, the lock sign that does not find the sign that comprises described shared resource in first node just forwards time, that is to say, want first in first node, to search the lock sign of the sign that whether comprises described shared resource, only when not existing, just forward, and while existing, directly distribute just, and that client is obtained lock sign from first node is fewer than the time of removing other nodes and obtain lock sign and expending, therefore, solved the consuming time longer problem of the method existence of current access shared resource.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and forms a part for specification, is used from explanation the present invention with the embodiment of the present invention one, is not construed as limiting the invention.In the accompanying drawings:
Figure 1A is the structural representation of dual-active data center in prior art;
Figure 1B is the structural representation of node and client in prior art;
Fig. 1 C is the schematic diagram of dual-active data center access shared resource in prior art;
Fig. 2 accesses the schematic diagram of shared resource in the embodiment of the present invention;
Fig. 3 is the first embodiment that accesses shared resource in the embodiment of the present invention;
Fig. 4 is the second embodiment that accesses shared resource in the embodiment of the present invention;
Fig. 5 accesses the illustrative view of functional configuration of the device of shared resource in the embodiment of the present invention.
Embodiment
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, 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, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
In addition, term " system " and " network " are often used interchangeably in this article herein.Term "and/or", is only a kind of incidence relation of describing affiliated partner herein, and expression can exist three kinds of relations, and for example, A and/or B, can represent: individualism A exists A and B, these three kinds of situations of individualism B simultaneously.In addition, alphabetical "/", generally represents that forward-backward correlation is to liking a kind of relation of "or" herein.
In order to solve the consuming time longer problem existing in prior art, in the embodiment of the present invention, to first receive the lock authority request of the sign of carrying shared resource of first node forwarding, wherein, lock authority request is that first node sends in the client that receives first node, and the lock that does not find the sign that comprises shared resource in first node forwards while identifying, then, from the lock sign of storage, determine the lock sign of the sign that comprises shared resource, finally, definite lock sign is dispensed to client by first node, give client the lock of shared resource is identified to corresponding lock authority, for the access of client to shared resource, in this scheme, after the lock authority request that first node sends in the client that receives first node, in first node, do not find that lock when sign of the sign that comprises shared resource forward, that is to say, want first in first node, to search the lock sign of the sign that whether comprises shared resource, while existing, directly distribute, only when not existing, just forward, and that client is obtained lock sign from first node is fewer than the time of removing other nodes and obtain lock sign and expending, therefore, solved the consuming time longer problem of the method existence of current access shared resource.
Below in conjunction with Figure of description, the preferred embodiment of the present invention is elaborated, be to be understood that, preferred embodiment described herein is only for description and interpretation the present invention, be not intended to limit the present invention, and in the situation that not conflicting, embodiment and the feature in embodiment in the application can combine mutually.
Below in conjunction with accompanying drawing, the preferred embodiment of the present invention is elaborated.
Consult shown in Fig. 2, in the embodiment of the present invention, the detailed process of access shared resource is as follows:
Step 200: the lock authority request that receives the sign of carrying shared resource of first node forwarding, wherein, lock authority request is that first node forwards when the client that receives first node lock sign that send and do not find the sign that comprises shared resource in first node;
Step 210: the lock sign of determining the sign that comprises shared resource from the lock sign of storage;
Step 220: definite lock sign is dispensed to client by first node, gives client the lock of shared resource is identified to corresponding lock authority, the access for client to shared resource.
In the embodiment of the present invention, lock sign comprises following information, and the mode of the sign of the shared resource of protection, access shared resource, in actual applications, can also comprise other information except above-mentioned two kinds of information, at this, no longer describes in detail.
In the embodiment of the present invention, the mode of access shared resource has multiple, as, read the mode of shared resource, now, the authority that reads this shared resource that client is obtained, and for example, write the mode of shared resource, now, the authority that writes this shared resource that client is obtained, wherein, if the authority that reads shared resource of obtaining, client can only be carried out read operation to this shared resource, can not carry out write operation; If the authority that writes shared resource of obtaining, client can not only be carried out read operation to this shared resource, can also carry out write operation, certainly, in actual applications, also has the mode of other access shared resources, at this, describes in detail no longer one by one.
In the embodiment of the present invention, the form of first node has multiple, for example, the lock sign corresponding to lock authority that can take for each client in buffer memory first node, or took, free time is less than the lock sign corresponding to lock authority of deleting threshold value, certainly, in actual applications, first node can also, for other information of buffer memory, describe in detail at this no longer one by one.
The executive agent of step 200-220 has multiple, take lock manager below as example describes, and it should be noted that, lock manager is an embodiment of executive agent, and in actual applications, executive agent can also be other, at this, describes in detail no longer one by one.
In actual applications, if client sends the lock authority request of access shared resource to other nodes, owing to being different internodal mutual, therefore, there is longer problem consuming time, in the embodiment of the present invention, in order to shorten client, send the lock authority request of access shared resource, or receive the time consuming of lock sign, client is when sending the lock authority request of access shared resource, can be to sending the lock authority request of accessing shared resource with the residing first node of client, if current lock sign of having stored the sign that comprises shared resource to be visited in first node, this first node is dispensed to client by corresponding lock sign, if current not storage comprises the lock sign of the sign of shared resource to be visited in this first node, this first node is sent to the lock authority request of access shared resource the lock manager of the lock authority of the access shared resource of managing different nodes, the lock sign of again lock manager receiving being returned is dispensed to client, and store this lock sign, when first node receives the lock authority request of the access shared resource that client sends again so, if this lock sign is not assigned with, this lock sign is dispensed to client, thereby avoided obtaining in the process of lock sign problem, the problem includes: longer problem consuming time.
For example, the node at client 1 place is in the first memory device, lock manager is positioned at the second memory device, wherein, lock manager is managed the lock authority of the first memory device and the second storage device access shared resource, client 1 will be obtained the lock sign of access the first shared resource, while locking authority, can directly to the lock manager that is positioned at the second memory device, send the lock authority request of access the first shared resource, now, owing to being two communication interactions between memory device, therefore, there is longer problem consuming time, in order to shorten client 1, send the lock authority request of access the first shared resource, or, obtain the time of the lock sign of access the first shared resource, client 1 can send to the first node at client 1 place the lock authority request of access the first shared resource, if in first node buffer memory access the lock sign of the first shared resource, and this lock sign is not assigned with, first node is sent to client 1 by this lock sign, that is to say, lock authority to client 1 assigns access the first shared resource, if the lock of cache access the first shared resource does not identify in first node, first node is sent to lock manager by the lock authority request of access the first shared resource, the lock sign that the lock manager receiving is returned is sent to client, and this lock sign of buffer memory, so that while receiving again the lock authority request of access the first shared resource that client 1 or other clients send, if this lock sign is not assigned with, this lock sign is sent to client.
In the embodiment of the present invention, the lock authority request that receives the sign of carrying shared resource of first node forwarding has various ways, for example, can receive the lock authority request of the sign of carrying shared resource that first node forwards by Section Point, wherein, lock authority request is that Section Point is receiving first node transmission, and the lock that does not find the sign that comprises shared resource in first node forwards while identifying, the above-mentioned a kind of implementation that just receives the lock authority request of the sign of carrying shared resource that first node forwards, in actual applications, also have other implementations, at this, no longer describe in detail.
The embodiment of the lock authority request of the sign of carrying shared resource that reception first node forwards by Section Point is as follows:
For example, the first memory device and the second memory device have 10 shared resources: shared resource 1, shared resource 2, ..., the corresponding lock of each shared resource identifies, the Section Point that is positioned at the first memory device can be stored 10 lock signs that shared resources difference is corresponding, namely access the lock authority of 10 shared resources, if be positioned at the client 1 of the second memory device, to access shared resource 1, client 1 can directly send the lock authority request of access shared resource 1 to the Section Point that is positioned at the first memory device, from Section Point, obtain the lock sign corresponding with shared resource 1, in order to raise the efficiency, client 1 also can first send the lock authority request of access shared resource 1 to residing first node, if first node is cached with the lock sign corresponding with shared resource 1, first node is sent to client 1 by this lock sign, to lock right assignment to client 1, if be not cached with the lock sign corresponding with shared resource 1 in first node, first node forwards the lock authority request of access shared resource 1 to Section Point, and the lock sign corresponding with shared resource 1 that the Section Point receiving is sent is sent to client 1, to lock right assignment to client 1.
In the embodiment of the present invention, Section Point has various ways, optional, for lock sign corresponding to the occupied lock authority of lock authority of buffer memory appointment, or, in the lock authority of appointment, took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
In the embodiment of the present invention, in a memory device, can also there be a plurality of Section Points, Section Point is for lock sign corresponding to the occupied lock authority of lock authority of buffer memory appointment, or, in the lock authority of appointment, took, free time is less than the lock sign corresponding to lock authority of deleting threshold value, now, different Section Points can be managed the lock sign that different shared resources is corresponding.
For example, the first memory device and the second memory device have 10 shared resources: shared resource 1, shared resource 2, ..., the corresponding lock of each shared resource identifies, be positioned at the lock sign corresponding to Section Point 1 managing shared resource 1-5 difference of the first memory device, be positioned at the lock sign corresponding to Section Point 2 managing shared resource 6-10 difference of the first memory device, be positioned at the lock sign corresponding to 10 shared resources difference of lock manager management of the second memory device, namely access the lock authority of 10 shared resources, if be positioned at the client 1 of the first memory device, to access shared resource 1, client 1 can directly send the lock authority request of access shared resource 1 to the lock manager that is positioned at the second memory device, from lock manager, obtain the lock sign corresponding with shared resource 1, in order to raise the efficiency, client 1 can first send the lock authority request of access shared resource 1 to residing first node, if first node is cached with the lock sign corresponding with shared resource 1, first node is sent to client 1 by this lock sign, to lock right assignment to client 1, if be not cached with the lock sign corresponding with shared resource 1 in first node, first node forwards the lock authority request of access shared resource 1 to Section Point 1, if while not finding the lock sign of the sign that comprises shared resource in Section Point 1, be forwarded to lock manager, and the lock sign corresponding with shared resource 1 that the lock manager receiving is sent is sent to client 1 by first node, to lock right assignment to client 1.
In like manner, if be positioned at the client 2 of the first memory device, to access shared resource 10, client 2 can directly send the lock authority request of access shared resource 10 to the lock manager that is positioned at the second memory device, obtains the lock sign corresponding with shared resource 10 from lock manager, in order to improve access efficiency, client 2 also can first send the lock authority request of access shared resource 10 to residing the 3rd node, if be cached with the lock sign corresponding with shared resource 10 in the 3rd node, the 3rd node is sent to client 2 by this lock sign, to lock right assignment to client 2, if be not cached with the lock sign corresponding with shared resource 10 in the 3rd node, the 3rd node forwards the lock authority request of access shared resource 10 to Section Point 2, if be not cached with the lock sign corresponding with shared resource 10 in Section Point 2, Section Point 2 forwards the lock authority request of access shared resource 10 to lock manager, and the lock sign corresponding with shared resource 10 that the lock manager receiving is sent is sent to client 2 by the 3rd node, to lock right assignment to client 2.
Above-described embodiment has just been enumerated the situation that a memory device only exists two Section Points, in actual applications, also may have a memory device to have the situation of a plurality of Section Points.If there are a plurality of Section Points in a memory device, client is when sending the lock authority request of access shared resource, first the lock authority request of access shared resource is sent to the first node at client place, if be cached with the lock sign corresponding with shared resource to be visited in the first node at client place, the first node at client place is sent to client by lock sign corresponding to the shared resource with to be visited, if be not cached with the lock sign corresponding with shared resource to be visited in the first node at client place, the lock authority request of access shared resource is forwarded to corresponding Section Point, if be cached with the lock sign corresponding with shared resource to be visited in Section Point, Section Point is sent to client by lock sign corresponding to the shared resource with to be visited, if be not cached with the lock sign corresponding with shared resource to be visited in Section Point, the lock authority request of access shared resource is forwarded to lock manager.
In the embodiment of the present invention, the mode of the lock authority request of the sign of carrying shared resource that reception first node forwards has multiple, for example, can directly by first node, receive the lock authority request of the sign of carrying shared resource of first node forwarding; Also can be by Section Point, to receive the lock authority request of the sign of carrying shared resource of first node forwarding.
So, in like manner, the mode that definite lock sign is dispensed to client by first node also has multiple, for example, can be that definite lock sign is directly dispensed to client by first node; Or, can be also definite lock sign to be sent to first node by Section Point, so that first node is dispensed to client by lock sign.
In the embodiment of the present invention, no matter client is to directly send the lock authority request of access shared resource to lock manager, or to first node, or Section Point sends the lock authority request of access shared resource, receive in the lock manager of this request or node and may store the lock sign corresponding with the shared resource of accessing, but this lock sign is sent to client, it is occupied that namely this locks lock authority corresponding to sign, now, when definite lock identifies corresponding lock authority and is taken by other clients, to the client that takies lock authority, send lock authority and recall indication, after completing access shared resource, the client that order takies lock authority discharges lock authority, lock sign corresponding to lock authority that the client that takies lock authority is discharged is dispensed to client by first node.
That is to say, the mode that definite lock sign is dispensed to client by first node has multiple, for example: if definite lock identifies corresponding lock authority while being taken by other clients, to the client that takies lock authority, send lock authority and recall indication, after the client that order takies lock authority completes access shared resource, discharge lock authority, lock sign corresponding to lock authority that the client that takies lock authority is discharged is dispensed to client by first node.
For example, client 1 sends the lock authority request of access shared resource 1 to Section Point, if the lock sign corresponding with shared resource 1 of buffer memory is assigned to other nodes in Section Point, that is to say, lock authority corresponding to this lock sign is assigned to client 2, to the client 2 that takies lock authority, send lock authority and recall indication, the client 2 that order takies lock authority completes release lock authority while accessing shared resource, then, lock sign corresponding to lock authority that Section Point discharges the client 2 that takies lock authority is again dispensed to client 1.
Above-described embodiment, the lock corresponding with shared resource to be visited sign buffer memory in Section Point of just take is assigned to other clients as example, in actual applications, also may be in the first node at client place, or, in lock manager, the lock corresponding with shared resource to be visited sign buffer memory is assigned to other clients, now, first node or lock manager send lock authority to the client that takies lock authority and recall indication, process is same as the previously described embodiments, at this, no longer describes in detail.
In order to understand better the embodiment of the present invention, below provide concrete application scenarios, for the process of access shared resource, make and describing in further detail:
By one-level, lock the embodiment that delegation node obtains lock sign.
Embodiment mono-(as shown in Figure 3):
Step 300: client 1 sends the lock authority request of access shared resource 1 to the first node at place;
Step 310: first node judges whether store the lock sign corresponding with shared resource 1 in first node and this lock sign is not assigned with, and if so, performs step 350, otherwise, perform step 320;
Step 320: first node is sent to lock manager by the lock authority request of access shared resource 1;
Wherein, lock manager is positioned at the second memory device.
Step 330: lock manager judges that whether storing the lock sign corresponding with shared resource 1 and this lock in first node identifies and be not assigned with; If so, perform step 340, otherwise, execution step 360;
Step 340: lock manager is sent to first node by the lock sign corresponding with shared resource 1;
Step 350: first node is sent to client 1 by the lock sign corresponding with shared resource 1;
Step 360: lock manager sends lock authority to the client 2 that takies lock authority and recalls indication, and lock sign corresponding to the lock authority that the client 2 that takies lock authority is discharged is sent to client 1 by first node.
Embodiment bis-(as shown in Figure 4):
Step 400: client 1 sends the lock authority request of access shared resource 1 to the first node at place;
Step 410: first node judges whether store the lock sign corresponding with shared resource 1 in first node and this lock sign is not assigned with, and if so, performs step 480, otherwise, perform step 420;
Step 420: first node is sent to Section Point by the lock authority request of access shared resource 1;
In this step, client 1 is positioned at the first memory device with Section Point.
Step 430: Section Point judges whether store the lock sign corresponding with shared resource 1 in first node and this lock sign is not assigned with, and if so, performs step 470, otherwise, perform step 440;
Step 440: Section Point is sent to lock manager by the lock authority request of access shared resource 1;
Wherein, lock manager is positioned at the second memory device.
Step 450: lock manager judges that whether storing the lock sign corresponding with shared resource 1 and this lock in first node identifies and be not assigned with; If so, perform step 460, otherwise, execution step 490;
Step 460: lock manager is sent to Section Point by the lock sign corresponding with shared resource 1;
Step 470: Section Point is sent to first node by the lock sign corresponding with shared resource 1;
Step 480: first node is sent to client 1 by the lock sign corresponding with shared resource 1;
Step 490: lock manager sends lock authority to the client 2 that takies lock authority and recalls indication, and lock sign corresponding to lock authority that takies client 2 releases of lock authority is forwarded to first node by Section Point, make first node be sent to client 1.
Consult shown in Fig. 5, the embodiment of the present invention also provides a kind of device of accessing shared resource, and this device comprises receiving element 500, determining unit 510, allocation units 520, wherein:
Receiving element 500, for receiving the lock authority request of the sign of carrying shared resource of first node forwarding; Wherein, lock authority request is that first node forwards when the client that receives first node lock sign that send and do not find the sign that comprises shared resource in first node;
Determining unit 510, the lock of determining the sign that comprises shared resource for the lock sign from storage identifies;
Allocation units 520, for definite lock sign is dispensed to client by first node, give client the lock of shared resource are identified to corresponding lock authority, the access for client to shared resource.
In the embodiment of the present invention, optionally, the lock authority request that receiving element 500 receives is that first node sends, lock sign corresponding to lock authority that first node takies for each client of buffer memory first node, or took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
In the embodiment of the present invention, optional, receiving element 500 specifically for:
The lock authority request of the sign of carrying shared resource that reception first node forwards by Section Point;
Wherein, to be Section Point forward receiving when first node sends and do not find in first node the lock sign of the sign that comprises shared resource lock authority request.
In the embodiment of the present invention, optionally, the lock authority request that receiving element 500 receives is that Section Point sends, Section Point is for lock sign corresponding to the occupied lock authority of lock authority of buffer memory appointment, or, in the lock authority of appointment, took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
In the embodiment of the present invention, optional, allocation units 520 specifically for:
Definite lock sign is sent to first node by Section Point, so that first node is dispensed to client by lock sign.
In the embodiment of the present invention, optional, allocation units 520 specifically for:
If definite lock identifies corresponding lock authority while being taken by other clients, to the client that takies lock authority, send lock authority and recall indication, after completing access shared resource, the client that order takies lock authority discharges lock authority;
Lock sign corresponding to lock authority that the client that takies lock authority is discharged is dispensed to client by first node.
In sum, in the embodiment of the present invention, first receive the lock authority request of the sign of carrying shared resource of first node forwarding, wherein, lock authority request is that first node sends in the client that receives first node, and the lock that does not find the sign that comprises shared resource in first node forwards while identifying, then, from the lock sign of storage, determine the lock sign of the sign that comprises shared resource, finally, definite lock sign is dispensed to client by first node, give client the lock of shared resource is identified to corresponding lock authority, for the access of client to shared resource, in this scheme, after the lock authority request that first node sends in the client that receives first node, the lock sign that does not find the sign that comprises shared resource in first node just forwards time, that is to say, want first in first node, to search the lock sign of the sign that whether comprises shared resource, only when not existing, just forward, and while existing, directly distribute just, and that client is obtained lock sign from first node is fewer than the time of removing other nodes and obtain lock sign and expending, therefore, solved the consuming time longer problem of the method existence of current access shared resource.
The present invention is with reference to describing according to flow chart and/or the block diagram of the method for the embodiment of the present invention, equipment (system) and computer program.Should understand can be in computer program instructions realization flow figure and/or block diagram each flow process and/or the flow process in square frame and flow chart and/or block diagram and/or the combination of square frame.Can provide these computer program instructions to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, the instruction of carrying out by the processor of computer or other programmable data processing device is produced for realizing the device in the function of flow process of flow chart or a plurality of flow process and/or a square frame of block diagram or a plurality of square frames.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, the instruction that makes to be stored in this computer-readable memory produces the manufacture that comprises command device, and this command device is realized the function in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make to carry out sequence of operations step to produce computer implemented processing on computer or other programmable devices, thereby the instruction of carrying out is provided for realizing the step of the function in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame on computer or other programmable devices.
Although described the preferred embodiments of the present invention, once those skilled in the art obtain the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to all changes and the modification that are interpreted as comprising preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the embodiment of the present invention the embodiment of the present invention.Like this, if within these of the embodiment of the present invention are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.

Claims (12)

1. a method of accessing shared resource, is characterized in that, comprising:
Receive the lock authority request of the sign of carrying shared resource of first node forwarding;
Wherein, described lock authority request is that described first node forwards when the client that receives first node lock sign that send and do not find the sign that comprises described shared resource in first node;
From the lock sign of storage, determine the lock sign of the sign that comprises described shared resource;
The described lock sign of determining is dispensed to described client by described first node, gives described client the described lock of described shared resource is identified to corresponding lock authority, the access for described client to described shared resource.
2. the method for claim 1, it is characterized in that, lock sign corresponding to lock authority that described first node takies for each client of first node described in buffer memory, or took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
3. method as claimed in claim 1 or 2, is characterized in that, the lock authority request of the sign of carrying shared resource that described reception first node forwards, specifically comprises:
Receive the lock authority request of the sign of carrying described shared resource that described first node forwards by Section Point;
Wherein, to be described Section Point forward when described first node sends and do not find in first node the lock sign of the sign that comprises described shared resource receiving described lock authority request.
4. method as claimed in claim 3, it is characterized in that, described Section Point is for lock sign corresponding to the occupied lock authority of lock authority of buffer memory appointment, or, in the lock authority of appointment, took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
5. the method as described in claim 3 or 4, is characterized in that, described the described lock sign of determining is dispensed to described client by described first node, specifically comprises:
The described lock sign of determining is sent to described first node by described Section Point, so that described first node is dispensed to described client by described lock sign.
6. the method as described in claim 1-5 any one, is characterized in that, described the described lock sign of determining is dispensed to described client by described first node, specifically comprises:
If the described lock of determining identifies corresponding lock authority while being taken by other clients, to the client that takies described lock authority, send lock authority and recall indication, after completing the described shared resource of access, the client that order takies described lock authority discharges described lock authority;
Lock sign corresponding to lock authority that the client that takies described lock authority is discharged is dispensed to described client by described first node.
7. a device of accessing shared resource, is characterized in that, comprising:
Receiving element, for receiving the lock authority request of the sign of carrying shared resource of first node forwarding; Wherein, described lock authority request is that described first node forwards when the client that receives first node lock sign that send and do not find the sign that comprises described shared resource in first node;
Determining unit, the lock of determining the sign that comprises described shared resource for the lock sign from storage identifies;
Allocation units, for the described lock sign of determining is dispensed to described client by described first node, give described client the described lock of described shared resource are identified to corresponding lock authority, the access for described client to described shared resource.
8. device as claimed in claim 7, it is characterized in that, the described lock authority request that described receiving element receives is that described first node sends, lock sign corresponding to lock authority that described first node takies for each client of first node described in buffer memory, or took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
As claimed in claim 7 or 8 device, it is characterized in that, described receiving element specifically for:
Receive the lock authority request of the sign of carrying described shared resource that described first node forwards by Section Point;
Wherein, to be described Section Point forward when described first node sends and do not find in first node the lock sign of the sign that comprises described shared resource receiving described lock authority request.
10. device as claimed in claim 9, it is characterized in that, the described lock authority request that described receiving element receives is that described Section Point sends, described Section Point is for lock sign corresponding to the occupied lock authority of lock authority of buffer memory appointment, or, in the lock authority of appointment, took, free time is less than the lock sign corresponding to lock authority of deleting threshold value.
11. devices as described in claim 9 or 10, is characterized in that, described allocation units specifically for:
The described lock sign of determining is sent to described first node by described Section Point, so that described first node is dispensed to described client by described lock sign.
12. devices as described in claim 7-11 any one, is characterized in that, described allocation units specifically for:
If the described lock of determining identifies corresponding lock authority while being taken by other clients, to the client that takies described lock authority, send lock authority and recall indication, after completing the described shared resource of access, the client that order takies described lock authority discharges described lock authority;
Lock sign corresponding to lock authority that the client that takies described lock authority is discharged is dispensed to described client by described first node.
CN201310689369.3A 2013-12-13 2013-12-13 A kind of method and device for accessing shared resource Active CN103716383B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310689369.3A CN103716383B (en) 2013-12-13 2013-12-13 A kind of method and device for accessing shared resource
PCT/CN2014/088928 WO2015085826A1 (en) 2013-12-13 2014-10-20 Method and apparatus for accessing shared resource

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310689369.3A CN103716383B (en) 2013-12-13 2013-12-13 A kind of method and device for accessing shared resource

Publications (2)

Publication Number Publication Date
CN103716383A true CN103716383A (en) 2014-04-09
CN103716383B CN103716383B (en) 2017-12-15

Family

ID=50408953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310689369.3A Active CN103716383B (en) 2013-12-13 2013-12-13 A kind of method and device for accessing shared resource

Country Status (2)

Country Link
CN (1) CN103716383B (en)
WO (1) WO2015085826A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015085826A1 (en) * 2013-12-13 2015-06-18 华为技术有限公司 Method and apparatus for accessing shared resource
CN106202074A (en) * 2015-04-29 2016-12-07 中兴通讯股份有限公司 A kind of method and device processing shared file
CN107402821A (en) * 2017-07-03 2017-11-28 阿里巴巴集团控股有限公司 Access control method, device and the equipment of shared resource
CN108038005A (en) * 2017-12-28 2018-05-15 广东蜂助手网络技术股份有限公司 Shared resource access method, client, server-side, system based on zookeeper
CN109063132A (en) * 2018-08-02 2018-12-21 上海达梦数据库有限公司 Latch requesting method, latch authorization method, device and terminal device
CN109697127A (en) * 2017-10-24 2019-04-30 华为技术有限公司 The method and apparatus that the access operation of a kind of pair of shared resource locks
CN109947575A (en) * 2019-03-21 2019-06-28 恒生电子股份有限公司 Locking, method for releasing and the related system of Read-Write Locks
CN110879743A (en) * 2019-11-20 2020-03-13 深圳市网心科技有限公司 Task elimination method, device, system and medium based on edge computing environment
CN114500390A (en) * 2021-12-29 2022-05-13 中国航空工业集团公司西安航空计算技术研究所 RapidIO network flow control method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980236A (en) * 2005-12-09 2007-06-13 英业达股份有限公司 Distribution-type data dynamic program agent method
US20100114889A1 (en) * 2008-10-30 2010-05-06 Netapp, Inc. Remote volume access and migration via a clustered server namespace
CN102375955A (en) * 2010-08-17 2012-03-14 伊姆西公司 System and method for locking files in combined naming space in network file system
CN103248667A (en) * 2012-02-14 2013-08-14 阿里巴巴集团控股有限公司 Resource access method and system for distributed system
CN103297268A (en) * 2013-05-13 2013-09-11 北京邮电大学 P2P (peer to peer) technology based distributed data consistency maintaining system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716383B (en) * 2013-12-13 2017-12-15 华为技术有限公司 A kind of method and device for accessing shared resource

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980236A (en) * 2005-12-09 2007-06-13 英业达股份有限公司 Distribution-type data dynamic program agent method
US20100114889A1 (en) * 2008-10-30 2010-05-06 Netapp, Inc. Remote volume access and migration via a clustered server namespace
CN102375955A (en) * 2010-08-17 2012-03-14 伊姆西公司 System and method for locking files in combined naming space in network file system
CN103248667A (en) * 2012-02-14 2013-08-14 阿里巴巴集团控股有限公司 Resource access method and system for distributed system
CN103297268A (en) * 2013-05-13 2013-09-11 北京邮电大学 P2P (peer to peer) technology based distributed data consistency maintaining system and method

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015085826A1 (en) * 2013-12-13 2015-06-18 华为技术有限公司 Method and apparatus for accessing shared resource
CN106202074A (en) * 2015-04-29 2016-12-07 中兴通讯股份有限公司 A kind of method and device processing shared file
CN106202074B (en) * 2015-04-29 2021-02-23 中兴通讯股份有限公司 Method and device for processing shared file
CN107402821B (en) * 2017-07-03 2020-06-30 阿里巴巴集团控股有限公司 Access control method, device and equipment for shared resources
CN107402821A (en) * 2017-07-03 2017-11-28 阿里巴巴集团控股有限公司 Access control method, device and the equipment of shared resource
CN109697127A (en) * 2017-10-24 2019-04-30 华为技术有限公司 The method and apparatus that the access operation of a kind of pair of shared resource locks
CN109697127B (en) * 2017-10-24 2020-12-01 华为技术有限公司 Method and device for locking access operation of shared resource
CN108038005A (en) * 2017-12-28 2018-05-15 广东蜂助手网络技术股份有限公司 Shared resource access method, client, server-side, system based on zookeeper
CN109063132A (en) * 2018-08-02 2018-12-21 上海达梦数据库有限公司 Latch requesting method, latch authorization method, device and terminal device
CN109947575A (en) * 2019-03-21 2019-06-28 恒生电子股份有限公司 Locking, method for releasing and the related system of Read-Write Locks
CN110879743A (en) * 2019-11-20 2020-03-13 深圳市网心科技有限公司 Task elimination method, device, system and medium based on edge computing environment
CN114500390A (en) * 2021-12-29 2022-05-13 中国航空工业集团公司西安航空计算技术研究所 RapidIO network flow control method
CN114500390B (en) * 2021-12-29 2024-01-19 中国航空工业集团公司西安航空计算技术研究所 rapidIO network flow control method

Also Published As

Publication number Publication date
CN103716383B (en) 2017-12-15
WO2015085826A1 (en) 2015-06-18

Similar Documents

Publication Publication Date Title
CN103716383A (en) Method and device for accessing shared resources
US11882011B2 (en) Distributed workload reassignment following communication failure
US9003002B2 (en) Efficient port management for a distributed network address translation
US9875259B2 (en) Distribution of an object in volatile memory across a multi-node cluster
US10235047B2 (en) Memory management method, apparatus, and system
CN111694649A (en) Resource scheduling method and device, computer equipment and storage medium
CN110069346B (en) Method and device for sharing resources among multiple processes and electronic equipment
CN111722933B (en) Deadlock resolution between distributed processes
WO2020215752A1 (en) Graph computing method and device
CN112153167A (en) Internet interconnection protocol management method, device, electronic equipment and storage medium
US20180188990A1 (en) Method, apparatus and system for inserting disk
CN106802939A (en) A kind of method and system of resolving data conflicts
CN111352863A (en) Memory management method, device, equipment and storage medium
CN112650692A (en) Heap memory allocation method, device and storage medium
CN110706148A (en) Face image processing method, device, equipment and storage medium
US9547590B2 (en) Managing memory
CN111475424B (en) Method, apparatus, and computer readable storage medium for managing a storage system
CN104869531B (en) Group member updating method and device
CN114253730A (en) Method, device and equipment for managing database memory and storage medium
CN114090249A (en) Resource allocation method, device, electronic equipment and storage medium
CN109710183B (en) Data synchronization method and device
KR101889749B1 (en) Message scheduling method
US20200301756A1 (en) Deadlock resolution between distributed processes using process and aggregated information
CN112559164A (en) Resource sharing method and device
CN109726017B (en) Method and device for sharing cache between application programs

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