Data transmission method and device, equipment and storage medium

By setting up a descriptor storage area in the hard disk controller and reading descriptor entries in batches, the problem of low descriptor entry acquisition efficiency in the NVMe protocol is solved, thus improving data transmission performance.

CN120973304APending Publication Date: 2025-11-18SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511071649.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In the NVMe protocol, the retrieval efficiency of PRP/SGL descriptor entries is low, resulting in a bottleneck in data transfer performance between host memory and the hard disk controller.

Method used

A descriptor storage area is set up in the hard disk controller, and the number of descriptor entries is determined based on the data transmission information sent by the host and the remaining storage space in the descriptor storage area. This allows for batch reading of descriptor entries, reducing the number of interactions between the hard disk controller and the host and improving the efficiency of reading descriptor entries.

Benefits of technology

By reading descriptor entries in batches, the number of interactions between the hard disk controller and the host is reduced, improving the efficiency of descriptor entry acquisition and thus enhancing the data transfer performance between the host memory and the hard disk controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973304A_ABST
    Figure CN120973304A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method and device, equipment and a storage medium, and relates to the technical field of storage. In the method, a descriptor storage area is arranged in a hard disk controller, and data transmission is performed according to data transmission information issued by a host and used for controlling data transmission and the remaining storage space of the descriptor storage area; according to the method, the number of descriptor entries which can be stored in the descriptor storage area can be determined, and the descriptor entries can be read from the host in batches according to the number of the descriptor entries, so that the interaction times of the hard disk controller and the host can be reduced, and the reading efficiency of the descriptor entries can be improved; therefore, the problem that the acquisition efficiency of PRP / SGL descriptor entries in some technologies is relatively low can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage, and in particular to a data transmission method and device, an electronic device, and a storage medium. BACKGROUND

[0002] NVMe (Non-Volatile Memory Express) is a high-performance interface protocol designed specifically for SSDs (Solid State Drives), aiming to improve data transmission efficiency. In the NVMe protocol, data transmission addressing mainly relies on two key mechanisms: PRP (Physical Region Page) and SGL (Scatter / Gather List). These two mechanisms are used to describe the location of data in the host memory, ensuring that the hard disk controller can accurately perform data transmission. PRP / SGL descriptor entries serve as pre-information conditions for data transmission, and their acquisition efficiency directly affects the data transmission performance between the host memory and the hard disk controller.

[0003] Currently, in some technologies, the acquisition efficiency of PRP / SGL descriptor entries is relatively low, resulting in a bottleneck in data transmission performance between the host memory and the hard disk controller. SUMMARY

[0004] The present application provides a data transmission method, a data transmission device, an electronic device, and a computer-readable storage medium to at least solve the problem of low acquisition efficiency of PRP / SGL descriptor entries in related technologies.

[0005] The present application provides a data transmission method applied to a hard disk controller, wherein the hard disk controller includes a descriptor storage area; the method comprises:

[0006] receiving data transmission information issued by a host for controlling data transmission;

[0007] determining the number of descriptor entries that need to be read from the host according to the data transmission information and the remaining storage space of the descriptor storage area, wherein the descriptor entries are used to describe the memory regions of data to be transmitted by the host;

[0008] reading at least one descriptor entry from the memory space of the host according to the number of descriptor entries, and saving the read descriptor entries to the descriptor storage area;

[0009] reading data from the memory regions described by each of the descriptor entries in the descriptor storage area according to the descriptor entries in the descriptor storage area.

[0010] The application further provides a data transmission device applied to a hard disk controller, wherein the hard disk controller comprises a descriptor storage area; and the device comprises:

[0011] an information receiving module, configured to receive data transmission information for controlling data transmission issued by a host;

[0012] an entry number determining module, configured to determine a number of descriptor entries that need to be read from the host according to the data transmission information and a remaining storage space of the descriptor storage area, wherein the descriptor entries are used to describe memory areas in which data to be transmitted by the host is located;

[0013] an entry saving module, configured to read at least one descriptor entry from a memory space of the host according to the number of descriptor entries, and save the read descriptor entry to the descriptor storage area;

