JP2018110031A - Method of managing lock in cluster, lock server and client - Google Patents

Method of managing lock in cluster, lock server and client Download PDF

Info

Publication number
JP2018110031A
JP2018110031A JP2018040616A JP2018040616A JP2018110031A JP 2018110031 A JP2018110031 A JP 2018110031A JP 2018040616 A JP2018040616 A JP 2018040616A JP 2018040616 A JP2018040616 A JP 2018040616A JP 2018110031 A JP2018110031 A JP 2018110031A
Authority
JP
Japan
Prior art keywords
lock
client
write
identifier
read
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
JP2018040616A
Other languages
Japanese (ja)
Other versions
JP6561162B2 (en
Inventor
文▲海▼ ▲藍▼
文▲海▼ ▲藍▼
Wenhai Lan
巍 ▲張▼
巍 ▲張▼
Wei Zhang
学友 王
Xueyou Wang
学友 王
粤 ▲張▼
粤 ▲張▼
Yue Zhang
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 JP2018040616A priority Critical patent/JP6561162B2/en
Publication of JP2018110031A publication Critical patent/JP2018110031A/en
Application granted granted Critical
Publication of JP6561162B2 publication Critical patent/JP6561162B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a method of managing lock in a cluster, a lock server and client.SOLUTION: A cluster includes a client and a lock server. The lock server includes an interface card and a memory. The memory is brought in its standby state to look for a read lock or stores a lock request queue. The memory further includes a read lock allocating count and a write lock allocating identifier. The read lock allocating count is used for recording an allocated read lock. The write lock allocating identifier is used for indicating whether or not a write lock is allocated. The client communicates with the interface card of the lock server by using an RDMA protocol to carry out a lock operation.SELECTED DRAWING: Figure 2

Description

本発明は、情報技術の分野に関し、特にクラスタ内のロック管理方法、ロックサーバ及びクライアントに関する。   The present invention relates to the field of information technology, and more particularly to a lock management method, a lock server, and a client in a cluster.

クラスタは、複数のクライアントを含み、クラスタ内の共有リソースの書き込み許可又は読み取り許可のような処理許可を取得するために、クライアントは、処理許可を求めてクラスタ内のロックサーバに申請する必要がある。これは、一般的にロックの申請と呼ばれる。一般的に、書き込み許可は、書き込みロック又は排他的ロックとも呼ばれ、読み取り許可は、読み取りロック又は共有ロックと呼ばれる。   The cluster includes a plurality of clients, and in order to obtain a processing permission such as a write permission or a read permission for a shared resource in the cluster, the client needs to apply for a processing permission from a lock server in the cluster. . This is commonly referred to as a lock application. In general, write permission is also called write lock or exclusive lock, and read permission is called read lock or shared lock.

従来技術では、図1に示すようにクライアントにより書き込みロックを求めて申請する方式において、クラスタは、ロックサーバと、クライアントAと、クライアントBとを含む。クライアントAは、リモートダイレクトメモリアクセス(Remote Direct Memory Access、RDMA)プロトコルを使用することにより、例えば、RDMAプロトコルにおけるアトミック操作(atomic operation)Compare-and-Swapを使用することにより書き込みロックを求めてロックサーバに申請することにより、クライアントAの識別子をロックサーバのメモリアドレスに書き込み、すなわち、クライアントAは、ロックサーバに申請することにより書き込みロックを取得し、すなわち、書き込みロックは、クライアントAに割り当てられる。クライアントBは、Compare-and-Swapを使用することにより書き込みロックを求めてロックサーバに申請し、ロックサーバは、クライアントAの識別子をクライアントBに返信し、クライアントBは、Compare-and-Swapを使用することにより、クライアントAの識別子に従って、書き込みロックを求めてクライアントAに申請する。クライアントAが書き込みロックを解放する前に、クライアントBは、書き込みロック待機状態にある。   In the conventional technique, as shown in FIG. 1, the cluster includes a lock server, a client A, and a client B in a method of applying for a write lock by a client. Client A locks for a write lock by using Remote Direct Memory Access (RDMA) protocol, for example, by using atomic operation Compare-and-Swap in RDMA protocol By applying to the server, the identifier of client A is written to the memory address of the lock server, that is, client A acquires a write lock by applying to the lock server, that is, the write lock is assigned to client A. . Client B asks the lock server for a write lock by using Compare-and-Swap, the lock server returns the identifier of client A to client B, and client B returns Compare-and-Swap. By using it, the client A applies for a write lock according to the identifier of the client A. Before client A releases the write lock, client B is in a write lock wait state.

従来技術の実現解決策では、クライアントAが故障した場合、ロックサーバは、クライアントBが書き込みロック待機状態にあることを認識しないため、クライアントBは申請によって書き込みロックを取得することができず、常に書き込みロック待機状態にある。前述の説明から、従来技術におけるロックサーバは、1つのみの現クライアントのロック状態を取得することができることが認識され得る。   In the prior art implementation solution, if client A fails, the lock server does not recognize that client B is in the write lock standby state, so client B cannot obtain a write lock by application and always Waiting for write lock. From the foregoing description, it can be appreciated that the lock server in the prior art can obtain the lock state of only one current client.

第1の態様によれば、本発明の実施例は、クラスタ内のロック管理方法を提供し、クラスタは、複数のクライアントとロックサーバとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと書き込みロック割り当て識別子と読み取りロック割り当てカウントとを記憶し、書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、クラスタ内のクライアントの識別子を記録するために使用され、書き込みロック割り当て識別子は、共有リソースのための書き込みロックが割り当てられたか否かを示すために使用され、読み取りロック割り当てカウントは、共有リソースのために割り当てられた読み取りロックの数量を示すために使用され、ロック管理方法は、インタフェースカードにより、複数のクライアント内の第1のクライアントにより送信された第1の書き込みロック要求を受信するステップであり、第1の書き込みロック要求は、第1のクライアントの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送するステップと、第1のクライアントの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むステップと、インタフェースカードにより、読み取りロックが割り当てられているか否かを決定するために、読み取りロック割り当てカウントに問い合わせ、読み取りロックが割り当てられない場合、書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定するステップと、第1のクライアントが書き込みロックを取得することを示すためのメッセージを第1のクライアントに送信するステップと、読み取りロックが割り当てられている場合、第2のメッセージを第1のクライアントに送信するステップであり、第2のメッセージは、第1のクライアントが書き込みロック待機状態にあることを示すステップとを含む。本発明のこの実施例では、メモリ内の書き込みロック要求キューと書き込みロック割り当て識別子と書き込みロック割り当てカウントとを使用することにより、ロックサーバは、クライアントが書き込みロックを取得するか、或いは書き込みロックを求めて待機すると決定することができる。   According to a first aspect, an embodiment of the present invention provides a lock management method in a cluster, the cluster includes a plurality of clients and a lock server, the lock server includes an interface card and a memory, The memory stores a write lock request queue, a write lock allocation identifier, and a read lock allocation count, and the write lock request queue is for a client resource that is in a write lock wait state for the shared resource and for the same shared resource. Used to record the identifier of the client in the cluster, including the identifier of the client that obtains the write lock, and the write lock assignment identifier is used to indicate whether a write lock for the shared resource has been assigned. Read lock allocation count Used to indicate the number of read locks allocated for a shared resource, the lock management method receives a first write lock request sent by a first client in a plurality of clients by an interface card The first write lock request includes a step of conveying an identifier of the first client and a memory address at a head of the queue of the write lock request queue, and a queue of the write lock request queue of the first client. To write to the first memory address and to determine whether the read lock is assigned by the interface card, query the read lock assignment count, and if the read lock is not assigned, write the write lock assignment identifier. Set to a lock-assigned state, send a message to the first client indicating that the first client acquires a write lock, and if a read lock is assigned, the second Sending a message to the first client, and the second message includes indicating that the first client is in a write lock wait state. In this embodiment of the invention, by using a write lock request queue in memory, a write lock assignment identifier, and a write lock assignment count, the lock server acquires a write lock or asks for a write lock. You can decide to wait.

第1の態様を参照して、第1の可能な実現方式では、クラスタは、第2のクライアントを更に含み、この方法は、インタフェースカードにより、複数のクライアント内の第2のクライアントにより送信された第2の書き込みロック要求を受信するステップであり、第2の書き込みロック要求は、第2のクライアントの識別子と書き込みロック要求キュー内の第1のメモリアドレスとを搬送し、第1のメモリアドレスは、書き込みロック要求キューのキュー先頭のメモリアドレスを除き、第2のクライアントの識別子が書き込まれることができる、キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスであるステップと、インタフェースカードにより、第2のクライアントの識別子を書き込みロック要求キュー内の第1のメモリアドレスに書き込むステップと、インタフェースカードにより、第2のクライアントが書き込みロック待機状態にあることを示すためのメッセージを第2のクライアントに送信するステップとを更に含む。したがって、ロックサーバは、書き込みロック要求キューを使用することにより、書き込みロック待機状態にあるクライアントを決定することができる。任意選択で、第1のメモリアドレスは、書き込みロック要求キューのキュー先頭のメモリアドレスを除き、第2のクライアントの識別子が書き込まれることができる、キュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスである。   Referring to the first aspect, in a first possible implementation manner, the cluster further includes a second client, the method sent by the second client in the plurality of clients by the interface card. Receiving a second write lock request, wherein the second write lock request carries an identifier of the second client and a first memory address in the write lock request queue, wherein the first memory address is The identifier of the second client can be written, except for the memory address at the head of the queue of the write lock request queue, the step being the memory address in the sequence from the head of the queue to the end of the queue, The first memory in the write lock request queue Further comprising a step of writing the address, the interface card, and a step in which the second client sends a message to indicate that the write lock wait state to the second client. Therefore, the lock server can determine the client in the write lock waiting state by using the write lock request queue. Optionally, the first memory address is the first in the sequence from the queue head to the queue tail to which the second client identifier can be written, except for the memory address at the head of the queue of the write lock request queue. Memory address.

第1の態様を参照して、第2の可能な実現方式では、ロックサーバのメモリは、読み取りロック要求キューを含み、読み取りロックが割り当てられていることを読み取りロック割り当てカウントが示す場合、読み取りロック要求キューは、共有リソースのための読み取りロックを取得する、クラスタ内にある第3のクライアントの識別子を記録するために使用される。   Referring to the first aspect, in a second possible implementation scheme, the lock server memory includes a read lock request queue, and if the read lock allocation count indicates that a read lock is allocated, the read lock The request queue is used to record the identifier of the third client in the cluster that obtains a read lock for the shared resource.

第1の可能な実現方式を参照して、第3の可能な実現方式では、第1の書き込みロック要求は、ロックリースを更に搬送し、ロックリースは、書き込みロックの有効期間を示すために使用される。ロックリースを使用することにより、ロックサーバは、ロックリースに従って書き込みロックを解放してもよい。   Referring to the first possible implementation scheme, in the third possible implementation scheme, the first write lock request further carries a lock lease, which is used to indicate the validity period of the write lock. Is done. By using a lock lease, the lock server may release the write lock according to the lock lease.

第1の可能な実現方式を参照して、第4の可能な実現方式では、第1のクライアントが書き込みロックを取得した後に、この方法は、インタフェースカードにより、第1のクライアントにより送信された書き込みロック解放要求を受信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭のメモリアドレスから第1のクライアントの識別子を削除するステップとを更に含む。第1のクライアントは、書き込みロックを解放し、これにより、クラスタ内の他のクライアントが書き込みロックを取得してもよい。   Referring to the first possible implementation scheme, in the fourth possible implementation scheme, after the first client has acquired a write lock, the method uses a write sent by the first client by the interface card. A step of receiving a lock release request, the write lock release request is a step of conveying a memory address at the head of a queue of the write lock request queue, and a step of setting a write lock assignment identifier to a write lock unassigned state by an interface card And deleting the identifier of the first client from the memory address at the head of the write lock request queue by the interface card. The first client releases the write lock, so that other clients in the cluster may acquire the write lock.

第1の可能な実現方式を参照して、第5の可能な実現方式では、第1のクライアントが書き込みロックを取得した後に故障になった場合、この方法は、インタフェースカードにより、書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭のメモリアドレスから第1のクライアントの識別子を削除するステップとを更に含む。任意選択で、インタフェースカードは、第1のクライアントが故障していると決定するために、クラスタ内の他のクライアントにより送信された通知を受信する。故障した第1のクライアントの書き込みロックを解放することは、故障した第1のクライアントが書き込みロックを長期間に保持することを妨げることができる。任意選択で、インタフェースカードは、第1のクライアントを除きクラスタ内のクライアントに通知を送信し、通知は、第1のクライアントにより保持された書き込みロックが解放されていることを示す。   Referring to the first possible implementation scheme, in the fifth possible implementation scheme, if the first client fails after acquiring the write lock, the method will cause the interface card to write the write lock assignment identifier. And a step of deleting the identifier of the first client from the memory address at the head of the write lock request queue by the interface card. Optionally, the interface card receives notifications sent by other clients in the cluster to determine that the first client has failed. Releasing the failed first client's write lock can prevent the failed first client from holding the write lock for an extended period of time. Optionally, the interface card sends a notification to clients in the cluster except for the first client, which indicates that the write lock held by the first client has been released.

第4又は第5の可能な実現方式を参照して、第6の可能な実現方式では、この方法は、インタフェースカードにより、書き込みロック待機状態にある第2のクライアントを決定するために、書き込みロック要求キューに問い合わせるステップと、インタフェースカードにより、第2のクライアントに対して書き込みロックを求めてインタフェースカードに申請するように命令するための通知を第2のクライアントに送信するステップとを更に含む。ロックサーバは、適時に書き込みロック待機状態にあるクライアントに対して書き込みロックを求めて申請するように命令する。   Referring to the fourth or fifth possible implementation scheme, in the sixth possible implementation scheme, the method uses the interface card to determine the second client in the write lock wait state to determine the second client Querying the request queue; and sending, by the interface card, a notification to the second client to instruct the second client to apply to the interface card for a write lock. The lock server instructs a client in a write lock waiting state to request and apply for a write lock in a timely manner.

第5の可能な実現方式を参照して、第7の可能な実現方式では、この方法は、インタフェースカードにより、第1のクライアントを除きクラスタ内のクライアントに通知を送信するステップであり、通知は、第1のクライアントにより保持された書き込みロックが解放されていることを示すステップを更に含む。   Referring to the fifth possible implementation scheme, in the seventh possible implementation scheme, this method is a step of sending a notification to the clients in the cluster except for the first client by means of an interface card, , Further comprising indicating that the write lock held by the first client has been released.

第4の可能な実現方式を参照して、第8の可能な実現方式では、この方法は、インタフェースカードにより、第1のクライアントにより送信された書き込みロック要求問い合わせメッセージを受信するステップであり、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアント識別子を求めて問い合わせるステップと、インタフェースカードにより、書き込みロック要求問い合わせ応答メッセージを第1のクライアントに送信するステップであり、書き込みロック要求問い合わせ応答メッセージは、次のメモリアドレスに記憶されたクライアント識別子を搬送するステップとを更に含む。   Referring to the fourth possible implementation scheme, in the eighth possible implementation scheme, the method is the step of receiving, by the interface card, a write lock request inquiry message sent by the first client and writing The lock request inquiry message carries the step of carrying the next memory address following the head of the write lock request queue, and the interface card determines the client identifier stored at the next memory address following the head of the write lock request queue. And a step of sending a write lock request inquiry response message to the first client by the interface card. The write lock request inquiry response message is a class stored in the next memory address. Further comprising the step of conveying the Ant identifier.

第4の可能な実現方式を参照して、第9の可能な実現方式では、この方法は、インタフェースカードにより、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアント識別子を求めて問い合わせるステップと、インタフェースカードにより、次のメモリアドレスに記憶されたクライアント識別子に対応するクライアントに対して書き込みロックを求めて申請するように命令するための通知を、次のメモリアドレスに記憶されたクライアント識別子に対応するクライアントに送信するステップとを更に含む。したがって、書き込みロックは、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューのキュー先頭から始まるシーケンスに従って申請されてもよい。   Referring to the fourth possible implementation scheme, in the ninth possible implementation scheme, this method uses the interface card to determine the client identifier stored at the next memory address following the head of the write lock request queue. Stored in the next memory address by the interface card and a notification for instructing the client corresponding to the client identifier stored in the next memory address to apply for a write lock. Transmitting to the client corresponding to the client identifier. Therefore, the write lock may be applied according to a sequence starting from the top of the write lock request queue of the client in the write lock standby state.

第4の可能な実現方式を参照して、第10の可能な実現方式では、書き込みロック要求キューは、書き込みロック待機状態にあるクライアントの書き込みロック優先度を更に記憶し、この方法は、インタフェースカードにより、第1のクライアントにより送信された書き込みロック要求問い合わせメッセージを受信するステップと、インタフェースカードにより、書き込みロック要求キュー内で書き込みロック待機状態にあるクライアントの書き込みロック優先度を求めて問い合わせるステップと、インタフェースカードにより、書き込みロック要求問い合わせ応答メッセージを第1のクライアントに送信するステップであり、問い合わせ応答メッセージは、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された識別子及び書き込みロック優先度を搬送するステップとを更に含む。   Referring to the fourth possible realization scheme, in the tenth possible realization scheme, the write lock request queue further stores the write lock priority of the client in the write lock wait state, and the method comprises an interface card. A step of receiving a write lock request inquiry message transmitted by the first client, and a step of inquiring for a write lock priority of a client in a write lock waiting state in the write lock request queue by an interface card, and The interface card sends a write lock request inquiry response message to the first client, and the inquiry response message is recorded in the write lock request queue of the client in the write lock standby state. Further comprising the step of conveying the identifier and write lock priority.

第4の可能な実現方式を参照して、第11の可能な実現方式では、書き込みロック要求キューは、書き込みロック待機状態にあるクライアントの書き込みロック優先度を更に記憶し、この方法は、インタフェースカードにより、最高の書き込みロック優先度を有するクライアントを決定するために、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された書き込みロック優先度を求めて問い合わせるステップと、インタフェースカードにより、最高の書き込みロック優先度を有するクライアントに対して書き込みロックを求めて申請するように命令するための通知を、最高の書き込みロック優先度を有するクライアントに送信し、これにより、最高の書き込みロック優先度を有するクライアントが書き込みロックを求めて申請するステップとを更に含む。   Referring to the fourth possible implementation scheme, in the eleventh possible implementation scheme, the write lock request queue further stores the write lock priority of the client in the write lock standby state, the method comprising: In order to determine the client with the highest write lock priority, the step of inquiring for the write lock priority recorded in the write lock request queue of the client in the write lock waiting state and the interface card Send a notification to the client with the highest write lock priority to send a notification to the client with the highest write lock priority to instruct them to apply for a write lock. The client that has Further comprising the step of applying to seek a click.

第4の可能な実現方式を参照して、第12の可能な実現方式では、この方法は、インタフェースカードにより、書き込みロック待機状態にあるクライアントを決定するために、書き込みロック要求キューに問い合わせるステップと、インタフェースカードにより、少なくとも2つのクライアントに対して書き込みロック要求をインタフェースカードに送信するように命令するための通知を、書き込みロック待機状態にあるクライアント内の少なくとも2つのクライアントに送信するステップとを更に含む。   Referring to the fourth possible implementation scheme, in a twelfth possible implementation scheme, the method includes querying a write lock request queue by an interface card to determine a client in a write lock wait state; Sending a notification by the interface card to instruct at least two clients to send a write lock request to the interface card to at least two clients in a client in a write lock wait state; Including.

第1の態様に対応して、第2の態様によれば、本発明の実施例は、クラスタ内のロック管理方法を提供し、クラスタは、複数のクライアントとロックサーバとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと書き込みロック割り当て識別子と読み取りロック割り当てカウントとを記憶し、書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、クラスタ内のクライアントの識別子を記録するために使用され、書き込みロック割り当て識別子は、共有リソースのための書き込みロックが割り当てられたか否かを示すために使用され、読み取りロック割り当てカウントは、共有リソースのために割り当てられた読み取りロックの数量を示すために使用され、ロック管理方法は、複数のクライアント内の第1のクライアントにより、第1の書き込みロック要求をロックサーバのインタフェースカードに送信するステップであり、第1の書き込みロック要求は、第1のクライアントの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送するステップと、第1のクライアントにより、インタフェースカードにより送信された第1のメッセージを受信するステップであり、第1のメッセージは、インタフェースカードが第1のクライアントの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むことを示し、第1のクライアントが書き込みロックを取得するか、或いは書き込みロック待機状態にあることを示すステップと、インタフェースカードが第1のクライアントの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むことに失敗したことを第1のメッセージが示す場合、第1のクライアントにより、第2の書き込みロック要求をインタフェースカードに送信するステップであり、第2の書き込みロック要求は、第1のクライアントの識別子と書き込みロック要求キュー内の第1のメモリアドレスとを搬送し、第1のメモリアドレスは、第1のクライアントの識別子が書き込まれることができる、キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスであるステップとを含む。任意選択で、第1のメモリアドレスは、第1のクライアントの識別子が書き込まれることができる、キュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスである。   Corresponding to the first aspect, according to the second aspect, an embodiment of the present invention provides a lock management method in a cluster, the cluster including a plurality of clients and a lock server, An interface card and memory, wherein the memory stores a write lock request queue, a write lock assignment identifier, and a read lock assignment count, wherein the write lock request queue is for a client in a write lock wait state for a shared resource. Used to record the identifier of the client in the cluster, including the identifier and the identifier of the client that obtains the write lock for the same shared resource, the write lock assignment identifier is assigned by the write lock for the shared resource Used to indicate whether or not The lock allocation count is used to indicate the number of read locks allocated for the shared resource, and the lock management method locks the first write lock request by the first client in the plurality of clients to the lock server. The first write lock request includes the step of conveying the identifier of the first client and the memory address at the head of the queue of the write lock request queue; Receiving the first message sent by the first message, indicating that the interface card writes the identifier of the first client to the memory address at the head of the queue of the write lock request queue; The client locks the write lock To indicate that the interface card is in a write lock standby state and that the interface card failed to write the identifier of the first client to the memory address at the head of the write lock request queue. Indicates that the first client sends a second write lock request to the interface card, wherein the second write lock request includes the first client identifier and the first in the write lock request queue. And the first memory address includes a step that is a memory address in a sequence from the head of the queue to the end of the queue to which the identifier of the first client can be written. Optionally, the first memory address is the first memory address in the sequence from the top of the queue to the end of the queue where the identifier of the first client can be written.

第2の態様を参照して、第1の可能な実現方式では、第1の書き込みロック要求及び第2の書き込みロック要求は、ロックリースを更に搬送し、ロックリースは、書き込みロックの有効期間を示すために使用される。ロックサーバは、第1のクライアントが長期間に書き込みロックを占有することを妨げるために、ロックリースに従って第1のクライアントの失効した書き込みロックを解放してもよい。   Referring to the second aspect, in a first possible implementation scheme, the first write lock request and the second write lock request further carry a lock lease, and the lock lease determines the lifetime of the write lock. Used to indicate. The lock server may release the expired write lock of the first client according to the lock lease to prevent the first client from occupying the write lock for a long period of time.

第2の態様を参照して、第2の可能な実現方式では、第1のクライアントが書き込みロックを取得した後に、この方法は、第1のクライアントにより、書き込みロック解放要求をインタフェースカードに送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップを更に含む。   Referring to the second aspect, in a second possible implementation scheme, after the first client acquires a write lock, the method sends a write lock release request to the interface card by the first client. The step of releasing the write lock further includes a step of conveying a memory address at the head of the write lock request queue.

第2の可能な実現方式を参照して、第3の可能な実現方式では、この方法は、第1のクライアントにより、書き込みロック要求問い合わせメッセージをインタフェースカードに送信するステップであり、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスを搬送するステップと、インタフェースカードにより送信された書き込みロック要求問い合わせ応答メッセージを受信するステップであり、書き込みロック要求問い合わせ応答メッセージは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアント識別子を搬送するステップと、第1のクライアントにより、書き込みロック要求問い合わせ応答メッセージで搬送されたクライアント識別子に従って、クライアントに対して書き込みロックを求めて申請するように命令するための通知を、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアント識別子に対応するクライアントに送信するステップとを更に含む。   Referring to the second possible realization scheme, in the third possible realization scheme, this method is a step of sending a write lock request inquiry message to the interface card by the first client. The message is a step of carrying the next memory address following the head of the write lock request queue and a step of receiving a write lock request inquiry response message sent by the interface card. A step of carrying the client identifier stored in the next memory address following the head of the lock request queue, and the client identifier carried in the write lock request inquiry response message by the first client Therefore, sending a notification to instruct the client to apply for a write lock request to the client corresponding to the client identifier stored at the next memory address following the head of the write lock request queue; Is further included.

第2の可能な実現方式を参照して、第4の可能な実現方式では、この方法は、第1のクライアントにより、書き込みロック要求問い合わせメッセージをインタフェースカードに送信するステップと、インタフェースカードにより送信された書き込みロック要求問い合わせ応答メッセージを受信するステップであり、問い合わせ応答メッセージは、書き込みロック待機状態にあるクライアントの、書き込みロックキューに記録された識別子及び書き込みロック優先度を搬送するステップと、第1のクライアントにより、書き込みロック要求問い合わせ応答メッセージに従って最高の書き込みロック優先度を有するクライアントを決定するステップと、第1のクライアントにより、最高の書き込みロック優先度を有するクライアントに対して書き込みロック要求をインタフェースカードに送信するように命令するための通知を、最高の書き込みロック優先度を有するクライアントに送信するステップとを更に含む。   Referring to the second possible implementation scheme, in the fourth possible implementation scheme, this method comprises the steps of sending a write lock request inquiry message to the interface card by the first client and sent by the interface card. Receiving a write lock request inquiry response message, wherein the inquiry response message carries an identifier and a write lock priority recorded in a write lock queue of a client in a write lock standby state; The client determines the client having the highest write lock priority according to the write lock request inquiry response message, and the first client writes to the client having the highest write lock priority. A notification for instructing to transmit only lock request to the interface card, further comprising the step of transmitting to the client with the highest write lock priority.

第3の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、第1のクライアントとロックサーバとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、読み取りロック要求キューと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、クラスタ内にあるクライアントの識別子を記録するために使用され、書き込みロック割り当て識別子は、共有リソースのための書き込みロックが割り当てられたか否かを示すために使用され、ロック管理方法は、インタフェースカードにより、複数のクライアント内の第1のクライアントにより送信された第1の読み取りロック要求を受信するステップであり、第1の読み取りロック要求は、第1のクライアントの識別子と読み取りロック要求キュー内の第1のメモリアドレスとを搬送するステップと、インタフェースカードにより、第1のクライアントの識別子を読み取りロック要求キュー内の第1のメモリアドレスに書き込むステップと、インタフェースカードにより、第1のメッセージを第1のクライアントに送信するステップであり、第1のメッセージは、書き込みロック割り当て識別子を搬送するステップとを含む。読み取りロック要求キューを使用することにより、クラスタ内のクライアントの読み取りロック要求状態が記録されることができ、すなわち、クライアントが読み取りロック待機状態にあるか、或いは読み取りロックを取得する。   According to a third aspect, an embodiment of the present invention provides another lock management method in a cluster, the cluster including a first client and a lock server, the lock server comprising an interface card, a memory, And the memory stores a read lock request queue and a write lock assignment identifier, wherein the read lock request queue is in a read lock wait state for the same shared resource or acquires a read lock in the cluster. Used to record an identifier of a client, a write lock assignment identifier is used to indicate whether a write lock for a shared resource has been assigned, and a lock management method is used by an interface card by multiple clients. First read sent by the first client in The first read lock request carries the identifier of the first client and the first memory address in the read lock request queue; Writing a client identifier to a first memory address in a read lock request queue; and sending a first message to the first client by an interface card, the first message being a write lock assignment identifier Conveying. By using the read lock request queue, the read lock request status of the clients in the cluster can be recorded, i.e., the client is in a read lock waiting state or obtains a read lock.

第3の態様を参照して、第1の可能な実現方式では、書き込みロックが割り当てられていることを書き込みロック割り当て識別子が示す場合、第1のメッセージは、第1のクライアントが読み取りロック待機状態にあることを示す。   Referring to the third aspect, in a first possible implementation scheme, if the write lock assignment identifier indicates that a write lock has been assigned, the first message is received by the first client in a read lock wait state. Indicates that

第3の態様を参照して、第2の可能な実現方式では、メモリは、読み取りロック割り当てカウントを更に記憶し、読み取りロック割り当てカウントは、共有リソースのために割り当てられた読み取りロックの数量を示すために使用され、書き込みロックが割り当てられないことを書き込みロック割り当て識別子が示す場合、インタフェースカードは、第1のクライアントに割り当てられた読み取りロックの数量に従って読み取りロック割り当てカウントを増加させ、第1のメッセージは、第1のクライアントが読み取りロックを取得することを示す。   Referring to the third aspect, in a second possible implementation manner, the memory further stores a read lock allocation count, the read lock allocation count indicating the number of read locks allocated for the shared resource. If the write lock assignment identifier indicates that the write lock is not assigned, the interface card increments the read lock assignment count according to the number of read locks assigned to the first client and the first message Indicates that the first client acquires a read lock.

第3の態様の第1の可能な実現方式を参照して、第3の可能な実現方式では、複数のクライアントは、第2のクライアントを更に含み、メモリは、書き込みロック要求キューを更に記憶し、書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、クラスタ内のクライアントの識別子を記録するために使用され、書き込みロックが割り当てられていることを書き込みロック割り当て識別子が示す場合、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶される。ロックサーバのメモリ内の書き込みロック要求キューは、書き込みロックを取得するクライアントを記録し、書き込みロックが割り当てられており、読み取りロック要求キュー内のクライアントが読み取りロック待機状態にあるため、ロックサーバは、書き込みロックを取得するクライアントについての情報を記録し、また、読み取りロック待機状態にあるクライアントについての情報も記録する。   Referring to the first possible implementation manner of the third aspect, in the third possible implementation manner, the plurality of clients further includes a second client, and the memory further stores a write lock request queue. The write lock request queue records the identifiers of clients in the cluster, including the identifiers of clients that are in a write lock wait state for shared resources and the identifiers of clients that acquire write locks for shared resources. And the write lock assignment identifier indicates that the write lock is assigned, the second client identifier is stored in the memory address at the head of the write lock request queue. The write lock request queue in the lock server's memory records the client that gets the write lock, the write lock is assigned, and the client in the read lock request queue is in the read lock wait state, so the lock server Information about the client that acquires the write lock is recorded, and information about the client that is in the read lock standby state is also recorded.

第3の態様を参照して、第4の可能な実現方式では、複数のクライアントは、第3のクライアントを更に含み、第3のクライアントの識別子は、読み取りロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キュー内の、第1の読み取りロック要求で搬送された第1のメモリアドレスは、第1のクライアントの識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである。ロックサーバのメモリ内の読み取りロック要求キューは、複数のクライアントを記録してもよく、したがって、ロックサーバは、複数のクライアントの読み取りロック状態、すなわち、複数のクライアントが読み取りロック待機状態にあるか読み取りロックを取得するかを確認してもよい。任意選択で、第1のメモリアドレスは、第1のクライアントの識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスである。   Referring to the third aspect, in a fourth possible implementation manner, the plurality of clients further includes a third client, and the identifier of the third client is the memory address at the head of the queue of the read lock request queue. The first memory address that is stored and carried in the first read lock request in the read lock request queue can be written with the identifier of the first client, from the head of the read lock request queue to the end of the queue This is the memory address in the sequence up to. The read lock request queue in the lock server's memory may record multiple clients, and therefore the lock server will read multiple clients in read lock state, i.e., whether multiple clients are in read lock wait state. You may check if you want to acquire a lock. Optionally, the first memory address is the first memory address in the sequence from the top of the read lock request queue to the end of the queue where the identifier of the first client can be written.

第3の態様を参照して、第5の可能な実現方式では、第1の読み取りロック要求は、ロックリースを更に搬送し、ロックリースは、読み取りロックの有効期間を示すために使用され、ロックリースが失効した場合、ロックサーバは、適時に読み取りロックを解放してもよい。   Referring to the third aspect, in a fifth possible implementation scheme, the first read lock request further carries a lock lease, which is used to indicate the validity period of the read lock and the lock If the lease expires, the lock server may release the read lock in a timely manner.

第3の態様の第2の可能な実現方式を参照して、第6の可能な実現方式では、この方法は、インタフェースカードにより、第1のクライアントにより送信された読み取りロック解放要求を受信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にある第1のメモリアドレスを搬送するステップと、インタフェースカードにより、第1のクライアントに割り当てられた読み取りロックの数量に従ってメモリ内の読み取りロック割り当てカウントを減少させるステップと、インタフェースカードにより、読み取りロック要求キュー内の第1のメモリアドレスから第1のクライアントの識別子を削除するステップとを更に含む。第1のクライアントは、読み取りロックを解放し、これにより、ロックサーバが書き込みロックを割り当ててもよい。任意選択で、第1のクライアントは、書き込みロックを求めて申請する他のクライアントの通知に従って読み取りロック解放要求を送信する。   Referring to the second possible implementation manner of the third aspect, in the 6th possible implementation manner, the method comprises receiving, by the interface card, a read lock release request sent by the first client. The read lock release request was assigned to the first client by the interface card carrying the first memory address in the read lock request queue storing the identifier of the first client. Decreasing the read lock allocation count in memory according to the number of read locks, and further deleting, by the interface card, the first client identifier from the first memory address in the read lock request queue. The first client may release the read lock, which may cause the lock server to assign a write lock. Optionally, the first client sends a read lock release request in accordance with notifications of other clients applying for a write lock.

第3の態様の第2の可能な実現方式を参照して、第7の可能な実現方式では、第1のクライアントが読み取りロックを取得した後に故障になった場合、この方法は、インタフェースカードにより、第1のクライアントに割り当てられた読み取りロックの数量に従ってメモリ内の読み取りロック割り当てカウントを減少させるステップと、インタフェースカードにより、読み取りロック要求キュー内の第1のメモリアドレスから第1のクライアントの識別子を削除するステップとを更に含む。第1のクライアントが読み取りロックを取得した後に故障になった場合、ロックサーバのインタフェースカードは、故障したクライアントが長期間に読み取りロックを保持することを妨げるために、第1のクライアントの読み取りロックを解放する。任意選択で、インタフェースカードは、他のクライアントの通知に従って第1のクライアントが故障していると決定し、次に、第1のクライアントにより保持された読み取りロックを解放してもよい。   Referring to the second possible implementation scheme of the third aspect, in the seventh possible implementation scheme, if the first client fails after acquiring the read lock, this method is performed by the interface card. Reducing the read lock allocation count in the memory according to the number of read locks allocated to the first client, and the interface card deriving the first client identifier from the first memory address in the read lock request queue by the interface card. And deleting. If a failure occurs after the first client acquires the read lock, the lock server's interface card will lock the first client's read lock to prevent the failed client from holding the read lock for an extended period of time. release. Optionally, the interface card may determine that the first client has failed in accordance with other client notifications and then release the read lock held by the first client.

第4の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、複数のクライアントとロックサーバとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、読み取りロック要求キューと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、クラスタ内にあるクライアントの識別子を記録するために使用され、書き込みロック割り当て識別子は、共有リソースのための書き込みロックが割り当てられたか否かを示すために使用され、ロック管理方法は、複数のクライアント内の第1のクライアントにより、第1の読み取りロック要求をインタフェースカードに送信するステップであり、第1の読み取りロック要求は、第1のクライアントの識別子と読み取りロック要求キュー内の第1のメモリアドレスとを搬送するステップと、第1のクライアントにより、インタフェースカードにより送信された第1のメッセージを受信するステップであり、第1のメッセージは、書き込みロック割り当て識別子を搬送するステップとを含む。   According to a fourth aspect, an embodiment of the present invention provides another lock management method in a cluster, the cluster including a plurality of clients and a lock server, the lock server comprising an interface card and a memory. The memory stores a read lock request queue and a write lock assignment identifier, and the read lock request queue is in a read lock wait state for the same shared resource or is in a cluster that acquires a read lock Used to record the identifier of the client, the write lock assignment identifier is used to indicate whether or not a write lock for the shared resource has been assigned, and the lock management method is the first in the plurality of clients. Client sends first read lock request to interface card The first read lock request is transmitted by the interface card by the first client and carrying the identifier of the first client and the first memory address in the read lock request queue. Receiving a first message, the first message carrying a write lock assignment identifier.

第4の態様を参照して、第1の可能な実現方式では、書き込みロックが割り当てられていることを書き込みロック割り当て識別子が示す場合、第1のメッセージは、第1のクライアントが読み取りロック待機状態にあることを示す。   Referring to the fourth aspect, in a first possible implementation scheme, if the write lock assignment identifier indicates that a write lock has been assigned, the first message is received by the first client in a read lock wait state. Indicates that

第4の態様を参照して、第2の可能な実現方式では、書き込みロックが割り当てられないことを書き込みロック割り当て識別子が示す場合、第1のメッセージは、第1のクライアントが読み取りロックを取得することを示す。   Referring to the fourth aspect, in the second possible implementation scheme, if the write lock assignment identifier indicates that the write lock is not assigned, the first message is obtained by the first client acquiring the read lock. It shows that.

第4の態様を参照して、第3の可能な実現方式では、クラスタは、第2のクライアントを更に含み、第2のクライアントの識別子は、読み取りロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キュー内の、第1の読み取りロック要求で搬送された第1のメモリアドレスは、第1のクライアントの識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである。任意選択で、第1のメモリアドレスは、第1のクライアントの識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスである。   Referring to the fourth aspect, in a third possible implementation manner, the cluster further includes a second client, and the identifier of the second client is stored in the memory address at the head of the queue of the read lock request queue. The first memory address carried by the first read lock request in the read lock request queue can be written with the identifier of the first client from the head of the read lock request queue to the end of the queue. A memory address in the sequence. Optionally, the first memory address is the first memory address in the sequence from the top of the read lock request queue to the end of the queue where the identifier of the first client can be written.

第4の態様を参照して、第4の可能な実現方式では、第1の読み取りロック要求は、ロックリースを更に搬送し、ロックリースは、読み取りロックの有効期間を示すために使用される。   Referring to the fourth aspect, in a fourth possible implementation scheme, the first read lock request further carries a lock lease, which is used to indicate the validity period of the read lock.

第4の態様の第2の可能な実現方式を参照して、第5の可能な実現方式では、第1のクライアントが読み取りロックを取得した場合、この方法は、第1のクライアントにより、読み取りロック解放要求をインタフェースカードに送信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送するステップを更に含む。任意選択で、第1のクライアントは、書き込みロックを求めて申請する他のクライアントにより送信された通知を受信し、読み取りロック解放操作を実行する。   Referring to the second possible implementation manner of the fourth aspect, in the fifth possible implementation manner, if the first client acquires a read lock, the method is executed by the first client by the read lock. Sending a release request to the interface card, the read lock release request further comprising conveying a memory address in a read lock request queue in which the identifier of the first client is stored. Optionally, the first client receives a notification sent by another client applying for a write lock and performs a read lock release operation.

第5の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック要求キューは、第2のクライアントの識別子を更に記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントの書き込みロック解放要求を受信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、第1のクライアントにより送信された書き込みロック要求問い合わせメッセージを受信するステップであり、書き込みロック要求問い合わせメッセージは、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック要求問い合わせ応答メッセージを第1のクライアントに送信するステップであり、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、インタフェースカードにより、第1のクライアントにより送信された書き込みロック占有要求を受信するステップであり、書き込みロック占有要求は、第2のクライアントの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送するステップと、インタフェースカードにより、第2のクライアントの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むステップとを含む。本発明のこの実施例では、第1のクライアントが書き込みロックを解放するときに、書き込みロックは、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントに直接割り当てられる。   According to a fifth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue and a write lock allocation identifier, and the first client identifier is stored at a memory address at the head of the queue of the write lock request queue; The queue further stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, the first client acquires a write lock for the shared resource, and the second Client is in a write lock wait state for a shared resource and locked The processing method is a step of receiving the write lock release request of the first client by the interface card, and the write lock release request is carried by the step of conveying the memory address at the head of the queue of the write lock request queue and the interface card. A step of deleting the identifier of the first client from the write lock request queue according to the memory address at the head of the queue of the write lock request queue, and a step of receiving a write lock request inquiry message transmitted by the first client by the interface card. Yes, the write lock request inquiry message carries a memory address in the write lock request queue in which the second client identifier is stored; To send a write lock request inquiry response message to the first client, and the write lock request inquiry response message is sent by the first client via the interface card and the interface card. The write lock occupancy request, the write lock occupancy request includes a step of conveying an identifier of the second client and a memory address at the head of the queue of the write lock request queue, and a second by the interface card. Writing the client identifier to the memory address at the head of the write lock request queue. In this embodiment of the invention, when the first client releases the write lock, the write lock is assigned directly to the client in the write lock wait state recorded in the write lock request queue.

第5の態様を参照して、第1の可能な実現方式では、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスである。したがって、識別子が書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアントは、書き込みロックを優先的に取得する。   Referring to the fifth aspect, in a first possible implementation scheme, the memory address in the write lock request queue, where the identifier of the second client is stored, is the next following the queue head of the write lock request queue. Memory address. Therefore, the client whose identifier is stored at the next memory address following the head of the write lock request queue preferentially acquires the write lock.

第5の態様を参照して、第2の可能な実現方式では、書き込みロック要求キューは、第2のクライアントの書き込みロック優先度を更に記憶し、第2のクライアントの書き込みロック優先度は、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で最高である。したがって、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で、最高の書き込みロック優先度を有するクライアントは、書き込みロックを優先的に取得する。   Referring to the fifth aspect, in a second possible implementation scheme, the write lock request queue further stores the write lock priority of the second client, and the write lock priority of the second client is write The best client in the lock request queue that is waiting for a write lock. Therefore, the client having the highest write lock priority among clients in the write lock waiting state recorded in the write lock request queue preferentially acquires the write lock.

第6の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キューは、第2のクライアントの識別子を記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、読み取りロック割り当てカウントは0であり、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための読み取りロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントにより送信された書き込みロック解放要求を受信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、第1のクライアントにより送信された読み取りロック要求問い合わせメッセージを受信するステップと、インタフェースカードにより、読み取りロック要求問い合わせ応答メッセージを第1のクライアントに送信するステップであり、読み取りロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、インタフェースカードにより、第1のクライアントにより送信された読み取りロック割り当てカウント変更要求を受信するステップと、インタフェースカードにより、読み取りロック割り当てカウント変更要求に従ってメモリ内の読み取りロック割り当てカウントを増加させるステップとを含む。第1のクライアントの書き込みロックが解放されると、読み取りロックは、読み取りロック要求キューに記録された、読み取りロック待機状態にあるクライアントに直接割り当てられる。   According to a sixth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: The memory includes an interface card and a memory, and the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the first client identifier is a head of the write lock request queue. The read lock request queue stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, the read lock assignment count is zero, 1 client writes for shared resources The lock is acquired, the second client is in a read lock waiting state for the shared resource, and the lock management method is a step of receiving a write lock release request transmitted by the first client by the interface card. The write lock release request includes a step of conveying the memory address at the head of the write lock request queue, a step of setting the write lock assignment identifier to a write lock unassigned state by the interface card, and a write lock request by the interface card. Deleting the identifier of the first client from the write lock request queue in accordance with the memory address at the head of the queue of the queue, and a read lock request sent by the first client by the interface card. Receiving an inquiry message; sending a read lock request inquiry response message to the first client by means of the interface card; the read lock request inquiry response message carrying an identifier of the second client; Receiving, by the interface card, a read lock allocation count change request sent by the first client; and increasing the read lock allocation count in the memory according to the read lock allocation count change request by the interface card. When the first client's write lock is released, the read lock is assigned directly to the client in the read lock wait state recorded in the read lock request queue.

第7の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック要求キューは、第2のクライアントの識別子を更に記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、第1のクライアントにより、書き込みロック解放要求をインタフェースカードに送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードが書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除した場合、第1のクライアントにより、書き込みロック要求問い合わせメッセージをインタフェースカードに送信するステップであり、書き込みロック要求問い合わせメッセージは、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスを搬送するステップと、第1のクライアントにより、インタフェースカードにより送信された書き込みロック要求問い合わせ応答メッセージを受信するステップであり、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、第1のクライアントにより、書き込みロック占有要求をインタフェースカードに送信するステップであり、書き込みロック占有要求は、第2のクライアントの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送するステップと、第1のクライアントにより、第2のクライアントの識別子が書き込みロック要求キューのキュー先頭のメモリアドレスに書き込まれることを示す、インタフェースカードにより送信された書き込みロック占有要求応答を受信するステップと、第1のクライアントにより、通知を第2のクライアントに送信するステップであり、通知は、第2のクライアントが書き込みロックを取得することを示すステップとを含む。第1のクライアントが書き込みロックを解放するときに、書き込みロックは、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントに直接割り当てられる。   According to a seventh aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue and a write lock allocation identifier, and the first client identifier is stored at a memory address at the head of the queue of the write lock request queue; The queue further stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, the first client acquires a write lock for the shared resource, and the second Client is in a write lock wait state for a shared resource and locked The processing method is a step of transmitting a write lock release request to the interface card by the first client. The write lock release request is transferred to the memory address at the head of the queue of the write lock request queue. When the first client identifier is deleted from the write lock request queue according to the memory address at the head of the lock request queue, the first client sends a write lock request inquiry message to the interface card. The inquiry message includes a step of carrying a memory address in a write lock request queue in which an identifier of the second client is stored, and an interface card by the first client. Receiving the write lock request inquiry response message transmitted by the step, wherein the write lock request inquiry response message carries the identifier of the second client, and the write lock occupation request is sent to the interface card by the first client. The write lock occupancy request includes a step of conveying the identifier of the second client and the memory address at the head of the queue of the write lock request queue, and the identifier of the second client is transmitted by the first client. A step of receiving a write lock occupation request response sent by the interface card indicating that the write lock request queue is written to the memory address at the head of the queue, and a first client sending a notification to the second client And the notification includes the step of indicating that the second client acquires a write lock. When the first client releases the write lock, the write lock is assigned directly to the client in the write lock wait state recorded in the write lock request queue.

第7の態様を参照して、第1の可能な実現方式では、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスである。したがって、識別子が書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアントは、書き込みロックを優先的に取得する。   Referring to the seventh aspect, in a first possible implementation scheme, the memory address in the write lock request queue, where the identifier of the second client is stored, is the next following the queue head of the write lock request queue. Memory address. Therefore, the client whose identifier is stored at the next memory address following the head of the write lock request queue preferentially acquires the write lock.

第7の態様を参照して、第2の可能な実現方式では、書き込みロック要求キューは、第2のクライアントの書き込みロック優先度を更に記憶し、第2のクライアントの書き込みロック優先度は、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で最高である。したがって、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で、最高の優先度を有するクライアントは、書き込みロックを優先的に取得する。   Referring to the seventh aspect, in a second possible implementation scheme, the write lock request queue further stores the write lock priority of the second client, and the write lock priority of the second client is write The best client in the lock request queue that is waiting for a write lock. Therefore, the client having the highest priority among the clients in the write lock waiting state recorded in the write lock request queue preferentially acquires the write lock.

第8の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キューは、第2のクライアントの識別子を記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、読み取りロック割り当てカウントは0であり、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための読み取りロック待機状態にあり、ロック管理方法は、第1のクライアントにより、書き込みロック解放要求をインタフェースカードに送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードが書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除した場合、第1のクライアントにより、読み取りロック要求問い合わせメッセージをインタフェースカードに送信するステップと、第1のクライアントにより、インタフェースカードにより送信された読み取りロック要求問い合わせ応答メッセージを受信するステップであり、読み取りロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、第1のクライアントにより、読み取りロック割り当てカウント変更要求をインタフェースカードに送信するステップとを含む。第1のクライアントが読み取りロックを解放した場合、読み取りロックは、読み取りロック要求キューに記録された、読み取りロック待機状態にあるクライアントに直接割り当てられる。   According to an eighth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: The memory includes an interface card and a memory, and the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the first client identifier is a head of the write lock request queue. The read lock request queue stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, the read lock assignment count is zero, 1 client writes for shared resources The lock is acquired, the second client is in a read lock waiting state for the shared resource, and the lock management method is a step of sending a write lock release request to the interface card by the first client, and the write lock For the release request, the step of transporting the memory address at the head of the write lock request queue, the interface card sets the write lock assignment identifier to the write lock unassigned state, and the write lock is performed according to the memory address at the head of the write lock request queue. When the identifier of the first client is deleted from the request queue, the first client sends a read lock request inquiry message to the interface card, and the first client Receiving a read lock request inquiry response message transmitted by the scan card, the read lock request inquiry response message carrying a second client identifier, and a read lock allocation count change request by the first client. Transmitting to the interface card. When the first client releases the read lock, the read lock is assigned directly to the client in the read lock wait state recorded in the read lock request queue.

第9の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック要求キューは、第2のクライアントの識別子を更に記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、第1のクライアントにより、書き込みロック解放要求をインタフェースカードに送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードが書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除した場合、第1のクライアントにより、書き込みロック要求問い合わせメッセージをインタフェースカードに送信するステップであり、書き込みロック要求問い合わせメッセージは、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスを搬送するステップと、第1のクライアントにより、インタフェースカードにより送信された書き込みロック要求問い合わせ応答メッセージを受信するステップであり、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、第1のクライアントにより、第2のクライアントの識別子に従って通知を第2のクライアントに送信するステップであり、通知は、第2のクライアントに対して書き込みロック要求をインタフェースカードに送信するように命令するために使用されるステップとを含む。書き込みロックを解放するときに、第1のクライアントは、書き込みロック待機状態にあるクライアントに対して書き込みロック要求を送信するように命令する。   According to a ninth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue and a write lock allocation identifier, and the first client identifier is stored at a memory address at the head of the queue of the write lock request queue; The queue further stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, the first client acquires a write lock for the shared resource, and the second Client is in a write lock wait state for a shared resource and locked The processing method is a step of transmitting a write lock release request to the interface card by the first client. The write lock release request is transferred to the memory address at the head of the queue of the write lock request queue. When the lock allocation identifier is set to the write lock unallocated state and the first client identifier is deleted from the write lock request queue according to the memory address at the head of the write lock request queue, the first client makes a write lock request inquiry Sending a message to the interface card, wherein the write lock request inquiry message is a memory address in the write lock request queue in which the identifier of the second client is stored. And receiving a write lock request inquiry response message sent by the interface card by the first client, wherein the write lock request inquiry response message carries the identifier of the second client; Sending a notification to the second client by the first client according to the identifier of the second client, the notification instructing the second client to send a write lock request to the interface card. Used for the purpose. When releasing the write lock, the first client instructs the client in the write lock waiting state to send a write lock request.

第9の態様を参照して、第1の可能な実現方式では、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスである。識別子が書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアントは、第1のクライアントにより送信された書き込みロック要求通知を優先的に取得する。   Referring to the ninth aspect, in the first possible realization scheme, the memory address in the write lock request queue where the identifier of the second client is stored is the next following the queue head of the write lock request queue. Memory address. The client whose identifier is stored at the next memory address following the head of the write lock request queue preferentially obtains the write lock request notification transmitted by the first client.

第9の態様を参照して、第2の可能な実現方式では、書き込みロック要求キューは、第2のクライアントの書き込みロック優先度を更に記憶し、第2のクライアントの書き込みロック優先度は、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で最高である。したがって、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で、最高の書き込みロック優先度を有するクライアントは、第1のクライアントにより送信された書き込みロック要求通知を優先的に取得する。   Referring to the ninth aspect, in the second possible implementation scheme, the write lock request queue further stores the write lock priority of the second client, and the write lock priority of the second client is write The best client in the lock request queue that is waiting for a write lock. Therefore, the client having the highest write lock priority among the clients in the write lock waiting state recorded in the write lock request queue preferentially obtains the write lock request notification transmitted by the first client. To do.

第10の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キューは、第2のクライアントの識別子を記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、読み取りロック割り当てカウントは0であり、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための読み取りロック待機状態にあり、ロック管理方法は、第1のクライアントにより、書き込みロック解放要求をインタフェースカードに送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードが書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除した場合、第1のクライアントにより、読み取りロック要求問い合わせメッセージをインタフェースカードに送信するステップと、第1のクライアントにより、インタフェースカードにより送信された読み取りロック要求問い合わせ応答メッセージを受信するステップであり、読み取りロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、第1のクライアントにより、第2のクライアントの識別子に従って通知を第2のクライアントに送信するステップであり、通知は、第2のクライアントに対して読み取りロックを求めて申請するように命令するために使用されるステップとを含む。書き込みロックを解放するときに、第1のクライアントは、読み取りロック待機状態にある第2のクライアントに対して読み取りロックを求めて申請するように命令し、第2のクライアントは、読み取りロック割り当てカウント変更要求をインタフェースカードに送信し、インタフェースカードは、読み取りロック割り当てカウントを変更し、第2のクライアントは、読み取りロックを取得する。   According to a tenth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: The memory includes an interface card and a memory, and the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the first client identifier is a head of the write lock request queue. The read lock request queue stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, the read lock assignment count is zero, 1 client writes for shared resources The second client is in a read lock waiting state for the shared resource, and the lock management method is a step of sending a write lock release request to the interface card by the first client, The lock release request is written according to the step of conveying the memory address at the head of the write lock request queue, and the interface card sets the write lock assignment identifier to the write lock unassigned state, and writes according to the memory address at the head of the write lock request queue. If the identifier of the first client is deleted from the lock request queue, the first client sends a read lock request inquiry message to the interface card, and the first client Receiving a read lock request inquiry response message sent by the source card, the read lock request inquiry response message carrying a second client identifier, and the first client identifying the second client identifier And sending a notification to the second client, wherein the notification includes instructing the second client to apply for a read lock. When releasing the write lock, the first client instructs the second client in the read lock waiting state to apply for a read lock, and the second client changes the read lock allocation count. The request is sent to the interface card, the interface card changes the read lock allocation count, and the second client acquires the read lock.

第11の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、第1のクライアントの識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、第1のクライアントにより取得された読み取りロックの数量であり、第1のクライアントは、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、第1のクライアントにより、読み取りロック解放要求をインタフェースカードに送信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送するステップと、インタフェースカードが読み取りロック割り当てカウントを0まで減少させ、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューから第1のクライアントの識別子を削除した場合、第1のクライアントにより、書き込みロック要求問い合わせメッセージをインタフェースカードに送信するステップであり、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、第1のクライアントにより、インタフェースカードにより送信された書き込みロック要求問い合わせ応答メッセージを受信するステップであり、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、第1のクライアントにより、第2のクライアントの識別子に従って通知を第2のクライアントに送信するステップであり、通知は、第2のクライアントに対して書き込みロックを求めて申請するように命令するために使用されるステップとを含む。読み取りロックを解放するときに、第1のクライアントは、識別子が書き込みロック要求キューのキュー先頭に記録された、書き込みロック待機状態にある第2のクライアントに対して書き込みロックを求めて申請するように命令し、第2のクライアントは、通知に従って書き込みロック割り当て識別子変更要求をインタフェースカードに送信し、インタフェースカードは、書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定し、第2のクライアントは、書き込みロックを取得する。   According to an eleventh aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the read lock request queue stores an identifier of the first client. The second client identifier is stored at the memory address at the head of the write lock request queue, the write lock allocation identifier indicates that no write lock is allocated, and the read lock allocation count is determined by the first client. With the quantity of read locks acquired The first client acquires a read lock for the shared resource, the second client is in a write lock waiting state for the shared resource, and the lock management method is performed by the first client by the read lock. Sending a release request to the interface card, wherein the read lock release request carries a memory address in a read lock request queue in which the identifier of the first client is stored, and the interface card assigns a read lock. If the first client identifier is deleted from the read lock request queue according to the memory address in the read lock request queue where the count is decreased to 0 and the first client identifier is stored, Write lock required A step of transmitting an inquiry message to the interface card, wherein the write lock request inquiry message includes a step of conveying a memory address at the head of the queue of the write lock request queue, and a write lock request transmitted by the interface card by the first client. Receiving a query response message, wherein the write lock request query response message carries a second client identifier, and the first client sends a notification to the second client according to the second client identifier. Sending and the notification includes a step used to instruct the second client to apply for a write lock. When releasing the read lock, the first client asks the second client in the write lock waiting state whose identifier is recorded at the head of the write lock request queue to apply for the write lock. The second client sends a write lock assignment identifier change request to the interface card according to the notification, the interface card sets the write lock assignment identifier to the write lock assigned state, and the second client To get.

第12の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、第1のクライアントの識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、第1のクライアントにより取得された読み取りロックの数量であり、第1のクライアントは、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、第1のクライアントにより、読み取りロック解放要求をインタフェースカードに送信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送するステップと、インタフェースカードがメモリ内の読み取りロック割り当てカウントを0まで減少させ、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューから第1のクライアントの識別子を削除した場合、第1のクライアントにより、書き込みロック要求問い合わせメッセージをインタフェースカードに送信するステップであり、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、第1のクライアントにより、インタフェースカードにより送信された書き込みロック要求問い合わせ応答メッセージを受信するステップであり、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、第1のクライアントにより、書き込みロック割り当て識別子変更要求をインタフェースカードに送信するステップと、インタフェースカードが書き込みロック割り当て識別子変更要求に従って書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定した場合、第1のクライアントにより、第2のクライアントの識別子に従って通知を第2のクライアントに送信するステップであり、通知は、第2のクライアントが書き込みロックを取得することを示すステップとを含む。第1のクライアントが読み取りロックを解放するときに、書き込みロックは、識別子が書き込みロック要求キューのキュー先頭に記録された、書き込みロック待機状態にある第2のクライアントに直接割り当てられる。   According to a twelfth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the read lock request queue stores an identifier of the first client. The second client identifier is stored at the memory address at the head of the write lock request queue, the write lock allocation identifier indicates that no write lock is allocated, and the read lock allocation count is determined by the first client. With the quantity of read locks acquired The first client acquires a read lock for the shared resource, the second client is in a write lock waiting state for the shared resource, and the lock management method is performed by the first client by the read lock. Sending a release request to the interface card, wherein the read lock release request carries a memory address in a read lock request queue in which the identifier of the first client is stored; When the read lock allocation count is decreased to 0 and the first client identifier is deleted from the read lock request queue according to the memory address in the read lock request queue where the first client identifier is stored, Write by client A step of transmitting a lock request inquiry message to the interface card, wherein the write lock request inquiry message includes a step of conveying a memory address at the head of the queue of the write lock request queue, and a write sent by the interface card by the first client A step of receiving a lock request inquiry response message. The write lock request inquiry response message includes a step of conveying an identifier of the second client, and a write lock assignment identifier change request is transmitted to the interface card by the first client. And when the interface card sets the write lock assignment identifier to the write lock assigned state according to the write lock assignment identifier change request, The first client is sending a notification in accordance with the identifier of the second client to the second client, the notification, and a step of indicating that the second client obtains a write lock. When the first client releases the read lock, the write lock is assigned directly to the second client in the write lock wait state whose identifier is recorded at the head of the write lock request queue.

第13の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、第1のクライアントの識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、第1のクライアントにより取得された読み取りロックの数量であり、第1のクライアントは、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントにより送信された読み取りロック解放要求を受信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送するステップと、インタフェースカードにより、読み取りロック割り当てカウントを0まで減少させ、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、第1のクライアントにより送信された書き込みロック要求問い合わせメッセージを受信するステップであり、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック要求問い合わせ応答メッセージを第1のクライアントに送信するステップであり、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップとを含む。第1のクライアントの読み取りロックが解放されると、インタフェースカードは、書き込みロックを優先的に処理するために、識別子が書き込みロック要求キューのキュー先頭に記録された、書き込みロック待機状態にある第2のクライアントを求めて問い合わせる。   According to a thirteenth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the read lock request queue stores an identifier of the first client. The second client identifier is stored at the memory address at the head of the write lock request queue, the write lock allocation identifier indicates that no write lock is allocated, and the read lock allocation count is determined by the first client. With the quantity of read locks acquired The first client acquires a read lock for the shared resource, the second client is in a write lock waiting state for the shared resource, and the lock management method is performed by the interface card by the first client. A read lock release request transmitted by the interface card, the read lock release request carrying a memory address in a read lock request queue storing an identifier of the first client; Decrementing the read lock allocation count to 0 and deleting the first client identifier from the read lock request queue in accordance with a memory address in the read lock request queue stored with the first client identifier; and Mosquito A write lock request inquiry message sent by the first client, the write lock request inquiry message includes a step of conveying a memory address at the head of the write lock request queue, and an interface card, Sending a write lock request inquiry response message to the first client, the write lock request inquiry response message carrying a second client identifier. When the read lock of the first client is released, the interface card is in a write lock standby state in which the identifier is recorded at the head of the queue of the write lock request queue in order to preferentially process the write lock. Ask for clients.

第14の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、第1のクライアントの識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、第1のクライアントにより取得された読み取りロックの数量であり、第1のクライアントは、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントにより送信された読み取りロック解放要求を受信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送するステップと、インタフェースカードにより、読み取りロック割り当てカウントを0まで減少させ、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、第1のクライアントにより送信された書き込みロック要求問い合わせメッセージを受信するステップであり、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック要求問い合わせ応答メッセージを第1のクライアントに送信するステップであり、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送するステップと、インタフェースカードにより、第1のクライアントにより送信された書き込みロック割り当て識別子変更要求を受信するステップと、インタフェースカードにより、書き込みロック割り当て識別子変更要求に従って書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定するステップとを含む。第1のクライアントの読み取りロックが解放されるときに、書き込みロックは、書き込みロック要求キューのキュー先頭に記録された、書き込みロック待機状態にあるクライアントに直接割り当てられる。   According to a fourteenth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the read lock request queue stores an identifier of the first client. The second client identifier is stored at the memory address at the head of the write lock request queue, the write lock allocation identifier indicates that no write lock is allocated, and the read lock allocation count is determined by the first client. With the quantity of read locks acquired The first client acquires a read lock for the shared resource, the second client is in a write lock waiting state for the shared resource, and the lock management method is performed by the interface card by the first client. A read lock release request transmitted by the interface card, the read lock release request carrying a memory address in a read lock request queue storing an identifier of the first client; Decrementing the read lock allocation count to 0 and deleting the first client identifier from the read lock request queue in accordance with a memory address in the read lock request queue stored with the first client identifier; and Mosquito A write lock request inquiry message sent by the first client, the write lock request inquiry message includes a step of conveying a memory address at the head of the write lock request queue, and an interface card, Sending a write lock request inquiry response message to the first client, the write lock request inquiry response message being sent by the first client by the interface card and carrying the identifier of the second client The step of receiving the write lock assignment identifier change request and the interface card writes the write lock assignment identifier according to the write lock assignment identifier change request. Tsu and a step of setting to click allocated state. When the read lock of the first client is released, the write lock is directly assigned to the client in the write lock waiting state recorded at the head of the queue of the write lock request queue.

第15の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに更に記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントの書き込みロック解放要求を受信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶された第2のクライアントの識別子を求めて問い合わせるステップと、インタフェースカードにより、第2のクライアントの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むステップと、インタフェースカードにより、第2のクライアントに対して書き込みロックを取得するように命令するための通知を第2のクライアントに送信するステップとを含む。本発明のこの実施例では、第1のクライアントが書き込みロックを解放するときに、ロックサーバは、書き込みロック要求キュー内に記録された、書き込みロック待機状態にあるクライアントに書き込みロックを割り当てる。   According to a fifteenth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue and a write lock assignment identifier, the identifier of the first client is stored at a memory address at the head of the queue of the write lock request queue, and the second The client identifier is further stored at the next memory address following the head of the write lock request queue, the write lock assignment identifier indicates that a write lock is assigned, and the first client is for a shared resource. The second client acquires a write lock for the shared resource The lock management method is a step of receiving the write lock release request of the first client by the interface card, and the write lock release request is obtained by changing the memory address at the head of the queue of the write lock request queue. Conveying step, deleting the identifier of the first client from the write lock request queue according to the memory address at the head of the queue of the write lock request queue by the interface card, and continuing to the head of the queue of the write lock request queue by the interface card A step of inquiring for the identifier of the second client stored at the next memory address, and an identifier of the second client by the interface card are written at the head of the queue of the write lock request queue. Comprising a step of writing the physical address, the interface card, and sending a notification for instructing to obtain a write lock on the second client to the second client. In this embodiment of the invention, when the first client releases the write lock, the lock server assigns the write lock to the client in the write lock wait state recorded in the write lock request queue.

第16の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、第1のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キューは、第2のクライアントの識別子を記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、読み取りロック割り当てカウントは0であり、第1のクライアントは、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための読み取りロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントにより送信された書き込みロック解放要求を受信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカードにより、書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定するステップと、インタフェースカードにより、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、読み取りロック要求キューに記憶された第2のクライアントの識別子を決定するために、読み取りロック要求キューに問い合わせるステップと、インタフェースカードにより、メモリ内の読み取りロック割り当てカウントを増加させるステップと、インタフェースカードにより、第2のクライアントが読み取りロックを取得することを示すための通知を第2のクライアントに送信するステップとを含む。第1のクライアントの書き込みロックが解放されるときに、ロックサーバは、読み取りロック要求キューに記録された、読み取りロック待機状態にあるクライアントに読み取りロックを直接割り当てる。   According to a sixteenth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: The memory includes an interface card and a memory, and the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier. The read lock request queue stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, the read lock assignment count is zero, 1 client writes for shared resources The second client is in a read lock waiting state for the shared resource, and the lock management method is a step of receiving, by the interface card, a write lock release request sent by the first client. Yes, the write lock release request includes a step of conveying the memory address at the head of the write lock request queue, a step of setting the write lock assignment identifier to the write lock unassigned state by the interface card, and a write lock by the interface card. Deleting the first client identifier from the write lock request queue according to the memory address at the head of the request queue, and the second client stored in the read lock request queue by the interface card. Querying the read lock request queue to determine the identifier of the client; increasing the read lock allocation count in memory by the interface card; and acquiring a read lock by the second card by the interface card. Sending a notification to indicate to the second client. When the first client's write lock is released, the lock server directly assigns the read lock to the client in the read lock waiting state recorded in the read lock request queue.

第17の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、第1のクライアントの識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、第1のクライアントにより取得された読み取りロックの数量であり、第1のクライアントは、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントにより送信された読み取りロック解放要求を受信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送するステップと、インタフェースカードにより、読み取りロック割り当てカウントを0まで減少させ、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、第2のクライアントの識別子を決定するために、書き込みロック要求キューのキュー先頭のメモリアドレスに問い合わせるステップと、インタフェースカードにより、第2のクライアントの識別子に従って、第2のクライアントに対して書き込みロックを求めてインタフェースカードに申請するように命令するための通知を第2のクライアントに送信するステップとを含む。第1のクライアントの読み取りロックが解放されるときに、インタフェースカードは、書き込みロックを優先的に処理するために、識別子が書き込みロック要求キューのキュー先頭に記録された、書き込みロック待機状態にある第2のクライアントを求めて問い合わせる。   According to a seventeenth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the read lock request queue stores an identifier of the first client. The second client identifier is stored at the memory address at the head of the write lock request queue, the write lock allocation identifier indicates that no write lock is allocated, and the read lock allocation count is determined by the first client. With the quantity of read locks acquired The first client acquires a read lock for the shared resource, the second client is in a write lock waiting state for the shared resource, and the lock management method is performed by the interface card by the first client. A read lock release request transmitted by the interface card, the read lock release request carrying a memory address in a read lock request queue storing an identifier of the first client; Decrementing the read lock allocation count to 0 and deleting the first client identifier from the read lock request queue in accordance with a memory address in the read lock request queue stored with the first client identifier; and Mosquito In order to determine the identifier of the second client by the command, inquiring of the memory address at the head of the queue of the write lock request queue, and writing to the second client by the interface card according to the identifier of the second client Sending a notification to the second client to instruct the interface card to apply for a lock. When the first client's read lock is released, the interface card is in a write lock wait state with an identifier recorded at the head of the write lock request queue to preferentially process the write lock. Ask for 2 clients.

第18の態様によれば、本発明の実施例は、クラスタ内の他のロック管理方法を提供し、クラスタは、ロックサーバと第1のクライアントと第2のクライアントとを含み、ロックサーバは、インタフェースカードとメモリとを含み、メモリは、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶し、読み取りロック要求キューは、第1のクライアントの識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、第1のクライアントにより取得された読み取りロックの数量であり、第1のクライアントは、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にあり、ロック管理方法は、インタフェースカードにより、第1のクライアントにより送信された読み取りロック解放要求を受信するステップであり、読み取りロック解放要求は、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送するステップと、インタフェースカードにより、読み取りロック割り当てカウントを0まで減少させ、第1のクライアントの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューから第1のクライアントの識別子を削除するステップと、インタフェースカードにより、第2のクライアントの識別子を決定するために、書き込みロック要求キューのキュー先頭のメモリアドレスに問い合わせるステップと、インタフェースカードにより、書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定するステップと、インタフェースカードにより、第2のクライアントの識別子に従って、第2のクライアントが書き込みロックを取得することを示すための通知を第2のクライアントに送信するステップとを含む。第1のクライアントの読み取りロックが解放されるときに、書き込みロックは、書き込みロック要求キューのキュー先頭に記録された、書き込みロック待機状態にあるクライアントに割り当てられる。   According to an eighteenth aspect, an embodiment of the present invention provides another lock management method in a cluster, wherein the cluster includes a lock server, a first client, and a second client, the lock server comprising: An interface card and a memory, wherein the memory stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier, and the read lock request queue stores an identifier of the first client. The second client identifier is stored at the memory address at the head of the write lock request queue, the write lock allocation identifier indicates that no write lock is allocated, and the read lock allocation count is determined by the first client. With the quantity of read locks acquired The first client acquires a read lock for the shared resource, the second client is in a write lock waiting state for the shared resource, and the lock management method is performed by the interface card by the first client. A read lock release request transmitted by the interface card, the read lock release request carrying a memory address in a read lock request queue storing an identifier of the first client; Decrementing the read lock allocation count to 0 and deleting the first client identifier from the read lock request queue in accordance with a memory address in the read lock request queue stored with the first client identifier; and Mosquito Inquiring the memory address at the head of the write lock request queue to determine the identifier of the second client, and setting the write lock assignment identifier in the write lock assigned state by the interface card; Sending, by the interface card, a notification to the second client indicating that the second client acquires a write lock according to the identifier of the second client. When the read lock of the first client is released, the write lock is assigned to the client in the write lock waiting state recorded at the head of the write lock request queue.

前述の実施例によれば、本発明の実施例は、ロックサーバを更に提供し、ロックサーバは、前述の実施例におけるロックサーバの機能を実現するように構成されたメモリ及びインタフェースカードを含む。   According to the foregoing embodiments, the embodiments of the present invention further provide a lock server, which includes a memory and an interface card configured to implement the functions of the lock server in the foregoing embodiments.

前述の実施例によれば、本発明の実施例は、本発明の前述の実施例に対応する解決策を実現するために、前述の実施例に記載されたクラスタ内の第1のクライアントとして機能するように構成されたクライアントを更に提供する。クライアントは、本発明の前述の実施例におけるクラスタ内の第1のクライアントの機能を実現する構造ユニットを含むか、或いは本発明の前述の実施例におけるクラスタ内の第1のクライアントの機能を実現する。対応して、本発明の実施例は、不揮発性コンピュータ読み取り可能記憶媒体及びコンピュータプログラムプロダクトを更に提供する。不揮発性コンピュータ読み取り可能記憶媒体及びコンピュータプログラムプロダクトに含まれるコンピュータ命令がクライアントのメモリにロードされ、クライアントの中央処理装置(Central Processing Unit、CPU)がコンピュータ命令を実行した場合、クライアントは、本発明の前述の実施例におけるクラスタ内の第1のクライアントの機能を実現する。   According to the above embodiment, the embodiment of the present invention functions as the first client in the cluster described in the above embodiment to realize a solution corresponding to the above embodiment of the present invention. There is further provided a client configured to: The client includes a structural unit that implements the function of the first client in the cluster in the previous embodiment of the present invention, or implements the function of the first client in the cluster in the previous embodiment of the present invention. . Correspondingly, embodiments of the present invention further provide non-volatile computer readable storage media and computer program products. When the computer instructions included in the non-volatile computer-readable storage medium and the computer program product are loaded into the client's memory and the client's central processing unit (CPU) executes the computer instructions, the client The function of the first client in the cluster in the above-described embodiment is realized.

前述の実施例を参照して、本発明の実施例は、クラスタを更に提供し、クラスタは、ロックサーバとクライアントとを含み、ロックサーバ及びクライアントについては、前述の実施例の説明に参照が行われてもよい。   Referring to the foregoing embodiment, the embodiment of the present invention further provides a cluster, the cluster includes a lock server and a client, and reference is made to the description of the foregoing embodiment for the lock server and the client. It may be broken.

本発明の実施例において提供されるクラスタ内のロック管理方法、ロックサーバ及びクラスタ内のクライアントによれば、ロックサーバ及びクライアントが読み取りロック要求、書き込みロック要求、書き込みロック解放要求及び読み取りロック解放要求のような操作を処理する場合、ロックサーバのインタフェースカード及びメモリは、互いに直接通信し、ロックサーバの中央処理装置は、前述の操作を処理する必要はない。したがって、(Transmission Control Protocol/Internet Protocol、TCP/IP)プロトコルを使用することによる通信に比べて、クライアントとロックサーバとの間の相互作用が低減される。   According to the lock management method in the cluster, the lock server, and the client in the cluster provided in the embodiment of the present invention, the lock server and the client can execute the read lock request, the write lock request, the write lock release request, and the read lock release request. When processing such an operation, the interface card and the memory of the lock server communicate directly with each other, and the central processing unit of the lock server does not need to process the aforementioned operation. Therefore, the interaction between the client and the lock server is reduced compared to communication using the (Transmission Control Protocol / Internet Protocol, TCP / IP) protocol.

従来技術におけるクラスタの構成図である。It is a block diagram of the cluster in a prior art. 本発明の実施例によるクラスタの構成図である。It is a block diagram of the cluster by the Example of this invention. 本発明の実施例によるロックサーバの構成図である。It is a block diagram of the lock server by the Example of this invention. 本発明の実施例によるロックサーバのメモリの概略図である。FIG. 3 is a schematic diagram of a memory of a lock server according to an embodiment of the present invention. 本発明の実施例に従って書き込みロックを要求するフローチャートである。6 is a flowchart for requesting a write lock according to an embodiment of the present invention. 本発明の実施例によるロックサーバのメモリの概略図である。FIG. 3 is a schematic diagram of a memory of a lock server according to an embodiment of the present invention. 本発明の実施例によるロックサーバのメモリの概略図である。FIG. 3 is a schematic diagram of a memory of a lock server according to an embodiment of the present invention. 本発明の実施例に従って読み取りロックを要求するフローチャートである。6 is a flowchart for requesting a read lock according to an embodiment of the present invention. 本発明の実施例によるロックサーバのメモリの概略図である。FIG. 3 is a schematic diagram of a memory of a lock server according to an embodiment of the present invention. 本発明の実施例によるロックサーバのメモリの概略図である。FIG. 3 is a schematic diagram of a memory of a lock server according to an embodiment of the present invention. 本発明の実施例によるクライアントの概略構成図である。It is a schematic block diagram of the client by the Example of this invention.

図2に示すように、本発明の実施例におけるクラスタは、ロックサーバとクライアントAとクライアントBとを含み、クライアントA及びクライアントBは、RDMAプロトコルを使用することによりロックサーバと別々に通信する。ロックサーバのメモリは、ロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶する。詳細については、以下の説明に参照が行われてもよい。   As shown in FIG. 2, the cluster in the embodiment of the present invention includes a lock server, a client A, and a client B, and the client A and the client B communicate with the lock server separately by using the RDMA protocol. The memory of the lock server stores a lock request queue, a read lock allocation count, and a write lock allocation identifier. For details, reference may be made to the following description.

図3に示すように、ロックサーバは、メモリ301とインタフェースカード302とを含み、インタフェースカード302は、イーサーネットプロトコル(Ethernet)をサポートするネットワークインタフェースカード(Network Interface Card、NIC)、若しくはInfiniBandプロトコルに基づくインタフェースカード、又はメモリへのダイレクトリモートアクセス、例えば、RDMAを実現することができるプロトコルを実現可能な他のインタフェースカードでもよい。本発明のこの実施例におけるメモリ301は、ダイナミックランダムアクセスメモリ(Dynamic Random Access Memory、DRAM)、デュアルインラインメモリモジュール(Dual-Inline-Memory-Modules、DIMM)、半導体メモリ(Semiconductor Memory、SCM)、不揮発性メモリ(Non-volatile memory、NVM)等でもよく、或いはこれらの組み合わせでもよく、本発明のこの実施例では限定されない。クライアントは、サーバ、パーソナルコンピュータ及び他の端末でもよい。クライアントは、一般的にCPUとメモリとを含む。クライアントは、一般的にロックサーバと通信するように構成されたインタフェースカードを更に含む。CPU、メモリ及びインタフェースカードは、バスを使用することにより互いに通信する。図2に示すクラスタによれば、図4に示すように、本発明のこの実施例では、ロックサーバのメモリ301内のロック要求キューは、書き込みロック要求キューである。他の実現では、ロックサーバのメモリ301内のロック要求キューは、読み取りロック要求キューである。他の実現では、ロックサーバのメモリ301内のロック要求キューは、書き込みロック要求キュー及び読み取りロック要求キューである。   As shown in FIG. 3, the lock server includes a memory 301 and an interface card 302. The interface card 302 is a network interface card (Network Interface Card, NIC) that supports the Ethernet protocol (Ethernet) or an InfiniBand protocol. It may be an interface card based on it or other interface card capable of implementing a direct remote access to the memory, for example a protocol capable of implementing RDMA. The memory 301 in this embodiment of the present invention includes a dynamic random access memory (DRAM), a dual-inline memory module (DIMM), a semiconductor memory (Semiconductor Memory, SCM), and a nonvolatile memory. It may be a non-volatile memory (NVM) or a combination thereof, and is not limited in this embodiment of the present invention. The client may be a server, a personal computer, and other terminals. A client typically includes a CPU and memory. The client further includes an interface card that is generally configured to communicate with the lock server. The CPU, memory, and interface card communicate with each other using a bus. According to the cluster shown in FIG. 2, as shown in FIG. 4, in this embodiment of the present invention, the lock request queue in the memory 301 of the lock server is a write lock request queue. In another implementation, the lock request queue in the lock server's memory 301 is a read lock request queue. In another implementation, the lock request queues in the lock server memory 301 are a write lock request queue and a read lock request queue.

本発明のこの実施例では、書き込みロック要求キュー及び読み取りロック要求キューは、メモリ301内のデータ構造であり、書き込みロック要求キューは、書き込みロック待機状態にあるか、或いは書き込みロックを取得するクライアントの識別子を記憶するために使用され、読み取りロック要求キューは、読み取りロック待機状態にあるか、或いは読み取りロックを取得するクライアントの識別子を記憶するために使用される。本発明のこの実施例では、記載の書き込みロック要求キュー及び読み取りロック要求キューは、同じ共有リソースを要求するクライアントの識別子を記憶し、同じ共有リソースを要求することは、同じ共有リソースのための書き込みロック又は読み取りロックを求めて申請することを示す。すなわち、書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、クラスタ内のクライアントの識別子を記録するために使用され、読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、クラスタ内にあるクライアントの識別子を記録するために使用される。書き込みロック割り当て識別子は、同じ共有リソースのための書き込みロックが割り当てられたか否かを識別するために使用され、読み取りロック割り当てカウントは、同じ共有リソースのために割り当てられた読み取りロックの対応する数量を識別するために使用される。メモリ301の読み取りロック割り当てカウントの具体的な実現では、1つのメモリアドレスは、ロックサーバにより割り当てられた読み取りロックの数量を記録するために割り当てられてもよく、或いは複数のメモリアドレスが使用され、各メモリアドレスは、クライアントにより取得された読み取りロックの、読み取りロック要求キューに記録された数量を記録する。本発明のこの実施例の具体的な実現では、書き込みロック要求キューは、メモリ301内のデータ構造であり、読み取りロック要求キューは、メモリ301内のデータ構造である。具体的な実現の中で、書き込みロック要求キュー及び読み取りロック要求キューのそれぞれは、配列又は他の構造でもよい。   In this embodiment of the present invention, the write lock request queue and the read lock request queue are data structures in the memory 301, and the write lock request queue is in a write lock wait state or the client that acquires the write lock. Used to store the identifier, the read lock request queue is used to store the identifier of the client that is in the read lock wait state or that acquires the read lock. In this embodiment of the invention, the described write lock request queue and read lock request queue store the identifiers of clients requesting the same shared resource, and requesting the same shared resource is a write for the same shared resource. Indicates applying for a lock or read lock. That is, the write lock request queue records the identifiers of clients in the cluster, including the identifiers of clients in a write lock wait state for shared resources and the identifiers of clients that acquire write locks for the same shared resource The read lock request queue is used to record the identifiers of clients in the cluster that are in the read lock wait state for the same shared resource or that acquire the read lock. The write lock assignment identifier is used to identify whether a write lock for the same shared resource has been assigned, and the read lock assignment count is the corresponding quantity of read locks assigned for the same shared resource. Used to identify. In a specific implementation of the read lock allocation count of memory 301, one memory address may be allocated to record the quantity of read locks allocated by the lock server, or multiple memory addresses are used, Each memory address records the quantity recorded in the read lock request queue of the read lock acquired by the client. In a specific implementation of this embodiment of the invention, the write lock request queue is a data structure in memory 301 and the read lock request queue is a data structure in memory 301. In a specific implementation, each of the write lock request queue and the read lock request queue may be an array or other structure.

本発明のこの実施例では、クライアントの識別子が書き込みロック要求キュー内のメモリアドレスに記憶されること、及びクライアントの識別子が書き込みロック要求キューに記録されることは、同じ意味を有する。同様に、クライアントの識別子が読み取りロック要求キュー内のメモリアドレスに記憶されること、及びクライアントの識別子が読み取りロック要求キューに記録されることは、同じ意味を有する。書き込みロックが同じ共有リソースのために割り当てられたか否かを識別するために書き込みロック割り当て識別子が使用されること、及び書き込みロックが割り当てられたか否かを示すために書き込みロック割り当て識別子が使用されることは、同じ意味を有する。本発明のこの実施例では、クラスタは、複数のクライアントを含み、複数のクライアント内のクライアントは、複数のクライアントに含まれるクライアントと同じ意味を有する。例えば、複数のクライアント内の第2のクライアントは、複数のクライアントに含まれる第2のクライアントと同じ意味を有する。   In this embodiment of the invention, storing the client identifier at a memory address in the write lock request queue and recording the client identifier in the write lock request queue have the same meaning. Similarly, storing the client identifier at a memory address in the read lock request queue and recording the client identifier in the read lock request queue have the same meaning. A write lock assignment identifier is used to identify whether a write lock has been assigned for the same shared resource, and a write lock assignment identifier is used to indicate whether a write lock has been assigned. Have the same meaning. In this embodiment of the invention, the cluster includes a plurality of clients, and the clients in the plurality of clients have the same meaning as the clients included in the plurality of clients. For example, the second client in the plurality of clients has the same meaning as the second client included in the plurality of clients.

具体的な実現の中で、ロックサーバは、インタフェースカード302を使用することにより各クライアントと通信し、書き込みロック要求キューのキュー先頭のメモリアドレスと書き込みロック要求キューの長さ情報とを各クライアントに送信し、同様に、読み取りロック要求キューのキュー先頭のメモリアドレスと読み取りロック要求キューの長さ情報とを各クライアントに送信し、書き込みロック割り当て識別子のメモリアドレスについての情報と読み取りロック割り当てカウントのメモリアドレスについての情報とを各クライアントに送信する。   In a specific implementation, the lock server communicates with each client by using the interface card 302, and sends to each client the memory address at the head of the write lock request queue and the length information of the write lock request queue. Similarly, the memory address at the head of the read lock request queue and the length information of the read lock request queue are sent to each client, and information about the memory address of the write lock allocation identifier and the memory of the read lock allocation count Information about the address is sent to each client.

クライアントA及びクライアントBは、RDMAプロトコルを使用することによりロックサーバと通信する。クライアントは、RDMAプロトコルを使用することによりロックサーバと通信し、TCP/IPプロトコルを使用することにより通信を実行することに比べて、クライアントとロックサーバとの間の相互作用が低減される。   Client A and client B communicate with the lock server by using the RDMA protocol. The client communicates with the lock server by using the RDMA protocol, and the interaction between the client and the lock server is reduced compared to performing communication by using the TCP / IP protocol.

図5に示すように、本発明の実施例は、クライアントにより書き込みロックを要求する処理を提供する。   As shown in FIG. 5, an embodiment of the present invention provides a process for requesting a write lock by a client.

ステップ501:インタフェースカード302は、クライアントAの書き込みロック要求を受信する。   Step 501: The interface card 302 receives the write lock request of the client A.

クライアントAは、書き込みロック要求をロックサーバに送信し、書き込みロック要求は、クライアントAの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送する。   Client A sends a write lock request to the lock server, and the write lock request carries the identifier of client A and the memory address at the head of the write lock request queue.

メモリ301内の書き込みロック要求キューは、書き込みロック待機状態にあるクライアントの識別子と、書き込みロックを取得するクライアントの識別子とを含む、クライアントの識別子を記録するために使用されてもよく、ロックサーバは、書き込みロック要求キューに従ってクラスタ内のクライアントの書き込みロック申請状態を決定してもよい。   The write lock request queue in memory 301 may be used to record client identifiers, including the identifiers of clients that are in a write lock wait state, and the identifiers of clients that acquire write locks. The write lock application status of the clients in the cluster may be determined according to the write lock request queue.

ステップ502:インタフェースカード302は、クライアントAの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込む。   Step 502: The interface card 302 writes the identifier of the client A into the memory address at the head of the write lock request queue.

ロックサーバのインタフェースカード302は、書き込みロック要求を受信し、図6に示すように、書き込みロック要求キューのキュー先頭の、書き込みロック要求で搬送されたメモリアドレスに従って、クライアントAの識別子を書き込みロック要求キューのキュー先頭に書き込む。   The lock server interface card 302 receives the write lock request, and, as shown in FIG. 6, writes the identifier of the client A according to the memory address carried by the write lock request at the head of the write lock request queue. Write to the top of the queue.

クライアントAの識別子が書き込みロック要求キューのキュー先頭に成功して書き込まれた場合、これは、ロックサーバが書き込みロックをクラスタ内のクライアントに割り当てず、クライアントが書き込みロックを求めて待機していないことを示す。任意選択で、インタフェースカード302は、クライアントAの識別子が書き込みロック要求キューのキュー先頭のメモリアドレスに書き込まれたことを示すためのメッセージをクライアントAに返信する。   If client A's identifier is successfully written to the head of the write lock request queue, this means that the lock server has not assigned a write lock to the client in the cluster and the client is not waiting for a write lock. Indicates. Optionally, interface card 302 returns a message to client A to indicate that client A's identifier has been written to the memory address at the head of the write lock request queue.

任意選択で、インタフェースカード302がクライアントAの識別子を書き込みロック要求キューのキュー先頭に書き込むことに失敗した場合、インタフェースカード302は、クライアントAの識別子が書き込みロック要求キューのキュー先頭に書き込まれることに失敗したことを示すためのメッセージをクライアントAに送信する。この場合、クライアントAは、書き込みロック要求をインタフェースカード302に再び送信してもよく、書き込みロック要求は、クライアントAの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスに続く次のメモリアドレスとを搬送し、インタフェースカード302は、クライアントAの識別子を書き込みロック要求キュー内の次のメモリアドレスに書き込む。クライアントAの識別子が書き込みロック要求キュー内の次のメモリアドレスに書き込まれることに失敗した場合、クライアントAは、書き込みロック要求キューのキュー先頭から始まる第3のメモリアドレスを順次に選択し、前述の操作を繰り返す。クライアントAの識別子が書き込みロック要求キュー内のメモリアドレスに成功して書き込まれるまで、クライアントAは、書き込みロック要求をインタフェースカード302に再び送信し、書き込みロック要求は、クライアントAの識別子と書き込みロック要求キュー内の第3のメモリアドレスとを搬送し、すなわち、書き込みロック要求は、クライアントAの識別子が書き込まれることができる、書き込みロック要求キュー内にあるメモリアドレスを搬送する。クライアントAは、固定の周期の間隔で書き込みロック要求を送信してもよく、或いはクライアントAの識別子が書き込みロック要求キューに書き込まれることに失敗したことを示すメッセージを受信した場合に書き込みロック要求を送信してもよい。   Optionally, if the interface card 302 fails to write the client A identifier to the head of the write lock request queue, the interface card 302 will write the client A identifier to the head of the write lock request queue. A message indicating failure has been sent to client A. In this case, the client A may send the write lock request to the interface card 302 again, and the write lock request includes the identifier of client A and the next memory address following the memory address at the head of the queue of the write lock request queue. The interface card 302 writes the identifier of the client A to the next memory address in the write lock request queue. If the identifier of client A fails to be written to the next memory address in the write lock request queue, client A sequentially selects the third memory address starting from the head of the write lock request queue and Repeat the operation. Until client A's identifier is successfully written to the memory address in the write lock request queue, client A sends the write lock request again to interface card 302, and the write lock request is sent to client A's identifier and write lock request. Carry a third memory address in the queue, ie the write lock request carries a memory address in the write lock request queue to which the identifier of client A can be written. Client A may send a write lock request at fixed intervals, or if it receives a message indicating that client A's identifier failed to be written to the write lock request queue, it sends a write lock request. You may send it.

任意選択で、インタフェースカード302がクライアントAの識別子を書き込みロック要求キューのキュー先頭に書き込むことに失敗した場合、インタフェースカード302は、書き込みロック要求キューのキュー先頭から始まり、クライアントAの識別子が書き込まれることができるメモリアドレスを求めて書き込みロック要求キューに順次に問い合わせ、クライアントAの識別子を書き込みロック要求キューに書き込み、インタフェースカード302は、クライアントAの識別子が書き込みロック要求キュー内のメモリアドレスに書き込まれたことを示すためのメッセージをクライアントAに送信する。任意選択で、メッセージは、クライアントAの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスを搬送してもよい。   Optionally, if the interface card 302 fails to write the client A identifier to the head of the write lock request queue, the interface card 302 starts at the head of the write lock request queue and the client A identifier is written. Query the write lock request queue sequentially for a memory address, write the client A identifier to the write lock request queue, the interface card 302 writes the client A identifier to the memory address in the write lock request queue A message to indicate that is sent to client A. Optionally, the message may carry a memory address in the write lock request queue where the identifier of client A is stored.

ステップ503:読み取りロックが割り当てられているか否かを問い合わせる。   Step 503: Queries whether a read lock has been assigned.

本発明のこの実施例では、0である書き込みロック割り当て識別子が、ロックサーバが書き込みロックを割り当てないことを示し、1である書き込みロック割り当て識別子が、ロックサーバが書き込みロックを割り当てていることを示す例が使用される。   In this embodiment of the invention, a write lock assignment identifier that is 0 indicates that the lock server does not assign a write lock, and a write lock assignment identifier that is 1 indicates that the lock server has assigned a write lock. An example is used.

任意選択で、インタフェースカード302がクライアントAの識別子を書き込みロック要求キューのキュー先頭に成功して書き込んだ場合、インタフェースカード302は、読み取りロックが割り当てられているか否かを決定するために、読み取りロック割り当てカウントに問い合わせる。ロックサーバが読み取りロックを割り当てない場合、書き込みロック割り当て識別子は、書き込みロック割り当て識別子のメモリアドレスに従って書き込みロック割り当て済状態に設定され(本発明のこの実施例では1に設定され)、インタフェースカード302は、クライアントAが書き込みロックを取得することを示すためのメッセージをクライアントAに送信する。例示的に、メッセージは、書き込みロック割り当て識別子と読み取りロック割り当てカウントとを搬送してもよく、書き込みロック割り当て識別子は1であり、読み取りロック割り当てカウントは0である。0である読み取りロック割り当てカウントは、読み取りロックが割り当てられていないことを示す。   Optionally, if the interface card 302 successfully writes the identifier of client A to the head of the write lock request queue, the interface card 302 reads the read lock to determine whether a read lock is assigned. Queries the allocation count. If the lock server does not assign a read lock, the write lock assignment identifier is set to the write lock assigned state according to the memory address of the write lock assignment identifier (set to 1 in this embodiment of the invention) and the interface card 302 The client A sends a message to the client A indicating that it acquires the write lock. Illustratively, the message may carry a write lock assignment identifier and a read lock assignment count, where the write lock assignment identifier is 1 and the read lock assignment count is 0. A read lock assignment count of 0 indicates that no read lock has been assigned.

任意選択で、インタフェースカード302がクライアントAの識別子を書き込みロック要求キューのキュー先頭に成功して書き込んだ場合、インタフェースカード302は、クライアントAの識別子が書き込みロック要求キューのキュー先頭に書き込まれたことを示すためのメッセージをクライアントAに送信し、クライアントAは、書き込みロック割り当て識別子変更要求をインタフェースカード302に送信し、書き込みロック割り当て識別子変更要求は、書き込みロック割り当て識別子のメモリアドレスを搬送し、インタフェースカード302は、ロックサーバが読み取りロックを割り当てているか否かを決定するために、読み取りロック割り当てカウントに問い合わせる。ロックサーバが読み取りロックを割り当てない場合、書き込みロック割り当て識別子は、書き込みロック割り当て識別子のメモリアドレスに従って書き込みロック割り当て済状態に設定され(本発明のこの実施例では1に設定され)、インタフェースカード302は、クライアントAが書き込みロックを取得することを示すためのメッセージをクライアントAに送信する。具体的に、メッセージは、書き込みロック割り当て識別子と読み取りロック割り当てカウントとを搬送してもよく、書き込みロック割り当て識別子は1であり、読み取りロック割り当てカウントは0である。   Optionally, if the interface card 302 has successfully written the identifier of client A to the head of the write lock request queue, the interface card 302 has written that the identifier of client A has been written to the head of the write lock request queue. To the client A, the client A transmits a write lock assignment identifier change request to the interface card 302, and the write lock assignment identifier change request carries the memory address of the write lock assignment identifier, and the interface Card 302 queries the read lock assignment count to determine whether the lock server has assigned a read lock. If the lock server does not assign a read lock, the write lock assignment identifier is set to the write lock assigned state according to the memory address of the write lock assignment identifier (set to 1 in this embodiment of the invention) and the interface card 302 The client A sends a message to the client A indicating that it acquires the write lock. Specifically, the message may carry a write lock assignment identifier and a read lock assignment count, where the write lock assignment identifier is 1 and the read lock assignment count is 0.

読み取りロック割り当てカウントに問い合わせた後に、ロックサーバが読み取りロックを割り当てないとインタフェースカード302が決定した場合、インタフェースカード302は、クライアントAが書き込みロックを成功して取得することを示すために、書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定し、すなわち、書き込みロック割り当て識別子を1に設定する。すなわち、書き込みロックは、クライアントAに成功して割り当てられる。読み取りロック割り当てカウントに問い合わせた後に、ロックサーバが読み取りロックを割り当てているとインタフェースカード302が決定した場合、インタフェースカード302は、書き込みロック割り当て識別子を1に設定せず、すなわち、書き込みロック割り当て識別子は、依然として書き込みロック未割り当て状態にあり(本発明のこの実施例では、この場合に書き込みロック割り当て識別子は0であり)、クライアントAは、書き込みロック待機状態にあり、インタフェースカード302は、クライアントAが書き込みロック待機状態にあることを示すためのメッセージをクライアントAに送信する。例示的に、メッセージは、書き込みロック割り当て識別子と読み取りロック割り当てカウントとを搬送してもよく、書き込みロック割り当て識別子は0であり、読み取りロック割り当てカウントは0ではない。0ではない読み取りロック割り当てカウントは、読み取りロックが割り当てられていることを示す。   After interrogating the read lock allocation count, if the interface card 302 determines that the lock server does not allocate a read lock, the interface card 302 uses the write lock to indicate that client A successfully acquires the write lock. Set the assignment identifier to the write lock assigned state, that is, set the write lock assignment identifier to 1. That is, the write lock is successfully assigned to client A. If the interface card 302 determines that the lock server has assigned a read lock after querying the read lock assignment count, the interface card 302 does not set the write lock assignment identifier to 1, that is, the write lock assignment identifier is Still in the write lock unassigned state (in this embodiment of the invention, the write lock assignment identifier is 0 in this case), client A is in the write lock wait state, and interface card 302 A message is sent to client A to indicate that it is in a write lock wait state. Illustratively, the message may carry a write lock assignment identifier and a read lock assignment count, where the write lock assignment identifier is zero and the read lock assignment count is not zero. A non-zero read lock assignment count indicates that a read lock is assigned.

本発明のこの実施例では、インタフェースカード302は、読み取りロック割り当てカウントに問い合わせ、ロックサーバが読み取りロックを割り当てない(読み取りロック割り当てカウントは0である)と決定し、インタフェースカード302は、書き込みロック割り当て識別子を1に設定する。   In this embodiment of the invention, the interface card 302 queries the read lock allocation count and determines that the lock server does not allocate a read lock (the read lock allocation count is 0), and the interface card 302 allocates a write lock allocation. Set the identifier to 1.

クラスタ内で、ロックサーバが読み取りロックを割り当てている場合、すなわち、クライアントAが変更する必要がある共有リソースがクラスタ内の他のクライアントにより読み取られている場合、書き込み許可は、クライアントAに割り当てられることができず、すなわち、書き込みロックは、割り当てられることができない。したがって、クライアントAの識別子が書き込みロック要求キューのキュー先頭に書き込まれた場合、ロックサーバが読み取りロックを割り当てているか否かが決定される必要がある。インタフェースカード302が問い合わせにより、ロックサーバが読み取りロックを割り当てないことを取得した場合、書き込みロック要求キューのキュー先頭内のクライアントは、書き込みロックを取得し、すなわち、クライアントAは、書き込みロックを取得する。インタフェースカード302が問い合わせにより、ロックサーバが読み取りロックを割り当てていることを取得した場合、クライアントAは、書き込みロックを求めて待機する。   In a cluster, if the lock server assigns a read lock, that is, if a shared resource that client A needs to change is read by another client in the cluster, write permission is assigned to client A That is, a write lock cannot be assigned. Therefore, when the identifier of the client A is written at the head of the write lock request queue, it is necessary to determine whether or not the lock server has assigned the read lock. When the interface card 302 obtains an inquiry that the lock server does not allocate a read lock, the client in the head of the write lock request queue acquires the write lock, that is, the client A acquires the write lock. . If the interface card 302 obtains an inquiry from the lock server that it has assigned a read lock, the client A waits for a write lock.

インタフェースカード302が、書き込みロック要求キューのキュー先頭の、クライアントAにより送信された書き込みロック要求で搬送されたメモリアドレスに従って、クライアントAの識別子を書き込みロック要求キューのキュー先頭に書き込むことに失敗した場合、クライアントAの識別子が書き込まれることができるメモリアドレスを見つけるために、書き込みロック要求キューは、書き込みロック要求キューのキュー先頭から始まり順次に問い合わせされ、クライアントAの識別子は、書き込みロック要求キューに書き込まれる。書き込みロック要求キューのキュー先頭は、最初に書き込みロックを求めて申請したクライアントを記録し、1つの書き込みロックは、1つのみのクライアントに割り当てられることができる。したがって、書き込みロック要求キューのキュー先頭のクライアントが書き込みロックを取得している場合又は書き込みロックを求めて待機している場合、クライアントAの識別子は、書き込みロック要求キューのキュー先頭に書き込まれることに失敗する。   When the interface card 302 fails to write the identifier of client A to the head of the write lock request queue according to the memory address carried in the write lock request sent by client A at the head of the write lock request queue. In order to find the memory address where the identifier of client A can be written, the write lock request queue is queried sequentially starting from the top of the write lock request queue queue, and the identifier of client A is written to the write lock request queue It is. The queue head of the write lock request queue records the client that first applied for the write lock, and one write lock can be assigned to only one client. Therefore, if the client at the head of the write lock request queue has acquired a write lock or is waiting for a write lock, the identifier of client A will be written at the head of the queue of the write lock request queue. Fail.

本発明のこの実施例では、クライアントAの識別子が書き込みロック要求キューのキュー先頭に成功して書き込まれ、読み取りロックが割り当てられないことをメモリ301内の読み取りロック割り当てカウントが記録し、すなわち、クライアントAが書き込みロックを取得する例が使用される。これに基づいて、他の実施例では、ロックサーバのインタフェースカード302は、クライアントBにより送信された書き込みロック要求を受信し、クライアントBにより送信された書き込みロック要求は、クライアントBの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送する。クライアントAの識別子が書き込みロック要求キューのキュー先頭に書き込まれているため、インタフェースカード302は、クライアントBの識別子を書き込みロック要求キューのキュー先頭に書き込むことに失敗する。任意選択で、インタフェースカード302は、クライアントBの識別子が書き込みロック要求キューのキュー先頭に書き込まれることに失敗したことを示すためのメッセージをクライアントBに送信する。インタフェースカード302は、クライアントBの識別子を書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに書き込み、すなわち、図7に示すように、書き込みロック要求キューのキュー先頭から始まり、クライアントBの書き込みロック要求は、書き込みロック要求キューの第2の位置にある。クライアントBの識別子を書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに書き込む具体的な方式については、クライアントAの識別子を書き込みロック要求キューに書き込む前述の説明に参照が行われてもよく、詳細はここでは説明しない。任意選択で、インタフェースカード302は、クライアントの識別子が書き込まれることができる、書き込みロック要求キューのキュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスを求めて書き込みロック要求キューに問い合わせ、クライアントの識別子が書き込まれることができるメモリアドレスをクライアントBに通知するための通知をクライアントBに送信する。任意選択で、クライアントの識別子が書き込まれることができるメモリアドレスは、クライアントの識別子が書き込まれることができる、書き込みロック要求キューのキュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスでもよい。   In this embodiment of the invention, the read lock allocation count in memory 301 records that the identifier of client A was successfully written to the head of the write lock request queue and no read lock was allocated, i.e., the client An example where A acquires a write lock is used. Based on this, in another embodiment, the lock server interface card 302 receives the write lock request sent by client B, and the write lock request sent by client B includes the client B identifier and the write lock. Carries the memory address at the head of the request queue. Since the identifier of client A is written at the head of the write lock request queue, the interface card 302 fails to write the identifier of client B at the head of the write lock request queue. Optionally, interface card 302 sends a message to client B to indicate that client B's identifier failed to be written to the head of the write lock request queue. The interface card 302 writes the identifier of client B to the next memory address following the head of the write lock request queue, that is, starting from the head of the write lock request queue, as shown in FIG. The request is in the second position of the write lock request queue. For a specific method of writing the identifier of client B to the next memory address following the queue head of the write lock request queue, reference may be made to the above description of writing the identifier of client A to the write lock request queue, Details are not described here. Optionally, the interface card 302 queries the write lock request queue for a memory address in the sequence from the head of the write lock request queue to the end of the queue where the client identifier can be written, and identifies the client Is sent to client B to notify client B of the memory address where can be written. Optionally, the memory address to which the client identifier can be written may be the first memory address in the sequence from the top of the write lock request queue to the end of the queue to which the client identifier can be written. .

この場合、メモリ301内の書き込みロック割り当て識別子は、書き込みロック割り当て済状態に設定され(本発明のこの実施例では1に設定され)、すなわち、書き込みロックは、書き込みロック要求キューのキュー先頭内のクライアントAに割り当てられ、クライアントBは、書き込みロック待機状態にある。インタフェースカード302は、もはやメモリ301内の書き込みロック割り当て識別子を変更しない。任意選択で、インタフェースカード302は、クライアントBが書き込みロック待機状態にあることを示すためのメッセージをクライアントBに送信する。具体的に、メッセージは、クライアントBの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスを搬送してもよい。クライアントBは、メモリアドレスに従って、クライアントBが書き込みロック待機状態にあると決定する。したがって、ロックサーバは、この場合のクラスタ内のクライアントの書き込みロック要求状態を決定し、すなわち、書き込みロックは、クライアントAに割り当てられ、クライアントBは、書き込みロック待機状態にある。書き込みロックがクライアントAに割り当てられることはまた、クライアントAが書き込みロックを保持し、クライアントAが書き込みロックの保持者であることとも呼ばれる。任意選択で、クライアントによりロックサーバに送信された書き込みロック要求は、書き込みロックリース、すなわち、クライアントにより保持される書き込みロックの有効時間を更に搬送してもよく、有効時間が失効したときにクライアントがリースを更新していない場合、書き込みロックは自動的に無効になる。   In this case, the write lock assignment identifier in memory 301 is set to the write lock assigned state (set to 1 in this embodiment of the invention), ie, the write lock is in the queue head of the write lock request queue. Assigned to client A, client B is in a write lock wait state. The interface card 302 no longer changes the write lock assignment identifier in the memory 301. Optionally, interface card 302 sends a message to client B indicating that client B is in a write lock wait state. Specifically, the message may carry a memory address in the write lock request queue where the identifier of client B is stored. Client B determines that client B is in a write lock wait state according to the memory address. Therefore, the lock server determines the write lock request state of the client in the cluster in this case, that is, the write lock is assigned to the client A, and the client B is in the write lock waiting state. Assigning a write lock to client A is also referred to as client A holding the write lock and client A being the write lock holder. Optionally, the write lock request sent by the client to the lock server may further carry a write lock lease, i.e., the validity time of the write lock held by the client, when the client expires. If the lease has not been renewed, the write lock is automatically disabled.

図8に示すように、本発明の実施例は、クライアントにより読み取りロックを要求する処理を更に提供する。本発明のこの実施例では、ロックサーバは、読み取りロック要求キューを更に含む。本発明のこの実施例における書き込みロック要求キューについての説明については、前述の説明に参照が行われてもよい。読み取りロック要求キューは、読み取りロック待機状態にあるか、或いは読み取りロックを取得するクライアントの識別子を記憶するために使用される。したがって、ロックサーバは、読み取りロック要求キューに従ってクラスタ内のクライアントの読み取りロック申請状態を決定してもよい。割り当てられている読み取りロックの数量は、読み取りロック割り当てカウントに従って決定されてもよい。   As shown in FIG. 8, an embodiment of the present invention further provides a process for requesting a read lock by a client. In this embodiment of the invention, the lock server further includes a read lock request queue. For a description of the write lock request queue in this embodiment of the invention, reference may be made to the above description. The read lock request queue is used to store an identifier of a client that is in a read lock waiting state or acquires a read lock. Therefore, the lock server may determine the read lock application status of the clients in the cluster according to the read lock request queue. The quantity of read locks allocated may be determined according to the read lock allocation count.

ステップ801:インタフェースカード302は、クライアントCにより送信された読み取りロック要求を受信する。   Step 801: The interface card 302 receives the read lock request transmitted by the client C.

本発明のこの実施例では、メモリ301は、読み取りロック要求キューを更に含み、クラスタは、クライアントCを更に含む。ロックサーバのインタフェースカード302は、クライアントCにより送信された読み取りロック要求を受信し、読み取りロック要求は、クライアントCの識別子と読み取りロック要求キューのキュー先頭のメモリアドレスとを搬送する。   In this embodiment of the invention, memory 301 further includes a read lock request queue and the cluster further includes client C. The lock server interface card 302 receives the read lock request sent by the client C, and the read lock request carries the identifier of the client C and the memory address at the head of the queue of the read lock request queue.

ステップ802:インタフェースカード302は、クライアントCの識別子を読み取りロック要求キューに書き込む。   Step 802: The interface card 302 writes the identifier of the client C into the read lock request queue.

具体的に、インタフェースカード302は、クライアントCの識別子を読み取りロック要求キューのキュー先頭のメモリアドレスに書き込み、クラスタ内の他のクライアントの識別子が読み取りロック要求キューのキュー先頭のメモリアドレスに書き込まれない場合、図9に示すように、クライアントCの識別子は、読み取りロック要求キューのキュー先頭のメモリアドレスに成功して書き込まれる。任意選択で、インタフェースカード302は、クライアントCの識別子が読み取りロック要求キューのキュー先頭のメモリアドレスに書き込まれたことを示すメッセージをクライアントAに送信する。   Specifically, the interface card 302 writes the identifier of the client C to the memory address at the head of the read lock request queue, and the identifier of the other client in the cluster is not written to the memory address at the head of the queue of the read lock request queue. In this case, as shown in FIG. 9, the identifier of the client C is successfully written to the memory address at the head of the read lock request queue. Optionally, the interface card 302 sends a message to client A indicating that the identifier of client C has been written to the memory address at the head of the read lock request queue.

クラスタ内の他のクライアントの識別子が読み取りロック要求キューのキュー先頭のメモリアドレスに書き込まれた場合、クライアントCの識別子は、読み取りロック要求キューのキュー先頭のメモリアドレスに書き込まれることに失敗する。任意選択で、インタフェースカード302は、クライアントCの識別子が読み取りロック要求キューのキュー先頭に書き込まれることに失敗したことを示すためのメッセージをクライアントCに送信する。この場合、クライアントCは、読み取りロック要求をインタフェースカード302に再び送信してもよく、読み取りロック要求は、クライアントCの識別子と読み取りロック要求キューのキュー先頭に続く次のメモリアドレスとを搬送し、インタフェースカード302は、クライアントCの識別子を読み取りロック要求キューのキュー先頭に続く次のメモリアドレスに書き込む。クライアントCの識別子が読み取りロック要求キューのキュー先頭に続く次のメモリアドレスに書き込まれることに失敗した場合、前述の操作が繰り返され、クライアントCの識別子が読み取りロック要求キュー内のメモリアドレスに成功して書き込まれるまで、クライアントCは、読み取りロック要求をインタフェースカード302に再び送信し、読み取りロック要求は、クライアントCの識別子と読み取りロック要求キューのキュー先頭から始まる第3のメモリアドレスとを搬送し、すなわち、読み取りロック要求は、クライアントCの識別子が書き込まれることができるメモリアドレスを搬送する。クライアントCは、読み取りロック要求を周期的に送信してもよく、或いはクライアントCの識別子が読み取りロック要求キューに書き込まれることに失敗したことを示すメッセージを受信した場合に読み取りロック要求を送信してもよい。任意選択で、インタフェースカード302は、クライアントの識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスを求めて読み取りロック要求キューに問い合わせ、クライアントの識別子が書き込まれることができるメモリアドレスをクライアントCに通知するための通知をクライアントCに送信する。任意選択で、クライアントの識別子が書き込まれることができるメモリアドレスは、クライアントの識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスである。   When the identifier of another client in the cluster is written to the memory address at the head of the read lock request queue, the identifier of client C fails to be written to the memory address at the head of the queue of the read lock request queue. Optionally, interface card 302 sends a message to client C to indicate that client C's identifier failed to be written to the head of the read lock request queue. In this case, client C may send a read lock request again to interface card 302, which carries the identifier of client C and the next memory address following the head of the read lock request queue, The interface card 302 reads the identifier of the client C and writes it to the next memory address following the head of the read lock request queue. If Client C's identifier fails to be written to the next memory address following the head of the read lock request queue, the above operation is repeated and Client C's identifier succeeds at the memory address in the read lock request queue. Client C sends the read lock request back to interface card 302 until the read lock request carries the identifier of client C and the third memory address starting from the top of the queue of the read lock request queue; That is, the read lock request carries a memory address where the identifier of client C can be written. Client C may send a read lock request periodically, or send a read lock request when it receives a message indicating that Client C's identifier failed to be written to the read lock request queue. Also good. Optionally, the interface card 302 queries the read lock request queue for a memory address in the sequence from the head of the read lock request queue to the end of the queue to which the client identifier can be written, and identifies the client Is sent to client C to notify client C of the memory address where it can be written. Optionally, the memory address to which the client identifier can be written is the first memory address in the sequence from the top of the read lock request queue to the end of the queue to which the client identifier can be written. .

任意選択で、インタフェースカード302がクライアントCの識別子を読み取りロック要求キューのキュー先頭に書き込むことに失敗した場合、インタフェースカード302は、読み取りロック要求キューのキュー先頭から始まり、クライアントCの識別子が書き込まれることができるメモリアドレスを求めて読み取りロック要求キューに順次に問い合わせ、クライアントCの識別子を読み取りロック要求キューに書き込み、インタフェースカード302は、クライアントCの識別子が読み取りロック要求キュー内のメモリアドレスに書き込まれたことを示すためのメッセージをクライアントCに送信する。任意選択で、メッセージは、クライアントCの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送してもよい。   Optionally, if the interface card 302 fails to write the identifier of client C to the head of the read lock request queue, the interface card 302 starts with the head of the queue of the read lock request queue and the client C identifier is written. Sequentially query the read lock request queue for a memory address, write the client C identifier to the read lock request queue, the interface card 302 writes the client C identifier to the memory address in the read lock request queue A message is sent to client C to indicate this. Optionally, the message may carry a memory address in the read lock request queue where the identifier of client C is stored.

クラスタ内の共有リソースは、複数のクライアントにより同時に読み取られてもよい。したがって、読み取りロックは、複数のクライアントにより共有されてもよく、すなわち、複数のクライアントは、読み取りロックを同時に保持してもよい。この場合、複数のクライアントは、同時に読み取りロックの保持者である。したがって、読み取りロック割り当てカウントにおいて、ロックサーバが読み取りロックを割り当てているか否かを示すためにカウントが使用されてもよい。例えば、読み取りロック割り当てカウントが0である場合、これは、ロックサーバが読み取りロックを割り当てないことを示す。ロックサーバが読み取りロックを割り当てる毎に、読み取りロック割り当てカウントは1だけ増加する。したがって、ロックサーバが書き込みロックを割り当てない(本発明のこの実施例では、書き込みロック割り当て識別子が0である)場合、クライアントは、読み取りロックを取得してもよい。   Shared resources in the cluster may be read simultaneously by multiple clients. Thus, a read lock may be shared by multiple clients, i.e., multiple clients may simultaneously hold a read lock. In this case, multiple clients are read lock holders at the same time. Thus, in the read lock assignment count, the count may be used to indicate whether the lock server has assigned a read lock. For example, if the read lock allocation count is 0, this indicates that the lock server does not allocate a read lock. Each time the lock server allocates a read lock, the read lock allocation count is incremented by one. Thus, if the lock server does not assign a write lock (in this embodiment of the invention, the write lock assignment identifier is 0), the client may acquire a read lock.

ステップ803:読み取りロック割り当てカウントを増加させる。   Step 803: Increase the read lock allocation count.

任意選択で、インタフェースカード302がクライアントCの識別子を読み取りロック要求キューに書き込んだ場合、インタフェースカード302は、読み取りロック割り当てカウントを1だけ増加させ、インタフェースカード302は、書き込みロック割り当て識別子と読み取りロック割り当てカウントとをクライアントCに返信する。さらに、書き込みロック割り当て識別子が1である場合、クライアントCは、読み取りロック割り当てカウント変更要求をインタフェースカード302に送信し、インタフェースカード302は、読み取りロック割り当てカウント変更要求に従って読み取りロック割り当てカウントを1だけ減少させる。   Optionally, if interface card 302 writes the identifier of client C to the read lock request queue, interface card 302 increments the read lock assignment count by 1, and interface card 302 adds the write lock assignment identifier and the read lock assignment. Returns the count to client C. Further, when the write lock allocation identifier is 1, client C sends a read lock allocation count change request to the interface card 302, and the interface card 302 decrements the read lock allocation count by 1 according to the read lock allocation count change request. Let

任意選択で、インタフェースカード302がクライアントCの識別子を読み取りロック要求キューに書き込んだ場合、且つ書き込みロック割り当て識別子が1である場合、インタフェースカード302は、クライアントCが読み取りロック待機状態にあることを示すためのメッセージをクライアントCに送信する。具体的に、メッセージは、書き込みロック割り当て識別子を搬送してもよく、クライアントCは、書き込みロック割り当て識別子に従ってクライアントCが読み取りロック待機状態にあると決定する。   Optionally, if interface card 302 writes client C's identifier to the read lock request queue and the write lock assignment identifier is 1, then interface card 302 indicates that client C is in a read lock wait state. Message to client C. Specifically, the message may carry a write lock assignment identifier, and client C determines that client C is in a read lock wait state according to the write lock assignment identifier.

前述の説明から、インタフェースカード302によりクライアントCに送信されたメッセージが、クライアントCが読み取りロックを取得するか、或いは読み取りロック待機状態にあることを示すかに拘わらず、これは、クライアントCの識別子が読み取りロック要求キュー内のメモリアドレスに書き込まれたことを示すことが認識され得る。   From the foregoing description, whether the message sent to client C by interface card 302 indicates that client C has acquired a read lock or is in a read lock wait state, this is the identifier of client C. Can be recognized indicating that has been written to a memory address in the read lock request queue.

任意選択で、インタフェースカード302がクライアントCの識別子を読み取りロック要求キューに書き込んだ場合、且つ書き込みロック割り当て識別子が0である場合、インタフェースカード302は、読み取りロック割り当てカウントを1だけ増加させる。さらに、インタフェースカード302は、クライアントCが読み取りロックを取得することを示すためのメッセージをクライアントCに送信する。例えば、メッセージは、書き込みロック割り当て識別子を搬送し、書き込みロック割り当て識別子は0である。任意選択で、ロックサーバが書き込みロックを割り当てている(書き込みロック割り当て識別子が1である)場合、読み取りロック要求キュー内のクライアントは、読み取りロック待機状態にあり、読み取りロック割り当てカウントは増加しない。さらに、インタフェースカード302は、クライアントCが読み取りロック待機状態にあることを示すためのメッセージをクライアントCに送信する。例えば、メッセージは、書き込みロック割り当て識別子を搬送し、書き込みロック割り当て識別子は1である。   Optionally, if interface card 302 writes client C's identifier to the read lock request queue and the write lock assignment identifier is 0, interface card 302 increases the read lock assignment count by one. Further, the interface card 302 transmits a message to the client C to indicate that the client C acquires the read lock. For example, the message carries a write lock assignment identifier, and the write lock assignment identifier is zero. Optionally, if the lock server has assigned a write lock (write lock assignment identifier is 1), the client in the read lock request queue is in a read lock wait state and the read lock assignment count does not increase. Further, the interface card 302 transmits a message to the client C to indicate that the client C is in the read lock standby state. For example, the message carries a write lock assignment identifier, and the write lock assignment identifier is 1.

本発明のこの実施例では、インタフェースカード302がクライアントCの識別子を読み取りロック要求キューのキュー先頭のメモリアドレスに成功して書き込む例が使用される。この場合、クラスタ内のクライアントは、読み取りロックを取得しないか、或いは読み取りロック待機状態になく、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを記録する(書き込みロック割り当て識別子は1である)。この場合、クライアントCは、読み取りロック待機状態にある。任意選択で、クライアントCによりロックサーバに送信された読み取りロック要求は、読み取りロックリース、すなわち、クライアントCにより保持される読み取りロックの有効時間を更に搬送してもよく、有効時間が失効したときにクライアントCがリースを更新していない場合、読み取りロックは自動的に無効になる。   In this embodiment of the present invention, an example is used in which the interface card 302 reads the identifier of client C and successfully writes it to the memory address at the head of the lock request queue. In this case, the client in the cluster does not acquire the read lock or is not in the read lock waiting state, and the write lock assignment identifier records that the write lock is assigned (the write lock assignment identifier is 1). ). In this case, the client C is in a read lock waiting state. Optionally, a read lock request sent by client C to the lock server may further carry a read lock lease, i.e., the validity time of the read lock held by client C, when the validity time expires. If client C has not renewed the lease, the read lock is automatically disabled.

