Hard disk cabinet control method, device, and medium

By using control methods and devices on both the disk enclosure controller side and the disk side, server consistency is determined and inconsistent access requests are rejected. By utilizing custom asynchronous event notifications for the disk, the problem of data corruption caused by multiple controllers accessing the disk is solved, reducing system cost and complexity and improving stability.

CN117218773BActive Publication Date: 2025-10-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311262829.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-10-28
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

In existing technologies, when multiple hosts access the hard drives in a disk enclosure simultaneously through multiple controllers, it can easily lead to data corruption on the hard drives.

Method used

By implementing a series of control methods and devices on the controller side and hard drive side of the hard drive enclosure, it is determined whether the server to be processed corresponding to the current access request is consistent with the target server. If they are inconsistent, the access request is rejected. Access conditions are sent by the hard drive manufacturer's custom asynchronous event notification, preventing different servers from accessing the same target hard drive through different controllers at the same time.

Benefits of technology

It effectively prevents hard drive data corruption, reduces system cost and complexity, and improves system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117218773B_ABST
    Figure CN117218773B_ABST
Patent Text Reader

Abstract

This invention relates to the field of data storage and discloses a hard disk enclosure control method, apparatus, and medium, comprising: acquiring and parsing a current access request sent by a server to determine the target hard disk; determining whether an occupancy identifier indicating the occupancy status sent by the target hard disk is received; wherein the occupancy identifier is an identifier sent by the target hard disk through a manufacturer-defined asynchronous event notification in response to an operation command; if an occupancy identifier is received, determining whether the pending server corresponding to the current access request is consistent with the target server; if they are inconsistent, rejecting the current access request. This application prevents different servers from accessing the same target hard disk at the same time, thus avoiding data corruption, by rejecting the access request when the pending server corresponding to the current access request is inconsistent with the target server. Simultaneously, the hard disk sends access conditions through a manufacturer-defined asynchronous event notification, eliminating the need for separate access link settings and reducing system cost and complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage, and in particular to a method, apparatus, and medium for controlling a hard disk enclosure. Background Technology

[0002] With the rapid development of data storage technology, in order to improve the utilization of storage devices and meet the needs of user data sharing, the concept of storage-compute separation has been widely used in server systems. Figure 1 The architecture diagram of a storage-compute separation server is as follows: Figure 1 As shown, after the separation of storage and computing, server 1 no longer has a data disk; the hard drives storing server data are centrally located in a hard disk enclosure for unified management. The hard disk enclosure and the diskless server are connected via a network.

[0003] Figure 2 A structural diagram of the hard drive enclosure, such as... Figure 2 As shown, the hard drive enclosure includes a controller 2 and a hard drive 3. Controller 2 is used to respond to hard drive operation requests sent by the server to perform read and write operations on the data in the hard drive. Since accessing the hard drive in the hard drive enclosure via the network may fail due to network cable failure, network interface card failure, or failure of the hard drive enclosure controller 2, a dual-controller architecture is currently mostly adopted to improve system stability. This involves setting up multiple controllers 2 in the hard drive enclosure, each controller 2 connected to all hosts. When any server 1 (e.g., server Host A) needs to read or write data in the hard drive, in order to ensure successful execution of the read / write operation, it needs to send access requests to all controllers 2. This may result in multiple controllers 2 accessing the hard drive 3 simultaneously, leading to hard drive data corruption.

[0004] Therefore, how to provide a disk enclosure control method to enable orderly access to disks by the server is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to solve the problem of hard disk data corruption caused by multiple hosts simultaneously accessing the hard disks in a hard disk enclosure through all controllers in the prior art. To this end, this invention provides a hard disk enclosure control method to prevent hard disk data corruption caused by different servers accessing the hard disks simultaneously through multiple controllers, and to reduce the cost and complexity of the system.

[0006] To address the aforementioned technical problems, this invention provides a hard disk enclosure control method, applied to the controller side of a hard disk enclosure, the hard disk enclosure control method comprising:

[0007] Obtain and parse the current access request sent by the server to determine the target hard drive;

[0008] Determine whether an occupation flag indicating the occupation status is received from the target hard drive; wherein the occupation flag is an flag sent by the target hard drive through a manufacturer-defined asynchronous event notification in response to an operation command;

[0009] If the occupancy identifier is received, the target server that has accessed the target hard drive is determined based on the occupancy identifier, and it is determined whether the server to be processed corresponding to the current access request is the same as the target server;

[0010] If they match, the operation instruction is generated based on the current access request, and the operation instruction is sent to the target hard disk so that the target hard disk can respond to the current access request;

[0011] If they do not match, the current access request is rejected.

[0012] In some embodiments, the occupancy identifier is the server identity information of the target server;

[0013] Accordingly, determining whether the server to be processed corresponding to the current access request is the same as the target server includes:

[0014] Parse the current access request to obtain the server identity information of the server to be processed;

[0015] Determine whether the server identity information of the server to be processed is the same as the server identity information of the target server;

[0016] If they are the same, then the server to be processed is determined to be consistent with the target server.

[0017] In some embodiments, after determining that the occupancy identifier sent by the target hard disk has not been received, the method further includes:

[0018] Generate operation instructions based on the current access request;

[0019] The operation command is sent to the target hard disk.

[0020] In some embodiments, generating operation instructions based on the current access request and controlling the target hard disk to respond to the current access request based on the operation instructions includes:

[0021] Parse the current access request to generate operation instructions;

[0022] Accordingly, sending the operation command to the target hard disk includes:

[0023] If the operation instruction is a read instruction, then the operation instruction is parsed to obtain the read address information;

[0024] The data to be read is determined based on the read address information, and the data to be read is copied to the cache area;

[0025] Send the data to be read in the cache area to the server;

[0026] If the operation instruction is a write instruction, then the operation instruction is parsed to obtain the data to be written and the write address information, and the data to be written is saved to the cache area;

[0027] The data to be written in the cache area is written to the target hard disk according to the write address information, and a write success message is sent to the server corresponding to the current access request.

[0028] In some embodiments, it also includes:

[0029] When a permission release request is received from the target server, a clearing instruction for the occupancy identifier is generated based on the server identity information of the target server, and the clearing instruction for the occupancy identifier is sent to the target hard disk so that the target hard disk can update the occupancy identifier based on the identity information of the server to be processed.

[0030] In some embodiments, it also includes:

[0031] Obtain the permission acquisition request sent by the server to be processed;

[0032] Parse the permission acquisition request to obtain the priority information of the server to be processed;

[0033] Determine whether the server to be processed has the permission to access the information based on the server identity information and the priority information of the server to be processed.

[0034] If the required access permission is granted, an occupancy identifier update instruction is generated based on the server identity information, and the occupancy identifier update instruction is sent to the target hard disk so that the hard disk updates the occupancy identifier based on the server identity information.

[0035] To address the aforementioned technical problems, this application also provides a hard disk enclosure control method, applied to the hard disk side of a hard disk enclosure, the hard disk enclosure control method comprising:

[0036] The controller receives an operation instruction sent by the controller; wherein the operation instruction is the instruction sent by the controller to the target hard disk for the first time, or the instruction sent by the controller when it receives an occupancy identifier from the target hard disk to indicate the occupancy status and the pending server corresponding to the current access request is the same as the target server; the target server is the server that the controller has determined to have accessed the target hard disk based on the occupancy identifier.

[0037] In response to the operation command from the controller, a placeholder identifier representing the occupancy status is sent to the controller; wherein the placeholder identifier is an identifier sent by the target hard disk through a manufacturer-defined asynchronous event notification.

[0038] In some embodiments, it also includes:

[0039] Determine whether an occupation identifier update instruction has been obtained; wherein, the occupation identifier update instruction is an instruction sent by the controller when it obtains a permission acquisition request sent by the server to be processed, and determines that the server to be processed has the permission to acquire based on the server identity information and priority information of the server to be processed;

[0040] If the occupancy identifier update instruction is obtained, the occupancy identifier update instruction is parsed to obtain the server identity information of the server to be processed, and the occupancy identifier is updated according to the server identity information.

[0041] To address the aforementioned technical problems, this application also provides a hard disk enclosure control device, characterized in that it is applied to the controller side of the hard disk enclosure, and the hard disk enclosure control device includes:

[0042] The acquisition module is used to acquire and parse the current access requests sent by the server in order to determine the target hard drive;

[0043] The first judgment module is used to determine whether it has received an occupation identifier sent by the target hard drive to indicate its occupation status; wherein, the occupation identifier is an identifier sent by the target hard drive through a manufacturer-defined asynchronous event notification in response to an operation command;

[0044] The second judgment module is used to determine, based on the occupancy identifier, the target server that has accessed the target hard disk if the occupancy identifier is received, and to determine whether the server to be processed corresponding to the current access request is the same as the target server.

[0045] The generation module is used to generate operation instructions based on the current access request if the request is consistent, and to control the target hard disk to respond to the current access request based on the operation instructions.

[0046] The rejection module is used to reject the current access request if there is a discrepancy.

[0047] To address the aforementioned technical problems, this application also provides a hard disk enclosure control device, including a memory for storing computer programs;

[0048] A processor is used to implement the steps of the hard disk enclosure control method when executing the computer program.

[0049] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned hard disk enclosure control method.

[0050] This invention provides a hard disk enclosure control method, applied to the controller side of a hard disk enclosure. The method includes: acquiring and parsing a current access request sent by a server to determine the target hard disk; determining whether an occupancy identifier representing the occupancy status sent by the target hard disk has been received; wherein the occupancy identifier is an identifier sent by the target hard disk through a vendor-defined asynchronous event notification in response to an operation command; if an occupancy identifier is received, determining the target server that has accessed the target hard disk based on the occupancy identifier, and determining whether the server to be processed corresponding to the current access request is consistent with the target server; if consistent, generating an operation command based on the current access request and sending the operation command to the target hard disk so that the target hard disk can respond to the current access request; if inconsistent, rejecting the current access request. Therefore, the technical solution provided by this application, by determining whether the server to be processed corresponding to the current access request is consistent with the target server, and rejecting the access request when inconsistent, prevents different servers from accessing the same target hard disk at the same time through different controllers, thus preventing hard disk data corruption. Simultaneously, the hard disk sends access conditions through its built-in vendor-defined asynchronous event notification, eliminating the need to set up a separate access link, reducing system cost and complexity.

[0051] In addition, the present invention also provides a hard disk enclosure control device and a medium, which correspond to the above method and have the same effect. Attached Figure Description

[0052] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is an architecture diagram of a storage-compute separation server;

[0054] Figure 2 This is a structural diagram of a hard drive enclosure;

[0055] Figure 3 A flowchart of a hard disk enclosure control method provided in an embodiment of the present invention;

[0056] Figure 4 A flowchart illustrating another hard disk enclosure control method provided in an embodiment of the present invention.

[0057] Figure 5This is a structural diagram of a hard disk enclosure control device provided in an embodiment of the present invention;

[0058] Figure 6 This is a structural diagram of a hard disk enclosure control device provided in another embodiment of the present invention;

[0059] The attached diagram is labeled as follows: 1 is the server, 2 is the controller, and 3 is the hard drive. Detailed Implementation

[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0061] The core of this invention is to provide a hard disk enclosure control method to prevent data corruption caused by different servers accessing the hard disk simultaneously through multiple controllers, and to reduce system cost and complexity.

[0062] With the rapid development of data storage technology and the accelerated innovation of new applications, the demand for data sharing is becoming increasingly urgent. Recently, the concept of storage-compute separation has emerged, which involves separating the hard drives from traditional servers. However, since most hard drives currently use PCIe interfaces, a controller needs to be added to the hard drive enclosure to convert the PCIe interface hard drives into network interface hard drives in order for the server to access them via the network. The hard drive enclosure described in this patent manages NVMe SSDs, and the network used can be FC, Ethernet, or IB. The server and the hard drive enclosure communicate and access each other via the NVMe Over Fabrics protocol.

[0063] Compared to local hard drives on traditional servers, accessing hard drives in remote disk enclosures over a network increases the probability of failure, such as network cable failures, network interface card failures, and disk enclosure controller failures. Sharing storage resources over a network does not want to sacrifice reliability, so disk enclosures are generally designed with a dual-controller architecture, with multiple links between the server and the enclosure. Therefore, the hard drives used in such dual-controller enclosures must be dual-port hard drives, meaning each hard drive can connect to the controllers of two enclosures. When multiple servers share hard drives over a network, ensuring data security is crucial to prevent data corruption when multiple servers write to the hard drive simultaneously. This can be addressed by the servers coordinating with each other, but when multiple servers are writing simultaneously, negotiation between servers or the use of distributed locks becomes complex and time-consuming. A better approach is for the shared hard drives to provide locking functionality. A server only needs to acquire lock privileges before writing data, and release the lock after completion. Servers without lock privileges are denied data writing access.

[0064] like Figure 1 or Figure 2 As shown in the diagram, the hard drive uses an NVMe SSD. The entity accessing the hard drive is called a Host in the NVMe protocol. The dual-port hard drive in the diagram is connected to two controllers in the disk enclosure, meaning this hard drive supports two Hosts, Host1 and Host2, each with its own identifier. The hard drive's locking function allows writing to only be permitted from Host1 or only from Host2 at any given time. The two controllers in the diagram are used to improve reliability. The same server accesses the hard drive by connecting to the two controllers in the disk enclosure via two separate links. If one server (let's assume it corresponds to HostA in the diagram) obtains lock permission from the first controller of the disk enclosure, and the first controller uses the NVMe SSD's pre-locking function to obtain lock permission from the hard drive, then the hard drive will allow Host1 to write but not Host2; that is, the second controller of the disk enclosure cannot write. However, from the server's perspective, although it has obtained lock permission from the first controller, writing from the second controller will still fail. This means the server can only write from the link from which the lock permission was obtained. Another issue is that HostA obtains lock access from the first controller of the hard drive enclosure, but from the hard drive's perspective, it grants lock access to Host1. Regardless of whether it is HostB or HostC, any operation from the first controller of the hard drive enclosure actually grants Host1 access, so the intended purpose of locking is not achieved.

[0065] To address this technical problem, this invention provides a hard disk enclosure control method. By determining whether the server to be processed corresponding to the current access request is the same as the target server, and rejecting the access request when they are inconsistent, it prevents different servers from accessing the same target hard disk simultaneously through different controllers, thus avoiding data corruption. Simultaneously, the hard disk sends access conditions via a built-in manufacturer-defined asynchronous event notification, eliminating the need for separate access link configuration and reducing system cost and complexity. To enable those skilled in the art to better understand this invention, the following detailed description, in conjunction with the accompanying drawings and specific embodiments, further illustrates the invention.

[0066] Figure 3 This is a flowchart illustrating a hard disk enclosure control method provided in an embodiment of the present invention. The method is applied to the controller side of the hard disk enclosure, such as... Figure 3 As shown, the hard disk enclosure control method includes:

[0067] S10: Obtain and parse the current access request sent by the server to determine the target hard drive;

[0068] S11: Determine whether an occupation flag indicating the occupation status has been received from the target hard drive; wherein, the occupation flag is an flag sent by the target hard drive through a manufacturer-defined asynchronous event notification in response to an operation command;

[0069] S12: If an occupation flag is received, determine the target server that has accessed the target hard drive based on the occupation flag, and determine whether the server to be processed corresponding to the current access request is the same as the target server.

[0070] S120: If they match, an operation instruction is generated based on the current access request, and the operation instruction is sent to the target hard disk so that the target hard disk can respond to the current access request;

[0071] S121: If there is no agreement, the current access request is rejected.

[0072] like Figure 1As shown, multiple different servers are connected to the controller of the hard drive enclosure to operate the hard drives in the enclosure. In this embodiment, the server to be processed is the server that sends a hard drive access request to the controller, and the target server is the server currently accessing the hard drive. When a current access request sent from any server to any server is obtained, the target hard drive corresponding to the current access request is determined, and it is determined whether an occupancy flag indicating the occupancy status is received from the target hard drive. For example, when there are servers HOSTA, HOSTB, and HOSTC, controllers host1 and host2, and hard drives 1 and 2 in the system, when HOSTA needs to access hard drive 1, HOSTA sends a hard drive access request to controllers host1 and host2 simultaneously. If hard drive 1 is not being accessed by servers HOSTB and HOSTC at this time, controller host1 or controller host2 generates an operation command from the HOSTA's access request and controls the hard drive to respond to the current access request through the operation command. At the same time, hard drive 1 sends an occupancy flag to each controller (which may or may not include controller host1) through the hard drive driver. Upon receiving the occupancy flag and acquiring a hard drive access request, controller 2 determines whether the server sending the access request is a HOSTA server. If it is a HOSTA server, access is allowed, and an operation command is generated based on the access request. If it is a HOSTB or HOSTC server, the access request is denied.

[0073] In practical implementation, a hard drive enclosure is a device that centrally manages hard drives and provides storage to the server via a network interface. This device internally includes NVMe SSDs, two controllers, and a network interface card. The hard drives used are NVMe SSDs. The NVMe protocol's Set Feature command contains a Host Identifier setting instruction, which requires hard drive support. The NVMe protocol's asynchronous event notification function reserves a vendor-defined event; this invention requires adding a Host Identifier notification function to this vendor-defined event.

[0074] Each controller in the hard drive enclosure contains a Central Processing Unit (CPU) and memory to run the software system. This software system includes hard drive drivers, network interface virtual disks (NICs), and the mapping and interfacing between these NICs and the hard drive drivers. The network interface card (NIC) of the enclosure handles the network connection between the server and the enclosure, carrying the NVM Express over Fabrics protocol over the network link for the server to access the NICs within the enclosure. The NICs created by the enclosure controllers receive and process requests from the network, managing the connections established by the server via NVM Express over Fabrics and related server information. On each controller of the enclosure, the number of NICs matches the number of actual hard drives in the enclosure, establishing a one-to-one mapping. When the server reads or writes to a NIC, the NIC, through its mapped hard drive driver, forwards the server's read / write request to the corresponding hard drive. After processing, the NIC responds to the server via the network with the request result. The network interface virtual disk implements a reservation function. Neither the network interface virtual disk nor the actual hard disk is divided into multiple storage partitions. That is, each disk has only one namespace, and the permission control of the namespace is the same as the permission control of the disk.

[0075] In practical implementation, the synchronization of authorized data is achieved through the asynchronous notification function built into the hard drive. Using asynchronous notification in the device driver allows the driver to actively notify the application when accessing the device. Asynchronous notification means that the application is actively notified as soon as the device is ready, so the application doesn't need to query the device status. This is very similar to the concept of a hardware "interrupt," and a more accurate term is "signal-driven asynchronous I / O." Signals are a software-level simulation of the interrupt mechanism. In principle, a process receiving a signal is equivalent to the processor receiving an interrupt request. Signals are asynchronous; a process doesn't need to wait for the signal to arrive, and in fact, the process doesn't know when the signal will arrive. Blocking I / O means waiting for the device to become accessible before accessing it. Non-blocking I / O uses the `poll()` function to check if the device is accessible, while asynchronous notification means the device notifies the user that it is accessible, and then the user performs I / O processing—that is, the driver initiates and actively notifies the application. These I / O methods can complement each other.

[0076] In the custom asynchronous event handling function of the hard drive driver development vendor, after the hard drive driver obtains the Host Identifier information, it needs to inform the corresponding network interface virtual disk. The network interface virtual disk judges the Host Identifier information. If it is a non-zero value, it means that this host is requesting lock permission through another controller. The network interface virtual disk records the Host Identifier that has obtained the lock permission. If it is all zero values, it means that the network interface virtual disk of the other controller is notifying the release of lock permission. Since only one host can obtain lock permission at the same time, the network interface virtual disk can release the lock permission of this host according to the lock permission record.

[0077] In practice, the placeholder identifier sent by the hard drive can be the server identity information of the target server. Correspondingly, after the hard drive enclosure controller receives the access request from the server connected to the enclosure, it parses the hard drive access request to obtain the server identity information; and then determines whether the server corresponding to the placeholder identifier has the necessary access permissions. The placeholder identifier is information sent by the hard drive through a vendor-defined asynchronous event notification. If the hard drive has access permissions, it generates an operation command based on the hard drive access request and the server identity information, and sends the operation command to the hard drive.

[0078] This invention provides a hard disk enclosure control method, applied to the controller side of a hard disk enclosure. The method includes: acquiring and parsing a current access request sent by a server to determine the target hard disk; determining whether an occupancy identifier representing the occupancy status sent by the target hard disk has been received; wherein the occupancy identifier is an identifier sent by the target hard disk through a vendor-defined asynchronous event notification in response to an operation command; determining the target server that has accessed the target hard disk based on the occupancy identifier; and determining whether the server to be processed corresponding to the current access request is consistent with the target server; if consistent, generating an operation command based on the current access request and sending the operation command to the target hard disk so that the target hard disk can respond to the current access request; if inconsistent, rejecting the current access request. Therefore, the technical solution provided by this application, by determining whether the server to be processed corresponding to the current access request is consistent with the target server, and rejecting the access request when inconsistent, prevents different servers from accessing the same target hard disk at the same time through different controllers, thus preventing hard disk data corruption. Simultaneously, the hard disk sends access conditions through its built-in vendor-defined asynchronous event notification, eliminating the need to set up a separate access link, reducing system cost and complexity.

[0079] In practice, the occupancy identifier can be the server identity information of the target server (e.g., server ID), or other predefined information, such as the username information for logging into the server.

[0080] To ensure the reliability of the occupancy identifier, in this embodiment, the server identity information of the target server is selected as the occupancy identifier.

[0081] Accordingly, determining whether the server to be processed and the target server corresponding to the current access request are the same includes: parsing the current access request to obtain the server identity information of the server to be processed; determining whether the server identity information of the server to be processed is the same as the server identity information of the target server; if they are the same, then it is determined that the server to be processed and the target server are the same.

[0082] In practice, the placeholder identifier sent by the hard drive can be either a single authorized server's identity information or a running access list containing the identity information of multiple servers; no limitation is made here. It is understood that when no server is accessing the hard drive, the hard drive has not granted access permissions to any server; therefore, the controller will not receive the placeholder identifier in this situation.

[0083] Based on the above embodiments, after determining that no occupancy identifier has been received from the target hard drive, the method further includes: generating an operation instruction based on the current access request; and sending the operation instruction to the target hard drive.

[0084] In practice, when the controller does not receive a detection placeholder flag, it indicates that the hard drive is not being read or written by other servers. Therefore, the current server can directly obtain the lock permission for the corresponding hard drive.

[0085] Furthermore, generating operation instructions based on the current access request and controlling the target hard drive to respond to the current access request according to the operation instructions includes: parsing the current access request to generate operation instructions; correspondingly, sending the operation instructions to the target hard drive includes: if the operation instruction is a read instruction, parsing the operation instruction to obtain read address information; determining the data to be read based on the read address information and copying the data to be read to the cache area; sending the data to be read in the cache area to the server; if the operation instruction is a write instruction, parsing the operation instruction to obtain the data to be written and write address information, and saving the data to be written to the cache area; writing the data to be written in the cache area to the target hard drive according to the write address information, and sending a write success message to the server corresponding to the current access request.

[0086] The hard drive controller performs read and write operations on the tracks of the hard drive. When the host writes data to the hard drive, the hard drive controller first transfers the data to a buffer, and then transfers the data sequentially to the corresponding tracks according to the track address. When the host reads data from the hard drive, the hard drive controller transfers the data from the corresponding tracks to the buffer according to the track address, and then transfers the data to memory according to the host's instructions.

[0087] When a server initiates a read / write request to a hard drive in a disk enclosure, the corresponding network interface virtual disk detects a lock record. The network interface virtual disk then determines the Host Identifier of the server initiating the request. If the Host Identifier matches the one that obtained the lock permission in the record, the request is allowed; otherwise, the request is rejected.

[0088] Furthermore, when a permission release request is received from the target server, a clearing instruction for the occupancy flag is generated based on the server identity information of the target server, and the clearing instruction for the occupancy flag is sent to the target hard disk so that the target hard disk can update the occupancy flag based on the identity information of the server to be processed.

[0089] In practice, after obtaining the Host Identifier information, the hard drive needs to inform the corresponding network interface virtual disk. The network interface virtual disk uses the Host Identifier information to determine whether it is a non-zero value. If it is, it means that this host is requesting lock permissions through another controller, and the network interface virtual disk records the Host Identifier that has obtained lock permissions. If it is all zeros, it means that the network interface virtual disk of the other controller is notifying the release of lock permissions. Since only one server host can obtain lock permissions at the same time, the network interface virtual disk can release the lock permissions of this server host according to the lock permission record.

[0090] It's understandable that even within the same system, different processes run on different servers, and therefore, different servers have different priorities. To ensure the normal operation of the server system, when a high-priority server needs to access the hard drive, even if the hard drive is currently occupied, the current access process needs to be stopped so that the higher-priority server can read and write to the hard drive.

[0091] Based on the above embodiments, the method further includes: obtaining a permission acquisition request sent by the server to be processed; parsing the permission acquisition request to obtain the priority information of the server to be processed; determining whether the server to be processed has the permission to acquire based on the server identity information and priority information of the server to be processed; if it has the permission to acquire, generating an occupancy identifier update instruction based on the server identity information and sending the occupancy identifier update instruction to the target hard disk so that the target hard disk can update the occupancy identifier based on the server identity information.

[0092] In this embodiment, when a permission request is received from the server, if the server has the permission, a list update instruction will be generated based on the server's identity information so that the hard drive can immediately provide access to the current server. This ensures that high-priority servers can access the hard drive first, thereby improving the stability and reliability of the system.

[0093] In practice, multiple servers are connected to the same hard drive enclosure to achieve shared storage. The tasks running on these servers may have different priorities. When multiple servers with different priorities need to use the same hard drive enclosure or hard drive, it may cause high-priority tasks to be unable to obtain hard drive access permissions first. Therefore, access server queues can be set up according to the priority order of the servers to provide services to high-priority servers first.

[0094] Figure 4 This is a flowchart of another hard disk enclosure control method provided in an embodiment of the present invention, applied to the hard disk side of the hard disk enclosure, such as... Figure 4 As shown, the hard disk enclosure control method includes:

