Solid state disk identification method and device and electronic equipment

By obtaining the TRIM characteristics, seeking cost and speed parameters of solid-state drives, and calculating the recognition probability in combination with Bayesian formula, the problem of not being able to identify new models of solid-state drives in the existing technology is solved, and accurate identification and high reliability are achieved without database updates. Sexual identification.

CN119200947APending Publication Date: 2024-12-27GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310756078.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing solid-state drive identification methods cannot accurately identify new models or have not entered the solid-state drive, and rely on the update of the solid-state drive database, and cannot identify new models of solid-state drives in real time.

Method used

By obtaining the TRIM characteristic parameters, cost parameters and speed parameters of the disk to be identified, the probability of the disk being a solid state hard disk is calculated based on the Bayesian formula. If the probability is greater than the preset threshold, it is determined as a solid state hard disk, so as to achieve identification without database updates.

Benefits of technology

It improves the accuracy and reliability of SSD recognition, and can accurately identify SSDs without considering the update of SSD database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119200947A_ABST
    Figure CN119200947A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of solid state disks, and discloses a solid state disk identification method and device and electronic equipment. The method comprises the following steps: acquiring disk parameters from a disk to be identified, wherein the disk parameters comprise TRIM characteristic parameters, track seeking cost parameters and rotating speed parameters; according to the TRIM characteristic parameter, the track seeking cost parameter and the rotating speed parameter, detecting whether the to-be-identified disk meets the characteristics of a solid state disk or not; and if the characteristics of the solid state disk are met, determining that the to-be-identified disk is the solid state disk. According to the method, the accuracy of identifying the solid state disk is improved, and the method has relatively high reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of solid-state hard disks, and in particular to a solid-state hard disk identification method, device and electronic device. Background Art

[0002] Solid State Drive (SSD) is a storage device that uses flash storage technology and can be used to replace traditional mechanical hard disk drives (HDDs). Compared to HDDs, SSDs have faster read and write speeds, lower access times, higher reliability, and lower energy consumption. The life of SSDs has always been a topic of concern. Each SSD has a limit on the number of erases and writes. Once the limit is reached, the flash memory chip will fail. If data is frequently written to the SSD, the life of the SSD will be accelerated. The prerequisite for solving the problem of frequent writes to the SSD is to be able to accurately identify the SSD. The current method of identifying SSDs is to obtain the model of the disk and match it with a known solid-state drive database. If the model is in the solid-state drive database, it is determined that the disk is a solid-state drive, otherwise it is not a solid-state drive.

[0003] However, the SSD database needs to be updated regularly. If the SSD database included in the software cannot be updated, this method can only detect SSDs whose models have been entered into the SSD database, and cannot identify new models of SSDs and models not included in the SSD database. Summary of the invention

[0004] The main technical problem solved by the implementation methods of the present application is how to accurately identify a solid state drive.

[0005] In order to solve the above technical problems, a technical solution adopted in the implementation mode of the present application is: providing a solid-state hard disk identification method, including: obtaining disk parameters from the disk to be identified, the disk parameters including TRIM characteristic parameters, seek cost parameters and rotation speed parameters; detecting whether the disk to be identified meets the characteristics of a solid-state hard disk according to the TRIM characteristic parameters, the seek cost parameters and the rotation speed parameters; if the characteristics of the solid-state hard disk are met, determining that the disk to be identified is a solid-state hard disk.

[0006] In some embodiments, acquiring disk parameters from the disk to be identified includes: communicating with the disk to be identified based on an ATA protocol to acquire the disk parameters of the disk to be identified.

[0007] In some embodiments, the detecting whether the disk to be identified meets the characteristics of a solid-state hard disk according to the TRIM characteristic parameter, the seek cost parameter, and the rotation speed parameter includes:

[0008] Determine whether the TRIM feature is supported according to the TRIM feature parameter, determine whether the seek cost is zero according to the seek cost parameter, and determine whether the rotation speed is less than a preset threshold according to the rotation speed parameter;

[0009] When the disk to be identified meets at least two of the TRIM support feature, the seek cost is zero, and the rotation speed is less than a preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state drive; otherwise, it does not meet the characteristics of a solid-state drive.

[0010] In some embodiments, before executing the step of obtaining disk parameters from the disk to be identified, the method further includes: obtaining sample parameters of hard disks supporting SATA interface; counting a first probability of all hard disks supporting TRIM instructions, a second probability of a rotation speed of 0 or 1, and a third probability of having a seek cost according to the sample parameters; counting a fourth probability of solid-state hard disks supporting TRIM instructions, a fifth probability of a rotation speed of 0 or 1, and a sixth probability of having a seek cost according to the sample parameters;

[0011] Among them, the detecting whether the disk to be identified meets the characteristics of a solid-state hard disk according to the TRIM characteristic parameters, the seek cost parameters and the rotation speed parameters includes: calculating the probability that the disk to be identified is the solid-state hard disk according to the first probability, the second probability and the third probability, and the fourth probability, the fifth probability and the sixth probability; when the probability is greater than a preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state hard disk, otherwise, it does not meet the characteristics of a solid-state hard disk.

[0012] In some embodiments, the calculating the probability that the disk to be identified is the solid-state drive according to the first probability, the second probability, the third probability, and the fourth probability, the fifth probability, and the sixth probability includes: calculating the probability that the disk to be identified is the solid-state drive based on a Bayesian formula, and the Bayesian formula is:

[0013] P(SSD|TRIM, speed, seek cost) = P(TRIM|SSD)*P(speed=0 or 1|SSD)*P(seek cost|SSD)*P(SSD) / P(TRIM)*P(speed=0 or 1)*P(seek cost);

[0014] Among them, P(SSD) is the prior probability of a solid state drive; P(TRIM), P(rotation speed = 0 or 1) and P(seek cost) correspond to the first probability, the second probability and the third probability respectively; P(TRIM|SSD), P(rotation speed = 0 or 1|SSD) and P(seek cost|SSD) correspond to the fourth probability, the fifth probability and the sixth probability respectively; P(SSD|TRIM, rotation speed, seek cost) is the probability that the disk to be identified is the solid state drive.

[0015] In some embodiments, the method further includes: when the disk to be identified is identified as a solid state drive, controlling data writing to the solid state drive.

[0016] In order to solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide a solid-state hard disk identification device, including: a disk parameter acquisition module, used to obtain disk parameters from the disk to be identified, the disk parameters include TRIM characteristic parameters, seek cost parameters and rotation speed parameters; a solid-state hard disk detection module, used to detect whether the disk to be identified meets the characteristics of a solid-state hard disk according to the TRIM characteristic parameters, the seek cost parameters and the rotation speed parameters, and if the characteristics of the solid-state hard disk are met, it is determined that the disk to be identified is a solid-state hard disk.

[0017] In some embodiments, the disk parameter acquisition module is specifically used to: communicate with the disk to be identified based on the ATA protocol to acquire the disk parameters of the disk to be identified.

[0018] In some embodiments, the solid state drive detection module is specifically used to:

[0019] Determine whether the TRIM feature is supported according to the TRIM feature parameter, determine whether the seek cost is zero according to the seek cost parameter, and determine whether the rotation speed is less than a preset threshold according to the rotation speed parameter;

[0020] When the disk to be identified meets at least two of the following conditions: supporting TRIM feature, the seek cost is zero, and the rotation speed is less than a preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state hard disk; otherwise, the disk does not meet the characteristics of a solid-state hard disk;

[0021] If the solid state hard disk characteristics are met, it is determined that the disk to be identified is a solid state hard disk.

[0022] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0023] Different from the related art, the solid-state hard disk identification method, device and electronic device provided in the embodiments of the present application mainly identify whether the disk is a solid-state hard disk through TRIM characteristic parameters, seek cost parameters and rotation speed parameters, and there is no need to consider the software update of the solid-state hard disk database. The solid-state hard disk identification method, device and electronic device provided in the embodiments of the present application improve the accuracy of identifying solid-state hard disks, and the implementation methods of the present application have strong reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0025] Figure 1 is a schematic flow chart of a solid state drive identification method provided in an embodiment of the present application;

[0026] Figure 2 is a structural schematic diagram of a solid state drive identification device provided in an embodiment of the present application;

[0027] Figure 3 Schematic diagram of the hardware structure of an electronic device 30 for executing a solid state drive identification method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0029] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.

[0030] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0031] The solid state drive identification method provided in the embodiment of the present application can improve the detection accuracy of the solid state drive. Figure 1 The embodiments of the present application are described in detail.

[0032] Figure 1 It is a schematic flow chart of the solid state drive identification method provided in an embodiment of the present application. Figure 1 The method may be executed by a storage array, for example, may be executed by a processor in the storage array where the disk is located. Figure 1 The method may include steps 101 to 103.

[0033] In step 101, disk parameters are obtained from a disk to be identified, wherein the disk parameters include TRIM characteristic parameters, seek cost parameters, and rotation speed parameters.

[0034] The disk to be identified belongs to a hardware device for storing data in a computer, and may specifically include a mechanical hard disk, a solid-state hard disk, an optical disk, etc. In the embodiment of the present application, the solid-state hard disk is mainly determined from the disk to be identified. The disk parameters refer to the physical and performance characteristics of the hard disk drive, which can have a significant impact on the performance and reliability of the disk. The disk parameters include capacity, rotation speed, interface type, cache size, seek time, rotational delay, mean time between failures (MTBF) and error correction code (ECC), etc. These parameters can be used to evaluate the performance, reliability and applicability of the disk. For example, the capacity determines how much data the disk can store, the rotation speed and cache size determine the data read and write speed, and the MTBF can be used to evaluate the reliability of the disk.

