CN116610259A - Method, system, storage medium and equipment for writing data based on solid state disk - Google Patents

Method, system, storage medium and equipment for writing data based on solid state disk Download PDF

Info

Publication number
CN116610259A
CN116610259A CN202310575804.3A CN202310575804A CN116610259A CN 116610259 A CN116610259 A CN 116610259A CN 202310575804 A CN202310575804 A CN 202310575804A CN 116610259 A CN116610259 A CN 116610259A
Authority
CN
China
Prior art keywords
data
metadata
solid state
granularity
state disk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310575804.3A
Other languages
Chinese (zh)
Inventor
呼元伟
张晨
杨翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202310575804.3A priority Critical patent/CN116610259A/en
Publication of CN116610259A publication Critical patent/CN116610259A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The application provides a method, a system, a storage medium and equipment for writing data based on a solid state disk, wherein the method comprises the following steps: configuring a data source address and a metadata source address for the DMA, the data source address and the metadata source address corresponding to the source data and the total metadata respectively, the source data including a plurality of granularity data, the total metadata including a plurality of metadata corresponding to the granularity data, and configuring a data destination address corresponding to the granularity data and a metadata destination address corresponding to the metadata; and moving the source data from the host to the solid state disk through the DMA based on the data source address and the data destination addresses to form a plurality of granularity data distributed at intervals, moving the total metadata from the host to the solid state disk based on the metadata source address and the metadata destination addresses to form a plurality of metadata distributed at intervals, so that the granularity data and the metadata are arranged at intervals, and completing the data writing request of the designated storage block in the solid state disk. The application can rapidly realize the format of interleaving the data and the metadata required by the subsequent flow.

Description

Method, system, storage medium and equipment for writing data based on solid state disk
Technical Field
The present application relates to the field of storage technologies, and in particular, to a method, a system, a storage medium, and an apparatus for writing data based on a solid state disk.
Background
Due to the existence of channel noise, data errors may be caused between a host and an SSD (Solid State Disk); in addition, data may also be erroneous between the controller and the flash memory inside the SSD. To ensure data integrity between the host and flash memory, the NVME (NVM Express, nonvolatile memory host controller interface specification) protocol provides an end-to-end data protection function. In addition to the logical block data itself, the NVME also allows each logical block data to carry metadata (meta data), which the NVME protocol does not explicitly require, but which is required to take on auxiliary and protection functions.
After formatting, SSD has a granularity of 512 bytes or 4K, etc. Taking a 512byte sector granularity as an example, for a 512+8 disk format, each 512byte (bytes) of user data is accompanied by an 8byte metadata. Fig. 1 is a schematic diagram of a structure for writing data from a host to a solid state disk according to the prior art. As shown in fig. 1, when host writes 4096 bytes of data to SSD, 8 512 bytes and 8 bytes of metadata need to be transferred, and the conventional processing method is to first move 8 512 bytes of user data to the first 4096 bytes of the write buffer, and then move 8 512 bytes of user data to the back of 4096 bytes of user data.
The data is arranged in 512 bytes of 8 and 8 bytes of metadata are arranged together, and when PI (Protection Information ) is to be checked by the DPU (Data Processing Subsystem ), it is necessary to convert the data into 512+8 interleaved format (i.e. each 512byte of data is followed by one 8byte of metadata), which clearly increases the complexity of data processing. The formats required for DPU verification currently lack an efficient way of processing.
Disclosure of Invention
In view of the above, the present application aims to provide a method, a system, a storage medium and a device for writing data based on a solid state disk, which are used for solving the problems of complex and inefficient data processing caused by difficulty in forming a format of interleaving granularity data and metadata when writing data from a host to the solid state disk in the prior art.
Based on the above purpose, the application provides a method for writing data based on a solid state disk, which comprises the following steps:
configuring a data source address and a metadata source address for the DMA, the data source address and the metadata source address corresponding to the source data and the total metadata respectively, the source data including a plurality of granularity data, the total metadata including a plurality of metadata corresponding to the granularity data, and configuring a data destination address corresponding to the granularity data and a metadata destination address corresponding to the metadata;
moving source data from a host to a solid state disk through DMA (direct memory access) based on a data source address and a plurality of data destination addresses to form a plurality of granularity data distributed at intervals, and moving total metadata from the host to the solid state disk based on a metadata source address and a plurality of metadata destination addresses to form a plurality of metadata distributed at intervals so as to enable the granularity data and the metadata to be arranged at intervals;
and finishing the data writing request of the designated storage block in the solid state disk based on the granularity data and the metadata which are arranged at intervals.
In some embodiments, the method further comprises:
configuring a counter for the DMA;
in response to the source data movement being completed or the total metadata movement being completed, incrementing a counter value by one;
and until the value of the counter reaches two, determining that the source data and the total metadata are all moved.
In some embodiments, the method further comprises:
and sending the data transfer request and the metadata transfer request to the DMA in parallel, so that the DMA performs source data transfer based on the data transfer request and performs total metadata transfer based on the metadata transfer request.
In some embodiments, spacing the granularity data and the metadata includes:
each granularity data is made to carry corresponding metadata.
In some embodiments, the method further comprises:
and sending the granularity data and the metadata which are arranged at intervals to a data processing subsystem for verification.
In some embodiments, the method further comprises:
in response to the verification being complete, a data transfer completion flag is transmitted by the data processing subsystem to the host to cause the host to determine that the write data request is complete based on the transfer completion flag.
In some embodiments, moving source data from the host to the solid state disk via the DMA based on the data source address and the plurality of data destination addresses includes:
judging whether the number of the data destination addresses is larger than a preset threshold value or not;
in response to the number of the data destination addresses being greater than a preset threshold, sequentially moving source data corresponding to the data destination addresses with the preset threshold number from the host to the solid state disk through the DMA each time;
and in response to the number of the data destination addresses required by the single movement is smaller than or equal to a preset threshold, directly moving source data corresponding to the data destination addresses required by the single movement from the host to the solid state disk.
In another aspect of the present application, there is also provided a system for writing data based on a solid state disk, including:
an address configuration module configured to configure a data source address and a metadata source address for the DMA, the data source address and the metadata source address corresponding to source data and total metadata, respectively, the source data including a plurality of granularity data, the total metadata including a plurality of metadata corresponding to the granularity data, and to configure a data destination address corresponding to the granularity data and a metadata destination address corresponding to the metadata;
the moving module is configured to move the source data from the host to the solid state disk through the DMA based on the data source address and the plurality of data destination addresses to form a plurality of granularity data distributed at intervals, and move the total metadata from the host to the solid state disk based on the metadata source address and the plurality of metadata destination addresses to form a plurality of metadata distributed at intervals so as to enable the granularity data and the metadata to be arranged at intervals; and
and the write completion module is configured to complete the write data request of the specified storage block in the solid state disk based on the granularity data and the metadata which are arranged at intervals.
In yet another aspect of the present application, there is also provided a computer readable storage medium storing computer program instructions which, when executed by a processor, implement the above-described method.
In yet another aspect of the present application, there is also provided a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, performs the above method.
The application has at least the following beneficial technical effects:
according to the method for writing data based on the solid state disk, the data source address and the metadata source address respectively corresponding to the source data and the total metadata are configured for the DMA, the source data comprises a plurality of pieces of granularity data, the total metadata comprises a plurality of pieces of metadata corresponding to the granularity data, the data destination address corresponding to the granularity data and the metadata destination address corresponding to the metadata are configured, the source data is moved from the host to the solid state disk through the DMA based on the data source address and the plurality of data destination addresses, a plurality of pieces of granularity data distributed at intervals are formed, the total metadata is moved from the host to the solid state disk based on the metadata source address and the plurality of metadata destination addresses, a plurality of pieces of metadata distributed at intervals are formed, so that the granularity data and the metadata are arranged at intervals, and the data writing request of a designated storage block in the solid state disk is completed.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a structure for writing data from a host to a solid state disk according to the prior art;
FIG. 2 is a schematic diagram of a method for writing data based on a solid state disk according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a structure of a plurality of granularity data distributed at intervals according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a structure of granularity data and metadata of a granularity arrangement according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a solid state disk-based data writing system according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a computer readable storage medium implementing a method for writing data based on a solid state disk according to an embodiment of the present application;
fig. 7 is a schematic hardware structure diagram of a computer device for executing a method for writing data based on a solid state disk according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the following embodiments of the present application will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present application, all the expressions "first" and "second" are used to distinguish two non-identical entities with the same name or non-identical parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present application. Furthermore, the terms "comprise" and "have," and any variations thereof, are intended to cover a non-exclusive inclusion, such as a process, method, system, article, or other step or unit that comprises a list of steps or units.
Based on the above object, in a first aspect of the embodiments of the present application, an embodiment of a method for writing data based on a solid state disk is provided. Fig. 2 is a schematic diagram of an embodiment of a method for writing data based on a solid state disk according to the present application. As shown in fig. 2, the embodiment of the present application includes the following steps:
step S10, configuring a data source address and a metadata source address corresponding to source data and total metadata respectively for the DMA, wherein the source data comprises a plurality of granularity data, the total metadata comprises a plurality of metadata corresponding to the granularity data, and configuring a data destination address corresponding to the granularity data and a metadata destination address corresponding to the metadata;
step S20, moving source data from a host to a solid state disk through DMA (direct memory access) based on a data source address and a plurality of data destination addresses to form a plurality of granularity data distributed at intervals, and moving total metadata from the host to the solid state disk based on a metadata source address and a plurality of metadata destination addresses to form a plurality of metadata distributed at intervals so as to enable the granularity data and the metadata to be arranged at intervals;
and step S30, completing the data writing request of the designated storage block in the solid state disk based on the granularity data and the metadata which are arranged at intervals.
DMA (Direct Memory Access ) is a function provided by some computer bus architecture that enables data to be sent directly from an attached device (e.g., disk drive) to the memory of a computer motherboard. DMA transfers are often used to copy a memory area from one device to another. Another option for Direct Memory Access (DMA) is a Programmed Input Output (PIO) interface. In a programmable input-output interface, all data transfer between devices is through the processor.
According to the method for writing data based on the solid state disk, the data source address and the metadata source address respectively corresponding to the source data and the total metadata are configured for the DMA, the source data comprises a plurality of pieces of granularity data, the total metadata comprises a plurality of pieces of metadata corresponding to the granularity data, the data destination address corresponding to the granularity data and the metadata destination address corresponding to the metadata are configured, the source data is moved from the host to the solid state disk through the DMA based on the data source address and the plurality of data destination addresses, a plurality of pieces of granularity data distributed at intervals are formed, the total metadata is moved from the host to the solid state disk based on the metadata source address and the plurality of metadata destination addresses, a plurality of pieces of metadata distributed at intervals are formed, so that the granularity data and the metadata are arranged at intervals, and the data writing request of a designated storage block in the solid state disk is completed.
In some embodiments, spacing the granularity data and the metadata includes: each granularity data is made to carry corresponding metadata.
In this embodiment, each piece of granularity data is followed by corresponding metadata for assisting and protecting the granularity data.
In addition, in order to realize granularity data and metadata interval arrangement, in the address setting stage of the DMA, the address interval arrangement of the data destination address and the metadata destination address is set, which is beneficial to guiding the DMA.
In some embodiments, moving source data from the host to the solid state disk via the DMA based on the data source address and the plurality of data destination addresses includes: judging whether the number of the data destination addresses is larger than a preset threshold value or not; in response to the number of the data destination addresses being greater than a preset threshold, sequentially moving source data corresponding to the data destination addresses with the preset threshold number from the host to the solid state disk through the DMA each time; and in response to the number of the data destination addresses required by the single movement is smaller than or equal to a preset threshold, directly moving source data corresponding to the data destination addresses required by the single movement from the host to the solid state disk.
In this embodiment, if the number of destination addresses of data gradually decreases to be less than or equal to a preset threshold value in the DMA transfer process, source data corresponding to the remaining destination addresses of data is directly transferred from the host to the solid state disk.
In some embodiments, the solid state disk is a formatted solid state disk.
In some embodiments, the source data is 4096 bytes in size and the total metadata is 64 bytes in size; the size of the granularity data is 512 bytes, and the size of the metadata is 8 bytes.
In this embodiment, after the solid state disk is formatted, the granularity data may be 512 bytes (bytes) or 4K. If the granularity data is 512 bytes, the corresponding metadata may be 8 bytes.
Because the DPU (Data Processing Subsystem ) requires a 512+8 interleaved data format, embodiments of the present application shift and arrange the data into a 512+8 interleaved format when the DMA shifts the data. Fig. 4 is a schematic structural diagram of granularity data and metadata of a granularity arrangement according to an embodiment of the present application. As shown in fig. 4, each 512byte data is followed by one 8byte metadata.
In some embodiments, the method further comprises: and sending the granularity data and the metadata which are arranged at intervals to a data processing subsystem for verification.
In some embodiments, the method further comprises: in response to the verification being complete, a data transfer completion flag is transmitted by the data processing subsystem to the host to cause the host to determine that the write data request is complete based on the transfer completion flag.
In this embodiment, after the granularity data and metadata are moved, the granularity data and metadata arranged at intervals may be directly sent to the data processing subsystem for verification. Taking the structure shown in fig. 4 as an example, 8 512+8 interleaving formats can be directly sent to the DPU, so that the flow of data conversion is reduced, and the data processing speed is improved. After the verification is completed, the data processing subsystem transmits a data transfer completion flag to the host, so that the host determines that the data writing request is completed based on the transfer completion flag, and the efficiency of completing the data writing request can be improved.
In some embodiments, the method further comprises: configuring a counter for the DMA; in response to the source data movement being completed or the total metadata movement being completed, incrementing a counter value by one; and until the value of the counter reaches two, determining that the source data and the total metadata are all moved.
In this embodiment, by configuring a counter for DMA to determine whether all of the source data and the total metadata are moved, it is beneficial to monitor the moving process, and further improves efficiency.
In some embodiments, the method further comprises: and sending the data transfer request and the metadata transfer request to the DMA in parallel, so that the DMA performs source data transfer based on the data transfer request and performs total metadata transfer based on the metadata transfer request.
In this embodiment, for the two processes of moving the user's data and moving the metadata, by sending the data moving request and the metadata moving request in parallel, the source data moving and the total metadata moving can be performed in parallel, and the efficiency of DMA moving the source data and the total metadata is improved.
Fig. 3 is a schematic structural diagram of granularity data of multiple interval distributions according to an embodiment of the present application. As shown in fig. 3-4, an exemplary embodiment of the solid state disk-based data writing method of the present application is as follows:
1) The DMA controlled by the processor can be used for configuring the functions of a plurality of data addresses at a time, and data movement is performed in two steps;
2) The method comprises the steps of firstly, configuring a data source address and 8 data destination addresses, wherein the source data is 4096 bytes, the granularity data length corresponding to each data destination address is 512 bytes, and initiating DMA to carry in 8 user data of 512 bytes;
3) And secondly, configuring a metadata source address and 8 metadata destination addresses, wherein the total metadata is configured to be 64 bytes, the metadata length corresponding to each metadata destination address is configured to be 8 bytes, and initiating DMA (direct memory access) to insert and move the metadata of 8 bytes into the empty space of FIG. 3 once to obtain the structure shown in FIG. 4.
4) Through the two steps of data, the data are arranged into an interleaving format supported by the DPU, so that 8 data of 512+8 can be sent to the DPU at one time, and the DPU can perform subsequent flow after finishing verification.
In another embodiment, after the DMA moves the source data, the host and the host do not need to be notified to issue the metadata movement request again, but the metadata movement request can be immediately fetched from the message request queue to move the total metadata. In the completion_call_back function, the data and metadata are moved back to be switched back to the state machine, and the specific implementation can be that if (512+8= lbaf) & (2= dm_cpl_cnt) is judged in the completion_call_back function by adding a dma_cpl_cnt counter, and then the data and metadata are switched back to the state machine. The embodiment has the advantages that the DMA can process the request for moving the metadata after processing the request for moving the user data, and the processing efficiency is high.
In a second aspect of the embodiment of the application, a system for writing data based on a solid state disk is also provided. Fig. 5 is a schematic diagram of an embodiment of a solid state disk-based data writing system provided by the present application. As shown in fig. 5, a solid state disk-based data writing system includes: an address configuration module 10 configured to configure a data source address and a metadata source address corresponding to source data and total metadata, respectively, for the DMA, the source data including a plurality of granularity data, the total metadata including a plurality of metadata corresponding to the granularity data, and to configure a data destination address corresponding to the granularity data and a metadata destination address corresponding to the metadata; a moving module 20 configured to move source data from the host to the solid state disk based on the data source address and the plurality of data destination addresses through the DMA to form a plurality of granularity data distributed at intervals, and move total metadata from the host to the solid state disk based on the metadata source address and the plurality of metadata destination addresses to form a plurality of metadata distributed at intervals, so that the granularity data and the metadata are arranged at intervals; and a write completion module 30 configured to complete a write data request for a specified memory block in the solid state disk based on the granularity data and the metadata arranged at intervals.
According to the solid state disk-based data writing system, the data source address and the metadata source address respectively corresponding to the source data and the total metadata are configured for the DMA, the source data comprises a plurality of pieces of granularity data, the total metadata comprises a plurality of pieces of metadata corresponding to the granularity data, the data destination address corresponding to the granularity data and the metadata destination address corresponding to the metadata are configured, the source data is moved from the host to the solid state disk through the DMA based on the data source address and the plurality of data destination addresses, a plurality of pieces of granularity data distributed at intervals are formed, the total metadata is moved from the host to the solid state disk based on the metadata source address and the plurality of metadata destination addresses, a plurality of pieces of metadata distributed at intervals are formed, so that the granularity data and the metadata are arranged at intervals, and the data writing request of a storage block in the solid state disk is completed.
In some embodiments, the system further comprises a counting module configured to configure the counter for the DMA; in response to the source data movement being completed or the total metadata movement being completed, incrementing a counter value by one; and until the value of the counter reaches two, determining that the source data and the total metadata are all moved.
In some embodiments, the system further comprises a move request module configured to send the data move request and the metadata move request in parallel to the DMA, to cause the DMA to source the data move based on the data move request, and to perform the total metadata move based on the metadata move request.
In some embodiments, movement module 20 includes a spacer module configured to cause each piece of granularity data to carry corresponding metadata.
In some embodiments, the system further comprises a verification module configured to send the granularity data and metadata of the interval arrangement to the data processing subsystem for verification.
In some embodiments, the system further comprises a write data request completion module configured to communicate, by the data processing subsystem, a data movement completion flag to the host in response to the verification completion, to cause the host to determine completion of the write data request based on the movement completion flag.
In some embodiments, the moving module 20 includes a determining module configured to determine whether the number of destination addresses of data is greater than a preset threshold; in response to the number of the data destination addresses being greater than a preset threshold, sequentially moving source data corresponding to the data destination addresses with the preset threshold number from the host to the solid state disk through the DMA each time; and in response to the number of the data destination addresses required by the single movement is smaller than or equal to a preset threshold, directly moving source data corresponding to the data destination addresses required by the single movement from the host to the solid state disk.
In some embodiments, the solid state disk is a formatted solid state disk.
In some embodiments, the source data is 4096 bytes in size and the total metadata is 64 bytes in size; the size of the granularity data is 512 bytes, and the size of the metadata is 8 bytes.
In a third aspect of the embodiment of the present application, a computer readable storage medium is provided, and fig. 6 shows a schematic diagram of a computer readable storage medium implementing a method for writing data based on a solid state disk according to an embodiment of the present application. As shown in fig. 6, the computer-readable storage medium 3 stores computer program instructions 31. The computer program instructions 31 when executed by a processor implement the method of any of the embodiments described above.
It should be appreciated that all of the embodiments, features and advantages set forth above for the solid state disk based data writing method according to the present application apply equally to the solid state disk based data writing system and storage medium according to the present application, without conflict.
In a fourth aspect of the embodiment of the present application, there is also provided a computer device, including a memory 402 and a processor 401 as shown in fig. 4, where the memory 402 stores a computer program, and the computer program is executed by the processor 401 to implement the method of any one of the embodiments above.
Fig. 7 is a schematic hardware structure diagram of an embodiment of a computer device for executing a method for writing data based on a solid state disk according to the present application. Taking the example of a computer device as shown in fig. 7, a processor 401 and a memory 402 are included in the computer device, and may further include: an input device 403 and an output device 404. The processor 401, memory 402, input device 403, and output device 404 may be connected by a bus or otherwise, for example in fig. 7. The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the solid state disk based write data system. The output 404 may include a display device such as a display screen.
The memory 402 is used as a non-volatile computer readable storage medium, and can be used to store non-volatile software programs, non-volatile computer executable programs, and modules, such as program instructions/modules corresponding to the method for writing data based on a solid state disk in the embodiment of the present application. Memory 402 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created based on the use of the solid state disk data writing method, and the like. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 402 may optionally include memory located remotely from processor 401, which may be connected to the local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor 401 executes various functional applications of the server and data processing, that is, implements the solid state disk-based data writing method of the above method embodiment, by running nonvolatile software programs, instructions, and modules stored in the memory 402.
Finally, it should be noted that the computer-readable storage media (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. The foregoing embodiment of the present application has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the application, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the application, and many other variations of the different aspects of the embodiments of the application as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present application.

Claims (10)

1. The method for writing data based on the solid state disk is characterized by comprising the following steps of:
configuring a data source address and a metadata source address for a DMA, the data source address and the metadata source address corresponding to source data and total metadata respectively, the source data comprising a plurality of granularity data, the total metadata comprising a plurality of metadata corresponding to the granularity data, and configuring a data destination address corresponding to the granularity data and a metadata destination address corresponding to the metadata;
moving the source data from a host to a solid state disk through the DMA based on the data source address and a plurality of data destination addresses to form a plurality of granularity data distributed at intervals, and moving the total metadata from the host to the solid state disk based on the metadata source address and a plurality of metadata destination addresses to form a plurality of metadata distributed at intervals so as to enable the granularity data and the metadata to be arranged at intervals;
and completing the data writing request of the designated storage block in the solid state disk based on the granularity data and the metadata which are arranged at intervals.
2. The method as recited in claim 1, further comprising:
configuring a counter for the DMA;
in response to the source data movement being completed or the total metadata movement being completed, incrementing the counter value by one;
and until the value of the counter reaches two, determining that all moving of the source data and the total metadata is completed.
3. The method as recited in claim 1, further comprising:
and sending a data transfer request and a metadata transfer request to the DMA in parallel, so that the DMA performs the source data transfer based on the data transfer request, and performs the total metadata transfer based on the metadata transfer request.
4. The method of claim 1, wherein spacing the granularity data and the metadata comprises:
and enabling each piece of granularity data to carry the corresponding metadata.
5. The method as recited in claim 1, further comprising:
and sending the granularity data and the metadata of the interval arrangement to a data processing subsystem for verification.
6. The method as recited in claim 5, further comprising:
in response to completion of the check, a data movement completion flag is transmitted by the data processing subsystem to the host to cause the host to determine completion of the write data request based on the movement completion flag.
7. The method of claim 1, wherein moving, by the DMA, the source data from a host to a solid state disk based on the data source address and a plurality of the data destination addresses comprises:
judging whether the number of the data destination addresses is larger than a preset threshold value or not;
in response to the number of the data destination addresses being greater than the preset threshold, sequentially moving source data corresponding to the data destination addresses with the preset threshold number from a host to a solid state disk through the DMA each time;
and in response to the number of the data destination addresses required by the single movement being smaller than or equal to the preset threshold, directly moving source data corresponding to the data destination addresses required by the single movement from the host to the solid state disk.
8. A solid state disk-based data writing system, comprising:
an address configuration module configured to configure, for a DMA, a data source address and a metadata source address corresponding to source data and total metadata, respectively, the source data including a plurality of granularity data, the total metadata including a plurality of metadata corresponding to the granularity data, and to configure a data destination address corresponding to the granularity data and a metadata destination address corresponding to the metadata;
a moving module configured to move, through the DMA, the source data from a host to a solid state disk based on the data source address and a plurality of the data destination addresses, to form a plurality of granularity data distributed at intervals, and to move the total metadata from the host to the solid state disk based on the metadata source address and a plurality of the metadata destination addresses, to form a plurality of metadata distributed at intervals, so that the granularity data and the metadata are arranged at intervals; and
and the write completion module is configured to complete the write data request of the designated storage block in the solid state disk based on the granularity data and the metadata which are arranged at intervals.
9. A computer readable storage medium, characterized in that computer program instructions are stored, which, when executed by a processor, implement the method of any one of claims 1-7.
10. A computer device comprising a memory and a processor, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of any of claims 1-7.
CN202310575804.3A 2023-05-19 2023-05-19 Method, system, storage medium and equipment for writing data based on solid state disk Pending CN116610259A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310575804.3A CN116610259A (en) 2023-05-19 2023-05-19 Method, system, storage medium and equipment for writing data based on solid state disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310575804.3A CN116610259A (en) 2023-05-19 2023-05-19 Method, system, storage medium and equipment for writing data based on solid state disk

Publications (1)

Publication Number Publication Date
CN116610259A true CN116610259A (en) 2023-08-18

Family

ID=87679510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310575804.3A Pending CN116610259A (en) 2023-05-19 2023-05-19 Method, system, storage medium and equipment for writing data based on solid state disk

Country Status (1)

Country Link
CN (1) CN116610259A (en)

Similar Documents

Publication Publication Date Title
US20190163364A1 (en) System and method for tcp offload for nvme over tcp-ip
CN109726163B (en) SPI-based communication system, method, equipment and storage medium
DE102012214324B4 (en) Method and apparatus for facilitating data validation using a checksum in conjunction with a sidefile
US10339079B2 (en) System and method of interleaving data retrieved from first and second buffers
US11397538B2 (en) Data migration method and apparatus
CN114443529A (en) Direct memory access architecture, system, method, electronic device and medium
US9298593B2 (en) Testing a software interface for a streaming hardware device
TWI510932B (en) Block storage gateway module, mediator system for storage, cloud storage system, method for providing access to block storage, mediating method for storage, and content delivery apparatus
WO2018041074A1 (en) Method, apparatus, and system for accessing memory device
TW200842593A (en) Content-terminated DMA
US20210049114A1 (en) Computing system for reducing latency between serially connected electronic devices
CN110119304B (en) Interrupt processing method and device and server
CN112445729B (en) Operation address determination method, PCIe system, electronic device and storage medium
WO2019057005A1 (en) Data check method, device and network card
CN104317716B (en) Data transmission method and distributed node equipment between distributed node
CN108108324A (en) A kind of PCIE extended methods and device
JP2016535483A (en) Network interface
CN115145492A (en) Method and system for managing physical disk under RAID controller
CN110874345B (en) Data processing method, device and system in distributed storage system
WO2017054714A1 (en) Method and apparatus for reading disk array
CN112463067A (en) Data protection method and equipment in NVMe-oF scene
CN116610259A (en) Method, system, storage medium and equipment for writing data based on solid state disk
US20130185477A1 (en) Variable latency memory delay implementation
CN110968538B (en) Data buffering method and device
US11775451B2 (en) Computing system for reducing latency between serially connected electronic devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination