CN103248667A - Resource access method and system for distributed system - Google Patents

Resource access method and system for distributed system Download PDF

Info

Publication number
CN103248667A
CN103248667A CN201210033052XA CN201210033052A CN103248667A CN 103248667 A CN103248667 A CN 103248667A CN 201210033052X A CN201210033052X A CN 201210033052XA CN 201210033052 A CN201210033052 A CN 201210033052A CN 103248667 A CN103248667 A CN 103248667A
Authority
CN
China
Prior art keywords
mutual exclusion
lock
resource
server
exclusion lock
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
CN201210033052XA
Other languages
Chinese (zh)
Other versions
CN103248667B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201210033052.XA priority Critical patent/CN103248667B/en
Publication of CN103248667A publication Critical patent/CN103248667A/en
Priority to HK13110854.9A priority patent/HK1183573A1/en
Application granted granted Critical
Publication of CN103248667B publication Critical patent/CN103248667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a resource access method and system for a distributed system. The resource access method comprises the following steps: before accessing the resource, a current server sets a current mutex identity of the source positioned at the local to a locked state; the current server requests other servers in the distributed system to set corresponding other mutex identities of the source to be in the locked state; the current server determines whether the locking of the other servers in the distributed system on the other mutex identities is successful or not; and if yes, the current server can access the resource. By adopting the method and the system provided by the invention, concurrent access of the source can be avoided.

Description