[0035] In an embodiment of the present application, the disk parameters include TRIM characteristic parameters, seek cost parameters, and rotation speed parameters. TRIM characteristic parameters refer to solid-state drive (SSD) parameters related to TRIM, which can be configured by the driver or operating system of the solid-state drive. TRIM is an instruction sent by the operating system to the SSD to inform the SSD which data blocks have been deleted so that the SSD can erase these blocks and reuse them when needed, which helps to improve the performance and life of the SSD. TRIM feature parameters include TRIM support (referring to whether the SSD supports TRIM instructions. If the SSD does not support TRIM, the operating system cannot send TRIM instructions, which may cause the performance of the SSD to deteriorate), TRIM delay (referring to how long it takes for the SSD to complete the corresponding operation after receiving the TRIM instruction. A shorter TRIM delay can improve the performance of the SSD), TRIM queue depth (referring to the number of TRIM instructions that the SSD can process at the same time. A larger TRIM queue depth can improve the performance of the SSD), TRIM optimization (referring to whether the SSD is optimized for TRIM. If the SSD supports TRIM optimization, the performance and life of the SSD can be improved by optimizing the TRIM operation), TRIM secure erase (referring to whether the SSD supports secure erase using TRIM instructions. Secure erase can ensure that the data on the SSD cannot be recovered, thereby protecting the user's privacy and sensitive information). In an embodiment of the present application, the TRIM feature parameter may specifically be TRIM support.

[0036] The seek cost parameter refers to the time and cost required for the head to move from one track to another when reading or writing data. This parameter is usually used to measure the performance of the disk, because the seek cost is one of the most important components of the disk access time. The seek cost is affected by many factors, including the movement speed of the head, the rotation speed of the disk, the position of the head and the position of the target track. The head usually needs to move a certain distance on the disk surface to reach the target track. The longer the distance, the higher the seek cost.

[0037] The rotational speed parameter usually refers to the rotational speed of the hard disk drive (HDD), which is expressed in the number of platter rotations per minute. The higher the rotational speed parameter, the faster the data can be read and written.

[0038] The main purpose of the embodiment of the present application is to detect the solid-state hard disk from the disk to be identified, that is, to distinguish the solid-state hard disk from the mechanical hard disk from the disk to be identified. It can be known that the storage medium of the mechanical hard disk is a rotating disk, and the reading and writing of data requires the help of a moving read-write head to perform a seek operation, so generally speaking, the rotation speed parameter value of the mechanical disk is relatively large, and the solid-state hard disk uses a flash memory chip as the storage medium, and there is no rotating disk, so the rotation speed parameter value of the solid-state hard disk is usually 0 or 1. The storage medium of the mechanical hard disk is a rotating disk, and the reading and writing of data requires the help of a moving read-write head to perform a seek operation, and this seek operation takes a certain amount of time, so generally speaking, the mechanical disk has a seek cost, and the solid-state hard disk uses a flash memory chip as the storage medium, so the solid-state hard disk usually has no seek cost. In addition, the flash memory chips used in solid-state drives have a limited number of erase and write cycles. Once the limit is reached, the flash memory chip will become invalid. When deleting files, many write operations will occur, so solid-state drives usually use the TRIM feature when deleting files. The TRIM feature means that when the disk deletes files, it does not actually delete the data first, but records the address of the data block to be deleted in the delete queue of the main control chip, and deletes the file at one time when it is idle or when the delete queue is full, reducing the number of erase and write cycles. Therefore, solid-state drives usually support the TRIM feature.

[0039] In the embodiment of the present application, both the solid-state drive and the mechanical hard disk use the SATA (Serial Advanced Technology Attachment) interface. The SATA interface is a data transmission interface standard between storage devices such as computer hard disk drives and optical disk drives and computer motherboards. It is a serial interface used to replace the early parallel ATA interface (also known as the IDE interface).

[0040] The obtaining of disk parameters from the disk to be identified includes: communicating with the disk to be identified based on the ATA protocol to obtain the disk parameters of the disk to be identified. The ATA protocol specifies the data transmission standards and interface specifications between the hard disk and the motherboard, including aspects such as data transmission rate, command set, and data transmission mode. The TRIM characteristic parameters, seek cost parameters, and rotation speed parameters of the disk to be identified can be queried in the application by communicating with the disk to be identified using the ATA protocol. The application can be a system application or a third-party application.

[0041] The process of communicating with the disk to be identified based on the ATA protocol to obtain disk parameters includes: connecting the disk to be identified to the computer, which can be connected through the SATA interface or other interfaces such as IDE; starting the computer and confirming whether the disk is identified in the BIOS; then using the IDENTIFY command in the ATA protocol to send a request to the disk to obtain basic parameter information of the disk, such as disk size, model, serial number, interface type, TRIM characteristic parameters, seek cost parameters and rotation speed parameters; then the disk can reply to the IDENTIFY command and return the response data to the computer, and the computer parses the data to obtain the disk parameters. Among them, different commands in the ATA protocol can be used to obtain the disk parameters corresponding to the command.

[0042] In step 102, it is detected whether the disk to be identified meets the characteristics of a solid state drive according to the TRIM characteristic parameter, the seek cost parameter and the rotation speed parameter.

[0043] In an embodiment of the present application, whether the TRIM feature is supported is determined according to the TRIM feature parameter, whether the seek cost is zero is determined according to the seek cost parameter, and whether the rotation speed is less than a preset threshold is determined according to the rotation speed parameter; when the disk to be identified satisfies at least two of the support for the TRIM feature, the seek cost is zero, and the rotation speed is less than the preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state hard disk, otherwise it does not meet the characteristics of a solid-state hard disk.

[0044] Among them, since the solid state drive has no rotating parts and uses flash memory storage technology, it does not need to rotate to read or write data. Therefore, the above preset threshold can be other values ​​such as 2.

[0045] In step 103, if the solid state drive characteristics are met, it is determined that the disk to be identified is a solid state drive.

[0046] When the disk to be identified meets at least two of the following conditions: supporting the TRIM feature, having a seek cost of zero, and having a rotation speed less than a preset threshold, it is determined that the disk to be identified is a solid state drive.

[0047] The embodiment of the present application analyzes the characteristics of the solid-state drive, obtains the disk parameters it supports, and determines whether it is a solid-state drive based on the disk parameters. The method does not rely on the solid-state drive database, is not affected by database updates, can accurately identify the solid-state drive, and has good reliability.

[0048] In some embodiments, based on the above three disk parameters, it is also possible to determine whether the disk to be identified is a solid-state drive based on a probability statistics method. Specifically, the method further includes: before executing the above step of obtaining disk parameters from the disk to be identified, the method further includes: obtaining sample parameters of hard disks that support SATA interface; according to the sample parameters, counting the first probability of all hard disks supporting TRIM instructions, the second probability of a rotation speed of 0 or 1, and the third probability of having a seek cost; according to the sample parameters, counting the fourth probability of solid-state drives supporting TRIM instructions, the fifth probability of a rotation speed of 0 or 1, and the sixth probability of having a seek cost.

[0049] Among them, the sample parameters of the hard disk supporting the SATA interface refer to the above three disk parameters corresponding to all hard disks (including solid-state hard disks and mechanical hard disks). The three disk parameters of the existing hard disks supporting the SATA interface on the market can be counted in large quantities, and the first probability of all hard disks supporting the TRIM instruction, the second probability of all hard disks having a rotation speed of 0 or 1, the third probability of all hard disks having a seek cost, the fourth probability of all hard disks supporting the TRIM instruction among solid-state hard disks, the fifth probability of solid-state hard disks having a rotation speed of 0 or 1, and the sixth probability of solid-state hard disks having a seek cost can be counted.

[0050] The embodiment of the present application regards support for TRIM instructions, rotation speed, and seek cost as three features, and then uses a naive Bayes classifier to estimate the probability that the hard disk is a solid-state drive.

[0051] Specifically, detecting whether the disk to be identified meets the characteristics of a solid-state hard disk based on the TRIM characteristic parameters, the seek cost parameters and the rotation speed parameters includes: calculating the probability that the disk to be identified is the solid-state hard disk based on the first probability, the second probability and the third probability, and the fourth probability, the fifth probability and the sixth probability; when the probability is greater than a preset threshold, determining that the disk to be identified meets the characteristics of a solid-state hard disk, otherwise, it does not meet the characteristics of a solid-state hard disk.

[0052] The calculating the probability that the disk to be identified is the solid-state hard disk according to the first probability, the second probability, the third probability, and the fourth probability, the fifth probability, and the sixth probability includes: calculating the probability that the disk to be identified is the solid-state hard disk based on the Bayesian formula, and the Bayesian formula is:

[0053] P(SSD|TRIM, speed, seek cost) = P(TRIM|SSD)*P(speed=0 or 1|SSD)*P(seek cost|SSD)*P(SSD) / P(TRIM)*P(speed=0 or 1)*P(seek cost);

[0054] Among them, P(SSD) is the prior probability of a solid state drive; P(TRIM), P(rotation speed = 0 or 1) and P(seek cost) correspond to the first probability, the second probability and the third probability respectively; P(TRIM|SSD), P(rotation speed = 0 or 1|SSD) and P(seek cost|SSD) correspond to the fourth probability, the fifth probability and the sixth probability respectively; P(SSD|TRIM, rotation speed, seek cost) is the probability that the disk to be identified is the solid state drive.

[0055] Among them, P(SSD) refers to the probability that the hard disk type is a solid-state drive among all hard disks. In the training data, P(SSD) can be estimated by counting the number of hard disk types. Specifically, the types of all hard disks in the data set are counted, and then the proportion of the number of solid-state drives to the total number of hard disks is calculated to obtain P(SSD). For example, assuming that there are 1,000 hard disks in the training data set, of which 200 are solid-state drives and 800 are mechanical hard disks, the estimated value of P(SSD) is 200 / 1000=0.2, that is, the proportion of solid-state drives is 20%. It should be noted that the training data set should be representative and contain sufficient hard disk samples to ensure the accuracy and reliability of the estimation results.

[0056] The above-mentioned embodiment adopts the method of machine learning classifier to identify whether the disk to be identified is a solid-state hard disk based on the three disk parameters of TRIM characteristic parameters, seek cost parameters and rotation speed parameters, thereby enriching the identification method of solid-state hard disks. In addition, since the identification of hard disk types usually needs to consider multiple features and factors, such as support for TRIM instructions, rotation speed, seek cost, etc., there are certain correlations and dependencies between these features. The embodiment of the present application adopts a naive Bayes classifier to reasonably combine and weight these features, thereby obtaining a more reasonable classification result, and the reasons and basis for the classification result can be explained according to the conditional probability value, thereby improving the interpretability and credibility of the classification result.

[0057] In some embodiments, after identifying that the disk is a solid-state drive, the above method further includes: controlling data writing to the solid-state drive. Data writing to the solid-state drive can be controlled by enabling TRIM features, reducing file fragmentation, disabling virtual memory, selecting a non-system disk when installing an application, disabling write cache, and the like. These methods for controlling data writing to the solid-state drive can be selected appropriately according to requirements and hardware configuration, etc. Thus, the service life of the solid-state drive can be extended, system stability can be enhanced, the performance of the solid-state drive can be improved, and energy consumption can be saved.

[0058] Figure 22 is a schematic diagram of the structure of a solid state disk identification device provided in an embodiment of the present application. The solid state disk identification device 20 comprises: a disk parameter acquisition module 21 and a solid state disk detection module 22.

[0059] The disk parameter acquisition module 21 is used to obtain disk parameters from the disk to be identified, and the disk parameters include TRIM characteristic parameters, seek cost parameters and rotation speed parameters; the solid-state hard disk detection module 22 is used to detect whether the disk to be identified meets the characteristics of a solid-state hard disk based on the TRIM characteristic parameters, the seek cost parameters and the rotation speed parameters. If the characteristics of the solid-state hard disk are met, it is determined that the disk to be identified is a solid-state hard disk.

[0060] The disk parameter acquisition module 21 is specifically used to communicate with the disk to be identified based on the ATA protocol to acquire the disk parameters of the disk to be identified.

[0061] The solid-state hard disk detection module 22 is specifically used to: determine whether the TRIM feature is supported according to the TRIM feature parameters, determine whether the seek cost is zero according to the seek cost parameters, and determine whether the rotation speed is less than a preset threshold according to the rotation speed parameters; when the disk to be identified satisfies at least two of the support of the TRIM feature, the seek cost is zero, and the rotation speed is less than the preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state hard disk, otherwise it does not meet the characteristics of a solid-state hard disk; if the characteristics of the solid-state hard disk are met, it is determined that the disk to be identified is a solid-state hard disk.

[0062] It should be noted that the above-mentioned solid-state drive identification device can execute the solid-state drive identification method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the embodiment of the solid-state drive identification device, please refer to the solid-state drive identification method provided in the embodiment of the present application.

[0063] Figure 3 is a hardware structure diagram of an electronic device 30 for executing a solid state drive identification method provided in an embodiment of the present application, such as Figure 3 As shown, the electronic device 30 includes:

[0064] One or more processors 31 and memory 32, Figure 3 A processor 31 is taken as an example.

[0065] The processor 31 and the memory 32 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0066] The memory 32 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the solid-state drive identification method in the embodiment of the present application (for example, the attached Figure 2 The processor 31 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, the solid-state hard disk identification method of the above method embodiment is implemented.

[0067] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the solid-state hard disk identification device, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 32 may optionally include a memory remotely arranged relative to the processor 31, and these remote memories may be connected to the solid-state hard disk identification 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.

[0068] The one or more modules are stored in the memory 32, and when executed by the one or more processors 31, the solid state drive identification method in any of the above method embodiments is executed, for example, the solid state drive identification method described above is executed. Figure 1 Method steps and implementation in Figure 2 The functions of the modules in .

[0069] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0070] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to: storage arrays; servers, storage devices, network devices, etc. deployed with storage arrays.

