WO2023056687A1 - 一种固态硬盘及其数据操作方法、装置及电子设备 - Google Patents

一种固态硬盘及其数据操作方法、装置及电子设备 Download PDF

Info

Publication number
WO2023056687A1
WO2023056687A1 PCT/CN2021/131265 CN2021131265W WO2023056687A1 WO 2023056687 A1 WO2023056687 A1 WO 2023056687A1 CN 2021131265 W CN2021131265 W CN 2021131265W WO 2023056687 A1 WO2023056687 A1 WO 2023056687A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
namespace
storage unit
identifier
electronic device
Prior art date
Application number
PCT/CN2021/131265
Other languages
English (en)
French (fr)
Inventor
陈镇星
尹慧
Original Assignee
中山市江波龙电子有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中山市江波龙电子有限公司 filed Critical 中山市江波龙电子有限公司
Publication of WO2023056687A1 publication Critical patent/WO2023056687A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the technical field of data storage, and in particular to a solid-state hard disk and its data operation method, device and electronic equipment.
  • SSD solid state disk
  • a solid state disk is a hard disk composed of a control unit and a solid state storage unit.
  • SSD is the same as ordinary hard disk (mechanical hard disk) in terms of interface specifications, functions and usage methods. Since SSD does not have the mechanical rotation device of ordinary hard disk, it has faster read and write speed and higher stability, and is widely used as Storage devices for electronic equipment (eg, computers) in various fields.
  • the embodiment of the present application provides a solid-state hard disk and its data operation method, device, and electronic equipment to solve the problem that the existing SSD data storage method will cause a large delay in the read and write operations of system data. technical problem.
  • the first aspect of the embodiments of the present application provides a data operation method for a solid-state hard disk, which is applied to the solid-state hard disk, and the data operation method includes:
  • the data operation instruction carrying information about the data to be operated and an identifier of a target namespace corresponding to the storage unit to which the data to be operated belongs;
  • the identifier of the target namespace is the first identifier, perform data operations on the storage unit corresponding to the first namespace based on the information of the data to be operated, and the storage unit corresponding to the first namespace is used to store the system data of electronic devices;
  • the identifier of the target namespace is the second identifier, perform data operations on the storage unit corresponding to the second namespace based on the information of the data to be operated, and the storage unit corresponding to the second namespace is used to store the Non-system data for electronic devices.
  • the data operation method before receiving the data operation instruction from the electronic device, the data operation method further includes:
  • the configuration information is used to describe the configuration of the storage unit in the solid-state hard disk, and the configuration includes: the The storage unit of the solid state disk is defined by the first namespace and the second namespace; the storage unit corresponding to the first namespace is used to store the system data of the electronic device, and the storage unit corresponding to the second namespace is used for The non-system data of the electronic device is stored; the identifier of the first namespace is the first identifier, and the identifier of the second namespace is the second identifier.
  • both the first namespace and the second namespace correspond to at least one storage unit; the storage unit corresponding to the first namespace is physically independent from the storage unit corresponding to the second namespace.
  • all the storage units corresponding to the first namespace are configured as a single-level unit structure; the storage units corresponding to the second namespace are configured as a single-level unit structure, a multi-layer unit structure, Three-story unit structure or four-story unit structure.
  • the second aspect of the embodiment of the present application provides a data operation method of a solid-state hard disk, which is applied to an electronic device, and the data operation method includes:
  • the data operation instruction carries the information of the data to be operated and the storage to which the data to be operated belongs The ID of the target namespace to which the unit corresponds.
  • the information of the data to be operated includes the data type, identification or content of the data to be operated; correspondingly, the generating a data operation instruction based on the configuration information and the information of the data to be operated includes:
  • the data operation instruction is generated based on the identifier of the target namespace and the identifier or content of the data to be operated.
  • the third aspect of the embodiment of the present application provides a data operation device for a solid-state hard disk, including:
  • the first communication unit is configured to receive a data operation instruction from the electronic device, where the data operation instruction carries information about the data to be operated and an identifier of a target namespace corresponding to the storage unit to which the data to be operated belongs;
  • the first data operation unit is configured to, if the identifier of the target namespace is the first identifier, perform data operations on the storage unit corresponding to the first namespace based on the information of the data to be operated, and the first namespace corresponds to
  • the storage unit is used to store system data of the electronic device;
  • the second data operation unit is configured to, if the identifier of the target namespace is the second identifier, perform data operations on the storage unit corresponding to the second namespace based on the information of the data to be operated, and the second namespace corresponds to
  • the storage unit is used to store non-system data of the electronic device.
  • a fourth aspect of the embodiments of the present application provides an electronic device, including:
  • the second communication unit is configured to acquire configuration information of the solid-state hard disk, and the configuration information is used to describe the configuration of the storage unit in the solid-state hard disk;
  • an instruction generating unit configured to generate a data operation instruction based on the configuration information and information of the data to be operated, and send the data operation instruction to the solid state disk, the data operation instruction carries the information of the data to be operated and the The identifier of the target namespace corresponding to the storage unit to which the data to be operated belongs.
  • the fifth aspect of the embodiment of the present application provides a solid-state hard disk, including: a data operation device and a plurality of storage units connected to the data operation device; the data operation device is used to implement the first aspect or the first aspect The steps of the data manipulation method described in any optional manner.
  • the sixth aspect of the embodiments of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and operable on the electronic device, and the processor executes the computer program implement the steps of the data manipulation method described in the second aspect or any optional manner of the second aspect.
  • a seventh aspect of the embodiments of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the first aspect or the first aspect is implemented. Steps in the data manipulation method described in an optional manner.
  • the eighth aspect of the embodiments of the present application provides another computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the second aspect or any of the second aspects are implemented. Steps in the data manipulation method described in an optional manner.
  • the ninth aspect of the embodiments of the present application provides a computer program product.
  • the computer program product runs on a solid-state hard disk
  • the solid-state hard disk performs the data operation described in the above-mentioned first aspect or any optional mode of the first aspect. method steps.
  • the tenth aspect of the embodiments of the present application provides another computer program product.
  • the solid-state hard disk executes the data described in the second aspect or any optional mode of the second aspect. How-to steps.
  • the storage unit in the solid-state hard disk is distinguished through the first namespace and the second namespace, that is, the storage unit corresponding to the first namespace is used to store electronic equipment system data
  • the storage unit corresponding to the second namespace is used to store the non-system data of the electronic device. Therefore, when the electronic device needs to operate the system data, the electronic device only needs to store the first namespace corresponding to the storage unit to which the system data belongs.
  • the first identifier of the namespace is carried in the data operation instruction, and the solid-state disk can perform data operations on the storage unit corresponding to the first namespace based on the data operation instruction; when the electronic device needs to operate on non-system data, the electronic device only The second identifier of the second namespace corresponding to the storage unit to which the non-system data belongs needs to be carried in the data operation instruction, and the solid state disk can perform data operations on the storage unit corresponding to the second namespace based on the data operation instruction. That is, the solid-state hard disk stores the system data and non-system data of electronic equipment in different storage units, so that the operation of system data and the operation of non-system data do not affect each other, thereby reducing the delay of system data operation .
  • FIG. 1 is a schematic structural diagram of a solid-state hard disk provided in an embodiment of the present application
  • Fig. 2 is the implementation flowchart of the data operation method of a kind of solid-state hard disk provided by the embodiment of the present application;
  • Fig. 3 is the implementation flow diagram of a data operation method of a solid-state hard disk provided by another embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a data operation device for a solid-state hard disk provided in an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by another embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features.
  • definition of “first” and “second” features may expressly or implicitly include one or more of these features.
  • references to "one embodiment” or “some embodiments” or the like in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • SSD solid state disk
  • a solid state disk is a hard disk composed of a control unit and a solid state storage unit.
  • SSD is the same as ordinary hard disk (mechanical hard disk) in terms of interface specifications, functions and usage methods. Since SSD does not have the mechanical rotation device of ordinary hard disk, it has faster read and write speed and higher stability, and is widely used as Storage devices for electronic equipment (eg, computers) in various fields.
  • both system data and non-system data are usually stored in the SSD.
  • existing SSDs usually store system data and non-system data of electronic devices in a mixed manner, that is, storage units in SSDs are used to store both system data of electronic devices and non-system data of electronic devices. It will cause a large delay in the read and write operations of system data.
  • most of the storage units in the existing SSDs use triple level cell (TLC) flash memory blocks. Since the data read and write speed of the TLC flash memory blocks is relatively slow, it will also cause system data to read and write. Write operations have a large latency.
  • TLC triple level cell
  • FIG. 1 is a schematic structural diagram of a solid-state hard disk provided by an embodiment of the present application.
  • the solid state disk 10 may include: a data operation device 11 and a plurality of storage units 12 connected to the data operation device 11 .
  • the data operation device 11 may specifically be a control unit.
  • the data operation device 11 is used to perform data operations on the storage unit 12, for example, to perform a data write operation on the storage unit 12 (that is, to write data into the storage unit 12) or to perform a data read operation (that is, to read data from the storage unit 12). read data).
  • the storage unit 12 is a physical (that is, non-logical) storage medium, which may specifically be a flash memory (flash memory) block (block).
  • the storage unit 12 may be a not AND (NAND) type flash memory block, or a NOR (not OR, NOR) type flash memory block, and the specific type of the flash memory block is not particularly limited here.
  • the storage units 12 in the solid-state hard disk 10 are divided into two categories, each category includes at least one storage unit 12, and these two types of storage units 12 are respectively defined by the first namespace and the second namespace, that is, the first Both the first namespace and the second namespace correspond to at least one storage unit 12 .
  • the storage unit 12 corresponding to the first namespace and the storage unit 12 corresponding to the second namespace are physically independent of each other, that is, the storage unit 12 corresponding to the first namespace is different from the storage unit 12 corresponding to the second namespace , that is, the storage unit 12 corresponding to the first namespace does not overlap with the storage unit 12 corresponding to the second namespace.
  • both the first namespace and the second namespace are configured with an identifier.
  • the identifier of the first namespace may be the first identifier
  • the identifier of the second namespace may be the second identifier.
  • both the first identifier and the second identifier may be composed of numbers, letters, or characters.
  • the first identifier may be Namespace1
  • the second identifier may be Namespace2.
  • the storage unit 12 corresponding to the first namespace can be used to store the system data of the electronic device
  • the storage unit 12 corresponding to the second namespace may be used to store non-system data of the electronic device.
  • the system data may be data related to the system operation of the electronic device.
  • the system operation may be an operation related to an operating system (operating system, OS) of the electronic device, for example, an OS installation operation or an application program (application, APP) installation operation, and the like.
  • the non-system data may be data other than the system data of the electronic device, such as audio data or video data.
  • all storage units 12 corresponding to the first namespace are can be configured as a single-layer unit (single level cell, SLC) structure. Because the data read and write speed of the storage unit of the SLC structure is fast, the amount of data stored in each unit is small, and the service life is long, so the storage unit of the SLC structure can not only reduce the operation delay of the system data, but also shrink The write amplification of SSD increases the service life of SSD.
  • SLC single level cell
  • the storage unit 12 corresponding to the second namespace may be configured as an SLC structure, or a multi-level cell (multi level cell, MLC) structure, or a TLC structure, or a quad level cell (quad level cell, QLC) structure, etc., which are set according to actual needs, and are not specifically limited here.
  • the solid-state hard disk 10 may further include an interface unit 13 .
  • the interface unit 13 may include: a high-speed serial computer expansion bus standard (peripheral Component interconnect express (PCIE) interface, serial advanced technology attachment (SATA) interface, serial SCSI (serial attached SCSI, SAS) interface or mini SATA (miniSATA, MSATA) interface, etc.
  • PCIE peripheral Component interconnect express
  • SATA serial advanced technology attachment
  • SAS serial SCSI
  • mini SATA miniSATA, MSATA
  • SCSI refers to the Small Computer System Interface (Small Computer System Interface).
  • the user when the electronic device needs to perform data operations on the solid-state hard disk 10, the user can insert the solid-state hard disk 10 into a corresponding interface slot on the electronic device, so that the solid-state hard disk 10 establishes a communication connection with the electronic device through the interface unit 13, and then Make the electronic equipment realize the data operation on the solid state hard disk 10 .
  • the embodiment of the present application further provides a data operation method for the solid-state hard disk.
  • Fig. 2 is the implementation flowchart of the data operation method of a kind of solid-state hard disk that the embodiment of the present application provides, as shown in Fig. 2, this data operation method can comprise S21 ⁇ S23, detailed description is as follows:
  • S21 The electronic device acquires configuration information of the solid state disk.
  • the electronic device after the electronic device establishes a communication connection with the solid-state hard disk, the electronic device needs to obtain configuration information of the solid-state hard disk, and the configuration information is used to describe the configuration of the storage unit in the solid-state hard disk.
  • the configuration may include the following content: the storage unit of the solid state disk is defined by the first namespace and the second namespace; the storage unit corresponding to the first namespace is used to store the system data of the electronic device, and the storage unit corresponding to the second namespace corresponds to The storage unit is used to store non-system data of the electronic device; the identifier of the first namespace is the first identifier, and the identifier of the second namespace is the second identifier.
  • the electronic device may actively acquire configuration information of the solid state drive.
  • the electronic device may send a configuration information acquisition request to the solid state disk.
  • the solid state disk may return the configuration information of the solid state disk to the electronic device in response to the configuration information acquisition request.
  • the electronic device may passively receive the configuration information of the solid state drive sent by the solid state drive.
  • the solid-state hard disk can actively send the configuration information of the solid-state hard disk to the electronic device. The electronic device receives the configuration information of the solid state drive sent by the solid state drive.
  • the electronic device generates a data operation instruction based on the configuration information and the information of the data to be operated, and sends the data operation instruction to the solid state disk.
  • Data operations may include: data read operations or data write operations, and the like.
  • the electronic device can generate a data operation instruction based on the configuration information of the solid state hard disk and the information of the data to be operated, and send the data operation instruction to the solid state hard disk.
  • the information of the data to be operated may include: data type, identification and content, and so on.
  • the data type of the data to be operated may include: system data or non-system data.
  • the identifier of the data to be operated may be the name of the data to be operated, or may be the name of the file where the data to be operated is located.
  • the electronic device may generate data operation instructions through the following steps:
  • the data operation instruction is generated based on the identifier of the target namespace and the identifier or content of the data to be operated.
  • the electronic device determines that the storage unit to which the data to be operated belongs is the storage unit used to store system data in the solid-state hard disk, that is, the first naming The storage unit corresponding to the space, therefore, the electronic device determines that the target namespace is the first namespace. Based on this, the electronic device generates a data operation instruction based on the first identifier of the first namespace and the identifier or content of the data to be operated.
  • the electronic device determines that the storage unit to which the data to be operated belongs is the storage unit used to store non-system data in the solid-state hard disk, that is, The storage unit corresponding to the second namespace, therefore, the electronic device determines that the target namespace is the second namespace. Based on this, the electronic device generates a data operation instruction based on the second identifier of the second namespace and the identifier or content of the data to be operated.
  • the data operation instruction generated by the electronic device carries the information of the data to be operated and the identifier of the target namespace corresponding to the storage unit to which the data to be operated belongs.
  • the electronic device generates a data operation instruction based on the identifier of the target namespace and the identifier or content of the data to be operated, which may specifically include the following two situations:
  • the electronic device may generate a data read instruction based on the identifier of the target namespace and the identifier of the data to be read. Specifically, if the data to be read is system data of the electronic device, the electronic device may generate a data read instruction based on the first identifier of the first namespace and the identifier of the data to be read; If the data is not system data, the electronic device may generate a data read instruction based on the second identifier of the second namespace and the identifier of the data to be read. That is to say, the data reading instruction generated by the electronic device includes the identifier of the data to be read and the identifier of the target namespace.
  • the electronic device may generate a data writing instruction based on the identifier of the target namespace and the content of the data to be written. Specifically, if the data to be written is system data of the electronic device, the electronic device may generate a data write instruction based on the first identifier of the first namespace and the content of the data to be written; if the data to be written is the system data of the electronic device If the data is not system data, the electronic device may generate a data writing instruction based on the second identifier of the second namespace and the content of the data to be written. That is to say, the data writing instruction generated by the electronic device includes the content of the data to be written and the identifier of the target namespace.
  • the solid state disk receives a data operation instruction from the electronic device.
  • the solid state disk after the solid state disk receives the data operation instruction sent by the electronic device, it can analyze the data operation instruction to obtain the identification of the target namespace corresponding to the storage unit to which the data to be operated belongs and the information of the data to be operated.
  • the solid state disk if the solid state disk detects that the identifier of the target namespace is the first identifier, the solid state disk executes S24. In another embodiment of the present application, if the solid state disk detects that the identifier of the target namespace is the second identifier, the solid state disk executes S25.
  • the identifier of the target namespace carried in the data operation instruction is the first identifier
  • the data to be operated is the system data of the electronic device.
  • the solid state disk can be based on the data to be operated carried in the data operation instruction. information, perform data operations on the storage unit corresponding to the first namespace.
  • the solid state disk may read the data to be read from the storage unit corresponding to the first namespace based on the identifier of the data to be read carried in the data read instruction.
  • the solid state disk may write the content of the data to be written carried in the data write instruction into the storage unit corresponding to the first namespace.
  • the identifier of the target namespace carried in the data operation instruction is the second identifier, it means that the data to be operated is non-system data of the electronic device. information, and perform data operations on the storage unit corresponding to the second namespace.
  • the solid state disk may read the data to be read from the storage unit corresponding to the second namespace based on the identifier of the data to be read carried in the data read instruction.
  • the solid state disk may write the content of the data to be written carried in the data write instruction into the storage unit corresponding to the second namespace.
  • S24 and S25 are two parallel steps. For a single data operation instruction, if the solid state disk executes S24, then S25 is not executed, and if the solid state disk executes S25, then S24 is not executed.
  • the storage units in the solid-state hard disk are distinguished through the first namespace and the second namespace, that is, the storage unit corresponding to the first namespace uses To store the system data of the electronic device, the storage unit corresponding to the second namespace is used to store the non-system data of the electronic device. Therefore, when the electronic device needs to operate the system data, the electronic device only needs to store the storage unit to which the system data belongs.
  • the first identifier of the corresponding first namespace is carried in the data operation instruction, and the solid-state disk can perform data operations on the storage unit corresponding to the first namespace based on the data operation instruction; when the electronic device needs to operate on non-system data , the electronic device only needs to carry the second identifier of the second namespace corresponding to the storage unit to which the non-system data belongs in the data operation instruction, and the solid-state disk can perform data processing on the storage unit corresponding to the second namespace based on the data operation instruction. operate. That is, the solid-state hard disk stores the system data and non-system data of electronic equipment in different storage units, so that the operation of system data and the operation of non-system data do not affect each other, thereby reducing the delay of system data operation .
  • FIG. 3 is a schematic flowchart of a data operation method for a solid state disk provided in another embodiment of the present application.
  • S21 in this embodiment may specifically include S211 ⁇ S212, which are described in detail as follows:
  • S211 The electronic device sends a configuration information acquisition request to the solid state disk.
  • the solid state disk receives the configuration information acquisition request from the electronic device, and returns the configuration information of the solid state disk to the electronic device in response to the configuration information acquisition request.
  • the electronic device after the electronic device establishes a communication connection with the solid-state hard disk, the electronic device can actively acquire the configuration information of the solid-state hard disk, that is, the electronic device can send a configuration information acquisition request to the solid-state hard disk. After receiving the configuration information acquisition request, the solid state disk may return the configuration information of the solid state disk to the electronic device in response to the configuration information acquisition request.
  • the solid-state hard disk will not send the configuration information of the solid-state hard disk to the electronic device until it receives the configuration information acquisition request from the electronic device, so as to avoid wasting the data of the solid-state hard disk. Process resources.
  • FIG. 4 is a schematic structural diagram of a data operation device for a solid-state hard disk provided by an embodiment of the present application. For ease of description, only parts related to this embodiment are shown.
  • the units included in the data operation device 40 of the solid-state hard disk are used to execute the steps performed by the solid-state hard disk in the above-mentioned method embodiment. For details, please refer to the relevant description in the above-mentioned method embodiment, and details will not be repeated here.
  • the data operation device 40 of the solid state disk includes: a first communication unit 41 , a first data operation unit 41 and a second data operation unit 43 . in:
  • the first communication unit 41 is configured to receive a data operation instruction from the electronic device, where the data operation instruction carries information about the data to be operated and an identifier of a target namespace corresponding to the storage unit to which the data to be operated belongs.
  • the first data operation unit 42 is configured to perform data operations on the storage unit corresponding to the first namespace based on the information of the data to be operated if the identifier of the target namespace is the first identifier.
  • the storage unit is used to store system data of the electronic device.
  • the second data operation unit 43 is configured to perform data operations on the storage unit corresponding to the second namespace based on the information of the data to be operated if the identifier of the target namespace is the second identifier.
  • the storage unit is used to store non-system data of the electronic device.
  • the first communication unit 41 is also used for:
  • the configuration information is used to describe the configuration of the storage unit in the solid-state hard disk, and the configuration includes: the storage unit of the solid-state hard disk is defined by a first namespace and a second namespace; the first namespace The corresponding storage unit is used to store the system data of the electronic device, and the storage unit corresponding to the second namespace is used to store the non-system data of the electronic device; the identifier of the first namespace is the first ID, where the ID of the second namespace is the second ID.
  • both the first namespace and the second namespace correspond to at least one storage unit; the storage unit corresponding to the first namespace is physically independent from the storage unit corresponding to the second namespace.
  • all the storage units corresponding to the first namespace are configured as a single-level unit structure; the storage units corresponding to the second namespace are configured as a single-level unit structure, a multi-layer unit structure, Three-story unit structure or four-story unit structure.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. For ease of description, only parts related to this embodiment are shown.
  • the units included in the electronic device 50 are configured to execute the steps performed by the electronic device in the foregoing method embodiments. For details, please refer to relevant descriptions in the foregoing method embodiments, and details are not repeated here.
  • the electronic device 50 includes: a second communication unit 51 and an instruction generation unit 52 . in:
  • the second communication unit 51 is used to obtain configuration information of the solid state hard disk, and the configuration information is used to describe the configuration of the storage unit in the solid state hard disk.
  • the instruction generation unit 52 is used to generate a data operation instruction based on the configuration information and the information of the data to be operated, and send the data operation instruction to the solid state disk, the data operation instruction carries the information of the data to be operated and the The identifier of the target namespace corresponding to the storage unit to which the data to be operated belongs.
  • the information of the data to be operated includes the data type, identification or content of the data to be operated; correspondingly, the instruction generating unit 52 is specifically configured to:
  • the data operation instruction is generated based on the identifier of the target namespace and the identifier or content of the data to be operated.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by another embodiment of the present application.
  • the electronic device 60 includes: a processor 61 , a memory 62 , and a computer program 63 stored in the memory 62 and operable on the processor 61 , such as a program corresponding to a data operation method of a solid state disk.
  • the processor 61 executes the computer program 63, various steps performed by the electronic device in the above embodiment of the data operation method for the solid state disk are realized.
  • the processor 61 executes the computer program 63
  • the functions of the units in the above embodiment corresponding to FIG. 5 are realized, for example, the functions of the units 51-52 shown in FIG. 5 .
  • the computer program 63 can be divided into one or more units, and the one or more units are stored in the memory 62 and executed by the processor 61 to complete the present application.
  • the one or more units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 63 in the electronic device 60 .
  • the computer program 63 may be divided into a second communication unit and an instruction generation unit, and the specific functions of each unit are as described above.
  • FIG. 6 is only an example of the electronic device 60, and does not constitute a limitation to the electronic device 60.
  • the electronic device 60 may include more or fewer components than shown in the figure, or combine certain components, or Different components, for example, the electronic device 60 may also include input and output devices, network access devices, buses, and so on.
  • Processor 61 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the storage 62 may be an internal storage unit of the electronic device 60 , such as a hard disk or memory of the electronic device 60 .
  • the memory 62 can also be an external storage unit of the electronic device 60, such as a plug-in hard disk equipped on the electronic device 60, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card) and so on.
  • the memory 62 may also include both an internal storage unit of the electronic device 60 and an external storage unit.
  • the memory 62 is used to store the computer program and other programs and data required by the electronic device 60 .
  • the memory 62 can also be used to temporarily store data that has been output or will be output.
  • the embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored.
  • a computer program is stored.
  • the steps performed by the solid-state disk in the above-mentioned method embodiments can be implemented.
  • the embodiment of the present application also provides another computer-readable storage medium, where a computer program is stored in the computer-readable storage medium.
  • a computer program is stored in the computer-readable storage medium.
  • the steps performed by the electronic device in the above-mentioned method embodiments can be implemented. .
  • the embodiment of the present application also provides a computer program product, which, when the computer program product runs on the solid-state hard disk, causes the solid-state hard disk to execute the steps performed by the solid-state hard disk in the foregoing method embodiments.
  • the embodiment of the present application also provides another computer program product, which, when the computer program product runs on the electronic device, causes the electronic device to execute the steps performed by the electronic device in the foregoing method embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种固态硬盘及其数据操作方法、装置及电子设备,适用于数据存储技术领域,其中,固态硬盘的数据操作方法包括:接收来自电子设备的数据操作指令,数据操作指令中携带有待操作数据的信息以及待操作数据所属的存储单元对应的目标命名空间的标识;若目标命名空间的标识为第一标识,则基于待操作数据的信息对第一命名空间对应的存储单元进行数据操作,第一命名空间对应的存储单元用于存储电子设备的系统数据;若目标命名空间的标识为第二标识,则基于待操作数据的信息对第二命名空间对应的存储单元进行数据操作,第二命名空间对应的存储单元用于存储电子设备的非系统数据,从而可以降低系统数据的操作的时延。

Description

一种固态硬盘及其数据操作方法、装置及电子设备
本申请要求于2021年10月08日在中国专利局提交的、申请号为202111172637.5的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据存储技术领域,尤其涉及一种固态硬盘及其数据操作方法、装置及电子设备。
背景技术
固态硬盘(solid state disk,SSD)是由控制单元和固态存储单元组成的硬盘。SSD在接口的规范、功能及使用方法上与普通硬盘(即机械硬盘)相同,由于SSD没有普通硬盘的机械旋转装置,因此具有更快的读写速度和更高的稳定性,被广泛用作各领域电子设备(例如,电脑)的存储装置。
电子设备采用SSD作为存储装置时,通常会将系统数据和非系统数据均存储在SSD中。然而,现有的SSD通常是将电子设备的系统数据和非系统数据进行混合存储,这样会导致系统数据的读写操作具有较大的时延。
技术问题
有鉴于此,本申请实施例提供了一种固态硬盘及其数据操作方法、装置及电子设备,以解决现有的SSD的数据存储方式会导致系统数据的读写操作具有较大的时延的技术问题。
技术解决方案
本申请实施例的第一方面提供了一种固态硬盘的数据操作方法,应用于所述固态硬盘,所述数据操作方法包括:
接收来自电子设备的数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识;
若所述目标命名空间的标识为第一标识,则基于所述待操作数据的信息对第一命名空间对应的存储单元进行数据操作,所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据;
若所述目标命名空间的标识为第二标识,则基于所述待操作数据的信息对第二命名空间对应的存储单元进行数据操作,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据。
可选的,在所述接收来自电子设备的数据操作指令之前,所述数据操作方法还包括:
接收来自所述电子设备的配置信息获取请求;
响应于所述配置信息获取请求,向所述电子设备返回所述固态硬盘的配置信息;所述配置信息用于描述所述固态硬盘中的存储单元的配置情况,所述配置情况包括:所述固态硬盘的存储单元通过第一命名空间和第二命名空间定义;所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据;所述第一命名空间的标识为所述第一标识,所述第二命名空间的标识为所述第二标识。
可选的,所述第一命名空间和所述第二命名空间均对应至少一个存储单元;所述第一命名空间对应的存储单元与所述第二命名空间对应的存储单元物理上相互独立。
可选的,所述第一命名空间对应的所有所述存储单元被配置为单层单元结构;所述第二命名空间对应的所述存储单元被配置为单层单元结构、多层单元结构、三层单元结构或四层单元结构。
本申请实施例的第二方面提供了一种固态硬盘的数据操作方法,应用于电子设备,所述数据操作方法包括:
获取固态硬盘的配置信息,所述配置信息用于描述所述固态硬盘中的存储单元的配置情况;
基于所述配置信息以及待操作数据的信息生成数据操作指令,并向所述固态硬盘发送所述数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识。
可选的,所述待操作数据的信息包括所述待操作数据的数据类型、标识或内容;对应地,所述基于所述配置信息以及待操作数据的信息生成数据操作指令,包括:
基于所述待操作数据的数据类型确定所述待操作数据所属的存储单元对应的目标命名空间的标识;
基于所述目标命名空间的标识以及所述待操作数据的标识或内容,生成所述数据操作指令。
本申请实施例的第三方面提供了一种固态硬盘的数据操作装置,包括:
第一通信单元,用于接收来自电子设备的数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识;
第一数据操作单元,用于若所述目标命名空间的标识为第一标识,则基于所述待操作数据的信息对第一命名空间对应的存储单元进行数据操作,所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据;
第二数据操作单元,用于若所述目标命名空间的标识为第二标识,则基于所述待操作数据的信息对第二命名空间对应的存储单元进行数据操作,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据。
本申请实施例的第四方面提供了一种电子设备,包括:
第二通信单元,用于获取固态硬盘的配置信息,所述配置信息用于描述所述固态硬盘中的存储单元的配置情况;
指令生成单元,用于基于所述配置信息以及待操作数据的信息生成数据操作指令,并向所述固态硬盘发送所述数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识。
本申请实施例的第五方面提供了一种固态硬盘,包括:数据操作装置以及与所述数据操作装置连接的多个存储单元;所述数据操作装置用于执行第一方面或第一方面的任一可选方式所述的数据操作方法的步骤。
本申请实施例的第六方面提供了一种电子设备,包括:存储器、处理器以及存储在所述存储器中并可在所述电子设备上运行的计算机程序,所述处理器执行所述计算机程序时实现第二方面或第二方面的任一可选方式所述的数据操作方法的步骤。
本申请实施例的第七方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现第一方面或第一方面的任一可选方式所述的数据操作方法的步骤。
本申请实施例的第八方面提供了另一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现第二方面或第二方面的任一可选方式所述的数据操作方法的步骤。
本申请实施例的第九方面提供了一种计算机程序产品,当计算机程序产品在固态硬盘上运行时,使得固态硬盘执行上述第一方面或第一方面的任一可选方式所述的数据操作方法的步骤。
本申请实施例的第十方面提供了另一种计算机程序产品,当计算机程序产品在固态硬盘上运行时,使得固态硬盘执行上述第二方面或第二方面的任一可选方式所述的数据操作方法的步骤。
有益效果
实施本申请实施例提供的一种固态硬盘的数据操作方法、装置、固态硬盘、电子设备、计算机可读存储介质及计算机程序产品具有以下有益效果:
本申请实施例提供的一种固态硬盘的数据操作方法,由于通过第一命名空间和第二命名空间对固体硬盘中的存储单元进行区分,即第一命名空间对应的存储单元用于存储电子设备的系统数据,第二命名空间对应的存储单元用于存储电子设备的非系统数据,因此,当电子设备需要对系统数据进行操作时,电子设备只需将系统数据所属的存储单元对应的第一命名空间的第一标识携带在数据操作指令中,固态硬盘便可基于该数据操作指令对第一命名空间对应的存储单元进行数据操作;当电子设备需要对非系统数据进行操作时,电子设备只需将非系统数据所属的存储单元对应的第二命名空间的第二标识携带在数据操作指令中,固态硬盘便可基于该数据操作指令对第二命名空间对应的存储单元进行数据操作。即固态硬盘将电子设备的系统数据和非系统数据分别存储在不同的存储单元中,这样使得系统数据的操作与非系统数据的操作之间互不影响,从而可以降低系统数据的操作的时延。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种固态硬盘的结构示意图;
图2为本申请实施例提供的一种固态硬盘的数据操作方法的实现流程图;
图3为本申请另一实施例提供的一种固态硬盘的数据操作方法的实现流程图;
图4为本申请实施例提供的一种固态硬盘的数据操作装置的结构示意图;
图5为本申请实施例提供的一种电子设备的结构示意图;
图6为本申请另一实施例提供的一种电子设备的结构示意图。
本发明的实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
需要说明的是,本申请实施例的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联物的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,除非另有说明,“多个”是指两个或多于两个,“至少一个”、“一个或多个”是指一个、两个或两个以上。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”特征可以明示或者隐含地包括一个或者更多个该特征。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
固态硬盘(solid state disk,SSD)是由控制单元和固态存储单元组成的硬盘。SSD在接口的规范、功能及使用方法上与普通硬盘(即机械硬盘)相同,由于SSD没有普通硬盘的机械旋转装置,因此具有更快的读写速度和更高的稳定性,被广泛用作各领域电子设备(例如,电脑)的存储装置。
电子设备采用SSD作为存储装置时,通常会将系统数据和非系统数据均存储在SSD中。然而,现有的SSD通常是将电子设备的系统数据和非系统数据进行混合存储,即SSD中的存储单元既用来存储电子设备的系统数据,又用来存储电子设备的非系统数据,这样会导致系统数据的读写操作具有较大的时延。且现有的SSD中的存储单元大多采用的是三层单元(triple level cell,TLC)结构的闪存块,由于TLC结构的闪存块的数据读写速度较慢,因此也会导致系统数据的读写操作具有较大的时延。
此外,电子设备对系统数据的读写操作一般是地址随机、数据长度较小的碎片化操作,因此存储单元采用TLC结构的闪存块会产生额外的填充数据,增大SSD的写入放大,从而缩短SSD的使用寿命。
为了解决上述技术问题,本申请实施例首先提供一种固态硬盘。图1为本申请实施例提供的一种固态硬盘的结构示意图。如图1所示,该固态硬盘10可以包括:数据操作装置11以及与数据操作装置11连接的多个存储单元12。
其中,数据操作装置11具体可以是控制单元。数据操作装置11用于对存储单元12进行数据操作,例如,对存储单元12进行数据写入操作(即,将数据写入存储单元12中)或者数据读取操作(即,从存储单元12中读取数据)。
存储单元12为物理上(即,非逻辑上)的存储介质,其具体可以是闪存(flash memory)块(block)。示例性的,存储单元12可以是与非(not AND,NAND)类型的闪存块,也可以是或非(not OR,NOR)类型的闪存块,此处不对闪存块的具体类型做特别限定。
本申请实施例将固态硬盘10中的存储单元12分为两类,每类均包括至少一个存储单元12,且通过第一命名空间和第二命名空间分别定义这两类存储单元12,即第一命名空间和第二命名空间均对应至少一个存储单元12。
需要说明的是,第一命名空间对应的存储单元12和第二命名空间对应的存储单元12物理上相互独立,即第一命名空间对应的存储单元12不同于第二命名空间对应的存储单元12,也就是说,第一命名空间对应的存储单元12与第二命名空间对应的存储单元12不重叠。
其中,第一命名空间和第二命名空间均配置有一个标识。示例性的,第一命名空间的标识可以为第一标识,第二命名空间的标识可以为第二标识。在具体应用中,第一标识和第二标识均可以由数字、字母或文字等组成,例如,第一标识可以为Namespace1,第二标识可以为Namespace2。
本申请实施例中,当固态硬盘10被用作电子设备(例如,手机、平板电脑或笔记本电脑等)的存储装置时,第一命名空间对应的存储单元12可以用于存储电子设备的系统数据,第二命名空间对应的存储单元12可以用于存储电子设备的非系统数据。其中,系统数据可以是与电子设备的系统操作相关的数据。系统操作可以是涉及电子设备的操作系统(operating system,OS)的操作,例如,OS的安装操作或应用程序(application,APP)的安装操作等。非系统数据可以是除电子设备的系统数据之外的其它数据,例如音频数据或视频数据等。
由于电子设备对系统数据的操作的时延性要求较高,即要求系统数据的操作具有较小的时延,因此,在本申请的一个实施例中,第一命名空间对应的所有存储单元12均可以被配置为单层单元(single level cell,SLC)结构。由于SLC结构的存储单元的数据读写速度较快,每个单元存储的数据量较小,且寿命较长,因此采用SLC结构的存储单元不仅可以降低系统数据的操作的时延,而且会缩小SSD的写入放大,增长SSD的使用寿命。
在本申请的另一个实施例中,第二命名空间对应的存储单元12可以被配置为SLC结构,或者多层单元(multi level cell,MLC)结构,或者TLC结构,或者四层单元(quad level cell,QLC)结构等,具体根据实际需求设置,此处不对其做特别限定。
由于固态硬盘10作为电子设备的存储装置时需要与电子设备进行通信,因此,请继续参阅图1,固态硬盘10还可以包括接口单元13。
示例性的,接口单元13可以包括:高速串行计算机扩展总线标准(peripheral component interconnect express,PCIE)接口、串行高级技术附件(serial advanced technology attachment,SATA)接口、串行SCSI(serial attached SCSI,SAS)接口或迷你SATA(miniSATA,MSATA)接口等。其中,SCSI指小型计算机系统接口(Small Computer System Interface)。
在具体应用中,电子设备需要对固态硬盘10进行数据操作时,用户可以将固态硬盘10插入电子设备上相应的接口插槽中,使固态硬盘10通过接口单元13与电子设备建立通信连接,进而使电子设备实现对固态硬盘10的数据操作。
基于上述实施例提供的固态硬盘,本申请实施例还提供一种固态硬盘的数据操作方法。图2为本申请实施例提供的一种固态硬盘的数据操作方法的实现流程图,如图2所示,该数据操作方法可以包括S21~S23,详述如下:
S21:电子设备获取固态硬盘的配置信息。
本申请实施例中,电子设备与固态硬盘建立通信连接后,电子设备需要获取固态硬盘的配置信息,该配置信息用于描述固态硬盘中的存储单元的配置情况。具体地,该配置情况可以包括以下内容:固态硬盘的存储单元通过第一命名空间和第二命名空间定义;第一命名空间对应的存储单元用于存储电子设备的系统数据,第二命名空间对应的存储单元用于存储电子设备的非系统数据;第一命名空间的标识为第一标识,第二命名空间的标识为第二标识。
在一种可能的实现方式中,电子设备与固态硬盘建立通信连接后,电子设备可以主动获取固态硬盘的配置信息。该实现方式中,电子设备可以向固态硬盘发送配置信息获取请求。固态硬盘接收到该配置信息获取请求后,可以响应于该配置信息获取请求,向电子设备返回固态硬盘的配置信息。
在另一种可能的实现方式中,电子设备与固态硬盘建立通信连接后,电子设备可以被动接收固态硬盘发送的固态硬盘的配置信息。该实现方式中,电子设备与固态硬盘建立通信连接后,固态硬盘可以主动向电子设备发送固态硬盘的配置信息。电子设备接收固态硬盘发送的固态硬盘的配置信息。
S22:电子设备基于所述配置信息以及待操作数据的信息生成数据操作指令,并向固态硬盘发送所述数据操作指令。
本申请实施例中,电子设备获取到固态硬盘的配置信息后,可以对固态硬盘进行数据操作。数据操作可以包括:数据读取操作或数据写入操作等。
电子设备需要对固态硬盘进行数据操作时,电子设备可以基于固态硬盘的配置信息以及待操作数据的信息生成数据操作指令,并向固态硬盘发送该数据操作指令。其中,待操作数据的信息可以包括:数据类型、标识及内容等。示例性的,待操作数据的数据类型可以包括:系统数据或非系统数据。待操作数据的标识可以是待操作数据的名称,或者可以是待操作数据所在文件的名称等。
在本申请的一个实施例中,电子设备可以通过以下步骤生成数据操作指令:
基于所述待操作数据的数据类型确定所述待操作数据所属的存储单元对应的目标命名空间的标识;
基于所述目标命名空间的标识以及所述待操作数据的标识或内容,生成所述数据操作指令。
在本实施一种可能的实现方式中,当待操作数据的数据类型为系统数据时,电子设备确定待操作数据所属的存储单元为固态硬盘中用于存储系统数据的存储单元,即第一命名空间对应的存储单元,因此,电子设备确定目标命名空间为第一命名空间。基于此,电子设备基于第一命名空间的第一标识以及待操作数据的标识或内容,生成数据操作指令。
在本实施另一种可能的实现方式中,当待操作数据的数据类型为非系统数据时,电子设备确定待操作数据所属的存储单元为固态硬盘中用于存储非系统数据的存储单元,即第二命名空间对应的存储单元,因此,电子设备确定目标命名空间为第二命名空间。基于此,电子设备基于第二命名空间的第二标识以及待操作数据的标识或内容,生成数据操作指令。
由此可见,本申请实施例中,电子设备生成的数据操作指令中携带有待操作数据的信息以及待操作数据所属的存储单元对应的目标命名空间的标识。
本实施例中,电子设备基于目标命名空间的标识以及待操作数据的标识或内容,生成数据操作指令,具体可以包括以下两种情况:
情况1、电子设备需要对固态硬盘进行数据读取操作。
该情况下,电子设备可以基于目标命名空间的标识以及待读取数据的标识生成数据读取指令。具体地,若待读取数据为电子设备的系统数据,则电子设备可以基于第一命名空间的第一标识以及待读取数据的标识生成数据读取指令;若待读取数据为电子设备的非系统数据,则电子设备可以基于第二命名空间的第二标识以及待读取数据的标识生成数据读取指令。也就是说,电子设备生成的数据读取指令中包括待读取数据的标识以及目标命名空间的标识。
情况2、电子设备需要对固态硬盘进行数据写入操作。
该情况下,电子设备可以基于目标命名空间的标识以及待写入数据的内容生成数据写入指令。具体地,若待写入数据为电子设备的系统数据,则电子设备可以基于第一命名空间的第一标识以及待写入数据的内容生成数据写入指令;若待写入数据为电子设备的非系统数据,则电子设备可以基于第二命名空间的第二标识以及待写入数据的内容生成数据写入指令。也就是说,电子设备生成的数据写入指令中包括待写入数据的内容以及目标命名空间的标识。
S23:固态硬盘接收来自电子设备的数据操作指令。
本申请实施例中,固态硬盘接收到电子设备发送的数据操作指令后,可以对该数据操作指令进行解析,得到待操作数据所属的存储单元对应的目标命名空间的标识以及待操作数据的信息。
在本申请的一个实施例中,固态硬盘若检测到目标命名空间的标识为第一标识,则固态硬盘执行S24。在本申请的另一个实施例中,固态硬盘若检测到目标命名空间的标识为第二标识,则固态硬盘执行S25。
S24:固态硬盘若检测到所述目标命名空间的标识为第一标识,则基于所述待操作数据的信息对第一命名空间对应的存储单元进行数据操作。
本实施例中,当数据操作指令中携带的目标命名空间的标识为第一标识时,说明待操作数据为电子设备的系统数据,此时固态硬盘可以基于该数据操作指令中携带的待操作数据的信息,对第一命名空间对应的存储单元进行数据操作。
具体地,当数据操作指令为数据读取指令时,固态硬盘可以基于该数据读取指令中携带的待读取数据的标识,从第一命名空间对应的存储单元中读取待读取数据。当数据操作指令为数据写入指令时,固态硬盘可以将数据写入指令中携带的待写入数据的内容写入第一命名空间对应的存储单元中。
S25:固态硬盘若检测到所述目标命名空间的标识为第二标识,则基于所述待操作数据的信息对第二命名空间对应的存储单元进行数据操作。
本实施例中,当数据操作指令中携带的目标命名空间的标识为第二标识时,说明待操作数据为电子设备的非系统数据,此时固态硬盘可以基于数据操作指令中携带的待操作数据的信息,对第二命名空间对应的存储单元进行数据操作。
具体地,当数据操作指令为数据读取指令时,固态硬盘可以基于该数据读取指令中携带的待读取数据的标识,从第二命名空间对应的存储单元中读取待读取数据。当数据操作指令为数据写入指令时,固态硬盘可以将数据写入指令中携带的待写入数据的内容写入第二命名空间对应的存储单元中。
需要说明的是,S24和S25为两个并列步骤,对于单个数据操作指令而言,固态硬盘若执行了S24则不执行S25,固态硬盘若执行了S25则不执行S24。
以上可以看出,本实施例提供的一种固态硬盘的数据操作方法,由于通过第一命名空间和第二命名空间对固体硬盘中的存储单元进行区分,即第一命名空间对应的存储单元用于存储电子设备的系统数据,第二命名空间对应的存储单元用于存储电子设备的非系统数据,因此,当电子设备需要对系统数据进行操作时,电子设备只需将系统数据所属的存储单元对应的第一命名空间的第一标识携带在数据操作指令中,固态硬盘便可基于该数据操作指令对第一命名空间对应的存储单元进行数据操作;当电子设备需要对非系统数据进行操作时,电子设备只需将非系统数据所属的存储单元对应的第二命名空间的第二标识携带在数据操作指令中,固态硬盘便可基于该数据操作指令对第二命名空间对应的存储单元进行数据操作。即固态硬盘将电子设备的系统数据和非系统数据分别存储在不同的存储单元中,这样使得系统数据的操作与非系统数据的操作之间互不影响,从而可以降低系统数据的操作的时延。
请参阅图3,图3为本申请另一实施例提供的一种固态硬盘的数据操作方法的示意性流程图。如图3所示,相对于图3对应的实施例,本实施例中的S21具体可以包括S211~S212,详述如下:
S211:电子设备向固态硬盘发送配置信息获取请求。
S212:固态硬盘接收来自所述电子设备的配置信息获取请求,并响应于所述配置信息获取请求,向所述电子设备返回所述固态硬盘的配置信息。
本实施例中,电子设备与固态硬盘建立通信连接后,电子设备可以主动获取固态硬盘的配置信息,即,电子设备可以向固态硬盘发送配置信息获取请求。固态硬盘接收到该配置信息获取请求后,可以响应于该配置信息获取请求,向电子设备返回固态硬盘的配置信息。
以上可以看出,本实施例提供的固态硬盘的数据操作方法,固态硬盘在接收到来自电子设备的配置信息获取请求后才会向电子设备发送固态硬盘的配置信息,从而可以避免浪费固态硬盘的处理资源。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
基于上述实施例中固态硬盘所执行的各个步骤,本申请实施例进一步给出该固体硬盘的数据操作装置的实施例。请参阅图4,图4为本申请实施例提供的一种固态硬盘的数据操作装置的结构示意图,为了便于说明,仅示出了与本实施例相关的部分。该固态硬盘的数据操作装置40包括的各单元用于执行上述方法实施例中固态硬盘所执行的各步骤,具体请参阅上述方法实施例中的相关描述,此处不再进行赘述。如图4所示,该固态硬盘的数据操作装置40包括:第一通信单元41、第一数据操作单元41及第二数据操作单元43。其中:
第一通信单元41用于接收来自电子设备的数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识。
第一数据操作单元42用于若所述目标命名空间的标识为第一标识,则基于所述待操作数据的信息对第一命名空间对应的存储单元进行数据操作,所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据。
第二数据操作单元43用于若所述目标命名空间的标识为第二标识,则基于所述待操作数据的信息对第二命名空间对应的存储单元进行数据操作,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据。
可选的,第一通信单元41还用于:
接收来自所述电子设备的配置信息获取请求,并响应于所述配置信息获取请求,向所述电子设备返回所述固态硬盘的配置信息;
所述配置信息用于描述所述固态硬盘中的存储单元的配置情况,所述配置情况包括:所述固态硬盘的存储单元通过第一命名空间和第二命名空间定义;所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据;所述第一命名空间的标识为所述第一标识,所述第二命名空间的标识为所述第二标识。
可选的,所述第一命名空间和所述第二命名空间均对应至少一个存储单元;所述第一命名空间对应的存储单元与所述第二命名空间对应的存储单元物理上相互独立。
可选的,所述第一命名空间对应的所有所述存储单元被配置为单层单元结构;所述第二命名空间对应的所述存储单元被配置为单层单元结构、多层单元结构、三层单元结构或四层单元结构。
基于上述实施例中电子设备所执行的各个步骤,本申请实施例进一步给出该电子设备的实施例。请参阅图5,图5为本申请实施例提供的一种电子设备的结构示意图,为了便于说明,仅示出了与本实施例相关的部分。该电子设备50包括的各单元用于执行上述方法实施例中电子设备所执行的各步骤,具体请参阅上述方法实施例中的相关描述,此处不再进行赘述。如图5所示,该电子设备50包括:第二通信单元51和指令生成单元52。其中:
第二通信单元51用于获取固态硬盘的配置信息,所述配置信息用于描述所述固态硬盘中的存储单元的配置情况。
指令生成单元52用于基于所述配置信息以及待操作数据的信息生成数据操作指令,并向所述固态硬盘发送所述数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识。
可选的,所述待操作数据的信息包括所述待操作数据的数据类型、标识或内容;对应地,指令生成单元52具体用于:
基于所述待操作数据的数据类型确定所述待操作数据所属的存储单元对应的目标命名空间的标识;
基于所述目标命名空间的标识以及所述待操作数据的标识或内容,生成所述数据操作指令。
需要说明的是,上述各单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参照方法实施例部分,此处不再赘述。
图6为本申请另一实施例提供的一种电子设备的结构示意图。如图6所示,该电子设备60包括:处理器61、存储器62以及存储在存储器62中并可在处理器61上运行的计算机程序63,例如固态硬盘的数据操作方法对应的程序。处理器61执行计算机程序63时实现上述固态硬盘的数据操作方法实施例中电子设备执行的各个步骤。或者,处理器61执行计算机程序63时实现上述图5对应的实施例中各单元的功能,例如,图5所示的单元51~52的功能。
示例性的,计算机程序63可以被分割成一个或多个单元,该一个或者多个单元被存储在存储器62中并由处理器61执行,以完成本申请。所述一个或多个单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述计算机程序63在电子设备60中的执行过程。例如,计算机程序63可以被分割成第二通信单元和指令生成单元,各单元具体功能如上所述。
本领域技术人员可以理解,图6仅仅是电子设备60的示例,并不构成对电子设备60的限定,电子设备60可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如电子设备60还可以包括输入输出设备、网络接入设备、总线等。
处理器61可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器62可以是电子设备60的内部存储单元,例如电子设备60的硬盘或内存。存储器62也可以是电子设备60的外部存储单元,例如电子设备60上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器62还可以既包括电子设备60的内部存储单元也包括外部存储单元。存储器62用于存储所述计算机程序以及电子设备60所需的其他程序和数据。存储器62还可以用于暂时地存储已经输出或者将要输出的数据。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,该计算机程序被处理器执行时可实现上述方法实施例中的固态硬盘执行的各步骤。
本申请实施例还提供了另一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,该计算机程序被处理器执行时可实现上述方法实施例中的电子设备执行的各步骤。
本申请实施例还提供了一种计算机程序产品,当计算机程序产品在固态硬盘上运行时,使得固态硬盘执行上述方法实施例中固态硬盘执行的各步骤。
本申请实施例还提供了另一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述方法实施例中电子设备执行的各步骤。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种固态硬盘的数据操作方法,其特征在于,应用于所述固态硬盘,所述数据操作方法包括:
    接收来自电子设备的数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识;
    若所述目标命名空间的标识为第一标识,则基于所述待操作数据的信息对第一命名空间对应的存储单元进行数据操作,所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据;
    若所述目标命名空间的标识为第二标识,则基于所述待操作数据的信息对第二命名空间对应的存储单元进行数据操作,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据。
  2. 根据权利要求1所述的数据操作方法,其特征在于,在所述接收来自电子设备的数据操作指令之前,所述数据操作方法还包括:
    接收来自所述电子设备的配置信息获取请求,并响应于所述配置信息获取请求,向所述电子设备返回所述固态硬盘的配置信息;
    所述配置信息用于描述所述固态硬盘中的存储单元的配置情况,所述配置情况包括:所述固态硬盘的存储单元通过第一命名空间和第二命名空间定义;所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据;所述第一命名空间的标识为所述第一标识,所述第二命名空间的标识为所述第二标识。
  3. 根据权利要求1所述的数据操作方法,其特征在于,所述第一命名空间和所述第二命名空间均对应至少一个存储单元;所述第一命名空间对应的存储单元与所述第二命名空间对应的存储单元物理上相互独立。
  4. 根据权利要求1至3任一项所述的数据操作方法,其特征在于,所述第一命名空间对应的所有所述存储单元被配置为单层单元结构;所述第二命名空间对应的所述存储单元被配置为单层单元结构、多层单元结构、三层单元结构或四层单元结构。
  5. 一种固态硬盘的数据操作方法,其特征在于,应用于电子设备,所述数据操作方法包括:
    获取固态硬盘的配置信息,所述配置信息用于描述所述固态硬盘中的存储单元的配置情况;
    基于所述配置信息以及待操作数据的信息生成数据操作指令,并向所述固态硬盘发送所述数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识。
  6. 根据权利要求5所述的数据操作方法,其特征在于,所述待操作数据的信息包括所述待操作数据的数据类型、标识或内容;对应地,所述基于所述配置信息以及待操作数据的信息生成数据操作指令,包括:
    基于所述待操作数据的数据类型确定所述待操作数据所属的存储单元对应的目标命名空间的标识;
    基于所述目标命名空间的标识以及所述待操作数据的标识或内容,生成所述数据操作指令。
  7. 一种固态硬盘的数据操作装置,其特征在于,包括:
    第一通信单元,用于接收来自电子设备的数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识;
    第一数据操作单元,用于若所述目标命名空间的标识为第一标识,则基于所述待操作数据的信息对第一命名空间对应的存储单元进行数据操作,所述第一命名空间对应的存储单元用于存储所述电子设备的系统数据;
    第二数据操作单元,用于若所述目标命名空间的标识为第二标识,则基于所述待操作数据的信息对第二命名空间对应的存储单元进行数据操作,所述第二命名空间对应的存储单元用于存储所述电子设备的非系统数据。
  8. 一种电子设备,其特征在于,包括:
    第二通信单元,用于获取固态硬盘的配置信息,所述配置信息用于描述所述固态硬盘中的存储单元的配置情况;
    指令生成单元,用于基于所述配置信息以及待操作数据的信息生成数据操作指令,并向所述固态硬盘发送所述数据操作指令,所述数据操作指令中携带有待操作数据的信息以及所述待操作数据所属的存储单元对应的目标命名空间的标识。
  9. 一种固态硬盘,其特征在于,包括:数据操作装置以及与所述数据操作装置连接的多个存储单元;所述数据操作装置用于执行如权利要求1至4任一项所述的数据操作方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至4任一项或者如权利要求5或6所述的数据操作方法的步骤。