[0095] S20: Receive the operation instruction sent by the controller; wherein, the operation instruction is the instruction sent by the controller to the target hard disk for the first time, or the instruction sent by the controller when it receives the occupancy identifier sent by the target hard disk to represent the occupancy status and the server to be processed corresponding to the current access request is the same as the target server; the target server is the server that the controller has accessed based on the occupancy identifier.

[0096] S21: In response to the controller's operation command, send a placeholder identifier to the controller to represent the occupancy status; wherein, the placeholder identifier is an identifier sent by the target hard drive through a manufacturer-defined asynchronous event notification.

[0097] Among them, the manufacturer-defined asynchronous event notification is an event notification function provided by hard drive manufacturers. When using the manufacturer-defined asynchronous event notification to transmit data, users do not need to develop their own communication links. They only need to modify the existing event definitions, thereby reducing the cost and complexity of the system.

[0098] In practice, the server uses the reservation function to initiate a lock request to the disks in the disk enclosure. Upon receiving the request, the corresponding network interface virtual disk checks if the server can acquire the lock. If the network interface virtual disk's lock record indicates that it is already locked by another server, it returns a lock acquisition failure. If it is not currently locked, the network interface virtual disk sends a request to the disk to set the Host Identifier via the disk driver. After the disk successfully notifies the other controller in the disk enclosure through another port, it responds that the Host Identifier setting was successful. The network interface virtual disk then initiates the locking function, records the Host Identifier that has acquired the lock, and responds to the server via the network to inform them that the lock acquisition was successful. At this point, the corresponding network interface virtual disks on both controllers in the disk enclosure have initiated the locking function.

[0099] This invention provides a hard disk enclosure control method, comprising: receiving an operation instruction sent by a controller; wherein the operation instruction is an instruction sent by the controller to a target hard disk for the first time, or an instruction sent by the controller when it receives an occupancy identifier from the target hard disk indicating an occupancy status and the server to be processed corresponding to the current access request is consistent with the target server; the target server is a server that has accessed the target hard disk as determined by the controller based on the occupancy identifier; responding to the controller's operation instruction and sending a placeholder identifier to the controller indicating an occupancy status; wherein the placeholder identifier is an identifier sent by the target hard disk through a manufacturer-defined asynchronous event notification. Therefore, the technical solution provided in this application, by determining whether the server to be processed corresponding to the current access request is consistent with the target server, and rejecting the access request when they are inconsistent, prevents different servers from accessing the same target hard disk at the same time through different controllers, thus preventing hard disk data corruption. Simultaneously, the hard disk sends access conditions through its built-in manufacturer-defined asynchronous event notification, eliminating the need to set up a separate access link, reducing system cost and complexity.

[0100] In a preferred embodiment, before obtaining the operation instructions sent by each controller, the method further includes: activating the hard drive extended host identifier and initializing the vendor-defined asynchronous event notification. In specific implementation, a hard drive supporting dual ports is first selected, and the Enable Extended Host Identifier (EXHID) field is set to 1 in the hard drive's Set Feature function to enable the hard drive to support a 128-bit (16-byte) long Host Identifier. A vendor-defined asynchronous event notification function is then developed in the hard drive. When one controller in the hard drive enclosure sends a request to the hard drive to set the Host Identifier, the hard drive notifies the other controller in the hard drive enclosure of the vendor-defined asynchronous event on its other port. After receiving the notification and obtaining the newly set Host Identifier, the hard drive's local port responds to its own controller with a successful setup.

[0101] In addition, the disk enclosure needs to be initialized, the network interface virtual disk's reservation function is enabled, and the disk drive initiates a vendor-defined asynchronous event wait function to the disk. The server establishes a network connection with the network interface virtual disk in the disk enclosure using the traditional NVMe over Fabrics protocol. The connection management in the network interface virtual disk records the Host Identifier information of each server that has established a connection via the NVMe over Fabrics protocol. This information is required by the protocol when establishing a network connection.

[0102] Furthermore, the disk enclosure control method provided by this invention also includes: clearing the placeholder identifier after detecting a list clearing command sent by the controller; sending the placeholder identifier to each controller via a vendor-defined asynchronous event notification so that the server can release the lock permission. This enables the system to provide access services to high-priority servers in a timely manner.

[0103] In practice, after receiving a request to release lock permissions, the network interface virtual disk clears its lock permission record and initiates a request to set the Host Identifier via the hard drive driver. However, this time, the Host Identifier passed in is all zeros. The hard drive notifies another controller in the disk enclosure of a vendor-defined asynchronous event through another port. After the hard drive driver on the other controller in the disk enclosure informs the network interface virtual disk of the all-zero Host Identifier information, the corresponding network interface virtual disk on the other controller in the disk enclosure also clears its lock permission record and releases the lock permissions. It is important to note that the network interface virtual disk in the disk enclosure no longer checks whether the requester is the same as the one that applied for the lock permissions when releasing lock permissions. This is to prevent the locked disk data from becoming permanently inaccessible due to a server failure that successfully applied for lock permissions.

[0104] As a preferred embodiment, the disk enclosure control method provided by the present invention further includes: upon detecting a list update instruction sent by the controller, parsing the list update instruction to obtain server identity information; updating the placeholder identifier according to the server identity information; and sending the placeholder identifier to each controller through a manufacturer-defined asynchronous event notification.