[0071] The embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, such as Figure 3 A processor 31 in the embodiment may enable the one or more processors to execute the solid state drive identification method in any of the above method embodiments, for example, to execute the above described Figure 1 Method steps and implementation in Figure 2 The functions of the modules in .

[0072] The present application provides a computer program product, wherein the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by the electronic device, the electronic device is enabled to execute the solid-state hard disk identification method in any of the above method embodiments, for example, to execute the above described Figure 1 Method steps and implementation in Figure 2 The functions of the modules in .

[0073] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0074] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A solid state hard disk identification method, characterized in that: include: Obtaining disk parameters from the disk to be identified, wherein the disk parameters include TRIM characteristic parameters, seek cost parameters, and rotation speed parameters; Detecting whether the disk to be identified meets the characteristics of a solid-state hard disk according to the TRIM characteristic parameter, the seek cost parameter, and the rotation speed parameter; If the solid state hard disk characteristics are met, it is determined that the disk to be identified is a solid state hard disk.

2. The method according to claim 1, characterized in that: The obtaining of disk parameters from the disk to be identified comprises: Communicate with the disk to be identified based on the ATA protocol to obtain disk parameters of the disk to be identified.

3. The method according to claim 1, characterized in that The detecting whether the disk to be identified meets the characteristics of a solid-state hard disk according to the TRIM characteristic parameter, the seek cost parameter and the rotation speed parameter comprises: Determine whether the TRIM feature is supported according to the TRIM feature parameter, determine whether the seek cost is zero according to the seek cost parameter, and determine whether the rotation speed is less than a preset threshold according to the rotation speed parameter; When the disk to be identified meets at least two of the TRIM support feature, the seek cost is zero, and the rotation speed is less than a preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state drive; otherwise, it does not meet the characteristics of a solid-state drive.

4. The method according to claim 1, characterized in that: Before executing the step of obtaining disk parameters from the disk to be identified, the method further includes: Get sample parameters of hard disks supporting SATA interface; According to the sample parameters, a first probability of all hard disks supporting the TRIM command, a second probability of a rotation speed of 0 or 1, and a third probability of having a seek cost are counted; According to the sample parameters, a fourth probability that the solid state drive supports the TRIM command, a fifth probability that the rotation speed is 0 or 1, and a sixth probability that the solid state drive has a seek cost are counted; The step of detecting whether the disk to be identified meets the characteristics of a solid state drive according to the TRIM characteristic parameter, the seek cost parameter, and the rotation speed parameter includes: Calculate the probability that the disk to be identified is the solid state drive according to the first probability, the second probability, the third probability, and the fourth probability, the fifth probability, and the sixth probability; When the probability is greater than a preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state hard disk; otherwise, it does not meet the characteristics of a solid-state hard disk.

5. The method according to claim 4, characterized in that The calculating the probability that the disk to be identified is the solid state drive according to the first probability, the second probability, the third probability, and the fourth probability, the fifth probability, and the sixth probability includes: The probability that the disk to be identified is the solid state drive is calculated based on the Bayesian formula, and the Bayesian formula is: P(SSD|TRIM, speed, seek cost) = P(TRIM|SSD)*P(speed=0 or 1|SSD)*P(seek cost|SSD)*P(SSD) / P(TRIM)*P(speed=0 or 1)*P(seek cost); Among them, P(SSD) is the prior probability of a solid state drive; P(TRIM), P(rotation speed = 0 or 1) and P(seek cost) correspond to the first probability, the second probability and the third probability respectively; P(TRIM|SSD), P(rotation speed = 0 or 1|SSD) and P(seek cost|SSD) correspond to the fourth probability, the fifth probability and the sixth probability respectively; P(SSD|TRIM, rotation speed, seek cost) is the probability that the disk to be identified is the solid state drive.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When it is identified that the disk to be identified is a solid state hard disk, data writing of the solid state hard disk is controlled.

7. A solid state hard disk identification device, characterized in that: include: A disk parameter acquisition module, used to acquire disk parameters from the disk to be identified, wherein the disk parameters include TRIM characteristic parameters, seek cost parameters and rotation speed parameters; The solid state drive detection module is used to detect whether the disk to be identified meets the characteristics of a solid state drive according to the TRIM characteristic parameters, the seek cost parameters and the rotation speed parameters. If the characteristics of the solid state drive are met, it is determined that the disk to be identified is a solid state drive.

8. The device according to claim 7, characterized in that The disk parameter acquisition module is specifically used to communicate with the disk to be identified based on the ATA protocol to acquire the disk parameters of the disk to be identified.

9. The device according to claim 7, characterized in that The solid state drive detection module is specifically used for: Determine whether the TRIM feature is supported according to the TRIM feature parameter, determine whether the seek cost is zero according to the seek cost parameter, and determine whether the rotation speed is less than a preset threshold according to the rotation speed parameter; When the disk to be identified meets at least two of the following conditions: supporting TRIM feature, the seek cost is zero, and the rotation speed is less than a preset threshold, it is determined that the disk to be identified meets the characteristics of a solid-state hard disk; otherwise, the disk does not meet the characteristics of a solid-state hard disk; If the solid state hard disk characteristics are met, it is determined that the disk to be identified is a solid state hard disk.

10. An electronic device, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1 to 6.