本発明のこの実施例では、クラスタは、クライアントDを更に含み、ロックサーバのインタフェースカード302は、クライアントDにより送信された読み取りロック要求を受信する。クライアントDにより送信された読み取りロック要求は、クライアントDの識別子と読み取りロック要求キューのキュー先頭のメモリアドレスとを搬送する。クライアントCの識別子は、読み取りロック要求キューのキュー先頭のメモリアドレスに記憶されているため、図10に示すように、インタフェースカード302は、クライアントDの識別子を読み取りロック要求キューのキュー先頭に続く次のメモリアドレスに書き込む。具体的な解決策については、クライアントCの識別子を読み取りロック要求キューに書き込む説明に参照が行われてもよく、詳細はここでは説明しない。クライアントAは書き込みロックを保持する(書き込みロック割り当て識別子は1である)ため、クライアントCは、読み取りロック待機状態にあり、クライアントDもまた、読み取りロック待機状態にある。   In this embodiment of the invention, the cluster further includes client D, and the lock server interface card 302 receives the read lock request sent by client D. The read lock request sent by client D carries the identifier of client D and the memory address at the head of the read lock request queue. Since the identifier of client C is stored at the memory address at the head of the read lock request queue, as shown in FIG. 10, the interface card 302 follows the identifier of client D following the head of the queue of the read lock request queue. Write to the memory address. For specific solutions, reference may be made to the description of writing the identifier of client C to the read lock request queue, and details are not described here. Since client A holds a write lock (write lock assignment identifier is 1), client C is in a read lock wait state and client D is also in a read lock wait state.

