Storage device control method and device, storage medium and electronic device

By detecting the expansion board type and automatically switching the sector format of the NVME SSD, the problem of sector format mismatch in trimode mode is solved, and the matching degree and performance stability of the NVME SSD are improved.

CN120428930BActive Publication Date: 2025-09-09INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510944581.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-09-09
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

In the prior art, the sector format of NVME SSD cannot be automatically adapted when connected in trimode mode, resulting in the inability to fully exert optimal performance and operational stability, and the sector format has a low degree of matching with server services.

Method used

By detecting the type of expansion board connected to the server, calling the matching query command to obtain the sector format supported by the storage device, filtering out the sector format that matches the target business, and automatically switching to the target sector format.

Benefits of technology

It realizes automatic adaptation of the sector format of NVME SSD in trimode mode, improves the matching degree between sector format and business, and enhances storage performance and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120428930B_ABST
    Figure CN120428930B_ABST
Patent Text Reader

Abstract

The present application discloses a control method and apparatus for a storage device, a storage medium, and an electronic device, and relates to the field of computer technology. The method comprises the following steps: detecting the board type of an expansion board currently connected to a server to obtain a target board type; calling a target query command matching the target board type to control the expansion board to query the sector format allowed to be set for the target storage device, and obtaining a plurality of reference sector formats; screening out a target sector format whose matching parameters with the target business meet preset matching conditions from the plurality of reference sector formats; switching the sectors in the target storage device to the target sector format, thereby solving technical problems such as the low matching degree between the sector format of the storage device and the business run by the server, and achieving the technical effect of improving the matching degree between the sector format of the storage device and the business run by the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and more specifically, to a storage device control method and apparatus, a storage medium, and an electronic device. Background Art

[0002] In existing technologies, some solutions can automatically modify the solid-state drive (SSD) sector format or implement automatic detection of sector attributes through software. However, these technical measures can only be used for NVME SSDs (Non-Volatile Memory Express SSDs) in onboard direct connection mode. They are not applicable to NVME SSDs connected in trimode mode, which is a non-direct connection mode. For example, NVME SSDs connected through a Redundant Array of Independent Disks (RAID) card.

[0003] Because the existing technology only supports direct connection mode, it is impossible to query and modify the sector format of NVMESSD in the trimode multi-protocol mixed scenario. At the same time, there are problems such as the need for offline manual confirmation of the sector format and the lack of subsequent dynamic monitoring and adaptive matching of sector modifications. As a result, the sector format of NVME SSD cannot be automatically adapted to complex business scenarios (such as large file / small file business), making it difficult to fully utilize the optimal performance and operational stability of the SSD.

[0004] In the related art, effective solutions have not yet been proposed for technical problems such as the low matching degree between the sector format of the storage device and the services run by the server. Summary of the Invention

[0005] The embodiments of the present application provide a storage device control method and apparatus, a storage medium, and an electronic device to at least solve technical problems in related technologies, such as the low matching degree between the sector format of the storage device and the services run by the server.

[0006] According to one embodiment of the present application, a method for controlling a storage device is provided, including:

[0007] Detecting a board type of an expansion board currently connected to the server to obtain a target board type, wherein the server is connected to one or more storage devices through the expansion board;

[0008] Invoking a target query command matching the target board type to control the expansion board to query the sector format allowed to be set for the target storage device, and obtaining a plurality of reference sector formats, wherein the target storage device is a storage device allowed to provide storage resources for the target service running on the server among one or more storage devices connected to the expansion board, and the reference sector format is used to indicate the data capacity specification allowed to be set for the sector of the target storage device;

[0009] Filtering a target sector format from a plurality of reference sector formats, wherein a matching parameter between the target service and the target service satisfies a preset matching condition, wherein the matching parameter that satisfies the preset matching condition is used to indicate that a matching degree between the corresponding reference sector format and the target service is greater than a preset matching degree;

[0010] Convert the sectors in the target storage device to the target sector format.

[0011] According to another embodiment of the present application, a control device for a storage device is provided, including:

[0012] a detection module, configured to detect a card type of an expansion card currently connected to the server to obtain a target card type, wherein the server is connected to one or more storage devices via the expansion card;

[0013] a calling module, configured to call a target query command matching the target board type to control the expansion board to query the sector format allowed to be set for the target storage device, and obtain a plurality of reference sector formats, wherein the target storage device is a storage device allowed to provide storage resources for the target service running on the server among one or more storage devices connected to the expansion board, and the reference sector format is used to indicate the data capacity specification allowed to be set for the sector of the target storage device;

[0014] a screening module, configured to screen out a target sector format from a plurality of reference sector formats, the matching parameters between which and the target service meet a preset matching condition, wherein the matching parameters that meet the preset matching condition are used to indicate that the degree of matching between the corresponding reference sector format and the target service is greater than a preset matching degree;

[0015] The switching module is used to switch the sectors in the target storage device to the target sector format.

[0016] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned storage device control methods when executing the computer program.

[0017] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned storage device control methods are implemented.

[0018] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned storage device control methods when executed by a processor.

