Search

CN-122018823-A - Universal disk command issuing method

CN122018823ACN 122018823 ACN122018823 ACN 122018823ACN-122018823-A

Abstract

The invention discloses a universal disk command issuing method, and belongs to the technical field of solid state disks. The method comprises the steps of analyzing user instructions into ATA command operations by using a semantic interface, then carrying out intelligent risk interception by using a double risk assessment mechanism, then packaging and issuing commands by using a SCSI-ATA transparent transmission technology, realizing real-time progress monitoring by using a double-cycle architecture of active polling and event monitoring, and finally converting original responses into readable suggestions by using an error code mapping library. The method supports two execution modes of foreground synchronization and background asynchronization, and covers various command types such as equipment diagnosis, performance test, safety erasure and the like. The intelligent risk interception method and the intelligent risk interception system greatly reduce the operation threshold, replace complex hexadecimal commands through semantic parameters, effectively prevent misoperation, ensure the system safety, realize automation, security and visualization of disk command issuing, and remarkably improve the operation and maintenance efficiency and reliability of the storage equipment.

Inventors

  • Song Xiaomi
  • MA YI
  • XIONG WEI

Assignees

  • 芯盛智能科技(湖南)有限公司

Dates

Publication Date
20260512
Application Date
20260415

Claims (9)

  1. 1. A method for issuing a universal disk command is characterized by comprising the following steps: Receiving an ATA command input by a user, analyzing the command into a corresponding ATA command operation by a semantic analysis tool, and outputting the command to an intelligent pre-inspection and risk interception module; the intelligent pre-detection and risk interception stage is that static and dynamic multidimensional risk analysis and risk assessment results are carried out on the analyzed ATA command operation through the intelligent pre-detection and risk interception module, and whether the operation is continued or not is determined according to the risk level; Inputting ATA command operation through risk assessment, judging the execution mode, selecting foreground synchronous execution or background asynchronous execution according to the judgment result of the execution mode, packaging the ATA command operation into a SCSI command description block through SCSI-ATA transparent transmission technology, and issuing the command to target disk equipment through an operating system interface; the real-time state monitoring stage is that a real-time state monitoring module monitors the command execution progress by adopting a double-cycle architecture of active polling and event monitoring, the active polling queries the equipment state according to a fixed time interval, the event monitoring is triggered by the equipment state change, and the progress information is updated in real time for display; and in the result analysis and feedback stage, original data returned by the target disk device is taken as input, the original error codes are converted into readable suggestion information based on the error code mapping database through the enhanced result analysis module, and a final analysis result is output and fed back to a user.
  2. 2. The method of claim 1, wherein the ATA command is in a natural voice parameter format including a device identifier, a command type and an operation mode parameter.
  3. 3. The method for issuing a universal disk command according to claim 1, wherein the risk class is classified into an emergency risk, a high risk, a medium risk and a low risk; For the emergency risk command, directly intercepting and executing and returning warning information; for high risk commands, suspending the process and entering interactive confirmation, and requiring a user to input confirmation parameters or secondary confirmation; For medium and low risk commands, the check is done directly through risk assessment.
  4. 4. The universal disk command issuing method according to claim 1, wherein the intelligent pre-detection and risk interception module comprises a command inherent risk analysis sub-module and a context risk assessment sub-module, wherein the command inherent risk analysis sub-module is used for statically assessing command risk levels based on a predefined risk database, and the context risk assessment sub-module is used for dynamically detecting device states, including checking whether target disk devices are system disks, unloaded partitions and occupied by RAID or LVM.
  5. 5. The method for issuing a universal disk command according to claim 1, wherein the SCSI to ATA transparent technology encapsulates the ATA command in a specific field of the SCSI command description block through libata library and issues the command to the target disk device through SG_IO interface of Linux operating system.
  6. 6. The method for issuing a universal disk command as claimed in claim 1, wherein the device state change comprises a device error event or a task completion event.
  7. 7. The method of claim 1, wherein in the command issuing and executing mode determining stage, a background asynchronous executing mode is adopted for the time-consuming command, a task identifier is returned to the user, the user inquires the task progress, success or failure result at any time through the task identifier, and the monitoring process does not block the foreground task of the terminal.
  8. 8. The method of claim 1, wherein in the result parsing and feedback stage, the enhanced result parsing module embeds an error code mapping database to map a sensor Key returned by the device, an additional sensing code, and an additional sensing code qualifier into a multilingual readable suggestion.
  9. 9. The method of claim 8, wherein the multi-lingual readable suggestions include Chinese and English.

