Computer system, operating method thereof, storage system, controller, and storage medium
By allocating different storage partitions of external data and internal data in the computer system and specifying the write location according to the data type, the problem of frequent garbage collection when storing external data is solved, and the service life of the memory is extended.
Patent Information
- Application Number
- CN202311035408.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2043-08-16
AI Technical Summary
The prior art causes the number of garbage collections in the storage system to increase when a user uses mobile terminals such as mobile phones as mobile hard disks to store external data, which affects the service life of the memory.
By allocating at least two types of data partitions in a computer system, respectively, for storing external data and internal data, and specifying a logical unit number according to the type of data partition, the controller instructs the memory to write the data to the corresponding physical storage block, thereby Reduce the number of garbage collections.
By distinguishing the storage areas of external data and internal data, the number of garbage collections on the physical storage blocks that store external data is reduced and the service life of the memory is extended.
Smart Images

Figure CN119493515A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a computer system and an operating method thereof, a storage system, a controller and a storage medium. Background Art
[0002] With the increasing popularity of mobile terminals such as mobile phones, many users use the memory in the mobile phone as a mobile hard disk to store external data of the mobile phone. Summary of the invention
[0003] The present application provides a computer system and an operation method thereof, a storage system, a controller and a storage medium, which can reduce the number of garbage collection times of the storage system and increase the service life of the memory when storing external data in the storage system. The technical solution is as follows:
[0004] On the one hand, a computer system is provided, which 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 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, and the logical unit number is specified according to the type of the data partition; the controller is configured to instruct the memory to write the first data to 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 a physical storage block corresponding to the logical unit number according to 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 attribute of the first data is predefined by a protocol; or, the correspondence between the logical unit number and the data attribute of the first data is set when the storage space of the memory is configured as at least two types of data partitions in the host.
[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 that satisfies a first condition 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 does not store second data, and 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, determine at least one physical storage block that satisfies a second condition 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 does not store third data, and the third data is data in the first type of data partition.
[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 that meets the 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 that meets the second condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number.
[0010] 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 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 that is not full from the physical storage blocks 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, determine at least one physical storage block that is not full from the physical storage blocks 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 a data type of the first data according to a type of a data partition to which the first data is written; wherein the data type is used to manage the first data or a physical storage block where the first data is located.
[0012] In an optional embodiment, the data type includes: cold data or hot data.
[0013] In an optional embodiment, the host is also configured to display an uninstall 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 interface of the resource manager of the host when a trigger operation for the uninstall control is received.
[0014] In an optional embodiment, 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 load the first type of data partition in the interface of the resource manager of the host when a trigger operation on the loading control is received.
[0015] In an optional embodiment, the host is also configured to display a trigger control corresponding to the first type of data partition on an interactive interface in response to the electronic device being coupled to an external device via a universal serial bus interface; 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, wherein 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 an electronic device including 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 a logical unit number to which the first data is to be written, and the logical unit number is specified according to the type of the data partition; the controller instructs the memory to write the first data to 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 a physical storage block in the memory 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 obtains 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.
[0019] In an optional embodiment, the correspondence between the logical unit number and the data attribute of the first data is predefined by a protocol; or, the correspondence between the logical unit number and the data attribute of the first data is set when the storage space of the memory is configured as at least two types of data partitions in the host.
[0020] In an optional embodiment, the controller determines the physical storage block corresponding to the logical unit number from the memory according to 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 that satisfies a first condition 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 does not store second data, and 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 not external data of the electronic device, the controller determines at least one physical storage block that satisfies a second condition 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 does not store third data, and the third data is data in the first type of data partition.
[0021] 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; 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; 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.
[0022] 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 fixed configuration relationship; 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 meets 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 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 that meets 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 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 sets 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: cold data or hot data.
[0025] In an optional embodiment, the method further includes: the host displays an uninstall control on an interactive interface when the first type of data partition has been loaded; and when a trigger operation for the uninstall control is received, uninstalling the first type of data partition in the interface of the resource manager of the host.
[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, loading the first type of data partition in the interface of the resource manager of the host.
[0027] In an optional embodiment, the method also includes: the host displays a trigger control corresponding to the first type of data partition on an interactive interface in response to the electronic device being coupled to an external device via a universal serial bus 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 comprising 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 including a computer system, and a second type corresponding to internal data of the electronic device; the computer system comprises the storage system;
[0029] The controller is configured to receive a write command; the write command includes first data to be written into the memory and a logical unit number into 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 a physical storage block corresponding to the logical unit number in the memory according to 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 comprising a memory interface and a memory 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 including a computer system, and a second type corresponding to internal data of the electronic device; the computer system comprises 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 into the memory and a logical unit number to which the first data is to be written, wherein the logical unit number is 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 a physical storage block corresponding to the logical unit number in the memory according to 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, wherein the storage system includes a controller and a memory, wherein a 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 including 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] receiving a write command; the write command comprising first data to be written into the memory and a logical unit number into which the first data is to be written, the logical unit number being specified according to the type of the data partition;
[0038] According to the logical unit number, instruct the memory to write the first data into a 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 instructions are stored in the computer-readable storage medium, and when the instructions are executed on a controller, all or part of the steps executed by the controller in the operation method of the computer system shown in any of the above embodiments are implemented; the controller is the controller in the computer system shown above.
[0041] The technical solution provided by this application may have the following beneficial effects:
[0042] In a computer system including a host, a controller and a memory, the storage space of the memory is divided into different data partitions according to the data type (i.e., external data and internal data of the electronic device), and 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, and the controller instructs the memory to write the first data to 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 to different physical storage blocks in the memory, and the garbage collection operation is performed in units of physical storage blocks, that is, the read and write operations on the internal data will not affect the physical storage blocks where the external data is located. Since external data is usually not read and written frequently compared to internal data, garbage collection operations are rarely generated on the physical storage blocks in the memory where the external data is written. It can be seen that through the above scheme, when storing external data in the storage system, the number of garbage collection times on the physical storage blocks storing the external data in the storage system can be reduced, and the service life of the memory can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 is a schematic diagram of a computer system provided by an embodiment of the present application;
[0045] Figure 2 It is a structural schematic diagram of a memory card involved in the present application;
[0046] Figure 3 is a structural schematic diagram of a solid-state drive involved in the present application;
[0047] Figure 4 is a block diagram of a memory shown in an exemplary embodiment of the present application;
[0048] Figure 5 is a schematic circuit diagram of a memory shown in an exemplary embodiment of the present application;
[0049] Figure 6 is a perspective view of a portion of a three-dimensional storage array structure shown in an exemplary embodiment of the present application;
[0050] Figure 7 It is a schematic diagram of data storage on a physical storage block involved in the present application;
[0051] Figure 8 is a framework diagram of a computer system provided by an exemplary embodiment of the present application;
[0052] Fig. 9 It is a schematic diagram of data storage on a physical storage block involved in the present application;
[0053] Fig.10 It is a schematic diagram of a data storage location change involved in the present application;
[0054] Fig.11 is a schematic diagram of another data storage location change involved in the present application;
[0055] Fig.12 This is a schematic diagram of external data writing settings involved in this application;
[0056] Fig.13 This is a schematic diagram of data partition unloading of external data involved in this application;
[0057] Fig.14 This is a schematic diagram of data partition loading of external data involved in this application;
[0058] Fig.15 It is a schematic diagram of the connection of the equipment involved in this application;
[0059] Fig.16 is a flowchart of an operating method of a computer system provided by an exemplary embodiment of the present application;
[0060] Fig.17 is a structural block diagram of a storage system provided by an exemplary embodiment of the present application;
[0061] Fig.18 is a schematic diagram of the structure of a controller provided by an exemplary embodiment of the present application;
[0062] Fig.19 is a flowchart of an operating method of a storage system provided by another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0063] The implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings.
[0064] The computer system provided in the embodiment of the present application may include a host and a storage system. The storage system may include a 3D memory, for example, a 3D NAND flash memory.
[0065] Figure 1 Schematic diagram of a computer system provided by an embodiment of the present 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] The controller 200 may be configured to control operations performed by the memory 100. Such as read, erase and program operations. The controller 200 may also be configured to manage various functions regarding data stored or to be stored in the memory 100, including but not limited to bad block management, garbage collection, conversion of logical addresses to physical addresses, wear leveling, etc. Optionally, the controller 200 may also be configured to process error correction codes (ECC) regarding data read from or written to the memory 100. The controller 200 may also perform any other suitable functions. For example, formatting the memory 100.
[0067] The controller 200 can also communicate with the external device according to a specific communication protocol. For example, the controller 200 can communicate with the external device through at least one of various interface protocols. The interface protocol can be a universal serial bus USB protocol, a multimedia card (Multi-Media Card, MMC) protocol, a peripheral component interconnect (Peripheral Component Interconnect, PCI) protocol, a PCI high-speed (PCI-E) protocol, an advanced technology attachment (Advanced Technology Attachment, ATA) protocol, a serial ATA protocol, a parallel ATA protocol, a small computer interface (Small Computer System Interface, SCSI) protocol, an enhanced small disk interface (Enhanced Small Drive Interface, ESDI) protocol, an integrated drive electronics (Integrated Development Environment, IDE) protocol, a Firewire (Fire wire) protocol, etc.
[0068] In an optional embodiment, the controller 200 and one or more memories 100 may be integrated into various types of electronic devices. The electronic device may be a mobile phone, a desktop computer, a laptop computer, a tablet computer, a vehicle computer, a game console, a printer, a positioning device, a wearable electronic device, a smart sensor, a virtual reality (VR) device, an augmented reality (AR) device, or any other suitable electronic device having a memory therein. In this scenario, Figure 1As shown, the computer system 10 further includes a host 300. The 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 implement the functions of the aforementioned electronic device.
[0069] In other embodiments, the controller 200 and one or more memories 100 may be integrated into various types of storage devices.
[0070] As an example, Figure 2 Schematic diagram of the structure of a memory card involved in this application. Figure 2 As shown, the controller 200 and the single memory 100 may be integrated into a memory card 400. The memory card 400 may include a PCMCIA (PC) card, a Compact Flash (CF) card, a Smart Media (SM) card, a memory stick, a Multi-Media Card (MMC), a RS-MMC, a micro-MMC, a Secure Digital (SD) card, a Universal Flash Storage (UFS), etc. Figure 2 As shown, the memory card 400 may further include a connector 410 for coupling the memory card 400 with a host.
[0071] As another example, Figure 3 Schematic diagram of a solid state drive involved in this application. Figure 3 As shown, the controller 200 and the plurality of memories 100 may be integrated into a solid state drive (SSD) 500. The solid state drive 500 may further include a connector 510 for coupling the solid state drive 500 with a host. The storage capacity and / or operating speed of the solid state drive 500 is greater than the storage capacity and / or operating speed of the memory card 400.
[0072] also, Figures 1 to 3 The memory 100 in the embodiment may be any memory involved in the embodiment of the present application. For example, it may be a 3D NAND (NAND gate) memory. The structure of the memory 100 is explained below.
[0073] Figure 4 is a block diagram of a memory according to an exemplary embodiment of the present application. Figure 4, the 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 a data input / output circuit 416. It should be understood that in some examples, the memory 400 may also include Figure 4 Additional peripheral circuits not shown.
[0074] The page buffer 404 may be configured to read data from the memory cell array 401 and program (write) data to the memory cell array 401 according to a control signal from the control logic unit 412. In one example, the page buffer 404 may store data (write data) to be programmed into the selected page 420 of the memory cell array 401. In another example, the page buffer 404 may output the read data in a program verification operation to ensure that the data has been correctly programmed into the corresponding memory cell of the selected word line coupled to the memory cell array 401. The column decoder 406 may operate in response to the control signal provided by the control logic unit to select one or more NAND memory strings in the memory cell array 401. The row decoder may operate in response to the control signal provided by the control logic unit and select / deselect the selected row of the memory cell array 401. The row decoder may also be configured to supply the voltage generated from the voltage generator 410 to the selected word line and the unselected word line of the memory cell array 401. As described in detail below, the row decoder / word line driver 408 is configured to perform an erase operation on the memory cells coupled to one or more selected word lines in the memory cell array 401. The voltage generator 410 may use an external power supply voltage or an internal power supply voltage to generate various voltages required by the memory, such as a program voltage, a read voltage, a pass voltage, a verification voltage, a bit line voltage, etc., and combinations thereof.
[0075] The control logic unit 412 may be coupled to the voltage generator 410, the page buffer 404, the column decoder 406, the row decoder 408, and the data input / output circuit 416, etc., and is configured to control the operation of each peripheral circuit. The control logic unit may generate an operation signal in response to a command or control signal from the storage controller. The register 414 may be coupled to the control logic unit 412, and includes a status register, a command register, and an address register for storing status information, a command operation code (OP code), and a command address for controlling the operation of each peripheral circuit. The data input / output circuit 416 may be coupled to the control logic unit 412, and act as a control buffer to buffer a control command received from a host (not shown) and relay it to the control logic unit 412, and to buffer status information received from the control logic unit 412 and relay it to the host. The data input / output circuit 416 may also be coupled to the column decoder, and act as a data input / output interface and a data buffer to buffer data and relay it to the memory cell array 401 or relay or buffer data from the memory cell array 401.
[0076] Figure 5 FIG. 1 is a schematic circuit diagram of a memory device according to an exemplary embodiment of the present application. Figure 5 As shown, the memory 500 may include a memory cell array device 501 and a peripheral circuit 502 coupled to the memory cell array device 501. The memory cell array device 501 may be a NAND flash memory cell array, wherein the 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 that can store 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, two bits may be stored per cell (MLC), three bits may be stored per cell (TLC), or four bits may be stored per cell (QLC).
[0077] like Figure 5As shown in , each NAND memory string 508 may include at least one source select transistor 510 at its source terminal and at least one drain select transistor 512 at its drain terminal. The source select transistor 510 and the drain select transistor 512 may be configured to activate the selected NAND memory string 508 during read and program operations. In some embodiments, the sources of the NAND memory strings 508 in the same block 504 are coupled through 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 a deselect voltage (e.g., 0V) to the corresponding drain select transistor 512 via one or more drain select lines 515 and / or by applying a select voltage or a deselect voltage (e.g., 0V) to the corresponding source select transistor 510 via one or more source select lines 515.
[0078] like Figure 5 As shown in , the memory array unit may include a plurality of 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 at the same time.
[0079] Figure 6 6 is a perspective view of a portion of a three-dimensional memory array structure shown in an exemplary embodiment of the present 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 layer may include a conductive material, including but not limited to tungsten (W), cobalt (Co), copper (Cu), aluminum (Al), polysilicon, doped silicon, silicide, or any combination thereof. In some embodiments, each gate conductive layer 406 includes a metal layer, such as a tungsten layer. In some embodiments, each gate conductive layer includes a doped polysilicon layer. The gate conductive layer may include a plurality of 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 a 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 (eg, a P-well and / or an N-well) is formed in the substrate 630, and the source terminal of the memory cell array is in contact with the well 644. It should be understood that although Figure 6 Not shown, but additional features of the memory cell array 600 may be formed, including but not limited to gate line slits / source contacts, local contacts, interconnect layers, etc.
[0081] For technical details not disclosed in the above memory-related hardware embodiments, please refer to the description of the computer system embodiments and method embodiments of the present application for understanding.
[0082] In the embodiment of the present application, the data in the computer system can be divided into internal data and external data.
[0083] Internal data: may be the code and resource data of the operating system and application programs running in the electronic device where the computer system is located, as well as the data generated during the operation of the operating system and application programs; for example, the data generated during the operation of the above-mentioned operating system may include data such as the operation log of the operating system, and the data generated during the operation of the above-mentioned application programs may include cache data generated during the operation of the application programs (such as web page cache, chat history cache, etc.), file data downloaded from the network (such as downloaded audio and video, pictures, documents), etc.
[0084] External data: can be data copied by a user from other devices outside the electronic device to the memory of the electronic device. For example, taking the electronic device as a mobile phone, external data can be file data copied by a user from a personal computer to the mobile phone via a USB cable, such as various types of documents, pictures, videos, audio, etc. copied to the mobile phone.
[0085] In the related art, when a user uses a mobile terminal as a mobile hard disk to store external data, the mobile terminal can be coupled to a personal computer through a Universal Serial Bus (USB) cable. After that, the user can copy the data in the personal computer (that is, the external data of the mobile terminal) to the storage space of the mobile terminal in the resource manager interface of the personal computer; after that, the controller of the storage system of the mobile terminal writes the external data into the memory of the mobile terminal. However, the types of external data and internal data of the mobile terminal are different. After the external data is written into the memory, the number of garbage collections in the storage system will increase, affecting the service life of the memory.
[0086] Specifically, the storage system in current electronic devices (such as mobile terminals such as mobile phones and tablets) does not distinguish between internal data 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 instructs the memory to write the document data into the memory based on the write command.
[0087] Among them, since the page is the basic data unit for programming operations, that is, when the memory is writing data, the smallest unit of its programming operation is a page, this will lead to the following situation: when the controller instructs the memory to write external data (such as document data), if a physical storage block (also called a block, storage block or flash memory in some scenarios, such as Figure 4 When there is a writable page in the block 140 in the physical storage block, the document data may be written into the writable page in the physical storage block regardless of whether other pages in the physical storage block store internal data. In other words, a physical storage block may have some pages storing external data and other pages storing internal data.
[0088] For example, see Figure 7 , which shows a schematic diagram of data storage on a physical storage block involved in the present application. Figure 7 As shown, assuming that the 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 the physical storage block 70 store internal data and the other 6 pages store external data; since the internal data may be hot data, it will be frequently accessed by the host, while the external data is usually not frequently accessed, such as Figure 7 In the physical storage block 70 shown, the internal data in 6 pages may become invalid data after a period of time, while the external data in the other 6 pages continue to be valid data. At this time, if the storage system triggers a garbage collection operation, garbage collection will be performed on the physical storage block 70, that is, the external data in the other 6 pages in the physical storage block 70 will be transferred to another physical storage block 71 so that the physical storage block 70 can be erased. At this time, other pages in the physical storage block 71 that store the external data may also store internal data, or other pages in the physical storage block 71 that store the external data may also be newly written with internal data. In this way, after a period of time, the physical storage block 71 may need to be garbage collected again.
[0089] Combination Figure 7It can be seen that when storing external data in a storage system, due to the difference in access frequency between the external data and the internal data, the physical storage blocks storing the external data will be frequently garbage collected, which will affect the life of the physical storage blocks.
[0090] In this regard, the solution shown in the subsequent embodiments of the present application distinguishes between the writing of external data and internal data, that is, during the data writing process, the external data and the internal data are written to different physical storage blocks.
[0091] Please refer to Figure 8 , which is a framework diagram of a computer system provided by an exemplary embodiment of the present application. The computer system may be as follows Figure 1 The system 10 shown. Figure 8 As shown, the computer system includes a host 810 , a controller 820 , and a memory 830 .
[0092] The storage space of the 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 the electronic device including the computer system, and a second type corresponding to internal data of the electronic device.
[0093] Among them, the storage space of the above-mentioned memory 830 is divided into at least two types of data partitions, which can be understood as: the storage space of the memory 830 is a logical storage space, and the storage space is divided into at least two types of logical data partitions.
[0094] Alternatively, the storage space of the above-mentioned memory 830 is divided into at least two types of data partitions, which can also be understood as: the storage space of the memory 830 is a physical storage space, and the logical space corresponding to the storage space is divided into at least two logical types of data partitions.
[0095] Furthermore, the at least two types of the above-mentioned data partitions include 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 include one or more data partitions. The embodiment of the present application does not limit the number and capacity of each type of data partition.
[0097] For example, 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 in the figure includes one data partition (data partition 3), and the second type of data partition 810b includes two data partitions (data partition 1 and data partition 2). Optionally, the first type of data partition 810a may also include more data partitions, and correspondingly, the second type of data partition 810b may include only one data partition, or may include 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 a logical unit number to which the first data is to be written, wherein the logical unit 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 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.
[0099] When the host 810 needs to write the first data, the logical unit number (LUN) to which the first data is to be written may be specified in a write command, wherein 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] Among them, different logical unit numbers can correspond to different physical storage blocks, and the logical unit number corresponding to the first type of data partition may be different from the logical unit number corresponding to the second type of data partition. At this time, in the above-mentioned computer system, the data of the first type of data partition (external data) will be written into the physical storage block corresponding to the external data, and the data of the second type of data partition (internal data) will be written into the physical storage block corresponding to the internal data, and the physical storage blocks where the internal data and the external data are written are different. That is to say, in the above-mentioned computer system, internal data and external data will not be stored in one physical storage block at the same time.
[0102] For example, Figure 8As shown, file 810c is external data, and file 810d is internal data; when the host 810 writes data in file 810c, the LUN number in the write command is specified by the first type, and at this time, the controller 820 instructs the memory 830 to write the data to the physical storage block 830a corresponding to the first type of data partition; when the host 810 writes data in file 810d, the LUN number in the write command is specified by the second type, and at this time, the controller 820 instructs the memory 830 to write the data to the physical storage block 830b corresponding to the second type of data partition; wherein, the physical storage block 830a and the physical storage block 830b are different physical storage blocks.
[0103] For example, see Fig. 9 , which shows a schematic diagram of data storage on a physical storage block involved in the present application. Fig. 9 As shown, it is assumed that the physical storage block 90 and the physical storage block 91 in the memory of the computer system involved in the embodiment of the present application correspond to 12 pages respectively, wherein the physical storage block 90 is the physical storage block corresponding to the first type of data partition, and the physical storage block 91 is the physical storage block corresponding to the second type of data partition.
[0104] like Fig. 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 the physical storage block 90, and the controller instructs the memory to write the external data to the 6 pages in the 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 the physical storage block 91, and the controller instructs the memory to write the internal data to the 6 pages in the physical storage block 91; after a period of time, the external data in the physical storage block 90 is not read and is still valid data, while the external data in the physical storage block 91 becomes invalid data after being read. At this time, the storage system will perform garbage collection on the physical storage block 91, but will not perform garbage collection on the physical storage block 90.
[0105] Combination Fig. 9 It can be seen that when storing external data in the storage system, since the external data and the internal data are written into different physical storage blocks, the garbage collection of the physical storage blocks where the internal data is located will not affect the physical storage blocks where the external data is located, thereby reducing the number of garbage collections of the physical storage blocks storing the external data and increasing the life of the corresponding physical storage blocks.
[0106] To summarize, in the computer system involved in the embodiments of the present application, in a computer system including a host, a controller and a memory, the storage space of the memory is divided into different data partitions according to the data type (i.e., external data and internal data of the electronic device), and 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, and the controller instructs the memory to write the first data to 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 to different physical storage blocks in the memory, and the garbage collection operation is performed in units of physical storage blocks, that is, the read and write operations on the internal data will not affect the physical storage blocks where the 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 blocks in the memory where the external data is written. It can be seen that through the above scheme, when storing external data in the storage system, the number of garbage collection times on the physical storage blocks storing external data in the storage system can be reduced, and the service life of the memory can be improved.
[0107] based on Figure 8 In the computer system of the illustrated embodiment, in an optional embodiment, the controller 820 may be configured to determine a physical storage block corresponding to a 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 the various physical storage blocks 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, therefore, for external data and internal data, the physical storage blocks corresponding to the logical unit number determined by the controller 820 are different physical storage blocks.
[0109] The physical storage blocks corresponding to the logical unit number may refer to one or more physical storage blocks among the physical storage blocks that allow writing of data in a data partition of the type corresponding to the logical unit number.
[0110] For example, when the first data is external data, the physical storage blocks corresponding to the logical unit numbers are one or more physical storage blocks in the physical storage blocks that are allowed to write the first data.
[0111] For another example, when the first data is internal data, the physical storage blocks corresponding to the logical unit number are one or more physical storage blocks in the physical storage blocks that are allowed to write the second data.
[0112] Among them, the above-mentioned physical storage blocks that are allowed to write data in the data partition of the type corresponding to the logical unit number may refer to physical storage blocks that have a fixed association relationship with the logical unit number. That is to say, in an optional embodiment, when the above-mentioned controller 820 determines the physical storage block corresponding to the logical unit number according to the logical unit number, it can determine the physical storage block corresponding to the logical unit number according to the association relationship 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 can first determine the physical storage blocks associated with the logical unit number, and then determine one or more unfull physical storage blocks from the physical storage blocks associated with the logical unit number as the above-mentioned physical storage blocks corresponding to the logical unit number.
[0114] In an optional embodiment, the association relationship between the above-mentioned logical unit number and each physical storage block may be an association relationship between a complete logical unit number and each physical storage block.
[0115] In other embodiments, the association relationship between the above-mentioned logical unit number and each physical storage block can be an association relationship between one or more bits in the logical unit number and each physical storage block. For example, the logical unit number is 8-bit data, one or more bits (such as the highest bit or the second highest bit) are used to indicate the type of the data partition corresponding to the logical unit number, such as "1" indicates that the type of the data partition corresponding to the logical unit number is the first type (corresponding to external data), and "0" indicates that the type of the data partition corresponding to the 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 according to the value of the 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, in the cache of the controller 820, or in the memory 830, an association relationship between a logical unit number and each physical storage block may be pre-stored, and the association relationship may be stored in the form of a relationship table or a relationship item; for example, the association relationship between the above-mentioned logical unit number and each physical storage block may be set when the storage space of the memory 830 is configured as at least two types of data partitions in the host; for example, during the system setting process of the electronic device before leaving the factory, the storage space of the memory 830 may be configured as at least two types of data partitions in the host, and the logical unit number corresponding to each type of data partition is divided, and at the same time, the association relationship between the above-mentioned logical unit number and each physical storage block in the memory 830 is configured; or, during the first startup of the operating system of the electronic device / the user restores the factory settings, the host guides the user to configure a part of the storage space in the memory 830 of the electronic device as an 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 divides the logical unit number corresponding to each type of data partition. At the same time, the controller 820 configures the association relationship between the above-mentioned logical unit number and each physical storage block in the memory 830.
[0117] In other embodiments, the association relationship between the above-mentioned logical unit number and each physical storage block may also be pre-defined in the firmware; for example, the association relationship between the above-mentioned logical unit number and each physical storage block may be pre-defined by a protocol.
[0118] In other embodiments, the association between the above-mentioned logical unit number and the physical storage block may also be an implicit association. For example, the above-mentioned controller 820 is configured to obtain a data attribute of the first data according to the logical unit number, and 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, and determine the physical storage block corresponding to the logical unit number from the memory according to the data attribute, and instruct the memory 830 to write the first data into the physical storage block corresponding to the logical unit number.
[0119] In the above embodiment, the correspondence between the logical unit number and the data attribute may be pre-stored in the cache of the controller 820 or in the memory 830, or the correspondence between the logical unit number and the data attribute may be pre-defined in the firmware of the controller 820. After the controller 820 receives the write command, it 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 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 meets the first condition 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 does not store the second data, and the second data is data in the second type of data partition; or, the controller 820 determines at least one physical storage block that is not full from other storage blocks other than the physical storage block where the data in the second type of data partition is located, 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 meets the second condition 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 does not store the third data, and the third data is data in the first type of data partition; or, the controller 820 determines at least one physical storage block that is not full from other storage blocks other than the physical storage block where the data in the first type of data partition is located, as the physical storage block corresponding to the logical unit number.
[0121] In the above embodiment, when the first data is external data, the controller 820 determines that no internal data exists on the physical storage block corresponding to the logical unit number. Similarly, when the first data is internal data, the controller 820 determines that no external data exists on the physical storage block corresponding to the logical unit number. Therefore, in the process of writing data, it is ensured that the external data in the memory is isolated from the physical storage blocks where the internal data are located.
[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 is located 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 that meets the 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 that meets the second condition from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number.
[0123] Among them, the correspondence between the type of the above-mentioned data partition and the physical storage block where the data in the data partition is located is a non-fixed configuration relationship, which means that no matter whether it is external data 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 the external data and internal data do not exist on the same physical storage block at the same time; that is to say, after the data partition is set (set), the logically expressed data partition does not have certain fixed corresponding physical storage blocks. When the data is written, the controller 820 allocates corresponding physical storage blocks to the data to be written, and 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 out from all available physical storage blocks in the memory 830 a physical storage block that is not currently full (including physical storage blocks with all pages or part of the pages being 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; or, 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] Through the above scheme, for a certain physical storage block in the memory, at a certain moment, one of the external data and the 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 of the external data and the internal data can be written into the physical storage block. However, at the same moment, only one of the external data and the internal data is stored in the physical storage block.
[0126] For example, please refer to Fig.10 , which shows a schematic diagram of a data storage location change involved in this application. Fig.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 reading and writing process, internal data 2 is written to physical storage block 1003, and physical storage block 1002 is recycled. 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] By the above Fig.10 It can be seen 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 further ensuring the utilization rate of the physical storage block.
[0128] In an optional embodiment, 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 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 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, 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.
[0129] Among them, the correspondence between the type of the above-mentioned data partition and the physical storage block where the data in the data partition is located is a fixed configuration relationship, which means that for a physical storage block, the data written to the physical storage block at different times is the same type of data in the external data and the internal data; that is, at different times, the physical storage block will only be written with external data or internal data; that is, a part of the physical storage blocks in the memory has been pre-divided for external data use, and another part of the physical storage blocks has been pre-divided for internal data use, and there is no overlap between the two parts of the physical storage blocks; accordingly, when the controller 820 instructs the memory 830 to write the first data, it can be combined with the data attributes of the first data, from the corresponding data attributes in the memory 830 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 that are pre-divided as external data in the memory 830, and instructs the memory 830 to write the first data into the one or more physical storage blocks; or, 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 that are pre-divided as internal data in the memory 830, and instructs the memory 830 to write the first data into the one or more physical storage blocks.
[0130] Through the above scheme, for a certain physical storage block, at a certain moment, one of the external data and the internal data can be written into the physical storage block. After a period of reading, writing and garbage collection, at another subsequent moment, the same type of data can be written into the physical storage block, and the other type of data between the external data and the internal data will not be written. That is to say, at different moments, only one of the external data and the internal data is stored in the physical storage block.
[0131] For example, please refer to Fig.11 , which shows another schematic diagram of changing the data storage location involved in the present application. Fig.11 As shown, the physical storage blocks in the memory are divided into block group 1101 and block group 1102, wherein each physical storage block in block group 1101 stores internal data, and each physical storage block in block group 1102 stores external data; Fig.11 At the initial moment, the internal data 1 is stored in the physical storage block 1101a in the block group 1101, and the external data 1 is stored in the physical storage block 1102a in the block group 1102. In the subsequent reading and writing process, in the reading and writing process of the internal data 1, the controller can instruct the memory to write the internal data 1 to the physical storage block 1101b in the same block group, and in the reading and writing process of the external data 1, the controller can instruct the memory to write the external data 1 to the physical storage block 1102b in the same block group. That is to say, the internal data will not be written to the block group 1102, and similarly, the external data will not be written to the block group 1101.
[0132] By the above Fig.11 It can be seen that for data corresponding to a certain data attribute, when the controller 820 determines the physical storage blocks that can be written, it only needs to query the unfilled physical storage blocks in a part of the physical storage blocks corresponding to the data attribute, and does not need 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 attribute of the first data is predefined by the protocol; in this case, the correspondence between the logical unit number and the data attribute of the first data can be predefined in the firmware.
[0134] Alternatively, the correspondence between the above-mentioned logical unit number and the data attribute of the first data is set when the storage space of the memory is configured as at least two types of data partitions in the host; for example, during the system setting process of the electronic device before leaving the factory, the storage space of the memory 830 is configured as at least two types of data partitions in the host, and the logical unit numbers corresponding to each type of data partition are divided, and at the same time, the correspondence between the above-mentioned logical unit numbers and the data attributes is configured; or, during the first startup of the operating system of the electronic device / the user restores the factory settings, the host guides the user to configure a part 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 divides the logical unit numbers corresponding to each type of data partition. At the same time, the controller 820 configures the correspondence between the above-mentioned logical unit numbers and the data attributes.
[0135] based on Figure 8 The computer system in the illustrated embodiment, in an optional embodiment, may also consider the influence of external data 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 is located.
[0137] In an embodiment of the present application, the controller 820 can set a corresponding data type for the first data according to the type of the data partition in 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 management methods subsequently.
[0138] For example, when the type of the data partition to which the first data is written is of the first type, the controller 820 can set the data type of the first data to the first data type. When the physical storage block where the first data is located is subsequently managed, a longer time interval can be used to detect whether the physical storage block needs garbage collection or wear leveling.
[0139] For another example, when the type of the data partition to which the first data is written is the second type, the controller 820 can set the data type of the first data to the second data type. When the physical storage block where the first data is located is subsequently managed, a shorter time interval can be used to detect whether the physical storage block needs garbage collection or wear leveling.
[0140] In an optional embodiment, the above data types may include: cold data or hot data.
[0141] In an embodiment of the present application, the controller 820 can set the data type of the first data to one of 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 data / hot data data types and simplifying the data type setting logic.
[0142] For example, please refer to Fig.12 , which shows a schematic diagram of external data writing settings involved in this application. Fig.12 As shown, a hot and cold data separation engine 1201 is provided in the firmware of the controller, and the storage space in the mobile phone memory is divided into four data partitions, corresponding to four groups of LUNs, including two groups of LUNs for system startup, one group of LUNs for storing internal data of the mobile phone, and one group of LUNs 1202 for users to store external data of the mobile phone. The data written to LUN 1202 will be marked as cold data by the hot and cold data separation engine 1201. At the same time, the physical storage blocks where the data in the data partition corresponding to the LUN 1202 is located are different from the physical storage blocks where the data in the data partitions corresponding to other LUNs are located, thereby reducing garbage collection and obtaining better write amplification performance.
[0143] In other embodiments, the above data types may also be newly added types used to manage internal data or external data differently.
[0144] based on Figure 8 The computer system in the embodiment shown, in an optional embodiment, as a logical data partition, the first type of data partition corresponding to the external data can be unloaded or loaded in the interface of the host's resource manager to achieve the effect of hiding or displaying the storage space for external data in the electronic device.
[0145] In an optional embodiment, the host 810 is also configured to display an uninstall 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 interface of the host's resource manager when a trigger operation for the uninstall control is received.
[0146] In an embodiment of the present application, in the interactive interface displayed to the user on the host side, the data partitions / data partition entries into which the storage space of the above-mentioned memory 830 is divided can be displayed. By triggering (such as clicking) the data partition / data partition entry, the data stored in the data partition can be viewed, as well as 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 more important data in the internal data of the electronic device, the user can back up the data to the data partition of the external data. For example, the user can view the data to be backed up (such as a photo) in the data partition corresponding to the internal data, long press the photo, and select Copy in the pop-up selection box, and then enter the data partition of the external data, long press the blank area and select Paste in the pop-up selection box to back up the photo to the data partition of the external data. The photos copied to the data partition of the external data will be stored as external data, which is equivalent to executing the process of writing the photo as external data into the first type of data partition.
[0148] Among them, the data partition of the external data can be uninstalled in the resource manager interface of the host, so that the data partition of the external data / the entry of the data partition is hidden. For example, please refer to Fig.13 , which shows a schematic diagram of data partition unloading of external data involved in this application. Take the interactive interface and the resource manager interface as an example, Fig.13 As shown, in the interface of the host's resource manager, there are displayed an uninstall control 1301, a data partition 1302 for external data, and a data partition for internal data. After the user clicks the uninstall control 1301, the data partition 1302 for external data is hidden. The above process can be called uninstalling the data partition for external data.
[0149] In an optional embodiment, the uninstallation process of the data partition of the external data can be added with authentication logic, that is, to verify whether the user has the authority to uninstall the data partition of the external data in the interface of the host's resource manager. For example, in the case of receiving a trigger operation for the uninstallation 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 password entered by the user with the pre-set password. If the match is successful, the first type of data partition is uninstalled in the interface of the host's resource manager.
[0150] The unloading process of the data partition of the first type does not affect the isolation of the physical storage blocks of the external data and the internal data in the memory. Specifically, after the data partition of the first type is unloaded, when the host 810 subsequently writes data to the data partition of the internal data, the logical unit number carried in the write command sent to the controller 820 is still specified by the type of the data partition of the internal data. Accordingly, the controller 820 instructs the memory 830 to write the data to the physical storage block corresponding to the logical unit number according to the logical unit number, thereby isolating the data from the external data already in the memory at the physical storage block level.
[0151] In an optional embodiment, 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 load the first type of data partition in the interface of the host's resource manager when a trigger operation on the loading control is received.
[0152] The data partition of the external data after being uninstalled can also be reloaded in the resource manager interface of the host, so that the data partition / entry of the data partition of the external data is redisplayed. Fig.13 , please refer to Fig.14 , which shows a schematic diagram of data partition loading of external data involved in this application. Fig.13 In the example, the user clicks the uninstall control 1301, and after the data partition 1302 of the external data is hidden, the uninstall control 1301 in the resource manager interface is replaced by the load control 1303. Fig.14 In the example, after the user clicks the loading control 1303, the data partition 1302 of the external data is redisplayed. The above process may be referred to as loading the data partition of the external data.
[0153] In an optional embodiment, the process of loading the data partition of the external data can be added with authentication logic, that is, to verify whether the user has the authority to load the data partition of the external data in the interface of the host's resource manager. For example, when 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 password entered by the user with the pre-set password. If the match is successful, the first type of data partition is loaded in the interface of the host's resource manager.
[0154] based on Figure 8 In the computer system in the illustrated embodiment, in an optional embodiment, as a logical data partition, the first type of data partition corresponding to the external data can also be visible to other external devices outside the electronic device, so as to achieve the effect of directly writing data in the external device to the storage space in the electronic device for external data.
[0155] In an optional embodiment, the host 810 is also configured to display a trigger control corresponding to the first type of data partition on the interactive interface in response to the electronic device being coupled to an external device via a universal serial bus interface; and to allow access to the first type of data partition on the external device side when a selection operation on the trigger control is received.
[0156] For example, an electronic device can be coupled to an external device via a USB cable. At this time, the interface of the first type of data partition / data partition can be displayed in the resource manager of the external device. At this time, the user on the external device side can view the data stored in the data partition, as well as interactive operations on the data stored in the data partition, by triggering (such as clicking) the entry of the data partition / data partition.
[0157] For example, in one usage scenario, for data that needs to be backed up or copied in an external device, the user can store the data in a data partition of the external data of the electronic device. For example, the user can view the data to be copied (such as a photo) in the external device, long press the photo, and select Copy in the pop-up selection box. Then, enter the data partition of the external data of the electronic device displayed on the external device side, long press a blank area and select Paste in the pop-up selection box, thereby writing the photo to the data partition of the external data of the electronic device. The photo copied to the data partition of the external data will be stored as external data by the host 810 of the electronic device.
[0158] Among them, for the data partition of the external data, it can be displayed or hidden in the interface of the resource manager on the external device side in the interactive interface of the host when the electronic device is coupled to the external device. Fig.15 , which shows a schematic diagram of the device connection involved in this application. Take the electronic device as a mobile phone and the external device as a personal computer as an example. Fig.15 As shown, when the mobile phone is connected (coupled) to the computer via a USB cable, three options pop up in the mobile phone interface, namely option 1501, option 1502 and option 1503; when the user selects option 1501, the computer's resource manager interface displays a portable solid state drive (PSSD) partition 1503 and a mobile phone file partition 1504, wherein the PSSD partition 1503 corresponds to a first type of data partition in the mobile phone for storing external data, and the mobile phone file partition 1504 corresponds to a second type of data partition in the mobile phone for storing internal data, and at the same time, the computer charges the mobile phone via the USB cable; when the user selects option 1502, the computer's resource manager interface only displays the mobile phone file partition 1504, and does not display the PSSD partition 1503, and at the same time, the computer charges the mobile phone via the USB cable; when the user selects option 1503, the computer's resource manager interface does not display the PSSD partition 1503 and the mobile phone file partition 1504, that is, at this time, the computer only charges the mobile phone via the USB cable.
[0159] In other embodiments, the above options 1501, 1502, and 1503 may also be triggered separately; for example, when the user selects option 1501 and does not select options 1502 and 1503, only PSSD partition 1503 is displayed in the computer's resource manager interface, and the computer does not charge the mobile phone; when the user selects option 1502 and does not select options 1501 and 1503, only mobile phone file partition 1504 is displayed in the computer's resource manager interface, and the computer does not charge the mobile phone; when the user selects option 1503 and does not select options 1501 and 1502, the computer The mobile phone is charged, but the PSSD partition 1503 and the mobile phone file partition 1504 are not displayed in the computer's resource manager interface; for example, when the user selects option 1501 and option 1502, and does not select option 1503, the PSSD partition 1503 and the mobile phone file partition 1504 are displayed in the computer's resource manager interface, and the computer does not charge the mobile phone; for example, when the user selects options 1501, 1502 and 1503 at the same time, the PSSD partition 1503 and the mobile phone file partition 1504 are displayed in the computer's resource manager interface, and the computer charges the mobile phone.
[0160] Fig.16 is a flowchart of an operating method of a computer system provided by an exemplary embodiment of the present application, the method is applied to a computer system including 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 including 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; Fig.16 As shown, the method includes the following.
[0161] Step 1601, the host sends a write command to the controller; the write command includes first data to be written into the memory and a logical unit number into which the first data is to be written, and the logical unit number is specified according to the type of the data partition.
[0162] Step 1602: The controller instructs the memory to write the first data into a physical storage block corresponding to the logical unit number in the memory 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 the first data into a physical storage block corresponding to the logical unit number in the memory according to the logical unit number, including:
[0164] The controller determines a physical storage block corresponding to the logical unit number according to 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 obtains the data attribute of the first data based on 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; the controller determines the physical storage block corresponding to the logical unit number from the memory based on the data attribute, and instructs 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 attribute of the first data is predefined by the protocol; or, the correspondence between the logical unit number and the data attribute of the first data is set when the storage space of the memory is configured as at least two types of data partitions in the host.
[0167] In an optional embodiment, the controller determines a physical storage block corresponding to a logical unit number from a memory according to 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 that satisfies a first condition 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 does not store second data, and the second data is data in a data partition of a second type; 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 that satisfies a second condition 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 does not store third data, and the third data is data in a data partition of the first type.
[0168] In an optional embodiment, the correspondence between the type of data partition and the physical storage block where the data in the data partition is located is a non-fixed configuration relationship.
[0169] In a case where 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: in a case where 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] In a case where 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: in a case where 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 an optional embodiment, 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 relationship.
[0172] In a case where 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 meets the first condition from the memory as the physical storage block corresponding to the logical unit number, including: in a case where 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 physical storage blocks pre-configured for the first type of data partition as the physical storage block corresponding to the logical unit number.
[0173] In a case where 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 meets the second condition from the memory as the physical storage block corresponding to the logical unit number, including: in a case where 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 physical storage blocks 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 sets 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 an optional embodiment, the data type includes: cold data or hot data.
[0176] In an optional embodiment, the above method also includes: when the first type of data partition has been loaded, the host displays an uninstall control on the interactive interface; when a trigger operation for the uninstall control is received, uninstalling the first type of data partition in the interface of the host's resource manager.
[0177] In an optional embodiment, the above method also 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 on the loading control is received, the first type of data partition is loaded in the interface of the host's resource manager.
[0178] In an optional embodiment, the above method also includes: the host displays a trigger control corresponding to the first type of data partition on the interactive interface in response to the electronic device being coupled to an external device via a universal serial bus 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.
[0179] Fig.17 is a structural block diagram of a storage system provided by an exemplary embodiment of the present application, such as Fig.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] Storage system 1700 may be all or part of a mobile phone, a desktop computer, a laptop computer, a tablet computer, a vehicle computer, a game console, a printer, a positioning device, a wearable electronic device, a smart sensor, a virtual reality (VR) device, an 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 (e.g., a central processing unit (CPU)) or a system on chip (SoC) (e.g., an application processor (AP)) of an electronic device. 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 embodiments, the controller 1720 is also coupled to a host. The controller 1720 may manage data stored in the memory 1710 and communicate with the host.
[0184] In some embodiments, controller 1720 is designed to operate in a low duty cycle environment, such as a secure digital (SD) card, a compact flash (CF) card, a universal serial bus (USB) flash drive, or other media for use in electronic devices such as personal computers, digital cameras, mobile phones, etc.
[0185] In some embodiments, the controller 1720 is designed to operate in a high duty cycle environment solid state drive (SSD) or embedded Multi Media Card (eMMC), which is used as data storage for mobile devices such as smart phones, tablet computers, laptops, etc., as well as enterprise storage arrays.
[0186] The controller 1720 may be configured to control operations of the memory 1710, such as read, erase, and program operations. The controller 1720 may also be configured to manage various functions regarding data stored or to be stored in the memory 1710, including but not limited to bad block management, garbage collection, logical to physical address translation, wear leveling, etc. In some embodiments, the controller 1720 is also configured to process error correction codes (ECC) regarding data read from or written to the memory 1710.
[0187] Controller 1720 may also perform any other suitable functions, such as formatting memory 1710. Controller 1720 may communicate with an external device according to a specific communication protocol.
[0188] The controller 1720 and one or more memories 1710 may be integrated into various types of storage devices, for example, included in the same package (eg, a universal flash storage (UFS) package or an eMMC package). That is, the memory system 1700 may be implemented and packaged into different types of terminal electronic products.
[0189] Illustratively, the controller 1720 and the single memory 1710 may be integrated into a memory card. The memory card may include a PC card (PCMCIA, Personal Computer Memory Card International Association), a CF card, a Smart Media (SM) card, a memory stick, a multimedia card (MMC, RS-MMC, MMCmicro), an SD card (SD, miniSD, microSD, SDHC), UFS, etc. The memory card may also include a memory card connector for coupling the memory card to a host.
[0190] Illustratively, the controller 1720 and the plurality of memories 1710 may be integrated into a solid state drive (SSD). In some implementations, the storage capacity and / or operating speed of the solid state drive is greater than the storage capacity and / or operating speed of the memory card.
[0191] The controller 1720 can be implemented as Figure 8 The controller 820 and the memory 1710 in the computer system shown in the figure can be implemented as Figure 8 The memory 830 in the computer system shown. That is, 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 including the computer system, and a second type corresponding to internal data of the electronic device; accordingly, the controller is configured to receive a write command; the write command includes the first data to be written into the memory and the logical unit number to which the first data is to be written, and the logical unit number is 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 corresponding to the logical unit number in the memory 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.
[0192] It is understood that the controller 1720 can perform the above Fig.16 In the scheme shown, all or part of the steps are executed by the controller.
[0193] Fig.18 is a schematic diagram of the structure of a controller provided by an exemplary embodiment of the present application. Fig.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 may also be referred to as a Host I / F, which is connected to a host and is used for communicating with the host.
[0195] The memory interface 1820 is connected to the memory (which may be a non-volatile memory) and is used to convert the data exchange on the bus into data exchange that complies with the storage timing of the storage medium.
[0196] The storage controller 1830 is used to control the functions of the entire controller, control the memory interface to correctly complete the data exchange between the memory and the bus, and is responsible for the management of interrupt signals, etc. Specifically, for example, the storage controller 1830 can be used to implement the control of 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] Among them, the peripheral processing unit 1830a can be used to implement mapping management, bad block management, power-off recovery and other functions; the wear leveling unit 1830b is used to implement the wear leveling function of the memory; the garbage collection unit 1830c is used to implement the garbage collection function of the memory, and the error correction unit 1830d is used to implement the error correction (error detection and correction) function, for example, the error correction unit 1830d can include an ECC circuit.
[0199] Optionally, the controller 1800 may further 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 may be connected to the storage controller 1830 , for example, connected to the peripheral processing unit 1830 a in the storage controller 1830 , and may 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 storage controller 1830 via the bus 1840, and can be used to cache data exchanged between the cache controller 1800 and the host or memory, as well as partial configuration information of the cache controller 1800.
[0202] In an embodiment of the present application, 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 including a computer system, and a second type corresponding to internal data of the electronic device; wherein the computer system includes a host, the above-mentioned controller 1800 and a memory; the above-mentioned front-end interface 1810 is configured to receive a write command; the write command includes the first data to be written to the memory and the logical unit number to which the first data is to be written, and the logical unit number is specified according to the type of data partition; the above-mentioned storage controller 1830 is configured to instruct the memory to write the first data into a physical storage block corresponding to the logical unit number in the memory through the memory interface 1820 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 controller 1800 may execute the above Fig.16 In the method shown, all or part of the steps are executed by the controller.
[0204] Fig.19is a flowchart of an operating method of a storage system provided by another exemplary embodiment of the present application, the storage system includes 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 including a computer system, and a second type corresponding to internal data of the electronic device; the computer system includes the above storage system; the method can be executed by the controller, for example, the controller can be as follows Fig.18 The controller 1800 shown; Fig.19 As shown, the method includes the following.
[0205] Step 1901, receiving a write command; the write command includes first data to be written into the memory and a logical unit number into which the first data is to be written, and the logical unit number is specified according to the type of the data partition.
[0206] Step 1902, according to 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 understandable that the method shown in the embodiment of the present application may include the above Fig.16 In the method shown, all or part of the steps are executed by the controller.
[0208] The embodiment of the present application provides a computer-readable storage medium, which stores instructions, which, when executed on a controller, implement the following Fig.19 The embodiment shown in the figure provides an operation method of a storage system. Optionally, the controller may be as follows Figure 8 The controller 802 in the computer system shown, or Fig.18 Controller 1800 is shown.
[0209] The present application provides a computer-readable storage medium in which instructions are stored. When the instructions are executed on a processor of a host, the following are implemented: Fig.16 In the computer system operation method provided in the illustrated embodiment, all or part of the steps are executed by the host.
[0210] In the present application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "at least one" means one or more, and the term "plurality" means two or more, unless otherwise clearly defined.
[0211] The term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0212] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present 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 an electronic device including 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 into 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 a physical storage block corresponding to the logical unit number in the memory according 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.
2. The method according to claim 1, characterized in that: The controller is configured to determine a physical storage block corresponding to the logical unit number according to 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 according to 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 according to 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 corresponding relationship between the logical unit number and the data attribute of the first data is predefined by the protocol; or, The correspondence between the logical unit number and the data attribute of the first data is set when the storage space of the memory is configured as the at least two types of data partitions in the host.
5. The computer system according to claim 3, characterized in that: The controller is configured to: In a case where the data attribute is configured to indicate that the first data is external data of the electronic device, determining at least one physical storage block satisfying a first condition 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 does not store second data, and the second data is data in the data partition of the second type; In a case where the data attribute is configured to indicate that the first data is internal data of the electronic device, at least one physical storage block satisfying 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 does not store third data, and the third data is 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 a non-fixed configuration relationship; The controller is configured to: In a case where the data attribute is configured to indicate that the first data is external data of the electronic device, determining at least one physical storage block satisfying the 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, at least one physical storage block that meets the second condition is determined from all writable physical storage blocks of the memory as the physical storage block corresponding to the logical unit number.
7. 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 a fixed configuration relationship; The controller is configured to: In a case where the data attribute is configured to indicate that the first data is external data of the electronic device, determining at least one unfilled physical storage block 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, at least one unfilled physical storage block is determined from the physical storage blocks pre-configured for the second type of data partition 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 further configured to set a data type of the first data according to a type of the data partition in which the first data is written; The data type is used to manage the first data or a physical storage block where the first data is located.
9. The computer system according to claim 8, characterized in that: The data type includes: 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 uninstall control on an interactive interface when the first type of data partition has been loaded; and uninstall the first type of data partition in the interface of the resource manager of the host when a trigger operation for the uninstall 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 an interactive interface when the first type of data partition is not loaded; and load the first type of data partition in the interface of the resource manager 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 display a trigger control corresponding to the first type of data partition on an interactive interface in response to the electronic device being coupled to an external device via a universal serial bus interface; and to allow access to the first type of data partition on the external device side upon receiving a selection operation on the trigger control.
13. A method for operating 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 an electronic device including 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 into the memory and a logical unit number into which the first data is to be written, wherein the logical unit number is specified according to the type of the data partition; The controller instructs the memory to write the first data into a physical storage block corresponding to the logical unit number in the memory according 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.
14. The method according to claim 13, characterized in that The controller instructs the memory to write the first data into a physical storage block corresponding to the logical unit number in the memory according to the logical unit number, including: The controller determines a physical storage block corresponding to the logical unit number according to 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 a physical storage block corresponding to the logical unit number according to 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 acquires a 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; The controller determines a physical storage block corresponding to the logical unit number from the memory according to the data attribute, 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 corresponding relationship between the logical unit number and the data attribute of the first data is predefined by the protocol; or, The correspondence between the logical unit number and the data attribute of the first data is set when the storage space of the memory is configured as the at least two types of data partitions in the host.
17. The method according to claim 15, characterized in that The controller determines, from the memory according to the data attribute, a physical storage block corresponding to the logical unit number, including: In the case where 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 satisfying a first condition 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 does not store second data, and the second data is data in the 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 that meets a second condition 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 does not store third data, and the third data is 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 a non-fixed configuration relationship; In a case where 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 satisfying a first condition from the memory as a physical storage block corresponding to the logical unit number, including: In a case where the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines, from all writable physical storage blocks of the memory, at least one physical storage block that satisfies the first condition as the physical storage block corresponding to the logical unit number; In a case where 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 satisfying a second condition from the memory as a 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 meets 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 the data partition and the physical storage block where the data in the data partition is located is a fixed configuration relationship; In a case where 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 satisfying a first condition from the memory as a physical storage block corresponding to the logical unit number, including: In a case where the data attribute is configured to indicate that the first data is external data of the electronic device, the controller determines at least one unfilled physical storage block from the physical storage blocks pre-configured for the first type of data partition as the physical storage block corresponding to the logical unit number; In a case where 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 satisfying a second condition from the memory as a 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 unfilled physical storage block from the physical storage blocks pre-configured for the second type of data partition as the physical storage block corresponding to the logical unit number.
20. The method according to claim 13, characterized in that The method further comprises: The controller sets the data type of the first data according to the type of the data partition in which the first data is written; The data type is used to manage the first data or a physical storage block where the first data is located.
21. The method according to claim 20, characterized in that The data type includes: cold data or hot data.
22. The method according to any one of claims 13 to 21, characterized in that: The method further comprises: When the first type of data partition has been loaded, the host displays an uninstall control on an interactive interface; when a trigger operation for the uninstall control is received, the host uninstalls the first type of data partition in the interface of the resource manager of the host.
23. The method according to any one of claims 13 to 21, characterized in that: The method further comprises: When the first type of data partition is not loaded, the host displays a loading control on an interactive interface; when a trigger operation on the loading control is received, the host loads the first type of data partition in the interface of the resource manager of the host.
24. The method according to any one of claims 13 to 21, characterized in that: The method further comprises: 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 the first type of data partition on an interactive interface; upon receiving a selection operation on the trigger control, access to the first type of data partition is allowed on the external device side.
25. A storage system, characterized in that: The storage system includes 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 including 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 into the memory and a logical unit number into 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 a physical storage block corresponding to the logical unit number in the memory according 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.
26. A controller, characterized in that: The controller includes a front-end interface, a memory interface and a memory 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 including 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 a write command; the write command includes first data to be written into the memory and a logical unit number into 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 a physical storage block corresponding to the logical unit number in the memory through the memory interface according 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.
27. A method for operating a storage system, characterized in that: The storage system includes 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 including 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 includes: receiving a write command; the write command comprising first data to be written into the memory and a logical unit number into which the first data is to be written, the logical unit number being specified according to the type of the data partition; According to the logical unit number, instruct the memory to write the first data into a 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, which implement the method according to claim 27 when executed on the controller.
Citation Information
Patent Citations
Method and apparatus of memory management by storage system
CN103365603A
Memory system, operating method thereof, memory controller, and memory
CN115527587A
Heterogeneous resource management method and related equipment
CN116069494A
Storage system, computer system and a method of establishing volume attribute
US20050182769A1
Storage system and method for thin provisioning
US20180188998A1