[go: up one dir, main page]

CN104023076A - Method for managing Ethernet interface hard disk capacity and multi-tenant interchanger - Google Patents

Method for managing Ethernet interface hard disk capacity and multi-tenant interchanger Download PDF

Info

Publication number
CN104023076A
CN104023076A CN201410271382.1A CN201410271382A CN104023076A CN 104023076 A CN104023076 A CN 104023076A CN 201410271382 A CN201410271382 A CN 201410271382A CN 104023076 A CN104023076 A CN 104023076A
Authority
CN
China
Prior art keywords
hard disk
address
ethernet interface
storage space
host
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
CN201410271382.1A
Other languages
Chinese (zh)
Other versions
CN104023076B (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 CN201410271382.1A priority Critical patent/CN104023076B/en
Publication of CN104023076A publication Critical patent/CN104023076A/en
Application granted granted Critical
Publication of CN104023076B publication Critical patent/CN104023076B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

本发明涉及一种以太网接口硬盘容量的管理方法和多租户交换机。该方法包括:根据所接收到的硬盘配置信息,向每个以太网接口硬盘发送容量分配命令,容量分配命令中包括主机IP地址与分配给主机IP地址的硬盘存储空间;接收并存储每个以太网接口硬盘发送的主机IP地址与分配给主机IP地址的硬盘存储空间的对应关系;当接收到主机下发的写以太网接口硬盘的写操作命令时,判断写操作命令中的写操作地址是否包含在分配给IP地址的硬盘存储空间中,如果是,则将写操作命令转发至硬盘存储空间对应的以太网接口硬盘,并且调整IP地址对应的可用硬盘存储空间大小。本发明简化了以太网接口硬盘的组网和容量管理。

The invention relates to a method for managing hard disk capacity of an Ethernet interface and a multi-tenant switch. The method includes: according to the received hard disk configuration information, sending a capacity allocation command to each Ethernet interface hard disk, the capacity allocation command includes the host IP address and the hard disk storage space allocated to the host IP address; receiving and storing each Ethernet interface The corresponding relationship between the host IP address sent by the network interface hard disk and the hard disk storage space allocated to the host IP address; Included in the hard disk storage space allocated to the IP address, if so, forward the write operation command to the hard disk with the Ethernet interface corresponding to the hard disk storage space, and adjust the size of the available hard disk storage space corresponding to the IP address. The invention simplifies the networking and capacity management of the Ethernet interface hard disk.

Description

以太网接口硬盘容量的管理方法和多租户交换机Method for managing hard disk capacity of Ethernet interface and multi-tenant switch

技术领域technical field

本发明涉及网络存储技术,尤其涉及一种以太网接口硬盘容量的管理方法和多租户交换机。The invention relates to network storage technology, in particular to a method for managing hard disk capacity of an Ethernet interface and a multi-tenant switch.

背景技术Background technique

随着云存储技术和网络存储应用的兴起,以太网接口硬盘的应用越来越广泛,目前已经实现网络功能的硬盘装置,都是以SAS(Serial Attached SmallComputer System Interface,串行小型计算机系统接口技术)硬盘和串行高级技术附件(Serial Advanced Technology Attachment,SATA)硬盘为基础,在SAS或SATA硬盘外部增加转换电路,可以为该硬盘提供以太网接口,通过该以太网接口可将以太网接口硬盘接入网络。With the rise of cloud storage technology and network storage applications, hard disks with Ethernet interfaces are more and more widely used. At present, hard disk devices that have realized network functions are all based on SAS (Serial Attached Small Computer System Interface, serial small computer system interface technology) ) hard disk and Serial Advanced Technology Attachment (Serial Advanced Technology Attachment, SATA) hard disk as the basis, adding a conversion circuit outside the SAS or SATA hard disk can provide an Ethernet interface for the hard disk, through which the Ethernet interface hard disk can be Connect to the network.

现有技术下实现网络功能的硬盘装置的容量分配和管理需要由与硬盘连接的精简指令集计算机微(Advanced RISC Machines,ARM)处理器和千兆以太网接口交换机实现,因此以太网接口硬盘的组网比较复杂,而且组网扩展及容量管理也较复杂。In the prior art, the capacity allocation and management of a hard disk device that realizes network functions needs to be realized by an Advanced RISC Machines (ARM) processor connected to the hard disk and a Gigabit Ethernet interface switch, so the Ethernet interface hard disk The networking is more complicated, and the network expansion and capacity management are also more complicated.

发明内容Contents of the invention

本发明实施例提供了一种以太网接口硬盘容量的管理方法和多租户交换机,以简化以太网接口硬盘的组网和容量管理。Embodiments of the present invention provide a method for managing the capacity of a hard disk with an Ethernet interface and a multi-tenant switch, so as to simplify networking and capacity management of the hard disk with an Ethernet interface.

第一方面,本发明提供了一种以太网接口硬盘容量的管理方法,交换机与多个以太网接口硬盘连接,所述交换机与多个主机连接,所述交换机执行以下步骤:In a first aspect, the present invention provides a method for managing the capacity of an Ethernet interface hard disk. A switch is connected to a plurality of Ethernet interface hard disks, the switch is connected to a plurality of hosts, and the switch performs the following steps:

根据所接收到的硬盘配置信息中的以太网接口硬盘的存储空间分配信息,向每个以太网接口硬盘发送容量分配命令,所述容量分配命令中包括主机IP地址与分配给所述主机IP地址的硬盘存储空间;According to the storage space allocation information of the Ethernet interface hard disk in the received hard disk configuration information, send a capacity allocation command to each Ethernet interface hard disk, and the capacity allocation command includes the IP address of the host and the IP address assigned to the host hard disk storage space;

接收并存储每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系;Receive and store the corresponding relationship between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space allocated to the host IP address;

当接收到主机下发的写以太网接口硬盘的写操作命令时,判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中,如果是,则将所述写操作命令转发至所述硬盘存储空间对应的以太网接口硬盘,并且调整所述IP地址对应的可用硬盘存储空间大小。When receiving the write operation command issued by the host to write the Ethernet interface hard disk, it is judged whether the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address, and if so, the The write operation command is forwarded to the Ethernet interface hard disk corresponding to the hard disk storage space, and the size of the available hard disk storage space corresponding to the IP address is adjusted.

在第一种可能的实现方式中,所述向每个以太网接口硬盘发送容量分配命令之前,还包括:向每个以太网接口硬盘发送查询命令,以获取每个以太网接口硬盘的硬盘信息。In a first possible implementation manner, before sending the capacity allocation command to each Ethernet interface hard disk, it also includes: sending a query command to each Ethernet interface hard disk to obtain hard disk information of each Ethernet interface hard disk .

根据第一方面或者第一方面的第一种可能的实现方式中,在第二种可能的实现方式中,所述判断所述操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中之后,还包括:如果所述操作命令中的写操作地址不包含在分配给所述IP地址的硬盘存储空间中,则返回无法写入的指示信息。According to the first aspect or the first possible implementation of the first aspect, in the second possible implementation, the judging whether the write operation address in the operation command is included in the address assigned to the IP address After storing in the hard disk storage space, it also includes: if the write operation address in the operation command is not included in the hard disk storage space allocated to the IP address, then return indicating information that cannot be written.