[0105] In the above embodiments, the hard disk enclosure control method has been described in detail. This invention also provides embodiments corresponding to the hard disk enclosure control device. It should be noted that this invention describes the device embodiments from two perspectives: one based on functional modules, and the other based on hardware.

[0106] Figure 5 This is a structural diagram of a hard disk enclosure control device provided in an embodiment of the present invention, as shown below. Figure 5 As shown, this device is applied to the controller side of a hard disk enclosure, and the hard disk enclosure control device includes:

[0107] The acquisition module 10 is used to acquire and parse the current access request sent by the server in order to determine the target hard drive;

[0108] The first judgment module 11 is used to determine whether it has received an occupation identifier sent by the target hard drive to represent the occupation status; wherein, the occupation identifier is an identifier sent by the target hard drive through a manufacturer-defined asynchronous event notification in response to an operation command;

[0109] The second judgment module 12 is used to determine the target server that has accessed the target hard disk based on the occupancy identifier if an occupancy identifier is received, and to determine whether the server to be processed corresponding to the current access request is consistent with the target server.

[0110] The generation module 13 is used to generate operation instructions based on the current access request if the request is consistent, and to control the target hard disk to respond to the current access request based on the operation instructions.

[0111] Module 14 is used to reject the current access request if there is a discrepancy.

[0112] In addition, the hard disk enclosure control state provided by the present invention also includes a second generation module, a parsing module, a permission release module, and a permission update module.

[0113] The second generation module is used to generate an operation instruction based on the current access request after determining that no occupancy identifier has been received from the target hard drive; and then send the operation instruction to the target hard drive.

[0114] The parsing module is used to parse the current access request to generate operation instructions;

[0115] The operation instruction sending module is used to: parse the operation instruction (if it is a read instruction) to obtain the read address information; determine the data to be read based on the read address information and copy the data to be read to the cache area; send the data to be read from the cache area to the server; parse the operation instruction (if it is a write instruction) to obtain the data to be written and the write address information, save the data to be written to the cache area; write the data to be written from the cache area to the target hard disk based on the write address information, and send a write success message to the server corresponding to the current access request.

[0116] The permission release module is used to generate a clearing instruction for the occupancy flag based on the server identity information of the target server when a permission release request is received from the target server, and send the clearing instruction to the target hard disk so that the target hard disk can update the occupancy flag according to the identity information of the server to be processed.

[0117] The permission update module is used to obtain permission acquisition requests sent by the server to be processed; parse the permission acquisition requests to obtain the priority information of the server to be processed; determine whether the server to be processed has the permission to acquire permissions based on the server identity information and priority information; if it has the permission to acquire permissions, generate an occupation mark update instruction based on the server identity information and send the occupation mark update instruction to the target hard disk so that the target hard disk can update the occupation mark based on the server identity information.

[0118] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0119] This invention provides a hard disk enclosure control device applied to the controller side of a hard disk enclosure. The hard disk enclosure control method includes: acquiring and parsing a current access request sent by a server to determine the target hard disk; determining whether an occupancy identifier indicating occupancy status has been received from the target hard disk; wherein the occupancy identifier is an identifier sent by the target hard disk through a manufacturer-defined asynchronous event notification in response to an operation command; determining the target server that has accessed the target hard disk based on the occupancy identifier; and determining whether the server to be processed corresponding to the current access request is consistent with the target server; if consistent, generating an operation command based on the current access request and sending the operation command to the target hard disk so that the target hard disk can respond to the current access request; if inconsistent, rejecting the current access request. Therefore, the technical solution provided by this application, by determining whether the server to be processed corresponding to the current access request is consistent with the target server, and rejecting the access request when inconsistent, prevents different servers from accessing the same target hard disk at the same time through different controllers, thus preventing hard disk data corruption. Simultaneously, the hard disk sends access conditions through its built-in manufacturer-defined asynchronous event notification, eliminating the need to set up a separate access link, reducing system cost and complexity.

[0120] Figure 6 A structural diagram of a hard disk enclosure control device provided in another embodiment of the present invention is shown below. Figure 6 As shown, the hard disk enclosure control device includes: a memory 20 for storing computer programs;

[0121] The processor 21 is used to execute computer programs to implement the steps of the hard disk enclosure control method as described in the above embodiments.

[0122] The hard disk enclosure control device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0123] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0124] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the hard disk enclosure control method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, server identity information, placeholder identifiers, etc.

[0125] In some embodiments, the hard disk enclosure control device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0126] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the hard disk enclosure control device and may include more or fewer components than shown.

[0127] The hard disk enclosure control device provided in this embodiment of the invention includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: determining whether an occupancy identifier indicating an occupancy status is received from the target hard disk; wherein, the occupancy identifier is an identifier sent by the target hard disk through a manufacturer-defined asynchronous event notification in response to an operation command; if the occupancy identifier is received, the target server that has accessed the target hard disk is determined based on the occupancy identifier, and it is determined whether the server to be processed corresponding to the current access request is consistent with the target server; if they are consistent, an operation command is generated based on the current access request, and the target hard disk is controlled to respond to the current access request based on the operation command; if they are inconsistent, the current access request is rejected.

[0128] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments (which may be a method corresponding to the controller side, a method corresponding to the hard disk side, or a method corresponding to both the controller side and the hard disk side).

[0129] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] The hard disk enclosure control method, apparatus, and medium provided by the present invention have been described in detail above. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