[0019] Through this application, the specific type of the expansion board connected to the server is first determined, and the server is connected to one or more storage devices through this expansion board; then a query instruction adapted to the board type is executed, thereby allowing the expansion board to query the sector specifications supported by the target storage device and obtain multiple available sector specification information. The target storage device here refers to a device that can provide storage resources for the target business running on the server, and the sector specification information indicates the data capacity standard that can be set for the sectors of these storage devices; then, from these sector specifications, specifications whose matching parameters with the target business meet the preset matching requirements are selected, where the matching parameters that meet the requirements mean that the degree of matching between the sector specification and the target business exceeds a preset threshold; finally, the sector of the target storage device is adjusted to the selected specification. Through the above method, first, the corresponding query instructions are accurately executed according to the type of expansion board to ensure that the sector specifications truly supported by the storage device are obtained, avoiding specification misjudgment due to hardware adaptation errors; secondly, the sector specifications are screened based on the target business characteristics, so that the data capacity standard of the sector is directly matched with the business, which changes the situation in which the sector specifications are out of touch with business needs in traditional solutions; finally, by automatically switching sector specifications, the dynamic adaptation of the storage device to the business scenario is realized, and the matching accuracy of the sector format and the business is improved, thereby solving the problem of storage performance loss caused by low matching. Therefore, it can solve the technical problems in related technologies such as the low matching degree between the sector format of the storage device and the business run by the server, and achieve the technical effect of improving the matching degree between the sector format of the storage device and the business run by the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 This is a hardware structure block diagram of a computer device according to a method for controlling a storage device according to an embodiment of the present application;

[0022] Figure 2 is a flow chart of a method for controlling a storage device according to an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of module functions of a control system according to an embodiment of the present application;

[0024] Figure 4 is a structural block diagram of a control device for a storage device according to an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0027] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations 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 explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0028] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0029] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a computer device for a method of controlling a storage device according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. The server device may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the control method of the storage device in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to a server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0031] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a communication provider of the server device. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0032] In this embodiment, a method for controlling a storage device is provided. Figure 2 is a flow chart of a method for controlling a storage device according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0033] Step S12: Detecting the card type of the expansion card currently connected to the server to obtain a target card type, wherein the server is connected to one or more storage devices via the expansion card;

[0034] Step S14: Invoking a target query command that matches the target board type to control the expansion board to query the sector format allowed to be set for the target storage device, and obtaining multiple reference sector formats, wherein the target storage device is a storage device allowed to provide storage resources for the target service running on the server among the one or more storage devices connected to the expansion board, and the reference sector format is used to indicate the data capacity specification allowed to be set for the sector of the target storage device;

[0035] Step S16, selecting a target sector format whose matching parameters with the target service satisfy a preset matching condition from the multiple reference sector formats, wherein the matching parameters satisfying the preset matching condition are used to indicate that the degree of matching between the corresponding reference sector format and the target service is greater than a preset matching degree;

[0036] Step S18: switching the sectors in the target storage device to the target sector format.

[0037] Through this application, the specific type of the expansion board connected to the server is first determined, and the server is connected to one or more storage devices through this expansion board; then a query instruction adapted to the board type is executed, thereby allowing the expansion board to query the sector specifications supported by the target storage device and obtain multiple available sector specification information. The target storage device here refers to a device that can provide storage resources for the target business running on the server, and the sector specification information indicates the data capacity standard that can be set for the sectors of these storage devices; then, from these sector specifications, specifications whose matching parameters with the target business meet the preset matching requirements are selected, where the matching parameters that meet the requirements mean that the degree of matching between the sector specification and the target business exceeds a preset threshold; finally, the sector of the target storage device is adjusted to the selected specification. Through the above method, first, the corresponding query instructions are accurately executed according to the type of expansion board to ensure that the sector specifications truly supported by the storage device are obtained, avoiding specification misjudgment due to hardware adaptation errors; secondly, the sector specifications are screened based on the target business characteristics, so that the data capacity standard of the sector is directly matched with the business, which changes the situation in which the sector specifications are out of touch with business needs in traditional solutions; finally, by automatically switching sector specifications, the dynamic adaptation of the storage device to the business scenario is realized, and the matching accuracy of the sector format and the business is improved, thereby solving the problem of storage performance loss caused by low matching. Therefore, it can solve the technical problems in related technologies such as the low matching degree between the sector format of the storage device and the business run by the server, and achieve the technical effect of improving the matching degree between the sector format of the storage device and the business run by the server.

[0038] Optionally, in this embodiment, the storage device may be, but is not limited to, any device that allows providing storage resources for services in the server, such as a hard disk such as an NVME SSD.

[0039] As a physical device for storing data, a hard drive's internal storage space is divided into multiple logical units, namely sectors. The sector format specifies the actual data capacity of each sector (such as 512B or 4096B) and metadata configuration. Task time refers to the length of time required to complete a business operation. The matching degree between the sector format and the business data characteristics directly affects the hard drive's read and write efficiency, which in turn determines the length of the task time. For example, when the sector format is adapted to the business data block size (such as large file business using 4096B sectors), the number of cross-sector operations can be reduced, shortening the task completion time. Otherwise, the task time will be extended due to frequent addressing. Taking the 4K video editing business as an example, assuming that a 500MB 4K video file needs to be processed:

[0040] Sector format adaptation scenario: If 4096B sectors are used, the file occupies approximately 128,000 sectors (500MB ÷ 4KB). The hard drive can read entire sectors continuously, reducing head seeks. In this case, using the nvme smart-log storcli-trimode command on the Broadcom RAID card to check that the hard drive supports 4096B sectors (for example, lbaf 2) and switching the format using nvme change_para, the video loads into the editing software in approximately 15 seconds.

[0041] Sector format mismatch scenario: If using 512B sectors, the file requires 1,000,000 sectors (500MB ÷ 512B), requiring frequent cross-sector seeks. Even if the RAID card detects support for 4096B but doesn't switch, the same video loading time will be extended to over 25 seconds. This is because each cross-sector operation consumes an additional 0.1ms of seek latency, adding over 10 seconds to the total loading time.

[0042] In this case, the compatibility of sector format and data block size directly affects the hard disk I / O efficiency. 4096B sectors significantly reduced seek overhead by reducing the number of sectors by 90%, shortening task time by 40%, and verifying the necessity of adaptive sector matching.

[0043] Optionally, in this embodiment, the above steps S12 to S18 may be implemented, but not limited to, by a control system (software) of the storage device, and the control system is deployed in the server. Figure 3 is a schematic diagram of module functions of a control system according to an embodiment of the present application, such as Figure 3 As shown, the control system includes: a sector support confirmation module, a best sector matching module, a batch sector update module, a hard disk operation monitoring module and a user notification module. The function of the sector support confirmation module is to query the sector format (sector format (referred to as sector in the figure) 1-n) supported by the NVME SSD through the RAID card exclusive tool; the function of the best sector matching module is to analyze and screen the best sector format (target sector format) based on the target business; the function of the batch sector update module is to perform batch sector format switching through the RAID card; the function of the hard disk operation monitoring module is to monitor the operating status of the hard disk after sector switching in real time to ensure stability, monitor performance indicators (such as bandwidth fluctuation, IOPS stability), and automatically roll back to the default format (default sector status) if an abnormality occurs (such as periodic drop) and record a log; the function of the user notification module is to notify the user of the sector matching results, update status and abnormal alarms.

[0044] As an optional solution, calling a target query command that matches the target board type to control the expansion board to query the sector format allowed to be set by the target storage device to obtain multiple reference sector formats, further comprising:

[0045] S21, matching a target control tool corresponding to a target card type from the corresponding card types and control tools, wherein the target control tool is a tool in an expansion card of the target card type that allows querying the sector format of a connected storage device;

[0046] S22, constructing a target query command according to the tool field and format query field of the target control tool and the target address of the target storage device connected to the expansion board;

[0047] S23, transmitting the target query command to the expansion board, wherein the expansion board is configured to call the target control tool indicated by the tool field in response to the target query command, and perform the query operation indicated by the format query field on the sector format of the target storage device indicated by the target address;

[0048] S24, receiving multiple reference sector formats returned by the expansion board in response to the target query command.

[0049] Optionally, in this embodiment, the above steps S21 to S24 may be implemented, but not limited to, by a sector support confirmation module in the control system of the storage device.

[0050] Optionally, in this embodiment, the target board type may be, but is not limited to, a Broadcom RAID card or a Microchip RAID card.

[0051] Optionally, in this embodiment, if the expansion card connected to the server is detected as a Broadcom RAID card, the corresponding target control tool is storcli-trimode (a command-line tool developed specifically for trimode mode, used to manage sector format queries for NVMe / SATA / SAS hybrid devices). In this case, the tool field is: storcli-trimode (specifies the Broadcom trimode-specific tool), and the format query field is: show (calls the SMART log query function of the NVMe protocol). Target address: Uses the three-level positioning parameters / c* / e* / s*, where:

[0052] / c* represents the controller ID (e.g. / c0 is the first controller);

[0053] / e* represents the cabinet number (can be omitted if there is no cabinet);

[0054] / s* represents the slot number (e.g. s4 is the 4th slot);

[0055] The wildcard * character supports batch matching of multiple devices (for example, / c* / eall / sall queries all controllers, cabinets, and slots).

[0056] An example of a complete target query command for a Broadcom RAID card is: nvme smart-log storcli-trimode / c* / e* / s* show / dev / sd* ( / dev / sd* is the system drive letter of the NVMe SSD, such as / dev / sda).

[0057] If the expansion card connected to the server is a Microchip RAID card, the matching target control tool is arcconf-trimode (based on the Microchip trimode technology architecture, supporting query operations on the sector format of the downstream storage device). In this case, the tool field is: arcconf-trimode (specifies the Microchip trimode dedicated tool), the format query field is: list (invokes the SMART log (nvme smart-log) query function of the NVMe protocol), and the target address is simplified to the secondary parameter **, where:

[0058] The first * represents the channel number (Reported Channel ID, such as 1 for the first physical channel);

[0059] The second * represents the device ID (e.g., 2 is the second device in the channel).

[0060] An example of a complete target query command for a Microchip RAID card is: nvme smart-log arcconf-trimode * * list / dev / sd* (the drive letter definition is the same as above).

[0061] Optionally, in this embodiment, the expansion board connected to the server is a Broadcom RAID card. The server (host) transmits the nvme smart-log storcli-trimode / c* / e* / s* show / dev / sd* command (target query command) to the Broadcom RAID card. After the firmware in the card parses the command, it uses the storcli-trimode tool to locate the NVMe SSD corresponding to the target address (such as / c0 / e1 / s2), calls the nvme smart-log function to query the sector format, and implements command transparent transmission in trimode mode.

[0062] If the expansion card connected to the server is a Microchip RAID card, the server (host) transmits the nvme smart-log arcconf-trimode * * list / dev / sd* command (target query command) to the Microchip RAID card. The Microchip RAID card uses the arcconf-trimode tool to parse the channel number and device number (such as 12), locate the target NVMe SSD, and trigger a sector format query to ensure that the query request in indirect connection mode is correctly processed.

[0063] The expansion card (Broadcom RAID card / Microchip RAID card) responds to the command and returns a list of sector formats supported by the NVMe SSD, for example:

[0064] lbaf 0: ms:0 lbads:9 rp:0x1 (512B + 0B metadata).

[0065] lbaf 1: ms:8 lbads:9 rp:0x1 (512B+8Bmetadata).

[0066] lbaf 2: ms:0 lbads:12 rp:0x1 (4096B+0B metadata).

[0067] lbaf 3: ms:8 lbads:12 rp:0x1 (4096B+8B metadata).

[0068] The results show that the hard disk (target storage device) supports four formats: 512B, 520B (512B+8B), 4096B, and 4104B (4096B+8B). The lbaf number corresponds to different data capacities and metadata configurations, providing a basis for subsequent sector matching.

[0069] As an optional solution, selecting a target sector format whose matching parameters with the target service meet preset matching conditions from multiple reference sector formats also includes:

[0070] S31, detecting a matching parameter between each of a plurality of reference sector formats and a target service to obtain a plurality of reference matching parameters;

[0071] S32, selecting a target matching parameter that meets a preset matching condition from a plurality of reference matching parameters;

[0072] S33: Determine the reference sector format corresponding to the target matching parameter as the target sector format.

[0073] Optionally, in this embodiment, the above steps S31 to S33 may be implemented, but not limited to, by a matching best sector module in a control system of the storage device.

[0074] Optionally, in this embodiment, a target matching parameter that meets a preset matching condition is screened out from a plurality of reference matching parameters, including: screening out the largest reference matching parameter from a plurality of reference matching parameters as the target matching parameter, or screening out a reference matching parameter that is greater than a matching parameter threshold from a plurality of reference matching parameters as the target matching parameter. In this way, it is possible to ensure that the target sector format and the target business match each other, thereby improving the technical effect of the matching degree between the sector format of the storage device and the business run by the server.

[0075] As an optional solution, detecting a matching parameter between each of a plurality of reference sector formats and a target service to obtain a plurality of reference matching parameters further includes:

[0076] S41, constructing a corresponding reference setting command for each of the multiple reference sector formats to obtain multiple reference setting commands, wherein each reference setting command is used to control the expansion board to set the target storage device to the corresponding reference sector format;

[0077] S42, transmitting a plurality of reference setting commands to the expansion board in sequence according to a preset interval, wherein the expansion board is configured to switch sectors in the target storage device to corresponding reference sector formats according to the received reference setting commands;

[0078] S43, within a preset interval after the sectors in the target storage device are switched to the corresponding reference sector format, controlling the server to run a test service corresponding to the target service, and collecting test performance parameters and test stability parameters of the server running the test service, to obtain a corresponding reference sector format, test performance parameters, and test stability parameters, wherein the test service is a service having a service similarity parameter with the target service that is higher than a similarity parameter threshold, the service similarity parameter is used to indicate the degree of service similarity between different services, and the greater the service similarity parameter, the higher the degree of service similarity between the two services, the test performance parameter is used to indicate the performance of the server running the test service, and the test stability parameter is used to indicate the stability of the server running the test service;

[0079] S44 , generating matching parameters corresponding to each reference sector format according to the corresponding reference sector formats, test performance parameters, and test stability parameters, to obtain a plurality of reference matching parameters.

[0080] Optionally, in this embodiment, for S41, if the expansion card connected to the server is a Broadcom RAID card, the reference setting command format is: nvme change_para storcli-trimode / c* / e* / s* set-sector * / dev / sd*, where / c* / e* / s* represents the controller-cabinet-slot three-level positioning parameters (for example, / c0 / e1 / s2), the fourth * represents the sector format number (0=512B, 1=520B, 2=4096B, 3=4104B), and / dev / sd* represents the drive letter of the target NVMESSD. For example, to switch the sector format to 4096B, the command is nvme change_para storcli-trimode / c0 / e* / s* set-sector 2 / dev / sda. If the expansion card connected to the server is a Microchip RAID card, the reference setting command format is: nvme change_para arcconf-trimode * * set-sector * / dev / sd*. The first two *s represent the channel number and device number (for example, 12), respectively. The third * represents the sector format number. The drive letter definition is the same as above. For example, to switch to 520B sectors, the command is nvme change_para arcconf-trimode 1 * set-sector1 / dev / sdb.

[0081] Optionally, in this embodiment, the above steps S41-42 can be implemented but not limited to a batch sector update module in the control system of the storage device. In S42, the reference setting command generated by S41 is sent to the expansion board (RAID card) in sequence. After each switch, the next switch is performed after a fixed time interval (such as 2 hours by default, configurable). For example, if the expansion board connected to the server is a Broadcom RAID card, first send the set-sector0 command to switch to the 512B sector at an interval of 2 hours; then send the set-sector2 command to switch to the 4096B sector at an interval of 2 hours, and so on.

[0082] Optionally, in this embodiment, for S43, a test business with a similarity to the target business higher than a threshold (such as a large file read and write test corresponding to a 4K video editing business) is run to ensure data representativeness. The test performance parameters may be, but are not limited to, IOPS (input and output operations per second), bandwidth (MB / s), and compared with the SPEC performance benchmark of NVME SSD. The test stability parameters may be, but are not limited to, recording the performance fluctuation amplitude (such as bandwidth jitter rate) and generating a stability curve.

[0083] As an optional solution, constructing a corresponding reference setting command for each of the multiple reference sector formats further includes:

[0084] S51, matching a target control tool corresponding to a target card type from the corresponding card types and control tools, wherein the target control tool is a tool in an expansion card of the target card type that allows setting the sector format of a connected storage device;

[0085] S52, constructing a reference setting command corresponding to each reference sector format according to the tool field and format setting field of the target control tool, the target address of the target storage device connected to the expansion board, and the reference sector format, wherein the expansion board is configured to call the target control tool indicated by the tool field in response to the reference setting command, and perform the setting operation indicated by the format setting field on the sector format of the target storage device indicated by the target address, and the setting operation is used to set the sector format of the target storage device to the reference sector format in the reference setting command.

[0086] Optionally, in this embodiment, if the card type of the expansion card connected to the server is a Broadcom RAID card, the matching target control tool is storcli-trimode (this tool is a special command line tool developed by Broadcom for the trimode mode, which allows the sector format of the downstream NVME SSD to be set), the tool field is: storcli-trimode, which explicitly calls the Broadcom trimode tool, the format setting field is: set-sector, which is used to trigger the format modification function, and the target address uses three-level positioning / c* / e* / s*, where: / c* is the controller ID (such as / c0), / e* is the cabinet number, and / s* is the slot number (such as / s2). The wildcard * supports batch matching, and the reference sector format is represented by a number, for example, 0=512B, 2=4096B, and the complete reference setting command is: nvme change_para storcli-trimode / c0 / e1 / s2 set-sector 2 / dev / sda, which means: set the NVME of controller 0, cabinet 1, and slot 2 The SSD (disk letter / dev / sda) sector format is set to 4096B (number 2).

[0087] If the expansion card connected to the server is a Microchip RAID card, use the arcconf-trimode tool (based on the Microchip trimode technology architecture, used to control the expansion card to set the sector format of the storage device). The tool field is arcconf-trimode, corresponding to the Microchip trimode tool. The format setting field is set-sector, used to trigger the format modification function. The target address is simplified to a secondary location, **, consisting of the channel number (Reported Channel ID) and the device number (Device ID) (for example, 12). The reference sector format is represented by a number, for example, 0 = 512B and 2 = 4096B. The complete reference setting command is: nvme change_para arcconf-trimode 1 3 set-sector 0 / dev / sdb, which means: Set the sector format of the NVME SSD (drive letter / dev / sdb) in channel 1 and device 3 to 512B (number 0).

[0088] Optionally, in this embodiment, if the multiple reference sector formats are: 512B, 520B (512B+8B), 4096B, 4104B (4096B+8B), a corresponding reference setting command is constructed for each reference sector format, that is, 4 reference setting commands.

[0089] As an optional solution, a matching parameter corresponding to each reference sector format is generated according to the corresponding reference sector format, the test performance parameter, and the test stability parameter to obtain multiple reference matching parameters, further comprising:

[0090] S61, matching the reference performance score corresponding to the reference test performance parameter range within which the test performance parameter falls from the test performance parameter ranges and performance scores having corresponding relationships, and obtaining a reference sector format and a reference performance score having corresponding relationships;

[0091] S62: Generate a reference stability score for each test stability parameter based on the number of performance drop points indicated by the test stability parameter, and obtain a corresponding reference sector format and reference stability score, wherein the performance drop point is the time point when the test performance parameter drops to a preset test performance parameter during the server running the test service;

[0092] S63: Generate reference matching parameters for the corresponding reference sector format according to the reference performance score and the reference stability score.

[0093] Optionally, in this embodiment, the test performance parameters include IOPS, bandwidth, etc., and their corresponding scores are determined by comparing them with a preset performance scoring standard (SPEC). For example, if the test performance parameter is ≥98%, the SPEC score is 10 (reference performance score); if the test performance parameter is 95% ≤ <98%, the SPEC score is 8 (reference performance score); and if the test performance parameter is <95%, the SPEC score is 5 (reference performance score). Assume that the 4K random read SPEC score of an NVME SSD is 100, and the measured test performance parameter of sector format 1 is 98 (≥98%), which matches the score of 10; the measured test performance parameter of sector format 2 is 96 (95%-98%), which matches the score of 8.

[0094] Optionally, in this embodiment, a reference stability score is generated for each test stability parameter based on the number of performance drop points indicated by the test stability parameter. That is, the test stability parameter is analyzed, the number of performance drop points (time points at which the performance value is 70% lower than the average value) is counted, and scores are given according to preset standards. For example, if there are no drop points and the stability indicated by the test stability parameter is ≥99%, the reference stability score is 10 points; if there are no drop points and the stability is 95%≤<99%, the reference stability score is 8 points; if there are no drop points and the stability is <95%, the reference stability score is 5 points; if there are drop points, the reference stability score is 1 point. Assume that sector 1 has 100% stability and no drop points within 2 hours of operation, and scores 10 points; sector 2 has 96% stability and no drop points, and scores 8 points.

[0095] Optionally, in this embodiment, reference matching parameters are generated for the corresponding reference sector formats based on the reference performance score and the reference stability score, which can be, but not limited to: calculating the comprehensive score of each reference sector format as the reference matching parameter according to the weights of 30% for the performance score and 70% for the stability score (supported configuration), for example, sector 1: performance score 10×0.3+stability score 10×0.7=10 points; sector 2: performance score 8×0.3+stability score 8×0.7=8 points. The higher the comprehensive score, the higher the matching degree between the sector format and the target service. For example, sector 1 is judged to be the best match because it has the highest comprehensive score.

[0096] As an optional solution, switching the sectors in the target storage device to the target sector format further includes:

[0097] S71, constructing a corresponding target setting command for the target sector format, wherein the target setting command is used to control the expansion board to set the sectors in the target storage device to the target sector format;

[0098] S72, transmitting the target setting commands to the expansion board in sequence;

[0099] S73, after the sectors in the target storage device are switched to the corresponding target sector format, controlling the server to run the target service and detecting target performance parameters and target stability parameters of the target service during operation, wherein the target performance parameters are used to indicate the performance of the server in running the target service, and the target stability parameters are used to indicate the stability of the server in running the target service;

[0100] S74: When the target performance parameter is less than the performance parameter threshold, and / or the target stability parameter is less than the stability parameter threshold, control the sectors in the target storage device to switch from the target sector format to the preset sector format.

[0101] Optionally, in this embodiment, the above steps S71-S72 may be implemented, but are not limited to, by a batch sector update module in the control system of the storage device. Based on the aforementioned adaptively matched optimal sector format (target sector format) of the NVME SSD, the batch sector update module automatically batch updates the NVME SSDs (target storage devices) installed in the actual business (target business) online to the matched optimal sector format.

[0102] Optionally, in this embodiment, the above-mentioned S73-S74 can be implemented, but is not limited to, through a hard disk operation monitoring module in the control system of the storage device. The service (target service) is run according to the matched optimal sector format (target sector format). The hard disk operation monitoring module monitors the operating status of the NVME SSD to confirm whether the NVME SSD operating status is stable (i.e., detecting the target performance parameters and target stability parameters of the target service during operation). If the monitored NVME SSD operating status tends to be stable (e.g., performance meets specification requirements and stability continuously reaches above 99%), the adaptively matched optimal sector format is maintained and operation continues. If the monitored NVME SSD operating status is less stable (i.e., the target performance parameter is less than the performance parameter threshold, and / or the target stability parameter is less than the stability parameter threshold, such as when periodic performance drops occur), the original default sector format (preset sector format) is restored and operation continues. Finally, the user is notified of the final confirmed sector format result through the notification module.

[0103] It is worth noting that the control method of the storage device proposed in this application can modify the sector format of the NVME SSD in trimode mode, filling the gap in the method of modifying sectors in trimode mode. It can also automatically confirm the supported sector format of the NVME SSD in trimode mode online without offline confirmation, thereby improving accuracy and efficiency. Furthermore, it can also adaptively match the optimal sector format of the NVME SSD used in actual business, thereby improving the operational stability of the actual business. In addition, this solution is not only applicable to trimode mode, but can also perform sector adaptive matching processing on SSDs in direct connection mode or other configurations.

[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0105] Based on this understanding, the technical solution of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, or optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of this application.

[0106] In this embodiment, a control device for a storage device is also provided. The device is used to implement the above-mentioned embodiments and preferred embodiments. Details already described are omitted for clarity. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0107] Figure 4 is a structural block diagram of a control device for a storage device according to an embodiment of the present application; Figure 4 Shown, including:

[0108] A detection module 402 is configured to detect a card type of an expansion card currently connected to the server to obtain a target card type, wherein the server is connected to one or more storage devices via the expansion card;

[0109] A calling module 404 is configured to call a target query command matching the target board type to control the expansion board to query the sector format allowed to be set for the target storage device, thereby obtaining a plurality of reference sector formats, wherein the target storage device is a storage device allowed to provide storage resources for the target service running on the server among one or more storage devices connected to the expansion board, and the reference sector format is used to indicate the data capacity specification allowed to be set for the sectors of the target storage device;

[0110] a screening module 406 configured to screen out, from a plurality of reference sector formats, a target sector format whose matching parameters with the target service satisfy a preset matching condition, wherein the matching parameters satisfying the preset matching condition indicate that the degree of matching between the corresponding reference sector format and the target service is greater than a preset matching degree;

[0111] The switching module 408 is configured to switch the sectors in the target storage device to a target sector format.

[0112] In an exemplary embodiment, the calling module includes:

[0113] a matching unit, configured to match a target control tool corresponding to a target card type from the corresponding card types and control tools, wherein the target control tool is a tool in an expansion card of the target card type that allows querying the sector format of a connected storage device;

[0114] A first construction unit is configured to construct a target query command according to a tool field and a format query field of a target control tool and a target address of an expansion board connected to a target storage device;

[0115] a first transmission unit, configured to transmit the target query command to the expansion board, wherein the expansion board is configured to call the target control tool indicated by the tool field in response to the target query command, and perform a query operation indicated by the format query field on the sector format of the target storage device indicated by the target address;