根据第一方面或者第一方面的第一种、第二种可能的实现方式中,在第三种可能的实现方式中,所述方法还包括:当接收到主机下发的读以太网接口硬盘的读操作命令时,如果所述读操作命令包括的Key参数值不是已有值,则返回以太网接口硬盘中没有所述Key参数值的指示信息。According to the first aspect or the first and second possible implementations of the first aspect, in the third possible implementation, the method further includes: when receiving the hard disk read from the Ethernet interface issued by the host, During the read operation command, if the Key parameter value included in the read operation command is not an existing value, then return the indication information that the Key parameter value does not exist in the Ethernet interface hard disk.

根据第一方面或者第一方面的第一种、第二种、第三种可能的实现方式中,在第四种可能的实现方式中,所述接收到主机下发的写以太网接口硬盘的写操作命令之后,所述判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中之前,还包括:根据所述写操作命令中包括的IP地址,获取分配给所述IP地址的硬盘存储空间。According to the first aspect or the first, second, and third possible implementations of the first aspect, in the fourth possible implementation, the receiving After the write operation command, before the judging whether the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address, it also includes: according to the IP address included in the write operation command, obtaining The hard disk storage space allocated to the IP address.

第二方面,本发明实施例提供了一种以太网接口硬盘容量管理的多租户交换机,多租户交换机与多个以太网接口硬盘连接,所述多租户交换机与多个主机连接,所述多租户交换机包括:In the second aspect, the embodiment of the present invention provides a multi-tenant switch for hard disk capacity management with Ethernet interface. The multi-tenant switch is connected to multiple hard disks with Ethernet interface. The multi-tenant switch is connected to multiple hosts. Switches include:

发送单元,用于根据所接收到的硬盘配置信息中的以太网接口硬盘的存储空间分配信息,向每个以太网接口硬盘发送容量分配命令,所述容量分配命令中包括主机IP地址与分配给所述主机IP地址的硬盘存储空间;The sending unit is configured to send a capacity allocation command to each Ethernet interface hard disk according to the storage space allocation information of the Ethernet interface hard disk in the received hard disk configuration information, and the capacity allocation command includes the host IP address and the address assigned to The hard disk storage space of the host IP address;

接收单元,用于接收每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系;The receiving unit is used to receive the correspondence between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space assigned to the host IP address;

存储单元,用于存储所述每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系;A storage unit for storing the correspondence between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space assigned to the host IP address;

判断单元,用于当接收到主机下发的写以太网接口硬盘的写操作命令时,判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中;A judging unit, configured to judge whether the write address in the write operation command is included in the hard disk storage space assigned to the IP address when receiving a write operation command issued by the host to write to the hard disk of the Ethernet interface;

处理单元,用于如果所述写操作命令中的写操作地址包含在分配给所述IP地址的硬盘存储空间中,则将所述写操作命令转发至所述硬盘存储空间对应的以太网接口硬盘,并且调整所述IP地址对应的可用硬盘存储空间大小。A processing unit, configured to forward the write operation command to the Ethernet interface hard disk corresponding to the hard disk storage space if the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address , and adjust the size of the available hard disk storage space corresponding to the IP address.

在第一种可能的实现方式中,所述发送单元还用于:向每个以太网接口硬盘发送查询命令,以获取每个以太网接口硬盘的硬盘信息。In a first possible implementation manner, the sending unit is further configured to: send a query command to each hard disk with an Ethernet interface, so as to obtain hard disk information of each hard disk with an Ethernet interface.

根据第二方面或者第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述处理单元还用于:如果所述操作命令中的写操作地址不包含在分配给所述IP地址的硬盘存储空间中,则返回无法写入的指示信息。According to the second aspect or the first possible implementation of the second aspect, in the second possible implementation, the processing unit is further configured to: if the write operation address in the operation command is not included in the In the hard disk storage space of the IP address, an indication message that cannot be written is returned.

根据第二方面或者第二方面的第一种、第二种可能的实现方式,在第三种可能的实现方式中,所述发送单元还用于:当接收到主机下发的读以太网接口硬盘的读操作命令时,如果所述读操作命令包括的Key参数值不是已有值,则返回以太网接口硬盘中没有所述Key参数值的指示信息。According to the second aspect or the first and second possible implementations of the second aspect, in a third possible implementation, the sending unit is further configured to: when receiving the read Ethernet interface issued by the host During the read operation command of the hard disk, if the Key parameter value included in the read operation command is not an existing value, then return the indication information that the Key parameter value does not exist in the Ethernet interface hard disk.

根据第二方面或者第二方面的第一种、第二种、第三种可能的实现方式,在第四种可能的实现方式中,所述多租户交换机还包括:获取单元,用于根据所述写操作命令中包括的IP地址,获取分配给所述IP地址的硬盘存储空间。According to the second aspect or the first, second, and third possible implementation manners of the second aspect, in a fourth possible implementation manner, the multi-tenant switch further includes: an acquisition unit configured to The IP address included in the write operation command is used to obtain the hard disk storage space allocated to the IP address.

本发明实施例提供的以太网接口硬盘容量的管理方法和多租户交换机,根据所接收到管理员针对主机进行容量分配的硬盘配置信息,向每个以太网接口硬盘发送容量分配命令,容量分配命令中包括主机IP地址与分配给主机IP地址的硬盘存储空间,以太网接口硬盘根据容量分配命令记录分配给主机IP地址的硬盘存储空间,并将该分配给主机IP地址的硬盘存储空间返回给交换机,交换机接收到主机下发的写以太网接口硬盘的写操作命令时,可在确定写操作命令中的写操作地址包含在分配给IP地址的硬盘存储空间中时,将写操作命令转发至硬盘存储空间对应的以太网接口硬盘,并且调整该IP地址对应的可用的硬盘存储空间大小。由此,本发明实施例实现了多租户交换机直接对以太网接口硬盘进行容量管理,简化了以太网接口硬盘的组网和容量管理。The management method of the hard disk capacity of the Ethernet interface and the multi-tenant switch provided by the embodiment of the present invention send a capacity allocation command to each hard disk of the Ethernet interface according to the hard disk configuration information received by the administrator for capacity allocation of the host, and the capacity allocation command Including the host IP address and the hard disk storage space allocated to the host IP address, the Ethernet interface hard disk records the hard disk storage space allocated to the host IP address according to the capacity allocation command, and returns the hard disk storage space allocated to the host IP address to the switch , when the switch receives the write operation command issued by the host to write to the hard disk of the Ethernet interface, it can forward the write operation command to the hard disk when it determines that the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address The Ethernet interface hard disk corresponding to the storage space, and adjust the available hard disk storage space corresponding to the IP address. Therefore, the embodiment of the present invention realizes that the multi-tenant switch directly manages the capacity of the hard disk with the Ethernet interface, and simplifies the networking and capacity management of the hard disk with the Ethernet interface.

附图说明Description of drawings

图1为本发明实施例提供的一种以太网接口硬盘容量管理的方法的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of a method for managing the capacity of a hard disk with an Ethernet interface provided by an embodiment of the present invention;

图2为本发明实施例提供的一种以太网接口硬盘容量的管理方法流程图;Fig. 2 is a flow chart of a method for managing the hard disk capacity of an Ethernet interface provided by an embodiment of the present invention;

图3为本发明实施例提供的一种以太网接口硬盘容量管理的多租户交换机示意图;3 is a schematic diagram of a multi-tenant switch for hard disk capacity management with an Ethernet interface provided by an embodiment of the present invention;

图4为本发明实施例提供的又一多租户交换机示意图。Fig. 4 is a schematic diagram of another multi-tenant switch provided by an embodiment of the present invention.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、接口、技术之类的具体细节,以便透切理解本发明。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本发明。在其它情况中,省略对众所周知的装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, for purposes of illustration rather than limitation, specific details such as specific system architectures, interfaces, and techniques are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