[0131] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

Claims

1. A hard disk enclosure control method, characterized in that, The hard disk enclosure control method, applied to the controller side of the hard disk enclosure, includes: Obtain and parse the current access request sent by the server to determine the target hard drive; Determine whether an occupation flag indicating the occupation status is received from the target hard drive; wherein the occupation flag is an flag sent by the target hard drive through a manufacturer-defined asynchronous event notification in response to an operation command; If the occupancy identifier is received, the target server that has accessed the target hard drive is determined based on the occupancy identifier, and it is determined whether the server to be processed corresponding to the current access request is the same as the target server; If they match, the operation instruction is generated based on the current access request, and the operation instruction is sent to the target hard disk so that the target hard disk can respond to the current access request; If they do not match, the current access request is rejected.

2. The hard disk enclosure control method according to claim 1, characterized in that, The occupancy identifier is the server identity information of the target server; Accordingly, determining whether the server to be processed corresponding to the current access request is the same as the target server includes: Parse the current access request to obtain the server identity information of the server to be processed; Determine whether the server identity information of the server to be processed is the same as the server identity information of the target server; If they are the same, then the server to be processed is determined to be consistent with the target server.

3. The hard disk enclosure control method according to claim 2, characterized in that, After determining that the occupancy identifier sent by the target hard drive has not been received, the method further includes: The operation instruction is generated based on the current access request; The operation command is sent to the target hard disk.

4. The hard disk enclosure control method according to claim 1, characterized in that, The step of generating an operation instruction based on the current access request and controlling the target hard disk to respond to the current access request based on the operation instruction includes: Parse the current access request to generate operation instructions; Accordingly, sending the operation command to the target hard disk includes: If the operation instruction is a read instruction, then the operation instruction is parsed to obtain the read address information; The data to be read is determined based on the read address information, and the data to be read is copied to the cache area; Send the data to be read in the cache area to the server; If the operation instruction is a write instruction, then the operation instruction is parsed to obtain the data to be written and the write address information, and the data to be written is saved to the cache area; The data to be written in the cache area is written to the target hard disk according to the write address information, and a write success message is sent to the server corresponding to the current access request.

5. The hard disk enclosure control method according to claim 2, characterized in that, Also includes: When a permission release request is received from the target server, a clearing instruction for the occupancy identifier is generated based on the server identity information of the target server, and the clearing instruction for the occupancy identifier is sent to the target hard disk so that the target hard disk can update the occupancy identifier based on the identity information of the server to be processed.

6. The hard disk enclosure control method according to any one of claims 1 to 5, characterized in that, Also includes: Obtain the permission acquisition request sent by the server to be processed; Parse the permission acquisition request to obtain the priority information of the server to be processed; Determine whether the server to be processed has the permission to access the information based on the server identity information and the priority information of the server to be processed. If the required access permission is granted, an occupancy identifier update instruction is generated based on the server identity information, and the occupancy identifier update instruction is sent to the target hard disk so that the target hard disk updates the occupancy identifier based on the server identity information.

7. A hard disk enclosure control method, characterized in that, The hard drive control method, applied to the hard drive side of a hard drive enclosure, includes: The controller receives an operation instruction sent by the controller; wherein the operation instruction is the instruction sent by the controller to the target hard disk for the first time, or the instruction sent by the controller when it receives an occupancy identifier from the target hard disk to indicate the occupancy status and the pending server corresponding to the current access request is the same as the target server; the target server is the server that the controller has determined to have accessed the target hard disk based on the occupancy identifier. In response to the operation command from the controller, a placeholder identifier representing the occupancy status is sent to the controller; wherein the placeholder identifier is an identifier sent by the target hard disk through a manufacturer-defined asynchronous event notification.

8. The hard disk enclosure control method according to claim 7, characterized in that, Also includes: Determine whether an occupation identifier update instruction has been obtained; wherein, the occupation identifier update instruction is an instruction sent by the controller when it obtains a permission acquisition request sent by the server to be processed, and determines that the server to be processed has the permission to acquire based on the server identity information and priority information of the server to be processed; If the occupancy identifier update instruction is obtained, the occupancy identifier update instruction is parsed to obtain the server identity information of the server to be processed, and the occupancy identifier is updated according to the server identity information.

9. A hard disk enclosure control device, characterized in that, The hard disk enclosure control device, applied to the controller side of the hard disk enclosure, includes: The acquisition module is used to acquire and parse the current access requests sent by the server in order to determine the target hard drive; The first judgment module is used to determine whether it has received an occupation identifier sent by the target hard drive to represent the occupation status; wherein the occupation identifier is an identifier sent by the target hard drive through a manufacturer-defined asynchronous event notification in response to an operation command; The second judgment module is used to determine, based on the occupancy identifier, the target server that has accessed the target hard disk if the occupancy identifier is received, and to determine whether the server to be processed corresponding to the current access request is the same as the target server. The generation module is used to generate operation instructions based on the current access request if the request is consistent, and to control the target hard disk to respond to the current access request based on the operation instructions. The rejection module is used to reject the current access request if there is a discrepancy.

10. A hard disk enclosure control device, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the steps of the hard disk enclosure control method as described in any one of claims 1 to 8 when executing the computer program.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the hard disk enclosure control method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Multiprocessor system

    JP1997081526A

  • Synchronizing requests to access computing resources

    US20180314650A1