[go: up one dir, main page]

CN104461705A - Service access method, storage controllers and cluster storage system - Google Patents

Service access method, storage controllers and cluster storage system Download PDF

Info

Publication number
CN104461705A
CN104461705A CN201410655484.3A CN201410655484A CN104461705A CN 104461705 A CN104461705 A CN 104461705A CN 201410655484 A CN201410655484 A CN 201410655484A CN 104461705 A CN104461705 A CN 104461705A
Authority
CN
China
Prior art keywords
storage
storage controller
lock
operation object
resource
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
CN201410655484.3A
Other languages
Chinese (zh)
Other versions
CN104461705B (en
Inventor
何孝金
李大权
蒋培军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410655484.3A priority Critical patent/CN104461705B/en
Publication of CN104461705A publication Critical patent/CN104461705A/en
Application granted granted Critical
Publication of CN104461705B publication Critical patent/CN104461705B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供一种业务访问的方法及存储控制器、集群存储系统,涉及计算机领域,以解决现有集群存储系统中的主存储控制器易出现性能瓶颈的问题。该方法包括:集群存储系统中的所有存储控制器均存储有所述集群储存系统的存储空间中的所有操作对象的资源锁,任一存储控制器在接收到主机业务的操作指令时,所述操作指令包括操作对象标识,根据所述操作对象标识确定所述第一存储控制器存储的所述操作对象的资源锁为未使用状态;对所述操作对象的资源锁进行加锁,加锁后的所述资源锁为已使用状态;按照所述操作指令访问所述操作对象。本发明实施例用于业务访问。

Embodiments of the present invention provide a service access method, a storage controller, and a cluster storage system, which relate to the field of computers and solve the problem that a main storage controller in an existing cluster storage system is prone to performance bottlenecks. The method includes: all storage controllers in the cluster storage system store the resource locks of all operation objects in the storage space of the cluster storage system, and when any storage controller receives an operation instruction of the host service, the The operation instruction includes an operation object identifier, and according to the operation object identifier, it is determined that the resource lock of the operation object stored by the first storage controller is in an unused state; the resource lock of the operation object is locked, and after locking The resource lock is in use; access the operation object according to the operation instruction. The embodiment of the present invention is used for service access.

Description

一种业务访问的方法及存储控制器、集群存储系统A service access method, storage controller, and cluster storage system

技术领域technical field

本发明涉及计算机领域,尤其涉及一种业务访问的方法及存储控制器、集群存储系统。The invention relates to the computer field, in particular to a service access method, a storage controller, and a cluster storage system.

背景技术Background technique

为了满足用户对存储需求的不断提高,现有技术提出了“集群存储系统”,提高了存储资源的容量、可靠性及可用性。In order to meet the continuous improvement of users' demand for storage, a "cluster storage system" is proposed in the prior art, which improves the capacity, reliability and availability of storage resources.

如图1所示,现有技术所提出的集群存储系统由多个存储控制器、存储空间及交换机组成。其中,存储空间可以由多个独立的磁盘组成,其用于存储数据;存储控制器用于在存储空间中读取或写入数据;存储控制器和存储空间通过交换机连接组网,任一存储控制器通过该交换机可以访问存储空间中的所有操作对象。As shown in FIG. 1 , the cluster storage system proposed in the prior art is composed of multiple storage controllers, storage spaces and switches. Among them, the storage space can be composed of multiple independent disks, which are used to store data; the storage controller is used to read or write data in the storage space; the storage controller and the storage space are connected to the network through a switch, and any storage control The controller can access all operation objects in the storage space through this switch.

由于存储空间中的同一操作对象可能同时被访问多次,为了保证存储空间数据的唯一性与确定性,通常会对操作对象设置资源锁,基于资源锁的加锁和释放机制可保证对访问同一操作对象的业务之间的互斥。具体地,当该操作对象被某一业务访问时,可设置该操作对象对应的资源锁为已使用状态,禁止其他业务对该操作对象进行访问,此过程为资源锁的加锁过程;当该业务执行完毕,将该操作对象对应的资源锁设置为未使用状态,允许其他业务对该操作对象进行访问,此过程为资源锁的释放过程。Since the same operation object in the storage space may be accessed multiple times at the same time, in order to ensure the uniqueness and certainty of the data in the storage space, resource locks are usually set for the operation object. Mutual exclusion between the services of the operation object. Specifically, when the operation object is accessed by a certain business, the resource lock corresponding to the operation object can be set to the used state, and other services are prohibited from accessing the operation object. This process is the locking process of the resource lock; After the business is executed, set the resource lock corresponding to the operation object to an unused state to allow other services to access the operation object. This process is the release process of the resource lock.

然而,现有的集群存储系统通常会将多个存储控制器中的某一存储控制器作为主存储控制器,其它的存储控制器作为备存储控制器。每一个存储控制器在执行业务时,均会向主存储控制器申请对资源锁进行加锁或释放,这样,当有大量业务并发向该主存储控制器发出申请时,主存储控制器将成为整个集群存储系统的瓶颈。However, in an existing clustered storage system, a certain storage controller among multiple storage controllers is usually used as a primary storage controller, and other storage controllers are used as backup storage controllers. Each storage controller will apply to the main storage controller to lock or release the resource lock when performing business. In this way, when there are a large number of services concurrently sending applications to the main storage controller, the main storage controller will become The bottleneck of the entire cluster storage system.

发明内容Contents of the invention

本发明提供一种业务访问的方法及存储控制器、集群存储系统,以解决现有集群存储系统中的主存储控制器易出现性能瓶颈的问题。The invention provides a service access method, a storage controller, and a cluster storage system to solve the problem that the main storage controller in the existing cluster storage system is prone to performance bottlenecks.

为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:

第一方面,提供一种业务访问的方法,所述方法应用于包括至少两个存储控制器的集群存储系统,所述至少两个存储控制器均存储有所述集群储存系统的存储空间中的所有操作对象的资源锁,所述方法包括:In the first aspect, a method for service access is provided, the method is applied to a clustered storage system including at least two storage controllers, and the at least two storage controllers both store the data stored in the storage space of the clustered storage system Resource locks for all operation objects, the methods include:

第一存储控制器接收主机业务的操作指令;所述操作指令包括操作对象标识;所述第一存储控制器为所述至少两个存储控制器中的任一个;The first storage controller receives an operation instruction of the host service; the operation instruction includes an operation object identifier; the first storage controller is any one of the at least two storage controllers;

根据所述操作对象标识确定所述第一存储控制器存储的所述操作对象的资源锁为未使用状态;determining according to the operation object identifier that the resource lock of the operation object stored by the first storage controller is in an unused state;

对所述操作对象的资源锁进行加锁,加锁后的所述资源锁为已使用状态;Locking the resource lock of the operation object, and the resource lock after locking is in a used state;

按照所述操作指令访问所述操作对象。The operation object is accessed according to the operation instruction.

在第一方面的第一种可能的实现方式中,所述方法还包括:In a first possible implementation manner of the first aspect, the method further includes:

接收后台业务的操作指令,所述后台业务的操作指令包括所述操作对象标识;receiving an operation instruction of a background service, where the operation instruction of the background service includes the operation object identifier;

在确定所述第一存储控制器存储的所述操作对象的资源锁为未使用状态时,对所述操作对象的资源锁进行加锁;lock the resource lock of the operation object when it is determined that the resource lock of the operation object stored by the first storage controller is in an unused state;

分别向所述集群存储系统中除所述第一存储控制器以外的所有存储控制器发送加锁请求消息,所述加锁请求消息用于指示存储控制器对所述操作对象的资源锁进行加锁;Sending lock request messages to all storage controllers in the clustered storage system except the first storage controller respectively, where the lock request messages are used to instruct the storage controllers to lock the resource lock of the operation object Lock;

在所述集群存储系统中所有存储控制器对所述操作对象的资源锁加锁完成后,按照所述后台业务的操作指令访问所述操作对象。After all the storage controllers in the cluster storage system lock the resource locks of the operation object, they access the operation object according to the operation instruction of the background service.

结合第一方面或者第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述方法还包括:With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the method further includes:

接收第二存储控制器发送的包括所述操作对象标识的加锁请求消息;所述第二存储控制器为所述集群存储系统中除所述第一存储控制器以外的任一存储控制器;receiving a lock request message including the operation object identifier sent by a second storage controller; the second storage controller is any storage controller in the cluster storage system except the first storage controller;

根据所述加锁请求消息对所述第一存储控制器存储的所述操作对象的资源锁进行加锁;Lock the resource lock of the operation object stored by the first storage controller according to the lock request message;

向所述第二存储控制器发送加锁响应消息。Send a lock response message to the second storage controller.

结合第一方面或者第一方面的第一种可能的实现方式,在第三种可能的实现方式中,在所述按照所述操作指令访问所述操作对象之后,包括:With reference to the first aspect or the first possible implementation manner of the first aspect, in a third possible implementation manner, after accessing the operation object according to the operation instruction, include:

将所述第一存储控制器存储的所述操作对象的资源锁释放,释放后的所述资源锁为未使用状态;releasing the resource lock of the operation object stored by the first storage controller, and the released resource lock is in an unused state;

在所述按照所述后台业务的操作指令访问所述操作对象之后,包括:After accessing the operation object according to the operation instruction of the background business, it includes:

将所述第一存储控制器存储的所述操作对象的资源锁释放;releasing the resource lock of the operation object stored by the first storage controller;

向所述集群存储系统中的除所述第一存储控制器以外的所有存储控制器发送状态变更消息,以便接收到所述状态变更消息的存储控制器将所述操作对象的资源锁释放。Sending a state change message to all storage controllers in the cluster storage system except the first storage controller, so that the storage controller receiving the state change message releases the resource lock of the operation object.

第二方面,提供一种存储控制器,包括:In a second aspect, a storage controller is provided, including:

存储单元,用于存储集群储存系统的存储空间中的所有操作对象的资源锁;The storage unit is used to store the resource locks of all operation objects in the storage space of the cluster storage system;

第一接收单元,用于接收主机业务的操作指令,所述操作指令包括操作对象标识;The first receiving unit is configured to receive an operation instruction of the host service, where the operation instruction includes an operation object identifier;

加锁单元,用于根据所述操作对象标识确定所述存储控制器存储的所述操作对象的资源锁为未使用状态,对所述操作对象的资源锁进行加锁;加锁后的所述资源锁为已使用状态;A locking unit, configured to determine, according to the operation object identifier, that the resource lock of the operation object stored by the storage controller is in an unused state, and lock the resource lock of the operation object; the locked The resource lock is in use;

第一访问单元,用于按照所述操作指令访问所述操作对象。A first access unit, configured to access the operation object according to the operation instruction.

在第二方面的第一种可能的实现方式中,还包括:In the first possible implementation manner of the second aspect, it also includes:

第二接收单元,用于接收后台业务的操作指令,所述后台业务的操作指令包括所述操作对象标识;The second receiving unit is configured to receive an operation instruction of a background service, where the operation instruction of the background service includes the operation object identifier;

发送单元,用于分别向所述集群存储系统中除所述存储控制器以外的所有存储控制器发送加锁请求消息,所述加锁请求消息用于指示存储控制器对所述操作对象的资源锁进行加锁;a sending unit, configured to send a lock request message to all storage controllers in the cluster storage system except the storage controller, and the lock request message is used to instruct the storage controller to use resources of the operation object Lock to lock;

第二访问单元,用于在所述集群存储系统中所有存储控制器对所述操作对象的资源锁加锁完成后,按照所述后台业务的操作指令访问所述操作对象。The second access unit is configured to access the operation object according to the operation instruction of the background service after all the storage controllers in the cluster storage system have completed locking the resource locks of the operation object.

结合第二方面或者第二方面的第一种可能的实现方式,在第二种可能的实现方式中,还包括:In combination with the second aspect or the first possible implementation of the second aspect, the second possible implementation also includes:

第三接收单元,用于接收第二存储控制器发送的包括所述操作对象标识的加锁请求消息;所述第二存储控制器为所述集群存储系统中除所述存储控制器以外的任一存储控制器;The third receiving unit is configured to receive the lock request message including the operation object identifier sent by the second storage controller; the second storage controller is any storage controller in the cluster storage system except the storage controller a storage controller;

所述加锁单元还用于,根据所述加锁请求消息对所述存储控制器存储的所述操作对象的资源锁进行加锁;The locking unit is further configured to lock the resource lock of the operation object stored by the storage controller according to the lock request message;

所述发送单元,用于向所述第二存储控制器发送加锁响应消息。The sending unit is configured to send a lock response message to the second storage controller.

结合第二方面或者第二方面的第一种可能的实现方式,在第三种可能的实现方式中,还包括:In combination with the second aspect or the first possible implementation manner of the second aspect, the third possible implementation manner further includes:

释放单元,用于在所述第一访问单元按照所述操作指令访问所述操作对象之后,将所述存储控制器存储的所述操作对象的资源锁释放,释放后的所述资源锁为未使用状态;A releasing unit, configured to release the resource lock of the operation object stored by the storage controller after the first access unit accesses the operation object according to the operation instruction, and the released resource lock is not status of use;

在所述第二访问单元按照所述后台业务的操作指令访问所述操作对象之后,将所述存储控制器存储的所述操作对象的资源锁释放;After the second access unit accesses the operation object according to the operation instruction of the background service, release the resource lock of the operation object stored by the storage controller;

所述发送单元还用于,向所述集群存储系统中的除所述存储控制器以外的所有存储控制器发送状态变更消息,以便接收到所述状态变更消息的存储控制器将所述操作对象的资源锁释放。The sending unit is further configured to send a state change message to all storage controllers in the cluster storage system except the storage controller, so that the storage controller receiving the state change message will set the operation object to The resource lock is released.

第三方面,提供一种集群存储系统,包括存储空间和至少两个存储控制器,所述至少两个存储控制器均与所述存储空间相连,所述至少两个存储控制器中的任一存储控制器分别与其他所有存储控制器相连;In a third aspect, a cluster storage system is provided, including a storage space and at least two storage controllers, the at least two storage controllers are both connected to the storage space, and any of the at least two storage controllers The storage controller is respectively connected to all other storage controllers;

所述存储控制器为第二方面至第二方面的第三种可能的实现方式中的任一种可能的实现方式所述的存储控制器;The storage controller is the storage controller described in any one of the possible implementation manners in the second aspect to the third possible implementation manner of the second aspect;

所述存储空间用于存储操作对象。The storage space is used to store operation objects.

采用上述方案,集群存储系统中的任一存储控制器在接收到主机业务的操作指令时,只需对该存储控制器存储的对应操作对象的资源锁进行加锁,即可按照该操作指令访问操作对象,无需向其他存储控制器发送加锁请求消息,相比现有技术中,存储控制器在接收到主机业务的操作指令时,需发送加锁请求消息至主存储控制器请求加锁,本发明提高了主机业务的执行效率,并且由于各存储控制器的加锁地位平等,不会造成某一存储控制器发生性能瓶颈。With the above scheme, when any storage controller in the cluster storage system receives an operation instruction from the host, it only needs to lock the resource lock of the corresponding operation object stored by the storage controller, and then access the server according to the operation instruction. The operation object does not need to send a lock request message to other storage controllers. Compared with the prior art, when the storage controller receives the operation command of the host service, it needs to send a lock request message to the main storage controller to request lock. The invention improves the execution efficiency of the host business, and because the locking status of each storage controller is equal, no performance bottleneck will occur in a certain storage controller.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.

图1为现有技术中的一种集群存储系统的结构示意图;FIG. 1 is a schematic structural diagram of a cluster storage system in the prior art;

图2为现有集群存储系统中存储控制器之间申请加锁的示意图;FIG. 2 is a schematic diagram of applying for locks between storage controllers in an existing cluster storage system;

图3为本发明实施例提供的一种业务访问的方法的流程示意图;FIG. 3 is a schematic flowchart of a service access method provided by an embodiment of the present invention;

图4为本发明实施例提供的一种存储控制器之间申请加锁的示意图;FIG. 4 is a schematic diagram of applying for locking between storage controllers according to an embodiment of the present invention;

图5为本发明实施例提供的一种存储控制器的结构示意图;FIG. 5 is a schematic structural diagram of a storage controller provided by an embodiment of the present invention;

图6为本发明实施例提供的另一种存储控制器的结构示意图;FIG. 6 is a schematic structural diagram of another storage controller provided by an embodiment of the present invention;

图7为本发明实施例提供的一种集群存储系统的结构示意图。FIG. 7 is a schematic structural diagram of a clustered storage system provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

为了使本领域技术人员能够快速地理解本发明提供的技术方案与现有技术的区别,下面对与本发明相关的术语进行说明,并对现有的业务访问的方法进行介绍。In order to enable those skilled in the art to quickly understand the difference between the technical solution provided by the present invention and the prior art, terms related to the present invention will be described below, and existing service access methods will be introduced.

1)后台业务:集群存储系统为维护自身的可靠性,而自发在后台执行的保障措施,例如数据备份,数据迁移等,由于系统的维护无需实时操作,因此,该后台业务具有发生频率低的特点。1) Background business: In order to maintain its own reliability, the cluster storage system spontaneously executes safeguard measures in the background, such as data backup, data migration, etc. Since the maintenance of the system does not require real-time operation, this background business has a low frequency of occurrence features.

2)主机业务:集群存储系统接收用户下发的指令执行的数据读写操作,主机业务是实时进行的,具有发生频率高的特点,并且该集群存储系统的主机业务在同一时间不会多次访问同一操作对象。2) Host business: The cluster storage system receives the data read and write operations executed by the instructions issued by the user. The host business is carried out in real time and has the characteristics of high occurrence frequency, and the cluster storage system host business will not be performed multiple times at the same time access the same operand.

3)操作对象:存储空间中用于存储数据的地址。3) Operation object: the address used to store data in the storage space.

4)资源锁:存储控制器访问操作对象所需要的唯一“钥匙”,存储控制器只有在确定将要访问的操作对象对应的资源锁处于未使用状态时,才能够对该操作对象进行访问。4) Resource lock: the only "key" required by the storage controller to access the operation object. The storage controller can only access the operation object when it determines that the resource lock corresponding to the operation object to be accessed is in an unused state.

现有的集群存储系统如图2所示,该集群存储系统包括:主存储控制器、至少一个备存储控制器、以及存储空间,其中,该主存储控制器与每个备存储控制器相连,所有存储控制器(包括主存储控制器和备存储控制器)分别与该存储空间相连;所有的存储控制器均用于访问存储空间中的操作对象;该主存储控制器还用于管理存储空间中的每个操作对象对应的资源锁。由图2可知,每一个存储控制器不管是执行主机业务还是后台业务,均会向主存储控制器申请对资源锁进行加锁,由于该主机业务的发生频率高的特点,很可能发生大量业务高并发向该主存储控制器发出申请的情况,造成该主存储控制器发生性能瓶颈。The existing cluster storage system is shown in Figure 2, the cluster storage system includes: a main storage controller, at least one backup storage controller, and a storage space, wherein the main storage controller is connected to each backup storage controller, All storage controllers (including primary storage controller and backup storage controller) are respectively connected to the storage space; all storage controllers are used to access operation objects in the storage space; the primary storage controller is also used to manage the storage space The resource lock corresponding to each operation object in . It can be seen from Figure 2 that each storage controller will apply to the main storage controller to lock the resource lock no matter whether it is executing host business or background business. Due to the high frequency of the host business, a large number of business operations are likely High concurrency applications to the primary storage controller cause performance bottlenecks in the primary storage controller.

本发明实施例提供一种业务访问的方法,应用于集群存储系统,该集群存储系统包括至少两个存储控制器,所述至少两个存储控制器均存储有该集群储存系统的存储空间中的所有操作对象的资源锁,如图3所示,该方法包括:An embodiment of the present invention provides a method for service access, which is applied to a clustered storage system. The clustered storage system includes at least two storage controllers, and each of the at least two storage controllers stores the data stored in the storage space of the clustered storage system. Resource locks for all operation objects, as shown in Figure 3, this method includes:

S301、第一存储控制器接收主机业务的操作指令;该操作指令包括操作对象标识。S301. The first storage controller receives an operation instruction of a host service; the operation instruction includes an operation object identifier.

其中,该第一存储控制器为该至少两个存储控制器中的任一个。Wherein, the first storage controller is any one of the at least two storage controllers.

S302、该第一存储控制器根据该操作对象标识确定该第一存储控制器存储的该操作对象的资源锁为未使用状态。S302. The first storage controller determines according to the operation object identifier that the resource lock of the operation object stored by the first storage controller is in an unused state.

S303、该第一存储控制器对该操作对象的资源锁进行加锁,加锁后的该资源锁为已使用状态。S303. The first storage controller locks the resource lock of the operation object, and the locked resource lock is in a used state.

S304、该第一存储控制器按照该操作指令访问该操作对象。S304. The first storage controller accesses the operation object according to the operation instruction.

示例地,步骤S302和步骤S303包括:该第一存储控制器在自身存储的锁配置表中查询对应该操作对象标识的资源锁的使用状态,其中,该锁配置表中包括操作对象标识、与操作对象标识一一对应的资源锁的使用状态;若该资源锁当前处于未使用状态,则将该资源锁的该未使用状态更改为已使用状态;若该资源锁当前处于已使用状态,则在查询到该资源锁处于未使用状态后,将该未使用状态更改为已使用状态。Exemplarily, steps S302 and S303 include: the first storage controller queries the use status of the resource lock corresponding to the operation object identifier in the lock configuration table stored by the first storage controller, wherein the lock configuration table includes the operation object identifier, and The operation object identifier corresponds to the usage state of the resource lock; if the resource lock is currently in the unused state, change the unused state of the resource lock to the used state; if the resource lock is currently in the used state, then After querying that the resource lock is in the unused state, change the unused state to the used state.

其中,该锁配置表可以以表格的形式存储于该第一存储控制器中,如下表1所示:Wherein, the lock configuration table may be stored in the first storage controller in the form of a table, as shown in Table 1 below:

表1Table 1

操作对象标识Operand ID 资源锁的状态The state of the resource lock 操作对象1Operation object 1 资源锁1未使用Resource lock 1 is not used 操作对象2Operation object 2 资源锁2已使用Resource lock 2 is used ……... ……... 操作对象NOperation object N 资源锁3未使用Resource lock 3 is not used

由表1,若该操作对象标识为操作对象1,则该第一存储控制器在表1中查询操作对象1对应的资源锁1的状态,若该资源锁1的状态为未使用状态,则该第一存储控制器将该资源锁1的状态更改为已使用状态,并按照该主机业务的操作指令访问该操作对象1,执行该主机业务;若该资源锁1的状态为已使用状态,则该第一存储控制器等待当前占用该资源锁1的业务(该业务是该第一存储控制器的后台业务或者是其他存储控制器的后台业务)执行完毕,将该资源锁1的状态更改为未使用状态后,将该资源锁1的状态更改为已使用状态。From Table 1, if the operation object is identified as operation object 1, then the first storage controller queries the state of the resource lock 1 corresponding to the operation object 1 in Table 1, and if the state of the resource lock 1 is unused, then The first storage controller changes the state of the resource lock 1 to a used state, and accesses the operation object 1 according to the operation instruction of the host service, and executes the host service; if the state of the resource lock 1 is in use, Then the first storage controller waits for the business currently occupying the resource lock 1 (the business is the background business of the first storage controller or the background business of other storage controllers) to finish executing, and changes the state of the resource lock 1 After it is in the unused state, change the state of the resource lock 1 to the used state.

上述表1只是举例说明,该锁配置表还可以以其他形式存储于该第一存储控制器中,其具体形式可以根据实际需求进行确定,本发明对此不作限定。The above Table 1 is just an example, and the lock configuration table can also be stored in the first storage controller in other forms, and the specific form can be determined according to actual needs, which is not limited in the present invention.

