Data processing method, device and system, storage equipment, upper computer and medium
By obtaining and optimizing the target load mode sent by the host computer, generating optimization strategies, and preloading L2P mapping table entries, the problem of low read and write efficiency caused by insufficient memory capacity of the storage device is solved, and data processing efficiency is improved.
Patent Information
- Application Number
- CN202411346521.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-07
AI Technical Summary
Due to the configuration of DRAM with small capacity, existing storage devices lack memory capacity and cannot store a complete L2P mapping table, resulting in frequent exchange of L2P mapping table entries when responding to read and write commands, which significantly reduces data processing efficiency.
By obtaining the target load mode sent by the host computer, judging and generating target optimization strategies, optimizing the storage method of L2P mapping table entries in memory, preloading and cacheing necessary L2P mapping table entries, reducing real-time query and swapping and out needs.
It significantly reduces the duration of responding to read and write commands, improves data processing efficiency, and optimizes the storage method of L2P mapping table entries through intelligent preloading and cache, reducing the need for memory queries and swaps in and out.
Smart Images

Figure CN119271578A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, apparatus, system, storage device, host computer and medium. Background Art
[0002] In order to reduce the size of storage devices and reduce costs, some storage devices are equipped with very small DRAM (Dynamic Random Access Memory) or no DRAM. This results in a very small memory capacity of the storage device, and it is impossible to store a complete L2P (Logical address To Physical address) mapping table in the memory. Only some L2P mapping table entries can be randomly selected from the complete L2P mapping table and stored in the memory.
[0003] When the storage device responds to a read or write command, if the L2P mapping table entries used in the response to the read or write command are not pre-stored in the memory, the storage device needs to clear the L2P mapping table entries stored in the memory in real time to free up memory space, and then query the L2P mapping table entries used in the response to the read or write command in real time and store them in the memory. This operation of swapping in and out the L2P mapping table entries in the memory will significantly increase the time to respond to the read or write command, greatly reducing the efficiency of data processing. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a data processing method, apparatus, system, storage device, host computer and medium to improve the efficiency of data processing. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a storage device, and the method includes:
[0006] Acquire a target load mode sent by the host computer, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command of the host computer;
[0007] Determining whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access order between each target storage unit, the target storage unit is a storage unit that the storage device needs to access when executing the data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit;
[0008] If it has been created, determining the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and storing the target L2P mapping table entry in the memory;
[0009] If not created, the target optimization strategy is generated according to the target load mode, and the target L2P mapping table entry is determined from the L2P mapping table according to the target optimization strategy, and the target L2P mapping table entry is stored in the memory.
[0010] Optionally, the target optimization strategy is generated by:
[0011] Determine the target storage units that need to be accessed to execute the data read and write instructions, and the access order between the target storage units;
[0012] Determine a target L2P mapping table entry recording the physical address of the target storage unit, and determine an access order between each target L2P mapping table entry according to an access order between each target storage unit;
[0013] Determining the access heat of each target L2P mapping table entry according to the access order between each target L2P mapping table entry;
[0014] Determine the access priority of each target L2P mapping table entry according to the access popularity of each target L2P mapping table entry;
[0015] A first storage method is determined as a target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table entry into the memory in a descending order of access priority.
[0016] Optionally, before determining the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry, the method further includes:
[0017] Determining whether a target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read / write instruction operating on the target storage unit is a write instruction;
[0018] The step of determining the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry includes:
[0019] The access priority of each target L2P mapping table entry is determined according to the access popularity of each target L2P mapping table entry and whether it needs to be modified.
[0020] Optionally, the target optimization strategy further includes: setting a storage mode of the target data in the memory according to the target storage unit and the access sequence between each target storage unit, wherein the target data is the data stored in the target storage unit;
[0021] After determining whether the target optimization strategy corresponding to the target load mode has been created, the method further includes:
[0022] If it has been created, according to the target optimization strategy, read the target data from the target storage unit and store the target data in the memory;
[0023] If not created, the target optimization strategy is generated according to the target load mode, and according to the target optimization strategy, the target data is read from the target storage unit and the target data is stored in the memory.
[0024] Optionally, the target optimization strategy is generated by:
[0025] Determine the target storage units that need to be accessed to execute the data read and write instructions, and the access order between the target storage units;
[0026] Determine the access heat of each target storage unit according to the access sequence between each target storage unit;
[0027] Determine the access priority of each target storage unit according to the access popularity of each target storage unit;
[0028] The second storage method is determined as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in the order of access priority from high to low.
[0029] Optionally, after storing the target L2P mapping table entry in the memory, the method further includes:
[0030] Obtaining the target data read and write command sent by the host computer;
[0031] The target data read / write command is responded to according to the target L2P mapping table entry stored in the memory.
[0032] Optionally, the target optimization strategy further includes: clearing L2P mapping table entries from the memory in order of access priorities of the L2P mapping table entries from low to high, and responding to the target data read and write command according to the target L2P mapping table entry stored in the memory, including:
[0033] When responding to a subcommand in the target data read / write command, if a first L2P mapping table entry is stored in the memory, responding to the subcommand according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry recording a physical address of a first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand;
[0034] or,
[0035] When responding to a subcommand in the target data read / write command, if the first L2P mapping table entry is not stored in the memory, some L2P mapping table entries are cleared from the memory in order of access priority from low to high, and the first L2P mapping table entry is stored in the memory, and the subcommand is responded to according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry that records the physical address of a first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand.
[0036] Optionally, the target optimization strategy further includes: clearing data stored in the storage unit from the memory in order of the access priority of the storage unit from low to high; and responding to the target data read and write command includes:
[0037] When responding to a subcommand in the target data read / write command, if first data is stored in the memory, responding to the subcommand according to the data stored in the memory, wherein the first data is data stored in a storage unit that needs to be accessed to execute the subcommand;
[0038] or,
[0039] When responding to the sub-command in the target data read and write command, if the first data is not stored in the memory, the data stored in some storage units are cleared from the memory in order of access priority from low to high, and the first data are stored in the memory, and the sub-command is responded to based on the data stored in the memory, wherein the first data is the data stored in the storage unit that needs to be accessed to execute the sub-command.
[0040] Optionally, the storage device includes a plurality of storage grains, each storage grain includes a plurality of storage units; the target optimization strategy further includes: aggregating sub-commands for the same storage grain in the data read and write commands; and responding to the target data read and write commands includes:
[0041] Before responding to the current subcommand in the target data read / write command, determining the target storage grain to which the storage unit to be accessed in response to the current subcommand belongs;
[0042] According to the data read / write instruction, determining whether there is a target subcommand in the subsequent subcommands in the target data read / write command, wherein the storage grain to which the storage unit to be accessed in response to the target subcommand belongs is the target storage grain;
[0043] If it exists, do not respond to the current subcommand. After receiving the target subcommand, aggregate the current subcommand with the target subcommand to obtain an aggregated subcommand and respond to the aggregated subcommand.
[0044] In a second aspect, an embodiment of the present application provides a data processing method, which is applied to a host computer, and the method includes:
[0045] In response to the object startup requesting data read and write, determining whether a target load mode corresponding to the object has been created, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command of the host computer, and the target data read and write command is a data read and write command generated by the host computer for the object;
[0046] If it has been created, the target load mode is sent to the storage device so that the storage device determines the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy corresponding to the target load mode, and stores the target L2P mapping table entry in the memory, wherein the target optimization strategy includes: a storage method of the target L2P mapping table entry in the memory is set according to the target storage unit and the access order between each target storage unit, the target storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table entry is an L2P mapping table entry that records the physical address of the target storage unit.
[0047] Optionally, after determining whether the target load mode corresponding to the object has been created, the method further includes:
[0048] If not created, in response to sending a target data read / write command to a storage device, obtaining a data read / write instruction executed by the storage device in response to the target data read / write command;
[0049] The target load pattern is generated based on the data read and write instructions.
[0050] Optionally, after sending the target load mode to the storage device, the method further includes:
[0051] In response to sending a target data read / write command to a storage device, obtaining a data read / write instruction actually executed by the storage device in a process of responding to the target data read / write command;
[0052] When the data read / write instruction is inconsistent with the actually executed data read / write instruction, the target load mode is updated to the actually executed data read / write instruction.
[0053] In a third aspect, an embodiment of the present application provides a data processing apparatus, applied to a storage device, the apparatus comprising:
[0054] A load mode acquisition module, used to acquire a target load mode sent by a host computer, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command of the host computer;
[0055] A first judgment module is used to judge whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access sequence between each target storage unit, the target storage unit is a storage unit that the storage device needs to access when executing the data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit;
[0056] a first mapping table entry storage module, configured to determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy when the judgment result of the first judgment module is yes, and store the target L2P mapping table entry in the memory;
[0057] The second mapping table entry storage module is used to generate the target optimization strategy according to the target load mode when the judgment result of the first judgment module is no, and determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and store the target L2P mapping table entry in the memory.
[0058] Optionally, the second mapping table entry storage module includes: a first storage unit determination unit, used to determine the target storage unit that needs to be accessed to execute the data read and write instructions, and the access order between each target storage unit; a mapping table entry determination unit, used to determine the target L2P mapping table entry that records the physical address of the target storage unit, and determine the access order between each target L2P mapping table entry according to the access order between each target storage unit; a first access heat determination unit, used to determine the access heat of each target L2P mapping table entry according to the access order between each target L2P mapping table entry; a first access priority determination unit, used to determine the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry; a first target optimization strategy determination unit, used to determine the first storage method as the target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table entry in the memory in order from high to low access priority.
[0059] Optionally, the second mapping table entry storage module also includes: a modification determination unit, used to determine whether the target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read and write instructions operating on the target storage unit are write instructions; the access priority determination unit, specifically used to determine the access priority of each target L2P mapping table entry according to the access popularity of each target L2P mapping table entry and whether it needs to be modified.
[0060] Optionally, the target optimization strategy also includes: a storage method of the target data in the memory is set according to the target storage unit and the access order between each target storage unit, wherein the target data is the data stored in the target storage unit; the device also includes: a first data storage module, used to read the target data from the target storage unit according to the target optimization strategy, and store the target data in the memory; a second data storage module, used to generate the target optimization strategy according to the target load pattern, and read the target data from the target storage unit according to the target optimization strategy, and store the target data in the memory.
[0061] Optionally, the second data storage module includes: a second storage unit determination unit, used to determine the target storage unit that needs to be accessed to execute the data read and write instructions, and the access order between the target storage units; a second access heat determination unit, used to determine the access heat of each target storage unit according to the access order between the target storage units; a second access priority determination unit, used to determine the access priority of each target storage unit according to the access heat of each target storage unit; a second target optimization strategy determination unit, used to determine the second storage method as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in order of access priority from high to low.
[0062] Optionally, the device further includes: a read / write command acquisition module, used to acquire the target data read / write command sent by the host computer; and a read / write command response module, used to respond to the target data read / write command according to the target L2P mapping table entry stored in the memory.
[0063] Optionally, the target optimization strategy also includes: clearing L2P mapping table items from the memory in order of access priority of the L2P mapping table items from low to high, and the read / write command response module is specifically used to: when responding to a subcommand in the target data read / write command, if a first L2P mapping table item is stored in the memory, respond to the subcommand according to the L2P mapping table item stored in the memory, wherein the first L2P mapping table item is an L2P mapping table item that records the physical address of the first storage unit, and the first storage unit is the access required to execute the subcommand. the storage unit to be asked; when responding to the sub-command in the target data read / write command, if the first L2P mapping table entry is not stored in the memory, clear some L2P mapping table entries from the memory in order of access priority from low to high, and store the first L2P mapping table entry in the memory, and respond to the sub-command according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry that records the physical address of the first storage unit, and the first storage unit is the storage unit that needs to be accessed to execute the sub-command.
[0064] Optionally, the target optimization strategy also includes: clearing data stored in the storage unit from the memory in order of access priority from low to high; the read / write command response module is specifically used to: when responding to a sub-command in the target data read / write command, if first data is stored in the memory, respond to the sub-command according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the sub-command; when responding to a sub-command in the target data read / write command, if the first data is not stored in the memory, clearing data stored in some storage units from the memory in order of access priority from low to high, and storing the first data in the memory, and responding to the sub-command according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the sub-command.
[0065] Optionally, the storage device includes multiple storage grains, each storage grain includes multiple storage units; the target optimization strategy also includes: aggregating sub-commands in the data read and write commands for the same storage grain; the read and write command response module is specifically used to: before responding to the current sub-command in the target data read and write command, determine the target storage grain to which the storage unit required to be accessed in response to the current sub-command belongs; based on the data read and write instructions, determine whether there is a target sub-command in subsequent sub-commands in the target data read and write command, wherein the storage grain to which the storage unit required to be accessed in response to the target sub-command belongs is the target storage grain; if so, do not respond to the current sub-command, and after receiving the target sub-command, aggregate the current sub-command with the target sub-command to obtain an aggregated sub-command and respond to the aggregated sub-command.
[0066] In a fourth aspect, an embodiment of the present application provides a data processing device, applied to a host computer, the device comprising:
[0067] A second judgment module is configured to judge whether a target load mode corresponding to the object has been created in response to the object startup requesting data reading and writing, wherein the target load mode includes: data reading and writing instructions that the storage device needs to execute when responding to the target data reading and writing command of the host computer, and the target data reading and writing command is a data reading and writing command generated by the host computer for the object;
[0068] A load mode sending module is used to send the target load mode to the storage device when the judgment result of the second judgment module is yes, so that the storage device determines the target L2P mapping table item from the L2P mapping table according to the target optimization strategy corresponding to the target load mode, and stores the target L2P mapping table item in the memory, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table item is an L2P mapping table item that records the physical address of the target storage unit.
[0069] Optionally, the device further comprises:
[0070] A load pattern generation module is used to obtain the data read and write instructions executed by the storage device in response to sending a target data read and write command to the storage device when the judgment result of the second judgment module is no; and generate the target load pattern based on the data read and write instructions.
[0071] Optionally, the device also includes: a load mode update module, which is used to respond to sending a target data read and write command to the storage device, obtain the data read and write instructions actually executed by the storage device in response to the target data read and write command; when the data read and write instructions are inconsistent with the actually executed data read and write instructions, update the target load mode to the actually executed data read and write instructions.
[0072] In a fifth aspect, an embodiment of the present application provides a data processing system, the data processing system comprising a storage device and a host computer;
[0073] The host computer is used to send a target load mode to the storage device, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command from the host computer;
[0074] The storage device is used to determine whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access sequence between each target storage unit, the target storage unit is a storage unit that the storage device needs to access when executing the data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit;
[0075] The storage device is further configured to determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy when the target optimization strategy corresponding to the target load mode has been created, and store the target L2P mapping table entry in the memory;
[0076] The storage device is also used to generate the target optimization strategy according to the target load mode when the target optimization strategy corresponding to the target load mode is not created, and determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and store the target L2P mapping table entry in the memory.
[0077] Optionally, the storage device is specifically used to determine the target storage unit that needs to be accessed to execute the data read and write instructions, and the access order between each target storage unit; determine the target L2P mapping table entry that records the physical address of the target storage unit, and determine the access order between each target L2P mapping table entry based on the access order between each target storage unit; determine the access heat of each target L2P mapping table entry based on the access order between each target L2P mapping table entry; determine the access priority of each target L2P mapping table entry based on the access heat of each target L2P mapping table entry; determine the first storage method as the target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table entry in the memory in order of access priority from high to low.
[0078] Optionally, the storage device is also used to determine whether the target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read and write instructions operating on the target storage unit are write instructions before determining the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry; the storage device is specifically used to determine the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry and whether it needs to be modified.
[0079] Optionally, the target optimization strategy also includes: a storage method of the target data in the memory is set according to the target storage unit and the access order between each target storage unit, wherein the target data is the data stored in the target storage unit; the storage device is also used to read the target data from the target storage unit and store the target data in the memory in accordance with the target optimization strategy when the target optimization strategy corresponding to the target load pattern has been created; and generate the target optimization strategy according to the target load pattern when the target optimization strategy corresponding to the target load pattern has not been created, and read the target data from the target storage unit and store the target data in the memory in accordance with the target optimization strategy.
[0080] Optionally, the storage device is specifically used to determine the target storage unit that needs to be accessed to execute the data read and write instructions, and the access order between the target storage units; determine the access popularity of each target storage unit according to the access order between the target storage units; determine the access priority of each target storage unit according to the access popularity of each target storage unit; determine the second storage method as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in order of access priority from high to low.
[0081] Optionally, the host computer is further used to send the target data read and write command to the storage device; the storage device is further used to respond to the target data read and write command according to the target L2P mapping table entry stored in the memory.
[0082] Optionally, the target optimization strategy also includes: clearing L2P mapping table items from the memory in order of access priority of the L2P mapping table items from low to high, the storage device is specifically used to, when responding to a subcommand in the target data read / write command, if a first L2P mapping table item is stored in the memory, respond to the subcommand according to the L2P mapping table item stored in the memory, wherein the first L2P mapping table item is an L2P mapping table item that records the physical address of a first storage unit, and the first storage unit is a physical address that needs to be accessed to execute the subcommand. A storage unit; when responding to a subcommand in the target data read / write command, if the first L2P mapping table entry is not stored in the memory, clear some L2P mapping table entries from the memory in order of access priority from low to high, and store the first L2P mapping table entry in the memory, and respond to the subcommand according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry that records the physical address of the first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand.
[0083] Optionally, the target optimization strategy also includes: clearing data stored in the storage unit from the memory in order of access priority from low to high; the storage device is specifically used to, when responding to a sub-command in the target data read and write command, if first data is stored in the memory, respond to the sub-command according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the sub-command; when responding to the sub-command in the target data read and write command, if the first data is not stored in the memory, clearing data stored in part of the storage unit from the memory in order of access priority from low to high, and storing the first data in the memory, and responding to the sub-command according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the sub-command.
[0084] Optionally, the storage device includes multiple storage grains, each storage grain includes multiple storage units; the target optimization strategy also includes: aggregating sub-commands in the data read and write commands for the same storage grain; the storage device is specifically used to determine, before responding to the current sub-command in the target data read and write command, the target storage grain to which the storage unit required to be accessed in response to the current sub-command belongs; based on the data read and write instructions, determine whether there is a target sub-command in subsequent sub-commands in the target data read and write command, wherein the storage grain to which the storage unit required to be accessed in response to the target sub-command belongs is the target storage grain; if so, do not respond to the current sub-command, and after receiving the target sub-command, aggregate the current sub-command with the target sub-command to obtain an aggregated sub-command and respond to the aggregated sub-command.
[0085] Optionally, the host computer is also used to respond to the start of an object requesting data reading and writing and determine whether a target load mode corresponding to the object has been created; the host computer is specifically used to send the target load mode to the storage device when the target load mode corresponding to the object has been created.
[0086] Optionally, the host computer is also used to, in response to sending a target data read and write command to the storage device, obtain data read and write instructions executed by the storage device in response to the target data read and write command when the target load pattern corresponding to the object is not created; and generate the target load pattern based on the data read and write instructions.
[0087] Optionally, the host computer is also used to, in response to sending a target data read / write command to the storage device, obtain the data read / write instructions actually executed by the storage device in responding to the target data read / write command; when the data read / write instructions are inconsistent with the actually executed data read / write instructions, update the target load mode to the actually executed data read / write instructions.
[0088] In a sixth aspect, an embodiment of the present application provides a storage device, including:
[0089] Memory, used to store computer programs;
[0090] The processor is used to implement the method described in the first aspect when executing the program stored in the memory.
[0091] In a seventh aspect, an embodiment of the present application provides a host computer, including:
[0092] Memory, used to store computer programs;
[0093] The processor is used to implement the method described in the second aspect when executing the program stored in the memory.
[0094] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect or the method described in the second aspect is implemented.
[0095] Beneficial effects of the embodiments of the present application:
[0096] In the solution provided by the embodiment of the present application, the storage device can obtain the target load mode sent by the host computer, wherein the target load mode includes: the data read and write instructions that the storage device needs to execute when responding to the target data read and write commands of the host computer; determine whether the target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage method of the target L2P mapping table item in the memory is set, the target storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table item is the L2P mapping table item that records the physical address of the target storage unit; if it has been created, according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory; if it has not been created, generate the target optimization strategy according to the target load mode, and according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory. Since the solution provided by the embodiment of the present application obtains and analyzes the target load pattern sent by the host computer in advance, and generates or applies the existing target optimization strategies in a targeted manner, these target optimization strategies can optimize the storage method of L2P mapping table items in the memory according to the target storage unit and the access order of the target storage unit. By intelligently preloading and caching the necessary L2P mapping table items, the need for real-time query and swapping in and out of L2P mapping table items is reduced, thereby significantly reducing the time to respond to read and write commands and improving the efficiency of data processing.
[0097] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0099] Figure 1 A schematic diagram of a data processing method applied to a storage device provided in an embodiment of the present application;
[0100] Figure 2 Based on Figure 1 A schematic diagram of a process flow of a target optimization strategy generation method in the illustrated embodiment;
[0101] Figure 3 Based on Figure 1 A specific flow chart of the data processing method of the illustrated embodiment;
[0102] Figure 4 Based on Figure 3 A schematic flow chart of another target optimization strategy generation method of the illustrated embodiment;
[0103] Figure 5 Based on Figure 1 A schematic diagram of a flow chart of a command response method of the illustrated embodiment;
[0104] Figure 6 Based on Figure 5 A schematic diagram of a specific flow chart of a command response method of the illustrated embodiment;
[0105] Figure 7 Based on Figure 5 Another specific flow chart of the command response method of the illustrated embodiment;
[0106] Figure 8 Based on Figure 5 A schematic diagram of another specific flow chart of the command response method of the illustrated embodiment;
[0107] Fig. 9 A schematic diagram of a data processing method applied to a host computer provided in an embodiment of the present application;
[0108] Fig.10 Based on Fig. 9 A schematic diagram of a process flow of a target load pattern generation method in the illustrated embodiment;
[0109] Fig.11 Based on Fig. 9 A schematic diagram of a process flow of a target load mode updating method of the illustrated embodiment;
[0110] Fig.12 A schematic diagram of the structure of a data processing device applied to a storage device provided in an embodiment of the present application;
[0111] Fig.13 A schematic diagram of the structure of a data processing device applied to a host computer provided in an embodiment of the present application;
[0112] Fig.14 A schematic diagram of the structure of a data processing system provided in an embodiment of the present application;
[0113] Fig.15 A schematic diagram of the structure of a storage device provided in an embodiment of the present application;
[0114] Fig.16 A schematic diagram of the structure of a host computer provided in an embodiment of the present application. DETAILED DESCRIPTION
[0115] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0116] In order to improve the efficiency of data processing, the embodiments of the present application provide a data processing method, a data processing apparatus, a data processing system, a storage device, a host computer, a computer-readable storage medium and a computer program product. The following first introduces the data processing method applied to the storage device provided in the embodiments of the present application.
[0117] The data processing method applied to a storage device provided in the embodiment of the present application can be applied to any storage device with data capabilities, for example, an SSD (Solid State Drive) or an embedded storage device of a mobile device, etc., without specific limitation here. For the sake of clear description, it is referred to as a storage device below.
[0118] like Figure 1 As shown, a data processing method is applied to a storage device, comprising:
[0119] S101, obtaining a target load mode sent by a host computer.
[0120] The target load mode includes: data read and write instructions that the storage device needs to execute when responding to the target data read and write commands of the host computer.
[0121] S102, determining whether a target optimization strategy corresponding to the target load mode has been created. If yes, executing step S103, if not, executing step S104.
[0122] Among them, the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage method of the target L2P mapping table entry in the memory is set, the target storage unit is the storage unit that the storage device needs to access when executing data read and write instructions, and the target L2P mapping table entry is the L2P mapping table entry that records the physical address of the target storage unit.
[0123] S103: Determine a target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and store the target L2P mapping table entry in a memory.
[0124] S104, generating a target optimization strategy according to the target load mode, and determining a target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and storing the target L2P mapping table entry in the memory.
[0125] In the solution provided by the embodiment of the present application, the storage device can obtain the target load mode sent by the host computer, wherein the target load mode includes: the data read and write instructions that the storage device needs to execute when responding to the target data read and write commands of the host computer; determine whether the target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage method of the target L2P mapping table item in the memory is set, the target storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table item is the L2P mapping table item that records the physical address of the target storage unit; if it has been created, according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory; if it has not been created, generate the target optimization strategy according to the target load mode, and according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory. Since the solution provided by the embodiment of the present application obtains and analyzes the target load pattern sent by the host computer in advance, and generates or applies the existing target optimization strategies in a targeted manner, these target optimization strategies can optimize the storage method of L2P mapping table items in the memory according to the target storage unit and the access order of the target storage unit. By intelligently preloading and caching the necessary L2P mapping table items, the need for real-time query and swapping in and out of L2P mapping table items is reduced, thereby significantly reducing the time to respond to read and write commands and improving the efficiency of data processing.
[0126] When the host computer meets the preset conditions, it can be determined that a target data read and write command is about to be sent to the storage device. At this time, the host computer can first send a target load mode to the storage device to instruct the storage device to pre-store the L2P mapping table items. Among them, the target load mode may include: data read and write instructions that the storage device needs to execute when responding to the target data read and write command of the host computer. In this way, the storage device can execute the above step S101, that is, obtain the target load mode sent by the host computer.
[0127] For example, the preset condition may be "starting game A". When the host computer detects that game A is started, it may determine that it is about to send a target data read and write command of "reading the game map data of game A and writing login information" to the storage device. At this time, the host computer may first send a target load mode of "writing data to storage unit 1, reading data from storage unit 2, and reading data from storage unit 3" to the storage device. The target load mode records the data read and write instructions that the storage device needs to execute when responding to the target data read and write command of "reading the game map data of game A and writing login information".
[0128] The method for generating the above target load pattern and the specific method for the host computer to send the target load pattern to the storage device will be described in detail in the subsequent data processing method applied to the host computer, and will not be repeated here.
[0129] For each load mode, when the storage device first obtains the load mode sent by the host computer, it can determine the storage unit that the storage device needs to access when executing the data read and write instructions based on the data read and write instructions included in the load mode, and determine the access order between the storage units that need to be accessed based on the order between the data read and write instructions.
[0130] Furthermore, the storage device may determine, for the storage units that need to be accessed, L2P mapping table entries recording the physical addresses of these storage units from the L2P mapping table, and determine the access order between the L2P mapping table entries according to the access order between these storage units.
[0131] Finally, the storage device can determine the storage method of these L2P mapping table entries in the memory according to the access order between the L2P mapping table entries, and use it as the optimization strategy corresponding to the load mode. In addition, the storage device can also establish a corresponding relationship between the load mode and the optimization strategy, so that when the load mode is received again in the future, it does not need to generate the optimization strategy again, and can directly obtain the optimization strategy according to the corresponding relationship and store the L2P mapping table entries.
[0132] Therefore, after the storage device executes the above step S101 and obtains the target load pattern sent by the host computer, it can determine whether it has created a target optimization strategy corresponding to the target load pattern by determining whether the correspondence between the load pattern stored in itself and the optimization strategy includes the target load pattern.
[0133] For example, the storage device can use the key-value data format to store various load modes and the optimization strategies corresponding to each load mode. After obtaining the target load mode sent by the host computer, the storage device can determine whether the key value corresponding to the target load mode exists in the key-value data stored by itself. If so, it is determined that the target optimization strategy corresponding to the target load mode has been created. If not, it is determined that the target optimization strategy corresponding to the target load mode has not been created.
[0134] If the target optimization strategy corresponding to the target load mode has been created, the storage device can execute step S103 to directly obtain the target optimization strategy from the optimization strategy created by itself. Because the storage method of the target L2P mapping table items included in the target optimization strategy in the memory actually records which L2P mapping table items are to be stored and how these L2P mapping table items should be stored in the memory. Therefore, the storage device first determines the target L2P mapping table items from the L2P mapping table according to the target optimization strategy, and then stores the target L2P mapping table items in the memory according to the storage method in the target optimization strategy, thereby completing the pre-storage of the L2P mapping table items.
[0135] In one implementation, the memory may include SRAM (Static Random Access Memory), DRAM and HMB (Host Memory Buffer), and when the storage device stores each target L2P mapping table item in the memory, it may store each target L2P mapping table item in SRAM, DRAM and HMB in sequence. That is, the storage device may first store the target L2P mapping table item in SRAM, and when the space reserved in SRAM for storing L2P mapping table items is full, the remaining target L2P mapping table items are further stored in DRAM, and when the space reserved in DRAM for storing L2P mapping table items is full, the remaining target L2P mapping table items are further stored in HMB, until the space reserved in HMB for storing L2P mapping table items is also full.
[0136] Of course, if the memory includes at least one of SRAM, DRAM and HMB, for example, only SRAM and DRAM, or only SRAM and HMB, the storage device can still store the target L2P mapping table entries in each type of memory in the above order, and only needs to skip the non-existent memory type, which will not be repeated here.
[0137] If the target optimization policy corresponding to the target load mode is not created, the storage device may execute step S104, generate the target optimization policy in real time according to the target load mode, and then determine the target L2P mapping table item from the L2P mapping table according to the target optimization policy, and store the target L2P mapping table item in the memory. The target optimization policy may be to store each target L2P mapping table item in the memory in descending order of access priority.
[0138] Regarding the access priority of the target L2P mapping table entry, in one implementation, the storage device may determine the access priority of the target L2P mapping table entry through the following steps:
[0139] First, the storage device can determine the target storage unit that the storage device needs to access when executing the data read and write instructions according to the data read and write instructions included in the target load mode, and determine the access order between the target storage units according to the order between the data read and write instructions.
[0140] Then, the storage device may determine the target L2P mapping table entry recording the physical address of the target storage unit from the L2P mapping table for the target storage unit, and determine the access order between the target L2P mapping table entries according to the access order between the target storage units.
[0141] Finally, the storage device can determine the access frequency of each target L2P mapping table entry according to the access order between each target L2P mapping table entry, and then determine the access priority of each target L2P mapping table entry according to the access frequency of each target L2P mapping table entry according to the principle that the higher the access frequency, the higher the access priority.
[0142] For example, the data read and write instructions included in the target load mode are: "write data to storage unit 1", "read data from storage unit 2", "read data from storage unit 3", and "read data from storage unit 1". Then the storage device can determine that the target storage units are: storage unit 1, storage unit 2, and storage unit 3 according to the above data read and write instructions, and the access order between the target storage units is: storage unit 1→storage unit 2→storage unit 3→storage unit 1.
[0143] On this basis, assuming that the first L2P mapping table entry records the physical address of storage unit 2, and the second L2P mapping table entry records the physical addresses of storage unit 1 and storage unit 3. Then it can be determined that the target L2P mapping table entry is the first L2P mapping table entry and the second L2P mapping table entry, and according to the access order between the target storage units, it can be determined that the access order between the target L2P mapping table entries is: second L2P mapping table entry→first L2P mapping table entry→second L2P mapping table entry→second L2P mapping table entry.
[0144] The storage device can determine the access frequency of the first L2P mapping table item as 1 and the access frequency of the second L2P mapping table item as 3 according to the access order between the target L2P mapping table items. According to the principle that the higher the access frequency, the higher the access priority, the storage device can determine the access priority of the second L2P mapping table item, which is assumed to be 3, and the access priority of the first L2P mapping table item, which is assumed to be 1, according to the access frequency of each target L2P mapping table item.
[0145] In another implementation manner, after obtaining the access order between the target L2P mapping table entries in the above manner, the storage device may also determine the access priority of each target L2P mapping table entry through the following steps:
[0146] According to the access order, the access position of each target L2P mapping table entry when it is accessed for the first time is determined, and then the access priority of each target L2P mapping table entry is determined according to the access position of each target L2P mapping table entry according to the principle that the earlier the access position, the higher the access priority.
[0147] For example, the determined access order between each target L2P mapping table item is: second L2P mapping table item → first L2P mapping table item → second L2P mapping table item → second L2P mapping table item. According to the access order, it can be determined that the access order of the second L2P mapping table item is the first, and the access order of the first L2P mapping table item is the second. According to the principle that the higher the access order, the higher the access priority, according to the access order of each target L2P mapping table item, the storage device can determine the access priority of the second L2P mapping table item, which is assumed to be 1, and the access priority of the first L2P mapping table item, which is assumed to be 0.5.
[0148] In yet another implementation manner, after obtaining the access order between the target L2P mapping table entries in the above manner, the storage device may also determine the access priority of the target L2P mapping table entries through the following steps:
[0149] According to the access order, the access frequency and the first access rank of each target L2P mapping table entry are determined, and then for each target L2P mapping table entry, the access frequency and access rank of the target L2P mapping table entry are weighted to obtain the access priority corresponding to the target L2P mapping table entry.
[0150] For example, the determined access order between the target L2P mapping table items is: the second L2P mapping table item→the first L2P mapping table item→the second L2P mapping table item→the second L2P mapping table item. Then for the first L2P mapping table item, according to the above access order, it can be determined that its access frequency is 1 time and its access rank is the second. For the second L2P mapping table item, according to the above access order, it can be determined that its access frequency is 3 times and its access rank is the first.
[0151] The storage device can then calculate the access priority of the first L2P mapping table entry through its access frequency "1 time" and access position "second place", assuming it is 2, and calculate the access priority of the second L2P mapping table entry through its access frequency "3 times" and access position "first place", assuming it is 5.
[0152] In the solution provided by the embodiment of the present application, by obtaining and analyzing the target load mode sent by the host computer in advance, the existing target optimization strategies are generated or applied in a targeted manner. These target optimization strategies can optimize the storage method of L2P mapping table items in the memory according to the target storage unit and the access order of the target storage unit. By intelligently preloading and caching the necessary L2P mapping table items, the need for real-time query and swapping in and out mapping table items is reduced, thereby significantly reducing the time to respond to read and write commands and improving the efficiency of data processing.
[0153] As an implementation method of the present application, Figure 2 As shown, the generation method of the above target optimization strategy may include:
[0154] S201, determining the target storage units that need to be accessed when executing a data read or write instruction, and the access order between the target storage units.
[0155] S202, determining a target L2P mapping table entry recording a physical address of a target storage unit, and determining an access order between each target L2P mapping table entry according to an access order between each target storage unit.
[0156] The specific implementation of steps S201-S202 is described in Figure 1 The embodiment shown is described in detail and will not be repeated here.
[0157] S203: Determine the access heat of each target L2P mapping table entry according to the access sequence between each target L2P mapping table entry.
[0158] After determining the access order between each target L2P mapping table entry, the storage device can determine the access frequency, access rank and time access sub-heat of the target L2P mapping table entry according to the access order, and then perform weighted summation of the access frequency, access rank and / or time access sub-heat to obtain the access heat of the target L2P mapping table entry.
[0159] The method of determining the access frequency and access ranking has been Figure 1 The embodiment shown is described in detail and will not be repeated here.
[0160] For the time access sub-heat, if multiple time points at which a target L2P mapping table entry is accessed are close, the time access sub-heat of the target L2P mapping table entry is higher. Therefore, for a target L2P mapping table entry, the time access sub-heat of the target L2P mapping table entry can be determined according to the access time intervals between the corresponding multiple accesses.
[0161] For example, the access order between the target L2P mapping table items is: the second L2P mapping table item → the second L2P mapping table item → the first L2P mapping table item → the third L2P mapping table item → the first L2P mapping table item. Although the access frequencies of the first L2P mapping table item and the second L2P mapping table item are both 2 times, the two accesses to the second L2P mapping table item are adjacent, and the two accesses to the first L2P mapping table item are separated by an access to the third L2P mapping table item. Therefore, the time access sub-heat of the second L2P mapping table item is higher than the time access sub-heat of the first L2P mapping table item.
[0162] S204: Determine the access priority of each target L2P mapping table entry according to the access popularity of each target L2P mapping table entry.
[0163] In one implementation, after obtaining the access heat of each target L2P mapping table entry, the storage device may determine the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry in a manner that the higher the access heat, the higher the access priority.
[0164] In another embodiment, before determining the access priority of each target L2P mapping table entry, the storage device may further determine whether the target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read / write instruction operating the target storage unit is a write instruction.
[0165] For example, the data read and write instructions are: "write data to storage unit 1" and "read data from storage unit 2". For storage unit 1, the data read and write instructions operating on it are write instructions, so it can be determined that the second L2P mapping table entry recording the physical address of storage unit 1 needs to be modified. For storage unit 2, the data read and write instructions operating on it are read instructions, so it can be determined that the first L2P mapping table entry recording the physical address of storage unit 2 does not need to be modified.
[0166] Accordingly, when determining the access priority of each target L2P mapping table entry, the storage device may perform weighted summation of the access heat of each target L2P mapping table entry and whether the target L2P mapping table entry needs to be modified to determine the access priority of the target L2P mapping table entry.
[0167] Among them, the corresponding relationship between "access heat" and "access priority" can be that the higher the access heat, the higher the access priority; the corresponding relationship between "whether it needs to be modified" and "access priority" can be that the higher the access priority is, the more it needs to be modified, or the lower the access priority is. It can be adaptively adjusted according to specific scenarios and is not specifically limited here.
[0168] For example, in a "read" priority scenario, for a target L2P mapping table entry, if it needs to be modified, its access priority is lower. In a "write" priority scenario, for a target L2P mapping table entry, if it needs to be modified, its access priority is higher.
[0169] S205: Determine the first storage mode as the target optimization strategy corresponding to the target load mode.
[0170] After determining the access priority of each target L2P mapping table entry, the storage device may determine the target optimization strategy corresponding to the target load mode as "storing each target L2P mapping table entry into the memory in descending order of access priority (ie, the first storage method)".
[0171] Regarding the method of generating the above-mentioned target optimization strategy, in one embodiment, after obtaining the target load pattern, the storage device can generate a general target optimization strategy for all data read and write instructions included in the target load pattern, that is, when the storage device executes the above-mentioned step S201, the data read and write instructions targeted are all data read and write instructions included in the target load pattern.
[0172] In another embodiment, after acquiring the target load pattern, the storage device may generate multiple target optimization strategies for all data read and write instructions included in the target load pattern, that is, when the storage device executes the above step S201, the data read and write instructions targeted are part of the data read and write instructions included in the target load pattern, specifically:
[0173] When the storage device obtains all the data read and write instructions included in the target load mode, it can first determine some data read and write instructions from all the data read and write instructions according to the preset number threshold in the order of the instructions from front to back, and then perform the above steps S201-S205 for the part of the data read and write instructions to first determine the first sub-optimization strategy corresponding to the part of the data read and write instructions. Then, according to the preset number threshold, continue to determine some data read and write instructions again from the part of the data read and write instructions for which the corresponding optimization strategy has not been generated, and generate the corresponding second sub-optimization strategy. And so on, until the corresponding optimization strategy is generated for all data read and write instructions. All the generated sub-optimization strategies are the target optimization strategy.
[0174] Accordingly, when the storage device stores the target L2P mapping table item in the memory, it can first determine the target L2P mapping table item from the L2P mapping table according to the first sub-optimization strategy, and store the target L2P mapping table item in the memory. After receiving the target data read and write command subsequently, when all the target L2P mapping table items stored in the memory are used up, or when the target L2P mapping table items stored in the memory are used to a preset proportion, it can then determine the target L2P mapping table item from the L2P mapping table according to the second sub-optimization strategy, and store the target L2P mapping table item in the memory, and so on, to achieve the storage of L2P mapping table items according to each sub-optimization strategy in turn.
[0175] In the solution provided in the embodiment of the present application, the access frequency, access rank, time access sub-heat and / or whether the target L2P mapping table entry needs to be modified can be considered to accurately determine the access priority of each target L2P mapping table entry, and the storage strategy of the L2P mapping table entry in the memory is optimized accordingly, the memory usage is optimized, and it is ensured that the L2P mapping table entries with high access priority can be processed first, thereby significantly improving the overall performance and response speed of the storage device.
[0176] As an implementation of an embodiment of the present application, the above-mentioned target optimization strategy may include not only the storage method of the above-mentioned L2P mapping table items in the memory, but also the storage method of the set data in the memory. Specifically, the above-mentioned target optimization strategy may also include: according to the target storage unit and the access order between each target storage unit, the storage method of the target data stored in the target storage unit in the memory is set.
[0177] Correspondingly, such as Figure 3 As shown, after the above step S102, the above method may further include:
[0178] S301, according to the target optimization strategy, read the target data from the target storage unit and store the target data in the memory.
[0179] For each load mode, when the storage device first obtains the load mode sent by the host computer, it can not only determine the storage method of the L2P mapping table entry in the memory, but also determine the storage method of the data in the memory. Specifically:
[0180] After the storage device determines the storage unit to be accessed and the access order between the storage units to be accessed according to the data read and write instructions included in the load mode, in addition to determining the storage method of the L2P mapping table entries in the memory according to the determined storage unit and the access order, the storage device can also determine the storage method of the data in these storage units in the memory according to the access order between the storage units to be accessed. Finally, the storage device can use the determined storage method of the L2P mapping table entries in the memory and the storage method of the data in the memory as the optimization strategy corresponding to the load mode.
[0181] Therefore, when the judgment result of step S102 is yes, the storage device can not only execute step S103, but also execute step S301 to directly obtain the target optimization strategy from the optimization strategy created by itself. Because the storage method of the target data included in the target optimization strategy in the memory actually records which storage units to read the target data from and how these target data should be stored in the memory. Therefore, the storage device can first read the target data from the target storage unit according to the target optimization strategy, and then store the target data in the memory according to the storage method in the target optimization strategy, thereby completing the pre-storage of data.
[0182] S302, generating a target optimization strategy according to the target load mode, and reading target data from the target storage unit according to the target optimization strategy, and storing the target data in the memory.
[0183] If not created, the storage device can execute step S302 in addition to step S104, generate a target optimization strategy in real time according to the target load mode, and then read the target data from the target storage unit according to the target optimization strategy, and store the target data in the memory. It should be noted that, in this embodiment, the generation of the target optimization strategy in step S104 actually refers to the storage method of the L2P mapping table items in the generated target optimization strategy, and the generation of the target optimization strategy in step S302 actually refers to the storage method of the data in the generated target optimization strategy. Among them, the storage method of the data in the target optimization strategy can be to store the target data stored in each target storage unit in the memory in the order of access priority from high to low.
[0184] Regarding the access priority of the target storage unit, in one implementation, the storage device may determine the access priority of the target storage unit through the following steps:
[0185] First, the storage device can determine the target storage unit that the storage device needs to access when executing the data read and write instructions according to the data read and write instructions included in the target load mode, and determine the access order between the target storage units according to the order between the data read and write instructions.
[0186] Then, the storage device can determine the access frequency of each target storage unit according to the access order between the target storage units, and then determine the access priority of each target storage unit according to the access frequency of each target storage unit according to the principle that the higher the access frequency, the higher the access priority.
[0187] For example, the data read and write instructions included in the target load mode are: "write data to storage unit 1", "read data from storage unit 2", and "read data from storage unit 1". Then the storage device can determine that the target storage units are: storage unit 1 and storage unit 2 according to the above data read and write instructions, and the access order between the target storage units is: storage unit 1→storage unit 2→storage unit 1.
[0188] The storage device can determine the access frequency of storage unit 1 to be 2 times and the access frequency of storage unit 2 to be 1 time according to the access order between each target storage unit. According to the principle that the higher the access frequency, the higher the access priority, the storage device can determine the access priority of storage unit 1, which is assumed to be 2, and the access priority of storage unit 2, which is assumed to be 1, according to the access frequency of each target storage unit.
[0189] In another implementation, after obtaining the access order between the target storage units in the above manner, the storage device may also determine the access priority of the target storage unit by the following steps:
[0190] According to the access order, the access position of each target storage unit when it is accessed for the first time is determined, and then the access priority of each target storage unit is determined according to the access position of each target storage unit according to the principle that the earlier the access position, the higher the access priority.
[0191] For example, the determined access order between each target storage unit is: storage unit 1→storage unit 2→storage unit 1. According to the access order, it can be determined that the access order of storage unit 1 is the first, and the access order of storage unit 2 is the second. According to the principle that the higher the access order, the higher the access priority, according to the access order of each target storage unit, the storage device can determine the access priority of storage unit 1, which is assumed to be 1, and the access priority of storage unit 2, which is assumed to be 0.5.
[0192] In yet another embodiment, after obtaining the access order between the target storage units in the above manner, the storage device may also determine the access priority of the target storage unit by the following steps:
[0193] According to the access order, the access frequency and the first access rank of each target storage unit are determined, and then for each target storage unit, the access frequency and access rank of the target storage unit are weightedly calculated to obtain the access priority corresponding to the target storage unit.
[0194] For example, the determined access order between the target storage units is: storage unit 1→storage unit 2→storage unit 1. Then for storage unit 1, according to the above access order, it can be determined that its access frequency is 2 times, and the access rank is the first. For storage unit 2, according to the above access order, it can be determined that its access frequency is 1 time, and the access rank is the second.
[0195] The storage device can then calculate the access priority of storage unit 1 through its access frequency "2 times" and access ranking "first place", assuming it is 4, and calculate the access priority of storage unit 2 through its access frequency "1 time" and access ranking "second place", assuming it is 2.
[0196] In the solution provided by the embodiment of the present application, by obtaining and analyzing the target load mode sent by the host computer in advance, the existing target optimization strategies are generated or applied in a targeted manner. These target optimization strategies can optimize the storage method of data in the memory according to the target storage unit and the access order of the target storage unit. By intelligently preloading and caching the necessary data, the time for reading and writing data when responding to read and write commands is significantly reduced, and the efficiency of data processing is improved.
[0197] As an implementation of an embodiment of the present application, the above target optimization strategy may also include: based on the target storage unit and the access order between each target storage unit, the target data stored in the target storage unit is set on the basis of the storage method in the memory, such as Figure 4 As shown, the generation method of the above target optimization strategy may also include:
[0198] S401, determining the target storage units that need to be accessed when executing a data read / write instruction, and the access order between the target storage units.
[0199] The specific implementation of step S401 is described in Figure 1 The embodiment shown is described in detail and will not be repeated here.
[0200] S402: Determine the access heat of each target storage unit according to the access sequence between each target storage unit.
[0201] After determining the access order between each target storage unit, the storage device can determine the access frequency, access rank, time access sub-heat and space access sub-heat of the target storage unit according to the access order, and then perform weighted summation of the access frequency, access rank, time access sub-heat and / or space access sub-heat to obtain the access heat of the target storage unit.
[0202] The method of determining the access frequency and access ranking has been Figure 3 The embodiment shown is described in detail and will not be repeated here.
[0203] For the time access sub-heat, if multiple time points at which a target storage unit is accessed are close, the time access sub-heat of the target storage unit is higher. Therefore, for a target storage unit, the time access sub-heat of the target storage unit can be determined according to the access time intervals between its corresponding multiple accesses.
[0204] For example, the access order between target storage units is: storage unit 2 → storage unit 2 → storage unit 1 → storage unit 3 → storage unit 1. Although the access frequencies of storage unit 1 and storage unit 2 are both 2 times, the two accesses to storage unit 2 are adjacent, while the two accesses to storage unit 1 are separated by an access to storage unit 3. Therefore, the time access sub-heat of storage unit 2 is higher than that of storage unit 1.
[0205] For the spatial access sub-heat, if there is a target storage unit belonging to the same storage die as the target storage unit among other target storage units accessed before (and / or after) a target storage unit, the spatial access sub-heat of the target storage unit is higher. Therefore, for a target storage unit, the spatial access sub-heat of the target storage unit can be determined based on the storage die to which the target storage unit belongs and the storage die to which other target storage units accessed before (and / or after) the target storage unit belong.
[0206] For example, assuming that storage unit 1 and storage unit 2 belong to the same storage die, the access order between target storage units is: storage unit 1 → storage unit 2 → storage unit 3. Then, because storage unit 1 and storage unit 2 belong to the same storage die, the spatial access sub-heat of storage unit 1 and storage unit 2 is higher than the spatial access sub-heat of storage unit 3.
[0207] S403: Determine the access priority of each target storage unit according to the access popularity of each target storage unit.
[0208] In one implementation, after obtaining the access heat of each target storage unit, the storage device may determine the access priority of each target storage unit according to the access heat of each target storage unit in a manner that the higher the access heat, the higher the access priority.
[0209] In another embodiment, before determining the access priority of each target storage unit, the storage device may further determine whether the data in the target storage unit needs to be modified according to whether the data read or write instruction operating the target storage unit is a write instruction.
[0210] For example, the data read and write instructions are: "write data to storage unit 1" and "read data from storage unit 2". For storage unit 1, the data read and write instructions operating on it are write instructions, so it can be determined that the data recorded in storage unit 1 needs to be modified. For storage unit 2, the data read and write instructions operating on it are read instructions, so it can be determined that the data recorded in storage unit 2 does not need to be modified.
[0211] Accordingly, when determining the access priority of each target storage unit, the storage device may perform a weighted summation of the access popularity of the target storage unit and whether the data in the target storage unit needs to be modified for each target storage unit to determine the access priority of the target storage unit.
[0212] Among them, the corresponding relationship between "access heat" and "access priority" can be that the higher the access heat, the higher the access priority; the corresponding relationship between "whether it needs to be modified" and "access priority" can be that the higher the access priority is, the more it needs to be modified, or the lower the access priority is. It can be adaptively adjusted according to specific scenarios and is not specifically limited here.
[0213] For example, in a "read" priority scenario, for a target storage unit, if the data in the target storage unit needs to be modified, the access priority is lower. In a "write" priority scenario, for a target storage unit, if the data in the target storage unit needs to be modified, the access priority is higher.
[0214] S404: Determine the second storage mode as the target optimization strategy corresponding to the target load mode.
[0215] After determining the access priority of each target storage unit, the storage device can determine the target optimization strategy corresponding to the target load mode as "storing the target data stored in each target storage unit into the memory in order of access priority from high to low (ie, the second storage method)".
[0216] When the storage device generates the target optimization strategy through the above steps S401-S404, it can generate a general target optimization strategy for all data read and write instructions included in the target load mode, or it can generate multiple target optimization strategies for all data read and write instructions included in the target load mode. The specific methods of generating a general target optimization strategy and generating multiple target optimization strategies are already described in Figure 2 The illustrated embodiment is partially described in detail and will not be repeated here.
[0217] In the solution provided in the embodiment of the present application, the access frequency, access rank, time access sub-heat, space access sub-heat and / or whether the target storage unit needs to be modified can be considered to accurately determine the access priority of each target storage unit, and the storage strategy of the data in the target storage unit in the memory is optimized accordingly, the memory usage is optimized, and it is ensured that data with high access priority can be processed first, thereby significantly improving the overall performance and response speed of the storage device.
[0218] As an implementation method of the present application, Figure 5 As shown, after storing the target L2P mapping table entry in the memory, the method may further include:
[0219] S501, obtaining the target data read and write command sent by the host computer.
[0220] After executing the above step S103 or the above step S104 and storing the target L2P mapping table entry in the memory, the storage device can also obtain the target data read and write command sent by the host computer.
[0221] For example, the host computer may first send the target load mode of "write data to storage unit 1, read data from storage unit 2, and read data from storage unit 3" to the storage device, so that the storage device stores the target L2P mapping table entry in the memory according to the target optimization strategy corresponding to the target load mode. The host computer may further send "read the game map data of game A and write login information" to the storage device to instruct the storage device to implement "read the game map data of game A and write login information" through the process of "write data to storage unit 1, read data from storage unit 2, and read data from storage unit 3".
[0222] S502, responding to a target data read / write command according to a target L2P mapping table entry stored in the memory.
[0223] After the storage device obtains the target data read / write command sent by the host computer, because the storage device has previously stored the target L2P mapping table entry for responding to the target data read / write command in the memory through the above steps S101-S104, the storage device can now directly respond to the target data read / write command based on the target L2P mapping table entry stored in the memory.
[0224] In the solution provided in the embodiment of the present application, after the storage device stores the target L2P mapping table entry in the memory, if it receives a target data read or write command sent by the host computer, it can directly respond to the target data read or write command based on the target L2P mapping table entry stored in the memory, thereby reducing the need for real-time query and swapping in and out of the L2P mapping table entry, thereby significantly reducing the time required to respond to the read or write command and improving data processing efficiency.
[0225] As an implementation method of the embodiment of the present application, the above target optimization strategy can also: clear the L2P mapping table entries from the memory in the order of the access priority of the L2P mapping table entries from low to high.
[0226] Correspondingly, such as Figure 6 As shown, the above step S502 may include:
[0227] S601, in response to a subcommand in a target data read / write command, determine whether a first L2P mapping table entry is stored in the memory. If yes, execute step S602, if not, execute step S603.
[0228] The target data read / write command received by the storage device may include multiple sub-commands, where the sub-commands are data read / write instructions. For example, the target data read / write command "read game map data of game A and write login information" may include sub-commands such as "write data to storage unit 1", "read data from storage unit 2" and "read data from storage unit 3".
[0229] Since the capacity of the memory is limited, when the storage device stores the target L2P mapping table entry in the memory, it may not be possible to store all the target L2P mapping table entries in the memory. Therefore, when responding to each subcommand, the storage device may first determine the first storage unit that needs to be accessed to execute the subcommand, and then determine the first L2P mapping table entry that records the physical address of the first storage unit. Then the storage device may determine whether the first L2P mapping table entry is stored in the memory.
[0230] S602: respond to the subcommand according to the L2P mapping table entry stored in the memory.
[0231] If the first L2P mapping table entry that will be used to respond to the current sub-command is stored in the memory, the storage device may directly respond to the current sub-command according to the L2P mapping table entry stored in the memory.
[0232] S603, clearing some L2P mapping table entries from the memory in order of access priority from low to high, storing the first L2P mapping table entry in the memory, and responding to the subcommand according to the L2P mapping table entry stored in the memory.
[0233] If the first L2P mapping table entry that will be used in response to the current subcommand is not stored in the memory, in order to have sufficient memory capacity to store the first L2P mapping table entry that will be used in response to the current subcommand, the storage device can first clear some L2P mapping table entries with lower access priorities from the memory in order of access priority from low to high to free up memory space.
[0234] The storage device may then query the first L2P mapping table entry from the L2P mapping table and store it in the memory, and then the storage device may respond to the current subcommand according to the L2P mapping table entry stored in the memory.
[0235] The method for determining the access priority of the L2P mapping table entry has been described in detail in the above embodiments and will not be repeated here.
[0236] In the solution provided by the embodiment of the present application, by first checking whether the L2P mapping table entry to be accessed has been stored in the memory, the storage device can quickly decide whether to directly use existing resources to respond to the sub-command or whether to clear and update the memory. And when the memory space is insufficient, some L2P mapping table entries are cleared from low to high according to the access priority, ensuring that the high-priority table entries are retained in the memory, thereby maximizing the use of limited memory resources and ensuring the response speed and efficiency of the sub-command.
[0237] As an implementation of an embodiment of the present application, the above-mentioned target optimization strategy also includes: clearing data stored in the storage unit from the memory in order of the access priority of the storage unit from low to high.
[0238] Correspondingly, such as Figure 7 As shown, the above-mentioned response target data read and write command may include:
[0239] S701, in response to a subcommand in a target data read / write command, determine whether the memory stores first data, if yes, execute step S702, if no, execute step S703.
[0240] The target data read / write command received by the storage device may include multiple sub-commands, where the sub-commands are data read / write instructions. For example, the target data read / write command "read game map data of game A and write login information" may include sub-commands such as "write data to storage unit 1", "read data from storage unit 2" and "read data from storage unit 3".
[0241] Since the capacity of the memory is limited, when the storage device stores the target data in the target storage unit in the memory, it may not be able to store all the target data in the memory. Therefore, when responding to each subcommand, the storage device may first determine the first storage unit that needs to be accessed to execute the subcommand. Then the storage device may determine whether the first data stored in the first storage unit is stored in the memory.
[0242] S702, respond to the sub-command according to the data stored in the memory.
[0243] If the memory stores the first data that will be used to respond to the current sub-command, the storage device can directly respond to the current sub-command according to the data stored in the memory.
[0244] S703, clearing data stored in some storage units from the memory in order of access priority from low to high, storing the first data in the memory, and responding to the sub-command according to the data stored in the memory.
[0245] If the first data to be used in response to the current sub-command is not stored in the memory, in order to have sufficient memory capacity to store the first data to be used in response to the current sub-command, the storage device can first clear the data stored in the storage units with lower access priorities from the memory in order of access priority from low to high to free up memory space.
[0246] The storage device can then read the first data from the first storage unit and store it in the memory, and then the storage device can respond to the current sub-command according to the data stored in the memory.
[0247] The method for determining the access priority of the storage unit has been described in detail in the above embodiments and will not be repeated here.
[0248] In the solution provided by the embodiment of the present application, by first checking whether the data to be accessed is already stored in the memory, the storage device can quickly decide whether to directly use existing resources to respond to the sub-command or whether to clean up and update the memory. And when the memory space is insufficient, some data is cleared from low to high according to the access priority, ensuring that high-priority data is retained in the memory, thereby maximizing the use of limited memory resources while ensuring the response speed and efficiency of the sub-command.
[0249] As an implementation of an embodiment of the present application, the above-mentioned storage device includes multiple storage dies, each storage die includes multiple storage units; accordingly, the target optimization strategy may also include: aggregating sub-commands in data read and write commands for the same storage die.
[0250] Correspondingly, such as Figure 8 As shown, the above-mentioned response target data read and write command may include:
[0251] S801, before responding to a current subcommand in a target data read / write command, determine a target storage die to which a storage unit to be accessed in response to the current subcommand belongs.
[0252] The target data read and write command received by the storage device may include multiple subcommands, and among the multiple subcommands, there may be subcommands that need to access storage units in the same storage die. On this basis, in order to increase data processing efficiency, the storage device may aggregate the subcommands that need to access storage units in the same storage die. Specifically:
[0253] Before responding to the current subcommand in the target data read / write command, the storage device may first determine the storage unit that needs to be accessed in response to the current subcommand, and then determine the target storage die to which the storage unit belongs.
[0254] S802, judging whether the target subcommand exists in the subsequent subcommands in the target data read / write command according to the data read / write instruction. If yes, executing step S803, if not, responding to the current subcommand.
[0255] Since the storage device has acquired the target load mode corresponding to the target data read / write command in advance, the target load mode includes: the data read / write instructions that the storage device needs to execute when responding to the target data read / write command of the host computer. For example, the target load mode corresponding to the target data read / write command of "reading the game map data of game A and writing the login information" may include "writing data to storage unit 1", "reading data from storage unit 2" and "reading data from storage unit 3".
[0256] Therefore, the storage device can determine the storage unit that needs to be accessed by each sub-command after the current sub-command in the subsequent target data read and write commands based on the above-mentioned data read and write instructions, and then the storage device can determine whether there is a target sub-command in which the storage grain to which the storage unit that needs to be accessed belongs is also a target storage grain in each sub-command after the current sub-command in the subsequent target data read and write commands.
[0257] S803: Do not respond to the current subcommand. After receiving the target subcommand, aggregate the current subcommand with the target subcommand to obtain an aggregated subcommand and respond to the aggregated subcommand.
[0258] If a target subcommand is required after the current subcommand, then because the storage units accessed by the current subcommand and the target subcommand belong to the same storage grain, the storage device may not respond to the current subcommand, but wait until the target subcommand is received later, aggregate the current subcommand and the target subcommand to obtain an aggregate subcommand, and then respond to the aggregate subcommand.
[0259] In the solution provided by the embodiment of the present application, the sub-commands in the target data read and write commands are pre-analyzed to determine the storage grains they need to access, and the sub-commands accessing the same storage grain are aggregated accordingly. This strategy reduces the number of storage grain switching times and reduces the overhead of addressing and switching storage grains. At the same time, command aggregation can also optimize the continuity of data access, so that the storage device can use resources more efficiently when processing complex data read and write tasks, thereby improving overall performance.
[0260] Correspondingly, the above-mentioned data processing method applied to the storage device, the embodiment of the present application also provides a data processing method applied to the host computer. The data processing method applied to the host computer provided by the embodiment of the present application is introduced below.
[0261] The data processing method applied to a storage device provided in the embodiment of the present application can be applied to any host computer that establishes a communication connection with the storage device, for example, terminal devices such as mobile phones and computers or servers, etc., without specific limitation here. For the sake of clear description, it is referred to as the host computer below.
[0262] like Fig. 9 ,A data processing method, applied to a host computer, comprises;
[0263] S901, in response to the start of an object requesting data reading and writing, it is determined whether a target load mode corresponding to the object has been created. If yes, step S902 is executed.
[0264] In many application scenarios, there will be a situation where "an object is started in the host computer, and then the host computer sends a data read and write command to the storage device to instruct the storage device to perform data read and write operations."
[0265] For example, when a game is started in the host computer, the host computer will send a data read and write command to the storage device to instruct the storage device to read the game map data and write the login information. For another example, when the upload function in the network disk is started in the host computer, the host computer will send a data read and write command to the storage device to instruct the storage device to write data.
[0266] Therefore, in order to speed up and improve the efficiency of data processing, the object requesting data reading and writing to be initiated in the above situation can be recorded in advance, and then the data reading and writing instructions that the storage device needs to execute when responding to the data reading and writing commands can be determined as the load mode of the object, thereby establishing a corresponding relationship between the object and the load mode.
[0267] For example, the object is "Game A" and the load pattern is "write data to storage unit 1, read data from storage unit 2, and read data from storage unit 3".
[0268] Therefore, when the upper computer detects the startup of an object requesting data reading and writing, it can respond to the startup of the object and determine whether it has created the target load pattern corresponding to the object by determining whether the correspondence between the objects stored in itself and the load pattern includes the object.
[0269] For example, the host computer can use the key-value data format to store each object and the load mode corresponding to each object. When the host computer detects that the object requesting data reading and writing is started, it can determine whether the key value corresponding to the object exists in the key-value data stored by itself. If it exists, it determines the target load mode corresponding to the object that has been created by itself. If it does not exist, it determines the target load mode corresponding to the object that has not been created by itself.
[0270] S902, sending the target load mode to the storage device, so that the storage device determines a target L2P mapping table entry from the L2P mapping table according to a target optimization policy corresponding to the target load mode, and stores the target L2P mapping table entry in a memory.
[0271] If the upper computer has created a target load pattern corresponding to the object, the upper computer can obtain the target load pattern from the load pattern created by itself, and then send the load pattern to the storage device, so that the storage device determines the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy corresponding to the target load pattern, and stores the target L2P mapping table entry in the memory.
[0272] The manner in which the storage device stores the target L2P mapping table entry in the memory according to the target optimization strategy has been described in detail in the above embodiments and will not be repeated here.
[0273] In the solution provided by the embodiment of the present application, by pre-recording and establishing the relationship between the object requesting data read and write and its corresponding load pattern in the host computer, when the object is started, the host computer can quickly identify and determine whether there is a created load pattern. Once confirmed, the host computer immediately sends the target load pattern to the storage device, so that the storage device can pre-fetch and cache the necessary L2P mapping table items from the L2P mapping table to the memory in advance according to the optimization strategy. This method significantly reduces the processing time of the storage device when receiving a specific read and write command.
[0274] As an implementation method of the present application, Fig.10 As shown, after the above step S901, the above method may further include:
[0275] S903, in response to sending a target data read / write command to the storage device, obtaining a data read / write instruction executed by the storage device in the process of responding to the target data read / write command.
[0276] If the host computer has not created the target load mode corresponding to the object, that is, the judgment result of the above step S901 is no, then in the subsequent process, the host computer can obtain the data read and write instructions executed by the storage device in response to the target data read and write commands when sending the target data read and write commands to the storage device.
[0277] The host computer can obtain the above data read and write instructions in the following two ways, but not limited to:
[0278] In one embodiment, the target data read and write command can specifically be an instruction stream composed of individual data read and write instructions. Therefore, when the upper computer sends the target data read and write command to the storage device, it can directly obtain the individual data read and write instructions included in the target data read and write command, and then use the individual data read and write instructions as the data read and write instructions executed by the storage device in the process of responding to the target data read and write command.
[0279] For example, the target data read and write command is "read the game map data of game A and write login information", and the target data read and write command may specifically include: the first data read and write instruction "write data to storage unit 1", the second data read and write instruction "read data from storage unit 2", and the third data read and write instruction "read data from storage unit 3". Therefore, when the host computer sends the target data read and write command to the storage device, it can obtain the various data read and write instructions included in the above target data read and write command as the data read and write instructions executed by the storage device in the process of responding to the target data read and write command.
[0280] In another embodiment, when the host computer sends the target data read and write command to the storage device, it can send a request command to the storage device to request the storage device to record the data read and write instructions executed in the process of responding to the target data read and write command, and feedback the recording result to the host computer. Then the host computer can receive the data read and write instructions fed back by the storage device based on the above request command as the data read and write instructions executed by the storage device in the process of responding to the target data read and write command.
[0281] S904, generating a target load pattern based on the data read and write instructions.
[0282] After obtaining the data read and write instructions executed by the storage device in response to the target data read and write commands, the host computer generates a target load pattern based on the data read and write instructions, that is, uses the data read and write instructions as the target load pattern, and establishes a corresponding relationship between the target load pattern and the object requesting data read and write.
[0283] In the solution provided by the embodiment of the present application, when the host computer has not yet created a target load pattern for a specific object, it can dynamically generate a load pattern for the object by capturing data read and write instructions executed by the storage device during actual data read and write operations.
[0284] As an implementation method of the present application, Fig.11 As shown, after the above step S902, the above method may further include:
[0285] S905 , in response to sending a target data read / write command to the storage device, obtaining a data read / write instruction actually executed by the storage device in the process of responding to the target data read / write command.
[0286] The data read and write instructions that the storage device needs to execute when responding to the target data read and write commands of the host computer may change. In this case, in order to ensure accuracy, the host computer can obtain the data read and write instructions actually executed by the storage device in response to the target data read and write commands when sending the target load mode to the storage device.
[0287] The host computer can obtain the above-mentioned data read and write instructions actually executed in the following two ways, but not limited to:
[0288] In one embodiment, the target data read and write command can specifically be an instruction stream composed of individual data read and write instructions. Therefore, after the upper computer sends the target load mode to the storage device, when the target data read and write command is obtained and sent to the storage device, the individual data read and write instructions included in the target data read and write command can be directly obtained, and then the individual data read and write instructions can be used as the data read and write instructions actually executed by the storage device in the process of responding to the target data read and write command.
[0289] In another embodiment, when the host computer sends the target data read and write command to the storage device, it can send a request command to the storage device to request the storage device to record the data read and write instructions actually executed in the process of responding to the target data read and write command, and feedback the record result to the host computer. Then the host computer can receive the data read and write instructions fed back by the storage device based on the above request command as the data read and write instructions executed by the storage device in the process of responding to the target data read and write command.
[0290] S906, when the data read / write instruction is inconsistent with the actually executed data read / write instruction, updating the target load mode to the actually executed data read / write instruction.
[0291] After the host computer obtains the data read and write instructions actually executed by the storage device, it can determine whether the data read and write instructions included in the previously recorded target load pattern are consistent with the data read and write instructions actually executed. If they are inconsistent, it means that the target load pattern corresponding to the object has changed. At this time, the host computer can update the target load pattern to the data read and write instructions actually executed.
[0292] In the solution provided by the embodiment of the present application, the host computer can capture the changes in the storage device's response to the data read and write commands in real time by obtaining the data read and write instructions actually executed by the storage device. Once it is found that the data read and write instructions included in the target load mode are inconsistent with the data read and write instructions actually executed, the host computer can immediately update it to ensure that the load mode always matches the operation performed by the storage device when responding to the data read and write commands.
[0293] Corresponding to the above-mentioned data processing method applied to a storage device, an embodiment of the present application further provides a data processing device applied to a storage device. The data processing device applied to a storage device provided in an embodiment of the present application is introduced below.
[0294] like Fig.12 As shown, a data processing device is applied to a storage device, comprising:
[0295] The load mode acquisition module 1210 is used to acquire the target load mode sent by the host computer, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to the target data read and write command of the host computer;
[0296] The first judgment module 1220 is used to judge whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access sequence between each target storage unit, the target storage unit is a storage unit that the storage device needs to access when executing a data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit;
[0297] A first mapping table entry storage module 1230 is configured to determine a target L2P mapping table entry from the L2P mapping table according to a target optimization strategy and store the target L2P mapping table entry in a memory when the judgment result of the first judgment module 1220 is yes;
[0298] The second mapping table entry storage module 1240 is used to generate a target optimization strategy according to the target load mode when the judgment result of the first judgment module 1220 is no, and determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and store the target L2P mapping table entry in the memory.
[0299] In the solution provided by the embodiment of the present application, the storage device can obtain the target load mode sent by the host computer, wherein the target load mode includes: the data read and write instructions that the storage device needs to execute when responding to the target data read and write commands of the host computer; determine whether the target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage method of the target L2P mapping table item in the memory is set, the target storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table item is the L2P mapping table item that records the physical address of the target storage unit; if it has been created, according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory; if it has not been created, generate the target optimization strategy according to the target load mode, and according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory. Since the solution provided by the embodiment of the present application obtains and analyzes the target load pattern sent by the host computer in advance, and generates or applies the existing target optimization strategies in a targeted manner, these target optimization strategies can optimize the storage method of L2P mapping table items in the memory according to the target storage unit and the access order of the target storage unit. By intelligently preloading and caching the necessary L2P mapping table items, the need for real-time query and swapping in and out of L2P mapping table items is reduced, thereby significantly reducing the time to respond to read and write commands and improving the efficiency of data processing.
[0300] As an implementation of the embodiment of the present application, the second mapping table entry storage module 1240 may include:
[0301] A first storage unit determination unit, used to determine the target storage unit to be accessed when executing the data read and write instruction, and the access order between the target storage units;
[0302] A mapping table entry determining unit, used to determine a target L2P mapping table entry recording a physical address of a target storage unit, and determine an access order between each target L2P mapping table entry according to an access order between each target storage unit;
[0303] A first access heat determination unit, configured to determine the access heat of each target L2P mapping table entry according to the access order between each target L2P mapping table entry;
[0304] A first access priority determination unit, configured to determine the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry;
[0305] The first target optimization strategy determination unit is used to determine the first storage method as the target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table entry into the memory in descending order of access priority.
[0306] As an implementation of the embodiment of the present application, the second mapping table entry storage module 1240 may further include:
[0307] A modification determination unit, used to determine whether a target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read and write instruction operating on the target storage unit is a write instruction;
[0308] The access priority determination unit is specifically configured to determine the access priority of each target L2P mapping table entry according to the access popularity of each target L2P mapping table entry and whether it needs to be modified.
[0309] As an implementation of the embodiment of the present application, the above-mentioned target optimization strategy may also include: according to the target storage unit and the access order between each target storage unit, setting the storage mode of the target data in the memory, wherein the target data is the data stored in the target storage unit;
[0310] The above device may also include:
[0311] A first data storage module, used to read target data from a target storage unit and store the target data in a memory according to a target optimization strategy;
[0312] The second data storage module is used to generate a target optimization strategy according to the target load mode, read the target data from the target storage unit according to the target optimization strategy, and store the target data in the memory.
[0313] As an implementation of the embodiment of the present application, the second data storage module may include:
[0314] A second storage unit determination unit, used to determine the target storage unit to be accessed when executing the data read and write instruction, and the access order between the target storage units;
[0315] A second access heat determination unit, used to determine the access heat of each target storage unit according to the access sequence between the target storage units;
[0316] A second access priority determination unit, configured to determine the access priority of each target storage unit according to the access popularity of each target storage unit;
[0317] The second target optimization strategy determination unit is used to determine the second storage method as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in the order of access priority from high to low.
[0318] As an implementation of the embodiment of the present application, the above device may further include:
[0319] The read and write command acquisition module is used to obtain the target data read and write commands sent by the host computer;
[0320] The read / write command response module is used to respond to the target data read / write command according to the target L2P mapping table entry stored in the memory.
[0321] As an implementation of an embodiment of the present application, the target optimization strategy may further include: clearing L2P mapping table entries from the memory in order of access priority of the L2P mapping table entries from low to high. The read-write command response module may be specifically used for:
[0322] When responding to a subcommand in a target data read / write command, if a first L2P mapping table entry is stored in the memory, responding to the subcommand according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry recording a physical address of a first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand;
[0323] When responding to a sub-command in a target data read or write command, if the first L2P mapping table entry is not stored in the memory, some L2P mapping table entries are cleared from the memory in order of access priority from low to high, and the first L2P mapping table entry is stored in the memory, and the sub-command is responded to according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry that records the physical address of the first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the sub-command.
[0324] As an implementation of an embodiment of the present application, the above-mentioned target optimization strategy may also include: clearing data stored in the storage unit from the memory in order of the access priority of the storage unit from low to high; the above-mentioned read and write command response module may be specifically used for:
[0325] When responding to a subcommand in a target data read / write command, if first data is stored in the memory, responding to the subcommand according to the data stored in the memory, wherein the first data is data stored in a storage unit that needs to be accessed to execute the subcommand;
[0326] When responding to a sub-command in a target data read or write command, if the first data is not stored in the memory, the data stored in some storage units are cleared from the memory in order of access priority from low to high, and the first data is stored in the memory, and the sub-command is responded to based on the data stored in the memory, wherein the first data is the data stored in the storage unit that needs to be accessed to execute the sub-command.
[0327] As an implementation of an embodiment of the present application, the storage device includes a plurality of storage grains, each storage grain includes a plurality of storage units; the target optimization strategy may further include: aggregating sub-commands for the same storage grain in the data read and write commands; the read and write command response module may be specifically used for:
[0328] Before responding to the current subcommand in the target data read / write command, determining the target storage grain to which the storage unit to be accessed in response to the current subcommand belongs;
[0329] According to the data read / write instruction, determining whether there is a target subcommand in the subsequent subcommands in the target data read / write command, wherein the storage grain to which the storage unit to be accessed in response to the target subcommand belongs is the target storage grain;
[0330] If it exists, do not respond to the current subcommand. After receiving the target subcommand, aggregate the current subcommand with the target subcommand to obtain the aggregated subcommand and respond to the aggregated subcommand.
[0331] Corresponding to the above-mentioned data processing method applied to the host computer, an embodiment of the present application also provides a data processing device applied to the host computer. The data processing device applied to the host computer provided by the embodiment of the present application is introduced below.
[0332] like Fig.13 As shown, a data processing device is applied to a host computer, comprising:
[0333] The second judgment module 1310 is used to judge whether a target load mode corresponding to the object has been created in response to the object startup requesting data reading and writing, wherein the target load mode includes: a data reading and writing instruction that the storage device needs to execute when responding to a target data reading and writing command of the host computer, and the target data reading and writing command is a data reading and writing command generated by the host computer for the object;
[0334] The load pattern sending module 1320 is used to send the target load pattern to the storage device when the judgment result of the second judgment module 1310 is yes, so that the storage device determines the target L2P mapping table item from the L2P mapping table according to the target optimization strategy corresponding to the target load pattern, and stores the target L2P mapping table item in the memory, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the target storage unit is the storage unit that the storage device needs to access when executing data read and write instructions, and the target L2P mapping table item is the L2P mapping table item that records the physical address of the target storage unit.
[0335] In the solution provided by the embodiment of the present application, by pre-recording and establishing the relationship between the object requesting data read and write and its corresponding load pattern in the host computer, when the object is started, the host computer can quickly identify and determine whether there is a created load pattern. Once confirmed, the host computer immediately sends the target load pattern to the storage device, so that the storage device can pre-fetch and cache the necessary L2P mapping table items from the L2P mapping table to the memory in advance according to the optimization strategy. This method significantly reduces the processing time of the storage device when receiving a specific read and write command.
[0336] As an implementation of the embodiment of the present application, the above device may further include:
[0337] The load pattern generation module is used to obtain the data read and write instructions executed by the storage device in response to the target data read and write command sent to the storage device when the judgment result of the second judgment module 1310 is no; and generate a target load pattern based on the data read and write instructions.
[0338] As an implementation of the embodiment of the present application, the above device may further include:
[0339] The load mode update module is used to respond to sending a target data read / write command to the storage device and obtain the data read / write instructions actually executed by the storage device in the process of responding to the target data read / write command; when the data read / write instructions are inconsistent with the data read / write instructions actually executed, the target load mode is updated to the data read / write instructions actually executed.
[0340] Corresponding to the above-mentioned data processing method, the embodiment of the present application further provides a data processing system. The data processing system provided by the embodiment of the present application is introduced below.
[0341] like Fig.14 As shown, a data processing system includes a storage device 1401 and a host computer 1402;
[0342] The host computer 1402 is used to send a target load pattern to the storage device 1401, wherein the target load pattern includes: data read and write instructions that the storage device 1401 needs to execute when responding to a target data read and write command from the host computer 1402;
[0343] The storage device 1401 is used to determine whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access sequence between each target storage unit, the target storage unit is a storage unit that the storage device 1401 needs to access when executing a data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit;
[0344] The storage device 1401 is further configured to determine a target L2P mapping table entry from the L2P mapping table according to the target optimization strategy when a target optimization strategy corresponding to the target load mode has been created, and store the target L2P mapping table entry in the memory;
[0345] The storage device 1401 is also used to generate a target optimization strategy according to the target load pattern when the target optimization strategy corresponding to the target load pattern is not created, and to determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and to store the target L2P mapping table entry in the memory.
[0346] In the solution provided by the embodiment of the present application, the storage device can obtain the target load mode sent by the host computer, wherein the target load mode includes: the data read and write instructions that the storage device needs to execute when responding to the target data read and write commands of the host computer; determine whether the target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage method of the target L2P mapping table item in the memory is set, the target storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table item is the L2P mapping table item that records the physical address of the target storage unit; if it has been created, according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory; if it has not been created, generate the target optimization strategy according to the target load mode, and according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory. Since the solution provided by the embodiment of the present application obtains and analyzes the target load pattern sent by the host computer in advance, and generates or applies the existing target optimization strategies in a targeted manner, these target optimization strategies can optimize the storage method of L2P mapping table items in the memory according to the target storage unit and the access order of the target storage unit. By intelligently preloading and caching the necessary L2P mapping table items, the need for real-time query and swapping in and out of L2P mapping table items is reduced, thereby significantly reducing the time to respond to read and write commands and improving the efficiency of data processing.
[0347] As an implementation of the embodiment of the present application, the storage device 1401 may be specifically used for:
[0348] Determine the target storage units to be accessed when executing the data read and write instructions, and the access order between the target storage units;
[0349] Determine a target L2P mapping table entry recording a physical address of a target storage unit, and determine an access order between each target L2P mapping table entry according to an access order between each target storage unit;
[0350] Determining the access heat of each target L2P mapping table entry according to the access order between each target L2P mapping table entry;
[0351] Determine the access priority of each target L2P mapping table entry according to the access popularity of each target L2P mapping table entry;
[0352] The first storage method is determined as the target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table entry into the memory in a descending order of access priority.
[0353] As an implementation of the embodiment of the present application, the storage device 1401 may also be used to determine whether the target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read and write instruction operating on the target storage unit is a write instruction before determining the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry;
[0354] The storage device 1401 may be specifically configured to determine the access priority of each target L2P mapping table entry according to the access popularity of each target L2P mapping table entry and whether it needs to be modified.
[0355] As an implementation of the embodiment of the present application, the above-mentioned target optimization strategy may also include: according to the target storage unit and the access order between each target storage unit, setting the storage mode of the target data in the memory, wherein the target data is the data stored in the target storage unit;
[0356] The above-mentioned storage device 1401 can also be used to read target data from a target storage unit and store the target data in memory according to the target optimization strategy when a target optimization strategy corresponding to a target load pattern has been created; and to generate a target optimization strategy according to the target load pattern when a target optimization strategy corresponding to a target load pattern has not been created, and to read target data from a target storage unit and store the target data in memory according to the target optimization strategy.
[0357] As an implementation of the embodiment of the present application, the storage device 1401 may be specifically used for:
[0358] Determine the target storage units to be accessed when executing the data read and write instructions, and the access order between the target storage units;
[0359] Determine the access heat of each target storage unit according to the access sequence between each target storage unit;
[0360] Determine the access priority of each target storage unit according to the access popularity of each target storage unit;
[0361] The second storage method is determined as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in the order of access priority from high to low.
[0362] As an implementation method of the embodiment of the present application, the host computer 1402 may also be used to send a target data read and write command to the storage device 1401;
[0363] The storage device 1401 may also be used to respond to a target data read or write command according to a target L2P mapping table entry stored in the memory.
[0364] As an implementation of an embodiment of the present application, the target optimization strategy may further include: clearing L2P mapping table entries from the memory in order of access priority of the L2P mapping table entries from low to high. The storage device 1401 may be specifically used for:
[0365] When responding to a subcommand in a target data read / write command, if a first L2P mapping table entry is stored in the memory, responding to the subcommand according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry recording a physical address of a first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand;
[0366] When responding to a sub-command in a target data read or write command, if the first L2P mapping table entry is not stored in the memory, some L2P mapping table entries are cleared from the memory in order of access priority from low to high, and the first L2P mapping table entry is stored in the memory, and the sub-command is responded to according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry that records the physical address of the first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the sub-command.
[0367] As an implementation of an embodiment of the present application, the above-mentioned target optimization strategy may also include: clearing data stored in the storage unit from the memory in order of the access priority of the storage unit from low to high; the above-mentioned storage device 1401 may be specifically used for:
[0368] When responding to a subcommand in a target data read / write command, if first data is stored in the memory, responding to the subcommand according to the data stored in the memory, wherein the first data is data stored in a storage unit that needs to be accessed to execute the subcommand;
[0369] When responding to a sub-command in a target data read or write command, if the first data is not stored in the memory, the data stored in some storage units are cleared from the memory in order of access priority from low to high, and the first data is stored in the memory, and the sub-command is responded to based on the data stored in the memory, wherein the first data is the data stored in the storage unit that needs to be accessed to execute the sub-command.
[0370] As an implementation of an embodiment of the present application, the storage device 1401 includes multiple storage grains, each storage grain includes multiple storage units; the target optimization strategy may also include: aggregating sub-commands for the same storage grain in the data read and write commands; the storage device 1401 may be specifically used for:
[0371] Before responding to the current subcommand in the target data read / write command, determining the target storage grain to which the storage unit to be accessed in response to the current subcommand belongs;
[0372] According to the data read / write instruction, determining whether there is a target subcommand in the subsequent subcommands in the target data read / write command, wherein the storage grain to which the storage unit to be accessed in response to the target subcommand belongs is the target storage grain;
[0373] If it exists, do not respond to the current subcommand. After receiving the target subcommand, aggregate the current subcommand with the target subcommand to obtain the aggregated subcommand and respond to the aggregated subcommand.
[0374] As an implementation method of the embodiment of the present application, the host computer 1402 may also be used to respond to the start of an object requesting data reading and writing, and determine whether a target load mode corresponding to the object has been created;
[0375] The host computer 1402 may be specifically configured to send a target load pattern to the storage device 1401 when a target load pattern corresponding to an object has been created.
[0376] As an implementation of the embodiment of the present application, the host computer 1402 may also be used for:
[0377] When the target load mode corresponding to the object is not created, in response to sending a target data read / write command to the storage device 1401, obtaining a data read / write instruction executed by the storage device 1401 in the process of responding to the target data read / write command;
[0378] Generates a target load pattern based on data read and write instructions.
[0379] As an implementation of the embodiment of the present application, the host computer 1402 may also be used for:
[0380] In response to sending a target data read / write command to the storage device 1401, obtaining a data read / write instruction actually executed by the storage device 1401 in the process of responding to the target data read / write command;
[0381] When the data read / write instruction is inconsistent with the actually executed data read / write instruction, the target load mode is updated to the actually executed data read / write instruction.
[0382] The present application also provides a storage device, such as Fig.15 As shown, including:
[0383] Memory 1501, used for storing computer programs;
[0384] The processor 1502 is used to implement the data processing method applied to the storage device described in any of the above embodiments when executing the program stored in the memory 1501.
[0385] In the solution provided by the embodiment of the present application, the storage device can obtain the target load mode sent by the host computer, wherein the target load mode includes: the data read and write instructions that the storage device needs to execute when responding to the target data read and write commands of the host computer; determine whether the target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage method of the target L2P mapping table item in the memory is set, the target storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table item is the L2P mapping table item that records the physical address of the target storage unit; if it has been created, according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory; if it has not been created, generate the target optimization strategy according to the target load mode, and according to the target optimization strategy, determine the target L2P mapping table item from the L2P mapping table, and store the target L2P mapping table item in the memory. Since the solution provided by the embodiment of the present application obtains and analyzes the target load pattern sent by the host computer in advance, and generates or applies the existing target optimization strategies in a targeted manner, these target optimization strategies can optimize the storage method of L2P mapping table items in the memory according to the target storage unit and the access order of the target storage unit. By intelligently preloading and caching the necessary L2P mapping table items, the need for real-time query and swapping in and out of L2P mapping table items is reduced, thereby significantly reducing the time to respond to read and write commands and improving the efficiency of data processing.
[0386] The present application also provides a host computer, such as Fig.16 As shown, including:
[0387] Memory 1601, used for storing computer programs;
[0388] The processor 1602 is used to implement the data processing method applied to the host computer described in any of the above embodiments when executing the program stored in the memory 1601.
[0389] In the solution provided by the embodiment of the present application, by pre-recording and establishing the relationship between the object requesting data read and write and its corresponding load pattern in the host computer, when the object is started, the host computer can quickly identify and determine whether there is a created load pattern. Once confirmed, the host computer immediately sends the target load pattern to the storage device, so that the storage device can pre-fetch and cache the necessary L2P mapping table items from the L2P mapping table to the memory in advance according to the optimization strategy. This method significantly reduces the processing time of the storage device when receiving a specific read and write command.
[0390] Furthermore, the storage device / host computer may further include a communication bus and / or a communication interface, and the processor xx2, the communication interface, and the memory xx1 communicate with each other via the communication bus.
[0391] The communication bus mentioned in the storage device / host computer can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0392] The communication interface is used for communication between the above storage device / host computer and other devices.
[0393] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0394] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0395] In another embodiment provided in the present application, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, it implements the data processing method applied to the storage device described in any of the above embodiments or the data processing method applied to the host computer described in any of the above embodiments.
[0396] In another embodiment provided in the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute the data processing method applied to a storage device described in any of the above embodiments or the data processing method applied to a host computer described in any of the above embodiments.
[0397] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0398] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0399] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, system, storage device, host computer, computer-readable storage medium and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0400] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A data processing method, characterized in that: Applied to a storage device, the method comprises: Acquire a target load mode sent by the host computer, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command of the host computer; Determining whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access order between each target storage unit, the target storage unit is a storage unit that the storage device needs to access when executing the data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit; If it has been created, determining the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and storing the target L2P mapping table entry in the memory; If not created, the target optimization strategy is generated according to the target load mode, and the target L2P mapping table entry is determined from the L2P mapping table according to the target optimization strategy, and the target L2P mapping table entry is stored in the memory.
2. The method according to claim 1, characterized in that The method for generating the target optimization strategy includes: Determine the target storage units that need to be accessed to execute the data read and write instructions, and the access order between the target storage units; Determine a target L2P mapping table entry recording the physical address of the target storage unit, and determine an access order between each target L2P mapping table entry according to an access order between each target storage unit; Determining the access heat of each target L2P mapping table entry according to the access order between each target L2P mapping table entry; Determine the access priority of each target L2P mapping table entry according to the access popularity of each target L2P mapping table entry; A first storage method is determined as a target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table entry into the memory in a descending order of access priority.
3. The method according to claim 2, characterized in that Before determining the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry, the method further includes: Determining whether a target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read / write instruction operating on the target storage unit is a write instruction; The step of determining the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry includes: The access priority of each target L2P mapping table entry is determined according to the access popularity of each target L2P mapping table entry and whether it needs to be modified.
4. The method according to claim 1, characterized in that: The target optimization strategy also includes: according to the target storage unit and the access sequence between each target storage unit, setting the storage mode of the target data in the memory, wherein the target data is the data stored in the target storage unit; After determining whether the target optimization strategy corresponding to the target load mode has been created, the method further includes: If it has been created, according to the target optimization strategy, read the target data from the target storage unit and store the target data in the memory; If not created, the target optimization strategy is generated according to the target load mode, and according to the target optimization strategy, the target data is read from the target storage unit and the target data is stored in the memory.
5. The method according to claim 4, characterized in that The method for generating the target optimization strategy includes: Determine the target storage units that need to be accessed to execute the data read and write instructions, and the access order between the target storage units; Determine the access heat of each target storage unit according to the access sequence between each target storage unit; Determine the access priority of each target storage unit according to the access popularity of each target storage unit; The second storage method is determined as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in the order of access priority from high to low.
6. The method according to any one of claims 1 to 5, characterized in that: After storing the target L2P mapping table entry in the memory, the method further includes: Obtaining the target data read and write command sent by the host computer; The target data read / write command is responded to according to the target L2P mapping table entry stored in the memory.
7. The method according to claim 6, characterized in that The target optimization strategy further includes: clearing L2P mapping table entries from the memory in order of access priorities of the L2P mapping table entries from low to high, and responding to the target data read and write command according to the target L2P mapping table entry stored in the memory, including: When responding to a subcommand in the target data read / write command, if a first L2P mapping table entry is stored in the memory, responding to the subcommand according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry recording a physical address of a first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand; or, When responding to a subcommand in the target data read / write command, if the first L2P mapping table entry is not stored in the memory, some L2P mapping table entries are cleared from the memory in order of access priority from low to high, and the first L2P mapping table entry is stored in the memory, and the subcommand is responded to according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry that records the physical address of a first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand.
8. The method according to claim 6, characterized in that The target optimization strategy also includes: clearing data stored in the storage unit from the memory in order of the access priority of the storage unit from low to high; and responding to the target data read and write command includes: When responding to a subcommand in the target data read / write command, if first data is stored in the memory, responding to the subcommand according to the data stored in the memory, wherein the first data is data stored in a storage unit that needs to be accessed to execute the subcommand; or, When responding to the sub-command in the target data read and write command, if the first data is not stored in the memory, the data stored in some storage units are cleared from the memory in order of access priority from low to high, and the first data are stored in the memory, and the sub-command is responded to based on the data stored in the memory, wherein the first data is the data stored in the storage unit that needs to be accessed to execute the sub-command.
9. The method according to claim 6, characterized in that The storage device includes a plurality of storage grains, each of which includes a plurality of storage units; The target optimization strategy further includes: aggregating sub-commands for the same storage die in the data read / write command; and responding to the target data read / write command includes: Before responding to the current subcommand in the target data read / write command, determining the target storage grain to which the storage unit to be accessed in response to the current subcommand belongs; According to the data read / write instruction, determining whether there is a target subcommand in the subsequent subcommands in the target data read / write command, wherein the storage grain to which the storage unit to be accessed in response to the target subcommand belongs is the target storage grain; If it exists, do not respond to the current subcommand. After receiving the target subcommand, aggregate the current subcommand with the target subcommand to obtain an aggregated subcommand and respond to the aggregated subcommand.
10. A data processing method, characterized in that: Applied to a host computer, the method comprises: In response to the object startup requesting data read and write, determining whether a target load mode corresponding to the object has been created, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command of the host computer, and the target data read and write command is a data read and write command generated by the host computer for the object; If it has been created, the target load mode is sent to the storage device so that the storage device determines the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy corresponding to the target load mode, and stores the target L2P mapping table entry in the memory, wherein the target optimization strategy includes: a storage method of the target L2P mapping table entry in the memory is set according to the target storage unit and the access order between each target storage unit, the target storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table entry is an L2P mapping table entry that records the physical address of the target storage unit.
11. The method according to claim 10, characterized in that After determining whether the target load mode corresponding to the object has been created, the method further includes: If not created, in response to sending a target data read / write command to a storage device, obtaining a data read / write instruction executed by the storage device in response to the target data read / write command; The target load pattern is generated based on the data read and write instructions.
12. The method according to claim 10, characterized in that After sending the target load pattern to the storage device, the method further includes: In response to sending a target data read / write command to a storage device, obtaining a data read / write instruction actually executed by the storage device in a process of responding to the target data read / write command; When the data read / write instruction is inconsistent with the actually executed data read / write instruction, the target load mode is updated to the actually executed data read / write instruction.
13. A data processing device, characterized in that: Applied to a storage device, the device comprises: A load mode acquisition module, used to acquire a target load mode sent by a host computer, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command of the host computer; A first judgment module is used to judge whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access sequence between each target storage unit, the target storage unit is a storage unit that the storage device needs to access when executing the data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit; a first mapping table entry storage module, configured to determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy when the judgment result of the first judgment module is yes, and store the target L2P mapping table entry in the memory; The second mapping table entry storage module is used to generate the target optimization strategy according to the target load mode when the judgment result of the first judgment module is no, and determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and store the target L2P mapping table entry in the memory.
14. The device according to claim 13, characterized in that The second mapping table item storage module includes: a first storage unit determination unit, used to determine the target storage unit to be accessed for executing the data read and write instruction, and the access order between each target storage unit; a mapping table item determination unit, used to determine the target L2P mapping table item recording the physical address of the target storage unit, and determine the access order between each target L2P mapping table item according to the access order between each target storage unit; a first access heat determination unit, used to determine the access heat of each target L2P mapping table item according to the access order between each target L2P mapping table item; a first access priority determination unit, used to determine the access priority of each target L2P mapping table item according to the access heat of each target L2P mapping table item; a first target optimization strategy determination unit, used to determine the first storage method as the target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table item in the memory in the order of access priority from high to low; or, The second mapping table entry storage module further includes: a modification determination unit, configured to determine whether the target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read and write instruction operating on the target storage unit is a write instruction; the access priority determination unit, specifically configured to determine the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry and whether it needs to be modified; or, The target optimization strategy also includes: a storage method of the target data in the memory is set according to the target storage unit and the access order between each target storage unit, wherein the target data is the data stored in the target storage unit; the device also includes: a first data storage module, which is used to read the target data from the target storage unit according to the target optimization strategy and store the target data in the memory; a second data storage module, which is used to generate the target optimization strategy according to the target load mode, and read the target data from the target storage unit according to the target optimization strategy and store the target data in the memory; or, The second data storage module includes: a second storage unit determination unit, used to determine the target storage unit to be accessed for executing the data read and write instruction, and the access order between the target storage units; a second access heat determination unit, used to determine the access heat of each target storage unit according to the access order between the target storage units; a second access priority determination unit, used to determine the access priority of each target storage unit according to the access heat of each target storage unit; a second target optimization strategy determination unit, used to determine the second storage method as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in the order of access priority from high to low; or, The device further comprises: a read / write command acquisition module, used to acquire the target data read / write command sent by the host computer; a read / write command response module, used to respond to the target data read / write command according to the target L2P mapping table entry stored in the memory; or, The target optimization strategy also includes: clearing L2P mapping table items from the memory in order of access priority of the L2P mapping table items from low to high, and the read / write command response module is specifically used to: when responding to a subcommand in the target data read / write command, if a first L2P mapping table item is stored in the memory, respond to the subcommand according to the L2P mapping table item stored in the memory, wherein the first L2P mapping table item is an L2P mapping table item that records the physical address of a first storage unit, and the first storage unit is a physical address that needs to be accessed to execute the subcommand. storage unit; when responding to a subcommand in the target data read / write command, if the first L2P mapping table entry is not stored in the memory, clear some L2P mapping table entries from the memory in order of access priority from low to high, and store the first L2P mapping table entry in the memory, and respond to the subcommand according to the L2P mapping table entry stored in the memory, wherein the first L2P mapping table entry is an L2P mapping table entry recording a physical address of the first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand; or, The target optimization strategy also includes: clearing data stored in the storage unit from the memory in order of access priority from low to high; the read / write command response module is specifically used to: when responding to a subcommand in the target data read / write command, if the memory stores first data, respond to the subcommand according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the subcommand; when responding to a subcommand in the target data read / write command, if the memory does not store the first data, clearing data stored in part of the storage unit from the memory in order of access priority from low to high, and storing the first data in the memory, and responding to the subcommand according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the subcommand; or, The storage device includes multiple storage grains, each storage grain includes multiple storage units; the target optimization strategy also includes: aggregating sub-commands for the same storage grain in the data read and write commands; the read and write command response module is specifically used to: before responding to the current sub-command in the target data read and write command, determine the target storage grain to which the storage unit required to be accessed in response to the current sub-command belongs; based on the data read and write instructions, determine whether there is a target sub-command in the subsequent sub-commands in the target data read and write command, wherein the storage grain to which the storage unit required to be accessed in response to the target sub-command belongs is the target storage grain; if so, do not respond to the current sub-command, and after receiving the target sub-command, aggregate the current sub-command with the target sub-command to obtain an aggregated sub-command and respond to the aggregated sub-command.
15. A data processing device, characterized in that: Applied to a host computer, the device comprises: A second judgment module is configured to judge whether a target load mode corresponding to the object has been created in response to the object startup requesting data reading and writing, wherein the target load mode includes: data reading and writing instructions that the storage device needs to execute when responding to the target data reading and writing command of the host computer, and the target data reading and writing command is a data reading and writing command generated by the host computer for the object; A load mode sending module is used to send the target load mode to the storage device when the judgment result of the second judgment module is yes, so that the storage device determines the target L2P mapping table item from the L2P mapping table according to the target optimization strategy corresponding to the target load mode, and stores the target L2P mapping table item in the memory, wherein the target optimization strategy includes: according to the target storage unit and the access order between each target storage unit, the storage unit is the storage unit that the storage device needs to access when executing the data read and write instructions, and the target L2P mapping table item is an L2P mapping table item that records the physical address of the target storage unit.
16. The device according to claim 15, characterized in that The device also includes: a load pattern generating module, configured to, when the judgment result of the second judging module is no, in response to sending a target data read / write command to the storage device, obtain a data read / write instruction executed by the storage device in response to the target data read / write command; and generate the target load pattern based on the data read / write instruction; or, The device also includes: a load mode update module, which is used to respond to sending a target data read and write command to the storage device, obtain the data read and write instructions actually executed by the storage device in responding to the target data read and write command; when the data read and write instructions are inconsistent with the actually executed data read and write instructions, update the target load mode to the actually executed data read and write instructions.
17. A data processing system, characterized in that: The data processing system includes a storage device and a host computer; The host computer is used to send a target load mode to the storage device, wherein the target load mode includes: data read and write instructions that the storage device needs to execute when responding to a target data read and write command from the host computer; The storage device is used to determine whether a target optimization strategy corresponding to the target load mode has been created, wherein the target optimization strategy includes: a storage method of a target L2P mapping table entry in a memory is set according to a target storage unit and an access sequence between each target storage unit, the target storage unit is a storage unit that the storage device needs to access when executing the data read and write instruction, and the target L2P mapping table entry is an L2P mapping table entry that records a physical address of the target storage unit; The storage device is further configured to determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy when the target optimization strategy corresponding to the target load mode has been created, and store the target L2P mapping table entry in the memory; The storage device is also used to generate the target optimization strategy according to the target load mode when the target optimization strategy corresponding to the target load mode is not created, and determine the target L2P mapping table entry from the L2P mapping table according to the target optimization strategy, and store the target L2P mapping table entry in the memory.
18. The system according to claim 17, characterized in that The storage device is specifically used to determine the target storage unit that needs to be accessed to execute the data read and write instruction, and the access order between each target storage unit; determine the target L2P mapping table entry that records the physical address of the target storage unit, and determine the access order between each target L2P mapping table entry according to the access order between each target storage unit; determine the access heat of each target L2P mapping table entry according to the access order between each target L2P mapping table entry; determine the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry; Determine a first storage method as a target optimization strategy corresponding to the target load mode, wherein the first storage method is to store each target L2P mapping table entry into a memory in a descending order of access priority; or, The storage device is further used to determine whether the target L2P mapping table entry corresponding to the target storage unit needs to be modified according to whether the data read and write instructions operating on the target storage unit are write instructions before determining the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry; the storage device is specifically used to determine the access priority of each target L2P mapping table entry according to the access heat of each target L2P mapping table entry and whether it needs to be modified; or, The target optimization strategy also includes: a storage method of the target data in the memory is set according to the target storage unit and the access order between each target storage unit, wherein the target data is the data stored in the target storage unit; the storage device is also used to read the target data from the target storage unit according to the target optimization strategy when the target optimization strategy corresponding to the target load mode has been created, and store the target data in the memory; when the target optimization strategy corresponding to the target load mode has not been created, generate the target optimization strategy according to the target load mode, read the target data from the target storage unit according to the target optimization strategy, and store the target data in the memory; or, The storage device is specifically used to determine the target storage unit that needs to be accessed to execute the data read and write instruction, and the access order between the target storage units; determine the access heat of each target storage unit according to the access order between the target storage units; determine the access priority of each target storage unit according to the access heat of each target storage unit; determine the second storage method as the target optimization strategy corresponding to the target load mode, wherein the second storage method is to store the target data stored in each target storage unit into the memory in the order of access priority from high to low; or, The host computer is further used to send the target data read and write command to the storage device; the storage device is further used to respond to the target data read and write command according to the target L2P mapping table entry stored in the memory; or, The target optimization strategy also includes: clearing L2P mapping table items from the memory in order of access priority from low to high, the storage device is specifically used to, when responding to the subcommand in the target data read / write command, if the first L2P mapping table item is stored in the memory, respond to the subcommand according to the L2P mapping table item stored in the memory, wherein the first L2P mapping table item is an L2P mapping table item recording the physical address of the first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand; when responding to the subcommand in the target data read / write command, if the first L2P mapping table item is not stored in the memory, clearing some L2P mapping table items from the memory in order of access priority from low to high, and storing the first L2P mapping table item in the memory, and responding to the subcommand according to the L2P mapping table item stored in the memory, wherein the first L2P mapping table item is an L2P mapping table item recording the physical address of the first storage unit, and the first storage unit is a storage unit that needs to be accessed to execute the subcommand; or, The target optimization strategy also includes: clearing data stored in the storage unit from the memory in order of access priority from low to high; the storage device is specifically used to, when responding to a sub-command in the target data read / write command, if first data is stored in the memory, respond to the sub-command according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the sub-command; when responding to the sub-command in the target data read / write command, if the first data is not stored in the memory, clearing data stored in part of the storage unit from the memory in order of access priority from low to high, and storing the first data in the memory, and responding to the sub-command according to the data stored in the memory, wherein the first data is data stored in the storage unit that needs to be accessed to execute the sub-command; or, The storage device includes a plurality of storage grains, each of which includes a plurality of storage units; the target optimization strategy also includes: aggregating subcommands for the same storage grain in the data read / write command; the storage device is specifically used to determine, before responding to the current subcommand in the target data read / write command, the target storage grain to which the storage unit to be accessed in response to the current subcommand belongs; according to the data read / write instruction, determine whether there is a target subcommand in the subsequent subcommands in the target data read / write command, wherein the storage grain to which the storage unit to be accessed in response to the target subcommand belongs is the target storage grain; if so, do not respond to the current subcommand, and after receiving the target subcommand, aggregate the current subcommand with the target subcommand to obtain an aggregated subcommand and respond to the aggregated subcommand; or, The host computer is further used to respond to the start of the object requesting data reading and writing, and to determine whether the target load mode corresponding to the object has been created; the host computer is specifically used to send the target load mode to the storage device when the target load mode corresponding to the object has been created; or, The host computer is further used for, when the target load mode corresponding to the object is not created, in response to sending a target data read / write command to the storage device, obtaining a data read / write instruction executed by the storage device in response to the target data read / write command; and generating the target load mode based on the data read / write instruction; or, The host computer is also used to respond to sending a target data read and write command to the storage device, obtain the data read and write instructions actually executed by the storage device in responding to the target data read and write command; when the data read and write instructions are inconsistent with the actually executed data read and write instructions, update the target load mode to the actually executed data read and write instructions.
19. A storage device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-9 when executing a program stored in a memory.
20. A host computer, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 10-12 when executing a program stored in a memory.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 9 or the method described in any one of claims 10 to 12 is implemented.