[0014] a data reading module, configured to read data from the memory areas described by the descriptor entries in the descriptor storage area according to the descriptor entries.

[0015] The application further provides an electronic device, comprising a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of any of the data transmission methods.

[0016] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the data transmission methods.

[0017] In the technical solutions of some embodiments of the application, by setting a descriptor storage area in a hard disk controller, and according to data transmission information for controlling data transmission issued by a host and a remaining storage space of the descriptor storage area, a number of descriptor entries that can be stored in the descriptor storage area can be determined, and according to the number of descriptor entries, descriptor entries can be read from the host in batches, so that the number of interactions between the hard disk controller and the host can be reduced, and the reading efficiency of the descriptor entries can be improved, thereby solving the problem of low acquisition efficiency of PRP / SGL descriptor entries in some technologies. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort.

[0019] Figure 1A partial structural schematic diagram of a hard disk controller is provided for some embodiments of the present application.

[0020] Figure 2 A flowchart of a data transmission method is provided for some embodiments of the present application.

[0021] Figure 3 A module schematic diagram of a data transmission apparatus is provided for some embodiments of the present application.

[0022] Figure 4 A module schematic diagram of an electronic device is provided for some embodiments of the present application. DETAILED DESCRIPTION

[0023] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, any other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0024] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0025] In order for those skilled in the art to better understand the technical solutions of the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0026] PRP and SGL are two different memory address description mechanisms defined in the NVMe protocol, which are used for a hard disk controller to access data in the host memory.

[0027] In PRP, each descriptor entry is used to describe (or point to) a data storage page (i.e. a memory region) of a specified size (such as 4KB) in the host memory. When the host needs to send data to the hard disk controller, the data transmission can be completed through the following steps:

[0028] 1) The host uses the descriptor entry to describe the memory region of the data in the host memory. For example, a pointer parameter can be set in the descriptor entry, which points to the memory region where the data is located.

[0029] 2) The host sends the address information of the descriptor entry (such as the storage address of the descriptor entry in the host memory) to the hard disk controller.

[0030] 3) The hard disk controller can read the descriptor entry from the host memory based on the address information of the descriptor entry, and then parse and convert the descriptor entry to obtain the data storage address, and further perform data reading based on the data storage address.

[0031] For example, assuming that the host needs to send data A to the hard disk controller, and data A is located in memory region S1 of the host memory. In this case, the host can generate a descriptor entry T1, and the pointer parameter in the descriptor entry T1 can point to the memory region S1. Further, the host can save the descriptor entry T1 to the memory region S2, and send the storage address information corresponding to the memory region S2 to the hard disk controller. After receiving the storage address information, the hard disk controller can read the descriptor entry T1 from the memory region S2, and parse and convert the descriptor entry T1 to obtain the storage address corresponding to the memory region S1. Based on the converted storage address, the hard disk controller can read data A from the memory region S1.

[0032] In the PRP, each descriptor entry occupies a specified size of memory space, and each memory page of the host can store a specified number of descriptor entries. For example, when the memory page size is 4KB and each descriptor entry occupies 8 bytes of memory space, each memory page can store 512 descriptor entries.

[0033] The SGL is a flexible data structure used in the NVMe protocol to describe non-continuous host memory regions. Specifically, in the SGL, each descriptor entry can include the starting physical address of the data, the data length, and other information. Compared with the PRP, in which each descriptor entry needs to describe a data storage page of a specified size (such as 4KB) in the host memory, in the SGL, each descriptor entry can dynamically describe a memory block of any size, which is more flexible. For example, assuming that the host needs to send data B, C, and D to the hard disk controller, and the starting physical address of data B is 0x1000, the length is 2KB; the starting physical address of data C is 0x4000, the length is 4KB; and the starting physical address of data D is 0x8000, the length is 1KB. Then, based on the SGL, the data transmission can be completed by the following steps:

[0034] 1) The host generates the following descriptor entries of the SGL:

[0035] Descriptor entry 1: address 0x1000, length 2KB

[0036] Descriptor entry 2: address 0x4000, length 4KB

[0037] Descriptor entry 3: address 0x8000, length 1KB.

[0038] 2) The host saves the descriptor entries 1-3 in a memory region C in the host memory, and then sends the storage address information Al corresponding to the memory region C to the hard disk controller.

[0039] 3) Based on the received storage address information Al, the hard disk controller can read the descriptor entries 1-3 in the memory region C, and parse and convert the descriptor entries 1-3 to obtain the storage address information A2, A3, A4 of the data B, C, D. Based on the storage address information A2, A3, A4, the hard disk controller can read the data B, C, D in the corresponding memory region.

[0040] In the SGL, each descriptor entry can occupy a specified size (such as 16 bytes) of memory space. Multiple descriptor entries can form a segment (i.e., segment), and each segment includes multiple descriptor entries.

[0041] Further, the descriptor entry can include a data descriptor entry and a metadata descriptor entry. The data descriptor entry is used to describe the memory region of the entity data, and the metadata descriptor entry is used to describe the memory region of the metadata of the entity data. For example, a file F has file name, file size, file type, and other metadata. Generally, when saving the entity data of the file F, the metadata of the file F also needs to be saved. The entity data and the metadata can be saved in different memory regions, so the descriptor entry can be divided into a data descriptor entry and a metadata descriptor entry, and the memory region of the entity data is described through the data descriptor entry, and the memory region of the metadata is described through the metadata descriptor entry.

[0042] Currently, in some technologies, when the host sends the related information of the descriptor entry to the hard disk controller, it is sent in sequence, and the whole process can be similar as follows:

[0043] 1) The host sends the address information of the descriptor entry 1 to the hard disk controller;

[0044] 2) Based on the address information of the descriptor entry 1, the hard disk controller reads the descriptor entry 1, and after reading the data 1 based on the descriptor entry 1, returns a response 1 to the host;

[0045] 3) In response to receiving the response 1, the host continues to send the address information of the descriptor entry 2 to the hard disk controller;

[0046] 4) Based on the address information of the descriptor entry 2, the hard disk controller reads the descriptor entry 2, and after reading the data 2 based on the descriptor entry 2, returns a response 2 to the host;

[0047] And so on.

[0048] As can be seen from the above process, in the data reading process, the hard disk controller needs to frequently communicate with the host, and such frequent communication increases the occupation of the bus bandwidth, causes additional delay, and the acquisition efficiency of the descriptor entry is low, thereby affecting the data transmission performance between the host memory and the hard disk controller.

[0049] In view of this, the present application first provides a new hard disk controller. For reference Figure 1 The partial structure schematic diagram of the hard disk controller provided by some embodiments of the present application is shown in the figure. Figure 1 In the embodiment, the hard disk controller can include a processor, a descriptor reading control module, a descriptor storage area, a checking module, an address conversion module and a register. The descriptor reading control module is configured to read the descriptor entry from the host. The descriptor storage area can include a first descriptor storage area and a second descriptor storage area. The first descriptor storage area can be used to store the data descriptor entry read from the host, and the second descriptor storage area can be used to store the metadata descriptor entry read from the host. The checking module can be used to check each descriptor entry in the descriptor storage area, such as checking whether the descriptor entry of the PRP is page-aligned. For example, checking whether the descriptor entry of the SGL meets the data format definition of the SGL. The address conversion module is configured to convert the descriptor entry into the actual storage address of the data.

[0050] Based on the above description, the present application provides a data transmission method, which can solve the problem of low acquisition efficiency of the PRP / SGL descriptor entry in the related art. The data transmission method can be applied to Figure 1 the hard disk controller in the embodiment. For reference Figure 2 The flowchart of the data transmission method provided by some embodiments of the present application is shown in the figure. Figure 2 In the embodiment, the data transmission method can include the following steps:

[0051] Step S201, receiving the data transmission information issued by the host for controlling data transmission.

[0052] Specifically, the data transmission information can include but is not limited to the descriptor entry type, the memory page size of the host memory, the number of memory pages occupied by the data, the starting storage address of the descriptor entry in the host memory, the data structure of the descriptor entry, etc. Wherein, the descriptor entry type is used to identify that the descriptor entry is one of the PRP and the SGL, and is one of the data descriptor entry and the metadata descriptor entry.

[0053] The processor in the hard disk controller can communicate with the host and receive data transmission information issued by the host. Based on the data transmission information, the processor can configure the descriptor reading control module. Based on the configuration information, the descriptor reading control module can perform steps S202-S203.

[0054] In step S202, the number of descriptor entries that need to be read from the host is determined according to the data transmission information and the remaining storage space of the descriptor storage area, wherein the descriptor entries are used to describe the memory area where the data to be transmitted by the host is located.

[0055] In step S203, at least one descriptor entry is read from the memory space of the host according to the number of descriptor entries, and the read descriptor entry is saved to the descriptor storage area.

[0056] Specifically, since the descriptor entries in the SGL and the PRL can exist in the form of a linked list, based on the link relationship between the descriptor entries and the information such as the starting storage address of the descriptor entries configured by the processor in the host memory, the data structure of the descriptor entries, etc., the descriptor reading control module can determine the total number of descriptor entries that need to be read in the current data transmission process and other information. Further, based on the information such as the memory space required by the descriptor entries in the configuration information, the storage space size required to store all the descriptor entries can be determined. If the remaining storage space of the descriptor storage area is greater than the storage space size required by all the descriptor entries, all the descriptor entries can be read to the local descriptor storage area; if the remaining storage space of the descriptor storage area is less than the storage space size required by all the descriptor entries, part of the descriptor entries can be read to the local descriptor storage area according to the remaining storage space size and the storage space size required by each descriptor entry. For example, assuming that the remaining storage space of the descriptor storage area is 500K, the storage space size required by all the descriptor entries is 600K, and the storage space required by each descriptor entry is 1K, 500 descriptor entries can be read to the local descriptor storage area in advance.

[0057] After the descriptor reading control module reads multiple descriptor entries to the local descriptor storage area, the address translation module can perform step S204.

[0058] In step S204, data is read from the memory area described by each descriptor entry according to the descriptor entries in the descriptor storage area.

[0059] Specifically, the address conversion module can convert the descriptor entries of the descriptor storage area in a sequential or parallel manner, and perform data reading according to the converted addresses. For any descriptor entry, the address conversion module can delete the descriptor entry after completing data reading according to the descriptor entry, so as to release the storage space of the descriptor storage area.

[0060] The descriptor reading control module can continue to read the unread descriptor entries from the host and save the read descriptor entries to the descriptor storage area after detecting that the storage space of the descriptor storage area is released. Specifically, in order to prevent the frequency of data reading from being too high, the descriptor reading control module triggers reading of the unread descriptor entries from the host again after the control storage space of the descriptor storage area exceeds a threshold.

[0061] To sum up, in the technical solutions of some embodiments of the present application, by setting the descriptor storage area in the hard disk controller and according to the data transmission information for controlling data transmission issued by the host and the remaining storage space of the descriptor storage area, the number of descriptor entries that can be stored in the descriptor storage area can be determined, and according to the number of descriptor entries, the descriptor entries can be read from the host in batches, so that the number of interactions between the hard disk controller and the host can be reduced, and the reading efficiency of the descriptor entries can be improved, thereby solving the problem of low acquisition efficiency of PRP / SGL descriptor entries in some technologies.

[0062] In some embodiments, when the descriptor entries are entries described using physical area pages, the step of determining the number of descriptor entries that can be read from the host according to the data transmission information and the remaining storage space of the descriptor storage area in step S202 comprises:

[0063] determining the number of first descriptor entries that have not been read based on the data transmission information;

[0064] determining the number of second descriptor entries that have not been read in the memory page in which the target descriptor entry has been read based on the offset address of the target descriptor entry in the memory page;

[0065] determining the number of third descriptor entries that can be stored in the descriptor storage area based on the size of the storage space required by each descriptor entry and the remaining storage space;

