Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: acquiring an execution code issued by a Host; sending the execution code to the controller; and updating codes of the controller based on the execution codes so as to realize the functions corresponding to the execution codes. Through the mode, the function of the controller in the Open-Channel SSD is determined by the execution code issued by the Host, compared with the prior art that the function of the SSD controller is determined by the function of the SSD controller, the embodiment of the invention can enable the SSD controller to have more functions and enable the Host to issue more functions, thereby improving the flexibility of Host Open-Channel management and improving the flexibility of solid state disk Open-Channel management.
In the embodiment of the present invention, it is considered that, in the existing related scheme, the idea of the Open Channel is to move the service logic originally belonging to the FTL (Flash Translation Layer) to the system service Layer, but the service logic still needs the SSD (Solid State Disk) controller (controller) to support itself, however, due to the limitation of the SSD controller itself, the system service Layer cannot design diversified operations, that is, the interface provided to the FTL still has limitation, thereby resulting in the inflexible management of the Open-Channel of the Solid State Disk.
The technical wording related to the embodiment of the invention is as follows:
SSD (Solid State Disk or Solid State Drive, SSD for short), also called Solid State Drive, is a hard Disk made of Solid State electronic memory chip array. The storage media of the solid state disk are divided into two types, one is to adopt a FLASH memory (FLASH chip) as a storage medium, the other is to adopt a DRAM as a storage medium, and the latest is to adopt an Intel XPoint particle technology. Solid state disk based on flash memory: the appearance of the FLASH chip can be made into various patterns by adopting the FLASH chip as a storage medium, such as: notebook hard disks, micro hard disks, memory cards, U disks and the like. The SSD solid state disk has the greatest advantages of being movable, being free of power control for data protection, being suitable for various environments and being suitable for individual users. The service life is longer, and the service life is different according to different flash memory media. SLC flash memory reaches more than 3000 PE of ten thousand times generally, MLC has reached about 1000 times too, the life-span of 300 times can also be guaranteed to the latest QLC, the write-in amount of a common user one year does not exceed 50 times of the total size of the hard disk, even the QLC flash memory of cheapest price, can provide the write-in life-span of 6 years. The reliability is very high, and the high-quality household solid state hard disk can easily reach the fault rate of one tenth of the common household mechanical hard disk.
Referring to fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal in the embodiment of the present invention is a hard disk management device, and the hard disk management device may be a terminal device having a processing function, such as a PC (personal computer), a microcomputer, a notebook computer, and a server.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a computer program.
In the terminal shown in fig. 1, applied to a solid state disk SSD, where the Open-Channel SSD includes a controller, the processor 1001 may be configured to call a computer program stored in the memory 1005, and perform the following operations:
acquiring an execution code issued by a Host;
sending the execution code to the controller;
and updating codes of the controller based on the execution codes so as to realize functions corresponding to the execution codes.
Further, the controller comprises a plurality of microcontroller MCUs, and the processor 1001 may be configured to call up a computer program stored in the memory 1005, and further perform the following operations:
determining the MCU to be updated required to be issued by the execution code;
and sending the execution code to the MCU to be updated.
Further, the processor 1001 may be configured to invoke the computer program stored in the memory 1005 to also perform the following operations:
and updating the codes of the MCU to be updated based on the execution codes.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes.
In the terminal shown in fig. 1, applied to Host, the processor 1001 may be configured to call up a computer program stored in the memory 1005 and perform the following operations:
compiling the code based on the function requirement to obtain an execution code;
and sending the execution code to an Open-Channel SSD (solid state disk), so that the Open-Channel SSD updates the code of a controller of the Open-Channel SSD based on the execution code, and the function corresponding to the execution code is realized.
Further, the processor 1001 may be configured to invoke the computer program stored in the memory 1005 to also perform the following operations:
determining the MCU to be updated required to be issued by the execution code;
and issuing the execution code to the MCU to be updated so that the Open-Channel SSD carries out code updating on the MCU to be updated based on the execution code.
Based on the hardware structure, the invention provides various embodiments of the hard disk management method.
The invention provides a hard disk management method.
Referring to fig. 2, fig. 2 is a flowchart illustrating a hard disk management method according to a first embodiment of the present invention.
In this embodiment, the hard disk management method is applied to a solid state disk SSD, where the Open-Channel SSD includes a controller, and the hard disk management method includes:
step S10, acquiring an execution code issued by the Host;
in this embodiment, an execution code issued by the Host is obtained. The Host is a system service layer, that is, a service logic originally belonging to the FTL is moved to the system service layer.
It should be noted that the execution code is a code compiled by the host, and is used for the controller of the Open-Channel SSD to execute a corresponding function based on the execution code. The function executed by the execution code is not limited by the function of the controller, and can be set by the Host according to the requirement.
In addition, it should be noted that the function corresponding to the execution code may be a computing function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, or the like.
Correspondingly, the Host compiles a code based on the function requirement to obtain an execution code; and sending the execution code to an Open-Channel SSD (solid state disk), so that the Open-Channel SSD updates the code of a controller of the Open-Channel SSD based on the execution code, and the function corresponding to the execution code is realized. The functional requirements can be set according to actual needs, such as a computing function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, and the like. Correspondingly, the function corresponding to the execution code may be a computing function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, and the like. Further, the execution code is for a controller of the Open-Channel SSD to perform a corresponding function based on the execution code. The function executed by the execution code is not limited by the function of the controller, and can be set by the Host according to the requirement. It is understood that updating the code of the controller may cause the controller to subsequently execute the function corresponding to the executed code.
Further, the controller includes a plurality of micro controller MCUs, and the step of issuing the execution code to the solid state disk Open-Channel SSD includes:
determining the MCU to be updated required to be issued by the execution code; and issuing the execution code to the MCU to be updated so that the Open-Channel SSD carries out code updating on the MCU to be updated based on the execution code. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs. It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes. The MCU forms distributed nodes, so that backup can be carried out among the MCUs, functions of the MCU can be executed through other MCUs after one MCU is down, and the performance of the Open-Channel SSD is improved.
Step S20, sending the execution code to the controller;
in this embodiment, after the Open-Channel SSD receives an execution code issued by the host, the execution code is sent to the controller, so that the controller updates the code, thereby implementing a function corresponding to the execution code.
The controller is an SSD controller, which may be a control chip. The controller may comprise several core MCUs, i.e. the controller may comprise one MCU or a plurality of MCUs.
In one embodiment, the controller comprises a microcontroller MCU, and the step of sending the execution code to the controller comprises:
and sending the execution code to an MCU of the controller.
In another embodiment, the controller includes a plurality of microcontroller MCUs, and the step of transmitting the execution code to the controller includes:
determining the MCU to be updated required to be issued by the execution code; and sending the execution code to the MCU to be updated. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs. It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes. The MCU forms distributed nodes, so that backup can be carried out among the MCUs, functions of the MCU can be executed through other MCUs after one MCU is down, and the performance of the Open-Channel SSD is improved.
And step S30, updating codes of the controller based on the execution codes, so as to implement functions corresponding to the execution codes.
In the embodiment, the controller is updated based on the execution code, so as to implement the function corresponding to the execution code. Specifically, the MCU to be updated is subjected to code updating, so that the MCU to be updated subsequently executes the function corresponding to the executed code.
The function corresponding to the execution code may be a calculation function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, and the like. That is to say, the present embodiment does not specify what instruction corresponds to what function in advance, and the like, which means that the system service layer can compile the code executed by each core MCU in real time, and then issue the code to each core MCU, so that the multipoint MCU can update the code segments on line to meet the requirement of the required function.
The embodiment of the invention provides a hard disk management method, which is applied to a Solid State Disk (SSD). an Open-Channel SSD comprises a controller and a Host, wherein the controller is used for acquiring an execution code issued by the Host; sending the execution code to the controller; and updating codes of the controller based on the execution codes so as to realize the functions corresponding to the execution codes. Through the mode, the function of the controller in the Open-Channel SSD is determined by the execution code issued by the Host, compared with the prior art that the function of the SSD controller is determined by the function of the SSD controller, the embodiment of the invention can enable the SSD controller to have more functions and enable the Host to issue more functions, thereby improving the flexibility of Host Open-Channel management and improving the flexibility of solid state disk Open-Channel management.
Further, based on the first embodiment, a second embodiment of the hard disk management method of the present invention is provided.
In this embodiment, the controller includes a plurality of micro controller MCUs, and the step S20 includes:
step A21, determining the MCU to be updated which is required to be issued by the execution code;
and step A22, sending the execution code to the MCU to be updated.
In this embodiment, the MCU to be updated, which needs to be issued for executing the code, is determined, and then the executing code is sent to the MCU to be updated. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs.
It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Correspondingly, the step of updating the code of the controller based on the execution code comprises the following steps:
and step A31, updating the codes of the MCU to be updated based on the execution codes.
In this embodiment, the MCU to be updated is code-updated based on the execution code. The MCU to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or multiple MCUs for code updating.
In some embodiments, the controller comprises a plurality of microcontroller MCUs, and the step of sending the execution code to the controller comprises:
determining a plurality of MCUs to be updated, which are required to be issued by the execution code; and sending the execution code to the MCUs to be updated. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs for code updating.
Correspondingly, the step of updating the code of the controller based on the execution code comprises the following steps:
and updating the codes of the MCUs to be updated based on the execution codes. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs for code updating.
It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes. The MCU forms distributed nodes, so that backup can be carried out among the MCUs, functions of the MCU can be executed through other MCUs after one MCU is down, and the performance of the Open-Channel SSD is improved. That is, there are multiple control points for the controller, so that more different functions can be implemented.
In this embodiment, the function of the MCU in the Open-Channel SSD is determined by the execution code issued by the Host, and compared with the prior art in which the function is determined by the function of the SSD controller, the embodiment of the present invention can enable the SSD controller to have more functions and enable the Host to issue more functions, thereby improving the flexibility of the Host Open-Channel management and improving the flexibility of the solid state disk Open-Channel management. Meanwhile, the controller comprises a plurality of Micro Controller Units (MCUs), so that the performance of the Open-Channel of the solid state disk can be improved, and the flexibility of Host Open-Channel management and the flexibility of the Open-Channel management of the solid state disk are further improved.
The invention also provides a hard disk management method.
Referring to fig. 3, fig. 3 is a flowchart illustrating a hard disk management method according to a third embodiment of the present invention.
In this embodiment, the hard disk management method is applied to a Host, and the hard disk management method includes:
step S100, compiling codes based on functional requirements to obtain execution codes;
step S200, issuing the execution code to an Open-Channel SSD (solid state disk), so that the Open-Channel SSD updates a code of a controller of the Open-Channel SSD based on the execution code, and implements a function corresponding to the execution code.
In this embodiment, codes are compiled based on function requirements to obtain execution codes, and then the execution codes are issued to an Open-Channel SSD (solid state disk), so that the Open-Channel SSD updates codes of a controller of the Open-Channel SSD based on the execution codes, and realizes functions corresponding to the execution codes. The functional requirements can be set according to actual needs, such as a computing function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, and the like. Correspondingly, the function corresponding to the execution code may be a computing function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, and the like.
It should be noted that the controller executing the code for the Open-Channel SSD executes the corresponding function based on the execution code. The function executed by the execution code is not limited by the function of the controller, and can be set by the Host according to the requirement.
It is understood that updating the code of the controller may cause the controller to subsequently execute the function corresponding to the executed code.
Further, the controller includes a plurality of micro controller MCUs, and the step of issuing the execution code to the solid state disk Open-Channel SSD includes:
determining the MCU to be updated required to be issued by the execution code; and issuing the execution code to the MCU to be updated so that the Open-Channel SSD carries out code updating on the MCU to be updated based on the execution code. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs. It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes. The MCU forms distributed nodes, so that backup can be carried out among the MCUs, functions of the MCU can be executed through other MCUs after one MCU is down, and the performance of the Open-Channel SSD is improved.
In an embodiment, the step S100 includes:
and compiling the code in real time based on the functional requirements to obtain an execution code.
Correspondingly, the Open-Channel SSD comprises a controller, and the Open-Channel SSD acquires an execution code issued by a Host; sending the execution code to the controller; and updating codes of the controller based on the execution codes so as to realize functions corresponding to the execution codes. The Host is a system service layer, that is, a service logic originally belonging to the FTL is moved to the system service layer.
It should be noted that the execution code is a code compiled by the host, and is used for the controller of the Open-Channel SSD to execute a corresponding function based on the execution code. The function executed by the execution code is not limited by the function of the controller, and can be set by the Host according to the requirement.
In addition, it should be noted that the function corresponding to the execution code may be a computing function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, or the like.
In addition, it should be noted that after the Open-Channel SSD receives an execution code issued by the host, the execution code is sent to the controller, so that the controller updates the code, thereby implementing a function corresponding to the execution code.
The controller is an SSD controller, which may be a control chip. The controller may comprise several core MCUs, i.e. the controller may comprise one MCU or a plurality of MCUs.
In one embodiment, the controller comprises a microcontroller MCU, and the step of sending the execution code to the controller comprises:
and sending the execution code to an MCU of the controller.
In another embodiment, the controller includes a plurality of microcontroller MCUs, and the step of transmitting the execution code to the controller includes:
determining the MCU to be updated required to be issued by the execution code; and sending the execution code to the MCU to be updated. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs. It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes. The MCU forms distributed nodes, so that backup can be carried out among the MCUs, functions of the MCU can be executed through other MCUs after one MCU is down, and the performance of the Open-Channel SSD is improved.
Specifically, the MCU to be updated is subjected to code updating, so that the MCU to be updated subsequently executes the function corresponding to the executed code.
The function corresponding to the execution code may be a calculation function, a backup function, a data arrangement function, a garbage collection function, an I/O isolation function, a wear leveling function, and the like. That is to say, the present embodiment does not specify what instruction corresponds to what function in advance, and the like, which means that the system service layer can compile the code executed by each core MCU in real time, and then issue the code to each core MCU, so that the multipoint MCU can update the code segments on line to meet the requirement of the required function.
The embodiment of the invention provides a hard disk management method, which is applied to Host, and compiles a code based on functional requirements to obtain an execution code; and issuing the execution code to the Open-Channel SSD so that the Open-Channel SSD updates the code of the controller of the Open-Channel SSD based on the execution code, and the function corresponding to the execution code is realized. Through the mode, the function of the Open-Channel SSD controller is determined by the execution code compiled by the Host, compared with the prior art that the function of the SSD controller is determined by the function of the SSD controller, the embodiment of the invention can enable the SSD controller to have more functions and enable the Host to compile more functions, thereby improving the flexibility of Host Open-Channel management and improving the flexibility of solid state disk Open-Channel management.
Further, based on the third embodiment, a fourth embodiment of the hard disk management method of the present invention is provided.
In this embodiment, the controller includes a plurality of micro controller MCUs, and the step S200 includes:
step A201, determining the MCU to be updated which is required to be issued by the execution code;
step a202, issuing the execution code to the MCU to be updated, so that the Open-Channel SSD performs code update on the MCU to be updated based on the execution code.
In this embodiment, the MCU to be updated, which needs to be issued by the execution code, is determined; and issuing the execution code to the MCU to be updated so that the Open-Channel SSD carries out code updating on the MCU to be updated based on the execution code. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs.
It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes. The MCU forms distributed nodes, so that backup can be carried out among the MCUs, functions of the MCU can be executed through other MCUs after one MCU is down, and the performance of the Open-Channel SSD is improved.
In some embodiments, the controller includes a plurality of micro controller MCUs, and the step of issuing the execution code to the solid state disk Open-Channel SSD includes:
determining a plurality of MCUs to be updated, which are required to be issued by the execution code; and issuing the execution code to the MCUs to be updated. The MCUs to be updated may include one or more MCUs, that is, the execution code may be issued to one MCU or a plurality of MCUs for code updating.
It can be understood that, by updating the code of the MCU to be updated, the MCU to be updated can subsequently execute the function corresponding to the executed code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes. The MCU forms distributed nodes, so that backup can be carried out among the MCUs, functions of the MCU can be executed through other MCUs after one MCU is down, and the performance of the Open-Channel SSD is improved. That is, there are multiple control points for the controller, so that more different functions can be implemented.
In this embodiment, the function of the MCU in the Open-Channel SSD is determined by the execution code issued by the Host, and compared with the prior art in which the function is determined by the function of the SSD controller, the embodiment of the present invention can enable the SSD controller to have more functions and enable the Host to issue more functions, thereby improving the flexibility of the Host Open-Channel management and improving the flexibility of the solid state disk Open-Channel management. Meanwhile, the controller comprises a plurality of Micro Controller Units (MCUs), so that the performance of the Open-Channel of the solid state disk can be improved, and the flexibility of Host Open-Channel management and the flexibility of the Open-Channel management of the solid state disk are further improved.
The invention also provides a hard disk management device.
In this embodiment, the hard disk management apparatus is disposed in an Open-Channel SSD of a solid state disk, and the hard disk management apparatus includes:
an obtaining module 10, configured to obtain an execution code issued by a Host;
a sending module 20, configured to send the execution code to the controller;
and the updating module 30 is configured to perform code updating on the controller based on the execution code, so as to implement a function corresponding to the execution code.
Each virtual function module of the hard disk management apparatus is stored in the memory 1005 of the hard disk management device shown in fig. 1, and is used for implementing all functions of a hard disk management program; when executed by the processor 1001, the modules may perform hard disk management functions.
Further, the controller includes a plurality of micro controller MCUs, and the sending module 20 is further configured to determine MCUs to be updated that are required to be issued by the execution code; and sending the execution code to the MCU to be updated.
Further, the update module 30 is further configured to perform code update on the MCU to be updated based on the execution code.
Further, the controller comprises a plurality of MCUs, and the MCUs are distributed nodes.
The function implementation of each module in the hard disk management device corresponds to each step in the hard disk management method embodiment, and the function and implementation process are not described in detail here.
The invention also provides a hard disk management device.
In this embodiment, the hard disk management apparatus is deployed in a Host, and the hard disk management apparatus includes:
a compiling module 100, configured to compile a code based on a functional requirement to obtain an execution code;
and the issuing module 200 is configured to issue the execution code to an Open-Channel SSD (solid state disk), so that the Open-Channel SSD updates a code of a controller of the Open-Channel SSD based on the execution code, and implements a function corresponding to the execution code.
Each virtual function module of the hard disk management apparatus is stored in the memory 1005 of the hard disk management device shown in fig. 1, and is used for implementing all functions of a hard disk management program; when executed by the processor 1001, the modules may perform hard disk management functions.
Further, the controller includes a plurality of micro controller MCUs, and the issuing module 200 is further configured to determine MCUs to be updated that need to be issued by the execution code; and issuing the execution code to the MCU to be updated so that the Open-Channel SSD carries out code updating on the MCU to be updated based on the execution code.
The function implementation of each module in the hard disk management device corresponds to each step in the hard disk management method embodiment, and the function and implementation process are not described in detail here.
The present invention also provides a computer readable storage medium having a hard disk management program stored thereon, which when executed by a processor implements the steps of the hard disk management method according to any one of the above embodiments.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the hard disk management method described above, and is not described herein again.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the hard disk management method according to any of the above embodiments.
The specific embodiment of the computer program product of the present invention is basically the same as the embodiments of the hard disk management method described above, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.