A kind of resource access method of distributed system and system
Technical field
The application relates to the network data processing field, particularly a kind of resource access method of distributed system and system.
Background technology
Distributed system (distributed system) is the software systems that are based upon on the network.Because most distributed systems are based upon on the computer network, so distributed system and computer network are essentially identical in physical structure.Distributed system is when working procedure, and many computers program can being transferred in the system move simultaneously.
When many computers in distributed system moved a certain program simultaneously, the situation that many computers are visited a certain data simultaneously may appear.This is commonly referred to the concurrent visit of resource in the art.Because computer after having access to the data of request, may be made amendment to data, so the error in data for fear of many computers are made amendment and caused a certain data simultaneously should prevent the concurrent visit to resource as far as possible.
In order to prevent that in distributed system to the concurrent visit of resource, the resource access method of distributed system of the prior art mainly is the lock function that utilizes the Memcache system.
During specific implementation, the principle of the lock function of Memcache system mainly is: before certain resource of computer access, attempt pinning a character string in the Memcache system earlier; If this character string is in the lock state, illustrate that then this resource is by other computer access, this then current computer is failed to the visit of this resource, otherwise illustrate that this resource is not by other computer access, after then pinning this character string by this current computer, just can visit this resource, also can avoid to occur visiting when other computers are follow-up to visit again this resource the situation of failure.
But, because the resource access method of distributed system of the prior art is higher to the reliability requirement of Memcache system, so if the Memcache system makes mistakes, the concurrent visit of resource can take place still.For example the back is restarted to the lock information dropout of certain resource in the Memcache system, when then whether the character string of other these resources of computer inquery is in the lock state, will think that this character string is in unlocked state by mistake.Before yet the Memcache system restarted, the character string of this resource was in the lock state, and this expression has other computer in this resource of visit, and this moment, different computers carries out concurrent visit to resource problem will take place.
In a word, need the urgent technical problem that solves of those skilled in the art to be exactly at present: the resource access method of a kind of distributed system of proposition how can innovate, can't effectively prevent when visiting the resource of distributed system the problem to the resource concurrence visit of appearance in the prior art to solve.
The application content
The application's technical problem to be solved provides a kind of resource access method of distributed system, in order to solve computers different in the prior art when visiting the resource of distributed system, the problem to the resource concurrence visit of appearance.
The application also provides a kind of resource access system of distributed system, in order to guarantee said method realization and application in practice.
In order to address the above problem, the application discloses a kind of resource access method of distributed system, each station server in the described distributed system has and described resource mutual exclusion lock sign one to one, and described mutual exclusion lock sign has lock-out state and unlocked state, and described method comprises:
Before the described resource of visit, the local current mutual exclusion lock sign that is positioned at of the described resource of current server is set to described lock-out state;
Other corresponding mutual exclusion lock signs of the described resource of other servers in the described distributed system of described current server request are set to lock-out state;
Described current server judges whether other servers in the described distributed system lock success to described other mutual exclusion lock signs;
If then described current server is visited described resource.
Preferably, the local current mutual exclusion lock sign that is positioned at of described resource is set to described lock-out state, comprising:
Search the resource identification of described resource; Described resource identification is corresponding one by one with described resource;
According to the mapping relations between predefined resource identification and the mutual exclusion lock sign, determine the current mutual exclusion lock sign that being positioned at of described resource is local;
Described current mutual exclusion lock sign is set to described lock-out state.
Preferably, other corresponding mutual exclusion lock signs of the described resource of other servers in the described current server request distributed system are set to lock-out state, comprising:
Described current server reads the server address information that the mutual exclusion lock identification-state need be set from the concurrent Access Control List (ACL) of preserving in advance; Store the server address information that has concurrent access conflict in the described concurrent Access Control List (ACL);
According to described server address information, described current server sends the request of visiting described resource to the server that needs arrange the mutual exclusion lock identification-state, so that described needs arrange the server of mutual exclusion lock identification-state receive described request after, the described mutual exclusion lock sign of attempting this locality is set to lock-out state;
Described current server receives the feedback information that expression that server that described needs arrange the mutual exclusion lock identification-state sends arranges success;
Then describedly judge that whether the described mutual exclusion lock sign corresponding with described resource of other servers in the described distributed system locks success, specifically comprises:
Judge whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
Preferably, described judging whether receives the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state, specifically comprises:
Judge whether in first Preset Time, to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
Preferably, under other servers in distributed system pair and described other mutual exclusion lock sign non-locking case of successful, described method also comprises:
Described current server judges whether to arrive second Preset Time, if then carry out the step that the local current mutual exclusion lock sign of being positioned at of the described resource of described current server is set to described lock-out state.
The application also provides a kind of resource access system of distributed system, each station server in the described distributed system has and described resource mutual exclusion lock sign one to one, described mutual exclusion lock sign has lock-out state and unlocked state, and described resource access system comprises:
Local sign lock cell was used for before the described resource of visit, and the local current mutual exclusion lock sign that is positioned at of described resource is set to described lock-out state;
Other sign locking request units, other the corresponding mutual exclusion lock signs of the described resource of other servers that are used for the described distributed system of request are set to lock-out state;
First judging unit is used for judging whether other servers of described distributed system lock success to described other mutual exclusion lock signs;
Addressed location, be used for when the judged result of described first judging unit when being, visit described resource.
Preferably, described local sign lock cell comprises:
Resource identification is searched subelement, is used for searching the resource identification of described resource; Described resource identification is corresponding one by one with described resource;
The mutual exclusion lock sign is determined subelement, is used for according to the mapping relations between predefined resource identification and the mutual exclusion lock sign, determines the current mutual exclusion lock sign that being positioned at of described resource is local;
Mutual exclusion lock lock indication stator unit is used for described current mutual exclusion lock sign and is set to described lock-out state.
Preferably, described other sign locking request units comprise:
Address information reads subelement, is used for reading the server address information that the mutual exclusion lock identification-state need be set from the concurrent Access Control List (ACL) of preserving in advance; Store the server address information that has concurrent access conflict in the described concurrent Access Control List (ACL);
Locking request sends subelement, is used for according to described server address information, and the server that the mutual exclusion lock identification-state is set to needs sends the request of visiting described resource;
Feedback information receives subelement, is used for receiving the feedback information that expression that server that described needs arrange the mutual exclusion lock identification-state sends arranges success; So that described needs arrange the server of mutual exclusion lock identification-state receive described request after, the described mutual exclusion lock sign of attempting this locality is set to lock-out state;
Described first judging unit specifically comprises:
First judgment sub-unit is used for judging whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
Preferably, described first judgment sub-unit specifically comprises:
The timing judgment sub-unit is used for judging whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state in first Preset Time.
Preferably, also comprise:
The timing judging unit is used for judging whether to arrive second Preset Time under other servers of distributed system pair and described other mutual exclusion lock sign non-locking case of successful;
Local sign lock cell control unit, be used for when the judged result of described timing judging unit when being, control the described local current mutual exclusion lock that is positioned at this locality that identifies the described resource of lock cell and identifies and be set to described lock-out state.
Compared with prior art, the application comprises following advantage:
In this application, since for every server-assignment that concurrent access conflict may take place the mutual exclusion lock sign, and at every turn before certain resource of visit, need all to confirm that other servers can identify the mutual exclusion lock about this resource separately successfully locking, occur crashing and situation such as restart if other servers are being visited this resource or other servers, present embodiment just suspends the visit to described resource, so can be avoided the situation of resource concurrence visit is taken place.
In addition, because among the application, whether blocked mutual exclusion lock identifies in the third party systems such as no longer being stored in Memcache the expression resource, therefore, also no longer relies on the stability of third party system.
Among the application, can also control the time span of the feedback information of waiting for other servers, avoid waits for too long and form deadlock.
Certainly, arbitrary product of enforcement the application might not need to reach simultaneously above-described all advantages.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present application, the accompanying drawing of required use is done to introduce simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiment of the application, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the flow chart of resource access method embodiment 1 of a kind of distributed system of the application;
Fig. 2 is the flow chart of resource access method embodiment 2 of a kind of distributed system of the application;
Fig. 3 identifies the flow chart of steps that is set to described lock-out state for the local current mutual exclusion lock that is positioned at of the application's described resource;
Fig. 4 is set to the flow chart of steps of lock-out state for other corresponding mutual exclusion lock signs of the described resource of other servers in the application's the distributed system;
Fig. 5 is the structure chart of resource access system embodiment 1 of the application's distributed system;
Fig. 6 is the structure chart of resource access system embodiment 2 of the application's distributed system;
Fig. 7 is the structure chart of this locality sign lock cell of the application;
Fig. 8 is the structure chart of other sign locking request units of the application.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment only is the application's part embodiment, rather than whole embodiment.Based on the embodiment among the application, those of ordinary skills are not making the every other embodiment that obtains under the creative work prerequisite, all belong to the scope of the application's protection.
The application can be used in numerous general or special purpose calculation element environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multiprocessor device, comprise distributed computing environment (DCE) of above any device or equipment etc.
The application can describe in the general context of the computer executable instructions of being carried out by computer, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.Also can in distributed computing environment (DCE), put into practice the application, in these distributed computing environment (DCE), be executed the task by the teleprocessing equipment that is connected by communication network.In distributed computing environment (DCE), program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
One of main thought of the application can comprise, for some may be by concurrent accessed resources, before this resource is conducted interviews, to might visit this resource server send request, judge by this request whether other servers are visiting this resource, only when the feedback information of every other server was represented not visit this resource, current server just conducted interviews to this resource.
Concrete, among the application, each station server in the described distributed system has and described resource mutual exclusion lock sign one to one, and described mutual exclusion lock sign has lock-out state and unlocked state.When described mutual exclusion lock sign was in the lock state, the server with described mutual exclusion lock sign just can not visit again described resource.And, after described mutual exclusion lock sign is in the lock state, can not be locked again.Therefore described mutual exclusion lock sign can guarantee at synchronization to have only a process to visit described resource.
Fig. 1 is the flow chart of resource access method embodiment 1 of a kind of distributed system of the application.As shown in Figure 1, this method can may further comprise the steps:
S101: before the described resource of visit, the local current mutual exclusion lock sign that is positioned at of the described resource of current server is set to described lock-out state;
S102: other corresponding mutual exclusion lock signs of the described resource of other servers in the described distributed system of described current server request are set to lock-out state;
Current server may exist the server of concurrent visit to send request to other, asks other servers of other servers to be set to lock-out state about the mutual exclusion lock sign of this resource.Other servers receive this request, can attempt the mutual exclusion lock about this resource of self is locked.If lock successfully, other servers can return the successful feedback information of expression locking to current server.
S103: described current server judges whether other servers in the described distributed system lock success to described other mutual exclusion lock signs; If, execution in step S104; Otherwise, stop.
Among the step S103, can judge whether other servers in the described distributed system lock success to described other mutual exclusion lock signs by judging whether to receive the successful feedback information of expression locking that other all servers return.
Other servers do not return when representing to lock successful feedback information, may have multiple situation.A kind of situation is certain station server, and for example server A is being visited this resource; And server A is before this resource of visit, and the mutual exclusion lock sign about this resource with self and other servers has locked, and lock so other servers just can't identify this mutual exclusion lock again.Another kind of situation is, certain station server, and for example server B is restarted for a certain reason, and then in restarting process, this server B just can't be returned expression and lock successful feedback information.
S104: described current server is visited described resource.
As seen, among the application since for every server-assignment that concurrent access conflict may take place the mutual exclusion lock sign, and at every turn before certain resource of visit, need all to confirm that other servers can identify the mutual exclusion lock about this resource separately successfully locking, occur crashing and situation such as restart if other servers are being visited this resource or other servers, present embodiment just suspends the visit to described resource, so can be avoided the situation of resource concurrence visit is taken place.
In addition, because among the application, whether blocked mutual exclusion lock identifies in the third party systems such as no longer being stored in Memcache the expression resource, therefore, also no longer relies on the stability of third party system.
Fig. 2 is the flow chart of resource access method embodiment 2 of a kind of distributed system of the application.As shown in Figure 2, this method can may further comprise the steps:
S201: before the described resource of visit, the local current mutual exclusion lock sign that is positioned at of the described resource of current server is set to described lock-out state;
S202: other corresponding mutual exclusion lock signs of the described resource of other servers in the described distributed system of described current server request are set to lock-out state;
S203: judge whether in first Preset Time, to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state; If, execution in step S204; Otherwise, stop.
S204: described current server is visited described resource.
In the present embodiment, when judging whether to receive whole described needs the described feedback information of server of mutual exclusion lock identification-state being set, increased the judgement about the time, if in first Preset Time, do not receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state, then no longer wait for the feedback information of other servers, thinking has other servers in this resource of visit, thereby current server suspends this resource of visit.As seen, the resource access method of the distributed system in the present embodiment can be controlled the time span of the feedback information of waiting for other servers, avoids waits for too long and forms deadlock.
Fig. 3 identifies the flow chart of steps that is set to described lock-out state for the local current mutual exclusion lock that is positioned at of the application's described resource.As shown in Figure 3, this flow process can comprise step:
S301: the resource identification of searching described resource; Described resource identification is corresponding one by one with described resource;
Concrete, can distribute a unique ID as the resource identification of described resource for each resource.
S302: according to the mapping relations between predefined resource identification and the mutual exclusion lock sign, determine the current mutual exclusion lock sign that being positioned at of described resource is local;
Have mapping relations between described resource identification and the described mutual exclusion lock sign.Concrete, this relation can be kept in the mapping table of resource ID and mutual exclusion lock sign.When needs are determined the mutual exclusion lock sign of resource correspondence, can from this mapping table, search.
S303: described current mutual exclusion lock sign is set to described lock-out state.
Fig. 4 is set to the flow chart of steps of lock-out state for other corresponding mutual exclusion lock signs of the described resource of other servers in the application's the distributed system.As shown in Figure 4, this flow process can comprise step:
S401: from the concurrent Access Control List (ACL) of preserving in advance, read the server address information that the mutual exclusion lock identification-state need be set; Store the server address information that has concurrent access conflict in the described concurrent Access Control List (ACL);
Concrete, in the concurrent Access Control List (ACL), can store the server address information of the possibility that has concurrent access conflict.For resource X, may exist the server of concurrent access conflict may be A, B, C; For resource Y, may exist the server of concurrent access conflict may be B, C, D.That is to say, in the concurrent Access Control List (ACL), for a certain resource, can the distributed storage system in the address information of Servers-all, may be to the address information of the server of this resource concurrence visit and only need store.
S402: according to described server address information, the server that the mutual exclusion lock identification-state is set to needs sends the request of visiting described resource;
S403: after the server that the mutual exclusion lock identification-state need be set received described request, the described mutual exclusion lock sign of attempting this locality was set to lock-out state;
After needs arrange the described mutual exclusion lock sign of the server of mutual exclusion lock identification-state and are set to lock-out state, the server that the mutual exclusion lock identification-state need be set can send feedback information to the server that sends request, and this feedback information represents that the mutual exclusion lock sign arranges success.
S404: reception need arrange the feedback information that expression that the server of mutual exclusion lock identification-state sends arranges success;
Accordingly, describedly judge that whether the described mutual exclusion lock sign corresponding with described resource of other servers in the described distributed system locks success, specifically comprises:
S405: judge whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
Need to prove, in order to allow described current server can't receive whole described needs when the described feedback information of server of mutual exclusion lock identification-state is set, again attempt this resource of visit after can waiting for certain hour, in above-described embodiment, under other servers in distributed system pair and described other mutual exclusion lock sign non-locking case of successful, described method can also comprise step:
Described current server judges whether to arrive second Preset Time, if then carry out the step that the local current mutual exclusion lock sign of being positioned at of the described resource of described current server is set to described lock-out state.
For aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the application is not subjected to the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the application is necessary.
The application also provides a kind of resource access system of distributed system.Each station server in the described distributed system has and described resource mutual exclusion lock sign one to one, and described mutual exclusion lock sign has lock-out state and unlocked state.Need to prove that the resource access system of the distributed system among the present invention can be integrated in the server in actual applications and realize.
Fig. 5 is the structure chart of resource access system embodiment 1 of the application's distributed system.As shown in Figure 5, described resource access system comprises:
Local sign lock cell 501 was used for before the described resource of visit, and the local current mutual exclusion lock sign that is positioned at of described resource is set to described lock-out state;
Other sign locking request units 502, other the corresponding mutual exclusion lock signs of the described resource of other servers that are used for the described distributed system of request are set to lock-out state;
First judging unit 503 is used for judging whether other servers of described distributed system lock success to described other mutual exclusion lock signs;
Addressed location 504, be used for when the judged result of described first judging unit when being, visit described resource.
The resource access system of the application's distributed system, since for every server-assignment that concurrent access conflict may take place the mutual exclusion lock sign, and at every turn before certain resource of visit, need all to confirm that other servers can identify the mutual exclusion lock about this resource separately successfully locking, occur crashing and situation such as restart if other servers are being visited this resource or other servers, present embodiment just suspends the visit to described resource, so can be avoided the situation of resource concurrence visit is taken place.
In addition, because among the application, whether blocked mutual exclusion lock identifies in the third party systems such as no longer being stored in Memcache the expression resource, therefore, also no longer relies on the stability of third party system.
Fig. 6 is the structure chart of resource access system embodiment 2 of the application's distributed system.As shown in Figure 6, described resource access system comprises:
Local sign lock cell 601 was used for before the described resource of visit, and the local current mutual exclusion lock sign that is positioned at of described resource is set to described lock-out state;
Other sign locking request units 602, other the corresponding mutual exclusion lock signs of the described resource of other servers that are used for the described distributed system of request are set to lock-out state;
Timing judgment sub-unit 603 is used for judging whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state in first Preset Time;
Addressed location 604, be used for when the judged result of described first judging unit when being, visit described resource.
In the present embodiment, when judging whether to receive whole described needs the described feedback information of server of mutual exclusion lock identification-state be set by the timing judgment sub-unit, increased the judgement about the time, if in first Preset Time, do not receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state, then no longer wait for the feedback information of other servers, thinking has other servers in this resource of visit, thereby current server suspends this resource of visit.As seen, the resource access system of the distributed system in the present embodiment can control the time span of the feedback information of waiting for other servers, avoids waits for too long and forms deadlock.
Fig. 7 is the structure chart of this locality sign lock cell of the application.As shown in Figure 7, this this locality sign lock cell can comprise:
Resource identification is searched subelement 701, is used for searching the resource identification of described resource; Described resource identification is corresponding one by one with described resource;
The mutual exclusion lock sign is determined subelement 702, is used for according to the mapping relations between predefined resource identification and the mutual exclusion lock sign, determines the current mutual exclusion lock sign that being positioned at of described resource is local;
Mutual exclusion lock lock indication stator unit 703 is used for described current mutual exclusion lock sign and is set to described lock-out state.
Fig. 8 is the structure chart of other sign locking request units of the application.As shown in Figure 8, these other sign locking request unit can comprise:
Address information reads subelement 801, is used for reading the server address information that the mutual exclusion lock identification-state need be set from the concurrent Access Control List (ACL) of preserving in advance; Store the server address information that has concurrent access conflict in the described concurrent Access Control List (ACL);
Locking request sends subelement 802, is used for according to described server address information, and the server that the mutual exclusion lock identification-state is set to needs sends the request of visiting described resource;
Feedback information receives subelement 803, and the expression that is used for receiving the server transmission that the mutual exclusion lock identification-state need be set arranges the feedback information of success;
Accordingly, described first judging unit 503 specifically can comprise:
First judgment sub-unit is used for judging whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
Need to prove, in order to allow described current server can't receive whole described needs when the described feedback information of server of mutual exclusion lock identification-state is set, again attempt this resource of visit after can waiting for certain hour, in above-described embodiment, under other servers in distributed system pair and described other mutual exclusion lock sign non-locking case of successful, described system can also comprise:
The timing judging unit is used for judging whether to arrive second Preset Time under other servers of distributed system pair and described other mutual exclusion lock sign non-locking case of successful;
Local sign lock cell control unit, be used for when the judged result of described timing judging unit when being, control the described local current mutual exclusion lock that is positioned at this locality that identifies the described resource of lock cell and identifies and be set to described lock-out state.
Need to prove that each embodiment in this specification all adopts the mode of going forward one by one to describe, what each embodiment stressed is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For system class embodiment, because it is similar substantially to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
At last, also need to prove, in this article, relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint and have the relation of any this reality or in proper order between these entities or the operation.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby make and comprise that process, method, article or the equipment of a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or also be included as the intrinsic key element of this process, method, article or equipment.Do not having under the situation of more restrictions, the key element that is limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
For the convenience of describing, be divided into various unit with function when describing above system and describe respectively.Certainly, when implementing the application, can in same or a plurality of softwares and/or hardware, realize the function of each unit.
As seen through the above description of the embodiments, those skilled in the art can be well understood to the application and can realize by the mode that software adds essential general hardware platform.Based on such understanding, the part that the application's technical scheme contributes to prior art in essence in other words can embody with the form of software product, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the application or embodiment.
More than resource access method and the system of a kind of distributed system that the application is provided be described in detail, used specific case herein the application's principle and execution mode are set forth, the explanation of above embodiment just is used for helping to understand the application's method and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to the application's thought, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.