[0066] among the number of first descriptor entries, the number of second descriptor entries and the number of third descriptor entries, the smallest number of descriptor entries is taken as the number of descriptor entries that can be read from the host.

[0067] In this way, cross-memory-page reading of descriptor entries can be prevented.

[0068] In some embodiments, when the descriptor entries are entries described using the scatter-gather list, the plurality of descriptor entries constitute a segment;

[0069] According to the data transmission information and the remaining storage space of the descriptor storage area, the number of descriptor entries to be read from the host is determined, including:

[0070] According to the data transmission information, the target storage space required to be occupied by the segment that has not been read is determined;

[0071] If the target storage space is greater than the remaining storage space, then according to the remaining storage space and the size of each descriptor entry, the number of descriptor entries to be read from the host is determined;

[0072] If the target storage space is not greater than the remaining storage space, then the number of descriptor entries in the segment that has not been read is taken as the number of descriptor entries to be read from the host.

[0073] In some embodiments, when the target storage space is greater than the remaining storage space, the method of the present application further includes:

[0074] After reading the descriptor entries from the host according to the number of descriptor entries, the starting address of the current descriptor entries that have not been read in the host memory is recorded;

[0075] In the case that at least part of the storage space of the descriptor storage area is released, the descriptor entries are continued to be read from the recorded starting address.

[0076] In this way, it is ensured that the starting position of the descriptor entries that have not been read can be found when the descriptor entries are read next time.

[0077] In some embodiments, the descriptor storage area includes a first descriptor storage area and a second descriptor storage area, and the descriptor entries include data descriptor entries and metadata descriptor entries;

[0078] Saving the read descriptor entries to the descriptor storage area includes:

[0079] If the descriptor entry is a data descriptor entry, then the descriptor entry is saved to the first descriptor storage area;

[0080] If the descriptor entry is a metadata descriptor entry, then the descriptor entry is saved to the second descriptor storage area.

[0081] In some embodiments, after saving the descriptor entries to the descriptor storage area, the method of the present application can further include:

[0082] According to a preset checking logic, each descriptor entry of the descriptor storage area is checked;

[0083] In the case that the checking is completed, the descriptor entry is converted into a storage address where the data is located, and data reading is performed based on the storage address obtained through the conversion;

[0084] Each descriptor storage area has at least one write pointer and at least two read pointers, the write pointer is used to indicate the storage location of the descriptor entry to be saved in the descriptor storage area, one read pointer is used to indicate the storage location of the descriptor entry to be checked in the descriptor storage area, and the other read pointer is used to indicate the storage location of the descriptor entry to be converted in the descriptor storage area.

[0085] In this way, the checking of the entry and the conversion of the entry can be decoupled and performed independently, for example, when the checking module checks the descriptor entry at position A, the address conversion module can convert the descriptor entry at position B, which is more adaptive.

[0086] In some embodiments, the method of the present application further comprises:

[0087] If both write pointers move away from one of the target storage locations, the descriptor entry in the target storage location is deleted.

[0088] In this way, the storage space can be released in time.

[0089] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment.

[0090] For reference Figure 3 The module schematic diagram of the data transmission device provided by some embodiments of the present application. Figure 3 In some embodiments, the data transmission device comprises:

[0091] The information receiving module 301 is configured to receive data transmission information for controlling data transmission issued by the host;

[0092] The entry quantity determining module 302 is configured to determine the number of descriptor entries to be read from the host according to the data transmission information and the remaining storage space of the descriptor storage area, wherein the descriptor entry is used to describe the memory area where the data to be transmitted by the host is located;

[0093] The entry saving module 303 is configured to read at least one descriptor entry from the memory space of the host according to the number of descriptor entries, and save the read descriptor entry to the descriptor storage area;

[0094] The data reading module 304 is configured to read data from the memory area described by each descriptor entry in the descriptor storage area according to the descriptor entry in the descriptor storage area.

[0095] In some embodiments, when the descriptor entries are entries described using physical region pages, the entry number determining module 302 is specifically configured to:

[0096] determine the first number of descriptor entries that have not been read based on the data transmission information;

[0097] determine the second number of descriptor entries that have not been read in the memory page in which the target descriptor entry is located based on the offset address of the target descriptor entry in the memory page in which the target descriptor entry has been read to;

[0098] determine the third number of descriptor entries that can be stored in the descriptor storage area based on the size of the storage space required by each descriptor entry and the remaining storage space;

[0099] among the first number of descriptor entries, the second number of descriptor entries and the third number of descriptor entries, the smallest number of descriptor entries is taken as the number of descriptor entries that need to be read from the host.

[0100] In some embodiments, when the descriptor entries are entries described using a scatter list, a plurality of descriptor entries constitute a segment; the entry number determining module 302 is specifically configured to:

[0101] determine the target storage space required by the segment that has not been read based on the data transmission information;

[0102] if the target storage space is greater than the remaining storage space, then the number of descriptor entries that need to be read from the host is determined according to the remaining storage space and the size of each descriptor entry;

[0103] if the target storage space is not greater than the remaining storage space, then the number of descriptor entries in the segment that has not been read is taken as the number of descriptor entries that need to be read from the host.

[0104] In some embodiments, when the target storage space is greater than the remaining storage space, the entry saving module 303 is further configured to:

[0105] after reading the descriptor entries from the host according to the number of descriptor entries, record the starting address of the current descriptor entries that have not been read in the memory of the host;

[0106] in the case that at least part of the storage space of the descriptor storage area is released, continue to read the descriptor entries from the recorded starting address.

[0107] In some embodiments, the descriptor storage area includes a first descriptor storage area and a second descriptor storage area, and the descriptor entries include data descriptor entries and metadata descriptor entries; the entry saving module 303 is further configured to:

[0108] If the descriptor entry is a data descriptor entry, the descriptor entry is saved to the first descriptor storage area;

[0109] If the descriptor entry is a metadata descriptor entry, the descriptor entry is saved to the second descriptor storage area.

[0110] In some embodiments, after the descriptor entry is saved to the descriptor storage area, the entry saving module 303 is further configured to:

[0111] According to a preset checking logic, each descriptor entry of the descriptor storage area is checked;

[0112] In a case where the checking is completed, the descriptor entry is converted into a storage address where the data is located, and data reading is performed based on the converted storage address;

[0113] In some embodiments, each descriptor storage area has at least one write pointer and at least two read pointers, the write pointer is used to indicate a storage location of a descriptor entry to be saved in the descriptor storage area, one read pointer is used to indicate a storage location of a descriptor entry to be checked in the descriptor storage area, and the other read pointer is used to indicate a storage location of a descriptor entry to be converted in the descriptor storage area.

[0114] In some embodiments, the entry saving module 303 is further configured to:

[0115] If both write pointers move away from one target storage location, the descriptor entry of the target storage location is deleted.

[0116] In combination with the above description, Figure 4 The embodiments of the present application also provide an electronic device, which comprises a memory 10 and a processor 20, the memory 10 stores a computer program, and the processor 20 is configured to run the computer program to perform the steps in any of the above data transmission method embodiments.

[0117] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is configured to perform the steps in any of the above data transmission method embodiments when running.

[0118] In an example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0119] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program realizes the steps in any of the data transmission method embodiments when executed by a processor.

[0120] The embodiment of the present application further provides another computer program product, which comprises a nonvolatile computer readable storage medium, and the nonvolatile computer readable storage medium stores a computer program, and the computer program realizes the steps in any of the data transmission method embodiments when executed by a processor.

[0121] Those skilled in the art can further understand that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0122] The above describes in detail a data transmission method, device, equipment and storage medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples in this paper, and the above example description is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A data transmission method, characterized in that, Applied to a hard disk controller, the hard disk controller including a descriptor storage area; the method includes: Receive data transmission information from the host to control data transmission; Based on the data transmission information and the remaining storage space in the descriptor storage area, the number of descriptor entries that need to be read from the host is determined, wherein the descriptor entries are used to describe the memory area where the data to be transmitted by the host is located; According to the number of descriptor entries, at least one descriptor entry is read from the host's memory space, and the read descriptor entry is saved to the descriptor storage area; Data is read from the memory region described by each of the descriptor entries in the descriptor storage area.

2. The method according to claim 1, characterized in that, When the descriptor entry is an entry described using a physical region page, determining the number of descriptor entries that need to be read from the host based on the data transmission information and the remaining storage space in the descriptor storage area includes: Based on the data transmission information, determine the number of first descriptor entries that have not yet been read; Based on the offset address of the currently read target descriptor entry in the memory page, determine the number of second descriptor entries that have not yet been read in the memory page where the target descriptor entry is located; Based on the storage space required by each descriptor entry and the remaining storage space, determine the number of third descriptor entries that the descriptor storage area can store; Among the first number of descriptor entries, the second number of descriptor entries, and the third number of descriptor entries, the smallest number of descriptor entries is taken as the number of descriptor entries that need to be read from the host.

3. The method according to claim 1, characterized in that, When the descriptor entry is an entry described using a scattered list, multiple descriptor entries form a segment; Determining the number of descriptor entries that need to be read from the host based on the data transmission information and the remaining storage space in the descriptor storage area includes: Based on the data transmission information, determine the target storage space required for the segments that have not yet been read; If the target storage space is greater than the remaining storage space, then the number of descriptor entries that need to be read from the host is determined based on the remaining storage space and the size of each descriptor entry. If the target storage space is not greater than the remaining storage space, then the number of descriptor entries in the unread segments is taken as the number of descriptor entries that need to be read from the host.

4. The method according to claim 3, characterized in that, If the target storage space is greater than the remaining storage space, the method further includes: After reading descriptor entries from the host according to the number of descriptor entries, record the starting address of the currently unread descriptor entries in the host memory; If at least a portion of the storage space in the descriptor storage area is released, the descriptor entry continues to be read, starting from the beginning address of the record.

5. The method according to claim 1, characterized in that, The descriptor storage area includes a first descriptor storage area and a second descriptor storage area, and the descriptor entries include data descriptor entries and metadata descriptor entries; Saving the read descriptor entries to the descriptor storage area includes: If the descriptor entry is a data descriptor entry, then the descriptor entry is saved to the first descriptor storage area; If the descriptor entry is a metadata descriptor entry, then the descriptor entry is saved to the second descriptor storage area.

6. The method according to claim 5, characterized in that, After saving the descriptor entry to the descriptor storage area, the method further includes: According to the preset checking logic, each descriptor entry in the descriptor storage area is checked; Once the check is complete, the descriptor entry is converted to the storage address where the data is located, and the data is read based on the converted storage address; Each of the descriptor storage areas has at least one write pointer and at least two read pointers. The write pointer is used to indicate the storage location of the descriptor entry to be saved in the descriptor storage area, one read pointer is used to indicate the storage location of the descriptor entry to be checked in the descriptor storage area, and the other read pointer is used to indicate the storage location of the descriptor entry to be converted in the descriptor storage area.

7. The method according to claim 6, characterized in that, The method further includes: If both write pointers are moved away from one of the target storage locations, the descriptor entry for that target storage location is deleted.

8. A data transmission device, characterized in that, Applied to a hard disk controller, the hard disk controller including a descriptor storage area; the device includes: The information receiving module is used to receive data transmission information sent by the host for controlling data transmission. The entry quantity determination module is used to determine the number of descriptor entries that need to be read from the host based on the data transmission information and the remaining storage space of the descriptor storage area, wherein the descriptor entries are used to describe the memory area where the data to be transmitted by the host is located; An entry saving module is used to read at least one descriptor entry from the host's memory space according to the number of descriptor entries, and save the read descriptor entry to the descriptor storage area; The data reading module is used to read data from the memory area described by each of the descriptor entries in the descriptor storage area.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data transmission method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data transmission method as described in any one of claims 1 to 7.