[0116] The receiving unit is used to receive multiple reference sector formats returned by the expansion board in response to the target query command.

[0117] In an exemplary embodiment, the screening module includes:

[0118] a detection unit, configured to detect a matching parameter between each of a plurality of reference sector formats and a target service, and obtain a plurality of reference matching parameters;

[0119] A screening unit, configured to screen out target matching parameters that meet preset matching conditions from a plurality of reference matching parameters;

[0120] The determining unit is configured to determine the reference sector format corresponding to the target matching parameter as the target sector format.

[0121] In an exemplary embodiment, the detection unit is further configured to:

[0122] Constructing a corresponding reference setting command for each of the multiple reference sector formats to obtain multiple reference setting commands, wherein each reference setting command is used to control the expansion board to set the target storage device to the corresponding reference sector format;

[0123] transmitting a plurality of reference setting commands to the expansion board in sequence according to a preset time interval, wherein the expansion board is configured to switch sectors in the target storage device to corresponding reference sector formats according to the received reference setting commands;

[0124] Within a preset interval after the sectors in the target storage device are switched to the corresponding reference sector format, the server is controlled to run a test service corresponding to the target service, and test performance parameters and test stability parameters of the server running the test service are collected to obtain a reference sector format, test performance parameters, and test stability parameters having corresponding relationships, wherein the test service is a service having a service similarity parameter with the target service that is higher than a similarity parameter threshold, the service similarity parameter is used to indicate the degree of service similarity between different services, and the greater the service similarity parameter, the higher the degree of service similarity between the two services, the test performance parameter is used to indicate the performance of the server running the test service, and the test stability parameter is used to indicate the stability of the server running the test service;

[0125] A matching parameter corresponding to each reference sector format is generated according to the reference sector format, the test performance parameter and the test stability parameter having a corresponding relationship, so as to obtain a plurality of reference matching parameters.

[0126] In an exemplary embodiment, the detection unit is further configured to:

[0127] Matching a target control tool corresponding to a target card type from the corresponding card types and control tools, wherein the target control tool is a tool in an expansion card of the target card type that allows setting a sector format of a connected storage device;

[0128] A reference setting command corresponding to each reference sector format is constructed based on the tool field and format setting field of the target control tool, the target address of the target storage device connected to the expansion board, and the reference sector format, wherein the expansion board is configured to call the target control tool indicated by the tool field in response to the reference setting command, and perform the setting operation indicated by the format setting field on the sector format of the target storage device indicated by the target address, and the setting operation is used to set the sector format of the target storage device to the reference sector format in the reference setting command.

[0129] In an exemplary embodiment, the detection unit is further configured to:

[0130] Matching the reference performance score corresponding to the reference test performance parameter range within which the test performance parameter falls from the test performance parameter ranges and performance scores with corresponding relationships, and obtaining a reference sector format and a reference performance score with corresponding relationships;

[0131] Generate a reference stability score for each test stability parameter based on the number of performance drop points indicated by the test stability parameter, and obtain a corresponding reference sector format and reference stability score, wherein the performance drop point is the time point when the test performance parameter drops to a preset test performance parameter during the server running the test business;

[0132] Generate reference matching parameters for the corresponding reference sector format according to the reference performance score and the reference stability score.

[0133] In an exemplary embodiment, the switching module includes:

[0134] A second construction unit is configured to construct a corresponding target setting command for the target sector format, wherein the target setting command is configured to control the expansion board to set the sectors in the target storage device to the target sector format;

[0135] The second transmission unit is used to transmit the target setting commands to the expansion board in sequence;

[0136] a first control unit, configured to control the server to run a target service after the sectors in the target storage device are switched to the corresponding target sector format, and detect a target performance parameter and a target stability parameter of the target service during operation, wherein the target performance parameter is used to indicate the performance of the server in running the target service, and the target stability parameter is used to indicate the stability of the server in running the target service;

[0137] The second control unit is used to control the sectors in the target storage device to switch from the target sector format to the preset sector format when the target performance parameter is less than the performance parameter threshold and / or the target stability parameter is less than the stability parameter threshold.

[0138] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0139] For the description of the features in the embodiment corresponding to the control device of the storage device, reference can be made to the relevant description of the embodiment corresponding to the control method of the storage device, which will not be repeated here.

[0140] An embodiment of the present application further provides an electronic device, Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present application, such as Figure 5 As shown, the electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the control method for the storage device.

[0141] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0142] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.

[0143] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned storage device control method embodiments when running.

[0144] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0145] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0146] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method in each embodiment of the present application; the computer program product also includes a non-volatile computer-readable storage medium, which stores the computer program, and, when executed by the processor, implements the steps of the storage device control method in each embodiment of the present application.

[0147] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0148] The above is a detailed introduction to a control method for a storage device provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A method for controlling a storage device, characterized in that: include: Detecting a board type of an expansion board currently connected to a server to obtain a target board type, wherein the server is connected to one or more storage devices through the expansion board; Invoking a target query command matching the target board type to control the expansion board to query a sector format allowed to be set for a target storage device, and obtaining a plurality of reference sector formats, wherein the target storage device is a storage device allowed to provide storage resources for a target service running on the server among one or more storage devices connected to the expansion board, and the reference sector formats are used to indicate data capacity specifications allowed to be set for sectors of the target storage device; Filtering a target sector format from the plurality of reference sector formats, wherein a matching parameter between the target service and the target service satisfies a preset matching condition, wherein the matching parameter that satisfies the preset matching condition is used to indicate that a matching degree between the corresponding reference sector format and the target service is greater than a preset matching degree; Switching sectors in the target storage device to the target sector format; The step of selecting a target sector format whose matching parameters with the target service satisfy a preset matching condition from the multiple reference sector formats comprises: detecting matching parameters between each of the multiple reference sector formats and the target service to obtain multiple reference matching parameters; selecting a target matching parameter satisfying the preset matching condition from the multiple reference matching parameters; and determining the reference sector format corresponding to the target matching parameter as the target sector format; Wherein, the detecting of the matching parameters between each of the reference sector formats in the plurality of reference sector formats and the target business to obtain a plurality of reference matching parameters includes: constructing a corresponding reference setting command for each of the plurality of reference sector formats to obtain a plurality of reference setting commands, wherein each of the reference setting commands is used to control the expansion board to set the target storage device to the corresponding reference sector format; transmitting the plurality of reference setting commands to the expansion board in sequence according to a preset interval, wherein the expansion board is configured to switch the sectors in the target storage device to the corresponding reference sector format according to the received reference setting command; and controlling the server to run the target business within the preset interval after the sectors in the target storage device are switched to the corresponding reference sector format. The test service corresponding to the service is collected, and the test performance parameters and test stability parameters of the server running the test service are collected to obtain the reference sector format, the test performance parameters and the test stability parameters with corresponding relationships, wherein the test service is a service whose service similarity parameter with the target service is higher than the similarity parameter threshold, and the service similarity parameter is used to indicate the service similarity between different services. The larger the service similarity parameter, the higher the service similarity between the two services. The test performance parameter is used to indicate the performance of the server running the test service, and the test stability parameter is used to indicate the stability of the server running the test service; according to the reference sector format, the test performance parameter and the test stability parameter with corresponding relationships, matching parameters corresponding to each reference sector format are generated to obtain multiple reference matching parameters.

2. The method according to claim 1, characterized in that The calling of the target query command matching the target board type controls the expansion board to query the sector format allowed to be set by the target storage device, and obtains multiple reference sector formats, including: Matching a target control tool corresponding to the target card type from the corresponding card types and control tools, wherein the target control tool is a tool in an expansion card of the target card type that allows querying the sector format of a connected storage device; Constructing the target query command according to the tool field and format query field of the target control tool and the target address of the target storage device connected to the expansion board; Transmitting the target query command to the expansion board, wherein the expansion board is configured to call the target control tool indicated by the tool field in response to the target query command, and perform the query operation indicated by the format query field on the sector format of the target storage device indicated by the target address; Receive the multiple reference sector formats returned by the expansion board in response to the target query command.

3. The method according to claim 1, characterized in that The constructing a corresponding reference setting command for each of the plurality of reference sector formats comprises: Matching a target control tool corresponding to the target card type from the corresponding card types and control tools, wherein the target control tool is a tool in an expansion card of the target card type that allows setting the sector format of a connected storage device; A reference setting command corresponding to each reference sector format is constructed based on the tool field and format setting field of the target control tool, the target address of the target storage device connected to the expansion board, and the reference sector format, wherein the expansion board is configured to call the target control tool indicated by the tool field in response to the reference setting command, and perform the setting operation indicated by the format setting field on the sector format of the target storage device indicated by the target address, and the setting operation is used to set the sector format of the target storage device to the reference sector format in the reference setting command.

4. The method according to claim 1, wherein Generating a matching parameter corresponding to each reference sector format according to the reference sector format, the test performance parameter, and the test stability parameter, to obtain a plurality of reference matching parameters, includes: Matching the reference performance score corresponding to the reference test performance parameter range within which the test performance parameter falls from the test performance parameter ranges and performance scores having a corresponding relationship, and obtaining the reference sector format and the reference performance score having a corresponding relationship; Generating a reference stability score for each test stability parameter according to the number of performance drop points indicated by the test stability parameter, and obtaining the reference sector format and the reference stability score having a corresponding relationship, wherein the performance drop point is a time point when the test performance parameter drops to a preset test performance parameter during the process of the server running the test service; The reference matching parameter is generated for the corresponding reference sector format according to the reference performance score and the reference stability score.

5. The method according to claim 1, wherein The switching of the sectors in the target storage device to the target sector format includes: Constructing a corresponding target setting command for the target sector format, wherein the target setting command is used to control the expansion board to set the sectors in the target storage device to the target sector format; Transmitting the target setting commands to the expansion board in sequence; After the sectors in the target storage device are switched to the corresponding target sector format, controlling the server to run the target service and detecting a target performance parameter and a target stability parameter of the target service during the running process, wherein the target performance parameter is used to indicate the performance of the server in running the target service, and the target stability parameter is used to indicate the stability of the server in running the target service; When the target performance parameter is less than a performance parameter threshold, and / or the target stability parameter is less than a stability parameter threshold, the sectors in the target storage device are controlled to switch from the target sector format to a preset sector format.

6. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the storage device control method according to any one of claims 1 to 5 when executing the computer program.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method for controlling the storage device according to any one of claims 1 to 5.

8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the storage device control method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and device for improving performance of solid state disk, storage medium and server

    CN119902718A