Description

Universal disk command issuing method Technical Field The invention relates to the technical field of solid state disks, in particular to a universal disk command issuing method. Background During storage device development and maintenance, it is often necessary to send specific ATA commands (e.g., SCT commands, SMART commands, etc.) to disk for device diagnostics, performance testing, or firmware debugging. But the Sata disk receives ATA commands and the operating system can only handle SCSI commands. At present, there is no tool for monitoring task execution progress, preventing issuing of risk commands, and sending any ATA commands directly through a device interface provided by an operating system. Existing tools typically rely on specific hardware or drivers or can only send limited predefined commands. Existing tools include: hdparm its main design goals are performance testing and power management, limited command set, and its parameter resolution logic is tightly coupled to specific functions, without the ability to flexibly assemble any ATA commands. Sg_sat (belonging to the sg3_ utils package), which is a set of lower level tools, including sg_sat_identification, sg_sat_smart, etc. They use exclusively ATA PASS-thumb. The method has the defects that each command is realized by an independent binary file, a command set is distributed, a user needs to memorize a large number of tool names and parameters, and for nonstandard or custom commands, the user still needs to manually calculate and assemble complex binary parameter blocks, so that the method is extremely unfriendly to the user. The main goal of the currently existing tools is the usual functions (performance, power supply) so it does not implement the complete ATA command set (e.g. complete SMART commands, flow control commands, security function commands, etc.), nor does its architecture facilitate expanding these commands. Or the sg_sat series tool adopts a 'one-function one-program' model, so that the tool set is fragmented, the use is complex, and the learning cost is high. More importantly, based on the in-depth analysis of the sg3_ utils tool, the core disadvantage is that it is a powerful but primitive set of commands, lacking systematic support for "automation", "security" and "observability" in modern operation and maintenance scenarios. Disclosure of Invention The invention aims to overcome the defects of the prior art and provides a universal disk command issuing method. Scattered, high-risk native command operations are converted into a programmable, monitorable, rollback safety automation task. 1. A unified semantical interface, which provides visual commands such as sg_ automate sanitize-device/dev/sdX-mode full-confirm, and the like, replaces sg_raw which needs to memorize complex hexadecimal CDB, 2, an intelligent pre-check and risk interception engine, which automatically checks whether a system disk is occupied by RAID/LVM and is forcefully confirmed twice before any destructive command (such as erasure and formatting) is executed, and 3, a real-time status monitoring and progress report, which automatically enters a monitoring mode for time-consuming commands such as sanitize, long self-test, and periodically polls progress and displays the progress in a progress bar/percentage form instead of blocking a terminal. 4. Enhanced result parsing and suggestion converts the original hexadecimal code returned by REQUEST SENSE into readable suggestions in Chinese/English, e.g., 0x5 x24 x00 into "error: illegal REQUEST". The possible reason is that the current device power or policy state does not allow this to be performed. The invention aims at realizing the following technical scheme that the universal disk command issuing method comprises the following steps: Receiving an ATA command input by a user, analyzing the command into a corresponding ATA command operation by a semantic analysis tool, and outputting the command to an intelligent pre-inspection and risk interception module; the intelligent pre-detection and risk interception stage is that static and dynamic multidimensional risk analysis and risk assessment results are carried out on the analyzed ATA command operation through the intelligent pre-detection and risk interception module, and whether the operation is continued or not is determined according to the risk level; Inputting ATA command operation through risk assessment, judging the execution mode, selecting foreground synchronous execution or background asynchronous execution according to the judgment result of the execution mode, packaging the ATA command operation into a SCSI command description block through SCSI-ATA transparent transmission technology, and issuing the command to target disk equipment through an operating system interface; the real-time state monitoring stage is that a real-time state monitoring module monitors the command execution progress by adopting a double-cycle architecture of active po