需要说明的是,本申请文件中的以太网接口硬盘是具有网络功能的硬盘装置,其具有以太网接口,可以直接通过网络交换机的以太网接口连接至网络中。It should be noted that the Ethernet interface hard disk in this application document is a hard disk device with network function, which has an Ethernet interface and can be directly connected to the network through the Ethernet interface of the network switch.

本发明实施例提供的以太网接口硬盘容量管理的方法可以应用于如图1所示的场景中,如图1所示,本发明实施例提供的交换机连接了多个主机,即具有多个租户,交换机可以连接多个以太网接口硬盘,其中交换机、以太网接口硬盘、主机组网后,交换机可以与各个主机进行通信,也可以与各个以太网接口硬盘进行交互。网络管理员可以通过交换机对所连接的主机进行硬盘的容量分配,交换机接收到网络管理员的硬盘配置信息之后,向每个以太网接口硬盘发送容量分配命令。该容量分配命令中包括主机IP地址以及分配给该主机IP地址的硬盘存储空间。以太网接口硬盘接收到容量分配命令后记录每个主机IP地址与分配给该主机IP地址的硬盘存储空间,并在交换机发送获取主机IP地址与硬盘存储空间的关系的请求消息时将每个主机IP地址与分配给该主机IP地址的硬盘存储空间的对应关系返回给交换机。交换机在后续接收到主机发送的写操作命令时,可根据该对应关系判断写操作命令中的写操作地址是否包含在分配给IP地址的硬盘存储空间中,如果是,则将写操作命令转发至硬盘存储空间对应的以太网接口硬盘,并且根据写操作命令中要写入的内容所占用的存储空间调整该IP地址对应的可用硬盘存储空间大小。由此实现交换机对以太网接口硬盘容量的管理,简化了以太网接口硬盘的组网和容量管理。The method for managing the hard disk capacity of the Ethernet interface provided by the embodiment of the present invention can be applied to the scenario shown in Figure 1. As shown in Figure 1, the switch provided by the embodiment of the present invention is connected to multiple hosts, that is, has multiple tenants , the switch can connect multiple hard disks with Ethernet interfaces. After the switch, hard disks with Ethernet interfaces, and hosts are networked, the switch can communicate with each host, and can also interact with each hard disk with Ethernet interfaces. The network administrator can allocate the capacity of the hard disks to the connected hosts through the switch. After receiving the hard disk configuration information from the network administrator, the switch sends capacity allocation commands to each Ethernet interface hard disk. The capacity allocation command includes the host IP address and the hard disk storage space allocated to the host IP address. After receiving the capacity allocation command, the Ethernet interface hard disk records the IP address of each host and the hard disk storage space assigned to the host IP address, and when the switch sends a request message to obtain the relationship between the host IP address and the hard disk storage space The corresponding relationship between the IP address and the hard disk storage space allocated to the host IP address is returned to the switch. When the switch subsequently receives the write operation command sent by the host, it can judge whether the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address according to the corresponding relationship, and if so, forward the write operation command to The hard disk storage space corresponds to the Ethernet interface hard disk, and the available hard disk storage space corresponding to the IP address is adjusted according to the storage space occupied by the content to be written in the write operation command. In this way, the switch can manage the capacity of the hard disk with the Ethernet interface, which simplifies the networking and capacity management of the hard disk with the Ethernet interface.

图2为本发明实施例提供的一种以太网接口硬盘容量的管理方法流程图,该实施例的执行主体是交换机,交换机与多个以太网接口硬盘连接,交换机与多个主机连接,该实施例详细描述了交换机对多个以太网接口硬盘的容量的管理方法,如图所示,交换机可执行以下步骤:Fig. 2 is a flow chart of a method for managing the hard disk capacity of an Ethernet interface provided by an embodiment of the present invention. The executive body of this embodiment is a switch, the switch is connected to multiple Ethernet interface hard disks, and the switch is connected to multiple hosts. This example describes in detail how the switch manages the capacity of hard disks with multiple Ethernet interfaces. As shown in the figure, the switch can perform the following steps:

步骤201,根据所接收到的硬盘配置信息中的以太网接口硬盘的存储空间分配信息,向每个以太网接口硬盘发送容量分配命令,容量分配命令中包括主机IP地址与分配给主机IP地址的硬盘存储空间。Step 201, according to the storage space allocation information of the Ethernet interface hard disk in the received hard disk configuration information, send a capacity allocation command to each Ethernet interface hard disk, and the capacity allocation command includes the host IP address and the IP address assigned to the host IP address. Hard disk storage space.

其中,交换机、以太网接口硬盘、主机连接组网后,交换机可首先向每个以太网接口硬盘发送查询命令,以获取每个以太网接口硬盘的硬盘信息。交换机向以太网接口硬盘发送的命令格式如下所示:Wherein, after the switch, the hard disk with the Ethernet interface, and the host are connected to the network, the switch can first send a query command to each hard disk with the Ethernet interface to obtain the hard disk information of each hard disk with the Ethernet interface. The format of the command sent by the switch to the hard disk on the Ethernet interface is as follows:

其中,Ethernet Header为命令的以太网头;Among them, Ethernet Header is the Ethernet header of the command;

IP header为命令的IP头;IP header is the IP header of the command;

TCP header为命令的TCP头;TCP header is the TCP header of the command;

操作码用来标识命令的类型,如操作码为1表示该命令为用来识别以太网接口硬盘的命令,硬盘接收到操作码为1的命令之后,可向发送方返回自身是否为以太网接口硬盘的信息,操作码为2表示该命令为用来获取以太网接口硬盘容量的命令,操作码为3表示该命令为用来配置主机IP地址与以太网接口硬盘容量或键值对(Key-Value,KV)之间的对应关系的命令,硬盘接收到操作码为3的命令之后,可根据命令中的“KEY或起始LBA”字段设置该对应关系,操作码为4表示该命令为用来获取主机IP地址与以太网接口硬盘容量或键值对之间的对应关系的命令,操作码为5表示该命令为用来以逻辑区块地址(Logical Block Address,LBA)方式读以太网接口硬盘数据的命令,操作码为6表示该命令为以LBA方式写以太网接口硬盘数据的命令,操作码为7表示该命令为以KV方式读以太网接口硬盘的命令,操作码为8表示该命令为以KV方式写以太网接口硬盘的命令;The operation code is used to identify the type of command. For example, the operation code is 1, which means that the command is used to identify the hard disk with the Ethernet interface. After the hard disk receives the command with the operation code 1, it can return to the sender whether it is an Ethernet interface. Hard disk information, the operation code is 2 means that the command is used to obtain the hard disk capacity of the Ethernet interface, and the operation code is 3 means that the command is used to configure the host IP address and the hard disk capacity of the Ethernet interface or a key-value pair (Key- Value, KV), after the hard disk receives the command whose operation code is 3, the corresponding relationship can be set according to the "KEY or initial LBA" field in the command, and the operation code is 4, which means that the command is used To obtain the corresponding relationship between the host IP address and the hard disk capacity of the Ethernet interface or the key-value pair, the operation code is 5, indicating that the command is used to read the Ethernet interface in the form of Logical Block Address (LBA) Hard disk data command, the operation code is 6 means that the command is to write the hard disk data of the Ethernet interface in LBA mode, the operation code is 7 means that the command is to read the Ethernet interface hard disk in KV mode, and the operation code is 8 means that the The command is the command to write the Ethernet interface hard disk in KV mode;

Key或起始地址LBA,用来标识交换机要访问以太网接口硬盘的地址或者要访问的内容的键值;Key or starting address LBA, which is used to identify the address of the switch to access the hard disk of the Ethernet interface or the key value of the content to be accessed;

数据长度,用来标识交换机要读写的内容的大小,Data length, used to identify the size of the content to be read and written by the switch,

数据内容,用来标识交换机要写入的内容;Data content, used to identify the content to be written by the switch;

Ethernet trailer,为命令的填充字段。Ethernet trailer, which is the filled field of the command.

在交换机、以太网接口硬盘组网后,交换机首先广播发送操作码为1的识别以太网接口硬盘的命令。在以太网接口硬盘返回识别信息,该识别信息中包括以太网接口硬盘的厂家、以太网接口硬盘的容量、以太网接口硬盘的操作方式等内容后,交换机继续发送操作码为2的获取以太网接口硬盘容量的命令,以太网接口硬盘向交换机返回硬盘可用的容量。After the switch and the Ethernet interface hard disk are networked, the switch first broadcasts and sends a command to identify the Ethernet interface hard disk with an operation code of 1. After the hard disk on the Ethernet interface returns the identification information, which includes the manufacturer of the hard disk on the Ethernet interface, the capacity of the hard disk on the Ethernet interface, and the operation mode of the hard disk on the Ethernet interface, etc., the switch continues to send the acquisition Ethernet interface with the operation code 2. The hard disk capacity command of the interface, the hard disk of the Ethernet interface returns the available capacity of the hard disk to the switch.

交换机接收到以太网接口硬盘返回的可用容量之后,记录该可用的容量信息。After the switch receives the available capacity returned by the hard disk of the Ethernet interface, it records the available capacity information.

管理员可根据交换机所记录的各以太网接口硬盘的可用容量信息,对交换机所连接的主机进行容量分配。当交换机接收到网络管理员的硬盘配置信息之后,向每个以太网接口硬盘发送容量分配命令,该容量分配命令的操作码为3,用来配置主机IP地址与以太网接口硬盘容量或KV之间的对应关系,该容量分配命令中包括主机IP地址以及分配给该主机IP地址的硬盘存储空间。其中,硬盘存储空间包括硬盘存储空间的地址和大小等信息。The administrator can allocate capacity to the hosts connected to the switch according to the available capacity information of each Ethernet interface hard disk recorded by the switch. After the switch receives the hard disk configuration information from the network administrator, it sends a capacity allocation command to each Ethernet interface hard disk. The operation code of the capacity allocation command is 3, which is used to configure the relationship between the host IP address and the Ethernet interface hard disk capacity or KV. The corresponding relationship among them, the capacity allocation command includes the IP address of the host and the hard disk storage space allocated to the IP address of the host. Wherein, the hard disk storage space includes information such as an address and a size of the hard disk storage space.

例如,对于主机1的IP1地址,网络管理员可以为该IP1地址分配以太网硬盘1的地址为0x00000000到0x01000000的存储空间,则向主机1发送的分配命令中可以包括该分配信息,以便配置主机1的IP1地址与以太网硬盘1的地址为0x00000000到0x01000000的存储空间的对应关系。For example, for the IP1 address of the host 1, the network administrator can allocate the storage space of the Ethernet hard disk 1 whose address is 0x00000000 to 0x01000000 for the IP1 address, and then the allocation command sent to the host 1 can include the allocation information, so as to configure the host The corresponding relationship between the IP1 address of 1 and the storage space of Ethernet hard disk 1 whose address is 0x00000000 to 0x01000000.

步骤202,接收并存储每个以太网接口硬盘发送的主机IP地址与分配给主机IP地址的硬盘存储空间的对应关系。Step 202, receiving and storing the corresponding relationship between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space allocated to the host IP address.

以太网接口硬盘接收到容量分配命令后,如果确定可以成功为该主机IP地址分配容量分配命令中所要求分配的存储空间,则为该主机IP地址分配该容量分配命令中要求分配的存储空间,并且记录主机IP地址与分配给该主机IP地址的硬盘存储空间。After the Ethernet interface hard disk receives the capacity allocation command, if it is determined that the host IP address can be successfully allocated the storage space required in the capacity allocation command, then the host IP address is allocated the storage space required in the capacity allocation command, And record the host IP address and the hard disk storage space allocated to the host IP address.

如果接收到容量分配命令的以太网接口硬盘发现容量分配命令中要求分配的存储空间已被占用或者因为其他原因不能为该主机IP地址分配容量分配命令中要求分配的存储空间,则返回一个分配操作失败的响应消息,接收到该响应消息的交换机可以重新为主机IP地址分配存储空间。If the Ethernet interface hard disk receiving the capacity allocation command finds that the storage space required in the capacity allocation command has been occupied or cannot be allocated for the host IP address due to other reasons, an allocation operation will be returned For a failed response message, the switch that receives the response message can re-allocate storage space for the host IP address.

优选地,当交换机向以太网接口硬盘发送操作码为4的获取主机IP地址与以太网接口硬盘容量或KV之间的对应关系的命令时,IP接口将系统记录区记录的每个主机IP地址与分配给该主机IP地址的硬盘存储空间的对应关系返回给交换机。Preferably, when the switch sends an operation code of 4 to the Ethernet interface hard disk to obtain the corresponding relationship between the host IP address and the Ethernet interface hard disk capacity or KV, the IP interface will record each host IP address in the system record area. The corresponding relationship with the hard disk storage space allocated to the IP address of the host is returned to the switch.

步骤203,当接收到主机下发的向以太网接口硬盘写入数据的写操作命令时,判断写操作命令中的写操作地址是否包含在分配给IP地址对应的硬盘存储空间中,如果是,则将写操作命令转发至硬盘存储空间对应的以太网接口硬盘,并且调整IP地址对应的可用硬盘存储空间大小。Step 203, when receiving the write operation command issued by the host to write data to the Ethernet interface hard disk, judge whether the write operation address in the write operation command is included in the hard disk storage space corresponding to the IP address, if yes, The write operation command is then forwarded to the hard disk with the Ethernet interface corresponding to the hard disk storage space, and the size of the available hard disk storage space corresponding to the IP address is adjusted.

如果所述操作命令中的写操作地址不包含在分配给所述IP地址的硬盘存储空间中,则返回无法写入的指示信息。If the write operation address in the operation command is not included in the hard disk storage space allocated to the IP address, then return the indication information that cannot be written.

当交换机接收到主机下发的向以太网接口硬盘写入数据的写操作命令时,交换机可先根据写操作命令中的“Key或起始LBA”字段的内容确定主机要访问的以太网接口硬盘的存储空间,根据IP头信息中的IP地址确定主机IP地址,然后根据本地记录的主机IP地址与分配给该主机IP地址的硬盘存储空间的对应关系,确定该主机IP地址是否可以写入写操作命令中携带的写操作地址,即根据写操作命令中携带的Key或者LBA以及数据长度确定数据写入的地址是否包含在该主机IP地址对应的硬盘存储空间中,如果包含,则说明该写操作命令中的内容可以写入对应的写操作地址中,则将该写操作命令转发至以太网接口硬盘,如果不可以,则向主机返回无法写入的指示信息。When the switch receives the write operation command issued by the host to write data to the Ethernet interface hard disk, the switch can first determine the Ethernet interface hard disk that the host wants to access according to the content of the "Key or initial LBA" field in the write operation command According to the IP address in the IP header information, determine the host IP address, and then determine whether the host IP address can be written or not according to the corresponding relationship between the locally recorded host IP address and the hard disk storage space allocated to the host IP address. The write operation address carried in the operation command, that is, according to the Key or LBA carried in the write operation command and the length of the data to determine whether the address for data writing is included in the hard disk storage space corresponding to the IP address of the host, if it is included, it means that the write If the content in the operation command can be written into the corresponding write operation address, the write operation command is forwarded to the hard disk with the Ethernet interface, and if not, the instruction information that cannot be written is returned to the host.

优选地,在将写操作命令发送至以太网接口硬盘之后,可根据该写操作命令中的数据长度,确定主机IP地址在这次写操作之后又使用了以太网接口硬盘的大小,然后根据写操作命令中要写入的内容所占用的存储空间调整该IP地址对应的可用硬盘存储空间大小。Preferably, after the write operation command is sent to the Ethernet interface hard disk, according to the data length in the write operation command, it is determined that the host IP address uses the size of the Ethernet interface hard disk after this write operation, and then according to the write The storage space occupied by the content to be written in the operation command adjusts the available hard disk storage space corresponding to the IP address.

优选地,本发明实施例提供的方法还包括:当接收到主机下发的从以太网接口硬盘读数据的读操作命令时,如果所述读操作命令包括的Key参数值不是已有值,则返回以太网接口硬盘中没有所述Key参数值的指示信息。Preferably, the method provided by the embodiment of the present invention further includes: when receiving a read operation command issued by the host to read data from the hard disk of the Ethernet interface, if the Key parameter value included in the read operation command is not an existing value, then Returns the indication information indicating that the Key parameter value does not exist in the hard disk of the Ethernet interface.

当交换机接收到主机下发的从以太网接口硬盘读数据的读操作命令时,交换机可先根据读操作命令中的Key参数值,确定主机要访问的内容是否存在,如果存在,则向以太网接口硬盘转发该读操作命令,否则返回以太网接口硬盘中没有所述Key参数值所对应的内容的指示信息。When the switch receives the read operation command issued by the host to read data from the hard disk of the Ethernet interface, the switch can first determine whether the content to be accessed by the host exists according to the value of the Key parameter in the read operation command, and if so, send the data to the Ethernet interface. The interface hard disk forwards the read operation command; otherwise, an indication message indicating that there is no content corresponding to the Key parameter value in the Ethernet interface hard disk is returned.

其中,如果交换机中没有记录写操作命令中的主机IP地址对应的硬盘存储空间,则在接收到主机下发的写以太网接口硬盘的写操作命令之后,在判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中之前,还需要根据所述写操作命令中包括的IP地址,获取本地所存储的分配给所述IP地址的硬盘存储空间,即向以太网接口硬盘发送操作码为4的获取主机IP地址与以太网接口硬盘容量或KV之间的对应关系的命令。Wherein, if the hard disk storage space corresponding to the IP address of the host computer in the write operation command is not recorded in the switch, after receiving the write operation command issued by the host computer to write the Ethernet interface hard disk, after judging the write operation command in the write operation command, Whether the operation address is included in the hard disk storage space assigned to the IP address, it is also necessary to obtain the locally stored hard disk storage space assigned to the IP address according to the IP address included in the write operation command, that is, to The hard disk on the Ethernet interface sends a command whose operation code is 4 to obtain the corresponding relationship between the IP address of the host and the capacity or KV of the hard disk on the Ethernet interface.

由此,通过本发明实施例提供的技术方案,实现了交换机对以太网接口硬盘容量的管理,简化了以太网接口硬盘的组网和容量管理。Therefore, through the technical solution provided by the embodiment of the present invention, the capacity management of the Ethernet interface hard disk by the switch is realized, and the networking and capacity management of the Ethernet interface hard disk are simplified.

相应地,本发明实施例提供了一种以太网接口硬盘容量管理的多租户交换机,图3为本发明实施例提供的一种以太网接口硬盘容量管理的多租户交换机示意图,多租户交换机与多个以太网接口硬盘连接,所述多租户交换机与多个主机连接,如图所示,该交换机包括:Correspondingly, an embodiment of the present invention provides a multi-tenant switch for hard disk capacity management of an Ethernet interface. FIG. 3 is a schematic diagram of a multi-tenant switch for hard disk capacity management of an Ethernet interface provided by an embodiment of the present invention. An Ethernet interface hard disk is connected, and the multi-tenant switch is connected to multiple hosts. As shown in the figure, the switch includes:

发送单元301,用于根据所接收到的硬盘配置信息中的以太网接口硬盘的存储空间分配信息,向每个以太网接口硬盘发送容量分配命令,所述容量分配命令中包括主机IP地址与分配给所述主机IP地址的硬盘存储空间。The sending unit 301 is configured to send a capacity allocation command to each Ethernet interface hard disk according to the storage space allocation information of the Ethernet interface hard disk in the received hard disk configuration information, and the capacity allocation command includes the host IP address and the allocation Hard disk storage space for the IP address of the host.

发送单元301还用于:向每个以太网接口硬盘发送查询命令,以获取每个以太网接口硬盘的硬盘信息。The sending unit 301 is further configured to: send a query command to each hard disk with an Ethernet interface, so as to acquire hard disk information of each hard disk with an Ethernet interface.

交换机接收到以太网接口硬盘返回的可用容量之后,可记录该可用容量信息。管理员可根据交换机所记录的容量信息,对交换机所连接的主机进行容量分配,当交换机接收到网络管理员的硬盘配置信息之后,可向每个以太网接口硬盘发送容量分配命令,该容量分配命令的操作码为3,用来配置主机IP地址与以太网接口硬盘容量或KV之间的对应关系,该容量分配命令中包括主机IP地址以及分配给该主机IP地址的硬盘存储空间。其中,硬盘存储空间包括硬盘存储空间的地址和大小等信息。After the switch receives the available capacity returned by the hard disk of the Ethernet interface, it can record the available capacity information. The administrator can allocate capacity to the hosts connected to the switch according to the capacity information recorded by the switch. After the switch receives the hard disk configuration information from the network administrator, it can send a capacity allocation command to each Ethernet interface hard disk. The capacity allocation The operation code of the command is 3, which is used to configure the corresponding relationship between the host IP address and the Ethernet interface hard disk capacity or KV. The capacity allocation command includes the host IP address and the hard disk storage space allocated to the host IP address. Wherein, the hard disk storage space includes information such as an address and a size of the hard disk storage space.

接收单元302,用于接收每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系。The receiving unit 302 is configured to receive the correspondence between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space allocated to the host IP address.

存储单元303,用于存储所述每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系。The storage unit 303 is configured to store the correspondence between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space allocated to the host IP address.

判断单元304,用于当接收到主机下发的写以太网接口硬盘的写操作命令时,判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中。The judging unit 304 is configured to judge whether the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address when receiving a write operation command issued by the host to write to the hard disk with the Ethernet interface.

当交换机接收到主机下发的写以太网接口硬盘的写操作命令时,交换机可先根据写操作命令中的“Key或起始LBA”字段的内容确定主机要访问的以太网接口硬盘的存储空间,根据IP头信息中的IP地址确定主机IP地址,然后根据本地记录的主机IP地址与分配给该主机IP地址的硬盘存储空间的对应关系,确定该主机IP地址是否可以写入写操作命令中携带的写操作地址,即根据写操作命令中携带的Key或者LBA以及数据长度确定数据写入的地址是否包含在该主机IP地址对应的硬盘存储空间中,如果包含,则说明该写操作命令中的内容可以写入对应的写操作地址中,则将该写操作命令转发至以太网接口硬盘,如果不可以,则向主机返回无法写入的指示信息。When the switch receives the write operation command issued by the host to write to the hard disk on the Ethernet interface, the switch can first determine the storage space of the hard disk on the Ethernet interface to be accessed by the host according to the content of the "Key or initial LBA" field in the write operation command. , determine the host IP address according to the IP address in the IP header information, and then determine whether the host IP address can be written into the write operation command according to the corresponding relationship between the locally recorded host IP address and the hard disk storage space allocated to the host IP address The write operation address carried, that is, according to the Key or LBA carried in the write operation command and the length of the data to determine whether the address for data writing is included in the hard disk storage space corresponding to the IP address of the host, if it is included, it means that the write operation command contains If the content can be written into the corresponding write operation address, the write operation command is forwarded to the hard disk of the Ethernet interface, and if not, the instruction information that cannot be written is returned to the host.

处理单元305,用于如果所述写操作命令中的写操作地址包含在分配给所述IP地址的硬盘存储空间中,则将所述写操作命令转发至所述硬盘存储空间对应的以太网接口硬盘,并且调整所述IP地址对应的硬盘存储空间大小。A processing unit 305, configured to forward the write operation command to an Ethernet interface corresponding to the hard disk storage space if the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address hard disk, and adjust the size of the hard disk storage space corresponding to the IP address.

优选地,处理单元305还用于:如果所述操作命令中的写操作地址不包含在分配给所述IP地址的硬盘存储空间中,则返回无法写入的指示信息。Preferably, the processing unit 305 is further configured to: if the write operation address in the operation command is not included in the hard disk storage space allocated to the IP address, return an indication that writing cannot be performed.

优选地,当接收到主机下发的读以太网接口硬盘的读操作命令时,如果所述读操作命令包括的Key参数值不是已有值,发送单元301还用于:则返回以太网接口硬盘中没有所述Key参数值的指示信息。Preferably, when receiving the read operation command issued by the host to read the hard disk with the Ethernet interface, if the Key parameter value included in the read operation command is not an existing value, the sending unit 301 is also used to: return the hard disk with the Ethernet interface There is no indication information about the Key parameter value in .

当交换机接收到主机下发的读以太网接口硬盘的读操作命令时,交换机可先根据读操作命令中的Key参数值,确定主机要访问的内容是否存在,如果存在,则向以太网接口硬盘转发该读操作命令,否则返回以太网接口硬盘中没有所述Key参数值所对应的内容的指示信息。When the switch receives the read operation command issued by the host to read the hard disk on the Ethernet interface, the switch can first determine whether the content to be accessed by the host exists according to the value of the Key parameter in the read operation command, and if so, send the data to the hard disk on the Ethernet interface. The read operation command is forwarded; otherwise, an indication message indicating that there is no content corresponding to the Key parameter value in the hard disk of the Ethernet interface is returned.

优选地,本发明实施例提供的多租户交换机还包括:获取单元306,用于根据所述写操作命令中包括的IP地址,获取分配给所述IP地址的硬盘存储空间。Preferably, the multi-tenant switch provided by the embodiment of the present invention further includes: an obtaining unit 306, configured to obtain the hard disk storage space allocated to the IP address according to the IP address included in the write operation command.

在交换机、以太网接口硬盘组网后,交换机首先广播发送操作码为1的识别以太网接口硬盘的命令。在以太网接口硬盘返回识别信息,该识别信息中包括以太网接口硬盘的厂家、以太网接口硬盘的容量、以太网接口硬盘的操作方式等内容后,交换机继续发送操作码为2的获取以太网接口硬盘容量的命令,以太网接口硬盘向交换机返回硬盘可用的容量。After the switch and the Ethernet interface hard disk are networked, the switch first broadcasts and sends a command to identify the Ethernet interface hard disk with an operation code of 1. After the hard disk on the Ethernet interface returns the identification information, which includes the manufacturer of the hard disk on the Ethernet interface, the capacity of the hard disk on the Ethernet interface, and the operation mode of the hard disk on the Ethernet interface, etc., the switch continues to send the acquisition Ethernet interface with the operation code 2. The hard disk capacity command of the interface, the hard disk of the Ethernet interface returns the available capacity of the hard disk to the switch.

由此,通过本发明实施例提供的技术方案,实现了交换机对以太网接口硬盘容量的管理,简化了以太网接口硬盘的组网和容量管理。Therefore, through the technical solution provided by the embodiment of the present invention, the capacity management of the Ethernet interface hard disk by the switch is realized, and the networking and capacity management of the Ethernet interface hard disk are simplified.

相应地,本发明实施例还提供了一种多租户交换机,多租户交换机与多个以太网接口硬盘连接,所述多租户交换机与多个主机连接,图4为本发明实施例提供的又一多租户交换机示意图,如图所示,该多租户交换机包括网络接口401、处理器402、存储器403。系统总线404用于连接网络接口401、处理器402和存储器403,并且用于承载各个器件之间的数据传输。Correspondingly, the embodiment of the present invention also provides a multi-tenant switch. The multi-tenant switch is connected to multiple hard disks with Ethernet interfaces, and the multi-tenant switch is connected to multiple hosts. FIG. 4 is another example provided by the embodiment of the present invention. A schematic diagram of a multi-tenant switch, as shown in the figure, the multi-tenant switch includes a network interface 401 , a processor 402 , and a memory 403 . The system bus 404 is used to connect the network interface 401, the processor 402 and the memory 403, and is used to carry data transmission between various devices.

网络接口401用于与其他网络实体通信。The network interface 401 is used to communicate with other network entities.

存储器403中具有软件程序和设备驱动程序。处理器402可以加载存储器403中的软件模块,并根据软件模块使得各个器件执行相应的功能;设备驱动程序可以是接口驱动程序。The memory 403 has software programs and device drivers in it. The processor 402 can load the software modules in the memory 403, and make each device execute corresponding functions according to the software modules; the device driver can be an interface driver.

本发明实施例提供的多租户交换机中,处理器402加载存储器403中的软件模块,并根据软件模块执行以下指令:In the multi-tenant switch provided by the embodiment of the present invention, the processor 402 loads the software module in the memory 403, and executes the following instructions according to the software module:

根据所接收到的硬盘配置信息,向每个以太网接口硬盘发送容量分配命令,所述容量分配命令中包括主机IP地址与分配给所述主机IP地址的硬盘存储空间;According to the received hard disk configuration information, send a capacity allocation command to each Ethernet interface hard disk, the capacity allocation command includes the host IP address and the hard disk storage space allocated to the host IP address;

接收并存储每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系;Receive and store the corresponding relationship between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space allocated to the host IP address;

当接收到主机下发的写以太网接口硬盘的写操作命令时,判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中,如果是,则将所述写操作命令转发至所述硬盘存储空间对应的以太网接口硬盘,并且调整所述IP地址对应的可用硬盘存储空间大小。When receiving the write operation command issued by the host to write the Ethernet interface hard disk, it is judged whether the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address, and if so, the The write operation command is forwarded to the Ethernet interface hard disk corresponding to the hard disk storage space, and the size of the available hard disk storage space corresponding to the IP address is adjusted.