PCT/CN2021/131265 2021-10-08 2021-11-17 一种固态硬盘及其数据操作方法、装置及电子设备 WO2023056687A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111172637.5 2021-10-08
CN202111172637.5A CN115963977A (zh) 2021-10-08 2021-10-08 一种固态硬盘及其数据操作方法、装置及电子设备

Publications (1)

Publication Number Publication Date
WO2023056687A1 true WO2023056687A1 (zh) 2023-04-13

Family

ID=85803140

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/131265 WO2023056687A1 (zh) 2021-10-08 2021-11-17 一种固态硬盘及其数据操作方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN115963977A (zh)
WO (1) WO2023056687A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117055820A (zh) * 2023-10-09 2023-11-14 苏州元脑智能科技有限公司 一种固态硬盘的命令处理方法、固态硬盘和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808163A (zh) * 2016-02-29 2016-07-27 华为技术有限公司 一种访问叠瓦式磁记录smr硬盘的方法及服务器
CN108959108A (zh) * 2017-05-26 2018-12-07 上海宝存信息科技有限公司 固态硬盘访问方法以及使用该方法的装置
CN109062514A (zh) * 2018-08-16 2018-12-21 郑州云海信息技术有限公司 一种基于命名空间的带宽控制方法、装置和存储介质
CN112612924A (zh) * 2020-12-30 2021-04-06 绿盟科技集团股份有限公司 一种数据读取、导出方法、装置、电子设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808163A (zh) * 2016-02-29 2016-07-27 华为技术有限公司 一种访问叠瓦式磁记录smr硬盘的方法及服务器
CN108959108A (zh) * 2017-05-26 2018-12-07 上海宝存信息科技有限公司 固态硬盘访问方法以及使用该方法的装置
CN109062514A (zh) * 2018-08-16 2018-12-21 郑州云海信息技术有限公司 一种基于命名空间的带宽控制方法、装置和存储介质
CN112612924A (zh) * 2020-12-30 2021-04-06 绿盟科技集团股份有限公司 一种数据读取、导出方法、装置、电子设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117055820A (zh) * 2023-10-09 2023-11-14 苏州元脑智能科技有限公司 一种固态硬盘的命令处理方法、固态硬盘和存储介质
CN117055820B (zh) * 2023-10-09 2024-02-09 苏州元脑智能科技有限公司 一种固态硬盘的命令处理方法、固态硬盘和存储介质