Claims (10)

1. the resource access method of a distributed system is characterized in that, each station server in the described distributed system has and described resource mutual exclusion lock sign one to one, and described mutual exclusion lock sign has lock-out state and unlocked state, and described method comprises:
Before the described resource of visit, the local current mutual exclusion lock sign that is positioned at of the described resource of current server is set to described lock-out state;
Other corresponding mutual exclusion lock signs of the described resource of other servers in the described distributed system of described current server request are set to lock-out state;
Described current server judges whether other servers in the described distributed system lock success to described other mutual exclusion lock signs;
If then described current server is visited described resource.
2. method according to claim 1 is characterized in that, the local current mutual exclusion lock sign that is positioned at of described resource is set to described lock-out state, comprising:
Search the resource identification of described resource; Described resource identification is corresponding one by one with described resource;
According to the mapping relations between predefined resource identification and the mutual exclusion lock sign, determine the current mutual exclusion lock sign that being positioned at of described resource is local;
Described current mutual exclusion lock sign is set to described lock-out state.
3. method according to claim 1 is characterized in that, other corresponding mutual exclusion lock signs of the described resource of other servers in the described current server request distributed system are set to lock-out state, comprising:
Described current server reads the server address information that the mutual exclusion lock identification-state need be set from the concurrent Access Control List (ACL) of preserving in advance; Store the server address information that has concurrent access conflict in the described concurrent Access Control List (ACL);
According to described server address information, described current server sends the request of visiting described resource to the server that needs arrange the mutual exclusion lock identification-state, so that described needs arrange the server of mutual exclusion lock identification-state receive described request after, the described mutual exclusion lock sign of attempting this locality is set to lock-out state;
Described current server receives the feedback information that expression that server that described needs arrange the mutual exclusion lock identification-state sends arranges success;
Then describedly judge that whether the described mutual exclusion lock sign corresponding with described resource of other servers in the described distributed system locks success, specifically comprises:
Judge whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
4. method according to claim 3 is characterized in that, described judging whether receives the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state, specifically comprises:
Judge whether in first Preset Time, to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
5. method according to claim 1 is characterized in that, under other servers in distributed system pair and described other mutual exclusion lock sign non-locking case of successful, described method also comprises:
Described current server judges whether to arrive second Preset Time, if then carry out the step that the local current mutual exclusion lock sign of being positioned at of the described resource of described current server is set to described lock-out state.
6. the resource access system of a distributed system, it is characterized in that, each station server in the described distributed system has and described resource mutual exclusion lock sign one to one, and described mutual exclusion lock sign has lock-out state and unlocked state, and described resource access system comprises:
Local sign lock cell was used for before the described resource of visit, and the local current mutual exclusion lock sign that is positioned at of described resource is set to described lock-out state;
Other sign locking request units, other the corresponding mutual exclusion lock signs of the described resource of other servers that are used for the described distributed system of request are set to lock-out state;
First judging unit is used for judging whether other servers of described distributed system lock success to described other mutual exclusion lock signs;
Addressed location, be used for when the judged result of described first judging unit when being, visit described resource.
7. system according to claim 6 is characterized in that, described local sign lock cell comprises:
Resource identification is searched subelement, is used for searching the resource identification of described resource; Described resource identification is corresponding one by one with described resource;
The mutual exclusion lock sign is determined subelement, is used for according to the mapping relations between predefined resource identification and the mutual exclusion lock sign, determines the current mutual exclusion lock sign that being positioned at of described resource is local;
Mutual exclusion lock lock indication stator unit is used for described current mutual exclusion lock sign and is set to described lock-out state.
8. system according to claim 6 is characterized in that, described other sign locking request units comprise:
Address information reads subelement, is used for reading the server address information that the mutual exclusion lock identification-state need be set from the concurrent Access Control List (ACL) of preserving in advance; Store the server address information that has concurrent access conflict in the described concurrent Access Control List (ACL);
Locking request sends subelement, is used for according to described server address information, and the server that the mutual exclusion lock identification-state is set to needs sends the request of visiting described resource;
Feedback information receives subelement, is used for receiving the feedback information that expression that server that described needs arrange the mutual exclusion lock identification-state sends arranges success; So that described needs arrange the server of mutual exclusion lock identification-state receive described request after, the described mutual exclusion lock sign of attempting this locality is set to lock-out state;
Described first judging unit specifically comprises:
First judgment sub-unit is used for judging whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state.
9. system according to claim 8 is characterized in that, described first judgment sub-unit specifically comprises:
The timing judgment sub-unit is used for judging whether to receive the described feedback information that whole described needs arrange the server of mutual exclusion lock identification-state in first Preset Time.
10. system according to claim 6 is characterized in that, also comprises:
The timing judging unit is used for judging whether to arrive second Preset Time under other servers of distributed system pair and described other mutual exclusion lock sign non-locking case of successful;
Local sign lock cell control unit, be used for when the judged result of described timing judging unit when being, control the described local current mutual exclusion lock that is positioned at this locality that identifies the described resource of lock cell and identifies and be set to described lock-out state.
CN201210033052.XA 2012-02-14 2012-02-14 A kind of resource access method of distributed system and system Active CN103248667B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201210033052.XA CN103248667B (en) 2012-02-14 2012-02-14 A kind of resource access method of distributed system and system
HK13110854.9A HK1183573A1 (en) 2012-02-14 2013-09-24 Method and system for accessing resources of a distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210033052.XA CN103248667B (en) 2012-02-14 2012-02-14 A kind of resource access method of distributed system and system

Publications (2)

Publication Number Publication Date
CN103248667A true CN103248667A (en) 2013-08-14
CN103248667B CN103248667B (en) 2016-03-30

Family

ID=48927889

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210033052.XA Active CN103248667B (en) 2012-02-14 2012-02-14 A kind of resource access method of distributed system and system

Country Status (2)

Country Link
CN (1) CN103248667B (en)
HK (1) HK1183573A1 (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488530A (en) * 2013-09-17 2014-01-01 新浪网技术(中国)有限公司 Lock migration method and device
CN103716383A (en) * 2013-12-13 2014-04-09 华为技术有限公司 Method and device for accessing shared resources
CN103731485A (en) * 2013-12-26 2014-04-16 华为技术有限公司 Network equipment, cluster storage system and distributed lock management method
CN104239418A (en) * 2014-08-19 2014-12-24 天津南大通用数据技术股份有限公司 Distributed lock method for supporting distributed database and distributed database system
CN104461705A (en) * 2014-11-17 2015-03-25 华为技术有限公司 Service access method, storage controllers and cluster storage system
CN104881005A (en) * 2015-03-26 2015-09-02 那峙雄 Mine upper-computer software lock-up control method
CN106372030A (en) * 2016-10-27 2017-02-01 郑州云海信息技术有限公司 Method and device for data synchronization of dual controller storage system
CN106776050A (en) * 2016-10-17 2017-05-31 广州视源电子科技股份有限公司 Multi-user's process exclusive method and device
CN107203890A (en) * 2016-03-17 2017-09-26 阿里巴巴集团控股有限公司 Credential data distribution method, apparatus and system
CN107402821A (en) * 2017-07-03 2017-11-28 阿里巴巴集团控股有限公司 Access control method, device and the equipment of shared resource
CN107402822A (en) * 2017-07-06 2017-11-28 腾讯科技(深圳)有限公司 Deadlock treatment method and device
CN108090058A (en) * 2016-11-21 2018-05-29 广东亿迅科技有限公司 A kind of high concurrent action interactions method
CN110866021A (en) * 2019-10-16 2020-03-06 微梦创科网络科技(中国)有限公司 Go language based locking and releasing method and system for distributed lock
CN112286697A (en) * 2020-11-06 2021-01-29 上海新时达机器人有限公司 Mutually exclusive resource access method based on operating system-free single-chip microcomputer platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5526524A (en) * 1993-12-23 1996-06-11 International Business Machines Corporation Method and system for management of locked objects in a computer supported cooperative work environment
CN1786918A (en) * 2004-12-10 2006-06-14 惠普开发有限公司 Distributed lock
CN1945539A (en) * 2006-10-19 2007-04-11 华为技术有限公司 Method for distributing shared resource lock in computer cluster system and cluster system
CN1980236A (en) * 2005-12-09 2007-06-13 英业达股份有限公司 Distribution-type data dynamic program agent method
CN101189581A (en) * 2005-06-16 2008-05-28 甲骨文国际公司 Techniques for handling lock-related inconsistencies

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5526524A (en) * 1993-12-23 1996-06-11 International Business Machines Corporation Method and system for management of locked objects in a computer supported cooperative work environment
CN1786918A (en) * 2004-12-10 2006-06-14 惠普开发有限公司 Distributed lock
CN101189581A (en) * 2005-06-16 2008-05-28 甲骨文国际公司 Techniques for handling lock-related inconsistencies
CN1980236A (en) * 2005-12-09 2007-06-13 英业达股份有限公司 Distribution-type data dynamic program agent method
CN1945539A (en) * 2006-10-19 2007-04-11 华为技术有限公司 Method for distributing shared resource lock in computer cluster system and cluster system

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488530B (en) * 2013-09-17 2016-10-19 新浪网技术(中国)有限公司 A kind of lock moving method and device
CN103488530A (en) * 2013-09-17 2014-01-01 新浪网技术(中国)有限公司 Lock migration method and device
CN103716383A (en) * 2013-12-13 2014-04-09 华为技术有限公司 Method and device for accessing shared resources
WO2015085826A1 (en) * 2013-12-13 2015-06-18 华为技术有限公司 Method and apparatus for accessing shared resource
CN103731485A (en) * 2013-12-26 2014-04-16 华为技术有限公司 Network equipment, cluster storage system and distributed lock management method
WO2015096606A1 (en) * 2013-12-26 2015-07-02 华为技术有限公司 Network device, cluster storage system and distributed lock management method
CN104239418B (en) * 2014-08-19 2018-01-19 天津南大通用数据技术股份有限公司 Support the distribution locking method and distributed data base system of distributed data base
CN104239418A (en) * 2014-08-19 2014-12-24 天津南大通用数据技术股份有限公司 Distributed lock method for supporting distributed database and distributed database system
CN104461705A (en) * 2014-11-17 2015-03-25 华为技术有限公司 Service access method, storage controllers and cluster storage system
CN104461705B (en) * 2014-11-17 2019-02-19 华为技术有限公司 A kind of method and storage control, cluster storage system of business access
CN104881005A (en) * 2015-03-26 2015-09-02 那峙雄 Mine upper-computer software lock-up control method
CN107203890A (en) * 2016-03-17 2017-09-26 阿里巴巴集团控股有限公司 Credential data distribution method, apparatus and system
CN106776050A (en) * 2016-10-17 2017-05-31 广州视源电子科技股份有限公司 Multi-user's process exclusive method and device
CN106776050B (en) * 2016-10-17 2019-12-17 广州视源电子科技股份有限公司 Multi-user process mutual exclusion method and device
CN106372030A (en) * 2016-10-27 2017-02-01 郑州云海信息技术有限公司 Method and device for data synchronization of dual controller storage system
CN108090058A (en) * 2016-11-21 2018-05-29 广东亿迅科技有限公司 A kind of high concurrent action interactions method
CN107402821A (en) * 2017-07-03 2017-11-28 阿里巴巴集团控股有限公司 Access control method, device and the equipment of shared resource
CN107402821B (en) * 2017-07-03 2020-06-30 阿里巴巴集团控股有限公司 Access control method, device and equipment for shared resources
CN107402822A (en) * 2017-07-06 2017-11-28 腾讯科技(深圳)有限公司 Deadlock treatment method and device
CN110866021A (en) * 2019-10-16 2020-03-06 微梦创科网络科技(中国)有限公司 Go language based locking and releasing method and system for distributed lock
CN112286697A (en) * 2020-11-06 2021-01-29 上海新时达机器人有限公司 Mutually exclusive resource access method based on operating system-free single-chip microcomputer platform
CN112286697B (en) * 2020-11-06 2022-11-25 上海新时达机器人有限公司 Mutually exclusive resource access method based on operating system-free single chip microcomputer platform

Also Published As

Publication number Publication date
HK1183573A1 (en) 2013-12-27
CN103248667B (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN103248667B (en) A kind of resource access method of distributed system and system
CN103544153B (en) A kind of data-updating method based on data base and system
CN103714097A (en) Method and device for accessing database
CN105955804B (en) A kind of method and apparatus for handling distributed transaction
CN109597640B (en) Account management method, device, equipment and medium for application program
EP3519987B1 (en) Intents and locks with intent
CN108614976A (en) Authority configuring method, device and storage medium
GB2513528A (en) Method and system for backup management of software environments in a distributed network environment
US8903889B2 (en) Method, system and article for mobile metadata software agent in a data-centric computing environment
CN112579307A (en) Physical lock resource allocation detection method and device and electronic equipment
CA3151214A1 (en) Resource processing method, device. computer equipment and storage medium
CN109088914B (en) Block generation method, block chain ecosystem and computer readable storage medium
US20100235377A1 (en) Memory Object Sharing for Just In Time Compiled Data
CN107967265B (en) File access method, data server and file access system
CN109753506B (en) Data distributed storage method, device, terminal and storage medium
US20140181502A1 (en) Dynamically manipulating rules for adding new devices
CN111339114A (en) Data access method, device, equipment and storage medium
US20190089688A1 (en) Twin factor authentication for controller
CN114553521A (en) Remote memory access method, device, equipment and medium
CN103347059A (en) Method, client-side and system for realizing user configuration parameter transmission
CN113254506A (en) Data processing method and device, computer equipment and storage medium
CN112988913A (en) Data processing method and related device
CN110019113B (en) Database service processing method and database server
CN107209882B (en) Multi-stage de-registration for managed devices
CN114546705B (en) Operation response method, operation response device, electronic apparatus, and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1183573

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1183573

Country of ref document: HK