Storage device control method and system, electronic device and storage medium
By carrying the discarded command in the read -write command of the storage device, the problem of insufficient discarding commands sent by the host side is solved, and the rapid discarding of invalid data in the storage device is realized, and the storage performance is improved.
Patent Information
- Application Number
- CN202310914492.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2025-01-24
AI Technical Summary
In storage devices, there are few or very slow drop commands sent by the host side, resulting in invalid data not being discarded in time, resulting in poor visual storage space and affecting storage performance.
Carrying discard commands in read and write commands enables the storage device to quickly and efficiently discard invalid data while executing read and write commands.
By carrying the discarded command in the read -write command, the storage device can quickly process invalid data, reduce bandwidth occupation and power consumption, and improve storage performance.
Smart Images

Figure CN119357083A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage devices, and in particular to a control method and system for storage devices, electronic equipment and storage medium. Background Art
[0002] During the application of the storage device, a discard command needs to be sent from the host to enable the storage device to discard invalid data.
[0003] In actual operation, the inventors of the present application discovered that the discard commands sent from the host side to the storage device are few or very slow, resulting in invalid data in the storage device not being discarded in time, making a lot of storage space remaining from the host side's perspective, while very little storage space remaining from the storage device's perspective, that is, the remaining storage space seen from the host side is different from the actual remaining storage space. Speeding up the sending of discard commands will occupy bandwidth and affect efficiency, as well as generate more power consumption, affecting the storage performance of the storage device. Summary of the invention
[0004] The main technical problem solved by the present invention is to provide a control method, system, electronic device and storage medium for a storage device, which can quickly and effectively reduce invalid data in the storage device and improve the storage performance of the storage device.
[0005] To solve the above technical problems, a technical solution adopted by the present invention is: to provide a storage device control method, applied to the storage device, the method comprising: receiving a read command or a write command sent by a host; wherein the read command and the write command carry a discard command; discarding invalid data corresponding to the discard command in the storage device, and executing the read command or the write command.
[0006] In one embodiment of the present application, discarding the invalid data corresponding to the discard command in the storage device includes: parsing the discard command to obtain a starting address and an address length; and discarding the invalid data corresponding to the starting address and the address length.
[0007] In one embodiment of the present application, discarding the invalid data corresponding to the discard command in the storage device includes: parsing the discard command to obtain a starting address; and obtaining an address length from the storage device; and discarding the invalid data corresponding to the starting address and the address length.
[0008] In one embodiment of the present application, discarding the invalid data corresponding to the discard command in the storage device includes: parsing the discard command to obtain a start address and an end address; and discarding the invalid data corresponding to the start address and the end address.
[0009] In one embodiment of the present application, parsing the discard command to obtain the starting address includes: parsing the discard command to convert the logical address in the discard command into a physical address; and using the physical address as the starting address.
[0010] To solve the above technical problems, another technical solution adopted in the present application is: to provide a control method for a storage device, applied to a host side, the method comprising: in response to a read command or a write command, carrying a discard command in the read command and the write command; sending the read command or the write command to the storage device, so that the storage device discards invalid data corresponding to the discard command, and executing the read command or the write command.
[0011] In one embodiment of the present application, in response to a read command or a write command, carrying a discard command in the read command and the write command includes: determining address information of invalid data in the storage device in response to the read command or the write command; determining the starting address, ending address and / or address length in the discard command based on the address information of the invalid data.
[0012] In one embodiment of the present application, after determining the starting address, ending address and / or length in the discard command based on the address information of the invalid data, it also includes: obtaining the command space corresponding to the read command or the write command; when the remaining space in the command space not occupied by the read command or the write command is greater than or equal to the preset space, storing the starting address and the address length in the remaining space, or storing the starting address and the ending address in the remaining space; when the remaining space is less than the preset space, storing the starting address in the remaining space.
[0013] To solve the above technical problems, another technical solution adopted in the present application is: to provide a control system for a storage device, comprising: a host end; at least one storage device, wherein the storage device is coupled to the host end; wherein each of the storage devices receives a read command or a write command sent by the host end; the read command and the write command carry a discard command; the storage device discards invalid data corresponding to the discard command, and executes the read command or the write command.
[0014] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, including a processor and a memory, wherein the processor is coupled to the memory and executes instructions when working to implement the above storage device control method.
[0015] In order to solve the above technical problems, another technical solution adopted by the present application is: providing a computer-readable storage medium, in which a computer program is stored, and the computer program is executed to implement the above-mentioned storage device control method.
[0016] Different from the current technology, the control method of the storage device provided by the present application, which is applied to the storage device, includes: receiving a read command or a write command sent by the host; wherein the read command and the write command carry a discard command; discarding invalid data corresponding to the discard command in the storage device, and executing the read command or the write command. That is, the technical solution in the present application carries a discard command in the read command and the write command, so that when the host sends a read command or a write command, the storage device can quickly and effectively discard the invalid data according to the discard command carried in the read command and the write command, thereby improving the storage performance of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. 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. Among them:
[0018] Figure 1 It is a flowchart of an embodiment of a control method for a storage device of the present application.
[0019] Figure 2 It is a flowchart of an embodiment of step S120.
[0020] Figure 3 is a flowchart of another embodiment of step S120.
[0021] Figure 4 FIG. 4 is a flowchart of another embodiment of step S120.
[0022] Figure 5 It is a flowchart of another embodiment of the control method of the storage device of the present application.
[0023] Figure 6 It is a flowchart of an embodiment of step S210 of the present application.
[0024] Figure 7 It is a flowchart of an embodiment after step S212 of the present application.
[0025] Figure 8 It is a structural diagram of an embodiment of a control system of a storage device of the present application.
[0026] Fig. 9 It is a structural schematic diagram of an embodiment of the electronic device of the present application.
[0027] Fig.10 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.
[0029] Reference to "embodiments" in an application means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0030] The steps in the embodiments of the present application do not necessarily have to be processed in the described order of steps. The steps can be selectively rearranged, or the steps in the embodiments can be deleted, or the steps in the embodiments can be added as needed. The step descriptions in the embodiments of the present application are only optional sequence combinations and do not represent all step sequence combinations in the embodiments of the present application. The order of steps in the embodiments cannot be considered as a limitation of the present application.
[0031] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0032] From the perspective of storage devices, there is a lot of valid data recognized by the storage devices. The cost of moving data during garbage collection is high, the rate of releasing free space is slowed down, and garbage collection is entered early, which affects the storage performance of the storage devices. The current control method of storage devices generally sends a discard command to the storage device through the host side, so that the storage device discards the corresponding invalid data. In order to speed up the discard of wireless data, it is usually adopted to speed up the sending of discard commands. However, this method will cause IO bandwidth occupation, which has a greater impact on IO efficiency, power consumption, etc.
[0033] Therefore, a control method for a storage device is provided. By carrying a discard command in a read command and a write command, when a host sends a read command or a write command, the storage device can quickly and effectively discard invalid data according to the discard command carried in the read command and the write command, thereby improving the storage performance of the storage device.
[0034] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of a control method for a storage device of the present application.
[0035] like Figure 1 As shown, the control method of the storage device of the present application is applied to the storage device, comprising the following steps:
[0036] S110, receiving a read command or a write command sent by the host end; wherein the read command and the write command carry a discard command.
[0037] Among them, the host end can be a communication device that can send commands, such as a mobile phone, tablet, computer, etc.; the read command is a read command used to read data information from the other device; the write command is a write command used to write data information to the other device.
[0038] Specifically, the host side wants to access the storage device mainly by sending a read command or a write command. Therefore, when the host side sends a read command or a write command to access the storage device, a discard command has been carried in the read command and the write command in advance; then, when the storage device receives the read command or the write command sent by the host side, it also receives the discard command carried in the read command or the write command.
[0039] S120: discard invalid data corresponding to the discard command in the storage device, and execute a read command or a write command.
[0040] Among them, the storage device can be a storage device built into the host side or a storage device external to the host side; the discard command is an instruction to discard certain data information, which is used to discard certain data information in the storage device; invalid data can be erroneous data, missing data, duplicate data, outdated data, abnormal data or inapplicable data, that is, invalid data is invalid in the current situation.
[0041] Specifically, after the storage device receives a read command or a write command, and simultaneously receives a discard command carried in the read command or the write command, the corresponding invalid data in the storage device is discarded according to the discard command, and the read command or the write command is executed accordingly.
[0042] See also Figure 2 , Figure 2 is a flow chart of an embodiment of step S120, such as Figure 2 As shown, including:
[0043] S121. Parse the discard command to obtain the start address and address length.
[0044] Since the discard command corresponds to corresponding invalid data, the discard command needs to be parsed to obtain the starting address and address length corresponding to the invalid data.
[0045] Specifically, after the storage device receives a read command or a write command, and simultaneously receives a discard command carried in the read command or the write command, the storage device parses the discard command to obtain a start address and an address length corresponding to the invalid data.
[0046] S122. Discard invalid data corresponding to the start address and address length.
[0047] The starting address and the address length correspond to the starting position and the length of the storage area of the invalid data in the storage device.
[0048] Specifically, after the storage device obtains the starting address and address length corresponding to the invalid data, the storage device discards the corresponding invalid data according to the starting address and address length.
[0049] See also Figure 3 , Figure 3 is a flow chart of another embodiment of step S120, such as Figure 3 As shown, including:
[0050] S123, parsing the discard command to obtain a start address; and obtaining an address length from a storage device.
[0051] When the remaining space in the command space corresponding to the read command or the write command is insufficient, the discard command may only include the starting address. Therefore, parsing the discard command may only obtain the starting address, and the corresponding address length needs to be obtained from the storage device.
[0052] Specifically, after parsing the discard command, if only the starting address corresponding to the invalid data is obtained without the corresponding address length, it means that the command space of the read command or write command is insufficient to accommodate the address length, and therefore the corresponding address length needs to be obtained from the storage device.
[0053] In some embodiments, by comparing the valid data on the host side and the valid data on the storage device, the same valid data can be determined to be the real valid data, and the valid data in the storage device that is different from the host side is defined as invalid data in the storage device, thereby obtaining the address length corresponding to the invalid data.
[0054] S124. Discard invalid data corresponding to the start address and address length.
[0055] After the start address and the address length are obtained, the area of invalid data can be determined, and then the invalid data in the area can be discarded according to the start address and the address length.
[0056] Specifically, after the storage device obtains the starting address and address length corresponding to the invalid data, the storage device may discard the corresponding invalid data according to the starting address and address length.
[0057] See also Figure 4 , Figure 4 is a flow chart of another embodiment of step S120, such as Figure 4 As shown, including:
[0058] S125, parsing the discard command to obtain the start address and the end address;
[0059] Among them, when there is sufficient remaining space in the command space corresponding to the read command or the write command, the discard command may include a starting address and an ending address, the starting address being the starting position of the invalid data in the storage area in the storage device corresponding to the discard command, and the ending address being the ending position of the invalid data in the storage area in the storage device corresponding to the discard command.
[0060] Specifically, after the storage device receives a read command or a write command, and simultaneously receives a discard command carried in the read command or the write command, the storage device parses the discard command to obtain a start address and an address length corresponding to the invalid data.
[0061] S126. Discard invalid data corresponding to the start address and the end address.
[0062] Specifically, after the storage device obtains the start address and the end address corresponding to the invalid data, the storage device discards the corresponding invalid data according to the start address and the address length.
[0063] In some embodiments, parsing the discard command to obtain the start address includes:
[0064] Parse the discard command and convert the logical address in the discard command into a physical address;
[0065] Among them, the logical address refers to the address of the memory unit, storage unit, and network host seen by the application in the computer architecture, also called the relative address. It is the address used at the network layer and above, and can also be called the virtual address; the physical address stores information in bytes in the storage device. In order to correctly store or obtain information, each byte unit is given a unique memory address. It is the address used by the data link layer and the physical layer, also called the actual address.
[0066] Specifically, when parsing the discard command, the logical address recorded in the discard command is converted into a physical address in the storage device to determine the actual address of the invalid data corresponding to the discard command in the storage device.
[0067] Use the physical address as the starting address.
[0068] Specifically, after the logical address in the discard command is converted into a physical address, because the physical address corresponds to invalid data, the physical address is used as the starting address of the invalid data, and then the invalid data is subsequently processed starting from the physical address.
[0069] In some embodiments, there may be two logical addresses in the discard command, where one logical address corresponds to the starting address and the other logical address corresponds to the ending address; that is, the logical address corresponding to the starting address is converted into the physical address corresponding to the starting address in the storage device, and the logical address corresponding to the ending address is converted into the physical address corresponding to the ending address in the storage device.
[0070] In this embodiment, the storage device receives a discard command carried in a read command or a write command, and then discards invalid data corresponding to the discard command, thereby reducing the additional overhead of executing the discard command alone, saving bandwidth, and correspondingly reducing power consumption. The storage device can also process read and write commands and discard commands at the same time, thereby improving the storage performance of the storage device.
[0071] See also Figure 5 , Figure 5 It is a flowchart of another embodiment of the control method of the storage device of the present application.
[0072] like Figure 5 As shown, the control method of the storage device of the present application is applied to the host side and includes the following steps:
[0073] S210 . In response to a read command or a write command, carry a discard command in the read command or the write command.
[0074] In order for the storage device to receive a discard command at the same time when receiving a read command or a write command, the host needs to carry the discard command in the read command or the write command before sending the read command or the write command.
[0075] See also Figure 6 , Figure 6 is a flow chart of an embodiment of step S210 of the present application, such as Figure 6 As shown, including:
[0076] S211 . In response to a read command or a write command, determine address information of invalid data in a storage device.
[0077] In order to determine the discard command corresponding to the invalid data, it is necessary to first determine the address information of the invalid data in the storage device. The address information of the invalid data is the address used by the invalid data at the network layer and above, that is, the virtual address and the corresponding address length.
[0078] Specifically, the storage device receives and responds to a read command or a write command sent by the host, and determines address information such as a virtual address and address length of invalid data in the storage device.
[0079] S212: Determine a start address, an end address and / or an address length in a discard command based on the address information of the invalid data.
[0080] Among them, because the address information of the wireless data includes a virtual address of a logical address, and the logical address corresponds to a physical address of a storage device, the physical address in the discard command can be determined based on the address information of the invalid data.
[0081] In some embodiments, the address length in the discard command may also be determined according to the address information of the invalid data.
[0082] See also Figure 7 , Figure 7 is a flow chart of an embodiment after step S212 of the present application, such as Figure 7 As shown, including:
[0083] S213. Obtain a command space corresponding to a read command or a write command.
[0084] The command space is the space required for the host to send a read command or a write command.
[0085] Specifically, before sending a read command or a write command on the host side, the data size corresponding to the read command or the write command is first determined, and then the command space for sending the read command or the write command is determined based on the data size, and the command space at least includes the read command or the write command, that is, the command space is larger than the actual data size of the read command or the write command.
[0086] S214. When the remaining space in the command space not occupied by the read command or the write command is greater than or equal to the preset space, the start address and the address length are stored in the remaining space, or the start address and the end address are stored in the remaining space.
[0087] Among them, in order to store the discard command in the command space corresponding to the read command or the write command, a preset space is set, that is, the space occupied by the read command or the write command plus the preset space is the command space, and the preset space is the space required to store the starting address and the address length in the discard command. Therefore, the starting address and the address length can be stored in the remaining space, or the starting address and the end address can be stored in the remaining space, only when the remaining space not occupied by the read command or the write command is greater than or equal to the preset space.
[0088] Specifically, the preset space required for the starting address and address length in the discard command is obtained, and the remaining space not occupied by the read command or the write command in the command space is obtained, and the size of the remaining space and the preset space are compared. When the remaining space is greater than or equal to the preset space, the starting address and the address length can be stored in the remaining space, so that when the host sends a read command or a write command, it carries the starting address and the address length of the discard command.
[0089] In some embodiments, when the remaining space is greater than or equal to the preset space, the start address and the end address can also be stored in the remaining space, so that when the host sends a read command or a write command, it carries the start address and the end address of the discard command.
[0090] S215: When the remaining space is smaller than the preset space, the start address is stored in the remaining space.
[0091] Among them, the remaining space may be smaller than the preset space, that is, the remaining space cannot store both the starting address and the address length in the remaining space, or the remaining space cannot store both the starting address and the ending address in the remaining space. Therefore, only the starting address can be stored in the remaining space, that is, the remaining space needs to be larger than the space required for the starting address.
[0092] Specifically, the host side obtains the preset space required for the starting address and address length in the discard command, and obtains the remaining space not occupied by the read command or the write command in the command space, and compares the size of the remaining space with the preset space. When the remaining space is smaller than the preset space, the starting address is stored in the remaining space, so that when the host side sends a read command or a write command, it carries the starting address of the discard command.
[0093] Alternatively, the host side obtains the preset space required for the starting address and the ending address in the discard command, and obtains the remaining space not occupied by the read command or the write command in the command space, and compares the size of the remaining space with the preset space. When the remaining space is smaller than the preset space, the starting address is stored in the remaining space, so that when the host side sends a read command or a write command, it carries the starting address of the discard command.
[0094] In some embodiments, when the remaining space is smaller than the preset space so that only the starting address of the discard command is stored in the remaining space, a host-side configurable parameter can be added, and when the host sends a read command or a write command, the host-side configurable parameter is carried; the host-side configurable parameter can be a preset address length in the discard command, such as a fixed address length, which can be set according to more actual needs.
[0095] S220, sending a read command or a write command to the storage device, so that the storage device discards the invalid data corresponding to the discard command, and executes the read command or the write command.
[0096] Specifically, the host sends a read command or a write command carrying a discard command to the storage device, so that when the storage device receives the read command or the write command, it also receives the discard command, thereby causing the storage device to discard the invalid data corresponding to the discard command and execute the read command or the write command.
[0097] In this embodiment, before the host sends a read command or a write command, a discard command is carried in the read command or the write command, so that when the host sends the read command or the write command, the discard command is synchronously sent to the storage device, so that the storage device discards the invalid data corresponding to the discard command, and executes the read command or the write command, thereby reducing the additional overhead of executing the discard command alone, saving bandwidth, and correspondingly reducing power consumption, and can process the read and write commands and the discard commands at the same time, thereby improving the storage performance of the storage device.
[0098] See also Figure 8 , Figure 8 It is a structural diagram of an embodiment of a control system of a storage device of the present application.
[0099] like Figure 8As shown, the control system 300 of the storage device includes a host end 310 and at least one storage device 320, and the storage device 320 is coupled to the host end 310; wherein each storage device 320 receives a read command or a write command sent by the host end 310; the read command and the write command carry a discard command; the storage device 320 discards the invalid data corresponding to the discard command, and executes the read command or the write command.
[0100] See also Fig. 9 , Fig. 9 It is a structural schematic diagram of an embodiment of the electronic device of the present application.
[0101] like Fig. 9 As shown, the electronic device 400 includes a processor 410 and a memory 420. The processor 410 is coupled to the memory 420 and executes instructions during operation to implement the above-mentioned control method of the storage device.
[0102] See also Fig.10 , Fig.10 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application.
[0103] like Fig.10 As shown, a computer program 510 is stored in the computer-readable storage medium 500, and the computer program 510 is executed to implement the above-mentioned storage device control method.
[0104] The above technical scheme provides a control method for a storage device, on the storage device, receiving a read command or a write command sent by the host side; wherein the read command and the write command carry a discard command; discarding invalid data corresponding to the discard command in the storage device, and executing the read command or the write command; on the host side, in response to the read command or the write command, carrying the discard command in the read command and the write command; sending the read command or the write command to the storage device, so that the storage device discards the invalid data corresponding to the discard command, and executing the read command or the write command. That is, in the present application, by carrying the discard command in the read command or the write command, the problem of extra bandwidth occupied by sending the discard command alone is avoided, that is, the extra overhead of executing the discard command alone is reduced, bandwidth is saved, power consumption is correspondingly reduced, and the read and write commands and the discard command can be processed at the same time, thereby improving the storage performance of the storage device.
[0105] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the system implementation described above is only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0106] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0107] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0109] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for controlling a storage device, characterized in that: Applied to a storage device, the method comprises: Receiving a read command or a write command sent by a host end; wherein the read command and the write command carry a discard command; The invalid data corresponding to the discard command in the storage device is discarded, and the read command or the write command is executed.
2. The method according to claim 1, characterized in that: The discarding of invalid data corresponding to the discard command in the storage device includes: Parsing the discard command to obtain a starting address and an address length; Invalid data corresponding to the start address and the address length are discarded.
3. The method according to claim 1, characterized in that: The discarding of invalid data corresponding to the discard command in the storage device includes: Parsing the discard command to obtain a start address; and obtaining an address length from a storage device; Invalid data corresponding to the start address and the address length are discarded.
4. The method according to claim 1, characterized in that: The discarding of invalid data corresponding to the discard command in the storage device includes: Parsing the discard command to obtain a start address and an end address; Invalid data corresponding to the start address and the end address are discarded.
5. The method according to any one of claims 2 to 4, characterized in that: The step of parsing the discard command to obtain a start address includes: Parsing the discard command, and converting the logical address in the discard command into a physical address; The physical address is used as the start address.
6. A method for controlling a storage device, characterized in that: Applied to the host side, the method includes: In response to a read command or a write command, carrying a discard command in the read command and the write command; The read command or the write command is sent to a storage device, so that the storage device discards invalid data corresponding to the discard command, and executes the read command or the write command.
7. The method according to claim 6, characterized in that In response to a read command or a write command, carrying a discard command in the read command and the write command comprises: In response to a read command or a write command, determining address information of invalid data in the storage device; The starting address, the ending address and / or the address length in the discard command are determined based on the address information of the invalid data.
8. The method according to claim 7, characterized in that After determining the starting address, the ending address and / or the address length in the discard command based on the address information of the invalid data, the method further includes: Obtaining a command space corresponding to the read command or the write command; When the remaining space in the command space not occupied by the read command or the write command is greater than or equal to a preset space, the start address and the address length are stored in the remaining space, or the start address and the end address are stored in the remaining space; When the remaining space is smaller than the preset space, the start address is stored in the remaining space.
9. A control system for a storage device, characterized in that: include: Host side; At least one storage device, the storage device is coupled to the host end; Among them, each of the storage devices receives a read command or a write command sent by the host; the read command and the write command carry a discard command; the storage device discards invalid data corresponding to the discard command, and executes the read command or the write command.
10. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the processor is coupled to the memory and executes instructions when working to implement the control method of the storage device according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: A computer program is stored in the computer-readable storage medium, and the computer program is executed to implement the control method of the storage device according to any one of claims 1 to 8.
Citation Information
Cited By
Storage controller, storage device, data processing system and method and medium
CN122614301A
Storage controller, storage device, data processing system, method and medium
CN122614301B