Also Published As

Publication number Publication date
CN115963977A (zh) 2023-04-14

Similar Documents

Publication Publication Date Title
US10496335B2 (en) Method and apparatus for performing multi-object transformations on a storage device
US11038749B2 (en) Memory resource allocation in an end-point device
US10067676B2 (en) Hybrid memory drives, computer system, and related method for operating a multi-mode hybrid drive
US10866737B2 (en) Apparatus, method and system to store information for a solid state drive
WO2016093977A1 (en) Apparatus and method for reducing latency between host and a storage device
US9164804B2 (en) Virtual memory module
US11675326B2 (en) Method and apparatus for remote field programmable gate array processing
US20220100425A1 (en) Storage device, operating method of storage device, and operating method of computing device including storage device
CN112148628A (zh) 用于主机管理的存储的卸载碎片整理操作
TWI412934B (zh) 嵌入式控制器記憶體之外部直接記憶體存取
CN111897485A (zh) 一种数据存储方法、装置、电子设备及存储介质
US10853255B2 (en) Apparatus and method of optimizing memory transactions to persistent memory using an architectural data mover
WO2023056687A1 (zh) 一种固态硬盘及其数据操作方法、装置及电子设备
EP4020220A1 (en) Utilizing nand buffer for dram-less multilevel cell programming
TWI749490B (zh) 寫入閃存管理表的電腦程式產品及方法及裝置
CN111897484B (zh) 一种数据存储方法、装置、电子设备及存储介质
TWI670599B (zh) 記憶體管理方法以及儲存控制器
TWI799221B (zh) 寫入資料到閃存記憶體的方法及裝置
US11675680B2 (en) Computing system initialization system
TWI835027B (zh) 更新主機與閃存位址對照表的方法及電腦程式產品及裝置
TWI810876B (zh) 因應主機丟棄命令的資料存取方法及產品電腦程式及裝置
US20240211278A1 (en) Storage device and operating method thereof
US20240311018A1 (en) Storage device, operation method of storage device, and operation method of host device
US20240231698A1 (en) Storage devices and operating methods thereof
TW202336597A (zh) 記憶體控制方法、記憶體儲存裝置及記憶體控制電路單元

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21959774

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE