Control Method, Device and Medium of a Storage Device
By receiving and converting REST requests to SCSI instructions under the fiber network and directly managing storage devices, the problem of not being able to directly manage storage devices under the fiber network is solved, and the effect of simplifying network topology and reducing maintenance costs is achieved.
Patent Information
- Application Number
- CN202210587028.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-05-27
AI Technical Summary
The storage device cannot be directly managed under a fiber optic network, and additional network switches are required, resulting in increased network complexity and system instability.
By receiving the REST request input by the user, it is converted into SCSI instructions and sent to the storage device through the FC link, and directly managing the storage device under the fiber network topology, simplifying the network topology.
Simplifies the network topology, reduces network maintenance costs, and improves system stability.
Smart Images

Figure CN115022746B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical fiber transmission, and in particular to a control method, device, and medium for a storage device. Background Art
[0002] With the rapid development of artificial intelligence (AI), big data, and cloud platforms, storage demands are growing, and more and more users are adopting large amounts of storage as core data storage media. Efficiently managing multiple storage devices has become a prerequisite for users to establish big data centers. Currently, managing storage devices requires setting up an Ethernet environment and connecting to the storage device's IP address via the Secure Shell (SSH) protocol for management operations. However, to ensure efficient business operations, many front-end business platforms typically use fiber optic switches to form a fiber optic network to provide higher bandwidth.
[0003] Currently, storage devices cannot be managed directly over fiber networks. Network switches must be added to create an Ethernet environment for storage device management. This topology increases network complexity. Furthermore, because Ethernet topologies typically utilize in-band management, with service and management flows sharing the same channel, network latency or packet loss can lead to system instability.
[0004] It can be seen that how to use a fiber optic network to directly manage storage devices is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a storage device control method, apparatus and medium for directly managing storage devices in a fiber optic network topology.
[0006] To solve the above technical problems, the present application provides a storage device control method, comprising:
[0007] Receive a first REST request input by a user;
[0008] Convert the first REST request into a SCSI command, and send the SCSI command to the storage device through the FC link;
[0009] Receive a second REST request input by the user, and determine whether the second REST request is a GET request;
[0010] If yes, receive the CLI data fed back by the storage device;
[0011] If not, the operation result fed back by the storage device is received.
[0012] Preferably, converting the first REST request into a SCSI command comprises:
[0013] Assemble a CLI command according to the first REST request;
[0014] Encapsulate the CLI command as a SCSI instruction.
[0015] Preferably, before converting the first REST request into a SCSI instruction, it further includes:
[0016] Verify the protocol type, port number, request URI, group name, and Token corresponding to the first REST request.
[0017] Preferably, before converting the first REST request into a SCSI instruction and after verifying the protocol type, port number, request URI, group name, and Token corresponding to the first REST request, it further includes:
[0018] Verify the user's operation authority through the Token;
[0019] If the user has the operation authority, enter the step of converting the first REST request into a SCSI instruction;
[0020] If the user does not have the operation authority, enter the step of receiving the first REST request input by the user.
[0021] Preferably, assembling the CLI command according to the first REST request includes:
[0022] Parse the first REST request to obtain request parameters;
[0023] Assemble the request parameters to obtain a CLI command.
[0024] Preferably, after receiving the CLI data fed back by the storage device, it further includes:
[0025] Encapsulate the CLI data as REST data and display the REST data.
[0026] Preferably, sending the SCSI instruction to the storage device through the FC link includes:
[0027] Select a target FC link according to the first REST request;
[0028] Send the SCSI instruction to the storage device through the target FC link.
[0029] To solve the above technical problems, the present application further provides a control device for a storage device, including:
[0030] A first receiving module, configured to receive the first REST request input by the user;
[0031] A conversion module for converting a first REST request into a SCSI instruction and sending the SCSI instruction to a storage device via an FC link;
[0032] A judgment module for receiving a second REST request input by a user and judging whether the second REST request is a GET request; if so, triggering a second receiving module; if not, triggering a third receiving module;
[0033] A second receiving module for receiving CLI data fed back by the storage device;
[0034] A third receiving module for receiving an operation result fed back by the storage device.
[0035] To solve the above technical problems, the present application further provides a control device for a storage device, including:
[0036] A memory for storing a computer program;
[0037] A processor for implementing the steps of the above control method for the storage device when executing the computer program.
[0038] To solve the above technical problems, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program implements the steps of the above control method for the storage device when executed by a processor.
[0039] The present application provides a control method for a storage device, which method receives a first REST request input by a user; converts the first REST request into a SCSI instruction and sends the SCSI instruction to the storage device via an FC link; receives a second REST request input by the user and judges whether the second REST request is a GET request; if so, receives CLI data fed back by the storage device; if not, receives an operation result fed back by the storage device. It can be seen that this method converts the first REST request input by the user into a SCSI instruction, and sends the SCSI instruction to the storage device via an FC link to directly manage the storage device under the fiber optic network topology, without the need to additionally build a separate Ethernet management network, simplifies the network topology, and reduces the network maintenance cost.
[0040] In addition, the control device and medium for the storage device provided by the present application have the same beneficial effects as the control method for the storage device. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 Flow chart of a control method for a storage device provided by this application;
[0043] Figure 2 Structural diagram of a control device for a storage device provided by this application;
[0044] Figure 3 Structural diagram of another control device for a storage device provided by this application. Detailed implementation manners
[0045] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part rather than all of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the protection scope of this application.
[0046] The core of this application is to provide a control method, device, and medium for a storage device, which are used to directly manage the storage device under the fiber optic network topology.
[0047] For ease of understanding, the application scenarios applicable to the technical solutions of this application are introduced below.
[0048] The control system of the storage device of this application includes a host and an out-of-band management module.
[0049] The host is the execution entity of this application. It can provide an information input interface for the user to input Representational State Transfer (REST) requests through the out-of-band management module installed on itself, and send the received first REST request and second REST request to the storage device through the out-of-band management module.
[0050] In this application, the out-of-band management module includes a service interface module, a protocol interaction module, and an out-of-band communication module. Among them, the service interface module includes a Servlet layer and a business logic layer. The Servlet layer is implemented by Tomcat, provides an information input interface for users to input the first REST request and the second REST request, and is responsible for receiving the first REST request and the second REST request input by users and returning the REST response feedback by the storage device. The business logic layer is the core layer of the service interface module, and is composed of a filter module, a routing control module, and a request processing module. It opens a processing thread for the first REST request and the second REST request, and is responsible for validating, routing, and processing the first REST request and the second REST request from the Servlet layer, and returning the result of the storage device processing the first REST request to the Servlet layer. Specifically, the filter module is responsible for common validation, including validating the protocol type, port number, request Uniform Resource Identifier (URI), REST group name, Token, etc.; the routing control module is used to route the first REST request to the corresponding processing unit in the request processing module according to the request URI and the REST group name for processing; the request processing module is composed of multiple processing units, each REST interface corresponds to a processing unit respectively. After receiving the first REST request, the REST interface will distribute it to the corresponding processing unit for processing. In a specific implementation, the processing unit processes the first REST request by calling the Command-line Interface (CLI) adapter interface, and assembles the first REST request into a management command of the storage device, that is, a CLI command. The protocol interaction module includes a storage management command sending unit and a management command execution result query unit. Among them, the storage management command sending unit is responsible for receiving the CLI command from the business logic layer and encapsulating it into a data transfer protocol instruction, that is, a Small Computer System Interface (SCSI) instruction. The storage device maps the SCSI instruction to the SCSI device of the host through a Fibre Channel (FC) link and sends the SCSI instruction to the storage device; the management command execution result query unit is responsible for returning the execution result of the CLI command feedback by the storage device to the business logic layer. In a specific implementation, after the storage device executes the CLI command, the command execution result query unit will store the execution status and execution result of the CLI command in a message queue. Specifically, before triggering the callback process of the out-of-band management, the message queue will temporarily store the execution status and execution result of the CLI command, and feedback them to the service interface module when the callback process of the out-of-band management is triggered.The out-of-band communication module is responsible for traversing all ports of the storage device's fiber optic card and selecting one or more FC links to send or query CLI commands according to user requirements.
[0051] To enable those skilled in the art to better understand the solution of this application, the following further detailed description of this application will be given in conjunction with the accompanying drawings and specific implementation manners.
[0052] It should be noted that the control method of the storage device provided in this application is applicable to various storage devices, such as disks, Basic Input Output System (BIOS) firmware, etc., which are not limited herein.
[0053] Figure 1 is a flowchart of a control method for a storage device provided in this application, as Figure 1 shown, this method includes:
[0054] S1: Receive a first REST request input by the user.
[0055] S2: Convert the first REST request into a SCSI command and send the SCSI command to the storage device through the FC link.
[0056] SCSI is a complete data transfer protocol, and its main function is to transfer commands, statuses, and block data between the host and the storage device. In this embodiment, since the first REST request cannot be directly transmitted to the storage device through the FC link, therefore, the received first REST request needs to be processed, converted into a SCSI command, and the SCSI command can be sent to the storage device through the FC link to realize directly managing the storage device through the existing fiber optic network in an out-of-band management manner.
[0057] S3: Receive a second REST request input by the user and determine whether the second REST request is a GET request; if so, enter S4; if not, enter S5.
[0058] In specific implementation, REST requests include various types such as GET requests, POST requests, DELETE requests, etc. If the second REST request is a GET request, it indicates that the SCSI command converted from the second REST request is a query command, specifically manifested as querying the CLI data obtained by the storage device after executing and parsing the management command obtained from the SCSI command. Therefore, after receiving the GET request, it will enter step S4 to receive the CLI data fed back by the storage device; if the second REST request is not a GET request but an operation request such as a POST request or a DELETE request, it indicates that the SCSI command converted from the second REST request is an operation command rather than a query command. At this time, it will enter step S5 to receive the operation result of the storage device executing this operation command.
[0059] In specific implementation, after receiving the SCSI command, the storage device will first check the legality of the SCSI command, including checking whether the out-of-band management operation code (Operation Code, OPCode) matches and checking whether the format of the container database (Container Database, CDB) is legal. Specifically, it can judge whether the out-of-band management OPCode matches by checking the number of the out-of-band management OPCode. In addition, the SCSI command can be parsed into the corresponding CLI command according to the pre-designed CLI command form, and the format of the CDB can be judged legal by checking the command name, parameter list and length of the CLI command. For example, if the number of the out-of-band management OPCode is correct, it indicates that the out-of-band management OPCode matches; if the command name, parameter list and length of the CLI command all meet the format requirements of the CLI command, it indicates that the CDB format is legal. If it is checked that the out-of-band management OPCode does not match or the CDB format is illegal, the storage device will return the operation result of the defined command being illegal to the out-of-band management module; if it is checked that the out-of-band management OPCode matches and the CDB format is legal, the storage device will further check the execution status and execution result of the CLI command. Specifically, if the CLI command is being executed, when receiving a GET request, the storage device will return the execution status of the CLI command as the BUSY status, which indicates that the CLI command is being executed at this time; if the CLI command execution is incorrect, when receiving a GET request, the storage device will encapsulate the error status and error result of executing the CLI command and send them to the out-of-band management module; if the CLI command is successfully executed, when receiving a GET request, the storage device will encapsulate the success status and execution result of executing the CLI command and send them to the out-of-band management module.
[0060] S4: Receive the CLI data fed back by the storage device.
[0061] S5: Receive the operation result fed back by the storage device.
[0062] This embodiment provides a control method for a storage device. The method receives a first REST request input by a user; converts the first REST request into a SCSI instruction, and sends the SCSI instruction to the storage device through an FC link; receives a second REST request input by the user, and determines whether the second REST request is a GET request; if so, receives CLI data fed back by the storage device; if not, receives an operation result fed back by the storage device. It can be seen that this method converts the first REST request input by the user into a SCSI instruction, and sends the SCSI instruction to the storage device through an FC link to directly manage the storage device under the fiber optic network topology, without the need to additionally build a separate Ethernet management network, simplifies the networking topology, and reduces the network maintenance cost.
[0063] Based on the above embodiment, in order to send the first REST request input by the user to the storage device through an FC link, it is necessary to convert the first REST request into a SCSI instruction. This embodiment makes a supplementary description of the steps for converting the first REST request into a SCSI instruction. The steps include:
[0064] Assemble a CLI command according to the first REST request;
[0065] Encapsulate the CLI command into a SCSI instruction.
[0066] Table 1 is a parameter definition list of CLI commands. As shown in Table 1, Table 1 is divided into two parts: header (byte 0-byte 5) and data (byte 6-byte n). The following explains each parameter in Table 1.
[0067] The FORMAT field specifies the format of PARAMETER DATA, taking a fixed value of 0x2, which is the American Standard Code for Information Interchange (ASCII) format.
[0068] The PARAMETER DATA LENGTH field specifies the length excluding the parameter header part, that is, n - 5.
[0069] PARAMETER DATA is the specific storage device command line parameter value, without further formatting and classification of the content, but uniformly filled into one field. The format of this field is parameter data in ASCII code format and ends with "\0", with a maximum support of 4092 bytes.
[0070] MSB is the most significant bit, referring to the bit with the highest value in binary; LSB is the least significant bit, referring to the bit with the lowest value in binary.
[0071] Table 1 List of Parameter Definitions for CLI Commands
[0072]
[0073] Table 2 is the CDB structure table of SCSI commands. As shown in Table 2, the CDB of SCSI commands adopts a CDB structure with a length of byte - 12. The following explains each parameter in Table 2.
[0074] The OPERATION CODE field represents the ID of the SCSI command and can be defined as 0xEF according to the actual situation of the storage system.
[0075] The CLI COMMAND TYPE field represents the CLI command type, and currently supports query type (0x01) and management type (0x02).
[0076] The SERVICE ACTION field represents the control instruction behavior, that is, it distinguishes between management command sending instructions (0x01) and command execution result query instructions (0x02). The storage device determines whether to execute a management action or a query action based on this field.
[0077] The HOST IDENTIFIER field is the identifier of the host identity. It is used in combination with the SEQUENCE NUMBER. When querying the command execution result (SERVICE ACTION is 0x02), the storage device will search in combination with these two fields, and the HOST IDENTIFIER value is maintained by the host.
[0078] The SEQUENCE NUMBER field is the command sequence number mark. It is used in combination with the HOST IDENTIFIER to find the corresponding command execution result. That is, after the command sending instruction (SERVICE ACTION is 0x01) is set, the storage device saves it, and the execution result query instruction (SERVICE ACTION is 0x02) uses the same SEQUENCE NUMBER value to query the result of this command. The specific maintenance strategy is determined by the host.
[0079] The CLI COMMAND CODE field is the command number of the storage system and is specified according to the actual storage system. For example, creating a pool is 0x01, creating a volume is 0x02, deleting a pool is 0x03, deleting a volume is 0x04, etc.
[0080] The PARAMETER LIST LENGTH field is used to specify the length of the parameter list in the data-out buffer when a command execution request (SERVICE ACTION is 0x01) is specified. When no parameters are transmitted through the data-out buffer, the value of this field is 0000h; when parameters are transmitted, the value range of this field is 0004h - 1000h.
[0081] The ALLOCATION LENGTH field is used to specify the maximum number of bytes of the data-in buffer requested by the host when a command result query request (SERVICE ACTION is 0x02) is specified, that is, the maximum length transmitted when outputting the command execution result.
[0082] Table 2 CDB Structure Table of SCSI Commands
[0083]
[0084]
[0085] In a specific implementation, the first REST request can be assembled into a CLI command according to Table 1, the CLI command can be encapsulated into a SCSI command according to Table 2, and the SCSI command is sent to the storage device by the storage device mapping to the SCSI device of the host through the FC link. Correspondingly, after receiving the SCSI command, the storage device can parse the SCSI command into a CLI command according to Table 1 and Table 2, and execute the CLI command to obtain the execution result of the CLI command, and the storage device executes the CLI command to manage the storage device.
[0086] This embodiment details the steps of converting the first REST request into a SCSI command. First, the first REST request is assembled into a CLI command, and then the CLI command is encapsulated into a SCSI command, so that the management command of the storage device can be sent to the storage device through the FC link, thereby realizing the direct management of the storage device under the fiber optic network.
[0087] Based on the above embodiment, in order to accurately obtain the first REST request for controlling the storage device from the first REST request input by the user, before converting the first REST request into a SCSI command, it is also necessary to filter the received first REST request. This step includes: verifying the protocol type, port number, request URI, group name, and Token corresponding to the first REST request.
[0088] In a specific implementation, it is possible to verify whether the protocol type is the FC protocol, whether the port number is the port number of the storage device, and verify whether the request URI, REST group name, and token are correct. If the protocol type is the FC protocol, the port number is the port number of the storage device, and the request URI, REST group name, and token are all correct, it indicates that the received first REST request is a request for controlling the storage device. At this time, the first REST request can be converted into a SCSI instruction and the SCSI instruction can be sent to the storage device to directly manage the storage device using the fiber optic network. Otherwise, it indicates that the received first REST request is not a request for controlling the storage device. Therefore, it is not necessary to convert the first REST request into a SCSI instruction and send it to the storage device, but instead enter step S1 to re-obtain the first REST request input by the user.
[0089] Before converting the first REST request into a SCSI instruction in this embodiment, the protocol type, port number, request URI, group name, and token corresponding to the first REST request are verified, and the first REST request for controlling the storage device is filtered out through common verification.
[0090] On the basis of the above embodiment, to improve the security of the storage device, after verifying the protocol type, port number, request URI, group name, and token corresponding to the first REST request, it is also necessary to verify the user's operation authority. This step includes:
[0091] Verify the user's operation authority through the token;
[0092] If the user has the operation authority, enter the step of converting the first REST request into a SCSI instruction;
[0093] If the user does not have the operation authority, enter the step of receiving the first REST request input by the user.
[0094] In a specific implementation, it is possible to determine whether the username and password are correct through a Token to verify the operation permissions of the user. Specifically, if the username and password are correct, it indicates that the currently operating user has the operation permissions. At this time, the first REST request input by the user can be converted into a SCSI command, and the SCSI command can be sent to the storage device through the FC link to manage the storage device; if the username and password are incorrect, it indicates that the currently operating user does not have the operation permissions, and it can be considered that the first REST request input by the user is invalid. At this time, the first REST request input by the user will be received again until it is verified that the user has the operation permissions. It can be understood that after receiving the second REST request, the protocol type, port number, request URI, group name, and Token corresponding to the second REST request should be verified first, and the operation permissions of the user should be verified through the Token corresponding to the second REST request to improve security.
[0095] It should be noted that if it is verified that the user does not have the operation permissions, a prompt will be issued to remind the user to re-enter the REST request. If it is verified multiple times that the user does not have the operation permissions, the reception of the REST request input by the user will be stopped and an alarm will be issued to prevent attackers from maliciously operating and attacking the storage device.
[0096] In this embodiment, after verifying the protocol type, port number, request URI, group name, and Token corresponding to the first REST request, the operation permissions of the user are verified through the Token to prevent attackers from maliciously operating and attacking the storage device, effectively improving the security of the storage device.
[0097] On the basis of the above embodiment, in order to accurately obtain the management command of the storage device, that is, the CLI command, this embodiment makes a supplementary description of the steps of assembling the CLI command. These steps include:
[0098] Parse the first REST request to obtain the request parameters;
[0099] Assemble the request parameters to obtain the CLI command.
[0100] In a specific implementation, the request parameters corresponding to the first REST request input by the user can be obtained by parsing the first REST request input by the user, and then the request parameters obtained by parsing the first REST request can be assembled into a CLI command according to Table 1, and then the CLI command can be encapsulated into a SCSI command.
[0101] In this embodiment, after receiving the first REST request input by the user, the corresponding request parameters are obtained by parsing the first REST request. By assembling the request parameters, the management command of the storage device, that is, the CLI command, can be obtained, so that the storage device can execute the CLI command subsequently to manage the storage device.
[0102] Based on the above embodiments, since the Servlet layer in the service interface module can only return REST responses, after receiving the CLI data fed back by the storage device, it is also necessary to process the CLI data. This step includes:
[0103] Encapsulate the CLI data into REST data and display the REST data.
[0104] Table 3 is the definition table of the execution result query instruction. The following explains each parameter in Table 3.
[0105] Table 3 Definition Table of Execution Result Query Instruction
[0106]
[0107] The SERVICE ACTION field represents the control instruction behavior. When the value of this field is 0x3, it controls the target end to perform login and logout processing. The value range and error design are the same as those in Table 2.
[0108] The HOST IDENTIFIER field is the identifier of the host identity. The value range and error design are the same as those in Table 2.
[0109] LOGIN TYPE is the login operation type, including login(01h) and logout(02h), that is, login and logout.
[0110] The PARAMETER LIST LENGTH field is used to specify the length of the parameter list in the Data-out buffer. The total length of the paramter header and paramter entry header in the buffer is 12 bytes. It is stipulated that the length range of user namedata is 0 - 256 bytes, and the length range of password data is 0 - 256 bytes. Therefore, the value range of PARAMETER LISTLENGTH is 000ch - 020ch.
[0111] In a specific implementation, if the second REST request is a GET request, the second REST request can be parsed into the request parameters corresponding to the second REST request, and the request parameters corresponding to the second REST request are converted into an execution result query instruction according to Table 3; after the storage device finishes executing the CLI command, if it receives the execution result query instruction, it will feedback the execution result, that is, the CLI data, to the protocol interaction module; after the protocol interaction module receives the CLI data, it will encapsulate it into REST data, and the Servlet layer in the service interface module will return the REST data to the upper-layer application in the host, and the upper-layer application will display the REST data.
[0112] In this embodiment, by reverse encapsulating CLI data into REST data, when the second REST request input by the user is a GET request, the out-of-band management module can return the execution result of the CLI command, i.e., CLI data, to the upper-layer application, and the upper-layer application displays the REST data so that the user can learn the execution result of the CLI command.
[0113] Based on the above embodiment, since the storage device has multiple ports and each port corresponds to an FC link, before sending the SCSI command to the storage device, it is necessary to select a target FC link to send the SCSI command to the storage device through the target FC link. This step includes:
[0114] Select a target FC link according to the first REST request;
[0115] Send the SCSI command to the storage device through the target FC link.
[0116] It should be noted that after the target FC link is selected, the target FC link is only used to carry the management control information of the user, i.e., the SCSI command, and is not responsible for carrying the service information of the user network, so as to ensure that the SCSI command can be accurately sent to the storage device. In addition, in a specific implementation, the target port number can be determined according to the first REST request input by the user, and the ports of the storage device are traversed to randomly select a port as the target port as long as the number of selected ports is consistent with the target port number.
[0117] Before sending the SCSI command to the storage device in this embodiment, a target FC link is selected according to the first REST request to send the SCSI command to the storage device through the target FC link, so as to accurately send the SCSI command to the storage device.
[0118] In the above embodiment, the control method of the storage device is described in detail. The present application also provides an embodiment corresponding to the control device of the storage device. It should be noted that the embodiments of the device part of the present application are described from two perspectives, one is from the perspective of functional modules, and the other is from the perspective of hardware.
[0119] Figure 2 For the structure diagram of a control device of a storage device provided by the present application, as Figure 2 shown, the device includes:
[0120] The first receiving module 10 is configured to receive the first REST request input by the user;
[0121] The conversion module 11 is configured to convert the first REST request into a SCSI command and send the SCSI command to the storage device;
[0122] A judgment module 12, configured to receive a second REST request input by a user, and judge whether the second REST request is a GET request; if so, trigger a second receiving module 13; if not, trigger a third receiving module 14;
[0123] The second receiving module 13 is configured to receive CLI data fed back by a storage device;
[0124] The third receiving module 14 is configured to receive an operation result fed back by the storage device.
[0125] Since the embodiments in the apparatus part correspond to those in the method part, for the embodiments in the apparatus part, please refer to the description of the embodiments in the method part, which will not be elaborated here.
[0126] The control device of the storage device provided in this embodiment receives a first REST request input by a user through a first receiving module, converts the first REST request into a SCSI instruction through a conversion module, and sends the SCSI instruction to the storage device. The judgment module receives a second REST request input by the user and judges whether the second REST request is a GET request; if so, trigger the second receiving module; if not, trigger the third receiving module; receive CLI data fed back by the storage device through the second receiving module; receive an operation result fed back by the storage device through the third receiving module. It can be seen that this device converts the first REST request input by the user into a SCSI instruction, and sends the SCSI instruction to the storage device through an FC link to directly manage the storage device under a fiber optic network topology, without the need to additionally build a separate Ethernet management network, simplifying the networking topology and reducing the network maintenance cost.
[0127] Figure 3 As shown in the structure diagram of another control device of the storage device provided in this application, Figure 3 as shown, the device includes:
[0128] A memory 20, configured to store a computer program;
[0129] A processor 21, configured to implement the steps of the control method of the storage device mentioned in the above embodiment when executing the computer program.
[0130] The control device of the storage device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a notebook computer, or a desktop computer, etc.
[0131] Among them, the processor 21 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 21 may be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI processor, and the AI processor is used to process computational operations related to machine learning.
[0132] The memory 20 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 20 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201. After the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the control method of the storage device disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202 and data 203, etc., and the storage method may be transient storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, CLI data, etc.
[0133] In some embodiments, the control device of the storage 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.
[0134] Those skilled in the art can understand that Figure 3 the structure shown in
[0135] does not constitute a limitation on the control device of the storage device, and may include more or fewer components than shown in the figure.
[0136] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the control method of the storage device recorded in the above method embodiment are implemented.
[0137] It can be understood that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this 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 application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0138] The computer-readable storage medium provided in this embodiment includes the control method of the storage device mentioned above, and the effect is the same.
[0139] The control method, device, and medium of the storage device provided by the present application have been introduced in detail above. The various embodiments in the specification are described in a progressive manner, and the key points of each embodiment are the differences from other embodiments. For the same and similar parts between the various embodiments, reference can be made to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the description of the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and modifications can still be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
[0140] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.
Claims
1. A control method for a storage device, characterized in that, For a host installed with an out-of-band management module, including: Receiving a first REST request input by a user; Converting the first REST request into a SCSI instruction and sending the SCSI instruction to a storage device through an FC link, so that the storage device determines whether the out-of-band management OPCode matches by checking the number of the out-of-band management OPCode, parsing the SCSI instruction into a corresponding CLI command according to a pre-designed CLI command form, and judging whether the CDB format is legal by checking the command name, parameter list and length of the CLI command; if the number of the out-of-band management OPCode is correct, it means that the out-of-band management OPCode matches; if the command name, parameter list and length of the CLI command all meet the format requirements of the CLI command, it means that the CDB format is legal; if it is checked that the out-of-band management OPCode does not match or the CDB format is illegal, an operation result of defining the command as illegal is returned to the out-of-band management module; if it is checked that the out-of-band management OPCode matches and the CDB format is legal, the execution status and execution result of the CLI command are checked; the out-of-band management module includes a storage management command sending unit and a management command execution result query unit; the storage management command sending unit is used for receiving the CLI command, encapsulating it into a SCSI instruction, and sending the SCSI instruction to the storage device through the FC link mapped by the SCSI device of the host to the storage device by the storage device; after the storage device executes the CLI command, the command execution result query unit is used for storing the execution status and execution result of the CLI command into a message queue; before triggering the callback process of the out-of-band management, the message queue temporarily stores the execution status and execution result of the CLI command and feeds back when the callback process of the out-of-band management is triggered; Receiving a second REST request input by the user and judging whether the second REST request is a GET request; if a CLI command is being executed, when the storage device receives the GET request, it returns the execution status of the CLI command as the BUSY state; if the CLI command execution is incorrect, when the storage device receives the GET request, it encapsulates the error status and error result of executing the CLI command and sends them to the out-of-band management module; if the CLI command is successfully executed and ended, when the storage device receives the GET request, it encapsulates the success state and execution result of executing the CLI command and sends them to the out-of-band management module; If so, receiving CLI data fed back by the storage device; If not, receiving an operation result fed back by the storage device.
2. The control method of the storage device according to claim 1, wherein The converting the first REST request into a SCSI instruction includes: Assembling a CLI command according to the first REST request; Encapsulating the CLI command into the SCSI instruction.
3. The control method of the storage device according to claim 1, wherein Before the converting the first REST request into a SCSI instruction, it further includes: Verifying the protocol type, port number, request URI, group name and Token corresponding to the first REST request.
4. The control method of the storage device according to claim 3, characterized in that, Before converting the first REST request into a SCSI instruction and after verifying the protocol type, port number, request URI, packet name, and Token corresponding to the first REST request, the following steps are further included: Verify the operation authority of the user through the Token; If the user has the operation authority, enter the step of converting the first REST request into a SCSI instruction; If the user does not have the operation authority, enter the step of receiving the first REST request input by the user.
5. The control method of the storage device according to claim 2, wherein The assembling of the CLI command according to the first REST request includes: Parse the first REST request to obtain request parameters; Assemble the request parameters to obtain the CLI command.
6. The control method of the storage device according to claim 1, wherein After receiving the CLI data fed back by the storage device, the following steps are further included: Encapsulate the CLI data into REST data and display the REST data.
7. The control method of the storage device according to claim 1, wherein The sending of the SCSI instruction to the storage device through the FC link includes: Select a target FC link according to the first REST request; Send the SCSI instruction to the storage device through the target FC link.
8. A control device for a storage device, characterized in that, For a host equipped with an out-of-band management module, it includes: A first receiving module, configured to receive a first REST request input by a user; A conversion module, configured to convert the first REST request into a SCSI instruction and send the SCSI instruction to a storage device through an FC link, so that the storage device determines whether the out-of-band management OPCode matches by checking the number of the out-of-band management OPCode, parses the SCSI instruction into a corresponding CLI command according to a pre-designed CLI command form, and determines whether the CDB format is legal by checking the command name, parameter list, and length of the CLI command; if the number of the out-of-band management OPCode is correct, it indicates that the out-of-band management OPCode matches; if the command name, parameter list, and length of the CLI command all meet the format requirements of the CLI command, it indicates that the CDB format is legal; if it is checked that the out-of-band management OPCode does not match or the CDB format is illegal, return an operation result of defining the command as illegal to the out-of-band management module; if it is checked that the out-of-band management OPCode matches and the CDB format is legal, check the execution status and execution result of the CLI command; the out-of-band management module includes a storage management command sending unit and a management command execution result query unit; the storage management command sending unit is configured to receive a CLI command, encapsulate it into a SCSI instruction, and send the SCSI instruction to the storage device through the FC link mapped by the storage device to the SCSI device of the host; after the storage device executes the CLI command, the command execution result query unit is configured to store the execution status and execution result of the CLI command in a message queue; before triggering the callback process of the out-of-band management, the message queue temporarily stores the execution status and execution result of the CLI command and feeds them back when the callback process of the out-of-band management is triggered; A judgment module, configured to receive the second REST request input by the user, and judge whether the second REST request is a GET request; if so, trigger the second receiving module; if not, trigger the third receiving module; if a CLI command is being executed, when the storage device receives a GET request, return the execution status of the CLI command as the BUSY status; if the CLI command execution is incorrect, when the storage device receives a GET request, encapsulate the error status and error result of executing the CLI command, and send them to the out-of-band management module; if the CLI command is successfully executed, when the storage device receives a GET request, encapsulate the success status and execution result of executing the CLI command, and send them to the out-of-band management module; The second receiving module is configured to receive the CLI data fed back by the storage device; The third receiving module is configured to receive the operation result fed back by the storage device.
9. A control device for a storage device, characterized in that, Comprising: A memory for storing a computer program; A processor, configured to implement the steps of the control method of the storage device according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the control method of the storage device according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
In-band management device and method and computer equipment
CN113900588A