进一步地,处理器402通过网络接口401向每个以太网接口硬盘发送容量分配命令之前,还可执行指令:向每个以太网接口硬盘发送查询命令,以获取每个以太网接口硬盘的硬盘信息。Further, before the processor 402 sends the capacity allocation command to each Ethernet interface hard disk through the network interface 401, it may also execute an instruction: send a query command to each Ethernet interface hard disk to obtain the hard disk information of each Ethernet interface hard disk .

进一步地,处理器402判断所述操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中之后,还可执行指令:如果所述操作命令中的写操作地址不包含在分配给所述IP地址的硬盘存储空间中,则返回无法写入的指示信息。Further, after the processor 402 judges whether the write operation address in the operation command is included in the hard disk storage space allocated to the IP address, the instruction may also be executed: if the write operation address in the operation command is not included in In the hard disk storage space allocated to the IP address, an indication message that cannot be written is returned.

进一步地,处理器402还可执行令:当接收到主机下发的读以太网接口硬盘的读操作命令时,如果所述读操作命令包括的Key参数值不是已有值,则返回以太网接口硬盘中没有所述Key参数值的指示信息。Further, the processor 402 can also execute an order: when receiving a read operation command issued by the host to read the hard disk of the Ethernet interface, if the Key parameter value included in the read operation command is not an existing value, then return to the Ethernet interface There is no indication information of the Key parameter value in the hard disk.

进一步地,在接收到主机下发的写以太网接口硬盘的写操作命令之后,在判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中之前,处理器402还可:根据所述写操作命令中包括的IP地址,获取分配给所述IP地址的硬盘存储空间。Further, after receiving the write operation command issued by the host to write the Ethernet interface hard disk, before judging whether the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address, process The controller 402 may also: acquire the hard disk storage space allocated to the IP address according to the IP address included in the write operation command.

由此,本发明实施例实现了多租户交换机直接对以太网接口硬盘进行容量管理,简化了以太网接口硬盘的组网和容量管理。Therefore, the embodiment of the present invention realizes that the multi-tenant switch directly manages the capacity of the hard disk with the Ethernet interface, and simplifies the networking and capacity management of the hard disk with the Ethernet interface.

专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals should further realize that the units and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the relationship between hardware and software Interchangeability. In the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.

结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the scope of the present invention. Protection scope, within the spirit and principles of the present invention, any modification, equivalent replacement, improvement, etc., shall be included in the protection scope of the present invention.

Claims (10)

1.一种以太网接口硬盘容量的管理方法,其特征在于,交换机与多个以太网接口硬盘连接,所述交换机与多个主机连接,所述交换机执行以下步骤:1. a management method of Ethernet interface hard disk capacity, is characterized in that, switch is connected with a plurality of Ethernet interface hard disks, and described switch is connected with a plurality of hosts, and described switch performs the following steps: 根据所接收到的硬盘配置信息中的以太网接口硬盘的存储空间分配信息,向每个以太网接口硬盘发送容量分配命令,所述容量分配命令中包括主机IP地址与分配给所述主机IP地址的硬盘存储空间;According to the storage space allocation information of the Ethernet interface hard disk in the received hard disk configuration information, send a capacity allocation command to each Ethernet interface hard disk, and the capacity allocation command includes the IP address of the host and the IP address assigned to the host hard disk storage space; 接收并存储每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系;Receive and store the corresponding relationship between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space allocated to the host IP address; 当接收到主机下发的写以太网接口硬盘的写操作命令时,判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中,如果是,则将所述写操作命令转发至所述硬盘存储空间对应的以太网接口硬盘,并且调整所述IP地址对应的可用硬盘存储空间大小。When receiving the write operation command issued by the host to write the Ethernet interface hard disk, it is judged whether the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address, and if so, the The write operation command is forwarded to the Ethernet interface hard disk corresponding to the hard disk storage space, and the size of the available hard disk storage space corresponding to the IP address is adjusted. 2.根据权利要求1所述的以太网接口硬盘容量的管理方法,其特征在于,所述向每个以太网接口硬盘发送容量分配命令之前,还包括:向每个以太网接口硬盘发送查询命令,以获取每个以太网接口硬盘的硬盘信息。2. The management method of the hard disk capacity of the Ethernet interface according to claim 1, wherein, before sending the capacity allocation command to each hard disk of the Ethernet interface, further comprising: sending a query command to each hard disk of the Ethernet interface , to obtain the hard disk information of each Ethernet interface hard disk. 3.根据权利要求1或2所述的以太网接口硬盘容量的管理方法,其特征在于,所述判断所述操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中之后,还包括:3. according to the management method of the described Ethernet interface hard disk capacity of claim 1 or 2, it is characterized in that, whether the write operation address in the described operation order of described judgment is included in the hard disk storage space that is assigned to the IP address After that, also include: 如果所述操作命令中的写操作地址不包含在分配给所述IP地址的硬盘存储空间中,则返回无法写入的指示信息。If the write operation address in the operation command is not included in the hard disk storage space allocated to the IP address, then return the indication information that cannot be written. 4.根据权利要求1-3任一所述的以太网接口硬盘容量的管理方法,其特征在于,所述方法还包括:4. according to the management method of the arbitrary described Ethernet interface hard disk capacity of claim 1-3, it is characterized in that, described method also comprises: 当接收到主机下发的读以太网接口硬盘的读操作命令时,如果所述读操作命令包括的Key参数值不是已有值,则返回以太网接口硬盘中没有所述Key参数值的指示信息。When receiving the read operation command issued by the host to read the Ethernet interface hard disk, if the Key parameter value included in the read operation command is not an existing value, then return the indication information that there is no said Key parameter value in the Ethernet interface hard disk . 5.根据权利要求1-4任一所述的以太网接口硬盘容量的管理方法,其特征在于,所述接收到主机下发的写以太网接口硬盘的写操作命令之后,所述判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中之前,还包括:根据所述写操作命令中包括的IP地址,获取分配给所述IP地址的硬盘存储空间。5. according to the management method of the hard disk capacity of Ethernet interface described in any one of claim 1-4, it is characterized in that, after described receiving the write operation order that writes Ethernet interface hard disk issued by host computer, described judgment described Whether the write operation address in the write operation command is included before the hard disk storage space assigned to the IP address, also includes: according to the IP address included in the write operation command, obtaining the hard disk storage space assigned to the IP address . 6.一种以太网接口硬盘容量管理的多租户交换机,其特征在于,多租户交换机与多个以太网接口硬盘连接,所述多租户交换机与多个主机连接,所述多租户交换机包括:6. A multi-tenant switch for Ethernet interface hard disk capacity management, characterized in that the multi-tenant switch is connected with a plurality of Ethernet interface hard disks, and the multi-tenant switch is connected with a plurality of hosts, and the multi-tenant switch includes: 发送单元,用于根据所接收到的硬盘配置信息中的以太网接口硬盘的存储空间分配信息,向每个以太网接口硬盘发送容量分配命令,所述容量分配命令中包括主机IP地址与分配给所述主机IP地址的硬盘存储空间;The sending unit is configured to send a capacity allocation command to each Ethernet interface hard disk according to the storage space allocation information of the Ethernet interface hard disk in the received hard disk configuration information, and the capacity allocation command includes the host IP address and the address assigned to The hard disk storage space of the host IP address; 接收单元,用于接收每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系;The receiving unit is used to receive the correspondence between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space assigned to the host IP address; 存储单元,用于存储所述每个以太网接口硬盘发送的主机IP地址与分配给所述主机IP地址的硬盘存储空间的对应关系;A storage unit for storing the correspondence between the host IP address sent by each Ethernet interface hard disk and the hard disk storage space assigned to the host IP address; 判断单元,用于当接收到主机下发的写以太网接口硬盘的写操作命令时,判断所述写操作命令中的写操作地址是否包含在分配给所述IP地址的硬盘存储空间中;A judging unit, configured to judge whether the write address in the write operation command is included in the hard disk storage space assigned to the IP address when receiving a write operation command issued by the host to write to the hard disk of the Ethernet interface; 处理单元,用于如果所述写操作命令中的写操作地址包含在分配给所述IP地址的硬盘存储空间中,则将所述写操作命令转发至所述硬盘存储空间对应的以太网接口硬盘,并且调整所述IP地址对应的可用硬盘存储空间大小。A processing unit, configured to forward the write operation command to an Ethernet interface hard disk corresponding to the hard disk storage space if the write operation address in the write operation command is included in the hard disk storage space allocated to the IP address , and adjust the size of the available hard disk storage space corresponding to the IP address. 7.根据权利要求6所述的以太网接口硬盘容量管理的多租户交换机,其特征在于,所述发送单元还用于:向每个以太网接口硬盘发送查询命令,以获取每个以太网接口硬盘的硬盘信息。7. The multi-tenant switch managed by the hard disk capacity of the Ethernet interface according to claim 6, wherein the sending unit is also used for: sending a query command to each hard disk of the Ethernet interface to obtain the data of each Ethernet interface Hard disk information of the hard disk. 8.根据权利要求6或7所述的以太网接口硬盘容量管理的多租户交换机,其特征在于,所述处理单元还用于:8. The multi-tenant switch managed by the Ethernet interface hard disk capacity according to claim 6 or 7, wherein the processing unit is also used for: 如果所述操作命令中的写操作地址不包含在分配给所述IP地址的硬盘存储空间中,则返回无法写入的指示信息。If the write operation address in the operation command is not included in the hard disk storage space allocated to the IP address, then return the indication information that cannot be written. 9.根据权利要求6-8任一所述的以太网接口硬盘容量管理的多租户交换机,其特征在于,所述发送单元还用于:9. The multi-tenant switch according to any one of claims 6-8, characterized in that the sending unit is also used for: 当接收到主机下发的读以太网接口硬盘的读操作命令时,如果所述读操作命令包括的Key参数值不是已有值,则返回以太网接口硬盘中没有所述Key参数值的指示信息。When receiving the read operation command issued by the host to read the Ethernet interface hard disk, if the Key parameter value included in the read operation command is not an existing value, then return the indication information that there is no said Key parameter value in the Ethernet interface hard disk . 10.根据权利要求6-9任一所述的以太网接口硬盘容量管理的多租户交换机,其特征在于,所述多租户交换机还包括:获取单元,用于根据所述写操作命令中包括的IP地址,获取分配给所述IP地址的硬盘存储空间。10. The multi-tenant switch according to any one of claims 6-9, characterized in that, the multi-tenant switch further comprises: an acquisition unit, configured to use the multi-tenant switch according to the information contained in the write operation command according to claim 6-9. IP address, to obtain the hard disk storage space allocated to the IP address.
CN201410271382.1A 2014-06-17 2014-06-17 The management method and multi-tenant interchanger of Ethernet interface hard-disk capacity Active CN104023076B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410271382.1A CN104023076B (en) 2014-06-17 2014-06-17 The management method and multi-tenant interchanger of Ethernet interface hard-disk capacity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410271382.1A CN104023076B (en) 2014-06-17 2014-06-17 The management method and multi-tenant interchanger of Ethernet interface hard-disk capacity