本発明のこの実施例では、クライアントは、RDMAプロトコルを使用することにより、ロック要求をロックサーバのインタフェースカード302に送信し、ロックサーバのメモリ301は、クラスタ内のクライアントのロック状態を記録する。ロックサーバは、全てのロックの状態を記録し、ロックサーバは、正常状態又は故障状態のようなクライアントの状態を決定することができる。したがって、ロックを保持するクライアントが故障になった場合、故障したクライアントにより保持されたロックは、適時に解放されてもよい。任意選択で、ロックサーバがクライアントの状態を決定することは、ロックサーバとクライアントとの間のハートビート検出を用いてクライアントの状態を決定することを含む。任意選択で、ハートビート検出は、クライアントの状態を決定するためにクライアントの間で実行され、正常状態のクライアントは、故障したクライアントについての情報をロックサーバに報告する。ロックサーバは、故障したクライアントについての情報に従って、故障したクライアントにより保持されたロックを解放する。任意選択で、故障したクライアントが書き込みロックを保持する場合、ロックサーバのインタフェースカード302は、メモリ301内の書き込みロック割り当て識別子を0に設定し、書き込みロック要求キューのキュー先頭から故障したクライアントの識別子を削除する。故障したクライアントが読み取りロックを保持する場合、ロックサーバのインタフェースカード302は、メモリ301内の読み取りロック割り当てカウントを1だけ減少させ、読み取りロック要求キューから故障したクライアントの識別子を削除する。任意選択で、他の正常なクライアントもまた、故障したクライアントにより保持されたロックを解放するために、ロックサーバの前述の操作を実行してもよい。例えば、他の正常なクライアントは、ロック解放要求をインタフェースカード302に送信し、ロック解放要求は、故障したクライアントの識別子を搬送し、インタフェースカード302は、前述のロック解放操作を実行する。任意選択で、ロックサーバのインタフェースカード302が故障したクライアントにより保持された書き込みロックを解放した後に、インタフェースカード302は、通知を他のクライアントに送信し、通知は、故障したクライアントにより保持された書き込みロックが解放されていることを示す。同様に、ロックサーバのインタフェースカード302が故障したクライアントにより保持された読み取りロックを解放した後に、インタフェースカード302は、通知を他のクライアントに送信し、通知は、故障したクライアントにより保持された読み取りロックが解放されていることを示す。   In this embodiment of the invention, the client uses the RDMA protocol to send a lock request to the lock server interface card 302, and the lock server memory 301 records the lock status of the clients in the cluster. The lock server records the state of all locks, and the lock server can determine the state of the client such as normal or faulty. Thus, if a client holding a lock fails, the lock held by the failed client may be released in a timely manner. Optionally, the lock server determining the state of the client includes determining the client state using heartbeat detection between the lock server and the client. Optionally, heartbeat detection is performed between clients to determine the state of the client, and the normal client reports information about the failed client to the lock server. The lock server releases the lock held by the failed client according to the information about the failed client. Optionally, if the failed client holds a write lock, the lock server interface card 302 sets the write lock assignment identifier in memory 301 to 0 and the identifier of the failed client from the head of the write lock request queue. Is deleted. If the failed client holds a read lock, the lock server interface card 302 decrements the read lock allocation count in the memory 301 by 1 and deletes the failed client identifier from the read lock request queue. Optionally, other normal clients may also perform the aforementioned operations on the lock server to release the lock held by the failed client. For example, another normal client sends a lock release request to the interface card 302, and the lock release request carries the identifier of the failed client, and the interface card 302 performs the aforementioned lock release operation. Optionally, after the lock server interface card 302 releases the write lock held by the failed client, the interface card 302 sends a notification to the other client and the notification is written by the failed client. Indicates that the lock has been released. Similarly, after the lock server interface card 302 releases the read lock held by the failed client, the interface card 302 sends a notification to the other clients, and the notification is read lock held by the failed client. Indicates that has been released.

本発明のこの実施例では、クライアントAは、書き込みロックを保持し、書き込みロックを解放する操作が更に含まれる。クライアントAは、書き込みロック解放要求をインタフェースカード302に送信し、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送する。任意選択で、インタフェースカード302は、書き込みロック要求キューのキュー先頭のメモリアドレスからクライアントAの識別子を削除し、インタフェースカード302は、書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定する(すなわち、1から0に変更する)。任意選択で、インタフェースカード302は、書き込みロック要求キューのキュー先頭のメモリアドレスからクライアントAの識別子を削除し、インタフェースカード302は、クライアントAの識別子が削除されたことをクライアントAに通知し、クライアントAは、書き込みロック割り当て識別子変更要求をインタフェースカード302に送信し、インタフェースカード302は、書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定する(すなわち、1から0に変更する)。   In this embodiment of the invention, client A further includes operations to hold the write lock and release the write lock. The client A transmits a write lock release request to the interface card 302, and the write lock release request carries the memory address at the head of the queue of the write lock request queue. Optionally, the interface card 302 deletes the identifier of client A from the memory address at the head of the write lock request queue, and the interface card 302 sets the write lock assignment identifier to the write lock unassigned state (ie, 1 Change from 0 to 0). Optionally, the interface card 302 deletes the identifier of client A from the memory address at the head of the write lock request queue, and the interface card 302 notifies client A that the identifier of client A has been deleted. A transmits a write lock assignment identifier change request to the interface card 302, and the interface card 302 sets the write lock assignment identifier to a write lock unassigned state (ie, changes from 1 to 0).

任意選択で、クライアントAが書き込みロックを解放するときに、この方法は、クライアントAにより、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するステップであり、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスを搬送するステップと、インタフェースカード302により、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアントBの識別子を求めて問い合わせるステップと、インタフェースカード302により、書き込みロック要求問い合わせ応答メッセージをクライアントAに送信するステップであり、書き込みロック要求問い合わせ応答メッセージは、クライアントBの識別子を搬送するステップと、クライアントAにより、書き込みロック要求問い合わせ応答メッセージで搬送されたクライアントBの識別子に従って、クライアントBに対して書き込みロックを求めて申請するように命令するための通知をクライアントBに送信するステップと、クライアントBにより、クライアントAの通知に従って書き込みロック要求をインタフェースカード302に送信するステップとを更に含む。詳細については、クライアントにより書き込みロック要求を送信する前述の説明に参照が行われてもよく、詳細はここでは説明しない。したがって、書き込みロックは、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューのキュー先頭から始まるシーケンスに従って申請されてもよい。任意選択で、クライアントAが書き込みロックを解放した後に、ロックサーバのインタフェースカード302は、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアントBの識別子を求めて問い合わせ、インタフェースカード302は、クライアントBに対して書き込みロックを求めて申請するように命令するための通知をクライアントBに送信し、クライアントBは、インタフェースカード302により送信された通知に従って書き込みロック要求メッセージをインタフェースカード302に送信する。   Optionally, when client A releases the write lock, this method is a step in which client A sends a write lock request inquiry message to interface card 302, where the write lock request inquiry message is stored in the write lock request queue. Carrying the next memory address following the head of the queue, inquiring the interface card 302 for the identifier of client B stored at the next memory address following the head of the write lock request queue, and the interface card 302, a write lock request inquiry response message is sent to client A. The write lock request inquiry response message carries the identifier of client B; The client A sends a notification to the client B to instruct the client B to apply for a write lock according to the identifier of the client B carried in the write lock request inquiry response message; To sending a write lock request to the interface card 302 according to the notification of the client A. For details, reference may be made to the above description of sending a write lock request by a client, and details are not described here. Therefore, the write lock may be applied according to a sequence starting from the top of the write lock request queue of the client in the write lock standby state. Optionally, after client A releases the write lock, the lock server interface card 302 queries and asks for the identifier of client B stored at the next memory address following the head of the write lock request queue. 302 sends a notification to client B to instruct client B to apply for a write lock, and client B sends a write lock request message to interface card 302 in accordance with the notification sent by interface card 302. Send to.

任意選択で、前述の実施例では、クライアントによりインタフェースカード302に送信された書き込みロック要求は、クライアントの書き込みロック優先度を更に搬送し、書き込みロック要求キューは、クライアントの識別子と書き込みロック優先度を記憶し、クライアントAが書き込みロックを解放した場合、この方法は、クライアントAにより、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するステップと、インタフェースカード302により、書き込みロック要求問い合わせ応答メッセージをクライアントAに送信するステップであり、問い合わせ応答メッセージは、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された識別子及び書き込みロック優先度を搬送するステップとを更に含む。本発明のこの実施例では、クライアントBが最高の書き込みロック優先度を有することが例として使用される。クライアントAは、書き込みロック要求問い合わせ応答メッセージに従って最高の書き込みロック優先度を有するクライアントを決定し、クライアントAは、クライアントBに対して書き込みロック要求をインタフェースカード302に送信するように命令するための通知をクライアントBに送信する。詳細については、クライアントにより書き込みロック要求を送信する前述の説明に参照が行われてもよく、詳細はここでは説明しない。したがって、書き込みロックは、書き込みロック待機状態にあるクライアントの書き込みロック優先度に従って申請されてもよい。任意選択で、前述の実施例では、クライアントによりインタフェースカード302に送信された書き込みロック要求は、クライアントの書き込みロック優先度を更に搬送し、書き込みロック要求キューは、クライアントの識別子と書き込みロック優先度とを記憶する。クライアントAが書き込みロックを解放した後に、ロックサーバのインタフェースカード302は、最高の書き込みロック優先度を有するクライアント、例えば、クライアントBを決定するために、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された書き込みロック優先度に問い合わせる。インタフェースカード302は、クライアントBに対して書き込みロックを求めて申請するように命令するための通知をクライアントBに送信し、クライアントBは、インタフェースカード302により送信された通知に従って書き込みロック要求メッセージをインタフェースカード302に送信する。   Optionally, in the foregoing embodiment, the write lock request sent by the client to the interface card 302 further carries the client's write lock priority, and the write lock request queue includes the client's identifier and write lock priority. If the client A releases the write lock, the method sends a write lock request inquiry message to the interface card 302 by the client A, and sends a write lock request inquiry response message to the client A by the interface card 302. The inquiry response message includes a step of conveying the identifier and the write lock priority recorded in the write lock request queue of the client in the write lock standby state. To include. In this embodiment of the invention, it is used as an example that client B has the highest write lock priority. Client A determines the client with the highest write lock priority according to the write lock request inquiry response message, and client A notifies client B to send a write lock request to interface card 302 To client B. For details, reference may be made to the above description of sending a write lock request by a client, and details are not described here. Therefore, the write lock may be applied according to the write lock priority of the client in the write lock standby state. Optionally, in the foregoing embodiment, the write lock request sent by the client to the interface card 302 further carries the client's write lock priority, and the write lock request queue includes the client identifier and the write lock priority. Remember. After client A releases the write lock, the lock server interface card 302 requests the write lock request of the client in the write lock wait state to determine the client with the highest write lock priority, eg, client B. Queries the write lock priority recorded in the queue. The interface card 302 sends a notification to the client B to instruct the client B to apply for a write lock, and the client B interfaces the write lock request message according to the notification sent by the interface card 302. Send to card 302.

任意選択で、クライアントAが書き込みロックを解放するときに、複数のクライアントが書き込みロック待機状態にあることを書き込みロック要求キューが記録する場合、この方法は、クライアントAにより、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するステップと、インタフェースカード302により、書き込みロック待機状態にあるクライアントを決定するために、書き込みロック要求キューに問い合わせるステップと、インタフェースカード302により、書き込みロック要求問い合わせ応答メッセージをクライアントAに送信するステップであり、書き込みロック要求問い合わせ応答メッセージは、書き込みロック待機状態にあるクライアントの識別子を搬送するステップと、クライアントAにより、書き込みロック要求問い合わせ応答メッセージに従って、クライアントに対して書き込みロック要求をインタフェースカード302に送信するように命令するための通知を、書き込みロック待機状態にあるクライアント内の少なくとも2つのクライアントに送信するステップとを更に含む。したがって、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントは、書き込みロックを取得するための同じ機会を有する。任意選択で、クライアントAが書き込みロックを解放するときに、この方法は、インタフェースカード302により、書き込みロック待機状態にあるクライアントを決定するために、書き込みロック要求キューに問い合わせるステップと、インタフェースカード302により、少なくとも2つのクライアントに対して書き込みロック要求をインタフェースカード302に送信するように命令するための通知を、書き込みロック待機状態にあるクライアント内の少なくとも2つのクライアントに送信するステップとを更に含む。   Optionally, if the write lock request queue records that multiple clients are in the write lock wait state when client A releases the write lock, this method causes client A to send a write lock request query message. Sending to the interface card 302; querying the write lock request queue to determine a client in the write lock waiting state by the interface card 302; and sending a write lock request inquiry response message to the client A by the interface card 302. The write lock request inquiry response message includes a step of conveying an identifier of a client in the write lock standby state and a write lock by the client A. Sending a notification to instruct the client to send a write lock request to the interface card 302 to at least two of the clients in the write lock wait state according to the write request inquiry response message. In addition. Thus, clients in the write lock wait state recorded in the write lock request queue have the same opportunity to acquire a write lock. Optionally, when client A releases the write lock, the method includes: querying the write lock request queue by interface card 302 to determine which client is in the write lock wait state; Further comprising: sending a notification to instruct at least two clients to send a write lock request to the interface card 302 to at least two clients in the write lock waiting state.

任意選択で、クライアントAが書き込みロックを解放するときに、読み取りロック要求キューがクライアントC及びDの識別子を記憶する場合、すなわち、クライアントC及びDが読み取りロック待機状態にある場合、この方法は、クライアントAにより、読み取りロック要求問い合わせメッセージをインタフェースカード302に送信するステップと、インタフェースカード302により、読み取りロック待機状態にあるクライアントC及びDを決定するために、読み取りロック要求キューに問い合わせるステップと、インタフェースカード302により、読み取りロック要求問い合わせ応答メッセージをクライアントAに送信するステップであり、読み取りロック要求問い合わせ応答メッセージは、読み取りロック待機状態にあるクライアントC及びDの識別子を搬送するステップとを更に含む。任意選択で、クライアントAは、読み取りロック要求問い合わせ応答メッセージに従って、クライアントC及びDに対して読み取りロックを求めて申請するように命令するための通知を、読み取りロック待機状態にあるクライアントC及びDに送信し、クライアントC及びDは、読み取りロック割り当てカウント変更要求をインタフェースカード302に別々に送信し、インタフェースカード302は、クライアントC及びDの読み取りロック割り当てカウント変更要求に従って読み取りロック割り当てカウントを増加させる。任意選択で、クライアントAは、読み取りロック要求問い合わせ応答メッセージに従って、通知を読み取りロック待機状態にあるクライアントCに送信し、これにより、クライアントCが読み取りロックを求めて申請する。クライアントCは、読み取りロック割り当てカウント変更要求をインタフェースカード302に送信し、インタフェースカード302は、クライアントCの読み取りロック割り当て変更要求に従って読み取りロック割り当てカウントを増加させる。したがって、読み取りロック要求キューに記録された、読み取りロック待機状態にある全てのクライアントは、読み取りロックを取得してもよい。任意選択で、クライアントAが書き込みロックを解放するときに、この方法は、インタフェースカード302により、読み取りロック待機状態にあるクライアントC及びDを決定するために、読み取りロック要求キューに問い合わせるステップと、インタフェースカード302により、クライアントC及びDに対して読み取りロックを求めて申請するように命令するための通知を、読み取りロック待機状態にあるクライアントC及びDに送信し、これにより、クライアントC及びDが読み取りロック割り当てカウント変更要求をインタフェースカード302に別々に送信するステップと、インタフェースカード302により、クライアントC及びDの読み取りロック割り当てカウント変更要求に従って読み取りロック割り当てカウントを増加させるステップとを更に含む。   Optionally, when client A releases the write lock, if the read lock request queue stores the identifiers of clients C and D, i.e., clients C and D are in the read lock wait state, Sending a read lock request inquiry message to the interface card 302 by the client A; querying the read lock request queue to determine the clients C and D in the read lock waiting state by the interface card 302; This is a step of sending a read lock request inquiry response message to the client A by the card 302. The read lock request inquiry response message carries the identifiers of the clients C and D in the read lock standby state. Further comprising the step of. Optionally, client A sends a notification to client C and D in the read lock waiting state to instruct client C and D to apply for a read lock according to the read lock request inquiry response message. The clients C and D transmit the read lock allocation count change request separately to the interface card 302, and the interface card 302 increases the read lock allocation count according to the client C and D read lock allocation count change request. Optionally, client A sends a notification to client C in read lock wait state according to the read lock request inquiry response message, whereby client C applies for a read lock. The client C transmits a read lock allocation count change request to the interface card 302, and the interface card 302 increases the read lock allocation count according to the client C read lock allocation change request. Therefore, all clients in the read lock waiting state recorded in the read lock request queue may acquire the read lock. Optionally, when client A releases the write lock, the method includes interfacing the read lock request queue with interface card 302 to determine clients C and D that are in the read lock wait state; The card 302 sends a notification to the clients C and D in the read lock waiting state to instruct the clients C and D to apply for a read lock, so that the clients C and D can read. The method further includes separately transmitting a lock allocation count change request to the interface card 302 and increasing the read lock allocation count by the interface card 302 according to the read lock allocation count change request of the clients C and D.

任意選択で、クライアントAが書き込みロックを解放するときに、この方法は、クライアントAにより、書き込みロック解放要求をインタフェースカード302に送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカード302により、書き込みロック要求キューのキュー先頭のメモリアドレスからクライアントAの識別子を削除するステップとを具体的に含む。クライアントAは、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信し、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスを搬送する。インタフェースカード302は、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアントBの識別子を求めて問い合わせる。インタフェースカード302は、書き込みロック要求問い合わせ応答メッセージをクライアントAに送信し、書き込みロック要求問い合わせ応答メッセージは、クライアントBの識別子を搬送する。クライアントAは、書き込みロック要求問い合わせ応答メッセージに従って書き込みロック占有要求をインタフェースカード302に送信し、書き込みロック占有要求は、書き込みロック要求キューのキュー先頭のメモリアドレスとクライアントBの識別子とを搬送する。インタフェースカード302は、クライアントBの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込む。インタフェースカード302は、クライアントBの識別子が書き込みロック要求キューのキュー先頭のメモリアドレスに書き込まれたことを示すための書き込みロック占有要求応答メッセージをクライアントAに送信する。クライアントAは、書き込みロック占有要求応答メッセージに従って、クライアントBが書き込みロックを取得することを示すための通知をクライアントBに送信する。したがって、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶された、書き込みロックを求めて待機しているクライアントが書き込みロックを取得することができることが確保され得る。任意選択で、クライアントAが書き込みロックを解放するときに、この方法は、インタフェースカード302により、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスに記憶されたクライアントBの識別子を問い合わせるステップと、インタフェースカード302により、クライアントBの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むステップと、インタフェースカード302により、クライアントBが書き込みロックを取得することを示すための通知をクライアントBに送信するステップとを更に含む。   Optionally, when client A releases the write lock, this method is a step in which client A sends a write lock release request to interface card 302, where the write lock release request is queued in the write lock request queue. Specifically, the method includes a step of transporting the top memory address and a step of deleting the identifier of the client A from the top memory address of the write lock request queue by the interface card 302. Client A transmits a write lock request inquiry message to interface card 302, and the write lock request inquiry message carries the next memory address following the head of the write lock request queue. The interface card 302 inquires for the identifier of the client B stored at the next memory address following the head of the write lock request queue. The interface card 302 transmits a write lock request inquiry response message to the client A, and the write lock request inquiry response message carries the identifier of the client B. The client A transmits a write lock occupation request to the interface card 302 according to the write lock request inquiry response message, and the write lock occupation request carries the memory address at the head of the queue of the write lock request queue and the identifier of the client B. The interface card 302 writes the identifier of the client B into the memory address at the head of the write lock request queue. The interface card 302 transmits a write lock occupation request response message to the client A to indicate that the identifier of the client B has been written to the memory address at the head of the write lock request queue. The client A sends a notification to the client B indicating that the client B acquires the write lock according to the write lock occupation request response message. Therefore, it can be ensured that the client waiting for the write lock stored at the next memory address following the head of the write lock request queue can acquire the write lock. Optionally, when client A releases the write lock, the method queries interface card 302 for the identifier of client B stored at the next memory address following the top of the write lock request queue queue; The interface card 302 sends the client B identifier to the memory address at the head of the write lock request queue, and the interface card 302 sends a notification to the client B indicating that the client B acquires the write lock. A step.

任意選択で、クライアントによりインタフェースカード302に送信された書き込みロック要求は、クライアントの書き込みロック優先度を更に搬送し、書き込みロック要求キューは、クライアントの識別子と書き込みロック優先度を記憶し、クライアントAが書き込みロックを解放するときに、この方法は、クライアントAにより、書き込みロック解放要求をインタフェースカード302に送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカード302により、書き込みロック要求キューのキュー先頭のメモリアドレスからクライアントAの識別子を削除するステップとを具体的に含む。クライアントAは、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信し、インタフェースカード302は、書き込みロック要求問い合わせ応答メッセージをクライアントAに送信し、書き込みロック要求応答メッセージは、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された識別子と書き込みロック優先度とを搬送する。本発明のこの実施例では、クライアントBが最高の書き込みロック優先度を有することが例として使用される。クライアントAは、書き込みロック要求問い合わせ応答メッセージに従って書き込みロック占有要求をインタフェースカード302に送信し、書き込みロック占有要求は、書き込みロック要求キューのキュー先頭のメモリアドレスとクライアントBの識別子とを搬送する。インタフェースカード302は、クライアントBの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込む。インタフェースカード302は、クライアントBの識別子が書き込みロック要求キューのキュー先頭のメモリアドレスに書き込まれたことを示すための書き込みロック占有要求応答メッセージをクライアントAに送信する。クライアントAは、書き込みロック占有要求応答メッセージに従って、クライアントBが書き込みロックを取得することを示すための通知をクライアントBに送信する。任意選択で、クライアントによりインタフェースカード302に送信された書き込みロック要求は、クライアントの書き込みロック優先度を更に搬送し、書き込みロック要求キューは、クライアントの識別子と書き込みロック優先度とを記憶する。クライアントAが書き込みロックを解放するときに、インタフェースカード302は、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された識別子及び書き込みロック優先度を求めて問い合わせる。本発明のこの実施例では、クライアントBが最高の書き込みロック優先度を有することが例として使用される。インタフェースカード302は、クライアントBの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込み、インタフェースカード302は、クライアントBが書き込みロックを取得することを示すための通知をクライアントBに送信する。   Optionally, the write lock request sent by the client to the interface card 302 further carries the client's write lock priority, the write lock request queue stores the client's identifier and write lock priority, and client A When releasing the write lock, this method is a step in which the client A sends a write lock release request to the interface card 302, and the write lock release request carries the memory address at the head of the queue of the write lock request queue. A step of deleting the identifier of the client A from the memory address at the head of the write lock request queue by the interface card 302. The client A sends a write lock request inquiry message to the interface card 302, the interface card 302 sends a write lock request inquiry response message to the client A, and the write lock request response message is sent to the client in the write lock standby state. The identifier and the write lock priority recorded in the write lock request queue are conveyed. In this embodiment of the invention, it is used as an example that client B has the highest write lock priority. The client A transmits a write lock occupation request to the interface card 302 according to the write lock request inquiry response message, and the write lock occupation request carries the memory address at the head of the queue of the write lock request queue and the identifier of the client B. The interface card 302 writes the identifier of the client B into the memory address at the head of the write lock request queue. The interface card 302 transmits a write lock occupation request response message to the client A to indicate that the identifier of the client B has been written to the memory address at the head of the write lock request queue. The client A sends a notification to the client B indicating that the client B acquires the write lock according to the write lock occupation request response message. Optionally, the write lock request sent by the client to interface card 302 further carries the client's write lock priority, and the write lock request queue stores the client's identifier and write lock priority. When the client A releases the write lock, the interface card 302 inquires for the identifier and the write lock priority recorded in the write lock request queue of the client in the write lock standby state. In this embodiment of the invention, it is used as an example that client B has the highest write lock priority. The interface card 302 writes the identifier of the client B to the memory address at the head of the write lock request queue, and the interface card 302 transmits a notification to the client B indicating that the client B acquires the write lock.

任意選択で、書き込みロック要求キューは、書き込みロック待機状態にある複数のクライアントの識別子を記録し、クライアントAが書き込みロックを解放するときに、この方法は、クライアントAにより、書き込みロック解放要求をインタフェースカード302に送信するステップであり、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送するステップと、インタフェースカード302により、書き込みロック要求キューのキュー先頭のメモリアドレスからクライアントAの識別子を削除するステップとを具体的に含む。クライアントAは、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信する。インタフェースカード302は、書き込みロック要求問い合わせ応答メッセージをクライアントAに送信し、書き込みロック要求応答メッセージは、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された識別子を搬送する。クライアントAは、書き込みロック要求問い合わせ応答メッセージに従ってクライアント、例えば、クライアントBをランダムに決定し、書き込みロック占有要求をインタフェースカード302に送信し、書き込みロック占有要求は、書き込みロック要求キューのキュー先頭のメモリアドレスとクライアントBの識別子とを搬送する。インタフェースカード302は、クライアントBの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込む。インタフェースカード302は、クライアントBの識別子が書き込みロック要求キューのキュー先頭のメモリアドレスに書き込まれたことを示すための書き込みロック占有要求応答メッセージをクライアントAに送信する。クライアントAは、書き込みロック占有要求応答メッセージに従って、クライアントBが書き込みロックを取得することを示すための通知をクライアントBに送信する。任意選択で、クライアントAが書き込みロックを解放するときに、この方法は、インタフェースカード302により、書き込みロック待機状態にあるクライアントの、書き込みロック要求キューに記録された識別子を求めて問い合わせるステップと、インタフェースカード302により、書き込みロック待機状態にあるクライアントからクライアント、例えば、クライアントBをランダムに決定するステップと、インタフェースカード302により、クライアントBの識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むステップと、インタフェースカード302により、クライアントBが書き込みロックを取得することを示す通知をクライアントBに送信するステップとを更に含む。   Optionally, the write lock request queue records the identifiers of multiple clients in the write lock wait state, and when client A releases the write lock, this method allows client A to interface the write lock release request. The write lock release request is transmitted to the card 302. The interface of the write lock request queue is sent from the memory address at the head of the queue of the write lock request queue by the interface card 302. Specifically deleting the identifier. Client A transmits a write lock request inquiry message to interface card 302. The interface card 302 transmits a write lock request inquiry response message to the client A, and the write lock request response message carries the identifier recorded in the write lock request queue of the client in the write lock standby state. The client A randomly determines a client, for example, the client B, according to the write lock request inquiry response message, and sends a write lock occupation request to the interface card 302. The write lock occupation request is the memory at the head of the queue of the write lock request queue. Carries the address and client B identifier. The interface card 302 writes the identifier of the client B into the memory address at the head of the write lock request queue. The interface card 302 transmits a write lock occupation request response message to the client A to indicate that the identifier of the client B has been written to the memory address at the head of the write lock request queue. The client A sends a notification to the client B indicating that the client B acquires the write lock according to the write lock occupation request response message. Optionally, when client A releases the write lock, the method interrogates the interface card 302 for an identifier recorded in the write lock request queue of the client that is in the write lock wait state; A step of randomly determining a client, for example, client B, from a client in a write lock standby state by means of the card 302, and a step of writing the identifier of the client B to the memory address at the head of the write lock request queue by means of the interface card 302; , Further comprising: sending a notification to the client B indicating that the client B acquires the write lock by the interface card 302.

任意選択で、クライアントAが書き込みロックを解放するときに、読み取りロック要求キューがクライアントC及びDの識別子を記憶する場合、この方法は、クライアントAにより、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するステップと、インタフェースカード302により、読み取りロック待機状態にあるクライアントC及びDを決定するために、読み取りロック要求キューに問い合わせるステップと、インタフェースカード302により、読み取りロック要求問い合わせ応答メッセージをクライアントAに送信するステップであり、読み取りロック要求問い合わせ応答メッセージは、読み取りロック待機状態にあるクライアントC及びDの識別子を搬送するステップと、クライアントAにより、読み取りロック要求問い合わせ応答メッセージに従って読み取りロック割り当てカウント変更要求をインタフェースカード302に送信するステップであり、読み取りロック割り当てカウント変更要求は、割り当てられた読み取りロックの数量を搬送するステップとを更に含む。任意選択で、割り当てられた読み取りロックの数量は2であり、インタフェースカード302は、割り当てられた読み取りロックの数量に従って読み取りロック割り当てカウントを増加させる。インタフェースカード302は、読み取りロック割り当てカウント変更要求応答をクライアントAに返信し、クライアントAは、通知をクライアントC及びDに送信する。任意選択で、割り当てられた読み取りロックの数量は1であり、インタフェースカード302は、割り当てられた読み取りロックの数量に従って読み取りロック割り当てカウントを増加させる。インタフェースカード302は、読み取りロック割り当てカウント変更要求応答をクライアントAに返信し、クライアントAは、クライアントC又はDに対して読み取りロックを取得するように命令する。任意選択で、クライアントAが書き込みロックを解放するときに、読み取りロック要求キューがクライアントC及びDの識別子を記憶する場合、この方法は、インタフェースカード302により、読み取りロック待機状態にあるクライアントC及びDを決定するために、読み取りロック要求キューに問い合わせるステップと、インタフェースカード302により、クライアントC及びDに割り当てられた読み取りロックの数量に従って読み取りロック割り当てカウントを増加させるステップと、インタフェースカード302により、読み取りロックが取得されたことを示すための通知をクライアントC又はDに送信するステップとを更に含む。   Optionally, when client A releases the write lock, if the read lock request queue stores the identifiers of clients C and D, this method causes client A to send a write lock request query message to interface card 302. A step of querying the read lock request queue to determine the clients C and D in the read lock waiting state by the interface card 302, and a read lock request query response message to the client A by the interface card 302. The read lock request inquiry response message includes the steps of conveying the identifiers of the clients C and D in the read lock standby state, and the client A makes a read lock request inquiry. Sending a read lock allocation count change request to the interface card 302 according to the response message, wherein the read lock assignment count change request further comprises conveying an assigned number of read locks. Optionally, the number of read locks assigned is 2, and the interface card 302 increases the read lock assignment count according to the number of read locks assigned. The interface card 302 returns a read lock allocation count change request response to the client A, and the client A transmits a notification to the clients C and D. Optionally, the assigned read lock quantity is 1, and the interface card 302 increases the read lock assignment count according to the assigned read lock quantity. The interface card 302 returns a read lock allocation count change request response to the client A, and the client A instructs the client C or D to acquire the read lock. Optionally, when client A releases the write lock, if the read lock request queue stores the identifiers of clients C and D, the method causes interface card 302 to cause client C and D in the read lock wait state. Querying the read lock request queue to determine a read lock allocation count according to the number of read locks assigned to clients C and D by interface card 302, and read lock by interface card 302. Further sending a notification to the client C or D to indicate that has been acquired.

任意選択で、読み取りロックを取得するクライアントC及びDが読み取りロックを解放するときに、クライアントCは、読み取りロック解放要求をインタフェースカード302に送信し、読み取りロック解放要求は、クライアントCの識別子と、クライアントCの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスとを搬送する。インタフェースカード302は、読み取りロック要求キューからクライアントCの識別子を削除し、読み取りロック割り当てカウントを減少させる。同様に、クライアントDは、読み取りロックを解放し、前述の操作を参照して、読み取りロック割り当てカウントが0まで減少する。クライアントDは、書き込みロック要求問い合わせメッセージをインタフェースカード302に更に送信し、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送する。インタフェースカード302は、書き込みロック要求問い合わせ応答メッセージをクライアントDに返信し、書き込みロック要求問い合わせ応答メッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶されたクライアントの識別子を搬送し、クライアントDは、クライアントの識別子に従って、クライアントに対して書き込みロックを求めてインタフェースカード302に申請するように命令する。クライアントが書き込みロックを求めてインタフェースカード302に申請することは、クライアントにより、書き込みロック割り当て識別子変更要求をインタフェースカード302に送信し、インタフェースカード302により、書き込みロック割り当て識別子を1に設定することを含む。任意選択で、読み取りロックを取得するクライアントC及びDが読み取りロックを解放するときに、インタフェースカード302は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶されたクライアントの識別子を問い合わせ、インタフェースカード302は、クライアントの識別子に従って、クライアントに対して書き込みロックを求めてインタフェースカード302に申請するように命令する。   Optionally, when clients C and D that acquire the read lock release the read lock, client C sends a read lock release request to the interface card 302, and the read lock release request includes the identifier of client C, It carries the memory address in the read lock request queue where the identifier of client C is stored. The interface card 302 deletes the identifier of client C from the read lock request queue and decreases the read lock allocation count. Similarly, client D releases the read lock, and with reference to the operation described above, the read lock allocation count is reduced to zero. The client D further transmits a write lock request inquiry message to the interface card 302, and the write lock request inquiry message carries the memory address at the head of the write lock request queue. The interface card 302 returns a write lock request inquiry response message to the client D, and the write lock request inquiry response message carries the identifier of the client stored in the memory address at the head of the write lock request queue. The client is instructed to apply to the interface card 302 for a write lock according to the client identifier. Applying to the interface card 302 for a write lock by the client includes sending a write lock assignment identifier change request to the interface card 302 by the client and setting the write lock assignment identifier to 1 by the interface card 302. . Optionally, when the clients C and D that acquire the read lock release the read lock, the interface card 302 queries the client identifier stored in the memory address at the head of the queue of the write lock request queue, and the interface card 302 Instructs the client to apply to the interface card 302 for a write lock according to the client identifier.

任意選択で、読み取りロックを取得するクライアントC及びDが読み取りロックを解放するときに、クライアントCは、読み取りロック解放要求をインタフェースカード302に送信し、読み取りロック解放要求は、クライアントCの識別子と、クライアントCの識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスとを搬送する。インタフェースカード302は、読み取りロック要求キューからクライアントCの識別子を削除し、読み取りロック割り当てカウントを減少させる。同様に、クライアントDは、読み取りロックを解放し、前述の操作を参照して、読み取りロック割り当てカウントが0まで減少する。クライアントDは、書き込みロック割り当て識別子変更要求をインタフェースカード302に送信する。インタフェースカード302は、書き込みロック割り当て識別子を書き込みロック割り当て済状態になるように変更する(本発明のこの実施例では1に設定する)。インタフェースカード302は、書き込みロック割り当て識別子変更要求応答をクライアントDに返信し、書き込みロック割り当て識別子変更要求応答は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶されたクライアントの識別子を搬送する。クライアントDは、クライアントの識別子に従って、クライアントに対して書き込みロックを取得するように命令する。任意選択で、読み取りロックを取得するクライアントC及びDが読み取りロックを解放するときに、インタフェースカード302は、書き込みロック割り当て識別子を書き込みロック割り当て済状態になるように変更し(本発明のこの実施例では1に設定し)、インタフェースカード302は、クライアントに対して書き込みロックを取得するように命令するために、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶されたクライアントの識別子を問い合わせる。   Optionally, when clients C and D that acquire the read lock release the read lock, client C sends a read lock release request to the interface card 302, and the read lock release request includes the identifier of client C, It carries the memory address in the read lock request queue where the identifier of client C is stored. The interface card 302 deletes the identifier of client C from the read lock request queue and decreases the read lock allocation count. Similarly, client D releases the read lock, and with reference to the operation described above, the read lock allocation count is reduced to zero. The client D transmits a write lock assignment identifier change request to the interface card 302. The interface card 302 changes the write lock assignment identifier to be in the write lock assigned state (set to 1 in this embodiment of the invention). The interface card 302 returns a write lock assignment identifier change request response to the client D, and the write lock assignment identifier change request response carries the identifier of the client stored in the memory address at the head of the write lock request queue. Client D instructs the client to acquire a write lock according to the identifier of the client. Optionally, when clients C and D that acquire the read lock release the read lock, the interface card 302 changes the write lock assignment identifier to be in the write lock assigned state (this embodiment of the invention). In order to instruct the client to acquire a write lock, the interface card 302 inquires the identifier of the client stored in the memory address at the head of the write lock request queue.

任意選択で、本発明のこの実施例は、読み取りロック回収ポリシーを更に提供する。本発明のこの実施例では、クラスタは、クライアントEを更に含む。クライアントEが書き込みロック要求をインタフェースカード302に送信した場合、ここで、具体的な操作については、クライアントBにより書き込みロック要求を送信する前述の操作に参照が行われてもよく、クライアントEは、書き込みロック待機状態にあり、クライアントC及びDは、読み取りロックを保持し、クライアントEは、クライアントC及びDに対して読み取りロックを解放するように命令する。クライアントCは、読み取りロック解放要求をインタフェースカード302に送信する。具体的な操作については、クライアントCにより読み取りロックを解放する前述の操作に参照が行われてもよい。クライアントDは、読み取りロック解放要求をインタフェースカード302に送信する。具体的な操作については、クライアントCにより読み取りロックを解放する前述の操作に参照が行われてもよい。クライアントC及びDにより保持された読み取りロックが解放された後に、メモリ301内の読み取りロック割り当てカウントは0である。任意選択で、インタフェースカード302は、クライアントEに対して書き込みロックを求めて申請するように命令するためのメッセージをクライアントEに送信する。任意選択で、インタフェースカード302は、クライアントDの読み取りロックが成功して解放されたことを示すためのメッセージをクライアントDに送信し、クライアントDは、クライアントEに対して書き込みロックを求めて申請するように命令するためのメッセージをクライアントEに送信する。   Optionally, this embodiment of the present invention further provides a read lock recovery policy. In this embodiment of the invention, the cluster further includes client E. When the client E sends a write lock request to the interface card 302, here, for the specific operation, reference may be made to the above-described operation of sending the write lock request by the client B. In a write lock wait state, clients C and D hold a read lock, and client E instructs clients C and D to release the read lock. Client C sends a read lock release request to interface card 302. For a specific operation, reference may be made to the above-described operation for releasing the read lock by the client C. Client D sends a read lock release request to interface card 302. For a specific operation, reference may be made to the above-described operation for releasing the read lock by the client C. After the read lock held by clients C and D is released, the read lock allocation count in memory 301 is zero. Optionally, the interface card 302 sends a message to the client E to instruct the client E to apply for a write lock. Optionally, interface card 302 sends a message to client D indicating that client D's read lock has been successfully released, and client D requests client E for a write lock. A message is sent to client E to instruct

本発明の前述の実施例では、クライアントが毎回1つの読み取りロックを求めて申請する例が説明のために使用されている。クライアント読み取りロック申請の間に、クライアントが複数の読み取りロックを求めて申請した場合、インタフェースカード302は、申請された読み取りロックの数量に従ってメモリ301内の読み取りロック割り当てカウントを増加させ、複数のクライアントの識別子は、読み取りロック要求キューに記録される。読み取りロック解放の間に、メモリ301内の読み取りロック割り当てカウントは、申請された読み取りロックの数量に従って減少し、複数のクライアントの識別子は、読み取りロック要求キューから削除される。クライアントは、RDMAプロトコルにおけるアトミック操作Compare-and-Swapを使用することにより、書き込みロック要求を送信してもよく、クライアントは、RDMAプロトコルにおけるアトミック操作Fetch-and-Addを使用することにより、読み取りロック要求を送信してもよい。   In the above-described embodiment of the present invention, an example where the client applies for one read lock each time is used for illustration. If during the client read lock application, the client applied for multiple read locks, the interface card 302 increases the read lock allocation count in the memory 301 according to the number of read locks requested and The identifier is recorded in the read lock request queue. During read lock release, the read lock allocation count in memory 301 decreases according to the number of read locks applied and multiple client identifiers are removed from the read lock request queue. The client may send a write lock request by using the atomic operation Compare-and-Swap in the RDMA protocol, and the client locks the read by using the atomic operation Fetch-and-Add in the RDMA protocol. A request may be sent.

本発明のこの実施例では、クライアントは、書き込みロック要求問い合わせメッセージ又は読み取りロック要求問い合わせメッセージのような問い合わせメッセージをインタフェースカード302に送信し、問い合わせメッセージは、書き込みロック要求キュー内のメモリアドレス又は読み取りロック要求キュー内のメモリアドレスのような複数の問い合わせ対象のメモリアドレスを一度に搬送してもよく、或いは問い合わせメッセージは、1つの問い合わせ対象のメモリアドレスを一度に搬送してもよく、問い合わせは、複数の問い合わせメッセージを使用することにより完了する。   In this embodiment of the invention, the client sends an inquiry message, such as a write lock request inquiry message or a read lock request inquiry message, to the interface card 302, where the inquiry message is a memory address or read lock in the write lock request queue. Multiple query target memory addresses, such as memory addresses in the request queue, may be carried at once, or the query message may carry one query target memory address at a time. It is completed by using the inquiry message.

本発明の実施例において提供されるクラスタ内のロック管理解決策によれば、クライアント1100が対応して提供される。図11に示すように、クライアント1100は、クラスタに適用され、クラスタ内の複数のクライアント内の第1のクライアントとして機能する。クラスタは、本発明の実施例に記載のロックサーバを更に含み、ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、書き込みロック要求キューと書き込みロック割り当て識別子と読み取りロック割り当てカウントとを記憶する。書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、クラスタ内のクライアントの識別子を記録するために使用され、書き込みロック割り当て識別子は、共有リソースのための書き込みロックが割り当てられたか否かを示すために使用され、読み取りロック割り当てカウントは、共有リソースのために割り当てられた読み取りロックの数量を示すために使用される。クライアント1100は、送信ユニット1101と受信ユニット1102とを含む。送信ユニット1101は、第1の書き込みロック要求をロックサーバのインタフェースカード302に送信するように構成され、第1の書き込みロック要求は、クライアント1100の識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送する。受信ユニット1102は、インタフェースカード302により送信された第1のメッセージを受信するように構成され、第1のメッセージは、インタフェースカード302がクライアント1100の識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むことを示し、クライアント1100が書き込みロックを取得するか、或いは書き込みロック待機状態にあることを示す。送信ユニット1101は、インタフェースカード302がクライアント1100の識別子を書き込みロック要求キューのキュー先頭のメモリアドレスに書き込むことに失敗したことを第1のメッセージが示す場合、第2の書き込みロック要求をインタフェースカード302に送信するように更に構成され、第2の書き込みロック要求は、クライアント1100の識別子と書き込みロック要求キュー内の第1のメモリアドレスとを搬送し、第1のメモリアドレスは、クライアント1100の識別子が書き込まれることができる、キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである。任意選択で、第1のメモリアドレスは、クライアント1100の識別子が書き込まれることができる、キュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスである。   According to the intra-cluster lock management solution provided in the embodiments of the present invention, a client 1100 is provided correspondingly. As shown in FIG. 11, the client 1100 is applied to the cluster and functions as a first client in a plurality of clients in the cluster. The cluster further includes a lock server described in an embodiment of the present invention, and the lock server includes an interface card 302 and a memory 301. The memory 301 includes a write lock request queue, a write lock allocation identifier, a read lock allocation count, and the like. Remember. The write lock request queue records the identifiers of clients in the cluster, including the identifiers of clients that are in a write lock wait state for shared resources and the identifiers of clients that acquire write locks for the same shared resource. The write lock allocation identifier is used to indicate whether a write lock for the shared resource has been allocated, and the read lock allocation count indicates the number of read locks allocated for the shared resource. Used for. The client 1100 includes a transmission unit 1101 and a reception unit 1102. The transmission unit 1101 is configured to transmit a first write lock request to the interface card 302 of the lock server, and the first write lock request includes an identifier of the client 1100 and a memory address at the head of the queue of the write lock request queue. Transport. The receiving unit 1102 is configured to receive the first message transmitted by the interface card 302, and the first message is sent to the memory address at the head of the queue of the write lock request queue by the interface card 302 writing the identifier of the client 1100. This indicates that the client 1100 has acquired a write lock or is in a write lock standby state. When the first message indicates that the interface card 302 failed to write the identifier of the client 1100 to the memory address at the head of the write lock request queue, the transmission unit 1101 sends the second write lock request to the interface card 302. And the second write lock request carries the identifier of the client 1100 and the first memory address in the write lock request queue, the first memory address being the identifier of the client 1100. A memory address in the sequence from the head of the queue to the end of the queue that can be written. Optionally, the first memory address is the first memory address in the sequence from the head of the queue to the end of the queue where the identifier of the client 1100 can be written.

本発明のこの実施例において提供される、図11に示すクライアント1100において、任意選択で、送信ユニット1101は、クライアント1100が書き込みロックを取得した後に、書き込みロック解放要求をインタフェースカード302に送信するように更に構成され、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送する。   In the client 1100 shown in FIG. 11 provided in this embodiment of the invention, optionally, the sending unit 1101 sends a write lock release request to the interface card 302 after the client 1100 has acquired a write lock. The write lock release request carries the memory address at the head of the write lock request queue.

本発明の他の実施例では、図11に示すクライアント1100は、クラスタに適用され、複数のクライアント内の第1のクライアントとして機能する。クラスタは、ロックサーバを更に含み、ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、読み取りロック要求キューと書き込みロック割り当て識別子とを記憶する。読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、クラスタ内にあるクライアントの識別子を記録するために使用され、書き込みロック割り当て識別子は、共有リソースのための書き込みロックが割り当てられたか否かを示すために使用される。送信ユニット1101は、第1の読み取りロック要求をインタフェースカード302に送信するように構成され、第1の読み取りロック要求は、クライアント1100の識別子と読み取りロック要求キュー内の第1のメモリアドレスとを搬送する。受信ユニット1102は、インタフェースカード302により送信された第1のメッセージを受信するように構成され、第1のメッセージは、書き込みロック割り当て識別子を搬送する。任意選択で、書き込みロックが割り当てられていることを書き込みロック割り当て識別子が示す場合、第1のメッセージは、クライアント1100が読み取りロック待機状態にあることを示す。任意選択で、書き込みロックが割り当てられないことを書き込みロック割り当て識別子が示す場合、第1のメッセージは、クライアント1100が読み取りロックを取得することを示す。任意選択で、複数のクライアントは、第2のクライアントを更に含み、第2のクライアントの識別子は、読み取りロック要求キューのキュー先頭のメモリアドレスに記憶される。この場合、読み取りロック要求キュー内の、第1の読み取りロック要求で搬送された第1のメモリアドレスは、クライアント1100の識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである。任意選択で、第1のメモリアドレスは、クライアント1100の識別子が書き込まれることができる、読み取りロック要求キューのキュー先頭からキュー末尾までのシーケンス内にある第1のメモリアドレスである。任意選択で、第1の読み取りロック要求をインタフェースカード302に送信する前に、送信ユニット1101は、第2の読み取りロック要求をインタフェースカード302に送信するように更に構成され、第2の読み取りロック要求は、クライアント1100の識別子と読み取りロック要求キューのキュー先頭のメモリアドレスとを搬送する。インタフェースカード302がクライアント1100の識別子を読み取りロック要求キューのキュー先頭のメモリアドレスに書き込むことに失敗した場合、受信ユニット1102は、インタフェースカード302により送信された第2のメッセージを受信するように更に構成され、第2のメッセージは、読み取りロック要求が失敗したことを示す。任意選択で、クライアント1100が読み取りロックを取得した場合、送信ユニット1102は、読み取りロック解放要求をインタフェースカード302に送信するように更に構成され、読み取りロック解放要求は、クライアント1100の識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送する。   In another embodiment of the present invention, the client 1100 shown in FIG. 11 is applied to a cluster and functions as a first client in a plurality of clients. The cluster further includes a lock server. The lock server includes an interface card 302 and a memory 301. The memory 301 stores a read lock request queue and a write lock assignment identifier. The read lock request queue is used to record the identifier of the client in the cluster that is in the read lock wait state for the same shared resource or that acquires the read lock, and the write lock assignment identifier is the shared resource Used to indicate whether a write lock for has been allocated. The sending unit 1101 is configured to send a first read lock request to the interface card 302, the first read lock request carrying an identifier of the client 1100 and a first memory address in the read lock request queue. To do. The receiving unit 1102 is configured to receive a first message sent by the interface card 302, the first message carrying a write lock assignment identifier. Optionally, if the write lock assignment identifier indicates that a write lock has been assigned, the first message indicates that the client 1100 is in a read lock wait state. Optionally, if the write lock assignment identifier indicates that the write lock is not assigned, the first message indicates that the client 1100 acquires the read lock. Optionally, the plurality of clients further includes a second client, and the identifier of the second client is stored in the memory address at the head of the read lock request queue. In this case, the first memory address carried by the first read lock request in the read lock request queue can be written with the identifier of the client 1100 from the head of the read lock request queue to the end of the queue. A memory address in the sequence. Optionally, the first memory address is the first memory address in the sequence from the top of the read lock request queue to the end of the queue where the identifier of the client 1100 can be written. Optionally, prior to sending the first read lock request to the interface card 302, the sending unit 1101 is further configured to send a second read lock request to the interface card 302, the second read lock request. Carries the identifier of the client 1100 and the memory address at the head of the read lock request queue. If the interface card 302 fails to read the identifier of the client 1100 and write it to the memory address at the head of the read lock request queue, the receiving unit 1102 is further configured to receive the second message sent by the interface card 302 And the second message indicates that the read lock request has failed. Optionally, if the client 1100 acquires a read lock, the sending unit 1102 is further configured to send a read lock release request to the interface card 302, where the read lock release request stores the identifier of the client 1100. , Carry the memory address in the read lock request queue.

本発明の他の実施例では、図11に示すクライアント1100は、クラスタに適用され、第1のクライアントとして機能し、クラスタは、ロックサーバと第2のクライアントとを更に含む。ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、書き込みロック要求キューと書き込みロック割り当て識別子とを記憶し、クライアント1100の識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック要求キューは、第2のクライアントの識別子を更に記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、クライアント1100は、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にある。送信ユニット1101は、書き込みロック解放要求をインタフェースカード302に送信するように構成され、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送し、インタフェースカード302が書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューからクライアント1100の識別子を削除した場合、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するように構成され、書き込みロック要求問い合わせメッセージは、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスを搬送する。受信ユニット1102は、インタフェースカード302により送信された書き込みロック要求問い合わせ応答メッセージを受信するように構成され、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送する。送信ユニット1101は、書き込みロック占有要求をインタフェースカード302に送信するように構成され、書き込みロック占有要求は、第2のクライアントの識別子と書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送する。受信ユニット1102は、インタフェースカード302により送信された書き込みロック占有要求応答を受信するように更に構成され、書き込みロック占有要求応答は、第2のクライアントの識別子が書き込みロック要求キューのキュー先頭のメモリアドレスに書き込まれることを示す。送信ユニット1101は、通知を第2のクライアントに送信するように更に構成され、通知は、第2のクライアントが書き込みロックを取得することを示す。任意選択で、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスである。任意選択で、書き込みロック要求キューは、第2のクライアントの書き込みロック優先度を更に記憶し、第2のクライアントの書き込みロック優先度は、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で最高である。   In another embodiment of the present invention, the client 1100 shown in FIG. 11 is applied to a cluster and functions as a first client, and the cluster further includes a lock server and a second client. The lock server includes an interface card 302 and a memory 301. The memory 301 stores a write lock request queue and a write lock assignment identifier, and the identifier of the client 1100 is stored in a memory address at the head of the queue of the write lock request queue. The write lock request queue further stores the identifier of the second client, the write lock assignment identifier indicates that a write lock is assigned, and the client 1100 acquires a write lock for the shared resource. The second client is in a write lock wait state for the shared resource. The transmission unit 1101 is configured to transmit a write lock release request to the interface card 302. The write lock release request carries the memory address at the head of the write lock request queue, and the interface card 302 receives the write lock request queue. When the identifier of the client 1100 is deleted from the write lock request queue according to the memory address at the head of the queue, the write lock request inquiry message is transmitted to the interface card 302, and the write lock request inquiry message is the identifier of the second client. Carries the memory address in the write lock request queue. The receiving unit 1102 is configured to receive the write lock request inquiry response message transmitted by the interface card 302, and the write lock request inquiry response message carries the identifier of the second client. The transmission unit 1101 is configured to transmit a write lock occupation request to the interface card 302, and the write lock occupation request carries the identifier of the second client and the memory address at the head of the queue of the write lock request queue. The receiving unit 1102 is further configured to receive a write lock occupancy request response sent by the interface card 302, wherein the write lock occupancy request response is a memory address at the head of the queue of the write lock request queue. To be written to. The sending unit 1101 is further configured to send a notification to the second client, the notification indicating that the second client acquires a write lock. Optionally, the memory address in the write lock request queue where the identifier of the second client is stored is the next memory address following the queue head of the write lock request queue. Optionally, the write lock request queue further stores the write lock priority of the second client, and the write lock priority of the second client is in a write lock wait state recorded in the write lock request queue. The best among clients.

本発明の他の実施例では、図11に示すクライアント1100は、クラスタに適用され、第1のクライアントとして機能し、クラスタは、ロックサーバと第2のクライアントとを更に含む。ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶する。クライアント1100の識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キューは、第2のクライアントの識別子を記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、読み取りロック割り当てカウントは0であり、クライアント1100は、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための読み取りロック待機状態にある。送信ユニット1101は、書き込みロック解放要求をインタフェースカード302に送信するように構成され、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送し、インタフェースカード302が書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューからクライアント1100の識別子を削除した場合、読み取りロック要求問い合わせメッセージをインタフェースカード302に送信するように構成される。受信ユニット1102は、インタフェースカード302により送信された読み取りロック要求問い合わせ応答メッセージを受信するように構成され、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送する。送信ユニット1101は、読み取りロック割り当てカウント変更要求をインタフェースカード302に送信するように更に構成され、これにより、第2のクライアントが読み取りロックを取得する。   In another embodiment of the present invention, the client 1100 shown in FIG. 11 is applied to a cluster and functions as a first client, and the cluster further includes a lock server and a second client. The lock server includes an interface card 302 and a memory 301. The memory 301 stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier. The identifier of the client 1100 is stored in the memory address at the head of the write lock request queue, the read lock request queue stores the identifier of the second client, and the write lock assignment identifier is assigned with the write lock. , The read lock allocation count is 0, the client 1100 acquires a write lock for the shared resource, and the second client is in a read lock wait state for the shared resource. The sending unit 1101 is configured to send a write lock release request to the interface card 302. The write lock release request carries the memory address at the head of the write lock request queue, and the interface card 302 receives the write lock assignment identifier. It is configured to send a read lock request inquiry message to the interface card 302 when the write lock request queue is set and the identifier of the client 1100 is deleted from the write lock request queue according to the memory address at the head of the write lock request queue. The The receiving unit 1102 is configured to receive the read lock request inquiry response message transmitted by the interface card 302, and the write lock request inquiry response message carries the identifier of the second client. The sending unit 1101 is further configured to send a read lock allocation count change request to the interface card 302, whereby the second client obtains the read lock.

本発明の他の実施例では、図11に示すクライアント1100は、クラスタに適用され、第1のクライアントとして機能し、クラスタは、ロックサーバと第2のクライアントとを更に含む。ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、書き込みロック要求キューと書き込みロック割り当て識別子とを記憶する。クライアント1100の識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック要求キューは、第2のクライアントの識別子を更に記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、クライアント1100は、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にある。送信ユニット1101は、書き込みロック解放要求をインタフェースカード302に送信するように構成され、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送し、インタフェースカード302が書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューからクライアント1100の識別子を削除した場合、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するように構成され、書き込みロック要求問い合わせメッセージは、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスを搬送する。受信ユニット1102は、インタフェースカード302により送信された書き込みロック要求問い合わせ応答メッセージを受信するように構成され、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送する。送信ユニット1101は、第2のクライアントの識別子に従って通知を第2のクライアントに送信し、通知は、第2のクライアントに対して書き込みロック要求をインタフェースカード302に送信するように命令するために使用される。任意選択で、第2のクライアントの識別子が記憶された、書き込みロック要求キュー内にあるメモリアドレスは、書き込みロック要求キューのキュー先頭に続く次のメモリアドレスである。任意選択で、書き込みロック要求キューは、第2のクライアントの書き込みロック優先度を更に記憶し、第2のクライアントの書き込みロック優先度は、書き込みロック要求キューに記録された、書き込みロック待機状態にあるクライアントの中で最高である。   In another embodiment of the present invention, the client 1100 shown in FIG. 11 is applied to a cluster and functions as a first client, and the cluster further includes a lock server and a second client. The lock server includes an interface card 302 and a memory 301. The memory 301 stores a write lock request queue and a write lock assignment identifier. The identifier of the client 1100 is stored in the memory address at the head of the write lock request queue, the write lock request queue further stores the identifier of the second client, and the write lock assignment identifier is assigned a write lock. The client 1100 acquires a write lock for the shared resource and the second client is in a write lock wait state for the shared resource. The sending unit 1101 is configured to send a write lock release request to the interface card 302. The write lock release request carries the memory address at the head of the write lock request queue, and the interface card 302 receives the write lock assignment identifier. It is configured to send a write lock request inquiry message to the interface card 302 when the write lock request queue is set and the identifier of the client 1100 is deleted from the write lock request queue according to the memory address at the head of the write lock request queue. The write lock request inquiry message carries a memory address in the write lock request queue in which the identifier of the second client is stored. The receiving unit 1102 is configured to receive the write lock request inquiry response message transmitted by the interface card 302, and the write lock request inquiry response message carries the identifier of the second client. The sending unit 1101 sends a notification to the second client according to the identifier of the second client, and the notification is used to instruct the second client to send a write lock request to the interface card 302. The Optionally, the memory address in the write lock request queue where the identifier of the second client is stored is the next memory address following the queue head of the write lock request queue. Optionally, the write lock request queue further stores the write lock priority of the second client, and the write lock priority of the second client is in a write lock wait state recorded in the write lock request queue. The best among clients.

