Computer system and its operating method, storage system, controller and storage medium
By separating internal and external data into separate storage partitions and writing them to different physical storage blocks, the problem of frequent garbage collection in storage systems is solved, extending the lifespan of the memory.
Patent Information
- Application Number
- CN202311035408.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-08-16
AI Technical Summary
In the existing technology, mobile terminals do not distinguish between internal and external data when storing external data, which leads to frequent garbage collection of the storage system and affects the lifespan of the memory.
The memory space is divided into different partitions for internal and external data, and data is written to different physical storage blocks according to the data type, thereby reducing garbage collection operations.
By differentiating write processes based on data type, the number of garbage collections on the physical storage blocks storing external data is reduced, thereby extending the lifespan of the memory.
Smart Images

Figure CN119493515B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to a computer system and its operating method, a storage system, a controller and a storage medium. Background Technology
[0002] With the increasing popularity of mobile devices such as smartphones, many users use the storage in their phones as external hard drives to store external data. Summary of the Invention
[0003] This application provides a computer system and its operating method, a storage system, a controller, and a storage medium, which can reduce the frequency of garbage collection in the storage system and improve the lifespan of the memory while storing external data. The technical solution is as follows:
[0004] On one hand, a computer system is provided, the computer system comprising: a host, a controller, and a memory, wherein the storage space of the memory is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing the computer system, and a second type corresponding to internal data of the electronic device; the host is configured to send a write command to the controller; the write command includes first data to be written to the memory and a logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition; the controller is configured to instruct the memory to write the first data into a physical storage block in the memory corresponding to the logical unit number, according to the logical unit number; wherein the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0005] In an optional embodiment, the controller is configured to determine the physical storage block corresponding to the logical unit number based on the logical unit number, and instruct the memory to write the first data into the physical storage block corresponding to the logical unit number.
[0006] In an optional embodiment, the controller is configured to obtain data attributes of the first data based on the logical unit number; the data attributes are configured to indicate that the first data is external data of the electronic device or internal data of the electronic device; determine a physical storage block corresponding to the logical unit number from the memory based on the data attributes; and instruct the memory to write the first data into the physical storage block corresponding to the logical unit number.
[0007] In an optional embodiment, the correspondence between the logical unit number and the data attributes of the first data is predefined by the protocol; or, the correspondence between the logical unit number and the data attributes of the first data is set when the storage space of the memory is configured in the host as the at least two types of data partitions.
[0008] In an optional embodiment, the controller is configured to, when the data attribute is configured to indicate that the first data is external data of the electronic device, determine at least one physical storage block from the memory that satisfies a first condition as a physical storage block corresponding to the logical unit number; the first condition includes: the physical storage block is not full and no second data is stored, the second data being data in a data partition of the second type; and when the data attribute is configured to indicate that the first data is internal data of the electronic device, determine at least one physical storage block from the memory that satisfies a second condition as a physical storage block corresponding to the logical unit number; the second condition includes: the physical storage block is not full and no third data is stored, the third data being data in a data partition of the first type.
[0009] In an optional embodiment, the correspondence between the type of the data partition and the physical storage block where the data in the data partition is located is a non-fixed configuration relationship; the controller is configured to, when the data attribute is configured to indicate that the first data is external data of the electronic device, determine at least one physical storage block from all writable physical storage blocks of the memory that satisfies the first condition, as the physical storage block corresponding to the logical unit number; and when the data attribute is configured to indicate that the first data is internal data of the electronic device, determine at least one physical storage block from all writable physical storage blocks of the memory that satisfies the second condition, as the physical storage block corresponding to the logical unit number.
[0010] In an optional embodiment, the correspondence between the data partition type and the physical storage block where the data in the data partition is located is a fixed configuration; the controller is configured to, when the data attribute is configured to indicate that the first data is external data of the electronic device, determine at least one physical storage block that is not full from each physical storage block pre-configured for the first type of data partition, as the physical storage block corresponding to the logical unit number; and when the data attribute is configured to indicate that the first data is internal data of the electronic device, determine at least one physical storage block that is not full from each physical storage block pre-configured for the second type of data partition, as the physical storage block corresponding to the logical unit number.
[0011] In an optional embodiment, the controller is further configured to set the data type of the first data according to the type of the data partition to which the first data is written; wherein the data type is used to manage the first data or the physical storage block where the first data resides.
[0012] In an optional embodiment, the data type includes either cold data or hot data.
[0013] In an optional embodiment, the host is further configured to display an uninstallation control on an interactive interface when the first type of data partition is loaded; and to uninstall the first type of data partition in the host's resource manager interface upon receiving a trigger operation on the uninstallation control.
[0014] In an optional embodiment, the host is further configured to display a loading control on the interactive interface when the first type of data partition is not loaded; and to load the first type of data partition in the resource manager interface of the host upon receiving a trigger operation on the loading control.
[0015] In an optional embodiment, the host is further configured to, in response to the electronic device being coupled to an external device via a Universal Serial Bus interface, display a trigger control on an interactive interface corresponding to the first type of data partition; and, upon receiving a selection operation on the trigger control, allow access to the first type of data partition on the external device side.
[0016] On the other hand, a method for operating a computer system is provided, the computer system including a host, a controller, and a memory, the storage space of the memory being divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing the computer system, and a second type corresponding to internal data of the electronic device; the method includes: the host sending a write command to the controller; the write command including first data to be written to the memory and a logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition; the controller instructing the memory to write the first data into a physical storage block in the memory corresponding to the logical unit number according to the logical unit number; wherein the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0017] In an optional embodiment, the controller instructs the memory to write the first data into the physical storage block corresponding to the logical unit number based on the logical unit number, including: the controller determines the physical storage block corresponding to the logical unit number based on the logical unit number, and instructs the memory to write the first data into the physical storage block corresponding to the logical unit number.
[0018] In an optional embodiment, the controller determines the physical storage block corresponding to the logical unit number based on the logical unit number, and instructs the memory to write the first data into the physical storage block corresponding to the logical unit number, including: the controller obtaining data attributes of the first data based on the logical unit number; the data attributes being configured to indicate that the first data is external data of the electronic device or internal data of the electronic device; the controller determining the physical storage block corresponding to the logical unit number from the memory based on the data attributes, and instructing the memory to write the first data into the physical storage block corresponding to the logical unit number.
[0019] In an optional embodiment, the correspondence between the logical unit number and the data attributes of the first data is predefined by the protocol; or, the correspondence between the logical unit number and the data attributes of the first data is set when the storage space of the memory is configured in the host as the at least two types of data partitions.
[0020] In an optional embodiment, the controller determines the physical storage block corresponding to the logical unit number from the memory based on the data attribute, including: when the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a first condition as the physical storage block corresponding to the logical unit number; the first condition includes: the physical storage block is not full and no second data is stored, the second data being data in a data partition of the second type; when the data attribute is configured to indicate that the first data is not external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a second condition as the physical storage block corresponding to the logical unit number; the second condition includes: the physical storage block is not full and no third data is stored, the third data being data in a data partition of the first type.
[0021] In an optional embodiment, the correspondence between the data partition type and the physical storage block where the data in the data partition resides is a non-fixed configuration. When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a first condition as the physical storage block corresponding to the logical unit number. This includes: when the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from all writable physical storage blocks of the memory that satisfies the first condition as the physical storage block corresponding to the logical unit number. When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a second condition as the physical storage block corresponding to the logical unit number. This includes: when the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block from all writable physical storage blocks of the memory that satisfies the second condition as the physical storage block corresponding to the logical unit number.
[0022] In an optional embodiment, the correspondence between the data partition type and the physical storage block where the data in the data partition is located is a fixed configuration. When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a first condition as the physical storage block corresponding to the logical unit number. This includes: when the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block that is not full from each physical storage block pre-configured for the first type of data partition as the physical storage block corresponding to the logical unit number. When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a second condition as the physical storage block corresponding to the logical unit number. This includes: when the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block that is not full from each physical storage block pre-configured for the second type of data partition as the physical storage block corresponding to the logical unit number.
[0023] In an optional embodiment, the method further includes: the controller setting the data type of the first data according to the type of the data partition to which the first data is written; wherein the data type is used to manage the first data or the physical storage block where the first data is located.
[0024] In an optional embodiment, the data type includes either cold data or hot data.
[0025] In an optional embodiment, the method further includes: when the first type of data partition has been loaded, the host displays an uninstallation control on an interactive interface; and when a trigger operation on the uninstallation control is received, the host uninstalls the first type of data partition in the interface of its resource manager.
[0026] In an optional embodiment, the method further includes: when the first type of data partition is not loaded, the host displays a loading control on an interactive interface; and when a trigger operation on the loading control is received, the first type of data partition is loaded in the interface of the host's resource manager.
[0027] In an optional embodiment, the method further includes: the host, in response to the electronic device being coupled to an external device via a Universal Serial Bus interface, displaying a trigger control corresponding to the first type of data partition on an interactive interface; and, upon receiving a selection operation on the trigger control, allowing access to the first type of data partition on the external device side.
[0028] On the other hand, a storage system is provided, the storage system including a controller and a memory, the storage space of the memory being divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; the computer system includes the storage system;
[0029] The controller is configured to receive a write command; the write command includes first data to be written to the memory and a logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition;
[0030] The controller is further configured to instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, based on the logical unit number.
[0031] The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0032] On the other hand, a controller is provided, the controller including a memory interface and a storage controller; the memory interface is used to connect a host and a memory; the storage space of the memory is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; the computer system includes the host, the controller, and the memory;
[0033] The memory interface is configured to receive a write command sent by the host; the write command includes first data to be written to the memory and a logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition;
[0034] The storage controller is configured to instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, based on the logical unit number.
[0035] The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0036] On the other hand, a method for operating a storage system is provided, the storage system including a controller and a memory, the storage space of the memory being divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; the computer system includes the storage system; the method is executed by the controller, and the method includes:
[0037] Receive a write command; the write command includes first data to be written to the memory and the logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition;
[0038] Based on the logical unit number, instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number;
[0039] The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0040] On the other hand, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium stores instructions that, when executed on a controller, implement all or part of the steps performed by the controller in the operation method of the computer system as shown in any of the above embodiments; the controller is the controller in the computer system shown above.
[0041] The technical solution provided in this application may include the following beneficial effects:
[0042] In a computer system comprising a host, controller, and memory, the memory's storage space is divided into different data partitions according to data types (i.e., external and internal data of electronic devices). Different types of data partitions correspond to different physical storage blocks in the memory. When the host sends a write command to the controller, the logical cell number in the write command is specified by the data partition type. The controller instructs the memory to write the first data into the physical storage block corresponding to the logical cell number. Through the above process, external and internal data can be written into different physical storage blocks in the memory. Garbage collection is performed on a per-physical-block basis. In other words, read and write operations on internal data do not affect the physical storage block where external data resides. Since external data is typically not read or written as frequently as internal data, garbage collection rarely occurs on the physical storage block where external data is written. Therefore, by using the above scheme, when storing external data in the storage system, the number of garbage collections on the physical storage blocks storing external data in the storage system can be reduced, thereby improving the lifespan of the memory. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a schematic diagram of a computer system provided in one embodiment of this application;
[0045] Figure 2 This is a schematic diagram of the structure of a memory card involved in this application;
[0046] Figure 3 This is a schematic diagram of the structure of a solid-state driver involved in this application;
[0047] Figure 4 This is a block diagram of a memory illustrated in an exemplary embodiment of this application;
[0048] Figure 5 This is a schematic circuit diagram of a memory shown in an exemplary embodiment of this application;
[0049] Figure 6 This is a perspective view of a portion of a three-dimensional storage array structure shown in an exemplary embodiment of this application;
[0050] Figure 7 This is a schematic diagram of data storage on a physical storage block, as described in this application;
[0051] Figure 8 This is a framework diagram of a computer system provided in an exemplary embodiment of this application;
[0052] Figure 9 This is a schematic diagram of data storage on a physical storage block, as described in this application;
[0053] Figure 10 This is a schematic diagram illustrating a data storage location change involved in this application;
[0054] Figure 11 This is a schematic diagram illustrating another data storage location change involved in this application;
[0055] Figure 12 This is a schematic diagram illustrating an external data writing setting involved in this application;
[0056] Figure 13 This is a schematic diagram illustrating the data partitioning and unloading of external data involved in this application;
[0057] Figure 14 This is a schematic diagram illustrating the loading of external data partitions, which is a feature of this application.
[0058] Figure 15 This is a schematic diagram of the device connections involved in this application;
[0059] Figure 16 This is a flowchart of an operation method of a computer system provided in an exemplary embodiment of this application;
[0060] Figure 17 This is a structural block diagram of a storage system provided in an exemplary embodiment of this application;
[0061] Figure 18 This is a schematic diagram of the controller structure provided in an exemplary embodiment of this application;
[0062] Figure 19 This is a flowchart of an operation method of a storage system provided in another exemplary embodiment of this application. Detailed Implementation
[0063] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0064] The computer system provided in this application embodiment may include a host and a storage system. The storage system may include 3D memory, such as 3D NAND flash memory.
[0065] Figure 1 This is a schematic diagram of a computer system provided in one embodiment of this application. Figure 1As shown, the computer system 10 includes: one or more memories 100, and a controller 200 coupled to the memories 100 and configured to control the memories 100. The controller 200 may also be referred to as a memory controller.
[0066] Controller 200 can be configured to control operations performed by memory 100, such as read, erase, and program operations. Controller 200 can also be configured to manage various functions related to data stored or to be stored in memory 100, including but not limited to bad block management, garbage collection, logical address to physical address translation, and wear leveling. Optionally, controller 200 can also be configured to handle error correcting codes (ECCs) for data read from or written to memory 100. Controller 200 can also perform any other suitable functions, such as formatting memory 100.
[0067] The controller 200 can also communicate with external devices according to specific communication protocols. For example, the controller 200 can communicate with external devices through at least one of various interface protocols. The interface protocol can be the Universal Serial Bus (USB) protocol, the Multi-Media Card (MMC) protocol, the Peripheral Component Interconnect (PCI) protocol, the PCI-E protocol, the Advanced Technology Attachment (ATA) protocol, the Serial ATA protocol, the Parallel ATA protocol, the Small Computer System Interface (SCSI) protocol, the Enhanced Small Drive Interface (ESDI) protocol, the Integrated Development Environment (IDE) protocol, the FireWire protocol, etc.
[0068] In an optional embodiment, the controller 200 and one or more memories 100 can be integrated into various types of electronic devices. These electronic devices can be mobile phones, desktop computers, laptop computers, tablet computers, vehicle computers, game consoles, printers, positioning devices, wearable electronic devices, smart sensors, virtual reality (VR) devices, augmented reality (AR) devices, or any other suitable electronic device having storage therein. In this scenario, such as... Figure 1As shown, the computer system 10 also includes a host 300. A controller 200 is coupled to the host 300. The controller 200 can manage data stored in the memory 100 and communicate with the host 300 to perform the functions of the aforementioned electronic device.
[0069] In other embodiments, the controller 200, and one or more memories 100, can be integrated into various types of storage devices.
[0070] As an example, Figure 2 This is a schematic diagram of the structure of a memory card involved in this application. Figure 2 As shown, the controller 200 and a single memory 100 can be integrated into the memory card 40. The memory card 40 may include PCMCIA (PC) cards, Compact Flash (CF) cards, Smart Media (SM) cards, memory sticks, Multi-Media Cards (MMC), RS-MMC, micro-MMC, Secure Digital (SD) cards, Universal Flash Storage (UFS), etc. Figure 2 As shown, the memory card 40 may also include a connector 41 that couples the memory card 40 to the host.
[0071] As another example Figure 3 This is a schematic diagram of the structure of a solid-state drive involved in this application. Figure 3 As shown, the controller 200 and multiple memories 100 can be integrated into a solid-state drive (SSD) 50. The solid-state drive 50 may also include a connector 51 that couples the solid-state drive 50 to the host. The storage capacity and / or operating speed of the solid-state drive 50 is greater than that of the memory card 40.
[0072] also, Figures 1 to 3 The memory 100 can be any memory involved in the embodiments of this application. For example, it can be a 3D NAND (NAND gate) memory. The structure of the memory 100 will be explained below.
[0073] Figure 4 This is a block diagram illustrating a memory according to an exemplary embodiment of this application. (Reference) Figure 4The memory 400 may include a memory cell array 401, a page buffer 404, a column decoder 406, a row decoder 408, a voltage generator 410, a control logic unit 412, a register 414, and data input / output circuitry 416. It should be understood that in some examples, it may also include... Figure 4 Additional peripheral circuitry not shown.
[0074] Page buffer 404 can be configured to read data from memory cell array 401 and program (write) data to memory cell array 401 according to control signals from control logic unit 412. In one example, page buffer 404 can store data to be programmed into selected page 420 of memory cell array 401 (write data). In another example, page buffer 404 can output read data in a programming verification operation to ensure that data has been correctly programmed into the corresponding memory cell coupled to the selected word line of memory cell array 401. Column decoder 406 can operate in response to control signals provided by control logic unit to select one or more NAND memory strings in memory cell array 401. Row decoder can operate in response to control signals provided by control logic unit and select / deselect selected rows of memory cell array 401. Row decoder can also be configured to supply voltage generated from voltage generator 410 to selected and unselected word lines of memory cell array 401. As described in detail below, row decoder / word line driver 408 is configured to perform erase operations on memory cells coupled to one or more selected word lines of memory cell array 401. Voltage generator 410 can use external or internal power supply voltages to generate various voltages required by the memory, such as programming voltage, read voltage, pass voltage, verification voltage, bit line voltage, and combinations thereof.
[0075] Control logic unit 412 can be coupled to voltage generator 410, page buffer 404, column decoder 406, row decoder 408, and data input / output circuit 416, etc., and is configured to control the operation of each peripheral circuit. Control logic unit can generate operation signals in response to commands or control signals from the memory controller. Register 414 can be coupled to control logic unit 412 and includes a status register, command register, and address register for storing status information, command opcode (OP code), and command address for controlling the operation of each peripheral circuit. Data input / output circuit 416 can be coupled to control logic unit 412 and acts as a control buffer to buffer control commands received from the host (not shown) and relay them to control logic unit 412, and to buffer status information received from control logic unit 412 and relay it to the host. Data input / output circuit 416 can also be coupled to column decoder and acts as a data input / output interface and data buffer to buffer data and relay it to or from memory cell array 401.
[0076] Figure 5 This is a schematic circuit diagram of a memory shown in an exemplary embodiment of this application. Figure 5 As shown, memory 500 may include a memory cell array device 501 and peripheral circuitry 502 coupled to the memory cell array device 501. The memory cell array device 501 may be a NAND flash memory cell array, wherein memory cells 506 are provided in the form of an array of NAND memory strings 508, each NAND memory string 508 extending vertically above a substrate (not shown). In some embodiments, each NAND memory string 508 includes a plurality of memory cells 506 coupled in series and stacked vertically. Each memory cell 506 may be a floating-gate type memory cell including a floating-gate transistor, or a charge-trapping type memory cell including a charge-trapping transistor. In some embodiments, each memory cell 506 is a single-level cell (SLC) having two possible memory states and capable of storing one bit of data. For example, a first memory state "0" may correspond to a first voltage range, and a second memory state "1" may correspond to a second voltage range. In some embodiments, each memory cell 306 is a multi-level cell capable of storing more than a single bit of data in more than two memory states. For example, it can store two bits per cell (MLC), three bits per cell (TLC), or four bits per cell (QLC).
[0077] like Figure 5As shown, each NAND memory string 508 may include at least one source select transistor 510 at its source end and at least one drain select transistor 512 at its drain end. The source select transistor 510 and drain select transistor 512 may be configured to activate a selected NAND memory string 508 during read and program operations. In some embodiments, the sources of NAND memory strings 508 in the same block 504 are coupled via the same source line (SL) 514. According to some embodiments, the drain select transistor 512 of each NAND memory string 508 is coupled to a corresponding bit line 516. In some embodiments, each NAND memory string 508 is configured to be selected or deselected by applying a select voltage or deselect voltage (e.g., 0V) to the corresponding drain select transistor 512 via one or more drain select lines and / or by applying a select voltage or deselect voltage (e.g., 0V) to the corresponding source select transistor 510 via one or more source select lines.
[0078] like Figure 5 As shown, a storage array unit may include multiple blocks. In some embodiments, each block 504 is a basic data unit for an erase operation, that is, all memory cells 506 on the same block 504 are erased simultaneously.
[0079] Figure 6 This is a perspective view of a portion of a three-dimensional memory array structure illustrated in an exemplary embodiment of this application. The memory cell array structure 600 includes a substrate 630 and a stacked structure above the substrate 630. The stacked structure includes alternately stacked gate conductive layers and interlayer dielectric layers. The substrate 630 may include silicon (e.g., single-crystal silicon), silicon-germanium (SiGe), gallium arsenide (GaAs), germanium (Ge), silicon-on-insulator (SOI), germanium-on-insulator (GOI), or any other suitable material. The gate conductive layers may include conductive materials, including but not limited to tungsten (W), cobalt (Co), copper (Cu), aluminum (Al), polycrystalline silicon, doped silicon, silicides, or any combination thereof. In some embodiments, each gate conductive layer includes a metal layer, such as a tungsten layer. In some embodiments, each gate conductive layer includes a doped polycrystalline silicon layer. The gate conductive layers may include multiple word lines 633, at least one source select line 632, and at least one drain select line 634.
[0080] like Figure 6 As shown, the memory cell array 600 includes a plurality of channel structures 612 extending vertically through the memory stack structure 635. In some embodiments, the channel structure 612 includes a memory film 637 and a channel 638. Figure 6As shown, according to some embodiments, a well 644 (e.g., a P-well and / or an N-well) is formed in the substrate 630, and the source ends of the memory cell array are in contact with the well 644. It should be understood that, although... Figure 6 Additional components that may form the memory cell array 600, but not shown in the diagram, include (but are not limited to) gate line slits / source contacts, local contacts, interconnect layers, etc.
[0081] For any technical details not disclosed in the above memory-related hardware embodiments, please refer to the descriptions of the computer system embodiments and method embodiments of this application for understanding.
[0082] In this embodiment of the application, the data in the computer system can be divided into internal data and external data.
[0083] Internal data: This can be the code and resource data of the operating system and applications running in the electronic device where the computer system resides, as well as the data generated during the operation of the operating system and applications; for example, the data generated during the operation of the operating system can include data such as the operating system's running logs, and the data generated during the operation of the applications can include cached data generated during the operation of the applications (such as web page cache, chat history cache, etc.), file data downloaded from the network (such as downloaded audio, video, pictures, documents, etc.), etc.
[0084] External data: This can be data copied by the user from other devices to the storage of the electronic device. For example, if the electronic device is a mobile phone, external data can be file data copied by the user from a personal computer to the mobile phone via a USB connection cable, such as various types of documents, pictures, videos, audio, etc.
[0085] In related technologies, when a user uses a mobile terminal as a portable hard drive to store external data, the mobile terminal can be coupled to a personal computer via a Universal Serial Bus (USB) cable. The user can then copy data from the personal computer (i.e., the mobile terminal's external data) to the mobile terminal's storage space through the PC's file explorer interface. Subsequently, the mobile terminal's storage system controller writes this external data into the mobile terminal's memory. However, the types of external and internal data on a mobile terminal are different. Writing external data to the memory increases the frequency of garbage collection in the storage system, affecting the memory's lifespan.
[0086] Specifically, current electronic devices (such as mobile phones, tablets, and other mobile terminals) do not distinguish between internal and external data when writing data. When a user uses an electronic device to store external data (for example, copying a document from a personal computer to a mobile phone), the host in the computer system of the electronic device sends a write command to the controller to write the document data. The controller, based on the write command, instructs the memory to write the document data into the memory.
[0087] Since a page is the basic unit of data used for programming operations, meaning that the smallest unit of programming operation when the memory is writing data is a page, the following situation occurs: When the controller instructs the memory to write external data (such as document data), if a physical storage block (which in some scenarios may also be called a block, storage block, or flash memory block, for example...) ... Figure 4 When a writable page exists in block 140 of the physical storage block, the document data may be written to the writable page in that physical storage block, regardless of whether other pages in that physical storage block store internal data. In other words, a physical storage block may contain some pages storing external data and others storing internal data.
[0088] For example, please refer to Figure 7 This illustrates a schematic diagram of data storage on a physical storage block, as described in this application. Figure 7 As shown, assuming physical storage block 70 in the memory corresponds to 12 pages, when writing external data to the memory, it is possible that 6 pages in physical storage block 70 store internal data, and the other 6 pages store external data. Since internal data may be frequently accessed by the host, while external data is usually not accessed frequently, such as... Figure 7 In the physical storage block 70 shown, the internal data in 6 pages may become invalid after a period of time, while the external data in the other 6 pages will remain valid. If the storage system triggers a garbage collection operation, it will perform garbage collection on physical storage block 70, which means transferring the external data of the other 6 pages in physical storage block 70 to another physical storage block 71 for erasure of physical storage block 70. At this time, other pages in physical storage block 71 besides storing the external data may also store internal data, or new internal data may be written to other pages in physical storage block 71 besides storing the external data. After a period of time, another garbage collection operation may be required on physical storage block 71.
[0089] Combination Figure 7It is evident that when storing external data in a storage system, the difference in access frequency between external and internal data leads to frequent garbage collection of the physical storage blocks storing external data, thus affecting the lifespan of the physical storage blocks.
[0090] In response, the solution shown in the subsequent embodiments of this application distinguishes between the writing of external data and internal data, that is, during the data writing process, external data and internal data are written to different physical storage blocks.
[0091] Please refer to Figure 8 This is a framework diagram of a computer system provided in an exemplary embodiment of this application. The computer system can be as follows: Figure 1 System 10 is shown. (e.g.) Figure 8 As shown, the computer system includes a host 810, a controller 820, and a memory 830.
[0092] The storage space of memory 830 is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device.
[0093] The storage space of the aforementioned memory 830 is divided into at least two types of data partitions. This can be understood as follows: the storage space of the memory 830 is a logical storage space, which is divided into at least two logical types of data partitions.
[0094] Alternatively, the storage space of the aforementioned memory 830 can be divided into at least two types of data partitions. This can also be understood as follows: the storage space of the memory 830 is a physical storage space, and the logical space corresponding to this storage space is divided into at least two logical types of data partitions.
[0095] Furthermore, the above-mentioned data partitions include at least two types, namely a first type and a second type, wherein the first type corresponds to external data and the second type corresponds to internal data.
[0096] Each type of data partition may contain one or more data partitions. This application does not limit the number or capacity of each type of data partition in its embodiments.
[0097] For example, such as Figure 8 As shown, on the host 810 side, the storage space of the memory 830 is divided into a first type of data partition 810a corresponding to external data, and a second type of data partition 810b corresponding to internal data; wherein, Figure 8The first type of data partition 810a shown contains one data partition (data partition 3), and the second type of data partition 810b contains two data partitions (data partition 1 and data partition 2). Optionally, the first type of data partition 810a may also contain more data partitions. Correspondingly, the second type of data partition 810b may contain only one data partition or three or more data partitions.
[0098] The host 810 is configured to send a write command to the controller 820; the write command includes first data to be written to the memory and the logical cell number to which the first data is to be written, wherein the logical cell number is specified according to the type of data partition; the controller 820 is configured to instruct the memory 830 to write the first data to the physical storage block in the memory corresponding to the logical cell number according to the logical cell number; wherein the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0099] When the host 810 needs to write the first data, it can specify the logical unit number (LUN) to which the first data is to be written in the write command. The logical unit number is associated with the type of the data partition corresponding to the first data.
[0100] Specifically, when the first data is external data, the LUN number in the write command is specified by the first type, and the first data will be written to the physical storage block corresponding to the data partition of the first type; when the first data is external data, the LUN number in the write command is specified by the second type, and the first data will be written to the physical storage block corresponding to the data partition of the second type.
[0101] In this system, different logical unit numbers can correspond to different physical storage blocks. Furthermore, the logical unit number corresponding to the first type of data partition can be different from the logical unit number corresponding to the second type of data partition. In this case, in the aforementioned computer system, the data of the first type of data partition (external data) will be written to the physical storage block corresponding to the external data, while the data of the second type of data partition (internal data) will be written to the physical storage block corresponding to the internal data. The physical storage blocks on which the internal and external data are written are different. That is to say, in the aforementioned computer system, a single physical storage block will not simultaneously store both internal and external data.
[0102] For example, such as Figure 8As shown, file 810c is external data, and file 810d is internal data. When host 810 writes data to file 810c, the LUN number in the write command is specified by the first type. At this time, controller 820 instructs memory 830 to write data to physical storage block 830a corresponding to the data partition of the first type. When host 810 writes data to file 810d, the LUN number in the write command is specified by the second type. At this time, controller 820 instructs memory 830 to write data to physical storage block 830b corresponding to the data partition of the second type. Physical storage block 830a and physical storage block 830b are different physical storage blocks.
[0103] For example, please refer to Figure 9 This illustrates a schematic diagram of data storage on a physical storage block, as described in this application. Figure 9 As shown, it is assumed that physical storage block 90 and physical storage block 91 in the memory of the computer system involved in this application correspond to 12 pages respectively. Among them, physical storage block 90 is the physical storage block corresponding to the first type of data partition, and physical storage block 91 is the physical storage block corresponding to the second type of data partition.
[0104] like Figure 9 As shown, when the host writes external data to the memory, the LUN in the write command is specified by the first type, corresponding to the LUN of physical storage block 90. The controller instructs the memory to write the external data to 6 pages in physical storage block 90. Correspondingly, when the host writes internal data to the memory, the LUN in the write command is specified by the second type, corresponding to the LUN of physical storage block 91. The controller instructs the memory to write the internal data to 6 pages in physical storage block 91. After a period of time, the external data in physical storage block 90 remains valid as it has not been read, while the external data in physical storage block 91 becomes invalid after being read. At this time, the storage system will perform garbage collection on physical storage block 91, but will not perform garbage collection on physical storage block 90.
[0105] Combination Figure 9 As can be seen, when storing external data in a storage system, since the external data and internal data are written to different physical storage blocks, garbage collection of the physical storage block where the internal data is located will not affect the physical storage block where the external data is located. This can reduce the number of garbage collections of the physical storage block storing external data and increase the lifespan of the corresponding physical storage block.
[0106] In summary, the computer system involved in this application, which includes a host, a controller, and a memory, divides the memory space into different data partitions according to data types (i.e., external and internal data of the electronic device). Different types of data partitions correspond to different physical storage blocks in the memory. When the host sends a write command to the controller, the logical unit number in the write command is specified by the type of the data partition. The controller instructs the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number. Through the above processing, external data and internal data can be written into different physical storage blocks in the memory. Garbage collection is performed on a physical storage block basis. That is to say, read and write operations on internal data will not affect the physical storage block where external data is located. Since external data is usually not read and written frequently compared to internal data, garbage collection operations rarely occur on the physical storage block in the memory where external data is written. Therefore, it can be seen that by using the above scheme, when storing external data in the storage system, the number of garbage collections on the physical storage blocks storing external data in the storage system can be reduced, thereby improving the lifespan of the memory.
[0107] based on Figure 8 In an optional embodiment of the computer system shown, the controller 820 can be configured to determine the physical storage block corresponding to the logical unit number based on the logical unit number, and instruct the memory 830 to write the first data into the physical storage block corresponding to the logical unit number.
[0108] In the above embodiment, the controller 820 can determine the physical storage block corresponding to the LUN carried by the write command from each physical storage block in the memory 830. Since the logical unit number is specified according to the type of data partition, and it is necessary to ensure that the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition, the physical storage block determined by the controller 820 corresponding to the logical unit number is a different physical storage block for external data and internal data.
[0109] The physical storage block corresponding to the logical unit number mentioned above can refer to one or more physical storage blocks among the various physical storage blocks that allow data to be written into the data partition of the type corresponding to the logical unit number.
[0110] For example, when the first data is external data, the physical storage block corresponding to the logical unit number is one or more physical storage blocks among the physical storage blocks that allow the first data to be written.
[0111] For example, when the first data mentioned above is internal data, the physical storage block corresponding to the logical unit number is one or more physical storage blocks among the physical storage blocks that allow the second data to be written.
[0112] The aforementioned physical storage blocks that allow data to be written into the data partition of the type corresponding to the logical unit number can refer to physical storage blocks that have a fixed association with the logical unit number. In other words, in an optional embodiment, when the controller 820 determines the physical storage block corresponding to the logical unit number based on the logical unit number, it can determine the physical storage block corresponding to the logical unit number based on the association between the logical unit number and the physical storage block.
[0113] In an optional embodiment, when the controller 820 determines the physical storage block corresponding to the logical unit number based on the logical unit number, it may first determine each physical storage block associated with the logical unit number, and then determine one or more unfilled physical storage blocks from each physical storage block associated with the logical unit number as the physical storage block corresponding to the logical unit number.
[0114] In an optional embodiment, the association between the above logical unit number and each physical storage block can be the complete association between the logical unit number and each physical storage block.
[0115] In other embodiments, the association between the aforementioned logical unit number and each physical storage block can be the association between one or more bits of the logical unit number and each physical storage block. For example, in an 8-bit logical unit number, one or more bits (such as the most significant bit or the second most significant bit) are used to indicate the type of data partition corresponding to this logical unit number. For example, "1" indicates that the type of data partition corresponding to this logical unit number is the first type (corresponding to external data), and "0" indicates that the type of data partition corresponding to this logical unit number is the second type (corresponding to internal data). The controller 820 can determine the physical storage blocks associated with the logical unit number based on the value of this bit, and then determine one or more unfilled physical storage blocks among the physical storage blocks associated with the logical unit number as the physical storage blocks corresponding to the logical unit number.
[0116] In an optional embodiment, the association between logical unit numbers and various physical storage blocks can be pre-stored in the cache of the controller 820 or in the memory 830. This association can be stored in the form of a relational table or relational items. For example, the association between the logical unit numbers and various physical storage blocks can be set when the storage space of the memory 830 is configured in the host as at least two types of data partitions. For example, during the system setup process before the electronic device leaves the factory, the storage space of the memory 830 can be configured in the host as at least two types of data partitions, and logical unit numbers corresponding to each type of data partition can be assigned. At the same time, the association between the logical unit numbers and various physical storage blocks in the memory 830 can be configured. Alternatively, during the first boot of the operating system of the electronic device / during the user's factory reset process, the host guides the user to configure a portion of the storage space in the memory 830 of the electronic device as external data storage space. After the user configures the external data storage space, the host configures the storage space of the memory 830 as at least two types of data partitions, and logical unit numbers corresponding to each type of data partition can be assigned. At the same time, the controller 820 configures the association between the logical unit numbers and various physical storage blocks in the memory 830.
[0117] In other embodiments, the association between the aforementioned logical unit number and each physical storage block can also be predefined in the firmware; for example, the association between the aforementioned logical unit number and each physical storage block can be predefined by the protocol.
[0118] In other embodiments, the association between the logical unit number and the physical storage block can also be an implicit association. For example, the controller 820 is configured to obtain the data attribute of the first data according to the logical unit number. The data attribute is configured to indicate that the first data is external data of the electronic device or internal data of the electronic device. Based on the data attribute, the controller determines the physical storage block corresponding to the logical unit number from the memory and instructs the memory 830 to write the first data into the physical storage block corresponding to the logical unit number.
[0119] In the above embodiments, the correspondence between logical unit numbers and data attributes can be pre-stored in the cache of the controller 820 or in the memory 830, or the correspondence between logical unit numbers and data attributes can be pre-defined in the firmware of the controller 820. After receiving a write command, the controller 820 can determine the data attribute of the first data according to the logical unit number in the write command, that is, determine whether the first data is external data or internal data, and then determine the physical storage block corresponding to the logical unit number from the memory according to the data attribute.
[0120] In an optional embodiment, the controller 820 is configured to, when a data attribute is configured to indicate that the first data is external data of the electronic device, determine at least one physical storage block from the memory that satisfies a first condition as a physical storage block corresponding to a logical unit number; the first condition includes: the physical storage block is not full and no second data is stored, the second data being data in a second type of data partition; or, the controller 820 determines at least one physical storage block that is not full from other storage blocks besides the physical storage block where the data in the second type of data partition is located, as a physical storage block corresponding to the logical unit number; when a data attribute is configured to indicate that the first data is internal data of the electronic device, determine at least one physical storage block from the memory that satisfies a second condition as a physical storage block corresponding to the logical unit number; the second condition includes: the physical storage block is not full and no third data is stored, the third data being data in a first type of data partition; or, the controller 820 determines at least one physical storage block that is not full from other storage blocks besides the physical storage block where the data in the first type of data partition is located, as a physical storage block corresponding to the logical unit number.
[0121] In the above embodiments, when the first data is external data, the physical storage block corresponding to the logical unit number determined by the controller 820 will not contain internal data. Similarly, when the first data is internal data, the physical storage block corresponding to the logical unit number determined by the controller 820 will not contain external data. Thus, during the data writing process, the physical storage blocks where the external data and the internal data are located in the memory are isolated.
[0122] In an optional embodiment, the correspondence between the type of data partition and the physical storage block where the data in the data partition resides is a non-fixed configuration relationship; the controller 820 is configured to: when the data attribute is configured to indicate that the first data is external data of the electronic device, determine at least one physical storage block satisfying a first condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number; when the data attribute is configured to indicate that the first data is internal data of the electronic device, determine at least one physical storage block satisfying a second condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number.
[0123] The correspondence between the data partition type and the physical storage block where the data in the data partition is located is a non-fixed configuration. This means that whether it is external or internal data, when it is written to the memory, it may be written to any physical storage block in the memory, as long as external data and internal data do not exist on the same physical storage block at the same time. In other words, after the data partition is set, the logically expressed data partition does not have a fixed corresponding physical storage block. When data is written, the controller 820 allocates the corresponding physical storage block for the data to be written, and only then do these allocated physical storage blocks correspond to the data partition where the data is located.
[0124] Accordingly, when the controller 820 instructs the memory 830 to write the first data, it can combine the data attributes of the first data to find, from all available physical storage blocks in the memory 830, a physical storage block that is not currently full (including physical storage blocks where all pages or some pages are empty) and satisfies the condition that external data and internal data do not exist on the same physical storage block at the same time. Specifically, when the data attributes of the first data indicate that it is external data, the controller 820 determines from all available physical storage blocks in the memory 830 one or more physical storage blocks that are not currently full and do not contain internal data, and instructs the memory 830 to write the first data into the one or more physical storage blocks. Alternatively, when the data attributes of the first data indicate that it is internal data, the controller 820 determines from all available physical storage blocks in the memory 830 one or more physical storage blocks that are not currently full and do not contain external data, and instructs the memory 830 to write the first data into the one or more physical storage blocks.
[0125] With the above scheme, for a certain physical storage block in the memory, at a certain moment, one type of data, external data and internal data, can be written into the physical storage block. After a period of reading, writing and garbage collection, at another subsequent moment, the other type of data, external data and internal data, can be written into the physical storage block. However, at any given moment, only one type of data, external data and internal data, is stored in the physical storage block.
[0126] For example, please refer to Figure 10 This illustration shows a schematic diagram of a data storage location change related to this application. For example... Figure 10 As shown, at time 1, external data 1 is stored on physical storage block 1001 and internal data 2 is stored on physical storage block 1002. In the subsequent read and write process, internal data 2 is written to physical storage block 1003 and physical storage block 1002 is reclaimed. At this time, physical storage block 1002 is an empty physical storage block. At the subsequent time 2, external data 1 on physical storage block 1001 can be written to physical storage block 1002.
[0127] From the above Figure 10 It is evident that each physical storage block in the memory can be used to store different types of data at different times, thereby ensuring the flexibility of the physical storage block in storing different types of data and thus ensuring the utilization rate of the physical storage block.
[0128] In an optional embodiment, the correspondence between the data partition type and the physical storage block where the data in the data partition is located is a fixed configuration; the controller 820 is configured to: when the data attribute is configured to indicate that the first data is external data of the electronic device, determine at least one physical storage block that is not full from each physical storage block of the data partition pre-configured for the first type, as the physical storage block corresponding to the logical unit number; when the data attribute is configured to indicate that the first data is internal data of the electronic device, determine at least one physical storage block that is not full from each physical storage block of the data partition pre-configured for the second type, as the physical storage block corresponding to the logical unit number.
[0129] The correspondence between the data partition type and the physical storage block where the data in the data partition resides is a fixed configuration. This means that for a physical storage block, the data written to that physical storage block at different times is the same type of data, both external and internal. In other words, at different times, that physical storage block will only be written with either external or internal data. Specifically, a portion of the physical storage blocks in the memory has been pre-allocated for external data use, and another portion has been pre-allocated for internal data use, with no overlap between these two portions. Correspondingly, when the controller 820 instructs the memory 830 to write the first data, it can combine the data attributes of the first data and retrieve the corresponding data attributes from the memory 830. In a subset of physical storage blocks, the controller 820 identifies physical storage blocks that are not currently full (including physical storage blocks where all pages or some pages are empty). Specifically, when the data attribute of the first data indicates that it is external data, the controller 820 determines one or more physical storage blocks that are not currently full from the physical storage blocks in the memory 830 that have been pre-allocated for external data use, and instructs the memory 830 to write the first data into the one or more physical storage blocks. Alternatively, when the data attribute of the first data indicates that it is internal data, the controller 820 determines one or more physical storage blocks that are not currently full from the physical storage blocks in the memory 830 that have been pre-allocated for internal data use, and instructs the memory 830 to write the first data into the one or more physical storage blocks.
[0130] With the above scheme, for a certain physical storage block, at a certain moment, one type of data, external data or internal data, can be written into the physical storage block. After a period of read, write and garbage collection, at another subsequent moment, the same type of data can be written into the physical storage block. The other type of data, external data or internal data, will not be written into it. In other words, at different times, the physical storage block only stores one type of data, external data or internal data.
[0131] For example, please refer to Figure 11 This illustrates another data storage location change involved in this application. For example... Figure 11 As shown, the physical storage blocks in the memory are divided into block group 1101 and block group 1102. Each physical storage block in block group 1101 stores internal data, while each physical storage block in block group 1102 stores external data. Figure 11 Initially, physical storage block 1101a in block group 1101 stores internal data 1, and physical storage block 1102a in block group 1102 stores external data 1. During subsequent read and write operations, when reading and writing internal data 1, the controller can instruct the memory to write internal data 1 to physical storage block 1101b in the same block group. When reading and writing external data 1, the controller can instruct the memory to write external data 1 to physical storage block 1102b in the same block group. That is, internal data will not be written to block group 1102, and similarly, external data will not be written to block group 1101.
[0132] From the above Figure 11 As can be seen, when the controller 820 determines the physical storage block that can be written to for data corresponding to a certain data attribute, it only needs to search for the unfilled physical storage block in a part of the physical storage blocks corresponding to the data attribute, without having to search from the entire memory 830, thereby ensuring the efficiency of data writing.
[0133] In an optional embodiment, the correspondence between the logical unit number and the data attributes of the first data is predefined by the protocol; in this case, the correspondence between the logical unit number and the data attributes of the first data can be predefined in the firmware.
[0134] Alternatively, the correspondence between the aforementioned logical unit number and the data attributes of the first data is set when the storage space of the memory is configured in the host as at least two types of data partitions; for example, during the system setup process before the electronic device leaves the factory, the storage space of the memory 830 is configured in the host as at least two types of data partitions, and logical unit numbers corresponding to each type of data partition are assigned. At the same time, the correspondence between the aforementioned logical unit number and the data attributes is configured; or, during the first boot of the operating system of the electronic device / during the user's factory reset process, the host guides the user to configure a portion of the storage space in the memory 830 of the electronic device as external data storage space. After the user configures the external data storage space, the host configures the storage space of the memory 830 as at least two types of data partitions, and logical unit numbers corresponding to each type of data partition are assigned. At the same time, the controller 820 configures the correspondence between the aforementioned logical unit number and the data attributes.
[0135] based on Figure 8 In an optional embodiment, the computer system shown in the example may also consider the impact of external or internal data on the management of the physical storage block when writing the first data.
[0136] In an optional embodiment, the controller 820 is further configured to set the data type of the first data according to the type of the data partition to which the first data is written; wherein the data type is used to manage the first data or the physical storage block where the first data resides.
[0137] In this embodiment, the controller 820 can set the corresponding data type for the first data according to the type of the data partition to which the first data is written. For data of different data types, the physical storage block where the data is located can be managed in different ways.
[0138] For example, when the data partition where the first data is written is of type 1, the controller 820 can set the data type of the first data to type 1. When managing the physical storage block where the first data is located, the controller can detect whether the physical storage block needs to be garbage collected or wear leveled by using a longer time interval.
[0139] For example, when the data partition to which the first data is written is of type 2, the controller 820 can set the data type of the first data to the second data type. When managing the physical storage block where the first data is located, the controller can detect whether the physical storage block needs to be garbage collected or wear leveled at a shorter time interval.
[0140] In an optional embodiment, the above data type may include either cold data or hot data.
[0141] In this embodiment, the controller 820 can set the data type of the first data to either cold data or hot data according to the type of the data partition to which the first data is written, thereby utilizing the existing cold / hot data types and simplifying the data type setting logic.
[0142] For example, please refer to Figure 12 This diagram illustrates a method for writing external data, as described in this application. Figure 12 As shown, the controller firmware includes a hot and cold data separation engine 1201. The storage space in the phone's memory is divided into four data partitions, corresponding to four LUNs. These include two LUNs for system startup, one LUN for storing internal phone data, and one LUN 1202 for storing external phone data. Data written to LUN 1202 is marked as cold data by the hot and cold data separation engine 1201. At the same time, the physical storage block where the data in the data partition corresponding to LUN 1202 is located is different from the physical storage block where the data in the data partitions corresponding to other LUNs is located, thereby reducing garbage collection and achieving better write amplification performance.
[0143] In other embodiments, the above data types may also be newly added, used to differentiate between internal and external data.
[0144] based on Figure 8 In an optional embodiment of the computer system shown in the example, the first type of data partition corresponding to external data can be unloaded or loaded in the host's resource manager interface as a logical data partition, so as to achieve the effect of hiding or displaying the storage space in the electronic device used for external data.
[0145] In an optional embodiment, the host 810 is further configured to display an uninstallation control on the interactive interface when the first type of data partition is loaded; and to uninstall the first type of data partition in the host's resource manager interface when a trigger operation on the uninstallation control is received.
[0146] In this embodiment of the application, the interactive interface displayed to the user on the host side can display the data partitions / data partition entries into which the storage space of the memory 830 is divided. By triggering (e.g., clicking) the data partition / data partition entry, the user can view the data stored in the data partition and perform interactive operations on the data stored in the data partition, such as opening, copying, deleting, cutting, sending, etc.
[0147] For example, in one usage scenario, for important data within an electronic device's internal data, a user can back up this data to an external data partition. For instance, a user can view the data to be backed up (such as a photo) in the internal data partition, long-press the photo, select "copy" from the pop-up menu, then go to the external data partition, long-press a blank area, and select "paste" from the pop-up menu. This backs up the photo to the external data partition. The photo copied to the external data partition will be stored as external data, essentially performing the process of writing the photo as external data to the first type of data partition.
[0148] Specifically, for external data partitions, they can be unmounted through the host's resource manager interface, thus hiding the data partition / entry point for that external data. For example, please refer to... Figure 13 This illustration shows a schematic diagram of data partition unloading related to this application for external data. Taking the example where the user interface and the resource manager interface are the same, such as... Figure 13 As shown, in the host's resource manager interface, there is an uninstallation control 1301, an external data partition 1302, and an internal data partition. After the user clicks the uninstallation control 1301, the external data partition 1302 is hidden. The above process can be called uninstalling the external data partition.
[0149] In an optional embodiment, the unloading process of the external data partition can incorporate authentication logic, that is, verifying whether the user has permission to unload the external data partition in the host's resource manager interface. For example, upon receiving a trigger operation on the unload control, the host 810 can display an authentication interface on the interactive interface, prompting the user to enter authentication information, such as a password. After the user enters the password, the host 810 matches the entered password with a pre-set password. If the match is successful, the first type of data partition is unloaded in the host's resource manager interface.
[0150] The unloading process of the first type of data partition does not affect the isolation between the physical storage blocks of external and internal data in the memory. Specifically, after the first type of data partition is unloaded, when the host 810 writes data to the internal data partition, the logical unit number carried in the write command sent to the controller 820 is still specified by the type of internal data partition. Accordingly, the controller 820 instructs the memory 830 to write the data to the physical storage block corresponding to the logical unit number, thereby isolating the data from the existing external data in the memory at the physical storage block level.
[0151] In an optional embodiment, the host is further configured to display a loading control on the interactive interface if the first type of data partition is not loaded; and to load the first type of data partition in the host's resource manager interface upon receiving a trigger operation on the loading control.
[0152] The data partition of the external data, after being uninstalled, can also be reloaded in the host's resource manager interface, thus making the data partition / data partition entry point of the external data re-display. For example, combined with... Figure 13 Please refer to Figure 14 This illustrates a schematic diagram of data partitioning and loading of external data, as described in this application. Figure 13 In the process, after the user clicks the uninstall control 1301 and the external data partition 1302 is hidden, the uninstall control 1301 in the file explorer interface is replaced by the load control 1303. Figure 14 In the process, after the user clicks the load control 1303, the data partition 1302 of the external data is redisplayed. The above process can be referred to as loading the data partition of the external data.
[0153] In an optional embodiment, the loading process of the external data partition can incorporate authentication logic, that is, verifying whether the user has permission to load the external data partition in the host's resource manager interface. For example, upon receiving a trigger operation on the loading control, the host 810 can display an authentication interface on the interactive interface, prompting the user to enter authentication information, such as a password. After the user enters the password, the host 810 matches the entered password with a pre-set password. If the match is successful, the first type of data partition is loaded in the host's resource manager interface.
[0154] based on Figure 8 In an optional embodiment of the computer system shown in the example, as a logical data partition, the first type of data partition corresponding to the external data can also be visible to other external devices besides the electronic device, so as to achieve the effect of directly writing data into the storage space of the electronic device for external data in the external device.
[0155] In an optional embodiment, the host 810 is further configured to, in response to the electronic device being coupled to an external device via a Universal Serial Bus interface, display a trigger control on an interactive interface corresponding to a data partition of the first type; and, upon receiving a selection operation on the trigger control, allow access to the data partition of the first type on the external device side.
[0156] For example, an electronic device can be coupled to an external device via a USB cable. In this case, the resource manager of the external device can display the interface of the first type of data partition / data partition. At this time, the user on the external device can view the data stored in the data partition and perform interactive operations on the data stored in the data partition by triggering (e.g., clicking) the entry of the data partition / data partition.
[0157] For example, in one use case, for data that needs to be backed up or copied from an external device, the user can store the data in the external data partition of the electronic device. For instance, the user can view the data to be copied (such as a photo) on the external device, long press the photo, select copy in the pop-up selection box, and then enter the external data partition of the electronic device displayed on the external device side. Long press the blank area and select paste in the pop-up selection box to write the photo to the external data partition of the electronic device. The photo copied to the external data partition will be stored as external data by the host 810 of the electronic device.
[0158] Specifically, for external data partitions, when the electronic device is coupled to the external device, the host's interface can be selected to show or hide them in the resource manager interface on the external device side. For example, please refer to... Figure 15 The diagram illustrates the device connection involved in this application. Taking a mobile phone as the electronic device and a personal computer as the external device as an example, as... Figure 15 As shown, when the phone and computer are connected (coupled) via USB cable, three options pop up on the phone's interface: Option 1501, Option 1502, and Option 1505. When the user selects Option 1501, the computer's file explorer displays the Portable Solid State Drive (PSSD) partition 1503 and the phone's file partition 1504. PSSD partition 1503 corresponds to the first type of data partition on the phone used for storing external data, and phone file partition 1504 corresponds to the second type of data partition on the phone used for storing internal data. Simultaneously, the computer charges the phone via USB cable. When the user selects Option 1502, the computer's file explorer only displays phone file partition 1504, not PSSD partition 1503. Simultaneously, the computer charges the phone via USB cable. When the user selects Option 1505, neither PSSD partition 1503 nor phone file partition 1504 is displayed on the computer's file explorer; that is, the computer only charges the phone via USB cable in this case.
[0159] In other embodiments, options 1501, 1502, and 1505 can also be triggered individually; for example, when the user selects option 1501 and does not select options 1502 and 1505, the computer's file explorer interface only displays the PSSD partition 1503, and the computer does not charge the phone; when the user selects option 1502 and does not select options 1501 and 1505, the computer's file explorer interface only displays the phone's file partition 1504, and the computer does not charge the phone; when the user selects option 1505 and does not select options 1501 and 1502, the computer... The phone is charging, but the PSSD partition 1503 and the phone file partition 1504 are not displayed in the computer's file explorer interface; for example, when the user selects options 1501 and 1502, but not option 1505, the PSSD partition 1503 and the phone file partition 1504 are displayed in the computer's file explorer interface, and the computer is not charging the phone; for example, when the user selects options 1501, 1502, and 1505 simultaneously, the PSSD partition 1503 and the phone file partition 1504 are displayed in the computer's file explorer interface, and the computer is charging the phone.
[0160] Figure 16 This is a flowchart illustrating an exemplary embodiment of an application of the present application regarding the operation method of a computer system. The method is applied to a computer system including a host, a controller, and a memory, wherein the memory's storage space is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing the computer system, and a second type corresponding to internal data of the electronic device; for example, the computer system may be as follows: Figure 8 The computer system shown; such as Figure 16 As shown, the method includes the following.
[0161] Step 1601: The host sends a write command to the controller; the write command includes the first data to be written to the memory and the logical cell number to which the first data is to be written, the logical cell number being specified according to the type of data partition.
[0162] Step 1602: The controller instructs the memory to write the first data into the physical storage block corresponding to the logical unit number according to the logical unit number; wherein the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0163] In an optional embodiment, the controller instructs the memory to write first data into the physical storage block corresponding to the logical unit number, based on the logical unit number, including:
[0164] The controller determines the physical storage block corresponding to the logical unit number based on the logical unit number, and instructs the memory to write the first data into the physical storage block corresponding to the logical unit number.
[0165] In an optional embodiment, the controller determines the physical storage block corresponding to the logical unit number based on the logical unit number, and instructs the memory to write the first data into the physical storage block corresponding to the logical unit number, including: the controller obtaining the data attributes of the first data based on the logical unit number; the data attributes being configured to indicate that the first data is external data of the electronic device or internal data of the electronic device; the controller determining the physical storage block corresponding to the logical unit number from the memory based on the data attributes, and instructing the memory to write the first data into the physical storage block corresponding to the logical unit number.
[0166] In an optional embodiment, the correspondence between the logical unit number and the data attributes of the first data is predefined by the protocol; or, the correspondence between the logical unit number and the data attributes of the first data is set when the storage space of the memory is configured in the host as at least two types of data partitions.
[0167] In an optional embodiment, the controller determines a physical storage block corresponding to a logical unit number from the memory based on data attributes, including: when the data attributes are configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a first condition as the physical storage block corresponding to the logical unit number; the first condition includes: the physical storage block is not full and no second data is stored, the second data being data in a second type of data partition; when the data attributes are configured to indicate that the first data is not external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a second condition as the physical storage block corresponding to the logical unit number; the second condition includes: the physical storage block is not full and no third data is stored, the third data being data in a first type of data partition.
[0168] In one optional embodiment, the correspondence between the type of data partition and the physical storage block where the data in the data partition resides is not a fixed configuration.
[0169] When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block that satisfies the first condition from the memory as the physical storage block corresponding to the logical unit number, including: when the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block that satisfies the first condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number.
[0170] When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block that satisfies the second condition from the memory as the physical storage block corresponding to the logical unit number, including: when the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block that satisfies the second condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number.
[0171] In one optional embodiment, the correspondence between the data partition type and the physical storage block where the data in the data partition resides is a fixed configuration.
[0172] When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block that satisfies the first condition from the memory as the physical storage block corresponding to the logical unit number, including: when the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block that is not full from each physical storage block of the data partition pre-configured for the first type as the physical storage block corresponding to the logical unit number.
[0173] When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block that satisfies the second condition from the memory as the physical storage block corresponding to the logical unit number, including: when the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block that is not full from each physical storage block of the data partition pre-configured for the second type of data partition as the physical storage block corresponding to the logical unit number.
[0174] In an optional embodiment, the method further includes: the controller setting the data type of the first data according to the type of the data partition to which the first data is written; wherein the data type is used to manage the first data or the physical storage block where the first data is located.
[0175] In one optional embodiment, the data type includes either cold data or hot data.
[0176] In an optional embodiment, the method further includes: displaying an uninstallation control on an interactive interface when the first type of data partition has been loaded; and uninstalling the first type of data partition in the host's resource manager interface when a trigger operation on the uninstallation control is received.
[0177] In an optional embodiment, the method further includes: displaying a loading control on an interactive interface when the first type of data partition is not loaded; and loading the first type of data partition in the host's resource manager interface when a trigger operation on the loading control is received.
[0178] In an optional embodiment, the method further includes: in response to the electronic device being coupled to an external device via a Universal Serial Bus interface, the host displays a trigger control corresponding to a data partition of the first type on an interactive interface; and upon receiving a selection operation on the trigger control, allows access to the data partition of the first type on the external device side.
[0179] Figure 17 This is a structural block diagram of a storage system provided in an exemplary embodiment of this application, such as... Figure 17 As shown, the storage system 1700 includes: one or more memories 1710, and,
[0180] A controller 1720 is coupled to the memory 1710 and configured to control the memory 1710.
[0181] The storage system 1700 may be all or part of a mobile phone, desktop computer, laptop computer, tablet computer, vehicle computer, game console, printer, positioning device, wearable electronic device, smart sensor, virtual reality (VR) device, augmented reality (AR) device, or any other suitable electronic device having storage therein.
[0182] Optionally, the storage system 1700 may include a host and a storage subsystem, the storage subsystem having one or more memories 1710 and a controller 1720. The host may be a processor of an electronic device (e.g., a central processing unit (CPU)) or a system-on-chip (SoC) (e.g., an application processor (AP)). The host may be configured to send data to the memory 1710. Alternatively, the host may be configured to receive data from the memory 1710.
[0183] According to some implementations, controller 1720 is also coupled to a host. Controller 1720 can manage data stored in memory 1710 and communicate with the host.
[0184] In some implementations, the controller 1720 is designed to operate in low duty cycle environments, such as secure digital (SD) cards, compact flash (CF) cards, universal serial bus (USB) flash drives, or other media used in electronic devices such as personal calculators, digital cameras, mobile phones, etc.
[0185] In some implementations, the controller 1720 is designed to operate in a high duty cycle environment solid-state drive (SSD) or embedded multi-media card (eMMC), which serves as data storage for mobile devices such as smartphones, tablets, laptops, etc., as well as enterprise storage arrays.
[0186] Controller 1720 can be configured to control operations of memory 1710, such as read, erase, and program operations. Controller 1720 can also be configured to manage various functions relating to data stored or to be stored in memory 1710, including but not limited to bad block management, garbage collection, logical-to-physical address translation, wear leveling, etc. In some embodiments, controller 1720 is also configured to process error correction codes (ECC) relating to data read from or written to memory 1710.
[0187] Controller 1720 can also perform any other suitable functions, such as formatting memory 1710. Controller 1720 can communicate with external devices according to a specific communication protocol.
[0188] The controller 1720 and one or more memories 1710 can be integrated into various types of storage devices, for example, included in the same package (e.g., a Universal Flash Memory (UFS) package or an eMMC package). That is, the storage system 1700 can be implemented and packaged into different types of end electronic products.
[0189] Schematic illustration: Controller 1720 and a single memory 1710 can be integrated into a memory card. The memory card can include PC cards (PCMCIA, Personal Computer Memory Card International Association), CF cards, Smart Media (SM) cards, memory sticks, multimedia cards (MMC, RS-MMC, MMCmicro), SD cards (SD, miniSD, microSD, SDHC), UFS, etc. The memory card may also include a memory card connector that couples the memory card to the host computer.
[0190] Schematic, the controller 1720 and multiple memories 1710 may be integrated into a solid-state drive (SSD). In some embodiments, the storage capacity and / or operating speed of the SSD is greater than that of the memory card.
[0191] The aforementioned controller 1720 can be implemented as Figure 8 The controller 820 and memory 1710 in the computer system shown can be implemented as Figure 8 The computer system shown includes a memory 830. Specifically, the memory's storage space is divided into at least two types of data partitions; these at least two types include a first type corresponding to external data of the electronic device containing the computer system, and a second type corresponding to internal data of the electronic device; correspondingly, a controller is configured to receive write commands; the write command includes first data to be written to the memory and a logical cell number to which the first data is to be written, the logical cell number being specified according to the type of data partition; the controller is also configured to instruct the memory to write the first data into a physical storage block in the memory corresponding to the logical cell number, based on the logical cell number; wherein the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0192] Understandably, controller 1720 can perform the actions described above. Figure 16 In the scheme shown, all or part of the steps are performed by the controller.
[0193] Figure 18 This is a schematic diagram of the controller structure provided in an exemplary embodiment of this application. Figure 18 As shown, the controller 1800 includes a front-end interface 1810, a memory interface 1820, a memory controller 1830, and a bus 1840.
[0194] The front-end interface 1810, also known as the Host I / F, is connected to the host and used for communication with the host.
[0195] The memory interface 1820 is connected to a memory (which may be a non-volatile memory) and is used to convert data exchanges on the bus into data exchanges that conform to the storage timing of the storage medium.
[0196] The memory controller 1830 controls the overall functionality of the controller, ensuring the memory interface correctly completes data exchange between the memory and the bus, and managing interrupt signals, among other things. Specifically, the memory controller 1830 can control functions such as data writing, data reading, garbage collection, wear leveling, and error correction.
[0197] Optionally, the storage controller 1830 may include a peripheral processing unit 1830a, a wear leveling unit 1830b, a garbage collection unit 1830c, and an error correction unit 1830d.
[0198] The peripheral processing unit 1830a can be used to implement functions such as mapping management, bad block management, and power-off recovery; the wear leveling unit 1830b is used to implement wear leveling function for memory; the garbage collection unit 1830c is used to implement garbage collection function for memory; and the error correction unit 1830d is used to implement error correction (error detection and correction) function. For example, the error correction unit 1830d may include an ECC circuit.
[0199] Optionally, the controller 1800 may also include a storage unit 1850. Optionally, the storage unit 1850 may include a read-only memory (ROM) and a random access memory (RAM).
[0200] The read-only memory can be connected to the storage controller 1830, for example, to the peripheral processing unit 1830a in the storage controller 1830, and can be used to store the firmware program and fixed configuration information of the controller 1800.
[0201] The random access memory can be connected to the front-end interface 1810, the memory interface 1820, and the memory controller 1830 via the bus 1840. It can be used to cache data exchanged between the cache controller 1800 and the host or memory, as well as some configuration information of the cache controller 1800.
[0202] In this embodiment, the memory's storage space is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; wherein, the computer system includes a host, the aforementioned controller 1800, and a memory; the aforementioned front-end interface 1810 is configured to receive write commands; the write command includes first data to be written to the memory and the logical unit number to which the first data is to be written, the logical unit number being specified according to the type of data partition; the aforementioned storage controller 1830 is configured to, through the memory interface 1820, instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, according to the logical unit number; wherein, the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0203] It is understandable that the aforementioned controller 1800 can perform the actions described above. Figure 16 In the method shown, all or part of the steps are performed by the controller.
[0204] Figure 19This is a flowchart illustrating an operation method of a storage system provided in another exemplary embodiment of this application. The storage system includes a controller and a memory, wherein the memory's storage space is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; the computer system includes the aforementioned storage system; the method can be executed by the controller, for example, the controller can be as follows: Figure 18 The controller 1800 shown; as Figure 19 As shown, the method includes the following.
[0205] Step 1901: Receive a write command; the write command includes the first data to be written to the memory and the logical cell number to which the first data is to be written, the logical cell number being specified according to the type of data partition.
[0206] Step 1902: Based on the logical unit number, instruct the memory to write the first data into the physical storage block corresponding to the logical unit number in the memory; wherein, the physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
[0207] It is understood that the methods shown in the embodiments of this application may include the above-described methods. Figure 16 In the method shown, all or part of the steps are performed by the controller.
[0208] This application provides a computer-readable storage medium storing instructions that, when executed on a controller, implement the following: Figure 19 The illustrated embodiment provides an operation method for the storage system. Optionally, the controller may be as follows: Figure 8 The controller 802 in the computer system shown, or as Figure 18 The controller shown is 1800.
[0209] This application provides a computer-readable storage medium storing instructions that, when executed on a host processor, implement... Figure 16 In the operation method of the computer system provided in the illustrated embodiment, all or part of the steps are performed by the host.
[0210] In this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The term "at least one" means one or more, and the term "multiple" means two or more, unless otherwise expressly defined.
[0211] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0212] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A computer system, characterized in that, The computer system includes a host, a controller, and a memory, wherein the storage space of the memory is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of the electronic device containing the computer system, and a second type corresponding to internal data of the electronic device; The host is configured to send a write command to the controller; the write command includes first data to be written to the memory and a logical unit number (LUN) to which the first data is to be written, the logical unit number being specified according to the type of the data partition; The controller is configured to instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, based on the logical unit number. The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
2. The computer system according to claim 1, characterized in that, The controller is configured to determine the physical storage block corresponding to the logical unit number based on the logical unit number, and instruct the memory to write the first data into the physical storage block corresponding to the logical unit number.
3. The computer system according to claim 2, characterized in that, The controller is configured to obtain data attributes of the first data based on the logical unit number; the data attributes are configured to indicate that the first data is external data of the electronic device or internal data of the electronic device; determine the physical storage block corresponding to the logical unit number from the memory based on the data attributes, and instruct the memory to write the first data into the physical storage block corresponding to the logical unit number.
4. The computer system according to claim 3, characterized in that, The correspondence between the logical unit number and the data attributes of the first data is predefined by the protocol; or, The correspondence between the logical unit number and the data attributes of the first data is set when the storage space of the memory is configured in the host as the at least two types of data partitions.
5. The computer system according to claim 3, characterized in that, The controller is configured to, When the data attribute is configured to indicate that the first data is external data of the electronic device, at least one physical storage block that satisfies the first condition is determined from the memory as the physical storage block corresponding to the logical unit number; The first condition includes: the physical storage block is not full and no second data is stored, where the second data is data in the second type of data partition; When the data attribute is configured to indicate that the first data is internal data of the electronic device, at least one physical storage block that satisfies a second condition is determined from the memory as the physical storage block corresponding to the logical unit number; the second condition includes: the physical storage block is not full and no third data is stored, the third data being data in the data partition of the first type.
6. The computer system according to claim 5, characterized in that, The correspondence between the type of the data partition and the physical storage block where the data in the data partition is located is not a fixed configuration. The controller is configured to, When the data attribute is configured to indicate that the first data is external data of the electronic device, at least one physical storage block that satisfies the first condition is determined from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical cell number. When the data attribute is configured to indicate that the first data is internal data of the electronic device, at least one physical storage block that satisfies the second condition is determined from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical cell number.
7. The computer system according to claim 5, characterized in that, The correspondence between the type of data partition and the physical storage block where the data in the data partition is located is a fixed configuration. The controller is configured to, When the data attribute is configured to indicate that the first data is external data of the electronic device, at least one physical storage block that is not full is determined from each physical storage block of the data partition pre-configured for the first type, as the physical storage block corresponding to the logical unit number; When the data attribute is configured to indicate that the first data is internal data of the electronic device, at least one physical storage block that is not full is determined from the various physical storage blocks of the data partition pre-configured for the second type, as the physical storage block corresponding to the logical unit number.
8. The computer system according to claim 1, characterized in that, The controller is also configured to set the data type of the first data according to the type of the data partition to which the first data is written; The data type is used to manage the first data or the physical storage block where the first data is located.
9. The computer system according to claim 8, characterized in that, The data types include: cold data or hot data.
10. The computer system according to any one of claims 1 to 9, characterized in that, The host is also configured to display an uninstallation control on the interactive interface when the first type of data partition has been loaded; and to uninstall the first type of data partition in the resource manager interface of the host when a trigger operation on the uninstallation control is received.
11. The computer system according to any one of claims 1 to 9, characterized in that, The host is also configured to display a loading control on the interactive interface when the first type of data partition is not loaded; and to load the first type of data partition in the resource manager interface of the host when a trigger operation on the loading control is received.
12. The computer system according to any one of claims 1 to 9, characterized in that, The host is also configured to, in response to the electronic device being coupled to an external device via a Universal Serial Bus interface, display a trigger control on an interactive interface corresponding to the first type of data partition; and, upon receiving a selection operation on the trigger control, allow access to the first type of data partition on the external device side.
13. A method for operating a computer system, characterized in that, The computer system includes a host, a controller, and a memory, wherein the memory's storage space is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of the electronic device containing the computer system, and a second type corresponding to internal data of the electronic device; the method includes: The host sends a write command to the controller; the write command includes first data to be written to the memory and the logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition; The controller instructs the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, based on the logical unit number. The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
14. The method according to claim 13, characterized in that, The controller, based on the logical unit number, instructs the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, including: The controller determines the physical storage block corresponding to the logical unit number based on the logical unit number, and instructs the memory to write the first data into the physical storage block corresponding to the logical unit number.
15. The method according to claim 14, characterized in that, The controller determines the physical storage block corresponding to the logical unit number based on the logical unit number, and instructs the memory to write the first data into the physical storage block corresponding to the logical unit number, including: The controller obtains the data attributes of the first data based on the logical unit number; the data attributes are configured to indicate that the first data is external data of the electronic device or internal data of the electronic device; The controller determines the physical storage block corresponding to the logical unit number from the memory based on the data attributes, and instructs the memory to write the first data into the physical storage block corresponding to the logical unit number.
16. The method according to claim 15, characterized in that, The correspondence between the logical unit number and the data attributes of the first data is predefined by the protocol; or, The correspondence between the logical unit number and the data attributes of the first data is set when the storage space of the memory is configured in the host as the at least two types of data partitions.
17. The method according to claim 15, characterized in that, The controller determines the physical storage block corresponding to the logical unit number from the memory based on the data attributes, including: When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a first condition as the physical storage block corresponding to the logical unit number; the first condition includes: the physical storage block is not full and does not store the second data, the second data being data in the second type of data partition; When the data attribute is configured to indicate that the first data is not external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a second condition as the physical storage block corresponding to the logical unit number; the second condition includes: the physical storage block is not full and no third data is stored, the third data being data in the data partition of the first type.
18. The method according to claim 17, characterized in that, The correspondence between the type of the data partition and the physical storage block where the data in the data partition is located is not a fixed configuration. When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a first condition, as the physical storage block corresponding to the logical unit number, including: When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block that satisfies the first condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical cell number. When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies the second condition, as the physical storage block corresponding to the logical unit number, including: When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block that satisfies the second condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number.
19. The method according to claim 17, characterized in that, The correspondence between the type of data partition and the physical storage block where the data in the data partition is located is a fixed configuration. When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies a first condition, as the physical storage block corresponding to the logical unit number, including: When the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one physical storage block that is not full from the various physical storage blocks of the data partition pre-configured for the first type, as the physical storage block corresponding to the logical unit number; When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block from the memory that satisfies the second condition, as the physical storage block corresponding to the logical unit number, including: When the data attribute is configured to indicate that the first data is internal data of the electronic device, the controller determines at least one physical storage block that is not full from the various physical storage blocks of the data partition pre-configured for the second type, as the physical storage block corresponding to the logical unit number.
20. The method according to claim 13, characterized in that, The method further includes: The controller sets the data type of the first data according to the type of the data partition to which the first data is written; The data type is used to manage the first data or the physical storage block where the first data is located.
21. The method according to claim 20, characterized in that, The data types include: cold data or hot data.
22. The method according to any one of claims 13 to 21, characterized in that, The method further includes: When the first type of data partition is loaded, the host displays an uninstallation control on the interactive interface; when a trigger operation is received on the uninstallation control, the first type of data partition is uninstalled in the resource manager interface of the host.
23. The method according to any one of claims 13 to 21, characterized in that, The method further includes: When the first type of data partition is not loaded, the host displays a loading control on the interactive interface; when a trigger operation is received on the loading control, the first type of data partition is loaded in the resource manager interface of the host.
24. The method according to any one of claims 13 to 21, characterized in that, The method further includes: The host responds to the electronic device being coupled to an external device via a Universal Serial Bus interface by displaying a trigger control on the interactive interface corresponding to the first type of data partition; upon receiving a selection operation on the trigger control, it allows access to the first type of data partition on the external device side.
25. A storage system, characterized in that, The storage system includes a controller and a memory, the storage space of which is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; the computer system includes the storage system; The controller is configured to receive a write command; the write command includes first data to be written to the memory and a logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition; The controller is further configured to instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, based on the logical unit number. The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
26. A controller, characterized in that, The controller includes a front-end interface, a memory interface, and a storage controller; the front-end interface is connected to a host, and the memory interface is connected to a memory; the storage space of the memory is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; the computer system includes the host, the controller, and the memory; The front-end interface is configured to receive write commands; the write command includes first data to be written to the memory and the logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition; The storage controller is configured to instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number, according to the logical unit number, through the memory interface. The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
27. A method for operating a storage system, characterized in that, The storage system includes a controller and a memory, the storage space of which is divided into at least two types of data partitions; the at least two types include a first type corresponding to external data of an electronic device containing a computer system, and a second type corresponding to internal data of the electronic device; The computer system includes the storage system; The method is executed by the controller, and the method includes: Receive a write command; the write command includes first data to be written to the memory and the logical unit number to which the first data is to be written, the logical unit number being specified according to the type of the data partition; Based on the logical unit number, instruct the memory to write the first data into the physical storage block in the memory corresponding to the logical unit number; The physical storage block corresponding to the first type of data partition is different from the physical storage block corresponding to the second type of data partition.
28. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on the controller, implement the method of claim 27.
Citation Information
Patent Citations
Method and apparatus of memory management by storage system
CN103365603A
Heterogeneous resource management method and related equipment
CN116069494A