采用上述方法,集群存储系统中的任一存储控制器在接收到主机业务的操作指令时,只需对该存储控制器存储的对应操作对象的资源锁进行加锁,即可按照该操作指令访问操作对象,无需向其他存储控制器发送加锁请求消息,相比现有技术中,存储控制器在接收到主机业务的操作指令时,需发送加锁请求消息至主存储控制器请求加锁,本发明提高了主机业务的执行效率,并且由于各存储控制器的加锁地位平等,不会造成某一存储控制器发生性能瓶颈。Using the above method, when any storage controller in the cluster storage system receives an operation command of the host service, it only needs to lock the resource lock of the corresponding operation object stored by the storage controller, and can access the server according to the operation command. The operation object does not need to send a lock request message to other storage controllers. Compared with the prior art, when the storage controller receives the operation command of the host service, it needs to send a lock request message to the main storage controller to request lock. The invention improves the execution efficiency of the host business, and because the locking status of each storage controller is equal, no performance bottleneck will occur in a certain storage controller.

然而,为了保证该第一存储控制器在执行主机业务时,只需对该第一存储控制器存储的对应操作对象的资源锁进行加锁即可与其他业务的互斥,在本发明实施例的一种可能的实现方式中,该集群存储系统的中任一存储控制器在执行后台业务之前,需向该集群存储系统中的所有存储控制器请求加锁。However, in order to ensure that the first storage controller only needs to lock the resource lock of the corresponding operation object stored by the first storage controller when executing the host service, it can be mutually exclusive with other services, in the embodiment of the present invention In a possible implementation manner of , any storage controller in the clustered storage system needs to request locks from all storage controllers in the clustered storage system before executing background services.

具体地,该第一存储控制器接收后台业务的操作指令,该后台业务的操作指令包括该操作对象标识;在确定该第一存储控制器存储的该操作对象的资源锁为未使用状态时,对该操作对象的资源锁进行加锁;分别向该集群存储系统中除该第一存储控制器以外的所有存储控制器发送加锁请求消息,该加锁请求消息用于指示存储控制器对该操作对象的资源锁进行加锁;在该集群存储系统中所有存储控制器对该操作对象的资源锁加锁完成后,按照该后台业务的操作指令访问该操作对象。Specifically, the first storage controller receives an operation instruction of the background service, and the operation instruction of the background service includes the operation object identifier; when it is determined that the resource lock of the operation object stored by the first storage controller is in an unused state, Lock the resource lock of the operation object; send a lock request message to all storage controllers in the cluster storage system except the first storage controller respectively, and the lock request message is used to instruct the storage controller to the The resource lock of the operation object is locked; after all the storage controllers in the cluster storage system complete the locking of the resource lock of the operation object, they access the operation object according to the operation instruction of the background business.

示例地,该加锁请求消息携带该操作对象标识,该第二存储控制器在接收到该加锁请求消息后,根据该操作对象标识对该第二存储控制器存储的该操作对象的资源锁进行加锁,并在加锁成功后,向该第一存储控制器发送加锁响应消息,该第二存储控制器对资源锁加锁的过程可参照上述第一存储控制器对该操作对象标识对应的资源锁加锁的过程,此处不再赘述。For example, the lock request message carries the operation object identifier, and after receiving the lock request message, the second storage controller locks the resource lock of the operation object stored in the second storage controller according to the operation object identifier. Locking is performed, and after the locking is successful, a lock response message is sent to the first storage controller. The process of locking the resource lock by the second storage controller can refer to the above-mentioned operation object identifier of the first storage controller. The process of locking the corresponding resource lock will not be repeated here.

进一步地,该第一存储控制器在该集群存储系统中的所有存储控制器加锁成功后执行该后台业务,也就是说,该第一存储控制器在对自身存储的对应该操作对象标识的资源锁加锁成功,且接收到该集群存储系统中除该第一存储控制器以外的所有存储控制器发送的加锁响应消息后,执行该后台业务。Further, the first storage controller executes the background service after all storage controllers in the cluster storage system are successfully locked, that is, the first storage controller performs the background service on its own storage corresponding to the operation object identifier After the resource lock is successfully locked and the lock response messages sent by all storage controllers in the cluster storage system except the first storage controller are received, the background service is executed.

示例地,该集群储存系统中的每一个存储控制器都存储了如上表1所示的锁配置表。如图4所示,该第一存储控制器向第二存储控制器发送加锁申请消息,该加锁申请消息包括操作对象1的标识,则该第二存储控制器在接收到该加锁申请消息后,查询该第二存储控制器存储的锁配置表,若该第二存储控制器存储的锁配置表中,操作对象1对应的资源锁1的状态为未使用状态,则该第二存储控制器将该资源锁1的状态更改为已使用状态,并向该第一存储控制器发送加锁响应消息,指示该第一存储控制器加锁成功。若该操作对象1对应的资源锁1的状态为已使用状态,则等待当前占用该资源锁1的业务执行完毕并释放该资源锁1后,确定该资源锁1处于未使用状态,则该第二存储控制器将该资源锁1的状态更改为已使用状态,并向该第一存储控制器发送加锁响应消息,指示该第一存储控制器加锁成功。Exemplarily, each storage controller in the cluster storage system stores the lock configuration table shown in Table 1 above. As shown in Figure 4, the first storage controller sends a lock application message to the second storage controller, and the lock application message includes the identifier of the operation object 1, then the second storage controller receives the lock application After receiving the message, query the lock configuration table stored by the second storage controller. If the status of the resource lock 1 corresponding to the operation object 1 in the lock configuration table stored by the second storage controller is unused, the second storage The controller changes the status of the resource lock 1 to the used status, and sends a lock response message to the first storage controller, indicating that the first storage controller is successfully locked. If the resource lock 1 corresponding to the operation object 1 is in the used state, wait for the service currently occupying the resource lock 1 to be executed and release the resource lock 1, and then determine that the resource lock 1 is in the unused state, then the second The second storage controller changes the status of the resource lock 1 to the used status, and sends a lock response message to the first storage controller, indicating that the first storage controller has successfully locked it.

另外,该第一存储控制器在接收到第二存储控制器发送的包括该操作对象标识的加锁请求消息时,根据该加锁请求消息对该第一存储控制器存储的该操作对象的资源锁进行加锁,并在加锁完成后向该第二存储控制器发送加锁响应消息,该第二存储控制器为该集群存储系统中除该第一存储控制器以外的任一存储控制器。In addition, when the first storage controller receives the lock request message including the operation object identifier sent by the second storage controller, the resources of the operation object stored in the first storage controller according to the lock request message The lock is locked, and after the lock is completed, a lock response message is sent to the second storage controller, and the second storage controller is any storage controller in the cluster storage system except the first storage controller .

这样,该第一存储控制器在执行后台业务时,该集群存储系统中每个存储控制器存储的锁配置表中对应该后台业务的操作对象的资源锁的状态均为已使用状态,此时,该集群存储系统中每个存储控制器都无法针对该操作对象执行其他的业务,保证了业务间的互斥。In this way, when the first storage controller is executing the background business, the resource locks corresponding to the operation objects of the background business in the lock configuration table stored by each storage controller in the cluster storage system are in the used state. , each storage controller in the cluster storage system cannot perform other services for the operation object, which ensures mutual exclusion among services.

此外,在第二存储控制器执行后台业务时,该第一存储控制器也将接收该第二存储控制器发送的加锁请求消息进行加锁。这样,该集群存储系统的任一存储控制器在对操作对象执行后台业务时,该集群存储系统中的所有存储控制器对应该操作对象的资源锁均处于已使用状态。也就是说,若某一存储控制器自身存储的对应该操作对象的资源锁处于未使用状态,表明此时不存在任何存储控制器对该操作对象执行后台业务,此时,若该存储控制器接收到对该操作对象执行主机业务的操作指令,只需对自身存储的对应该操作对象的资源锁进行加锁即可执行该主机业务(由于该集群存储系统的主机业务在同一时间不会多次访问同一操作对象,因此不用考虑不同主机业务之间的互斥)。In addition, when the second storage controller executes the background service, the first storage controller will also receive the lock request message sent by the second storage controller and perform locking. In this way, when any storage controller of the cluster storage system executes a background service on the operation object, the resource locks corresponding to the operation object of all storage controllers in the cluster storage system are in a used state. That is to say, if the resource lock corresponding to the operation object stored by a certain storage controller is in an unused state, it indicates that there is no storage controller performing background business on the operation object at this time. At this time, if the storage controller After receiving the operation instruction to execute the host business on the operation object, the host business can be executed only by locking the resource lock corresponding to the operation object stored by itself (because the host business of the cluster storage system is not much at the same time). Access to the same operation object at a time, so there is no need to consider the mutual exclusion between different host services).

进一步地,该第一存储控制器在执行完业务后,均需要对该业务占用的资源锁进行释放。具体地,该第一存储控制器在按照该主机业务的操作指令访问该操作对象之后,将该第一存储控制器存储的该操作对象的资源锁释放,释放后的该资源锁为未使用状态;该第一存储控制器在按照该后台业务的操作指令访问该操作对象之后,将该第一存储控制器存储的该操作对象的资源锁释放,并向该集群存储系统中的除该第一存储控制器以外的所有存储控制器发送状态变更消息,以便接收到该状态变更消息的存储控制器将该操作对象的资源锁释放。Further, the first storage controller needs to release the resource lock occupied by the service after executing the service. Specifically, after the first storage controller accesses the operation object according to the operation instruction of the host service, the resource lock of the operation object stored in the first storage controller is released, and the resource lock after release is in an unused state ; After the first storage controller accesses the operation object according to the operation instruction of the background service, the resource lock of the operation object stored by the first storage controller is released, and the cluster storage system except the first All storage controllers other than the storage controller send a state change message, so that the storage controller that receives the state change message releases the resource lock of the operation object.

由上可知,本发明实施例中的存储控制器在执行主机业务时,未向其他存储控制器申请加锁,不会造成某一存储控制器发生性能瓶颈,同时,另外,由于该集群存储系统中各个存储控制器均存储了操作对象标识与资源锁的使用状态的对应关系,因此,某一个存储控制器发生故障,不影响该集群存储系统的业务访问。It can be seen from the above that the storage controller in the embodiment of the present invention does not apply for locks from other storage controllers when executing the host business, which will not cause a performance bottleneck of a storage controller. At the same time, in addition, because the cluster storage system Each storage controller in the cluster stores the corresponding relationship between the operation object identifier and the usage status of the resource lock. Therefore, if a storage controller fails, it will not affect the service access of the cluster storage system.

本发明实施例提供一种存储控制器50,对应上述图3的方法实施例,该存储控制器50的各个功能单元均可用于上述方法步骤。如图5所示,该存储控制器50包括:An embodiment of the present invention provides a storage controller 50, which corresponds to the method embodiment in FIG. 3 above, and each functional unit of the storage controller 50 can be used in the above method steps. As shown in Figure 5, the storage controller 50 includes:

存储单元51,用于存储集群储存系统的存储空间中的所有操作对象的资源锁。The storage unit 51 is configured to store resource locks of all operation objects in the storage space of the cluster storage system.

第一接收单元52,用于接收主机业务的操作指令,该操作指令包括操作对象标识。The first receiving unit 52 is configured to receive an operation instruction of the host service, where the operation instruction includes an operation object identifier.

加锁单元53,用于根据该操作对象标识确定该存储控制器存储的该操作对象的资源锁为未使用状态,对该操作对象的资源锁进行加锁;加锁后的该资源锁为已使用状态。The locking unit 53 is configured to determine, according to the operation object identifier, that the resource lock of the operation object stored by the storage controller is in an unused state, and lock the resource lock of the operation object; the locked resource lock is used status of use.

第一访问单元54,用于按照该操作指令访问该操作对象。The first access unit 54 is configured to access the operation object according to the operation instruction.

采用上述方法,集群存储系统中的任一存储控制器在接收到主机业务的操作指令时,只需对该存储控制器存储的对应操作对象的资源锁进行加锁,即可按照该操作指令访问操作对象,无需向其他存储控制器发送加锁请求消息,相比现有技术中,存储控制器在接收到主机业务的操作指令时,需发送加锁请求消息至主存储控制器请求加锁,本发明提高了主机业务的执行效率,并且由于各存储控制器的加锁地位平等,不会造成某一存储控制器发生性能瓶颈。Using the above method, when any storage controller in the cluster storage system receives an operation command of the host service, it only needs to lock the resource lock of the corresponding operation object stored by the storage controller, and can access the server according to the operation command. The operation object does not need to send a lock request message to other storage controllers. Compared with the prior art, when the storage controller receives the operation command of the host service, it needs to send a lock request message to the main storage controller to request lock. The invention improves the execution efficiency of the host business, and because the locking status of each storage controller is equal, no performance bottleneck will occur in a certain storage controller.

然而,为了保证该存储控制器在执行主机业务时,只需对该存储控制器存储的对应操作对象的资源锁进行加锁即可与其他业务的互斥,在本发明实施例的一种可能的实现方式中,该集群存储系统的中任一存储控制器在执行后台业务之前,需向该集群存储系统中的所有存储控制器请求加锁。However, in order to ensure that the storage controller only needs to lock the resource lock of the corresponding operation object stored by the storage controller when executing the host service, it can be mutually exclusive with other services. In an implementation manner, any storage controller in the cluster storage system needs to request locks from all storage controllers in the cluster storage system before executing background services.

因此,可选地,该存储控制器还包括:Therefore, optionally, the storage controller also includes:

第二接收单元55,用于接收后台业务的操作指令,该后台业务的操作指令包括该操作对象标识。The second receiving unit 55 is configured to receive an operation instruction of a background service, where the operation instruction of the background service includes the operation object identifier.

发送单元56,用于分别向该集群存储系统中除该存储控制器以外的所有存储控制器发送加锁请求消息,该加锁请求消息用于指示存储控制器对该操作对象的资源锁进行加锁。The sending unit 56 is configured to send a lock request message to all storage controllers in the cluster storage system except the storage controller, and the lock request message is used to instruct the storage controller to lock the resource lock of the operation object. Lock.

第二访问单元57,用于在该集群存储系统中所有存储控制器对该操作对象的资源锁加锁完成后,按照该后台业务的操作指令访问该操作对象。The second access unit 57 is configured to access the operation object according to the operation instruction of the background service after all the storage controllers in the cluster storage system finish locking the resource locks of the operation object.

示例地,该加锁请求消息携带该操作对象标识,该第二存储控制器在接收到该加锁请求消息后,根据该操作对象标识对该第二存储控制器存储的该操作对象的资源锁进行加锁,并在加锁成功后,向该存储控制器发送加锁响应消息。For example, the lock request message carries the operation object identifier, and after receiving the lock request message, the second storage controller locks the resource lock of the operation object stored in the second storage controller according to the operation object identifier. Locking is performed, and after the locking is successful, a locking response message is sent to the storage controller.

进一步地,该存储控制器在该集群存储系统中的所有存储控制器加锁成功后执行该后台业务,也就是说,该存储控制器在对自身存储的对应该操作对象标识的资源锁加锁成功,且接收到该集群存储系统中除该存储控制器以外的所有存储控制器发送的加锁响应消息后,执行该后台业务。Further, the storage controller executes the background business after all storage controllers in the cluster storage system are successfully locked, that is, the storage controller locks the resource lock corresponding to the operation object identifier stored in itself After the process is successful, and the lock response messages sent by all the storage controllers in the cluster storage system except the storage controller are received, the background service is executed.

可选地,该存储控制器还包括:Optionally, the storage controller also includes:

第三接收单元58,用于接收第二存储控制器发送的包括该操作对象标识的加锁请求消息;该第二存储控制器为该集群存储系统中除该存储控制器以外的任一存储控制器。The third receiving unit 58 is configured to receive the lock request message including the operation object identifier sent by the second storage controller; the second storage controller is any storage controller in the cluster storage system except the storage controller device.

该加锁单元53还用于,根据该加锁请求消息对该存储控制器存储的该操作对象的资源锁进行加锁。The locking unit 53 is further configured to lock the resource lock of the operation object stored by the storage controller according to the lock request message.

该发送单元56,用于向该第二存储控制器发送加锁响应消息。The sending unit 56 is configured to send a lock response message to the second storage controller.

这样,该存储控制器在执行后台业务时,该集群存储系统中每个存储控制器存储的锁配置表中对应该后台业务的操作对象的资源锁的状态均为已使用状态,此时,该集群存储系统中每个存储控制器都无法针对该操作对象执行其他的业务,保证了业务间的互斥。In this way, when the storage controller is executing the background business, the status of the resource lock corresponding to the operation object of the background business in the lock configuration table stored by each storage controller in the cluster storage system is in the used state. Each storage controller in the cluster storage system cannot perform other services for the operation object, which ensures mutual exclusion among services.

此外,在第二存储控制器执行后台业务时,该存储控制器也将接收该第二存储控制器发送的加锁请求消息进行加锁。这样,该集群存储系统的任一存储控制器在对操作对象执行后台业务时,该集群存储系统中的所有存储控制器对应该操作对象的资源锁均处于已使用状态。也就是说,若某一存储控制器自身存储的对应该操作对象的资源锁处于未使用状态,表明此时不存在任何存储控制器对该操作对象执行后台业务,此时,若该存储控制器接收到对该操作对象执行主机业务的操作指令,只需对自身存储的对应该操作对象的资源锁进行加锁即可执行该主机业务(由于该集群存储系统的主机业务在同一时间不会多次访问同一操作对象,因此不用考虑不同主机业务之间的互斥)。In addition, when the second storage controller executes the background service, the storage controller will also receive the lock request message sent by the second storage controller and perform locking. In this way, when any storage controller of the cluster storage system executes a background service on the operation object, the resource locks of all storage controllers in the cluster storage system corresponding to the operation object are in a used state. That is to say, if the resource lock corresponding to the operation object stored by a certain storage controller is in an unused state, it indicates that there is no storage controller performing background business on the operation object at this time. At this time, if the storage controller After receiving an operation instruction to execute the host business on the operation object, the host business can be executed only by locking the resource lock corresponding to the operation object stored by itself (because the cluster storage system does not have many host businesses at the same time). Access to the same operation object at a time, so there is no need to consider the mutual exclusion between different host services).

进一步地,该存储控制器在执行完业务后,均需要对该业务占用的资源锁进行释放。因此,可选地,该存储控制器还包括:Further, the storage controller needs to release the resource lock occupied by the service after executing the service. Therefore, optionally, the storage controller also includes:

释放单元59,用于在该第一访问单元按照该操作指令访问该操作对象之后,将该存储控制器存储的该操作对象的资源锁释放,释放后的该资源锁为未使用状态;在该第二访问单元按照该后台业务的操作指令访问该操作对象之后,将该存储控制器存储的该操作对象的资源锁释放;该发送单元56还用于,向该集群存储系统中的除该存储控制器以外的所有存储控制器发送状态变更消息,以便接收到该状态变更消息的存储控制器将该操作对象的资源锁释放。The release unit 59 is configured to release the resource lock of the operation object stored in the storage controller after the first access unit accesses the operation object according to the operation instruction, and the released resource lock is in an unused state; After the second access unit accesses the operation object according to the operation instruction of the background business, the resource lock of the operation object stored in the storage controller is released; the sending unit 56 is also used to delete the storage in the cluster storage system All storage controllers other than the controller send a state change message, so that the storage controller that receives the state change message releases the resource lock of the operation object.

另外,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。In addition, those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. , that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

本发明实施例提供一种存储控制器60,该存储控制器60为集群存储系统中的任一个存储控制器,如图6所示,包括:The embodiment of the present invention provides a storage controller 60, the storage controller 60 is any storage controller in the cluster storage system, as shown in FIG. 6, including:

处理器(processor)61、通信接口(Communications Interface)62、存储器(memory)63和通信总线64;其中,所述处理器61、所述通信接口62和所述存储器63通过所述通信总线64完成相互间的通信。Processor (processor) 61, communication interface (Communications Interface) 62, memory (memory) 63 and communication bus 64; Wherein, described processor 61, described communication interface 62 and described memory 63 complete by described communication bus 64 mutual communication.

处理器61可能是一个多核中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 61 may be a multi-core CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.

存储器63用于存放程序代码以及操作对象的资源锁,所述程序代码包括计算机操作指令和网络流图。存储器63可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 63 is used to store program codes and resource locks of operation objects, and the program codes include computer operation instructions and network flow diagrams. The memory 63 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory.

所述通信接口62,用于实现这些装置之间的连接通信。The communication interface 62 is used to realize connection and communication between these devices.

所述处理器61用于执行所述存储器63中的程序代码,以实现以下操作:The processor 61 is used to execute the program codes in the memory 63 to achieve the following operations:

所述方法应用于包括至少两个存储控制器的集群存储系统,所述至少两个存储控制器均存储有所述集群储存系统的存储空间中的所有操作对象的资源锁,所述方法包括:The method is applied to a clustered storage system including at least two storage controllers, and each of the at least two storage controllers stores resource locks of all operation objects in the storage space of the clustered storage system, and the method includes:

接收主机业务的操作指令;所述操作指令包括操作对象标识;所述存储控制器为所述至少两个存储控制器中的任一个;receiving an operation instruction of a host service; the operation instruction includes an operation object identifier; the storage controller is any one of the at least two storage controllers;

根据所述操作对象标识确定所述存储控制器存储的所述操作对象的资源锁为未使用状态;determining according to the operation object identifier that the resource lock of the operation object stored by the storage controller is in an unused state;

对所述操作对象的资源锁进行加锁,加锁后的所述资源锁为已使用状态;Locking the resource lock of the operation object, and the resource lock after locking is in a used state;

按照所述操作指令访问所述操作对象。The operation object is accessed according to the operation instruction.

可选地,所述操作还包括:Optionally, the operations also include:

接收后台业务的操作指令,所述后台业务的操作指令包括所述操作对象标识;receiving an operation instruction of a background service, where the operation instruction of the background service includes the operation object identifier;

在确定所述存储控制器存储的所述操作对象的资源锁为未使用状态时,对所述操作对象的资源锁进行加锁;Locking the resource lock of the operation object when it is determined that the resource lock of the operation object stored by the storage controller is in an unused state;

分别向所述集群存储系统中除所述存储控制器以外的所有存储控制器发送加锁请求消息,所述加锁请求消息用于指示存储控制器对所述操作对象的资源锁进行加锁;Sending lock request messages to all storage controllers in the cluster storage system except the storage controller respectively, where the lock request messages are used to instruct the storage controllers to lock the resource lock of the operation object;

在所述集群存储系统中所有存储控制器对所述操作对象的资源锁加锁完成后,按照所述后台业务的操作指令访问所述操作对象。After all the storage controllers in the cluster storage system lock the resource locks of the operation object, they access the operation object according to the operation instruction of the background service.

可选地,所述操作还包括:Optionally, the operations also include:

接收第二存储控制器发送的包括所述操作对象标识的加锁请求消息;所述第二存储控制器为所述集群存储系统中除所述存储控制器以外的任一存储控制器;receiving a lock request message including the operation object identifier sent by a second storage controller; the second storage controller is any storage controller in the cluster storage system except the storage controller;

根据所述加锁请求消息对所述存储控制器存储的所述操作对象的资源锁进行加锁;Lock the resource lock of the operation object stored by the storage controller according to the lock request message;

向所述第二存储控制器发送加锁响应消息。Send a lock response message to the second storage controller.

可选地,在所述按照所述操作指令访问所述操作对象之后,所述操作还包括:Optionally, after accessing the operation object according to the operation instruction, the operation further includes:

将所述存储控制器存储的所述操作对象的资源锁释放,释放后的所述资源锁为未使用状态;releasing the resource lock of the operation object stored by the storage controller, and the released resource lock is in an unused state;

在所述按照所述后台业务的操作指令访问所述操作对象之后,所述操作还包括:After accessing the operation object according to the operation instruction of the background service, the operation further includes:

将所述存储控制器存储的所述操作对象的资源锁释放;releasing the resource lock of the operation object stored by the storage controller;

向所述集群存储系统中的除所述存储控制器以外的所有存储控制器发送状态变更消息,以便接收到所述状态变更消息的存储控制器将所述操作对象的资源锁释放。Sending a state change message to all storage controllers in the cluster storage system except the storage controller, so that the storage controller receiving the state change message releases the resource lock of the operation object.

本发明实施例提供一种集群存储系统70,如图7所示,包括:An embodiment of the present invention provides a cluster storage system 70, as shown in FIG. 7 , including:

存储空间71、存储控制器72和存储控制器73,其中,该存储空间71分别与该存储控制器72和该储控制器73相连,该存储控制器72与该储控制器73相连。A storage space 71 , a storage controller 72 and a storage controller 73 , wherein the storage space 71 is connected to the storage controller 72 and the storage controller 73 respectively, and the storage controller 72 is connected to the storage controller 73 .

该存储空间71用于存储操作对象。The storage space 71 is used to store operation objects.

该存储控制器72为图5或者图6所示的存储控制器50或者存储控制器60,该73存储控制器为图5或者图6所示的存储控制器50或者存储控制器60,具体可参照图5或者图6对应的描述,此处不再赘述。The storage controller 72 is the storage controller 50 or the storage controller 60 shown in FIG. 5 or FIG. 6, and the storage controller 73 is the storage controller 50 or the storage controller 60 shown in FIG. 5 or FIG. Refer to the description corresponding to FIG. 5 or FIG. 6 , which will not be repeated here.

采用上述集群存储系统,该集群存储系统中的任一存储控制器在接收到主机业务的操作指令时,只需对该存储控制器存储的对应操作对象的资源锁进行加锁,即可按照该操作指令访问操作对象,无需向其他存储控制器发送加锁请求消息,相比现有技术中,存储控制器在接收到主机业务的操作指令时,需发送加锁请求消息至主存储控制器请求加锁,本发明提高了主机业务的执行效率,并且由于各存储控制器的加锁地位平等,不会造成某一存储控制器发生性能瓶颈。With the above cluster storage system, when any storage controller in the cluster storage system receives an operation command of the host service, it only needs to lock the resource lock of the corresponding operation object stored by the storage controller, and the The operation instruction accesses the operation object without sending a lock request message to other storage controllers. Compared with the prior art, when the storage controller receives the operation instruction of the host service, it needs to send a lock request message to the main storage controller to request Locking, the present invention improves the execution efficiency of host business, and because the locking status of each storage controller is equal, it will not cause a performance bottleneck of a certain storage controller.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理包括,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. All should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (9)

1.一种业务访问的方法,其特征在于,所述方法应用于包括至少两个存储控制器的集群存储系统,所述至少两个存储控制器均存储有所述集群储存系统的存储空间中的所有操作对象的资源锁,所述方法包括:1. A method for service access, characterized in that the method is applied to a clustered storage system comprising at least two storage controllers, and the at least two storage controllers are all stored in the storage space of the clustered storage system Resource locks for all operation objects, the methods include: 第一存储控制器接收主机业务的操作指令;所述操作指令包括操作对象标识;所述第一存储控制器为所述至少两个存储控制器中的任一个;The first storage controller receives an operation instruction of the host service; the operation instruction includes an operation object identifier; the first storage controller is any one of the at least two storage controllers; 根据所述操作对象标识确定所述第一存储控制器存储的所述操作对象的资源锁为未使用状态;determining according to the operation object identifier that the resource lock of the operation object stored by the first storage controller is in an unused state; 对所述操作对象的资源锁进行加锁,加锁后的所述资源锁为已使用状态;Locking the resource lock of the operation object, and the resource lock after locking is in a used state; 按照所述操作指令访问所述操作对象。The operation object is accessed according to the operation instruction. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 接收后台业务的操作指令,所述后台业务的操作指令包括所述操作对象标识;receiving an operation instruction of a background service, where the operation instruction of the background service includes the operation object identifier; 在确定所述第一存储控制器存储的所述操作对象的资源锁为未使用状态时,对所述操作对象的资源锁进行加锁;lock the resource lock of the operation object when it is determined that the resource lock of the operation object stored by the first storage controller is in an unused state; 分别向所述集群存储系统中除所述第一存储控制器以外的所有存储控制器发送加锁请求消息,所述加锁请求消息用于指示存储控制器对所述操作对象的资源锁进行加锁;Sending lock request messages to all storage controllers in the clustered storage system except the first storage controller respectively, where the lock request messages are used to instruct the storage controllers to lock the resource lock of the operation object Lock; 在所述集群存储系统中所有存储控制器对所述操作对象的资源锁加锁完成后,按照所述后台业务的操作指令访问所述操作对象。After all the storage controllers in the cluster storage system lock the resource locks of the operation object, they access the operation object according to the operation instruction of the background service. 3.根据权利要求1或2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1 or 2, characterized in that the method further comprises: 接收第二存储控制器发送的包括所述操作对象标识的加锁请求消息;所述第二存储控制器为所述集群存储系统中除所述第一存储控制器以外的任一存储控制器;receiving a lock request message including the operation object identifier sent by a second storage controller; the second storage controller is any storage controller in the cluster storage system except the first storage controller; 根据所述加锁请求消息对所述第一存储控制器存储的所述操作对象的资源锁进行加锁;Lock the resource lock of the operation object stored by the first storage controller according to the lock request message; 向所述第二存储控制器发送加锁响应消息。Send a lock response message to the second storage controller. 4.根据权利要求1或2所述的方法,其特征在于,在所述按照所述操作指令访问所述操作对象之后,包括:4. The method according to claim 1 or 2, characterized in that, after accessing the operation object according to the operation instruction, comprising: 将所述第一存储控制器存储的所述操作对象的资源锁释放,释放后的所述资源锁为未使用状态;releasing the resource lock of the operation object stored by the first storage controller, and the released resource lock is in an unused state; 在所述按照所述后台业务的操作指令访问所述操作对象之后,包括:After accessing the operation object according to the operation instruction of the background business, it includes: 将所述第一存储控制器存储的所述操作对象的资源锁释放;releasing the resource lock of the operation object stored by the first storage controller; 向所述集群存储系统中的除所述第一存储控制器以外的所有存储控制器发送状态变更消息,以便接收到所述状态变更消息的存储控制器将所述操作对象的资源锁释放。Sending a state change message to all storage controllers in the cluster storage system except the first storage controller, so that the storage controller receiving the state change message releases the resource lock of the operation object. 5.一种存储控制器,其特征在于,包括:5. A storage controller, characterized in that, comprising: 存储单元,用于存储集群储存系统的存储空间中的所有操作对象的资源锁;The storage unit is used to store the resource locks of all operation objects in the storage space of the cluster storage system; 第一接收单元,用于接收主机业务的操作指令,所述操作指令包括操作对象标识;The first receiving unit is configured to receive an operation instruction of the host service, where the operation instruction includes an operation object identifier; 加锁单元,用于根据所述操作对象标识确定所述存储控制器存储的所述操作对象的资源锁为未使用状态,对所述操作对象的资源锁进行加锁;加锁后的所述资源锁为已使用状态;A locking unit, configured to determine, according to the operation object identifier, that the resource lock of the operation object stored by the storage controller is in an unused state, and lock the resource lock of the operation object; the locked The resource lock is in use; 第一访问单元,用于按照所述操作指令访问所述操作对象。A first access unit, configured to access the operation object according to the operation instruction. 6.根据权利要求5所述的存储控制器,其特征在于,还包括:6. The storage controller according to claim 5, further comprising: 第二接收单元,用于接收后台业务的操作指令,所述后台业务的操作指令包括所述操作对象标识;The second receiving unit is configured to receive an operation instruction of a background service, where the operation instruction of the background service includes the operation object identifier; 发送单元,用于分别向所述集群存储系统中除所述存储控制器以外的所有存储控制器发送加锁请求消息,所述加锁请求消息用于指示存储控制器对所述操作对象的资源锁进行加锁;a sending unit, configured to send a lock request message to all storage controllers in the cluster storage system except the storage controller, and the lock request message is used to instruct the storage controller to use resources of the operation object Lock to lock; 第二访问单元,用于在所述集群存储系统中所有存储控制器对所述操作对象的资源锁加锁完成后,按照所述后台业务的操作指令访问所述操作对象。The second access unit is configured to access the operation object according to the operation instruction of the background service after all the storage controllers in the cluster storage system have completed locking the resource locks of the operation object. 7.根据权利要求5或6所述的存储控制器,其特征在于,还包括:7. The storage controller according to claim 5 or 6, further comprising: 第三接收单元,用于接收第二存储控制器发送的包括所述操作对象标识的加锁请求消息;所述第二存储控制器为所述集群存储系统中除所述存储控制器以外的任一存储控制器;The third receiving unit is configured to receive the lock request message including the operation object identifier sent by the second storage controller; the second storage controller is any storage controller in the cluster storage system except the storage controller a storage controller; 所述加锁单元还用于,根据所述加锁请求消息对所述存储控制器存储的所述操作对象的资源锁进行加锁;The locking unit is further configured to lock the resource lock of the operation object stored by the storage controller according to the lock request message; 所述发送单元,用于向所述第二存储控制器发送加锁响应消息。The sending unit is configured to send a lock response message to the second storage controller. 8.根据权利要求5或6所述的存储控制器,其特征在于,还包括:8. The storage controller according to claim 5 or 6, further comprising: 释放单元,用于在所述第一访问单元按照所述操作指令访问所述操作对象之后,将所述存储控制器存储的所述操作对象的资源锁释放,释放后的所述资源锁为未使用状态;A releasing unit, configured to release the resource lock of the operation object stored by the storage controller after the first access unit accesses the operation object according to the operation instruction, and the released resource lock is not status of use; 在所述第二访问单元按照所述后台业务的操作指令访问所述操作对象之后,将所述存储控制器存储的所述操作对象的资源锁释放;After the second access unit accesses the operation object according to the operation instruction of the background service, release the resource lock of the operation object stored by the storage controller; 所述发送单元还用于,向所述集群存储系统中的除所述存储控制器以外的所有存储控制器发送状态变更消息,以便接收到所述状态变更消息的存储控制器将所述操作对象的资源锁释放。The sending unit is further configured to send a state change message to all storage controllers in the cluster storage system except the storage controller, so that the storage controller receiving the state change message will set the operation object to The resource lock is released. 9.一种集群存储系统,其特征在于,包括存储空间和至少两个存储控制器,所述至少两个存储控制器均与所述存储空间相连,所述至少两个存储控制器中的任一存储控制器分别与其他所有存储控制器相连;9. A cluster storage system, characterized in that it comprises a storage space and at least two storage controllers, the at least two storage controllers are all connected to the storage space, and any of the at least two storage controllers A storage controller is respectively connected with all other storage controllers; 所述存储控制器为权利要求5至8任一项所述的存储控制器;The storage controller is the storage controller according to any one of claims 5 to 8; 所述存储空间用于存储操作对象。The storage space is used to store operation objects.
CN201410655484.3A 2014-11-17 2014-11-17 A business access method, storage controller, and cluster storage system Active CN104461705B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410655484.3A CN104461705B (en) 2014-11-17 2014-11-17 A business access method, storage controller, and cluster storage system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410655484.3A CN104461705B (en) 2014-11-17 2014-11-17 A business access method, storage controller, and cluster storage system

Publications (2)

Publication Number Publication Date
CN104461705A true CN104461705A (en) 2015-03-25
CN104461705B CN104461705B (en) 2019-02-19

Family

ID=52907807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410655484.3A Active CN104461705B (en) 2014-11-17 2014-11-17 A business access method, storage controller, and cluster storage system

Country Status (1)

Country Link
CN (1) CN104461705B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106372030A (en) * 2016-10-27 2017-02-01 郑州云海信息技术有限公司 Method and device for data synchronization of dual controller storage system
CN108572876A (en) * 2018-03-07 2018-09-25 北京神州绿盟信息安全科技股份有限公司 A kind of implementation method and device of Read-Write Locks
CN110209641A (en) * 2018-02-12 2019-09-06 杭州宏杉科技股份有限公司 A kind of trunking service processing method and device applied in more controlled storage systems
CN110580232A (en) * 2018-06-08 2019-12-17 杭州宏杉科技股份有限公司 Lock management method and device
US11416313B2 (en) * 2018-01-05 2022-08-16 Beijing Kingsoft Cloud Network Technology Co., Ltd. Equipment control method, cluster system , electronic device and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165938A1 (en) * 2003-12-24 2005-07-28 Linden Cornett Method, system, and program for managing shared resources
CN1945539A (en) * 2006-10-19 2007-04-11 华为技术有限公司 Method for distributing shared resource lock in computer cluster system and cluster system
CN101013381A (en) * 2007-01-26 2007-08-08 华中科技大学 Distributed lock based on object memory system
CN103248667A (en) * 2012-02-14 2013-08-14 阿里巴巴集团控股有限公司 Resource access method and system for distributed system
CN103731485A (en) * 2013-12-26 2014-04-16 华为技术有限公司 Network equipment, cluster storage system and distributed lock management method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165938A1 (en) * 2003-12-24 2005-07-28 Linden Cornett Method, system, and program for managing shared resources
CN1945539A (en) * 2006-10-19 2007-04-11 华为技术有限公司 Method for distributing shared resource lock in computer cluster system and cluster system
CN101013381A (en) * 2007-01-26 2007-08-08 华中科技大学 Distributed lock based on object memory system
CN103248667A (en) * 2012-02-14 2013-08-14 阿里巴巴集团控股有限公司 Resource access method and system for distributed system
CN103731485A (en) * 2013-12-26 2014-04-16 华为技术有限公司 Network equipment, cluster storage system and distributed lock management method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106372030A (en) * 2016-10-27 2017-02-01 郑州云海信息技术有限公司 Method and device for data synchronization of dual controller storage system
US11416313B2 (en) * 2018-01-05 2022-08-16 Beijing Kingsoft Cloud Network Technology Co., Ltd. Equipment control method, cluster system , electronic device and readable storage medium
CN110209641A (en) * 2018-02-12 2019-09-06 杭州宏杉科技股份有限公司 A kind of trunking service processing method and device applied in more controlled storage systems
CN108572876A (en) * 2018-03-07 2018-09-25 北京神州绿盟信息安全科技股份有限公司 A kind of implementation method and device of Read-Write Locks
CN110580232A (en) * 2018-06-08 2019-12-17 杭州宏杉科技股份有限公司 Lock management method and device
CN110580232B (en) * 2018-06-08 2021-10-29 杭州宏杉科技股份有限公司 Lock management method and device

Also Published As

Publication number Publication date
CN104461705B (en) 2019-02-19

Similar Documents

Publication Publication Date Title
US11042311B2 (en) Cluster system with calculation and storage converged
JP5510556B2 (en) Method and system for managing virtual machine storage space and physical hosts
US11671497B2 (en) Cluster hierarchy-based transmission of data to a storage node included in a storage node cluster
CN107402722B (en) A data migration method and storage device
US11262916B2 (en) Distributed storage system, data processing method, and storage node
US20220114145A1 (en) Resource Lock Management Method And Apparatus
EP3217248B1 (en) Method and system for writing data
CN103744719B (en) Lock management method and system, the collocation method and device of lock administration system
EP3470984B1 (en) Method, device, and system for managing disk lock
CN106936931B (en) Method, related equipment and system for realizing distributed lock
JP2017530437A (en) Distributed workload reassignment after communication failure
CN106776998A (en) A kind of database service provides method and server
US9875059B2 (en) Storage system
US20180364948A1 (en) Data Processing Method, Related Device, and Storage System
CN103634379A (en) Management method for distributed storage space and distributed storage system
WO2019062856A1 (en) Data reconstruction method and apparatus, and data storage system
CN104461705A (en) Service access method, storage controllers and cluster storage system
WO2021082465A1 (en) Method for ensuring data consistency and related device
CN108512782A (en) Accesses control list is grouped method of adjustment, the network equipment and system
CN112099728B (en) A method and device for performing write and read operations
US9747323B1 (en) Method for reconstruction of a distributed lock state after a node addition or removal using a consistent hash
US11231964B2 (en) Computing device shared resource lock allocation
US9755986B1 (en) Techniques for tightly-integrating an enterprise storage array into a distributed virtualized computing environment
EP3358795B1 (en) Method and apparatus for allocating a virtual resource in network functions virtualization (nfv) network
CN110019475B (en) Data persistence processing method, device and system

Legal Events

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