本発明の他の実施例では、図11に示すクライアント1100は、クラスタに適用され、第1のクライアントとして機能し、クラスタは、ロックサーバと第2のクライアントとを更に含む。ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶する。クライアント1100の識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、読み取りロック要求キューは、第2のクライアントの識別子を記憶し、書き込みロック割り当て識別子は、書き込みロックが割り当てられていることを示し、読み取りロック割り当てカウントは0であり、クライアント1100は、共有リソースのための書き込みロックを取得し、第2のクライアントは、共有リソースのための読み取りロック待機状態にある。送信ユニット1101は、書き込みロック解放要求をインタフェースカード302に送信するように構成され、書き込みロック解放要求は、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送し、インタフェースカード302が書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、書き込みロック要求キューのキュー先頭のメモリアドレスに従って書き込みロック要求キューからクライアント1100の識別子を削除した場合、読み取りロック要求問い合わせメッセージをインタフェースカード302に送信するように構成される。受信ユニット1102は、インタフェースカード302により送信された読み取りロック要求問い合わせ応答メッセージを受信するように構成され、読み取りロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送する。送信ユニット1101は、第2のクライアントの識別子に従って通知を第2のクライアントに送信するように更に構成され、通知は、第2のクライアントに対して読み取りロックを求めて申請するように命令するために使用される。第2のクライアントは、通知に従って読み取りロック割り当てカウント変更要求をインタフェースカード302に送信する。インタフェースカード302は、第2のクライアントに割り当てられた読み取りロックの数量に従って読み取りロック割り当てカウントを増加させる。   In another embodiment of the present invention, the client 1100 shown in FIG. 11 is applied to a cluster and functions as a first client, and the cluster further includes a lock server and a second client. The lock server includes an interface card 302 and a memory 301. The memory 301 stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier. The identifier of the client 1100 is stored in the memory address at the head of the write lock request queue, the read lock request queue stores the identifier of the second client, and the write lock assignment identifier is assigned with the write lock. , The read lock allocation count is 0, the client 1100 acquires a write lock for the shared resource, and the second client is in a read lock wait state for the shared resource. The sending unit 1101 is configured to send a write lock release request to the interface card 302. The write lock release request carries the memory address at the head of the write lock request queue, and the interface card 302 receives the write lock assignment identifier. It is configured to send a read lock request inquiry message to the interface card 302 when the write lock request queue is set and the identifier of the client 1100 is deleted from the write lock request queue according to the memory address at the head of the write lock request queue. The The receiving unit 1102 is configured to receive a read lock request inquiry response message sent by the interface card 302, and the read lock request inquiry response message carries the identifier of the second client. The sending unit 1101 is further configured to send a notification to the second client according to the identifier of the second client, the notification instructing the second client to apply for a read lock. used. The second client transmits a read lock allocation count change request to the interface card 302 according to the notification. The interface card 302 increases the read lock assignment count according to the number of read locks assigned to the second client.

本発明の他の実施例では、図11に示すクライアント1100は、クラスタに適用され、第1のクライアントとして機能し、クラスタは、ロックサーバと第2のクライアントとを更に含む。ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶する。読み取りロック要求キューは、クライアント1100の識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、クライアント1100により取得された読み取りロックの数量であり、クライアント1100は、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にある。送信ユニット1101は、読み取りロック解放要求をインタフェースカード302に送信するように構成され、読み取りロック解放要求は、クライアント1100の識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送し、インタフェースカード302が読み取りロック割り当てカウントを0まで減少させ、クライアント1100の識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューからクライアント1100の識別子を削除した場合、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するように構成され、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送する。受信ユニット1102は、インタフェースカード302により送信された書き込みロック要求問い合わせ応答メッセージを受信するように構成され、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送する。送信ユニット1101は、第2のクライアントの識別子に従って通知を第2のクライアントに送信するように更に構成され、通知は、第2のクライアントに対して書き込みロックを求めて申請するように命令するために使用される。第2のクライアントは、通知に従って書き込みロック割り当て識別子変更要求をインタフェースカード302に送信する。インタフェースカード302は、書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定する。   In another embodiment of the present invention, the client 1100 shown in FIG. 11 is applied to a cluster and functions as a first client, and the cluster further includes a lock server and a second client. The lock server includes an interface card 302 and a memory 301. The memory 301 stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier. The read lock request queue stores the identifier of the client 1100, the identifier of the second client is stored in the memory address at the head of the queue of the write lock request queue, and the write lock assignment identifier indicates that no write lock is assigned. The read lock allocation count is the number of read locks acquired by the client 1100, the client 1100 acquires a read lock for the shared resource, and the second client waits for the write lock for the shared resource Is in a state. The sending unit 1101 is configured to send a read lock release request to the interface card 302, and the read lock release request carries a memory address in the read lock request queue where the identifier of the client 1100 is stored, and the interface If the card 302 decrements the read lock allocation count to 0 and deletes the client 1100 identifier from the read lock request queue according to the memory address in the read lock request queue where the client 1100 identifier is stored, the write lock request inquiry The message is configured to be transmitted to the interface card 302, and the write lock request inquiry message carries the memory address at the head of the write lock request queue. The receiving unit 1102 is configured to receive the write lock request inquiry response message transmitted by the interface card 302, and the write lock request inquiry response message carries the identifier of the second client. The sending unit 1101 is further configured to send a notification to the second client according to the identifier of the second client, wherein the notification is for instructing the second client to apply for a write lock. used. The second client transmits a write lock assignment identifier change request to the interface card 302 according to the notification. The interface card 302 sets the write lock assignment identifier to the write lock assigned state.

本発明の他の実施例では、図11に示すクライアント1100は、クラスタに適用され、第1のクライアントとして機能し、クラスタは、ロックサーバと第2のクライアントとを更に含む。ロックサーバは、インタフェースカード302とメモリ301とを含み、メモリ301は、書き込みロック要求キューと読み取りロック要求キューと読み取りロック割り当てカウントと書き込みロック割り当て識別子とを記憶する。読み取りロック要求キューは、クライアント1100の識別子を記憶し、第2のクライアントの識別子は、書き込みロック要求キューのキュー先頭のメモリアドレスに記憶され、書き込みロック割り当て識別子は、書き込みロックが割り当てられないことを示し、読み取りロック割り当てカウントは、クライアント1100により取得された読み取りロックの数量であり、クライアント1100は、共有リソースのための読み取りロックを取得し、第2のクライアントは、共有リソースのための書き込みロック待機状態にある。送信ユニット1101は、読み取りロック解放要求をインタフェースカード302に送信するように構成され、読み取りロック解放要求は、クライアント1100の識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスを搬送し、インタフェースカード302が読み取りロック割り当てカウントを0まで減少させ、クライアント1100の識別子が記憶された、読み取りロック要求キュー内にあるメモリアドレスに従って読み取りロック要求キューからクライアント1100の識別子を削除した場合、書き込みロック要求問い合わせメッセージをインタフェースカード302に送信するように構成され、書き込みロック要求問い合わせメッセージは、書き込みロック要求キューのキュー先頭のメモリアドレスを搬送する。受信ユニット1102は、インタフェースカード302により送信された書き込みロック要求問い合わせ応答メッセージを受信し、書き込みロック要求問い合わせ応答メッセージは、第2のクライアントの識別子を搬送する。送信ユニット1101は、書き込みロック割り当て識別子変更要求をインタフェースカード302に送信し、インタフェースカード302が書き込みロック割り当て識別子変更要求に従って書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定した場合、第2のクライアントの識別子に従って通知を第2のクライアントに送信するように更に構成され、通知は、第2のクライアントが書き込みロックを取得することを示す。   In another embodiment of the present invention, the client 1100 shown in FIG. 11 is applied to a cluster and functions as a first client, and the cluster further includes a lock server and a second client. The lock server includes an interface card 302 and a memory 301. The memory 301 stores a write lock request queue, a read lock request queue, a read lock allocation count, and a write lock allocation identifier. The read lock request queue stores the identifier of the client 1100, the identifier of the second client is stored in the memory address at the head of the queue of the write lock request queue, and the write lock assignment identifier indicates that no write lock is assigned. The read lock allocation count is the number of read locks acquired by the client 1100, the client 1100 acquires a read lock for the shared resource, and the second client waits for the write lock for the shared resource Is in a state. The sending unit 1101 is configured to send a read lock release request to the interface card 302, and the read lock release request carries a memory address in the read lock request queue where the identifier of the client 1100 is stored, and the interface If the card 302 decrements the read lock allocation count to 0 and deletes the client 1100 identifier from the read lock request queue according to the memory address in the read lock request queue where the client 1100 identifier is stored, the write lock request inquiry The message is configured to be transmitted to the interface card 302, and the write lock request inquiry message carries the memory address at the head of the write lock request queue. The receiving unit 1102 receives the write lock request inquiry response message transmitted by the interface card 302, and the write lock request inquiry response message carries the identifier of the second client. The transmission unit 1101 transmits a write lock assignment identifier change request to the interface card 302. When the interface card 302 sets the write lock assignment identifier to the write lock assigned state according to the write lock assignment identifier change request, the transmission unit 1101 It is further configured to send a notification to the second client according to the identifier, the notification indicating that the second client acquires a write lock.

本発明のこの実施例において提供されるクライアント1100により実現される機能については、前述の実施例におけるクライアントA、クライアントB、クライアントC及びクライアントDに対応する説明に参照が行われてもよい。クライアント1100により実現される効果については、前述の実施例における説明に参照が行われてもよい。   For functions implemented by the client 1100 provided in this embodiment of the present invention, reference may be made to the descriptions corresponding to Client A, Client B, Client C, and Client D in the previous embodiment. For the effects realized by the client 1100, reference may be made to the description in the foregoing embodiment.

図11に示すクライアント1100について、実現方式は、前述のユニットがクライアント1100に組み込まれることであり、前述のユニットは、クライアント1100のメモリにロードされてもよく、クライアント1100のCPUは、本発明の実施例の対応する実施例における機能を実現するために、メモリ内の命令を実行する。他の実現では、クライアント1100に含まれるユニットは、ハードウェアにより実現されてもよく、或いはソフトウェアとハードウェアとの組み合わせにより実現されてもよい。前述のユニットはまた、構造ユニットとも呼ばれる。   For the client 1100 shown in FIG. 11, the implementation method is that the above-mentioned unit is incorporated in the client 1100, and the above-mentioned unit may be loaded into the memory of the client 1100, and the CPU of the client 1100 In order to implement the functions of the corresponding embodiment of the embodiment, instructions in the memory are executed. In other implementations, the units included in the client 1100 may be implemented by hardware or may be implemented by a combination of software and hardware. The aforementioned units are also referred to as structural units.

本発明のこの実施例は、不揮発性コンピュータ読み取り可能記憶媒体及びコンピュータプログラムプロダクトを更に提供する。不揮発性コンピュータ読み取り可能記憶媒体及びコンピュータプログラムプロダクトに含まれるコンピュータ命令が図11に示すクライアント1100のメモリにロードされた場合、CPUは、本発明の前述の実施例における対応する機能を実現するように、メモリにロードされたコンピュータ命令を実行する。   This embodiment of the present invention further provides a non-volatile computer readable storage medium and a computer program product. When the computer instructions included in the non-volatile computer readable storage medium and the computer program product are loaded into the memory of the client 1100 shown in FIG. 11, the CPU realizes the corresponding function in the above-described embodiment of the present invention. Execute computer instructions loaded into memory.

本発明において提供される複数の実施例では、開示の装置及び方法は、他の方式で実現されてもよいことが認識されるべきである。例えば、記載の装置の実施例におけるユニット分割は、単なる論理的な機能分割であり、実際の実現では他の分割でもよい。例えば、複数のユニット又はコンポーネントは、組み合わされてもよく、或いは他のシステムに統合されてもよく、或いはいくつかの機能が無視されてもよく、或いは実行されなくてもよい。さらに、図示又は説明した相互結合若しくは直接結合又は通信接続は、いくつかのインタフェースを使用することにより実現されてもよい。装置又はユニットの間の間接結合又は通信接続は、電気的、機械的、或いは他の形式で実現されてもよい。   It should be appreciated that in the embodiments provided in the present invention, the disclosed apparatus and method may be implemented in other manners. For example, the unit division in the described apparatus embodiment is merely logical function division and may be other division in actual implementation. For example, multiple units or components may be combined or integrated into other systems, or some functions may be ignored or not performed. Furthermore, the mutual or direct coupling or communication connection shown or described may be realized by using several interfaces. Indirect coupling or communication connections between devices or units may be realized in electrical, mechanical or other forms.

別々の部分として記載したユニットは、物理的に分けられてもよく、或いは物理的に分けられなくてもよく、ユニットとして示す部分は、物理的なユニットでもよく、或いは物理的なユニットでなくてもよく、1つの位置に配置されてもよく、或いは複数のネットワークユニットに分散されてもよい。ユニットの一部又は全部は、実施例の解決策の目的を達成するための実際のニーズに従って選択されてもよい。   A unit described as a separate part may or may not be physically separated, and the part shown as a unit may be a physical unit or not a physical unit. Alternatively, they may be arranged at one location or distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the example solutions.

さらに、本発明の実施例における機能ユニットは、1つの処理ユニットに統合されてもよく、或いはユニットのそれぞれは、物理的に単独で存在してもよく、或いは2つ以上のユニットが1つのユニットに統合される。   Furthermore, the functional units in the embodiments of the present invention may be integrated into one processing unit, or each of the units may physically exist alone, or two or more units may be combined into one unit. Integrated into.

Claims (44)

クラスタ内のロック管理方法であり、前記クラスタは、複数のクライアントとロックサーバとを含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、書き込みロック要求キューと書き込みロック割り当て識別子と読み取りロック割り当てカウントとを記憶し、前記書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、前記クラスタ内のクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための前記書き込みロックが割り当てられたか否かを示すために使用され、前記読み取りロック割り当てカウントは、前記共有リソースのために割り当てられた読み取りロックの数量を示すために使用される方法であって、
前記インタフェースカードにより、前記複数のクライアント内の第1のクライアントにより送信された第1の書き込みロック要求を受信するステップであり、前記第1の書き込みロック要求は、前記第1のクライアントの識別子と前記書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送するステップと、
前記インタフェースカードにより、前記第1のクライアントの前記識別子を前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスに書き込み、前記インタフェースカードにより、読み取りロックが割り当てられているか否かを決定するために、前記読み取りロック割り当てカウントに問い合わせ、前記読み取りロックが割り当てられない場合、前記インタフェースカードにより、前記書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定し、前記インタフェースカードにより、前記第1のクライアントが前記書き込みロックを取得することを示すためのメッセージを前記第1のクライアントに送信するステップと、
前記読み取りロックが割り当てられている場合、前記インタフェースカードにより、第2のメッセージを前記第1のクライアントに送信するステップであり、前記第2のメッセージは、前記第1のクライアントが書き込みロック待機状態にあることを示すステップと
を含む方法。
A lock management method in a cluster, wherein the cluster includes a plurality of clients and a lock server, the lock server includes an interface card and a memory, and the memory includes a write lock request queue, a write lock allocation identifier, A read lock allocation count, and the write lock request queue includes an identifier of a client in a write lock wait state for a shared resource and an identifier of a client that acquires a write lock for the same shared resource, Used to record the identifier of the client in the cluster, the write lock assignment identifier is used to indicate whether the write lock for the shared resource has been assigned, and the read lock assignment count is , A method that is used to indicate the quantity of read lock allocated to the serial shared resource,
Receiving, by the interface card, a first write lock request sent by a first client of the plurality of clients, wherein the first write lock request includes an identifier of the first client and the first client Carrying the memory address at the head of the write lock request queue;
In order to write the identifier of the first client to the memory address at the head of the write lock request queue by the interface card, and to determine whether or not a read lock is allocated by the interface card, Query the read lock allocation count, and if the read lock is not allocated, the interface card sets the write lock allocation identifier to the write lock allocated state, and the interface card causes the first client to write the write lock Sending a message to the first client indicating acquisition of a lock;
If the read lock has been assigned, the interface card sends a second message to the first client, the second message being in a write lock wait state by the first client. A method comprising the steps of indicating.
前記インタフェースカードにより、前記複数のクライアント内の第2のクライアントにより送信された第2の書き込みロック要求を受信するステップであり、前記第2の書き込みロック要求は、前記第2のクライアントの識別子と前記書き込みロック要求キュー内の第1のメモリアドレスとを搬送し、前記第1のメモリアドレスは、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスを除き、前記第2のクライアントの前記識別子が書き込まれることができる、前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスであるステップと、
前記インタフェースカードにより、前記第2のクライアントの前記識別子を前記書き込みロック要求キュー内の前記第1のメモリアドレスに書き込むステップと、
前記インタフェースカードにより、前記第2のクライアントが書き込みロック待機状態にあることを示すためのメッセージを前記第2のクライアントに送信するステップと
を更に含む、請求項1に記載の方法。
Receiving, by the interface card, a second write lock request sent by a second client in the plurality of clients, wherein the second write lock request includes an identifier of the second client and the second client A first memory address in the write lock request queue, and the first memory address is written with the identifier of the second client except for the memory address at the head of the write lock request queue. A step of being a memory address in a sequence from the queue head to the queue tail,
Writing the identifier of the second client to the first memory address in the write lock request queue by the interface card;
The method according to claim 1, further comprising: sending, by the interface card, a message to the second client indicating that the second client is in a write lock wait state.
前記ロックサーバの前記メモリは、読み取りロック要求キューを更に含み、前記読み取りロックが割り当てられていることを前記読み取りロック割り当てカウントが示す場合、前記読み取りロック要求キューは、前記共有リソースのための前記読み取りロックを取得する、前記クラスタ内にある第3のクライアントの識別子を記録するために使用される、請求項1に記載の方法。   The memory of the lock server further includes a read lock request queue, and if the read lock allocation count indicates that the read lock is allocated, the read lock request queue is the read for the shared resource. The method of claim 1, used to record an identifier of a third client in the cluster that obtains a lock. 前記第1の書き込みロック要求は、ロックリースを更に搬送し、前記ロックリースは、前記書き込みロックの有効期間を示すために使用される、請求項1に記載の方法。   The method of claim 1, wherein the first write lock request further carries a lock lease, and the lock lease is used to indicate a lifetime of the write lock. 前記第1のクライアントが前記書き込みロックを取得した後に、
前記インタフェースカードにより、前記第1のクライアントにより送信された書き込みロック解放要求を受信するステップであり、前記書き込みロック解放要求は、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスを搬送するステップと、
前記インタフェースカードにより、前記書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定するステップと、
前記インタフェースカードにより、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスから前記第1のクライアントの前記識別子を削除するステップと
を更に含む、請求項2に記載の方法。
After the first client acquires the write lock,
Receiving a write lock release request sent by the first client by the interface card, the write lock release request carrying the memory address at the head of the queue of the write lock request queue; ,
Setting the write lock assignment identifier to a write lock unassigned state by the interface card;
The method according to claim 2, further comprising: deleting, by the interface card, the identifier of the first client from the memory address at the head of the queue of the write lock request queue.
前記インタフェースカードにより、前記書き込みロック待機状態にある前記第2のクライアントを決定するために、前記書き込みロック要求キューに問い合わせるステップと、
前記インタフェースカードにより、前記第2のクライアントに対して前記書き込みロックを求めて前記インタフェースカードに申請するように命令するための通知を前記第2のクライアントに送信するステップと
を更に含む、請求項5に記載の方法。
Querying the write lock request queue with the interface card to determine the second client in the write lock wait state;
6. The method further comprising: sending, by the interface card, a notification to the second client to instruct the second client to apply for the interface card for the write lock. The method described in 1.
前記第1のクライアントが前記書き込みロックを取得した後に故障になった場合、
前記インタフェースカードにより、前記書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定するステップと、
前記インタフェースカードにより、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスから前記第1のクライアントの前記識別子を削除するステップと
を更に含む、請求項1に記載の方法。
If the first client fails after acquiring the write lock,
Setting the write lock assignment identifier to a write lock unassigned state by the interface card;
The method according to claim 1, further comprising: deleting, by the interface card, the identifier of the first client from the memory address at the head of the write lock request queue.
前記インタフェースカードにより、前記第1のクライアントを除き前記クラスタ内のクライアントに通知を送信するステップであり、前記通知は、前記第1のクライアントにより保持された前記書き込みロックが解放されていることを示すステップを更に含む、請求項7に記載の方法。   Sending a notification by the interface card to clients in the cluster except for the first client, the notification indicating that the write lock held by the first client has been released; The method of claim 7 further comprising a step. クラスタ内のロック管理方法であり、前記クラスタは、複数のクライアントとロックサーバとを含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、書き込みロック要求キューと書き込みロック割り当て識別子と読み取りロック割り当てカウントとを記憶し、前記書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、前記クラスタ内のクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための前記書き込みロックが割り当てられたか否かを示すために使用され、前記読み取りロック割り当てカウントは、前記共有リソースのために割り当てられた読み取りロックの数量を示すために使用される方法であって、
前記複数のクライアント内の第1のクライアントにより、第1の書き込みロック要求を前記ロックサーバの前記インタフェースカードに送信するステップであり、前記第1の書き込みロック要求は、前記第1のクライアントの識別子と前記書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送するステップと、
前記第1のクライアントにより、前記インタフェースカードにより送信された第1のメッセージを受信するステップであり、前記第1のメッセージは、前記インタフェースカードが前記第1のクライアントの前記識別子を前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスに書き込むことを示し、前記第1のクライアントが前記書き込みロックを取得するか、或いは書き込みロック待機状態にあることを示すステップと、
前記インタフェースカードが前記第1のクライアントの前記識別子を前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスに書き込むことに失敗したことを前記第1のメッセージが示す場合、前記第1のクライアントにより、第2の書き込みロック要求を前記インタフェースカードに送信するステップであり、前記第2の書き込みロック要求は、前記第1のクライアントの前記識別子と前記書き込みロック要求キュー内の第1のメモリアドレスとを搬送し、前記第1のメモリアドレスは、前記第1のクライアントの前記識別子が書き込まれることができる、前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスであるステップと
を含む方法。
A lock management method in a cluster, wherein the cluster includes a plurality of clients and a lock server, the lock server includes an interface card and a memory, and the memory includes a write lock request queue, a write lock allocation identifier, A read lock allocation count, and the write lock request queue includes an identifier of a client in a write lock wait state for a shared resource and an identifier of a client that acquires a write lock for the same shared resource, Used to record the identifier of the client in the cluster, the write lock assignment identifier is used to indicate whether the write lock for the shared resource has been assigned, and the read lock assignment count is , A method that is used to indicate the quantity of read lock allocated to the serial shared resource,
Sending a first write lock request to the interface card of the lock server by a first client of the plurality of clients, wherein the first write lock request includes an identifier of the first client; Carrying a memory address at the head of the write lock request queue;
Receiving a first message sent by the interface card by the first client, the first message being sent by the interface card to the identifier of the first client in the write lock request queue; Indicating writing to the memory address at the head of the queue and indicating that the first client acquires the write lock or is in a write lock wait state;
If the first message indicates that the interface card failed to write the identifier of the first client to the memory address at the head of the write lock request queue, the first client Sending a second write lock request to the interface card, wherein the second write lock request carries the identifier of the first client and a first memory address in the write lock request queue. And wherein the first memory address is a memory address in a sequence from the head of the queue to the end of the queue to which the identifier of the first client can be written.
前記第1の書き込みロック要求及び前記第2の書き込みロック要求は、ロックリースを更に搬送し、前記ロックリースは、前記書き込みロックの有効期間を示すために使用される、請求項9に記載の方法。   10. The method of claim 9, wherein the first write lock request and the second write lock request further carry a lock lease, and the lock lease is used to indicate a lifetime of the write lock. . 前記第1のクライアントが前記書き込みロックを取得した後に、
前記第1のクライアントにより、書き込みロック解放要求を前記インタフェースカードに送信するステップであり、前記書き込みロック解放要求は、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスを搬送するステップを更に含む、請求項9に記載の方法。
After the first client acquires the write lock,
Sending a write lock release request to the interface card by the first client, the write lock release request further comprising conveying the memory address at the head of the queue of the write lock request queue; The method of claim 9.
クラスタ内のロック管理方法であり、前記クラスタは、複数のクライアントとロックサーバとを含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、読み取りロック要求キューと書き込みロック割り当て識別子とを記憶し、前記読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、前記クラスタ内にあるクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための書き込みロックが割り当てられたか否かを示すために使用される方法であって、
前記インタフェースカードにより、前記複数のクライアント内の第1のクライアントにより送信された第1の読み取りロック要求を受信するステップであり、前記第1の読み取りロック要求は、前記第1のクライアントの識別子と前記読み取りロック要求キュー内の第1のメモリアドレスとを搬送するステップと、
前記インタフェースカードにより、前記第1のクライアントの前記識別子を前記読み取りロック要求キュー内の前記第1のメモリアドレスに書き込むステップと、
前記インタフェースカードにより、第1のメッセージを前記第1のクライアントに送信するステップであり、前記第1のメッセージは、前記書き込みロック割り当て識別子を搬送するステップと
を含む方法。
A lock management method in a cluster, wherein the cluster includes a plurality of clients and a lock server, the lock server includes an interface card and a memory, and the memory includes a read lock request queue, a write lock allocation identifier, And the read lock request queue is used to record an identifier of a client in the cluster that is in a read lock wait state for the same shared resource or obtains a read lock, and the write A lock assignment identifier is a method used to indicate whether a write lock for the shared resource has been assigned,
Receiving, by the interface card, a first read lock request sent by a first client in the plurality of clients, wherein the first read lock request includes an identifier of the first client and the first client; Carrying a first memory address in a read lock request queue;
Writing the identifier of the first client to the first memory address in the read lock request queue by the interface card;
Transmitting by the interface card a first message to the first client, the first message carrying the write lock assignment identifier.
前記書き込みロックが割り当てられていることを前記書き込みロック割り当て識別子が示す場合、前記第1のメッセージは、前記第1のクライアントが読み取りロック待機状態にあることを示す、請求項12に記載の方法。   13. The method of claim 12, wherein if the write lock assignment identifier indicates that the write lock is assigned, the first message indicates that the first client is in a read lock wait state. 前記メモリは、読み取りロック割り当てカウントを更に記憶し、前記読み取りロック割り当てカウントは、前記共有リソースのために割り当てられた読み取りロックの数量を示すために使用され、前記書き込みロックが割り当てられないことを前記書き込みロック割り当て識別子が示す場合、前記インタフェースカードは、前記第1のクライアントに割り当てられた読み取りロックの数量に従って前記読み取りロック割り当てカウントを増加させ、前記第1のメッセージは、前記第1のクライアントが読み取りロックを取得することを示す、請求項12に記載の方法。   The memory further stores a read lock allocation count, wherein the read lock allocation count is used to indicate a quantity of read locks allocated for the shared resource, wherein the write lock is not allocated. If the write lock assignment identifier indicates, the interface card increments the read lock assignment count according to the number of read locks assigned to the first client, and the first message is read by the first client. The method of claim 12, wherein the method indicates obtaining a lock. 前記複数のクライアントは、第2のクライアントを更に含み、前記メモリは、書き込みロック要求キューを更に記憶し、前記書き込みロック要求キューは、前記共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、前記共有リソースのための前記書き込みロックを取得するクライアントの識別子とを含む、前記クラスタ内のクライアントの識別子を記録するために使用され、前記書き込みロックが割り当てられていることを前記書き込みロック割り当て識別子が示す場合、前記第2のクライアントの識別子は、前記書き込みロック要求キューのキュー先頭のメモリアドレスに記憶される、請求項13に記載の方法。   The plurality of clients further includes a second client, the memory further stores a write lock request queue, the write lock request queue including an identifier of a client in a write lock wait state for the shared resource; The write lock assignment identifier used to record an identifier of the client in the cluster, wherein the write lock is assigned, including an identifier of the client that obtains the write lock for the shared resource 14. The method of claim 13, wherein the second client identifier is stored in a memory address at the head of the write lock request queue. 前記複数のクライアントは、第3のクライアントを更に含み、前記第3のクライアントの識別子は、前記読み取りロック要求キューのキュー先頭のメモリアドレスに記憶され、
前記読み取りロック要求キュー内の、前記第1の読み取りロック要求で搬送された前記第1のメモリアドレスは、前記第1のクライアントの前記識別子が書き込まれることができる、前記読み取りロック要求キューの前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである、請求項12に記載の方法。
The plurality of clients further include a third client, and the identifier of the third client is stored in a memory address at the head of the queue of the read lock request queue;
The queue of the read lock request queue, in which the identifier of the first client can be written to the first memory address carried in the first read lock request in the read lock request queue. The method of claim 12, wherein the memory address is in a sequence from the beginning to the end of the queue.
前記第1の読み取りロック要求は、ロックリースを更に搬送し、前記ロックリースは、読み取りロックの有効期間を示すために使用される、請求項12に記載の方法。   The method of claim 12, wherein the first read lock request further carries a lock lease, the lock lease being used to indicate a lifetime of the read lock. 前記第1のクライアントが前記読み取りロックを取得した場合、
前記インタフェースカードにより、前記第1のクライアントにより送信された読み取りロック解放要求を受信するステップであり、前記読み取りロック解放要求は、前記第1のクライアントの前記識別子が記憶された、前記読み取りロック要求キュー内にある前記第1のメモリアドレスを搬送するステップと、
前記インタフェースカードにより、前記第1のクライアントに割り当てられた前記読み取りロックの数量に従って前記メモリ内の前記読み取りロック割り当てカウントを減少させるステップと、
前記インタフェースカードにより、前記読み取りロック要求キュー内の前記第1のメモリアドレスから前記第1のクライアントの前記識別子を削除するステップと
を更に含む、請求項14に記載の方法。
If the first client acquires the read lock,
Receiving the read lock release request sent by the first client by the interface card, wherein the read lock release request is the read lock request queue in which the identifier of the first client is stored; Carrying the first memory address within;
Reducing the read lock allocation count in the memory by the interface card according to the number of read locks allocated to the first client;
15. The method of claim 14, further comprising: deleting, by the interface card, the identifier of the first client from the first memory address in the read lock request queue.
前記第1のクライアントが前記読み取りロックを取得した後に故障になった場合、
前記インタフェースカードにより、前記第1のクライアントに割り当てられた前記読み取りロックの数量に従って前記メモリ内の前記読み取りロック割り当てカウントを減少させるステップと、
前記インタフェースカードにより、前記読み取りロック要求キュー内の前記第1のメモリアドレスから前記第1のクライアントの前記識別子を削除するステップと
を更に含む、請求項14に記載の方法。
If the first client fails after acquiring the read lock,
Reducing the read lock allocation count in the memory by the interface card according to the number of read locks allocated to the first client;
15. The method of claim 14, further comprising: deleting, by the interface card, the identifier of the first client from the first memory address in the read lock request queue.
クラスタ内のロック管理方法であり、前記クラスタは、複数のクライアントとロックサーバとを含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、読み取りロック要求キューと書き込みロック割り当て識別子とを記憶し、前記読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、前記クラスタ内にあるクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための書き込みロックが割り当てられたか否かを示すために使用される方法であって、
前記複数のクライアント内の第1のクライアントにより、第1の読み取りロック要求を前記インタフェースカードに送信するステップであり、前記第1の読み取りロック要求は、前記第1のクライアントの識別子と前記読み取りロック要求キュー内の第1のメモリアドレスとを搬送するステップと、
前記第1のクライアントにより、前記インタフェースカードにより送信された第1のメッセージを受信するステップであり、前記第1のメッセージは、前記書き込みロック割り当て識別子を搬送するステップと
を含む方法。
A lock management method in a cluster, wherein the cluster includes a plurality of clients and a lock server, the lock server includes an interface card and a memory, and the memory includes a read lock request queue, a write lock allocation identifier, And the read lock request queue is used to record an identifier of a client in the cluster that is in a read lock wait state for the same shared resource or obtains a read lock, and the write A lock assignment identifier is a method used to indicate whether a write lock for the shared resource has been assigned,
Sending a first read lock request to the interface card by a first client of the plurality of clients, wherein the first read lock request includes an identifier of the first client and the read lock request. Carrying a first memory address in a queue;
Receiving, by the first client, a first message sent by the interface card, the first message carrying the write lock assignment identifier.
前記書き込みロックが割り当てられていることを前記書き込みロック割り当て識別子が示す場合、前記第1のメッセージは、前記第1のクライアントが読み取りロック待機状態にあることを示す、請求項20に記載の方法。   21. The method of claim 20, wherein if the write lock assignment identifier indicates that the write lock is assigned, the first message indicates that the first client is in a read lock wait state. 前記書き込みロックが割り当てられないことを前記書き込みロック割り当て識別子が示す場合、前記第1のメッセージは、前記第1のクライアントが読み取りロックを取得することを示す、請求項20に記載の方法。   21. The method of claim 20, wherein the first message indicates that the first client acquires a read lock if the write lock assignment identifier indicates that the write lock is not assigned. 前記複数のクライアントは、第2のクライアントを更に含み、前記第2のクライアントの識別子は、前記読み取りロック要求キューのキュー先頭のメモリアドレスに記憶され、
前記読み取りロック要求キュー内の、前記第1の読み取りロック要求で搬送された前記第1のメモリアドレスは、前記第1のクライアントの前記識別子が書き込まれることができる、前記読み取りロック要求キューの前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである、請求項20に記載の方法。
The plurality of clients further includes a second client, and the identifier of the second client is stored in a memory address at the head of the queue of the read lock request queue;
The queue of the read lock request queue, in which the identifier of the first client can be written to the first memory address carried in the first read lock request in the read lock request queue. 21. The method of claim 20, wherein the memory address is in a sequence from the beginning to the end of the queue.
前記第1の読み取りロック要求は、ロックリースを更に搬送し、前記ロックリースは、読み取りロックの有効期間を示すために使用される、請求項20に記載の方法。   21. The method of claim 20, wherein the first read lock request further carries a lock lease, and the lock lease is used to indicate a lifetime of a read lock. 前記第1のクライアントが前記読み取りロックを取得した場合、
前記第1のクライアントにより、読み取りロック解放要求を前記インタフェースカードに送信するステップであり、前記読み取りロック解放要求は、前記第1のクライアントの前記識別子が記憶された、前記読み取りロック要求キュー内にあるメモリアドレスを搬送するステップを更に含む、請求項22に記載の方法。
If the first client acquires the read lock,
Sending a read lock release request to the interface card by the first client, the read lock release request being in the read lock request queue in which the identifier of the first client is stored; 23. The method of claim 22, further comprising the step of carrying a memory address.
ロックサーバであり、前記ロックサーバは、クラスタに適用され、前記クラスタは、複数のクライアントを更に含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、書き込みロック要求キューと書き込みロック割り当て識別子と読み取りロック割り当てカウントとを記憶するように構成され、前記書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、前記クラスタ内のクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための前記書き込みロックが割り当てられたか否かを示すために使用され、前記読み取りロック割り当てカウントは、前記共有リソースのために割り当てられた読み取りロックの数量を示すために使用されるロックサーバであって、
前記インタフェースカードは、前記複数のクライアント内の第1のクライアントにより送信された第1の書き込みロック要求を受信するように構成され、前記第1の書き込みロック要求は、前記第1のクライアントの識別子と前記書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送し、
前記インタフェースカードは、前記第1のクライアントの前記識別子を前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスに書き込み、読み取りロックが割り当てられているか否かを決定するために、前記読み取りロック割り当てカウントに問い合わせ、前記読み取りロックが割り当てられない場合、前記書き込みロック割り当て識別子を書き込みロック割り当て済状態に設定し、前記第1のクライアントが前記書き込みロックを取得することを示すためのメッセージを前記第1のクライアントに送信するように更に構成され、
前記読み取りロックが割り当てられている場合、第2のメッセージを前記第1のクライアントに送信するように更に構成され、前記第2のメッセージは、前記第1のクライアントが書き込みロック待機状態にあることを示す、ロックサーバ。
A lock server, wherein the lock server is applied to a cluster, the cluster further includes a plurality of clients, the lock server includes an interface card and a memory, and the memory includes a write lock request queue and a write lock. Configured to store an allocation identifier and a read lock allocation count, wherein the write lock request queue obtains a write lock for the same shared resource as an identifier of a client in a write lock waiting state for the shared resource And the write lock assignment identifier is used to indicate whether or not the write lock for the shared resource has been assigned. Read the above Ri lock allocation count is a lock server used to indicate the quantity of read lock allocated to said shared resource,
The interface card is configured to receive a first write lock request transmitted by a first client in the plurality of clients, wherein the first write lock request includes an identifier of the first client. The memory address at the head of the write lock request queue is conveyed,
The interface card writes the identifier of the first client to the memory address at the head of the write lock request queue and determines whether a read lock is assigned to determine whether a read lock is assigned. If the read lock is not assigned, the write lock assignment identifier is set to a write lock assigned state, and a message indicating that the first client acquires the write lock is sent to the first lock. Further configured to send to the client,
If the read lock is assigned, the device is further configured to send a second message to the first client, the second message indicating that the first client is in a write lock wait state. Show lock server.
前記インタフェースカードは、前記複数のクライアント内の第2のクライアントにより送信された第2の書き込みロック要求を受信するように更に構成され、前記第2の書き込みロック要求は、前記第2のクライアントの識別子と前記書き込みロック要求キュー内の第1のメモリアドレスとを搬送し、前記第1のメモリアドレスは、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスを除き、前記第2のクライアントの前記識別子が書き込まれることができる、前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスであり、前記第2のクライアントの前記識別子を前記書き込みロック要求キュー内の前記第1のメモリアドレスに書き込み、前記第2のクライアントが書き込みロック待機状態にあることを示すためのメッセージを前記第2のクライアントに送信する、請求項26に記載のロックサーバ。   The interface card is further configured to receive a second write lock request sent by a second client in the plurality of clients, wherein the second write lock request is an identifier of the second client. And the first memory address in the write lock request queue, wherein the first memory address is the identifier of the second client except for the memory address at the head of the write lock request queue. Is written to the first memory address in the write lock request queue, the memory address in a sequence from the queue head to the queue tail, and the identifier of the second client can be written to the first memory address in the write lock request queue, The second client is in the write lock wait state Sending a message to indicate to the second client, the lock server according to claim 26. 前記メモリは、読み取りロック要求キューを記憶するように更に構成され、前記読み取りロックが割り当てられていることを前記読み取りロック割り当てカウントが示す場合、前記読み取りロック要求キューは、前記共有リソースのための前記読み取りロックを取得する、前記クラスタ内にある第3のクライアントの識別子を記録するために使用される、請求項26に記載のロックサーバ。   The memory is further configured to store a read lock request queue, and when the read lock allocation count indicates that the read lock has been allocated, the read lock request queue is configured for the shared resource. 27. The lock server of claim 26, used to record an identifier of a third client in the cluster that obtains a read lock. 前記第1のクライアントが前記書き込みロックを取得した後に、
前記インタフェースカードは、前記第1のクライアントにより送信された書き込みロック解放要求を受信するように更に構成され、前記書き込みロック解放要求は、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスを搬送し、前記書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスから前記第1のクライアントの前記識別子を削除するように更に構成される、請求項26に記載のロックサーバ。
After the first client acquires the write lock,
The interface card is further configured to receive a write lock release request sent by the first client, wherein the write lock release request carries the memory address at the head of the queue of the write lock request queue. The write lock assignment identifier is further configured to set the write lock unassigned state and to delete the identifier of the first client from the memory address at the head of the queue of the write lock request queue. 26. The lock server according to 26.
前記第1のクライアントが前記書き込みロックを取得した後に故障になった場合、
前記インタフェースカードは、前記書き込みロック割り当て識別子を書き込みロック未割り当て状態に設定し、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスから前記第1のクライアントの前記識別子を削除するように更に構成される、請求項26に記載のロックサーバ。
If the first client fails after acquiring the write lock,
The interface card is further configured to set the write lock assignment identifier to a write lock unassigned state and delete the identifier of the first client from the memory address at the head of the queue of the write lock request queue. The lock server according to claim 26.
クライアントであり、前記クライアントは、クラスタ内の複数のクライアント内の第1のクライアントに適用され、前記クラスタは、ロックサーバを更に含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、書き込みロック要求キューと書き込みロック割り当て識別子と読み取りロック割り当てカウントとを記憶し、前記書き込みロック要求キューは、共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、同じ共有リソースのための書き込みロックを取得するクライアントの識別子とを含む、前記クラスタ内のクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための前記書き込みロックが割り当てられたか否かを示すために使用され、前記読み取りロック割り当てカウントは、前記共有リソースのために割り当てられた読み取りロックの数量を示すために使用されるクライアントであって、前記第1のクライアントは、
第1の書き込みロック要求を前記ロックサーバの前記インタフェースカードに送信するように構成された送信ユニットであり、前記第1の書き込みロック要求は、前記第1のクライアントの識別子と前記書き込みロック要求キューのキュー先頭のメモリアドレスとを搬送する送信ユニットと、
前記インタフェースカードにより送信された第1のメッセージを受信するように構成された受信ユニットであり、前記第1のメッセージは、前記インタフェースカードが前記第1のクライアントの前記識別子を前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスに書き込むことを示し、前記第1のクライアントが前記書き込みロックを取得するか、或いは書き込みロック待機状態にあることを示す受信ユニットと
を含み、
前記送信ユニットは、前記インタフェースカードが前記第1のクライアントの前記識別子を前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスに書き込むことに失敗したことを前記第1のメッセージが示す場合、第2の書き込みロック要求を前記インタフェースカードに送信するように更に構成され、前記第2の書き込みロック要求は、前記第1のクライアントの前記識別子と前記書き込みロック要求キュー内の第1のメモリアドレスとを搬送し、前記第1のメモリアドレスは、前記第1のクライアントの前記識別子が書き込まれることができる、前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである、クライアント。
A client, wherein the client is applied to a first client in a plurality of clients in a cluster, the cluster further including a lock server, the lock server including an interface card and memory, wherein the memory is A write lock request queue, a write lock allocation identifier, and a read lock allocation count, wherein the write lock request queue is a write lock wait queue for a shared resource and a write for the same shared resource Used to record the identifier of the client in the cluster, including the identifier of the client that obtains the lock, the write lock assignment identifier indicating whether the write lock for the shared resource has been assigned or not. The Is used, the read lock allocated count is a client used to indicate the quantity of read lock allocated to said shared resource, said first client,
A transmission unit configured to transmit a first write lock request to the interface card of the lock server, wherein the first write lock request includes an identifier of the first client and a write lock request queue; A transmission unit that carries the memory address at the head of the queue;
A receiving unit configured to receive a first message transmitted by the interface card, the first message being sent by the interface card to the identifier of the first client in the write lock request queue; A receiving unit that indicates writing to the memory address at the head of the queue and indicating that the first client acquires the write lock or is in a write lock wait state;
If the first message indicates that the interface card has failed to write the identifier of the first client to the memory address at the head of the queue of the write lock request queue, Is further configured to transmit the write lock request to the interface card, wherein the second write lock request carries the identifier of the first client and a first memory address in the write lock request queue. And the first memory address is a memory address in a sequence from the head of the queue to the end of the queue to which the identifier of the first client can be written.
前記送信ユニットは、前記第1のクライアントが前記書き込みロックを取得した後に、書き込みロック解放要求を前記インタフェースカードに送信するように更に構成され、前記書き込みロック解放要求は、前記書き込みロック要求キューの前記キュー先頭の前記メモリアドレスを搬送する、請求項31に記載のクライアント。   The sending unit is further configured to send a write lock release request to the interface card after the first client has acquired the write lock, the write lock release request being sent from the write lock request queue. The client of claim 31, carrying the memory address at the head of a queue. ロックサーバであり、前記ロックサーバは、クラスタに適用され、前記クラスタは、複数のクライアントを更に含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、読み取りロック要求キューと書き込みロック割り当て識別子とを記憶するように構成され、前記読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、前記クラスタ内にあるクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための書き込みロックが割り当てられたか否かを示すために使用されるロックサーバであって、
前記インタフェースカードは、前記複数のクライアント内の第1のクライアントにより送信された第1の読み取りロック要求を受信するように構成され、前記第1の読み取りロック要求は、前記第1のクライアントの識別子と前記読み取りロック要求キュー内の第1のメモリアドレスとを搬送し、前記第1のクライアントの前記識別子を前記読み取りロック要求キュー内の前記第1のメモリアドレスに書き込み、第1のメッセージを前記第1のクライアントに送信するように構成され、前記第1のメッセージは、前記書き込みロック割り当て識別子を搬送する、ロックサーバ。
A lock server, wherein the lock server is applied to a cluster, the cluster further includes a plurality of clients, the lock server includes an interface card and memory, and the memory includes a read lock request queue and a write lock. The read lock request queue records an identifier of a client in the cluster that is in a read lock wait state for the same shared resource or obtains a read lock. The write lock assignment identifier is a lock server used to indicate whether a write lock for the shared resource has been assigned,
The interface card is configured to receive a first read lock request sent by a first client in the plurality of clients, wherein the first read lock request includes an identifier of the first client. A first memory address in the read lock request queue, writes the identifier of the first client to the first memory address in the read lock request queue, and writes a first message to the first memory address. A lock server configured to send to the client of the first message, wherein the first message carries the write lock assignment identifier.
前記書き込みロックが割り当てられていることを前記書き込みロック割り当て識別子が示す場合、前記第1のメッセージは、前記第1のクライアントが読み取りロック待機状態にあることを示す、請求項33に記載のロックサーバ。   34. The lock server of claim 33, wherein the first message indicates that the first client is in a read lock waiting state if the write lock assignment identifier indicates that the write lock is assigned. . 前記メモリは、読み取りロック割り当てカウントを更に記憶し、前記読み取りロック割り当てカウントは、前記共有リソースのために割り当てられた読み取りロックの数量を示すために使用され、前記書き込みロックが割り当てられないことを前記書き込みロック割り当て識別子が示す場合、前記インタフェースカードは、前記第1のクライアントに割り当てられた読み取りロックの数量に従って前記読み取りロック割り当てカウントを増加させるように更に構成され、前記第1のメッセージは、前記第1のクライアントが読み取りロックを取得することを示す、請求項33に記載のロックサーバ。   The memory further stores a read lock allocation count, wherein the read lock allocation count is used to indicate a quantity of read locks allocated for the shared resource, wherein the write lock is not allocated. If the write lock assignment identifier indicates, the interface card is further configured to increase the read lock assignment count according to the number of read locks assigned to the first client, and the first message is the first message 34. The lock server of claim 33, indicating that one client obtains a read lock. 前記複数のクライアントは、第2のクライアントを更に含み、前記メモリは、書き込みロック要求キューを記憶するように更に構成され、前記書き込みロック要求キューは、前記共有リソースのための書き込みロック待機状態にあるクライアントの識別子と、前記共有リソースのための前記書き込みロックを取得するクライアントの識別子とを含む、前記クラスタ内のクライアントの識別子を記録するために使用され、前記書き込みロックが割り当てられていることを前記書き込みロック割り当て識別子が示す場合、前記第2のクライアントの識別子は、前記書き込みロック要求キューのキュー先頭のメモリアドレスに記憶される、請求項34に記載のロックサーバ。   The plurality of clients further includes a second client, and the memory is further configured to store a write lock request queue, wherein the write lock request queue is in a write lock wait state for the shared resource. Used to record an identifier of a client in the cluster, including an identifier of a client and an identifier of a client that obtains the write lock for the shared resource, and wherein the write lock is assigned The lock server according to claim 34, wherein when the write lock assignment identifier indicates, the identifier of the second client is stored in a memory address at the head of the queue of the write lock request queue. 前記複数のクライアントは、第3のクライアントを更に含み、前記第3のクライアントの識別子は、前記読み取りロック要求キューのキュー先頭のメモリアドレスに記憶され、
前記読み取りロック要求キュー内の、前記第1の読み取りロック要求で搬送された前記第1のメモリアドレスは、前記第1のクライアントの前記識別子が書き込まれることができる、前記読み取りロック要求キューの前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである、請求項33に記載のロックサーバ。
The plurality of clients further include a third client, and the identifier of the third client is stored in a memory address at the head of the queue of the read lock request queue;
The queue of the read lock request queue, in which the identifier of the first client can be written to the first memory address carried in the first read lock request in the read lock request queue. The lock server according to claim 33, which is a memory address in a sequence from the head to the tail of the queue.
前記第1のクライアントが前記読み取りロックを取得した場合、前記インタフェースカードは、前記第1のクライアントにより送信された読み取りロック解放要求を受信するように更に構成され、前記読み取りロック解放要求は、前記第1のクライアントの前記識別子が記憶された、前記読み取りロック要求キュー内にある前記第1のメモリアドレスを搬送し、前記第1のクライアントに割り当てられた前記読み取りロックの数量に従って前記メモリ内の前記読み取りロック割り当てカウントを減少させ、前記読み取りロック要求キュー内の前記第1のメモリアドレスから前記第1のクライアントの前記識別子を削除するように更に構成される、請求項35に記載のロックサーバ。   When the first client acquires the read lock, the interface card is further configured to receive a read lock release request sent by the first client, wherein the read lock release request is The first memory address in the read lock request queue, in which the identifier of one client is stored, carries the read in the memory according to the number of read locks assigned to the first client 36. The lock server of claim 35, further configured to decrement a lock allocation count and delete the identifier of the first client from the first memory address in the read lock request queue. 前記第1のクライアントが前記読み取りロックを取得した後に故障になった場合、前記インタフェースカードは、前記第1のクライアントに割り当てられた前記読み取りロックの数量に従って前記メモリ内の前記読み取りロック割り当てカウントを減少させ、前記読み取りロック要求キュー内の前記第1のメモリアドレスから前記第1のクライアントの前記識別子を削除するように構成される、請求項35に記載のロックサーバ。   If the first client fails after obtaining the read lock, the interface card decrements the read lock allocation count in the memory according to the number of read locks allocated to the first client. 36. The lock server of claim 35, wherein the lock server is configured to delete the identifier of the first client from the first memory address in the read lock request queue. クライアントであり、前記クライアントは、クラスタに適用され、複数のクライアント内の第1のクライアントとして機能し、前記クラスタは、ロックサーバを更に含み、前記ロックサーバは、インタフェースカードとメモリとを含み、前記メモリは、読み取りロック要求キューと書き込みロック割り当て識別子とを記憶し、前記読み取りロック要求キューは、同じ共有リソースのための読み取りロック待機状態にあるか、或いは読み取りロックを取得する、前記クラスタ内にあるクライアントの識別子を記録するために使用され、前記書き込みロック割り当て識別子は、前記共有リソースのための書き込みロックが割り当てられたか否かを示すために使用されるクライアントであって、前記第1のクライアントは、
第1の読み取りロック要求を前記インタフェースカードに送信するように構成された送信ユニットであり、前記第1の読み取りロック要求は、前記第1のクライアントの識別子と前記読み取りロック要求キュー内の第1のメモリアドレスとを搬送する送信ユニットと、
前記インタフェースカードにより送信された第1のメッセージを受信するように構成された受信ユニットであり、前記第1のメッセージは、前記書き込みロック割り当て識別子を搬送する受信ユニットと
を含むクライアント。
A client, the client being applied to a cluster and functioning as a first client in a plurality of clients, the cluster further comprising a lock server, the lock server comprising an interface card and memory; The memory stores a read lock request queue and a write lock assignment identifier, and the read lock request queue is in a read lock wait state for the same shared resource or is in the cluster that acquires a read lock. Used to record a client identifier, wherein the write lock assignment identifier is a client used to indicate whether a write lock for the shared resource has been assigned, wherein the first client is ,
A transmission unit configured to transmit a first read lock request to the interface card, wherein the first read lock request includes an identifier of the first client and a first in the read lock request queue; A transmission unit carrying a memory address;
A receiving unit configured to receive a first message transmitted by the interface card, wherein the first message includes a receiving unit carrying the write lock assignment identifier.
前記書き込みロックが割り当てられていることを前記書き込みロック割り当て識別子が示す場合、前記第1のメッセージは、前記第1のクライアントが読み取りロック待機状態にあることを示す、請求項40に記載のクライアント。   41. The client of claim 40, wherein the first message indicates that the first client is in a read lock wait state when the write lock assignment identifier indicates that the write lock is assigned. 前記書き込みロックが割り当てられないことを前記書き込みロック割り当て識別子が示す場合、前記第1のメッセージは、前記第1のクライアントが読み取りロックを取得することを示す、請求項40に記載のクライアント。   41. The client of claim 40, wherein if the write lock assignment identifier indicates that the write lock is not assigned, the first message indicates that the first client acquires a read lock. 前記複数のクライアントは、第2のクライアントを更に含み、前記第2のクライアントの識別子は、前記読み取りロック要求キューのキュー先頭のメモリアドレスに記憶され、
前記読み取りロック要求キュー内の、前記第1の読み取りロック要求で搬送された前記第1のメモリアドレスは、前記第1のクライアントの前記識別子が書き込まれることができる、前記読み取りロック要求キューの前記キュー先頭からキュー末尾までのシーケンス内にあるメモリアドレスである、請求項40に記載のクライアント。
The plurality of clients further includes a second client, and the identifier of the second client is stored in a memory address at the head of the queue of the read lock request queue;
The queue of the read lock request queue, in which the identifier of the first client can be written to the first memory address carried in the first read lock request in the read lock request queue. 41. The client of claim 40, wherein the client is a memory address in a sequence from the beginning to the end of the queue.
前記送信ユニットは、読み取りロック解放要求を前記インタフェースカードに送信するように更に構成され、前記読み取りロック解放要求は、前記第1のクライアントの前記識別子が記憶された、前記読み取りロック要求キュー内にあるメモリアドレスを搬送する、請求項42に記載のクライアント。   The sending unit is further configured to send a read lock release request to the interface card, the read lock release request being in the read lock request queue in which the identifier of the first client is stored. 43. The client of claim 42, carrying a memory address.
JP2018040616A 2018-03-07 2018-03-07 Lock management method, lock server and client in cluster Active JP6561162B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018040616A JP6561162B2 (en) 2018-03-07 2018-03-07 Lock management method, lock server and client in cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018040616A JP6561162B2 (en) 2018-03-07 2018-03-07 Lock management method, lock server and client in cluster

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2016567831A Division JP6306215B2 (en) 2015-12-14 2015-12-14 Lock management method, lock server and client in cluster

Publications (2)

Publication Number Publication Date
JP2018110031A true JP2018110031A (en) 2018-07-12
JP6561162B2 JP6561162B2 (en) 2019-08-14

Family

ID=62844518

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018040616A Active JP6561162B2 (en) 2018-03-07 2018-03-07 Lock management method, lock server and client in cluster

Country Status (1)

Country Link
JP (1) JP6561162B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614048A (en) * 2018-12-10 2019-04-12 深圳市硅格半导体有限公司 Data read-write method, device and computer readable storage medium based on flash memory
KR20200117405A (en) * 2019-04-04 2020-10-14 한국전자통신연구원 Distributed sysetm for managing distributed lock and operating method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0895841A (en) * 1994-09-22 1996-04-12 Mitsubishi Electric Corp Data base processing system
JPH09325894A (en) * 1996-06-06 1997-12-16 Hitachi Ltd Exclusive control system
JP2001067238A (en) * 1999-08-27 2001-03-16 Nec Corp Distributed exclusion and sharing control method and device therefor, and machine-readable recording medium where program is precorded
JP2014048969A (en) * 2012-08-31 2014-03-17 Nippon Telegr & Teleph Corp <Ntt> Server, file management system, file management method and file management program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0895841A (en) * 1994-09-22 1996-04-12 Mitsubishi Electric Corp Data base processing system
JPH09325894A (en) * 1996-06-06 1997-12-16 Hitachi Ltd Exclusive control system
JP2001067238A (en) * 1999-08-27 2001-03-16 Nec Corp Distributed exclusion and sharing control method and device therefor, and machine-readable recording medium where program is precorded
JP2014048969A (en) * 2012-08-31 2014-03-17 Nippon Telegr & Teleph Corp <Ntt> Server, file management system, file management method and file management program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614048A (en) * 2018-12-10 2019-04-12 深圳市硅格半导体有限公司 Data read-write method, device and computer readable storage medium based on flash memory
KR20200117405A (en) * 2019-04-04 2020-10-14 한국전자통신연구원 Distributed sysetm for managing distributed lock and operating method thereof
KR102450133B1 (en) * 2019-04-04 2022-10-05 한국전자통신연구원 Distributed sysetm for managing distributed lock and operating method thereof
US11500693B2 (en) 2019-04-04 2022-11-15 Electronics And Telecommunications Research Institute Distributed system for distributed lock management and method for operating the same

Also Published As

Publication number Publication date
JP6561162B2 (en) 2019-08-14

Similar Documents

Publication Publication Date Title
JP6306215B2 (en) Lock management method, lock server and client in cluster
EP3470984B1 (en) Method, device, and system for managing disk lock
CN109101341B (en) Distribution method and equipment of distributed lock
US11586392B2 (en) Multi-stream SSD QoS management
WO2022007470A1 (en) Data transmission method, chip, and device
US20200382595A1 (en) Nvm express over fabrics
JP6561162B2 (en) Lock management method, lock server and client in cluster
CN106936931B (en) Method, related equipment and system for realizing distributed lock
US20100161585A1 (en) Asymmetric cluster filesystem
CN113127139B (en) Memory allocation method and device based on DPDK of data plane development kit
WO2019037664A1 (en) Address allocation
US20190146845A1 (en) Lock Allocation Method and Apparatus, and Computing Device
US7343432B1 (en) Message based global distributed locks with automatic expiration for indicating that said locks is expired
CN114911632B (en) Method and system for controlling interprocess communication
US10289550B1 (en) Method and system for dynamic write-back cache sizing in solid state memory storage
WO2018032499A1 (en) Load balancing method and associated device
WO2017177400A1 (en) Data processing method and system
JP6678093B2 (en) Data sharing system, data sharing method
US20160306754A1 (en) Storage system
CN114448942B (en) DHCP message processing method and device, electronic equipment and storage medium
JP2018530796A (en) Apparatus and method for executing multiple threads
CN113961319A (en) Method and device for job thermal migration, electronic equipment and storage medium
CN117255078A (en) Processing method and system for DHCP server

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190319

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190617

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190702

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190722

R150 Certificate of patent or registration of utility model

Ref document number: 6561162

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250