Data processing method and data storage device
By setting and updating the detection interval in the data storage device, the problem of setting detection cycles in open commands is solved, and data transmission performance is improved and redundant operations and detection times are optimized.
Patent Information
- Application Number
- CN202411587012.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-08
AI Technical Summary
In data storage devices, the detection cycle of open commands is difficult to set, resulting in the inability to take into account both the redundant operations and the number of detections, which affects the data transmission performance.
By setting the detection interval and updating the detection interval according to the data length transmitted between the host and the data storage device, it can adapt to different data transmission methods and reduce the number of redundant operations and detection times.
It realizes that while ensuring data transmission performance, it balances redundant operations and detection times, and improves data transmission efficiency.
Smart Images

Figure CN119088735B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of storage technology, and in particular relates to a data processing method and a data storage device. Background Art
[0002] When the host performs data transmission between data storage devices, the host sends a read and write command in various forms. One of the read and write commands is an open-end command. When the host sends an open-end command, the length of the command is not set in the open-end command. Instead, the host sends a stop command after reading or writing the command, and the open-end command is completed.
[0003] When a data storage device executes an open command, it detects whether a stop command is received each time a data unit is read or written. If a stop command is not received, the next data unit will be read or written until a stop command is received. This method will cause poor read and write performance. However, if a larger data length is used as the detection cycle of the stop command, a longer redundant operation will be generated. Therefore, when setting the detection cycle of the stop command, the redundant operations and the number of detections cannot be taken into account at the same time, which in turn affects the data transmission performance. Summary of the invention
[0004] The object of the present invention is to provide a data processing method and a data storage device, which can solve the problem that it is difficult to set the detection cycle, resulting in redundant operations and the inability to take into account the number of detections at the same time.
[0005] To achieve the above object, the present invention provides a data processing method and a data storage device, and the data processing method at least comprises the following steps:
[0006] When the data storage device receives an open command sent by the host, a detection interval is set;
[0007] transmitting data between the host and the data storage device in units of the detection interval;
[0008] When the data storage device receives the end command sent by the host, the data transmission between the host and the data storage device ends; and
[0009] The length of data transmitted between the host and the data storage device is obtained, and the detection interval is updated according to the data length.
[0010] In one embodiment of the present invention, the data processing method further includes the following steps:
[0011] It is determined whether the command received by the data storage device is an open command, and if the command received by the data storage device is not an open command, the detection interval is cleared.
[0012] In one embodiment of the present invention, setting the detection interval includes the following steps:
[0013] Determining whether the detection interval exists, and if the detection interval does not exist, presetting the detection interval; and
[0014] If the detection interval exists, the existing detection interval is used.
[0015] In an embodiment of the present invention, the preset detection interval is a first preset detection interval, and the first preset detection interval is the length of data read or written at one time during random reading and writing.
[0016] In one embodiment of the present invention, updating the detection interval according to the data length comprises the following steps:
[0017] Obtaining the relationship between the length of data transmitted between the host and the data storage device and the detection interval; and
[0018] The detection interval is updated according to the relationship between the length of data transmitted between the host and the data storage device this time and the detection interval.
[0019] In one embodiment of the present invention, when the length of data transmitted between the host and the data storage device is less than the detection interval, the length of data transmitted between the host and the data storage device is used as the updated detection interval.
[0020] In one embodiment of the present invention, when the length of data transmitted between the host and the data storage device is equal to the detection interval, the detection interval is kept unchanged.
[0021] In one embodiment of the present invention, when the length of data transmitted between the host and the data storage device is greater than the detection interval, and the detection interval is equal to the first preset detection interval, the detection interval is updated to the second preset detection interval, wherein the first preset detection interval is the length of data read or written at one time during random reading and writing, and the second preset detection interval is the length of data read or written at one time during sequential reading and writing.
[0022] In one embodiment of the present invention, when the length of data transmitted between the host and the data storage device is greater than the detection interval, and the detection interval is not equal to a first preset detection interval, the length of data transmitted between the host and the data storage device is used as an updated detection interval, wherein the first preset detection interval is the length of data read or written at one time during random reading and writing.
[0023] The present invention also provides a data storage device of a data storage device, and the data storage device comprises:
[0024] a memory storing program commands; and
[0025] A processor runs the program command to implement any one of the data processing methods described above.
[0026] In summary, the data processing method and data storage device provided by the present invention use the data length transmitted between the current host and the data storage device to update the detection interval in the next cycle. Since the read and write commands between the host and the data storage device have a certain continuity, the length of the data transmitted by the host to the data storage device next time is likely to be equal to the length of the data transmitted by the host to the data storage device this time. Except when the read and write state between the host and the data storage device changes, the detection interval and the length of the data transmitted between the host and the data storage device are too large. Through the update of the detection interval in the present application, the detection interval and the length of the data transmitted between the data storage device are usually in an adaptive state, thereby reducing the redundant operations generated at the same time, and reducing the number of detections by the maximum length. At the same time, when the length of the data transmitted between the secondary host and the data storage device is greater than or equal to the detection interval, by setting the first preset detection interval and the second preset detection interval, it is verified whether the data transmission between the host and the data storage device is a common data transmission mode such as random reading and writing or sequential reading and writing, thereby further increasing the accuracy of the detection interval estimation, thereby further reducing the redundant operations generated, and reducing the number of detections by the maximum length. Therefore, through the data processing method provided in the present application, it is possible to obtain the detection interval that is compatible with the current read-write program to the maximum extent, thereby balancing the requirements for the redundant operations generated and the number of detections, thereby improving data transmission performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0028] Figure 1 It is a structural schematic diagram of a data storage device in one embodiment of the present application.
[0029] Figure 2 It is a flow chart of a data processing method in one embodiment of the present application.
[0030] Figure 3 This is a flow chart of a method for updating a detection interval in an embodiment of the present application.
[0031] Figure 4 It is a structural schematic diagram of a data storage device in one embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present application are given in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thoroughly and comprehensively understood.
[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0034] In the description of the present invention, it should be understood that the orientations or positional relationships indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", etc. are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. The degrees indicated by "high" and "low" are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or component referred to must have high and low, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0035] See also Figure 1As shown, the host 100 is electrically connected to the data storage device 200, and the host 100 can send commands such as write, read and erase to the data storage device 200. A controller 201 and a non-volatile storage unit 202 are provided in the data storage device 200. The controller 201 can execute a plurality of logic gates or control commands implemented in hardware or firmware form, and perform operations such as writing, reading and erasing data in the non-volatile storage unit 202 according to the command of the host 100. Among them, the host 100 and the data storage device 200 can be implemented as separate chips, modules, or devices, or can be included in a single device. For example, the data storage device 200 can be an integrated single storage device, and then connected to the host 100. However, the present disclosure is not limited to this example. That is, in another example, the host 100 and the data storage device 200 can be integrated into a single device.
[0036] See also Figure 1 As shown, in one embodiment of the present invention, the non-volatile storage unit 202 of the data storage device 200 includes a plurality of flash memory blocks 203, and the flash memory blocks 203 may belong to the same memory die or to different memory die. Each flash memory block 203 has a plurality of physical pages, and each physical page has at least one physical sector, wherein the physical pages belonging to the same flash memory block 203 can be independently written and erased simultaneously. For example, each flash memory block 203 is composed of 128 physical pages, and each physical page has 8 physical sectors. That is to say, in an example where each physical sector is 512 bytes, the capacity of each physical page is 4 kilobytes (K). However, in one embodiment, each flash memory block 203 may be composed of 64 physical pages, 256 physical pages, or any other number of physical pages.
[0037] See also Figure 1 As shown, in one embodiment of the present invention, a flash memory block 203 (block) is the minimum unit of erasure. That is, each flash memory block 203 contains the minimum number of storage cells that are erased together. A physical page is the minimum programmable unit. That is, a physical page is the minimum unit for writing data. However, in some embodiments, the minimum unit for writing data may also be a physical sector or other size. Each physical page generally includes a data bit area and a redundant bit area. The data bit area is used to store user data, and the redundant bit area is used to store system data (e.g., error checking and correction code).
[0038] See also Figure 1As shown, in one embodiment of the present invention, the data storage device 200 using NAND flash memory as the storage medium has the characteristics of non-volatility, fast read and write speed, shock resistance, low power consumption, small size, etc. compared with the traditional magnetic disk, and is currently widely used in embedded systems, consumer electronics, aerospace and other fields. According to the different protocols of communication between the data storage device 200 and the host 100, it can be divided into embedded memory standard specifications (Embedded Multi Media Card, eMMC), universal flash storage (Universal Flash Storage, UFS), serial hard disk (Serial ATA, SATA) and high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIe) and other products. Among them, eMMC has an absolute advantage in the embedded market due to its low price, but the maximum rate of the protocol is HS400, that is, the maximum performance does not exceed 400MB / s, and the actual maximum performance is about 200~300MB / s. On this basis, various eMMC manufacturers adopt various solutions to improve the performance of the product as much as possible, such as increasing cache space, increasing hardware acceleration functions, etc. In the eMMC protocol, the read and write commands sent by the host 100 to the data storage device 200 have various forms. One type of read and write command is a command queue, which can implement multiple commands concurrently. There are also two types of commands that are non-command queues. One type of non-command queue is a pre-defined command. Before sending the pre-defined command, the length of the operation data will be set, that is, the read and write command with a known operation length. The other type of non-command queue is an open command. When the host 100 sends an open command, the length of the command is not set in the open command. Instead, a stop command is sent after the host 100 reads or writes the command, and the open command is completed.
[0039] See also Figure 1As shown, in one embodiment of the present invention, when the command sent by the host 100 is an open command, the data storage device 200 only knows the starting address when operating, but does not know the data length. After the host 100 executes the operation in response to the open command, it sends a stop command to the data storage device 200, so that the data storage device 200 stops operating. After receiving the open command, the data storage device 200 will treat the open command as an infinite read and write command. At this time, the data storage device 200 will generate many preparation operations in the firmware in advance, such as preparing tasks, querying mapping relationships, preparing cache space, etc., and even generate many operations in advance on the flash memory side, such as generating flash memory read and write operations in advance. When the data storage device 200 receives the stop command, for random read and write commands, when the firmware of the data storage device 200 stores data beyond the command range, it is necessary to clear the redundant data in the firmware, which will greatly waste the firmware running time. And for sequential read and write commands, the redundant data that needs to be cleared is less, but it will also affect the performance of sequential read and write.
[0040] In the application, if Figure 1 As shown, when an open command is received, if accurate reading and writing is required, each read and write operation of a data unit (a physical sector) is stopped to detect whether a stop command is received. If a stop command is not received, the next data unit is read and written. However, this operation mode will lead to poor performance. Because relative to the length of data transmitted between the host 100 and the data storage device 200, if the set detection interval is too long and the data in each command is too short, a large amount of redundant data will be generated in the firmware. If the set detection interval is too short and the data in each command is too long, a large number of unnecessary detection times will be generated. For the transformed commands, it is difficult to set a suitable detection interval that meets the transmission of open commands between the host 100 and the data storage device 200 at each stage.
[0041] See also Figure 1 and Figure 2 As shown, the present invention provides a data storage method for a data storage device, which uses the data range of the current command as the detection interval of the next stop command, and then adaptively adjusts the detection interval of the stop command corresponding to each open command, thereby achieving a balance between the detection cycle and redundant data. Specifically, the data storage method for the data storage device includes steps S101 to S107.
[0042] Step S101: When the data storage device receives a command sent by the host, it determines whether the received command is an open command. If the received command is not an open command, step S102 is executed and the process ends. If the received command is an open command, step S103 is executed.
[0043] Step S102: Clear the detection interval.
[0044] Step S103, determine whether there is a detection interval. If there is a detection interval, execute step S105. If there is no detection interval, execute step S104, and then execute step S105.
[0045] Step S104: preset a detection interval.
[0046] Step S105: transmitting data between the host and the data storage device in units of detection intervals.
[0047] Step S106: When the data storage device receives the end command sent by the host, the data storage between the host and the data storage device ends.
[0048] Step S107, obtaining the length of data transmitted between the host and the data storage device, and updating the detection interval according to the data length, and then returning to step S101.
[0049] See also Figure 1 and Figure 2 As shown, in one embodiment of the present invention, in step S101, since the command transmitted by the host 100 to the data storage device 200 may be a command queue, it may also be a predefined command, or it may be an open command. Therefore, when the host 100 receives a command sent by the data storage device 200, it is first necessary to determine whether the received command is an open command. Specifically, it is possible to determine whether the command sent by the host 100 is an open command by querying whether the command received by the data storage device 200 has a data length. If the received command has a data length, the command received by the data storage device 200 is not an open command. If the received command does not have a data length, the command received by the data storage device 200 is an open command.
[0050] See also Figure 1 and Figure 2 As shown, in one embodiment of the present invention, in step S101 to step S102, when it is determined that the command received by the data storage device 200 is not an open command, no matter the command is a command queue or a predefined command, the detection interval is cleared. At this time, since the command sent by the host 100 contains the data length, it is not necessary to detect whether the stop command is received, so there is no need to set the detection interval. If there is a detection interval, the efficiency of data transmission will be affected.
[0051] See also Figure 1 and Figure 2As shown, in one embodiment of the present invention, in steps S101 to S104, when it is determined that the command received by the data storage device 200 is an open command, a detection interval needs to be set. At this time, it is not certain whether there is a detection interval in the firmware. If the command transmitted by the host 100 to the data storage device 200 last time is an open command, the detection interval set last time is saved in the firmware. At this time, the existing detection interval is directly used. If the command transmitted by the host 100 to the data storage device 200 last time is a non-open command or the data processing method described in this application is executed for the first time, the detection interval set last time will not be saved in the firmware. Therefore, step S103 needs to be executed, that is, to determine whether there is a detection interval. If there is no detection interval in the firmware, a detection interval needs to be preset. In this embodiment, in step S104, the preset detection interval is a first preset detection interval. Among them, the first preset detection interval is, for example, 4KB, that is, the capacity of a physical page, and also the length of data read or written at one time during random reading and writing. In other embodiments, the preset detection interval is, for example, 8KB, 16KB or 32KB.
[0052] See also Figure 1 and Figure 2 As shown, in one embodiment of the present invention, in step S105, after setting the detection interval by using an existing detection interval or by a preset detection interval, data is transmitted between the host 100 and the data storage device 200 in units of the detection interval. Specifically, when the host 100 and the data storage device 200 are performing data transmission, at each detection interval, the data storage device 200 will detect whether a stop command is received. When the data storage device 200 receives the stop command, the data transmission between the host 100 and the data storage device 200 will be stopped. When the data storage device 200 does not receive the stop command, the host 100 and the data storage device 200 will continue to perform data transmission, and the detection interval will be calculated from zero until the data storage device 200 detects the stop command, thereby terminating the data transmission between the host 100 and the data storage device 200.
[0053] See also Figure 1 and Figure 2As shown, in one embodiment of the present invention, after the data transmission between the host 100 and the data storage device 200 is completed, the detection interval can be updated according to the data length transmitted between the host 100 and the data storage device 200, and the updated detection interval is used as the detection interval of the next open command. In addition to test scenarios such as software testing, the read and write commands between the host 100 and the data storage device 200 have a certain continuity, such as being in the same read and write state for a long period of time, and the read and write state can be sequential reading, sequential writing, random reading or random writing. For example, when downloading or watching movies, most of them are sequential reading / sequential writing, and random reading and writing commands are rarely involved. For example, the operation of operating application software is mostly random reading / random writing operations, and sequential reading and writing commands are rarely involved. Therefore, over a long period of time, the length of data transmitted between the host 100 and the data storage device 200 is fixed. Therefore, when the detection interval is updated using the data length transmitted between the host 100 and the data storage device 200, the length of data transmitted by the host 100 to the data storage device 200 next time is likely to be equal to the length of data transmitted by the host 100 to the data storage device 200 this time. During data transmission between the host 100 and the data storage device 200, except when the read / write state between the host 100 and the data storage device 200 changes, the detection interval and the length of data transmitted between the host 100 and the data storage device 200 are too large, through the update of the detection interval in the present application, the length of data transmitted between the detection interval and the data storage device 200 is usually in an adapted state.
[0054] Please combine Figure 1 , Figure 2 and Figure 3 As shown, in one embodiment of the present invention, in step S107, the length of data transmitted between the host and the data storage device is obtained, and the detection interval is updated according to the data length, including steps S201 to S206.
[0055] Step S201, determine whether the data length transmitted between the host and the data storage device is less than the detection interval. If the data length transmitted between the host and the data storage device is less than the detection interval, execute step S206. If the data length transmitted between the host and the data storage device is not greater than the detection interval, execute step S202.
[0056] Step S202, determine whether the data length transmitted between the host and the data storage device is equal to the detection interval. If the data length transmitted between the host and the data storage device is equal to the detection interval, execute step S203. If the data length transmitted between the host and the data storage device is not equal to the detection interval, execute step S204.
[0057] Step S203: keep the detection interval unchanged.
[0058] Step S204: Determine whether the detection interval is equal to the first preset detection interval. If the detection interval is equal to the first preset detection interval, execute step S205; if the detection interval is not equal to the first preset detection interval, execute step S206.
[0059] Step S205: Update the detection interval to a second preset detection interval.
[0060] Step S206: Use the length of data transmitted between the host and the data storage device as an updated detection interval.
[0061] Please combine Figure 1 , Figure 2 and Figure 3 As shown, in one embodiment of the present invention, when updating the detection interval based on the data length, it is necessary to first obtain the relationship between the data length transmitted between the current host 100 and the data storage device 200 and the detection interval, and update the detection interval based on the relationship between the data length transmitted between the current host 100 and the data storage device 200 and the detection interval.
[0062] See also Figure 1 and Figure 3 As shown, in one embodiment of the present invention, according to step S201 and step S202, it can be determined whether the length of the data transmitted between the host 100 and the data storage device 200 is greater than, less than or equal to the detection interval. When the length of the data transmitted between the host 100 and the data storage device 200 is less than the detection interval, step S206 is executed, that is, the length of the data transmitted between the host 100 and the data storage device 200 is used as the updated detection interval. When the length of the data transmitted between the host 100 and the data storage device 200 is equal to the detection interval, step S203 is executed, that is, the detection interval is kept unchanged. When the length of the data transmitted between the host 100 and the data storage device 200 is greater than the detection interval, steps S204 to S206 are executed.
[0063] See also Figure 1 and Figure 3As shown, in one embodiment of the present invention, in steps S204 to S206, the first preset detection interval is 4KB, which is also the data length read at one time during random reading and writing. The second preset detection interval is 128KB, which is also the data length read at one time during sequential reading and writing. Therefore, through steps S204 and S205, when executing the data processing method provided by the present application, in the first cycle, the first preset detection interval will be used as the actual detection interval. That is, it is equivalent to verifying whether the data transmission between the host 100 and the data storage device 200 is random reading and writing. In the first cycle, if the length of the data transmitted between the host 100 and the data storage device 200 this time is greater than the first pre-detection interval, that is, the transmission between the host 100 and the data storage device 200 this time is not random reading and writing, then the detection interval is updated to the second preset detection interval. In the second cycle, the second preset detection interval will be used as the actual detection interval. That is, it is equivalent to verifying whether the data transmission between the host 100 and the data storage device 200 is sequential reading and writing. If the length of the data transmitted between the host 100 and the data storage device 200 is greater than the second pre-detection interval, that is, the data transmission between the host 100 and the data storage device 200 is not sequential reading and writing, the length of the data transmitted between the host 100 and the data storage device 200 will be used as the updated detection interval.
[0064] See also Figure 1 and Figure 3 As shown, in one embodiment of the present invention, using the data processing method provided by the present application, when data is transmitted between the host 100 and the data storage device 200, the common data length read once during random reading and writing, and the data length read once during sequential reading and writing are first used as the preset detection interval. The data length transmitted between the current host 100 and the data storage device 200 can be obtained with the maximum probability. When the transmission mode between the host 100 and the data storage device 200 changes, the detection interval of this time can be updated according to the data length transmitted between the host 100 and the data storage device 200 last time, so that the detection interval can be quickly updated according to the data transmission mode between the host 100 and the data storage device 200. Then, in the subsequent detection interval, a stop command can be received, thereby reducing the redundant operations generated and reducing the number of detections at the same time.
[0065] See also Figure 4 As shown, an embodiment of the present application provides a data storage device, which also includes a memory 302, a processor 301 and a program stored in the memory and executable on the processor, and the processor executes to implement the above data processing method.
[0066] See also Figure 4As shown, the memory 302 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory can be an internal storage unit of a data storage device, such as a mobile hard disk of the data storage device. In other embodiments, the memory can also be an external storage device of the data storage device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the data storage device. Further, the memory can also include both an internal storage unit of the data storage device and an external storage device. The memory can be used not only to store application software and various types of data installed in the data storage device, but also to temporarily store data that has been output or is to be output.
[0067] See also Figure 4 As shown, the processor 301 in some embodiments may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor is the control core (ControlUnit) of the vehicle-mounted device, and uses various interfaces and lines to connect various components of the entire vehicle-mounted device, and executes various functions of the vehicle-mounted device and processes data by running or executing programs or modules stored in the memory, and calling data stored in the memory.
[0068] The processor executes the operating system of the vehicle-mounted device and various installed application programs. The processor executes the application programs to implement the steps in the above method embodiment.
[0069] Exemplarily, the program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of program command segments capable of completing specific functions, which are used to describe the execution process of the program in the vehicle-mounted device.
[0070] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of commands for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the lithium battery cold solder joint detection method of each embodiment of the present invention.
[0071] In summary, the present invention provides a data processing method and a data storage device, which includes determining whether a command received by the data storage device is an open command, and clearing the detection interval when the command received by the data storage device is a non-open command. When the data storage device receives an open command sent by the host, the existing detection interval or the preset detection interval is maintained. Data is transmitted between the host and the data storage device in units of the detection interval. When the data storage device receives an end command sent by the host, the data transmission between the host and the data storage device is terminated. The length of the data transmitted between the host and the data storage device is obtained, and the detection interval is updated according to the data length. Through the data processing method and data storage device provided by the present application, the requirements for the redundant operations generated and the number of detections can be balanced, thereby improving the data transmission performance.
[0072] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A data processing method, characterized in that: At least the following steps are included: When the data storage device receives an open command sent by the host, a detection interval is set, and the detection interval is an interval of the data length; transmitting data between the host and the data storage device in units of the detection interval; When the data storage device receives the end command sent by the host, the data transmission between the host and the data storage device ends; as well as The length of data transmitted between the host and the data storage device is obtained, and the detection interval is updated according to the length of data transmitted between the host and the data storage device.
2. A data processing method according to claim 1, characterized in that: The data processing method further comprises the following steps: It is determined whether the command received by the data storage device is an open command, and if the command received by the data storage device is not an open command, the detection interval is cleared.
3. A data processing method according to claim 1, characterized in that: Setting the detection interval involves the following steps: Determining whether the detection interval exists, and if the detection interval does not exist, presetting the detection interval; and If the detection interval exists, the existing detection interval is used.
4. A data processing method according to claim 3, characterized in that: The preset detection interval is a first preset detection interval, and the first preset detection interval is the length of data read or written at one time during random reading and writing.
5. A data processing method according to claim 1, characterized in that: Updating the detection interval according to the data length comprises the following steps: Obtaining the relationship between the length of data transmitted between the host and the data storage device and the detection interval; and The detection interval is updated according to the relationship between the length of data transmitted between the host and the data storage device this time and the detection interval.
6. A data processing method according to claim 1, characterized in that: When the length of data transmitted between the host and the data storage device this time is less than the detection interval, the length of data transmitted between the host and the data storage device this time is used as the updated detection interval.
7. A data processing method according to claim 1, characterized in that: When the length of data transmitted between the host and the data storage device this time is equal to the detection interval, the detection interval is kept unchanged.
8. A data processing method according to claim 1, characterized in that: When the length of data transmitted between the host and the data storage device is greater than the detection interval, and the detection interval is equal to the first preset detection interval, the detection interval is updated to the second preset detection interval, wherein the first preset detection interval is the length of data read or written at one time during random reading and writing, and the second preset detection interval is the length of data read or written at one time during sequential reading and writing.
9. A data processing method according to claim 1, characterized in that: When the length of data transmitted between the host and the data storage device is greater than the detection interval, and the detection interval is not equal to the first preset detection interval, the length of data transmitted between the host and the data storage device is used as the updated detection interval, wherein the first preset detection interval is the length of data read or written at one time during random reading and writing.
10. A data storage device, characterized in that: The data storage device comprises: a memory storing program commands; and A processor runs the program command to implement the data processing method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Data processing method and device, electronic equipment, storage medium and program product
CN112882661A
Memory, memory control method and memory system
CN114641762A