Publications (2)

Publication Number Publication Date
CN104023076A true CN104023076A (en) 2014-09-03
CN104023076B CN104023076B (en) 2017-12-15

Family

ID=51439645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410271382.1A Active CN104023076B (en) 2014-06-17 2014-06-17 The management method and multi-tenant interchanger of Ethernet interface hard-disk capacity

Country Status (1)

Country Link
CN (1) CN104023076B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037772A (en) * 2021-03-30 2021-06-25 苏州科达科技股份有限公司 Data processing method, system, device and storage medium
WO2024051259A1 (en) * 2022-09-06 2024-03-14 华为技术有限公司 Data processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101977227A (en) * 2010-10-25 2011-02-16 中国农业大学 Multi-user network storage system and construction method thereof
US20130024643A1 (en) * 2011-07-22 2013-01-24 Hitachi, Ltd. Storage apparatus and data management method
CN102904913A (en) * 2011-07-27 2013-01-30 鸿富锦精密工业(深圳)有限公司 Cloud storage space management method and system and gateway device using the method
US20130046802A1 (en) * 2009-04-23 2013-02-21 Hitachi, Ltd Data migration system and data migration method
TW201327162A (en) * 2011-12-26 2013-07-01 Inventec Corp Dynamical disk mapping method and server using the same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130046802A1 (en) * 2009-04-23 2013-02-21 Hitachi, Ltd Data migration system and data migration method
CN101977227A (en) * 2010-10-25 2011-02-16 中国农业大学 Multi-user network storage system and construction method thereof
US20130024643A1 (en) * 2011-07-22 2013-01-24 Hitachi, Ltd. Storage apparatus and data management method
CN102904913A (en) * 2011-07-27 2013-01-30 鸿富锦精密工业(深圳)有限公司 Cloud storage space management method and system and gateway device using the method
TW201327162A (en) * 2011-12-26 2013-07-01 Inventec Corp Dynamical disk mapping method and server using the same

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何金鑫: ""网络硬盘存储优化方法的设计与实现"", 《中国优秀硕士学位论文全文数据库》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037772A (en) * 2021-03-30 2021-06-25 苏州科达科技股份有限公司 Data processing method, system, device and storage medium
WO2024051259A1 (en) * 2022-09-06 2024-03-14 华为技术有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN104023076B (en) 2017-12-15

Similar Documents

Publication Publication Date Title
CN109791522B (en) Data migration method and system and intelligent network card
CN108701004B (en) A data processing system, method and corresponding device
US10645164B1 (en) Consistent latency for solid state drives
US9565269B2 (en) Non-volatile memory express over ethernet
US9015268B2 (en) Remote direct storage access
US9098404B2 (en) Storage array, storage system, and data access method
US10339079B2 (en) System and method of interleaving data retrieved from first and second buffers
CN107229415B (en) A data writing method, data reading method and related equipment and system
EP3352071B1 (en) Data check method and storage system
US20140317346A1 (en) Redundant array of independent disks systems that utilize spans with different storage device counts for a logical volume
EP3142014B1 (en) Method, device and user equipment for reading/writing data in nand flash
CN106844245A (en) Data transmission method and device
US12032849B2 (en) Distributed storage system and computer program product
US9910797B2 (en) Space efficient formats for scatter gather lists
CN103984662A (en) Method and device for reading and writing data and storage system
US10209905B2 (en) Reusing storage blocks of a file system
CN104023076B (en) The management method and multi-tenant interchanger of Ethernet interface hard-disk capacity
CN104038550B (en) Data communications method and its device, storage system
CN105765542B (en) Method for accessing files, distributed storage system and storage nodes
US12504925B2 (en) Storage node, storage device, and network chip
US10289550B1 (en) Method and system for dynamic write-back cache sizing in solid state memory storage
US10216447B1 (en) Operating system management for direct flash over fabric storage devices
CN106557277A (en) The reading method and device of disk array
CN104956348A (en) SATA initiator addressing and storage device slicing
CN112445413A (en) Data storage method and device and related equipment

Legal Events

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