Magnetic disk health state detection method and device based on SMART information, equipment and medium
By collecting disk model and manufacturer information, and using a large language model to extract and store structured SMART information, the problem of low detection reliability caused by differences between different hard drive manufacturers is solved, and efficient and accurate disk health status detection is achieved.
Patent Information
- Application Number
- CN202511783718.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-03
AI Technical Summary
The SMART information from different hard drive manufacturers varies, resulting in low reliability of disk health status detection, especially in server testing with mixed hard drive models, where the probability of false positives and false negatives is high.
Collect disk model and manufacturer information, extract structured SMART information using a large language model, and store it in a MongoDB database. Then, query and detect it using the identity information index.
It improves the reliability of disk health status detection, reduces the probability of false positives and false negatives due to differences in manufacturers and human experience, and reduces the complexity and cost of operation and maintenance.
Smart Images

Figure CN121597503A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for detecting disk health status based on SMART information. Background Technology
[0002] With the advancement of technology, enterprises are paying increasing attention to server robustness, especially for servers providing data services. Disk health is crucial for their stable operation, as disks are the foundation of data persistence. Failures can lead to permanent data loss and high recovery costs, and are also a source of performance bottlenecks. Deteriorating disk health can cause latency spikes that drag down service performance, and may also trigger kernel errors, file system corruption, or even operating system crashes. Failure to monitor in a timely manner can lead to sudden downtime, increasing the complexity and cost of operation and maintenance. SMART, as an industry standard, has become a standard feature of many hard drives and is a commonly used technology for monitoring disk health in daily testing and operation and maintenance. When used with the smartctl command-line tool under Linux / Unix systems, it can monitor SMART attributes and their values, such as the number of remapped sectors and interface transmission errors. Users can identify disk failures, assess the health status, and predict potential failures by combining attribute threshold ranges.
[0003] Currently, when acquiring SMART information, each hard drive manufacturer has the right to determine the measurement indicators and set safety thresholds. This results in significant differences in SMART attribute definitions, threshold standards, and data formats among different manufacturers or models of hard drives. Specifically, this manifests as inconsistent attribute names, different warning thresholds for the same attribute depending on the manufacturer, different methods of representing attribute values, and manufacturers adding their own unique monitoring indicators. This poses a challenge to unified monitoring and prediction of hard drive health status, especially in server testing with mixed hard drive models. This not only raises the technical threshold for testing but also greatly increases the probability of false positives and false negatives.
[0004] It is evident that how to avoid discrepancies in SMART information due to different manufacturers and models, thereby improving the reliability of disk health status detection, is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a disk health status detection method, apparatus, device, and medium based on SMART information, avoiding discrepancies in SMART information due to different manufacturers and models, thereby improving the reliability of disk health status detection. The specific solution is as follows:
[0006] In a first aspect, the present invention discloses a disk health status detection method based on SMART information, comprising:
[0007] Collect disk attribute information for different identities; wherein, the identity information includes disk model and disk manufacturer;
[0008] The target large language model is used to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information;
[0009] The identity information is used to determine the index of the structured SMART information, and the structured SMART information is stored in the MongoDB database;
[0010] Based on the target identity information of the disk to be tested, the target SMART information is retrieved from the MongoDB database, and the health status of the disk to be tested is detected based on the target SMART information to obtain the health status result.
[0011] Optionally, the disk attribute information collected for different identity information includes:
[0012] Collect original disk attribute information corresponding to different disk models and manufacturers; wherein, the disk attribute information includes SMART white paper, technical specifications, and product data sheets;
[0013] Use a preset parsing tool to extract text data and / or tabular data from the original disk attribute information;
[0014] The text data and / or the table data are cleaned to obtain the cleaned disk attribute information.
[0015] Optionally, the step of extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model to obtain structured SMART information includes:
[0016] Set the target SMART field and prompt words; wherein, the target SMART field includes the identity information and SMART information, the SMART information includes attribute identifier, attribute name, attribute description and SMART threshold, and the prompt words represent the fields and formats of the attribute information to be extracted;
[0017] The target large language model and the prompt words are used to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information.
[0018] Optionally, the prompt words include the attribute name, an example of extracting attribute information, and the logic for extracting attribute information;
[0019] The step of extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model and the prompt words to obtain structured SMART information includes:
[0020] The extraction logic and examples of the attribute information are used to guide the target large language model to extract the attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information; wherein, the structured SMART information includes the attribute name.
[0021] Optionally, the step of extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model to obtain structured SMART information includes:
[0022] The target large language model is used to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain the first SMART information;
[0023] JSON Schema is used to define field type constraints to perform format validation on the first SMART information and remove attribute information in the first SMART information that does not conform to the preset format to obtain the second SMART information; wherein, the preset format is JSON format;
[0024] The numerical SMART information in the second SMART information is converted to integers, and abnormal data in the second SMART information is removed to obtain the converted SMART information; wherein, the abnormal data is the numerical SMART information in the second SMART information that failed to be converted.
[0025] The converted SMART information is standardized in units to obtain standardized SMART information. Then, the names of SMART information belonging to the same attribute but with different attribute names in the standardized SMART information are standardized to obtain structured SMART information.
[0026] Optionally, storing the structured SMART information in a MongoDB database includes:
[0027] If there are multiple source objects for the current structured SMART information under the same identity information, then compare whether the current structured SMART information belonging to different source objects is consistent;
[0028] If the current structured SMART information belonging to different source objects is consistent, then the current structured SMART information is stored in the MongoDB database.
[0029] Optionally, the step of retrieving target SMART information from the MongoDB database based on the target identity information of the disk to be detected includes:
[0030] Retrieve the current query command returned by the preset natural language query interface;
[0031] The current query command is segmented using the word segmenter of the target retrieval tool to obtain the target identity information of the disk to be detected;
[0032] The target SMART information is retrieved from the MongoDB database based on the target identity information of the disk to be tested.
[0033] Secondly, the present invention discloses a disk health status detection device based on SMART information, comprising:
[0034] The information collection module is used to collect disk attribute information of different identity information; wherein, the identity information includes disk model and disk manufacturer;
[0035] The structuring module is used to extract attribute information corresponding to the target SMART field from the disk attribute information using the target large language model, so as to obtain structured SMART information;
[0036] An information storage module is used to determine the index of the structured SMART information from the identity information and store the structured SMART information in a MongoDB database;
[0037] The health monitoring module is used to search for target SMART information from the MongoDB database based on the target identity information of the disk to be tested, and to perform health status detection on the disk to be tested based on the target SMART information to obtain a health status result.
[0038] Thirdly, the present invention discloses an electronic device, comprising:
[0039] Memory, used to store computer programs;
[0040] A processor for executing a computer program to implement the steps of the aforementioned SMART information-based disk health status detection method.
[0041] Fourthly, the present invention discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disk health status detection method based on SMART information.
[0042] Therefore, this invention collects disk attribute information with different identities; wherein, the identity information includes disk model and disk manufacturer; it uses a target large language model to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information; it uses the identity information to determine the index of the structured SMART information and stores the structured SMART information in a MongoDB database; it searches for the target SMART information in the MongoDB database according to the target identity information of the disk to be tested, and performs a health status detection on the disk to be tested based on the target SMART information to obtain a health status result.
[0043] The beneficial effects are as follows: First, by collecting disk attribute information including disk model and manufacturer information, this invention can accurately distinguish disks from different manufacturers and models, solving the problem of significant differences in SMART information between different manufacturers or types of disks, and avoiding subsequent processing errors due to information confusion. Second, by using a target large language model to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information, this invention can more efficiently and accurately transform unstructured SMART-related data into standardized structured data compared to traditional methods, eliminating the need for extensive manual processing and improving the completeness and accuracy of attribute information extraction. Third, by using identity information as an index for structured SMART information... The data is stored in a MongoDB database. Because MongoDB supports a loose BSON data structure, it can flexibly store complex SMART data for disks from different manufacturers and models. Furthermore, using the identity information as an index facilitates the rapid location and querying of the corresponding disk's SMART information, providing efficient data acquisition support for subsequent health status detection. Finally, by retrieving the target SMART information from the MongoDB database based on the target identity information of the disk to be tested and performing health status detection, testers or maintenance personnel can accurately match the SMART health attribute information of the disk to be tested and judge the disk's health status based on the corresponding thresholds and other information. This effectively reduces the probability of false positives and false negatives caused by differences in manufacturers and human experience, thereby reducing the complexity and cost of operation and maintenance. Attached Figure Description
[0044] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 A flowchart of a disk health status detection method based on SMART information provided in an embodiment of the present invention;
[0046] Figure 2 A flowchart illustrating a specific disk health status detection method based on SMART information provided in this embodiment of the invention;
[0047] Figure 3 This is a specific schematic diagram of SMART information acquisition provided in an embodiment of the present invention;
[0048] Figure 4 This is a schematic diagram of a disk health status detection device based on SMART information provided in an embodiment of the present invention;
[0049] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0051] With the advancement of technology, enterprises are paying increasing attention to server robustness, especially for servers providing data services. Disk health is crucial for their stable operation, as disks are the foundation of data persistence. Failures can lead to permanent data loss and high recovery costs, and are also a source of performance bottlenecks. Deteriorating disk health can cause latency spikes that drag down service performance, and may also trigger kernel errors, file system corruption, or even operating system crashes. Failure to monitor in a timely manner can lead to sudden downtime, increasing the complexity and cost of operation and maintenance. SMART, as an industry standard, has become a standard feature of many hard drives and is a commonly used technology for monitoring disk health in daily testing and operation and maintenance. When used with the smartctl command-line tool under Linux / Unix systems, it can monitor SMART attributes and their values, such as the number of remapped sectors and interface transmission errors. Users can identify disk failures, assess the health status, and predict potential failures by combining attribute threshold ranges.
[0052] Currently, when acquiring SMART information, each hard drive manufacturer has the right to determine the measurement indicators and set safety thresholds. This results in significant differences in SMART attribute definitions, threshold standards, and data formats among different manufacturers or models of hard drives. Specifically, this manifests as inconsistent attribute names, different warning thresholds for the same attribute depending on the manufacturer, different methods of representing attribute values, and manufacturers adding their own unique monitoring indicators. This poses a challenge to unified monitoring and prediction of hard drive health status, especially in server testing with mixed hard drive models. This not only raises the technical threshold for testing but also greatly increases the probability of false positives and false negatives.
[0053] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0054] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] Next, we will describe in detail a disk health status detection scheme based on SMART information provided by an embodiment of the present invention. Figure 1 A disk health status detection method based on SMART information provided in this embodiment of the invention includes:
[0056] Step S11: Collect disk attribute information for different identity information; wherein, the identity information includes disk model and disk manufacturer.
[0057] In this embodiment, the collection of disk attribute information for different identity information includes: collecting original disk attribute information corresponding to different disk models and disk manufacturers; wherein, the disk attribute information includes SMART white paper, technical specifications, and product data sheets; extracting text data and / or table data from the original disk attribute information using a preset parsing tool; and cleaning the text data and / or table data to obtain the cleaned disk attribute information.
[0058] When collecting disk attribute information corresponding to different identity information (disk model, disk manufacturer), the original disk attribute information for different disk models is first downloaded from the official websites of major disk manufacturers. This includes the SMART white paper, technical specifications, and product data sheets. If the official documentation is incomplete, relevant information from open-source projects such as smartmontools and technical forums and blogs is also referenced (data accuracy needs to be manually verified). Most disk attribute information is in PDF (Portable Document Format) format. Then, a preset parsing tool (such as pdfplumber) is used to parse the original disk attribute information, extracting text data (such as attribute descriptions and threshold descriptions) and tabular data (such as structured tables containing attribute IDs, names, and thresholds) from the PDF document. An example of using pdfplumber to extract PDF tables is shown below:
[0059] import pdfplumber
[0060] with pdfplumber.open("XXX_smart.pdf") as pdf:
[0061] For the page in pdf.pages:
[0062] tables = page.extract_tables()
[0063] for table in tables:
[0064] # Extract attribute ID, name, threshold, and other fields
[0065] process_table(table);
[0066] Finally, the extracted text and table data are cleaned to remove irrelevant content such as headers, footers, and advertisements, while retaining valid information containing keywords such as "SMART," "Attribute," and "threshold." This completes the initial data screening and purification, yielding the cleaned disk attribute information.
[0067] This data collection and preprocessing method, on the one hand, obtains raw disk attribute information from multiple channels such as manufacturer websites and open-source projects, and explicitly covers core document types such as SMART white papers and technical specifications. This ensures that the collected disk attribute information is authoritative and comprehensive, laying a data foundation for subsequent extraction of accurate SMART information. On the other hand, it uses preset parsing tools to selectively extract text and tabular data, and combines this with data cleaning to remove irrelevant content. This effectively filters redundant information, reduces interference, and avoids errors caused by data clutter in subsequent information extraction stages. At the same time, the standardized data format also facilitates the subsequent extraction of structured SMART information using large language models, further improving overall data processing efficiency and indirectly solving the problems of high extraction difficulty and low accuracy caused by the scattered sources and chaotic formats of SMART information.
[0068] Step S12: Use the target large language model to extract the attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information.
[0069] In this embodiment, the step of extracting attribute information corresponding to the target SMART field from the disk attribute information using a target large language model to obtain structured SMART information includes: setting a target SMART field and prompt words; wherein, the target SMART field includes the identity information and SMART information, the SMART information includes attribute identifier, attribute name, attribute description, and SMART threshold, and the prompt words represent the fields and formats of the attribute information to be extracted; and the target large language model and the prompt words are used to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information.
[0070] When using the target large language model to extract corresponding attribute information from disk attribute information to obtain structured SMART information, the target SMART field and prompt words are first clearly defined. The target SMART field contains identity information (disk model, disk manufacturer) and SMART information (i.e., attribute identifier, attribute name, attribute description, SMART threshold). The prompt words specify the fields to be extracted and the output format (e.g., specifying JSON output, including manufacturer, model, ID of each attribute, name, etc.), and also embed domain knowledge (e.g., common name correspondences of SMART attributes) and examples to strengthen the extraction logic. Then, the cleaned prompt words of the target SMART field and the cleaned disk attribute information are input into the target large language model. The model extracts the content that matches the target SMART field from the disk attribute information based on the prompt words, forming structured data containing disk model, manufacturer, and detailed information of each SMART attribute, i.e., structured SMART information. In other words, by setting clear target SMART fields and prompts that include field and format requirements, and combining the large language model's ability to understand natural language and professional documents, the required structured SMART information can be accurately extracted from unstructured disk attribute information (such as text and tables in vendor documents). This solves the problems of large differences in document formats among different vendors, low efficiency of manual extraction, and susceptibility to errors. It ensures that the extracted structured information fully covers key fields, unifies the output format, provides a standardized data foundation for subsequent storage and querying, reduces manual intervention, and improves the efficiency and accuracy of information extraction. It can better meet the SMART information extraction needs of disks from multiple vendors and models.
[0071] In this embodiment, the prompt word includes the attribute name, an example of attribute information extraction, and the attribute information extraction logic; the step of using the target large language model and the prompt word to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information includes: using the attribute information extraction logic and the attribute information extraction example to guide the target large language model to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information; wherein, the structured SMART information includes the attribute name.
[0072] When extracting attribute information using the target large language model and prompt words, the prompt words must include attribute names, such as "Reallocated_Sector_Count" or "Number of Remapped Sectors," as well as extraction examples. For instance, a complete extraction case showing the correspondence between attribute ID, name, description, and threshold for a specific disk model can be provided. The extraction logic can also be included, for example: first, identify the disk model and manufacturer in the document, then match the SMART attribute one by one according to the model, marking null if there is no explicit threshold. During subsequent extraction operations, the extraction logic in the prompt words serves as the rule, and the extraction examples serve as a reference, guiding the target large language model (such as a fine-tuned BERT or open-source LLM) to filter content from the cleaned disk attribute information that corresponds to the target SMART fields (i.e., identity information, attribute identifiers, attribute descriptions, SMART thresholds, etc.). The target large language model is, for example, a fine-tuned BERT (Bidirectional Encoder Representations from Transformers) or LLM (Large Language Model). Finally, structured SMART information containing attribute names is generated, such as a set of manufacturers, models, and corresponding SMART attributes organized in a specified JSON format. The clear definition of attribute names in the prompt words can avoid confusion for large language models regarding the different expressions of the same attribute by different vendors. For example, it distinguishes that "Reallocated_Sector_Ct" and "ReallocatedSectorCount" both correspond to "remapped sector number". The extraction examples and extraction logic provide clear operational guidelines for the model, reducing extraction omissions or errors caused by model misunderstandings, and significantly improving the accuracy of converting unstructured data into structured SMART information. At the same time, this prompt-based guided extraction does not require large-scale model reconstruction and can adapt to disk attribute documents of different vendors and formats. It effectively solves the problems of low extraction efficiency and high misjudgment rate caused by inconsistent SMART attribute expressions and large differences in document structure, providing high-quality standardized data for subsequent knowledge base construction.
[0073] In this embodiment, the step of extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model to obtain structured SMART information includes: extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model to obtain first SMART information; defining field type constraints using JSON Schema to perform format validation on the first SMART information and removing attribute information in the first SMART information that does not conform to a preset format to obtain second SMART information; wherein, the preset format is JSON format; converting the numeric SMART information in the second SMART information into integers and removing abnormal data in the second SMART information to obtain converted SMART information; wherein, the abnormal data is numeric SMART information in the second SMART information that failed to be converted; unifying the units of the converted SMART information to obtain unified SMART information, and unifying the names of SMART information belonging to the same attribute but with different attribute names in the unified SMART information to obtain structured SMART information.
[0074] When extracting corresponding attribute information from disk attribute information to obtain structured SMART information using the target large language model, the process first extracts the content corresponding to the target SMART fields (identity information, attribute identifier, attribute name, attribute description, SMART threshold, etc.) from the cleaned disk attribute information using the target large language model, thus obtaining the first SMART information. Next, JSON Schema is used to define field type constraints, such as specifying "attribute_id" as an integer and "threshold" as a numeric value or null, to perform format validation on the first SMART information, removing attribute information that does not conform to the JSON format, thus obtaining the second SMART information. Then, the numeric SMART information (such as attribute ID and threshold) in the second SMART information is converted to integers, and abnormal data that fails to convert is removed, resulting in the converted SMART information. Through JSON Schema format validation and numerical conversion, non-standard data and outliers can be filtered out, ensuring the format consistency and numerical accuracy of the structured SMART information, and solving the data chaos problem caused by differences in document formats from different vendors.
[0075] Finally, the units of the converted SMART information are standardized. For example, "℃" and "Celsius" in different documents are standardized to "℃". The names of information with the same attribute but different names (such as "Reallocated_Sector_Count" and "Remapped Sector Count") are standardized to obtain structured SMART information. The standardization of units and attribute names can eliminate the differences in the expression of the same attribute (such as different terminology translations and abbreviations), realize the standardization of SMART information across manufacturers and models, and provide a high-quality data foundation for subsequent storage in MongoDB database and accurate query and health status detection based on identity information. At the same time, it reduces the risk of query errors and detection misjudgments caused by inconsistent data formats and expressions, and improves the reliability of the entire SMART information application process.
[0076] Step S13: Determine the index of the structured SMART information using the identity information, and store the structured SMART information in the MongoDB database.
[0077] In this embodiment, storing the structured SMART information in a MongoDB database includes: if there are multiple source objects for the current structured SMART information under the same identity information, comparing whether the current structured SMART information belonging to different source objects is consistent; if the current structured SMART information belonging to different source objects is consistent, then storing the current structured SMART information in a MongoDB database.
[0078] When storing structured SMART information in a MongoDB database, it is necessary to first determine whether there are multiple source objects for the structured SMART information to be stored under the same identity information (i.e., the same disk model and the same manufacturer), such as manufacturer's official website white paper, smartmontools open source project database, technical forum shared data, etc. If there are multiple source objects, the content of the current structured SMART information corresponding to different source objects is compared to check whether the core fields such as attribute identifier, attribute name, attribute description, and SMART threshold of SMART attributes in each source information are consistent. When it is confirmed that the current structured SMART information of different source objects is completely consistent, the structured SMART information is then officially stored in the MongoDB database. By comparing the consistency of structured SMART information from multiple sources under the same identity information, erroneous data caused by differences in sources can be effectively filtered out. For example, if the threshold shared by a technical forum is inconsistent with the official white paper of a manufacturer, the data will not be stored directly, ensuring that the SMART information stored in the MongoDB database is authoritative and accurate, and avoiding erroneous data from affecting subsequent health status detection results. At the same time, with multi-source consistency as the premise of storage, the reliability of structured SMART information is further enhanced, providing high-quality data support for subsequent querying of target SMART information based on identity information and conducting disk health status detection, indirectly solving the problem of false positives and false negatives caused by the complexity of SMART information sources and the difficulty in distinguishing accuracy.
[0079] Furthermore, when validating structured SMART information, on the one hand, threshold rationality verification is carried out. Based on the physical meaning of each SMART attribute, it is determined whether its threshold conforms to objective laws. For example, "Current_Pending_Sector" (number of sectors to be mapped) represents the number of sectors suspected of being damaged or to be detected. From a physical and logical perspective, its warning threshold is usually 0. If the threshold extraction result of this attribute in the structured SMART information is 50 or other values that clearly exceed the reasonable range, then the threshold is determined to be abnormal. Threshold rationality verification can eliminate abnormal thresholds caused by large language model extraction deviations or document annotation errors, avoiding misjudgments due to incorrect thresholds during subsequent health status detection. On the other hand, field integrity verification is performed, explicitly requiring that each SMART attribute must contain at least the core fields "ID", "Name", and "Description", and the disk basic information must contain the identity fields "Manufacturer" and "Model". If a field is found to be missing in a structured SMART piece of information, such as missing the attribute ID or not indicating the disk model, the information is returned to the extraction stage for reprocessing or temporarily marked as "to be supplemented" for later improvement. Field integrity verification ensures that the core content of the structured SMART information is not missing, preventing the information from being unable to be associated with the corresponding disk or used for querying and detection due to the missing key fields. This further guarantees the quality of SMART information stored in the knowledge base and provides reliable data support for subsequent accurate querying of target SMART information based on identity information and conducting disk health status detection. It effectively solves the problem of low monitoring and detection accuracy caused by abnormal SMART information thresholds and incomplete fields.
[0080] Step S14: Search for target SMART information in the MongoDB database based on the target identity information of the disk to be tested, and perform health status detection on the disk to be tested based on the target SMART information to obtain the health status result.
[0081] In this embodiment, the step of searching for target SMART information from the MongoDB database based on the target identity information of the disk to be detected includes: obtaining the current query instruction returned by a preset natural language query interface; segmenting the current query instruction using the word segmenter of the target retrieval tool to obtain the target identity information of the disk to be detected; and searching for target SMART information from the MongoDB database based on the target identity information of the disk to be detected.
[0082] When searching for target SMART information in the MongoDB database based on the target identity information of the disk to be tested, the system first receives the current query command input by the user through a preset natural language query interface, such as "query the remapping sector number threshold of model C from manufacturer A". Then, it uses a target retrieval tool (such as Elasticsearch) with a word segmenter (such as the IK word segmenter) to perform Chinese word segmentation on the current query command, extracting the target identity information of the disk to be tested from the segmentation results, such as disk model C and the disk manufacturer A. Finally, using the extracted target identity information as an index, it accurately matches and searches for the corresponding target SMART information in the MongoDB database (such as the remapping sector number attribute ID, description, and threshold of this model of disk). The specific pseudocode is as follows:
[0083] from langchain.chains import LLMChain
[0084] from langchain.prompts import PromptTemplate
[0085] prompt = PromptTemplate(
[0086] input_variables=["query"],
[0087] template="Converts user queries to MongoDB query statements: {query}" )
[0089] chain = LLMChain(llm=OpenAI(), prompt=prompt)
[0090] #User input: "Health indicator attribute information for Manufacturer A, Model C"
[0091] #Output: knowledge.query({"manufacturer": "Seagate", "model": "C"}).
[0092] By combining a natural language query interface with a word segmenter, users can input query commands in everyday language rather than professional syntax, significantly lowering the barrier to entry for testers and operations personnel, eliminating the need to master complex query syntax. At the same time, searching using the target identity information as an index can quickly locate the SMART information corresponding to the disk to be tested, solving the problems of low query efficiency and inaccurate positioning caused by mixed information from multiple manufacturers and models of disks. This ensures that the required reference data can be accurately obtained during health status detection, improving the convenience and efficiency of disk health detection.
[0093] When performing a health status check on a disk based on the target SMART information, the system first obtains the current SMART attribute values of the disk under test in real time using tools such as smartctl, such as the current value of the number of remapped sectors and the current value of the number of sectors to be mapped. Then, these real-time attribute values are compared with the target SMART information retrieved from the MongoDB database. If a threshold is used as a critical value, and the current value exceeds the threshold, it is considered abnormal, thus determining whether each attribute is within the normal range. Finally, the system combines the comparison results of all SMART attributes to generate the health status result of the disk under test, including the overall health level and details of abnormal attributes, such as "the current value of the number of remapped sectors is 15, exceeding the threshold of 10, indicating a risk of data loss." By accurately comparing real-time attribute values with the thresholds and physical meanings of attributes defined by the manufacturer in the target SMART information, the health status of the disk can be scientifically determined, avoiding misjudgments caused by relying on human experience. At the same time, combined with the descriptive information of specific abnormal attributes, potential risk points of the disk can be clearly pointed out, providing maintenance personnel with targeted handling basis. This effectively solves the problems of low accuracy of health status detection and delayed fault warning caused by the lack of unified threshold standards and attribute interpretation basis in existing technologies, and improves the reliability and foresight of disk health management.
[0094] Therefore, this invention collects disk attribute information with different identities; wherein, the identity information includes disk model and disk manufacturer; it uses a target large language model to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information; it uses the identity information to determine the index of the structured SMART information and stores the structured SMART information in a MongoDB database; it searches for the target SMART information in the MongoDB database according to the target identity information of the disk to be tested, and performs a health status detection on the disk to be tested based on the target SMART information to obtain a health status result.
[0095] The beneficial effects are as follows: First, by collecting disk attribute information including disk model and manufacturer information, this invention can accurately distinguish disks from different manufacturers and models, solving the problem of significant differences in SMART information between different manufacturers or types of disks, and avoiding subsequent processing errors due to information confusion. Second, by using a target large language model to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information, this invention can more efficiently and accurately transform unstructured SMART-related data into standardized structured data compared to traditional methods, eliminating the need for extensive manual processing and improving the completeness and accuracy of attribute information extraction. Third, by using identity information as an index for structured SMART information... The data is stored in a MongoDB database. Because MongoDB supports a loose BSON data structure, it can flexibly store complex SMART data for disks from different manufacturers and models. Furthermore, using the identity information as an index facilitates the rapid location and querying of the corresponding disk's SMART information, providing efficient data acquisition support for subsequent health status detection. Finally, by retrieving the target SMART information from the MongoDB database based on the target identity information of the disk to be tested and performing health status detection, testers or maintenance personnel can accurately match the SMART health attribute information of the disk to be tested and judge the disk's health status based on the corresponding thresholds and other information. This effectively reduces the probability of false positives and false negatives caused by differences in manufacturers and human experience, thereby reducing the complexity and cost of operation and maintenance.
[0096] See Figure 2 This invention discloses a specific method for detecting disk health status based on SMART information. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. It includes:
[0097] Step S21: Collect disk attribute information for different identity information; wherein, the identity information includes disk model and disk manufacturer.
[0098] For example Figure 3The diagram illustrates a specific method for acquiring SMART information. Disk attribute information for different disk models is collected from various manufacturers' official websites. This includes SMART white papers, technical specifications, and product data sheets, containing key information such as attribute IDs, names, descriptions, threshold standards, and data format descriptions. A pre-defined parsing tool is used to extract text and / or tabular data from the raw disk attribute information. The text and / or tabular data is then cleaned, for example, by removing irrelevant content such as headers, footers, and advertisements, to obtain cleaned disk attribute information. When collecting raw disk attribute information, if the original information is in HTML format, XPath is first used to locate the target elements storing SMART information based on the page structure. Target elements may be attribute tables or threshold description text. Regular expressions are then used to extract the core data from the located target elements. If the original information is in XML format, XPath is first used to filter out target nodes containing SMART attributes. Regular expressions are then used to clean redundant information (such as spaces, comments, and special characters) from the target nodes to obtain cleaned disk attribute information. In this way, it can supplement the parsing of documents in formats other than PDF, such as HTML and XML, and work with other parsing tools to cover multiple data sources, ensuring the integrity and accuracy of SMART's raw data extraction, and providing a standardized data foundation for subsequent processing.
[0099] Step S22: Use the target large language model to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information.
[0100] The collected disk attribute information is intelligently processed and extracted, that is, the target large language model is used to extract the attribute information corresponding to the target SMART field from the disk attribute information. The target large language model is, for example, BERT or LLM+Prompt.
[0101] When the target large language model is LLM+Prompt, a reasonable prompt needs to be constructed before using the large language model (LLM) to extract structured information from unstructured text and output it in JSON format. Specifically, SMART domain knowledge needs to be embedded in the Prompt to improve the extraction quality of SMART attribute information from unstructured text. Accuracy is improved through chain-of-thought, and fuzzy matching rules are designed to handle differences in vendor terminology and improve fault tolerance. To ensure effective information retrieval, the Prompt template can be optimized in stages: extracting basic information, adding Few-Shot examples for reinforcement, and optimizing fault tolerance. An example of a Prompt template is shown below.
[0102] You are a storage device expert skilled at extracting structured information from disk manufacturers' SMART white papers. Your task is to extract disk SMART attribute information from a given text and output it in a specified JSON format.
[0103] The extracted information includes:
[0104] - Attribute ID: An integer representing the number of the SMART attribute.
[0105] - Attribute Name: A string representing the name of the attribute.
[0106] - Description: A string that describes the meaning of the attribute.
[0107] - Threshold: If the threshold for this attribute is explicitly given in the text, it is extracted (usually an integer or floating-point number); otherwise, it is set to null.
[0108] Notice:
[0109] 1. The text may contain information about multiple disk models. Please extract the SMART attribute list for each model separately.
[0110] 2. If a threshold is not explicitly given in the text for a certain attribute, the Threshold field is set to null.
[0111] {
[0112] "manufacturer": "manufacturer name",
[0113] "model": "model number",
[0114] "smart_attributes": [
[0115] {
[0116] "id": Attribute ID,
[0117] "name": "Attribute Name",
[0118] "description": "Attribute description",
[0119] },
[0120] ...other attributes ]
[0122] }
[0123] If the text contains multiple model numbers, output a JSON array, with each element corresponding to the information of one model number, as shown above.
[0124] Step S23: Determine the index of the structured SMART information using the identity information, and store the structured SMART information in the MongoDB database.
[0125] The structured SMART information in JSON format is stored in a MongoDB database, and the identity information is an index of the structured SMART information. Full-text search is then performed in collaboration with the target search tool Elasticsearch.
[0126] Furthermore, in the MongoDB database, a data model is set up to store disk information, SMART attributes, and their thresholds, as follows:
[0127] Table 1: Disk Model [manufacturer, model, ...]);
[0128] Table 2: SMART attributes [attribute_id (attribute ID), attribute_name (attribute name), description (description), ...];
[0129] Table 3: Thresholds [manufacturer, model, attribute_id, threshold_value, threshold_type, ...];
[0130] It is understandable that a disk model may correspond to multiple SMART attributes, and each attribute may have different thresholds due to differences in manufacturers and models.
[0131] Step S24: Obtain the current query instruction returned by the preset natural language query interface; use the word segmenter of the target retrieval tool to segment the current query instruction to obtain the target identity information of the disk to be detected; search for the target SMART information from the MongoDB database based on the target identity information of the disk to be detected.
[0132] It provides a pre-defined natural language query interface, meaning the disk SMART information intelligent knowledge base is equipped with a standardized API (Application Programming Interface) that supports REST (Representational State Transfer) protocol reading. A pseudocode example is shown below:
[0133] import FastAPI from fastapi
[0134] app = FastAPI()
[0135] @app.get(" / smart / {manufacturer} / {model}")
[0136] async def get_smart(manufacturer: str, model: str):
[0137] # Query data from the knowledge base
[0138] result = db.smart.query({"manufacturer": manufacturer, "model":model})
[0139] return {
[0140] "manufacturer":**,
[0141] "model": **,
[0142] "attributes": [
[0143] ... ]
[0145] };
[0146] In this way, users can issue the current query command through the preset natural language query interface, reducing the professional requirements for users. After the system obtains the current query command returned by the preset natural language query interface, it can then use the word segmenter of the target retrieval tool to segment the current query command to obtain the target identity information of the disk to be detected. Furthermore, based on the target identity information of the disk to be detected, the system can search for the target SMART information from the MongoDB database.
[0147] Step S25: Perform a health status check on the disk to be tested based on the target SMART information to obtain a health status result.
[0148] Based on the target SMART information, several key parameters can be tracked, such as the number of bad sectors, power-on time, and temperature. Therefore, the health status of the disk to be tested can be checked based on the target SMART information to obtain the health status result. The specific pseudocode is as follows:
[0149] def predict_failure(manufacturer, model):
[0150] attrs = knowledge.get_smart(manufacturer, model)
[0151] for attr in attrs:
[0152] # Check the actual value based on attr['name']
[0153] if actual value > attr["threshold"]:
[0154] return f"Warning: {attr['name']} is above the threshold {attr['threshold']}"
[0155] Return "Disk health";
[0156] In other words, the health status of the disk under test can be determined by comparing the current actual SMART information of the disk under test with the corresponding SMART threshold in the target SMART information.
[0157] Furthermore, if the health status result obtained from the health status check of the disk under test based on the target SMART information indicates that the current health status of the disk under test is a preset health level, then the health status of the disk under test in a preset future time period can be predicted based on the target SMART information. Specifically, firstly, the historical actual SMART information of the disk under test within a preset historical time period is obtained. A time series prediction model is constructed based on the historical actual SMART information and the SMART threshold in the target SMART information. By analyzing the changing trend of each historical actual SMART information over time, predicted values of each SMART information in the preset future time period are generated. Then, the predicted values are compared with the SMART threshold in the target SMART information to generate a prediction result indicating whether each SMART information has a risk of exceeding the threshold in the preset future time period. Based on the prediction result, the health status of the disk under test in the preset future time period is determined. For example, "Healthy within 1 month, but the number of remapped sectors may exceed the threshold within 3 months, posing a warning risk." This embodiment can achieve the purpose of early warning of potential faults based on the current state detection; at the same time, based on the prediction logic of attribute physical meaning and threshold, it can clearly point out the attributes and time nodes that may be abnormal in the future, giving maintenance personnel a time window to replace disks and back up data in advance, reducing the risk of data loss and service interruption caused by sudden disk failure, and improving the stability and reliability of the storage system.
[0158] To ensure the timeliness and accuracy of the knowledge base, an automated update mechanism needs to be established. This involves periodically crawling the official websites of various disk manufacturers to monitor the updates to SMART-related documents. Once an update is detected, it should be automatically synchronized to the knowledge base and the data updated. Furthermore, considering the differences in the definitions of SMART attributes among different manufacturers (e.g., different names, IDs, or physical meanings for the same attribute), a unified attribute mapping relationship needs to be established to achieve standardized correspondence of attributes across manufacturers. In addition, the thresholds for some SMART attributes may change with disk firmware version updates. Therefore, firmware version information needs to be monitored and recorded during data collection and storage to ensure that the threshold data matches the corresponding firmware version, avoiding threshold invalidation issues caused by firmware updates.
[0159] Figure 4 A schematic diagram of a disk health status detection device based on SMART information provided in an embodiment of the present invention includes:
[0160] The information collection module 11 is used to collect disk attribute information of different identity information; wherein, the identity information includes disk model and disk manufacturer;
[0161] The structuring module 12 is used to extract attribute information corresponding to the target SMART field from the disk attribute information using the target large language model, so as to obtain structured SMART information;
[0162] Information storage module 13 is used to determine the index of the structured SMART information from the identity information and store the structured SMART information in a MongoDB database;
[0163] The health monitoring module 14 is used to search for target SMART information from the MongoDB database based on the target identity information of the disk to be tested, and to perform health status detection on the disk to be tested based on the target SMART information to obtain a health status result.
[0164] Furthermore, embodiments of this application also disclose an electronic device, Figure 5 This is a structural diagram of an electronic device according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the disk health status detection method based on SMART information disclosed in any of the foregoing embodiments. Furthermore, the electronic device in this embodiment may specifically be an electronic computer.
[0165] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0166] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0167] The operating system 221 is used to manage and control the various hardware devices on the electronic device and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the disk health status detection method based on SMART information executed by the electronic device as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0168] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disk health status detection method based on SMART information. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0169] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0170] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can 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.
[0171] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0172] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0173] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A disk health status detection method based on SMART information, characterized in that, include: Collect disk attribute information for different identities; wherein, the identity information includes disk model and disk manufacturer; The target large language model is used to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information; The identity information is used to determine the index of the structured SMART information, and the structured SMART information is stored in the MongoDB database; Based on the target identity information of the disk to be tested, the target SMART information is retrieved from the MongoDB database, and the health status of the disk to be tested is detected based on the target SMART information to obtain the health status result.
2. The disk health status detection method based on SMART information according to claim 1, characterized in that, The disk attribute information collected for different identity information includes: Collect original disk attribute information corresponding to different disk models and manufacturers; wherein, the disk attribute information includes SMART white paper, technical specifications, and product data sheets; Use a preset parsing tool to extract text data and / or tabular data from the original disk attribute information; The text data and / or the table data are cleaned to obtain the cleaned disk attribute information.
3. The disk health status detection method based on SMART information according to claim 1, characterized in that, The step of extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model to obtain structured SMART information includes: Set the target SMART field and prompt words; wherein, the target SMART field includes the identity information and SMART information, the SMART information includes attribute identifier, attribute name, attribute description and SMART threshold, and the prompt words represent the fields and formats of the attribute information to be extracted; The target large language model and the prompt words are used to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information.
4. The disk health status detection method based on SMART information according to claim 3, characterized in that, The prompt words include the attribute name, an example of attribute information extraction, and the attribute information extraction logic; The step of extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model and the prompt words to obtain structured SMART information includes: The extraction logic and examples of the attribute information are used to guide the target large language model to extract the attribute information corresponding to the target SMART field from the disk attribute information to obtain structured SMART information; wherein, the structured SMART information includes the attribute name.
5. The disk health status detection method based on SMART information according to claim 1, characterized in that, The step of extracting attribute information corresponding to the target SMART field from the disk attribute information using the target large language model to obtain structured SMART information includes: The target large language model is used to extract attribute information corresponding to the target SMART field from the disk attribute information to obtain the first SMART information; JSON Schema is used to define field type constraints to perform format validation on the first SMART information and remove attribute information in the first SMART information that does not conform to the preset format to obtain the second SMART information; wherein, the preset format is JSON format; The numerical SMART information in the second SMART information is converted to integers, and abnormal data in the second SMART information is removed to obtain the converted SMART information; wherein, the abnormal data is the numerical SMART information in the second SMART information that failed to be converted. The converted SMART information is standardized in units to obtain standardized SMART information. Then, the names of SMART information belonging to the same attribute but with different attribute names in the standardized SMART information are standardized to obtain structured SMART information.
6. The disk health status detection method based on SMART information according to any one of claims 1 to 5, characterized in that, The step of storing the structured SMART information in a MongoDB database includes: If there are multiple source objects for the current structured SMART information under the same identity information, then compare whether the current structured SMART information belonging to different source objects is consistent; If the current structured SMART information belonging to different source objects is consistent, then the current structured SMART information is stored in the MongoDB database.
7. The disk health status detection method based on SMART information according to claim 1, characterized in that, The step of retrieving target SMART information from the MongoDB database based on the target identity information of the disk to be detected includes: Retrieve the current query command returned by the preset natural language query interface; The current query command is segmented using the word segmenter of the target retrieval tool to obtain the target identity information of the disk to be detected; The target SMART information is retrieved from the MongoDB database based on the target identity information of the disk to be tested.
8. A disk health status detection device based on SMART information, characterized in that, include: The information collection module is used to collect disk attribute information of different identity information; wherein, the identity information includes disk model and disk manufacturer; The structuring module is used to extract attribute information corresponding to the target SMART field from the disk attribute information using the target large language model, so as to obtain structured SMART information; An information storage module is used to determine the index of the structured SMART information from the identity information and store the structured SMART information in a MongoDB database; The health monitoring module is used to search for target SMART information from the MongoDB database based on the target identity information of the disk to be tested, and to perform health status detection on the disk to be tested based on the target SMART information to obtain a health status result.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the disk health status detection method based on SMART information as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the disk health status detection method based on SMART information as described in any one of claims 1 to 7.