Data transmission method, system, product, equipment, medium and device
By setting polling priority and weight for the accelerator channel and dynamically scheduling data transmission, the problem that the polling strategy cannot adapt to differentiated needs is solved, and system performance and efficiency are improved.
Patent Information
- Application Number
- CN202511063229.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-31
AI Technical Summary
In the prior art, polling strategies cannot flexibly respond to differentiated bandwidth or real-time requirements of different accelerator applications, resulting in reduced system efficiency and flexibility.
The polling priority and polling weight for each channel under different applications are set for each channel, and the channel reading order is dynamically determined and the number of descriptors controlled for a single read is adapted to differentiated requirements.
It realizes refined resource allocation, improves system performance and throughput efficiency, and meets the real-time and bandwidth requirements of different applications.
Smart Images

Figure CN120567801A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data transmission technology, and in particular to a data transmission method, system, product, equipment, medium and device. Background Art
[0002] In scenarios like data centers, leveraging DMA (Direct Memory Access) technology to achieve high-speed data transfer between accelerators and the host is crucial. To meet the demands of running multiple accelerated applications simultaneously, related technologies bind each DMA channel to an independent CPU (Central Processing Unit), configure a dedicated FIFO (First In First Out) storage descriptor for each DMA channel, and execute each channel's tasks sequentially through a round-robin approach. However, this polling strategy lacks the flexibility to respond to the varying bandwidth or real-time requirements of different applications, reducing system efficiency and flexibility.
[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the Invention
[0004] The present application provides a data transmission method, system, product, device, medium and apparatus to at least solve the problem in related technologies that polling strategies cannot adapt to differentiated needs.
[0005] The present application provides a data transmission method, including: when there is at least one readable channel among multiple channels, determining the polling priority and polling weight of the readable channel under the current application; the channel occupies the corresponding address space in a first storage medium to store descriptors issued by a host computer; reading the descriptors stored in the readable channel according to the polling priority and polling weight corresponding to at least one of the readable channels; the polling weight represents a first number of descriptors read from the readable channel each time; and performing a data transmission operation based on the read descriptors that meet the execution conditions of direct memory access.
[0006] The present application also provides a data transmission system, including: a first determination module, configured to determine the polling priority and polling weight of a readable channel under a current application when there is at least one readable channel among multiple channels; the channel occupies a corresponding address space in a first storage medium to store descriptors issued by a host computer; a reading module, configured to read the descriptors stored in the readable channel according to the polling priority and polling weight corresponding to at least one of the readable channels; the polling weight represents a first number of descriptors read from the readable channel each time; and an execution module, configured to execute a data transmission operation based on the read descriptors that meet the execution conditions of direct memory access.
[0007] The present application also provides a computer program product, comprising a computer program / instruction, which implements the steps of the data transmission method described above when executed by a processor.
[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the data transmission method described above when executing the computer program.
[0009] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the data transmission method described above are implemented.
[0010] The present application also provides a data transmission device, including: a control register, configured to store the polling priority and polling weight corresponding to each channel; a first storage medium, wherein the channel occupies the corresponding address space in the first storage medium to store the descriptor sent by the host computer; a write control component, configured to write the descriptor sent by the host into the corresponding channel; a read control component, configured to read the descriptors stored in the multiple channels according to the polling priority and the polling weight; a splitting component, configured to output the descriptor that meets the execution condition of direct memory access; and an execution component, configured to perform a data transmission operation according to the read descriptor that meets the execution condition of direct memory access.
[0011] Through this application, since polling priority and polling weight are set for each channel under different applications, where the polling weight represents the first number of descriptors read from the readable channel each time, the channel reading order can be dynamically determined according to the polling priority during the scheduling process, and the number of descriptors read at a single time can be accurately controlled according to the polling weight, thereby flexibly adapting to the differentiated real-time and bandwidth requirements of different applications, solving the problem that the polling strategy in the related technology cannot adapt to differentiated requirements, and achieving the beneficial effect of refined resource allocation and improved system performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Figure 1 A flowchart of the steps of a data transmission method provided in an embodiment of the present application.
[0014] Figure 2 A schematic diagram of descriptor writing provided in an embodiment of the present application.
[0015] Figure 3 A schematic diagram of descriptor extraction provided in an embodiment of the present application.
[0016] Figure 4 A flowchart of the steps of another data transmission method provided in an embodiment of the present application.
[0017] Figure 5 Schematic diagram of a data transmission device in the first transmission scenario provided in an embodiment of the present application.
[0018] Figure 6 Schematic diagram of a data transmission device in the second transmission scenario provided in an embodiment of the present application.
[0019] Figure 7 A schematic diagram of the structure of a data transmission system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0021] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0022] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0023] The embodiment of the present application provides a data transmission method, combined with Figure 1 The execution flow of the data transmission method shown is described in detail.
[0024] S101: When there is at least one readable channel among the multiple channels, determine the polling priority and polling weight of the readable channel in the current application; the channel occupies the corresponding address space in the first storage medium to store the descriptor sent by the host computer.
[0025] In this embodiment, the first storage medium may be a RAM (Random Access Memory) memory. A preset address space is divided within the RAM memory, with multiple channels occupying different address spaces within the RAM memory to store descriptors for each channel. For example, taking 16 channels as an example, with each channel supporting 128 descriptors, the required depth of the RAM memory is 16×128, or 2048. The RAM memory may be divided into 16 address spaces, with the 16 channels correspondingly occupying 16 address spaces within the RAM memory to store descriptors for each channel. Because the RAM memory may be read and written simultaneously, the RAM memory in this embodiment may be a dual-port RAM.
[0026] This embodiment pre-assigns polling priorities and polling weights for different applications to each channel, wherein the polling priority can determine the reading order of each channel. It can be understood that the polling priority is set according to whether the current application cares about delays and timely responses. As an optional embodiment, the polling priority can be divided into three levels: medium, low, and high. Channels with high priorities will be polled first. The polling weight is used to characterize the first number of descriptors read from the readable channel each time. The polling weight can be regarded as a supplement to the polling priority. Under the same amount of data, channels with larger polling weights will execute faster and end earlier within the same polling priority. The value range of the polling weight can be set between 1 and 128.
[0027] Assume that an FPGA (Field-Programmable Gate Array) accelerator deploys encryption and decryption applications, such as SM2 (Elliptic Curve Public Key Cryptographic Algorithm), SM3 (Cryptographic Hash Algorithm), SM4 (Block Cipher Algorithm), 3DES (Triple Data Encryption Algorithm), AES (Advanced Encryption Standard), and SHA (Secure Hash Algorithm), image compression and decompression applications, and network data transmission and reception applications. These applications correspond to channels L0 to L8, respectively. Refer to Table 1 for the configuration of their polling priorities and polling weights.
[0028] Table 1 Correspondence between application, channel, polling priority and polling weight
[0029] As can be understood, in Table 1, channel L8 corresponds to network data transmission and reception applications, which require timely responses. Therefore, this channel can be set to high priority. Channels L7 and L6 correspond to image compression and decompression applications, which require large data operations and are less sensitive to latency, and can be set to low priority. The remaining channels correspond to encryption and decryption applications (SM2, SM3, SM4, 3DES, AES, and SHA) and can be set to medium priority. Since network data transmission and reception is a high priority and there is only one application, a polling weight of 1 is sufficient. Image compression and decompression are low priority, and there are only two applications, which rarely occur simultaneously. Therefore, a polling weight of 1 is also sufficient. Channels L0-L5 are encryption and decryption applications, with the same polling priority. Users need to set polling weights based on their needs. Considering that SM2, SM3, and SHA have relatively small data volumes and it is desirable to execute all data operations immediately when polling them, a polling weight greater than the number of descriptors (maximum data volume / descriptor size) can be set. For applications like SM4, 3DES, and AES, which have large data volumes and long processing times, a polling weight of 1 can be sufficient.
[0030] Of course, the above and Table 1 are only examples. The polling priority and polling weight of each channel can be adjusted according to the application corresponding to the channel. This embodiment does not make any specific limitations here.
[0031] In this embodiment, a readable channel is a channel among multiple channels that meets the read condition. The read condition is adjusted according to different transmission scenarios. For example, in scenarios where a large amount of data is transmitted at a time, such as multimedia video streams and audio streams, the read condition may include that all descriptors allocated to a channel are written to the channel; in scenarios where a small amount of data is transmitted at a time, such as text messages, the read condition may include that a channel is not empty. The setting can be based on actual project needs, and this embodiment does not specifically limit the basis for determining a readable channel.
[0032] Before executing this step, the process also includes monitoring each channel to determine whether any readable channel meets the read conditions in the current transmission scenario. If any readable channel meets the read conditions in the current transmission scenario, the process determines the polling priority and polling weight corresponding to each readable channel so that identifiers can be subsequently read from each readable channel according to the polling priority and polling weight. If no readable channel meets the read conditions in the current transmission scenario, the process continues monitoring.
[0033] By dynamically allocating polling priorities and polling weights across multiple channels, data scheduling optimization that is adaptive to application scenarios is achieved. Polling priorities ensure low-latency response to data, while polling weights can fine-tune the throughput ratio of each channel, thereby improving the overall system throughput efficiency while meeting the real-time requirements of differentiated services. This also reduces hardware overhead through optimized access to storage address space, achieving both deployment flexibility and energy efficiency.
[0034] S102: Reading descriptors stored in the readable channel according to a polling priority and a polling weight corresponding to at least one readable channel; the polling weight represents a first quantity of descriptors read from the readable channel each time.
[0035] In this embodiment, the polling weight corresponding to each channel represents the first number of descriptors that can be read from the readable channel at a time. For example, if the polling weight corresponding to a channel is 5, this means that each time the channel is polled, up to 5 descriptors can be read from the channel. Specifically, if the number of descriptors to be read in the channel is less than 5 when the channel is polled, all descriptors in the channel are read. If the number of descriptors to be read in the channel is greater than or equal to 5 when the channel is polled, all descriptors in the channel are read. It will be understood that different readable channels can have the same polling priority or different polling priorities, and accordingly, different readable channels can also have the same polling weight or different polling weights. When multiple readable channels exist, polling is triggered. First, all readable channels are sorted according to the polling priority. Then, descriptors are read from each readable channel in sequence according to its polling weight. After reading, operations may also be performed to update the channel status (such as updating the number of descriptors to be read).
[0036] By controlling the number of descriptors read at a time through polling weights, data can be processed in batches, reducing the overhead of frequent polling and improving system throughput. The combination of polling priority and polling weights prevents low-priority channels from occupying resources for extended periods while ensuring timely response for high-priority channels. While high-priority channels are processed first, the proper allocation of polling weights ensures that low-priority channels are also processed fairly, preventing them from being completely blocked.
[0037] As an optional embodiment, the polling priority of each channel in this embodiment can also be adjusted based on the status of the channel within the first preset time period. Assuming that the polling priority of a channel is set to high, but there is no data in the first preset time period up to the current moment, the polling priority of the channel can be lowered and maintained for the second preset time period. The polling priority of the channel can then be adjusted back to the original polling priority, or when data appears on the channel again, the polling priority of the channel can be adjusted back to the original polling priority. The polling priority and the number of polls can be dynamically adjusted according to actual needs, and this embodiment does not specifically limit this.
[0038] S103: Execute a data transfer operation according to the read descriptor that meets the execution condition of direct memory access.
[0039] Direct Memory Access (DMA) is a technology that allows peripheral devices (such as network cards and disk controllers) to interact directly with memory, eliminating the need for CPU intervention and improving data transfer efficiency. In this embodiment, DMA is used to efficiently transfer data pointed to by descriptors, such as transferring data from memory to the device or vice versa.
[0040] It can be understood that a descriptor is a data structure, including but not limited to information such as source address, destination address, data length, status / control bits, etc. The descriptor in this embodiment is used to describe the data to be transmitted. After reading the descriptor, it is submitted to the DMA controller so that the DMA controller executes the data transfer operation corresponding to the descriptor, that is, moving the data block of the descriptor source address to the destination address.
[0041] In this embodiment, the executed descriptor needs to meet the execution conditions of direct memory access. The execution conditions here are determined based on the max_payload_size supported by the DMA controller and the 4k address boundary. That is, the data block size specified by the descriptor executed in this embodiment does not exceed the max_payload_size supported by the DMA controller (for example, the max_payload_size of a PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) device, including but not limited to 128B / 256B, etc.), the start address and target address of the data block are both aligned with the 4k boundary, and the data block does not cross the 4k address boundary to avoid paging overhead.
[0042] Automatic data transfer via DMA reduces CPU interrupts and copy operations, improving overall system performance. DMA supports batch descriptor processing, using a polling weight mechanism to control the number of descriptors read from a channel at a time. The DMA controller processes these descriptors in batches, reducing the overhead of frequently starting and stopping DMA, thereby maximizing I / O (Input / Output) throughput. Priority scheduling ensures that critical data (such as real-time audio and video streams) is transmitted first, reducing jitter. Leveraging DMA hardware capabilities, zero-copy data transfer is achieved, making it suitable for scenarios such as high-performance computing and network packet processing.
[0043] Through this application, since polling priority and polling weight are set for each channel under different applications, where the polling weight represents the first number of descriptors read from the readable channel each time, the channel reading order can be dynamically determined according to the polling priority during the scheduling process, and the number of descriptors read at a single time can be accurately controlled according to the polling weight, thereby flexibly adapting to the differentiated real-time and bandwidth requirements of different applications, solving the problem that the polling strategy in the related technology cannot adapt to differentiated requirements, and achieving the beneficial effect of refined resource allocation and improved system performance.
[0044] In an exemplary embodiment, the readable channel includes a first readable channel; the data transmission method further includes: when writing a descriptor to a corresponding channel, updating a second number of descriptors written in the channel; for each channel, when the second number is equal to the corresponding write completion number of the channel, determining that the first readable channel exists in the multiple channels.
[0045] In this embodiment, each descriptor is written into the address space of the corresponding RAM memory according to the ID (Identification) number of the channel. It can be understood that there is a one-to-one correspondence between the channel ID number and the address space of the RAM memory. Assuming that there are 4 channels and the RAM memory depth is 512, the address space 0-127 of the RAM memory is divided into the first channel, 128-255 is divided into the second channel, and so on. The received descriptor is written starting from the corresponding first address.
[0046] When writing descriptors to the corresponding channel, each time a descriptor is written, the second count of descriptors written to that channel is updated. This second count records the number of descriptors currently written to each channel. It initially has a value of 0 and increments by 1 with each descriptor written. For example, if the first descriptor is written to that channel, the second count is updated to 1. If the second descriptor is written to the channel, the second count is updated to 2, and so on. The "completed write count" refers to the total number of descriptors to be written to each channel, as issued by the host computer. It is used to determine whether the channel is readable. A first readable channel refers to a channel that has reached the completed write count, indicating that all descriptors in that channel have been written and can be polled for reads. For example, if the completed write count of channel A is 10, when the second count reaches 10, channel A becomes the first readable channel. It can be understood that the read condition in this transmission scenario is that the second count of a channel reaches the corresponding completed write count after the update. In this case, if at least one first readable channel is determined among the multiple channels, polling can be triggered. After determining the polling priority and polling weight of each first readable channel, subsequent polling operations are performed.
[0047] For example, assume there are four channels, A, B, C, and D. A occupies RAM address space 0-127, B occupies RAM address space 128-255, and so on. A's write completion count is 3, B's write completion count is 5, C's write completion count is 2, and D's write completion count is 4. During the descriptor write phase, A writes three descriptors (addresses 0→1→2), and A's second count is updated to 3. At this point, A is determined to be the first readable channel. B writes five descriptors (addresses 128→129→130→131→132), and B's second count is updated to 5. At this point, B is also determined to be the first readable channel. C writes two descriptors (addresses 256→257), and C's second count is updated to 2. C is also determined to be the first readable channel. D writes four descriptors (addresses 384→385→386→387), and D's second count is updated to 4. D is also determined to be the first readable channel. It can be understood that if the second number of a channel is less than its corresponding write completion number, it needs to be skipped during polling. For example, when D is determined to be the first readable channel, the second number of B may not have reached its corresponding second number, so B is skipped during polling.
[0048] In this embodiment, the readability of the channel is accurately determined by comparing the second number with the number of completed writes, thereby avoiding invalid polling. Moreover, once the channel meets the readability condition, polling is triggered immediately, thereby reducing the delay from data readiness to processing. Each channel is counted independently and has an independent address space. A single channel error (such as overflow) does not affect the operation of other channels.
[0049] In an exemplary embodiment, when writing a descriptor to a corresponding channel, updating the second number of descriptors written in the channel includes: when writing the descriptor to the corresponding channel, controlling the value of a write counter corresponding to the channel to increment to update the second number of descriptors written in the channel; the data transmission method also includes: when the value of the write counter is equal to the number of write completions corresponding to the channel, setting the read flag of the channel to a first preset value, so as to determine whether there is at least one first readable channel among the multiple channels based on the read flag.
[0050] In this embodiment, refer to Figure 2As shown, each of the n+1 channels (L0-Ln) is independently configured with a write counter to record the number of descriptors currently written to the channel (i.e., the second number). The write counter is initially set to 0 and increments by 1 each time a descriptor is written to the channel, accurately tracking the channel's write progress and determining whether the channel has reached a readable condition. This embodiment also independently configures a read flag for each channel. The read flag is a status flag bit for each channel that indicates whether the channel is readable. The read flag includes two values: a first preset value and a second preset value. The first preset value can be 1, and the second preset value can be 0. When the value of the write counter of any channel equals the number of completed writes, the read flag can be set to 1. If the read flag of any channel is detected to be 1, it can be determined that at least one first readable channel exists among the multiple channels, thereby triggering polling.
[0051] For example, assume there are three channels, A, B, and C. A occupies RAM address space 0-127, B occupies RAM address space 128-255, and C occupies RAM address space 256-383. The number of write completions for A is 3, the number of write completions for B is 2, and the number of write completions for C is 4.
[0052] Descriptor writing and counter updating: For A, writing the first descriptor (address 0) → the write counter value is 1; writing the second descriptor (address 1) → the write counter value is 2; writing the third descriptor (address 2) → the write counter value is 3; for B, writing the first descriptor (address 128) → the write counter value is 1; writing the second descriptor (address 129) → the write counter value is 2. For C, writing the first descriptor (address 256) → the write counter value is 1 (the write completion count of 4 has not been reached and it is currently unreadable).
[0053] Read flag update: For A: the count value of the write counter is 3, which is equal to the number of writes completed corresponding to A (3), and the read flag is set to 1 (readable); for B: the count value of the write counter is 2, which is equal to the number of writes completed corresponding to B (2), and the read flag is set to 1 (readable); for C: the count value of the write counter is 1, which is less than the number of writes completed corresponding to C (4), and the read flag remains 0 (unreadable).
[0054] It is detected that the read flags of A and B are set to 1, and it is determined that A and B are both the first readable channels. The descriptors are read according to the polling priority (such as A>B) and polling weight (such as A's polling weight is 2, B's polling weight is 1). Two descriptors are read from A (addresses 0-1), and the remaining one (address 2) is waiting for the next polling. One descriptor is read from B (address 128).
[0055] In this embodiment, the write counter and read flag can be implemented via registers or memory mapping, enabling efficient hardware access and reducing software judgment overhead. The read flag is updated synchronously with the write operation, ensuring immediate detection of the readable state and reducing latency. Each channel independently maintains the write counter and read flag, avoiding multi-channel contention and enhancing system stability. Polling is triggered only when the read flag is 1, reducing power consumption from ineffective channel scanning.
[0056] In an exemplary embodiment, descriptors stored in a readable channel are read according to the polling priority and polling weight corresponding to at least one readable channel, including: when there is one first readable channel, performing a read operation on the first readable channel; when there are multiple first readable channels, performing read operations on the multiple first readable channels in descending order of polling priority; wherein the read operation includes reading the descriptors stored in the first readable channel according to the polling weight corresponding to the first readable channel.
[0057] For example, because the total number of descriptors sent by the host computer to each channel may be different, and the timing of sending may also be different, the time when each channel becomes the first readable channel may also be different. There may be one or more first readable channels at the same time. If there is only one first readable channel, after polling is triggered, a read operation only needs to be performed on the first readable channel, that is, according to the polling weight of the first readable channel, a maximum of the first number of descriptors is read from the first readable channel. If there are multiple first readable channels, the read operation is performed on the multiple first readable channels in descending order of polling priority.
[0058] For example, assume there are three first readable channels, A, B, and C. A has a high polling priority and a polling weight of 3, B has a medium polling priority and a polling weight of 2, and C has a low polling priority and a polling weight of 1. Assume that A currently has three descriptors written, B has two descriptors written, and C has one descriptor written. This polling is performed in descending order of the polling priorities of A, B, and C. First, a read operation is performed on A, reading three descriptors from A. Then, a read operation is performed on B, reading two descriptors from B. Finally, a read operation is performed on C, reading one descriptor from C.
[0059] It is understood that if the number of remaining descriptors in the first readable channel is less than the first number represented by the polling weight, for example, if there is only one descriptor left in the first readable channel, only one descriptor will be read when the polling weight is equal to 2. In addition, if there are no readable descriptors in the first readable channel, the polling is automatically skipped.
[0060] This implementation prioritizes high-priority channels (such as real-time audio and video streams) to ensure low latency. Throughput allocation to each channel is controlled by polling weights, preventing starvation of low-priority channels. Batch reads (based on weights) reduce the number of DMA activations and improve data transfer efficiency.
[0061] In an exemplary embodiment, read operations are performed on multiple first readable channels in order from high to low polling priority, including: determining the first readable channel with the highest polling priority among all first readable channels on which the read operation has not been performed, performing a read operation on the first readable channel with the highest polling priority, and repeating this step until the descriptors in all first readable channels are taken out.
[0062] In this embodiment, among all first-readable channels, the one with the highest priority is processed first. A first-readable channel that has not yet been read is one that has been marked as readable (meets the write completion condition) but has not yet been polled, or has only been partially read (still has remaining descriptors). Among the unprocessed channels, the one with the highest polling priority is selected to ensure that critical data is processed first.
[0063] In this embodiment, it is assumed that there are four first readable channels, namely A, B, C, and D, A and C are high priority, B is low priority, and D is medium priority. According to a preset order or randomly, one channel is selected from A and C to perform a reading operation first. For example, A is selected first for the reading operation. After the reading operation on A is completed, if there is a new first readable channel E with a higher polling priority than A, the reading operation is performed on E. If there is no new first readable channel with a higher polling priority than A, the reading operation is performed on C with the same polling priority as A. After the reading operation on C, if there is no new first readable channel with a higher polling priority than C, and there are still unread descriptors in A and / or C, polling is performed between the two until all the descriptors between A and C are retrieved. The reading process of B and D is the same.
[0064] In this embodiment, it can be ensured that the descriptor of the highest priority channel is processed first, meeting the real-time system requirements, and the low priority channels will not preempt the resources of the high priority channels, thus avoiding service interference.
[0065] In an exemplary embodiment, among all first readable channels that have not performed a read operation, a first readable channel with the highest polling priority is determined, a read operation is performed on the first readable channel with the highest polling priority, and this step is repeated until the descriptors in all first readable channels are taken out, including: determining a current readable channel with the highest polling priority among all first readable channels that have not performed a read operation; performing a read operation on the current readable channel, and determining whether there is a first target readable channel with a higher polling priority than the current readable channel among all first readable channels; if the first target readable channel exists, using the first target readable channel as a new current readable channel, and performing a read operation on the current readable channel , and determine whether there is an operation of a first target readable channel with a higher polling priority than the current readable channel among all the first readable channels; if there is no first target readable channel, determine whether there is a second target readable channel with the same polling priority as the current readable channel; if there is a second target readable channel, use the second target readable channel as the new current readable channel, perform a read operation on the current readable channel, and determine whether there is an operation of a first target readable channel with a higher polling priority than the current readable channel among all the first readable channels; if there is no second target readable channel, execute the operation of determining the current readable channel with the highest polling priority among all the first readable channels that have not performed the read operation.
[0066] In this embodiment, the current readable channel refers to the channel currently being processed, and a read operation will be performed on it (reading the descriptor according to the polling weight). The first target readable channel is a channel among the unprocessed channels whose polling priority is higher than that of the current readable channel. The second target readable channel is a channel among the unprocessed channels whose polling priority is the same as that of the current readable channel. First, determine a current readable channel with the highest polling priority from multiple first readable channels. After performing a read operation on the current readable channel, determine whether there is a first target readable channel with a higher polling priority than the current readable channel. If so, use the first target readable channel as the new current readable channel and perform a read operation on the new current readable channel. If the first target readable channel does not exist, determine whether there is a second target readable channel with the same polling priority as the current readable channel. If so, use the second target readable channel as the new current readable channel and perform a read operation on the new current readable channel. If not, determine the current readable channel with the highest polling priority among all first readable channels that have not performed a read operation. If the current readable channel has not been read, continue to read the descriptor of the current readable channel. If the current readable channel is taken out, determine the current readable channel from other first readable channels.
[0067] For example, assume that the channels include A (high polling priority, polling weight of 2, and 4 readable descriptors), B (medium polling priority, polling weight of 3, and 6 readable descriptors), C (medium polling priority, polling weight of 1, and 2 readable descriptors), and D (low polling priority, polling weight of 1, and 3 readable descriptors). Initially, the unprocessed channels include A, B, C, and D. A, which has the highest priority, is selected (the current readable channel). Two descriptors are read, and the number of remaining descriptors is 2. Round 1: Check whether there is a higher priority channel (whether there is a first target readable channel): No (A is already the highest priority). Check for channels with the same priority (whether there is a second target readable channel): No (A has the only priority). Continue to select A, read two descriptors, and retrieve all descriptors in A. Second round: The unprocessed channels include B, C, and D. B is selected and three descriptors are read. B still has three descriptors remaining. A check is made for a higher polling priority channel (whether a first target readable channel exists): None (B currently has the highest priority). A check is made for channels with the same polling priority (whether a second target readable channel exists): C. The channel switches to C and reads one descriptor. C still has one descriptor remaining. A check is made for a higher priority channel (whether a first target readable channel exists): None. A check is made for channels with the same polling priority (whether a second target readable channel exists): B. The channel switches back to B and reads three descriptors, retrieving all descriptors from B. The unprocessed channels include C and D. C, with the highest polling priority, is selected and one descriptor is read. C is retrieved, leaving only D. The read is divided into three passes, one descriptor each. The above example assumes that there are no additional first readable channels besides A, B, C, and D. If a new first readable channel with a higher polling priority than A, B, C, or D is discovered during the read process, the higher-priority first readable channel will be switched to after completing A, B, C, or D.
[0068] In this embodiment, if a higher priority channel is added during runtime, it can immediately preempt the current processing, meeting hard real-time requirements and avoiding starvation of channels of the same priority due to sequencing issues (e.g., channels B and C are processed alternately, rather than B monopolizing resources).
[0069] Among them, if there is a second target readable channel, the second target readable channel is used as the new current readable channel, including: if there is a second target readable channel, and there are multiple second target readable channels, the new current readable channel is selected from the multiple second target readable channels in a preset order.
[0070] In this embodiment, if there are multiple second-target readable channels, a new current readable channel can be selected from the multiple second-target readable channels in a preset order. The preset order and the fixed scheduling order between priority channels include, but are not limited to, ascending channel ID order (channel 0 > channel 1 > channel 2); rotation order (last processed channel + 1); and weight ratio (higher-weighted channels take precedence). By enforcing rotation in the preset order, all channels of equal priority are processed.
[0071] In an exemplary embodiment, the data transmission method further includes: after performing a read operation on the current readable channel, updating the number of executions of the read operation of the current readable channel; when the number of executions matches the second number, setting the read flag of the current readable channel to a second preset value, so as to determine whether there is at least one first readable channel among the multiple channels based on the read flag.
[0072] In this embodiment, refer to Figure 3 and Figure 4 Each of the n+1 channels (L0-Ln) is independently configured with a read counter. The initial value of the read counter is 0. Each time a descriptor is read from the channel, the read counter increments by 1. (The read counter records the position, that is, the number of descriptors read.) When the read counter and the write counter match, all descriptors written to the channel are retrieved. When the read counter and the write counter match, the read flag of the channel is set to 0, which means that the channel status is adjusted to unreadable.
[0073] Specifically, first determine whether there is a first readable channel with a read flag of 1 in multiple channels. If not, maintain the idle state. If so, select the channel with the highest priority, read m descriptors in the channel (m is the polling weight of the channel), increase the read counter by 1 each time it is read, and determine whether the count values of the read counter and write counter of the channel match. If so, clear the read counter, clear the write counter, set the read flag to 0, and enter the operation of determining whether there is a channel with a read flag of 1. If there is no match, determine whether there is a channel with a read flag of 1. If so, determine whether there is a channel with a higher priority. If there is no higher channel, poll with the same priority. If a higher channel exists, select the channel with a higher priority. If there is no channel with a read flag of 1, enter the idle state.
[0074] In an exemplary embodiment, a read operation is performed on a current readable channel, including: determining a third number of descriptors stored in the current readable channel; when the third number is less than or equal to a first number corresponding to the current readable channel, reading all descriptors in the current readable channel; when the third number is greater than the first number corresponding to the current readable channel, reading the first number of descriptors in the current readable channel.
[0075] In this embodiment, the third number is the actual number of descriptors to be read in the current readable channel, which changes dynamically (decreases with each read operation). Even if the number of descriptors to be read is less than the polling weight, they are read immediately to avoid waiting and reduce delay.
[0076] In an exemplary embodiment, a data transfer operation is performed based on a read descriptor that meets the execution conditions of direct memory access, including: when the read descriptor meets the execution conditions of direct memory access, performing the data transfer operation based on the read descriptor; when the read descriptor does not meet the execution conditions of direct memory access, splitting the descriptor into sub-descriptors that meet the execution conditions of direct memory access, and performing the data transfer operation based on the sub-descriptors.
[0077] In this embodiment, since the descriptor actually executed by the DMA controller is limited by Max_Payload_Size and the 4k address boundary, it is necessary to split the descriptor into multiple descriptors that meet the length requirements and the starting address requirements, that is, split a large descriptor into small sub-descriptors. The separated sub-descriptors cannot cross the 4K address boundary, and the length cannot exceed Max_Payload_Size.
[0078] In an exemplary embodiment, the readable channel includes a second readable channel; the data transmission method further includes: for each channel, determining whether the descriptor stored in the channel meets the execution conditions of direct memory access; if so, writing the descriptor into a sub-channel corresponding to the channel; if not, splitting the descriptor into sub-descriptors that meet the execution conditions of direct memory access, and writing the sub-descriptors into sub-channels corresponding to the channel; the sub-channels are set in a second storage medium; if any sub-channel is not empty, determining that a second readable channel exists in multiple channels.
[0079] In this embodiment, the polling weight acts on the sub-descriptor after the split, rather than the descriptor before the split. As an optional embodiment, the polling weight corresponding to each sub-descriptor is 1. Before and after the descriptor is split, a FIFO (sub-channel) with a depth of 4 is added for caching (the FIFO is designed using registers and does not occupy RAM memory) to ensure pipeline efficiency.
[0080] In an exemplary embodiment, descriptors stored in a readable channel are read according to the polling priority and polling weight corresponding to at least one readable channel, including: when there is one second readable channel, performing a read operation on the second readable channel; when there are multiple second readable channels, performing read operations on multiple second readable channels in descending order of polling priority; wherein the read operation includes reading the descriptors stored in the second readable channel according to the polling weight corresponding to the second readable channel.
[0081] In this embodiment, each channel's sub-channels (output FIFOs) are polled one by one, reading m (weighted) descriptors from each FIFO before polling the next one. If the output FIFO of a channel is empty (less than m descriptors) when polling, the channel is abandoned and the next one is polled. When the output FIFO is empty, it means that all descriptors in the channel have been executed. As an optional embodiment, the polling weight and polling priority are configured by the host computer through the PCIe base address space. The address space offset address and register description are shown in Table 2.
[0082] Table 2 Polling weight and polling priority configuration table
[0083] The above is just an example, you can choose according to the actual project needs.
[0084] In summary, this application saves a lot of storage resources and costs by using a dual-port RAM to store multiple channel descriptors. Increasing the channel weight improves the flexibility of the host computer in scheduling each channel, reasonably allocates the bandwidth of each channel, and thus improves the efficiency of accelerated applications. Two descriptor polling implementation methods are provided, and users can flexibly select the mode according to the characteristics of the application. By adding three priority levels (high, medium, and low), transmission can be optimized for specific applications to reduce latency.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0086] An embodiment of the present application also provides a data transmission device, including: a control register, configured to store the polling priority and polling weight corresponding to each channel; a first storage, configured with multiple channels; a write control component, configured to write the descriptors sent by the host into the corresponding channels; a read control component, configured to read the descriptors stored in the multiple channels according to the polling priority and polling weight; a splitting component, configured to output descriptors that meet the execution conditions of direct memory access; and an execution component, configured to perform a data transmission operation based on the read descriptors that meet the execution conditions of direct memory access.
[0087] Specifically, the control register communicates with the host computer through the advanced peripheral interface bus.
[0088] Please refer to Figure 5 , Figure 5This is a schematic diagram of a data transmission device in the first transmission scenario provided by the present application. In this scenario, the splitting component includes at least one FIFO (depth of 2). The splitting component judges whether the descriptor read out from the channel by polling meets the execution conditions of direct memory access. If not, the descriptor needs to be split and written to the FIFO, waiting for execution by the execution component. If it meets the conditions, the descriptor is directly written to the FIFO. When writing to the FIFO, it is also necessary to consider whether the FIFO currently has write space. If there is write space, it is written directly. If there is no write space, it waits.
[0089] Please refer to Figure 6 , Figure 6 This is a schematic diagram of a data transmission device under the second transmission scenario provided by the present application. In this scenario, the splitting component determines whether the descriptor written in the channel meets the execution conditions of direct memory access before the polling module polls. The splitting component includes multiple sub-channels (output FIFOs) corresponding to each channel. If not, the descriptor needs to be split and written to the sub-channel, and wait for polling. If it is satisfied, the descriptor is directly written to the corresponding sub-channel, and wait for polling. When writing to the sub-channel, it is also necessary to consider whether the sub-channel currently has write space. If there is write space, write directly. If there is no write space, wait. Figure 6 C0~Cn are respectively the sub-descriptors after the large descriptors that do not meet the direct memory access conditions and are stored in the sub-channels corresponding to channels L0~Ln are split or the descriptors that meet the execution conditions of direct memory access.
[0090] Please refer to Figure 7 , an embodiment of the present application also provides a data transmission system, including: a first determination module 01, configured to determine the polling priority and polling weight of the readable channel under the current application when there is at least one readable channel among multiple channels; the channel occupies the corresponding address space in the first storage medium to store the descriptor sent by the upper computer; a reading module 02, configured to read the descriptor stored in the readable channel according to the polling priority and polling weight corresponding to at least one readable channel; the polling weight represents the first number of descriptors read from the readable channel each time; and an execution module 03, configured to perform a data transmission operation according to the read descriptor that meets the execution condition of direct memory access.
[0091] In an exemplary embodiment, the readable channel includes a first readable channel; the data transmission system also includes: a first update module, used to update the second number of descriptors written in the channel when the descriptor is written to the corresponding channel; a first processing module, used to determine, for each channel, when the second number is equal to the corresponding write completion number of the channel, whether the first readable channel exists in multiple channels.
[0092] In an exemplary embodiment, when writing a descriptor to a corresponding channel, updating the second number of descriptors written in the channel includes: when writing the descriptor to the corresponding channel, controlling the value of a write counter corresponding to the channel to increment to update the second number of descriptors written in the channel; the data transmission system also includes a setting module for setting a read flag of the channel to a first preset value when the value of the write counter is equal to the number of write completions corresponding to the channel, so as to determine whether there is at least one first readable channel among the multiple channels based on the read flag.
[0093] In an exemplary embodiment, descriptors stored in a readable channel are read according to the polling priority and polling weight corresponding to at least one readable channel, including: when there is one first readable channel, performing a read operation on the first readable channel; when there are multiple first readable channels, performing read operations on the multiple first readable channels in descending order of polling priority; wherein the read operation includes reading the descriptors stored in the first readable channel according to the polling weight corresponding to the first readable channel.
[0094] In an exemplary embodiment, read operations are performed on multiple first readable channels in order from high to low polling priority, including: determining the first readable channel with the highest polling priority among all first readable channels on which the read operation has not been performed, performing a read operation on the first readable channel with the highest polling priority, and repeating this step until the descriptors in all first readable channels are taken out.
[0095] In an exemplary embodiment, among all first readable channels that have not performed a read operation, a first readable channel with the highest polling priority is determined, a read operation is performed on the first readable channel with the highest polling priority, and this step is repeated until the descriptors in all first readable channels are taken out, including: determining a current readable channel with the highest polling priority among all first readable channels that have not performed a read operation; performing a read operation on the current readable channel, and determining whether there is a first target readable channel with a higher polling priority than the current readable channel among all first readable channels; if the first target readable channel exists, using the first target readable channel as a new current readable channel, and performing a read operation on the current readable channel , and determine whether there is an operation of a first target readable channel with a higher polling priority than the current readable channel among all the first readable channels; if there is no first target readable channel, determine whether there is a second target readable channel with the same polling priority as the current readable channel; if there is a second target readable channel, use the second target readable channel as the new current readable channel, perform a read operation on the current readable channel, and determine whether there is an operation of a first target readable channel with a higher polling priority than the current readable channel among all the first readable channels; if there is no second target readable channel, execute the operation of determining the current readable channel with the highest polling priority among all the first readable channels that have not performed the read operation.
[0096] In an exemplary embodiment, if a second target readable channel exists, the second target readable channel is used as a new current readable channel, including: if a second target readable channel exists, and there are multiple second target readable channels, a new current readable channel is selected from the multiple second target readable channels in a preset order.
[0097] In an exemplary embodiment, the data transmission system also includes: a second update module, which is used to update the number of executions of the read operation of the current readable channel after performing the read operation on the current readable channel; when the number of executions matches the second number, the read flag of the current readable channel is set to a second preset value, so as to determine whether there is at least one first readable channel in multiple channels based on the read flag.
[0098] In an exemplary embodiment, a read operation is performed on a current readable channel, including: determining a third number of descriptors stored in the current readable channel; when the third number is less than or equal to a first number corresponding to the current readable channel, reading all descriptors in the current readable channel; when the third number is greater than the first number corresponding to the current readable channel, reading the first number of descriptors in the current readable channel.
[0099] In an exemplary embodiment, a data transfer operation is performed based on a read descriptor that meets the execution conditions of direct memory access, including: when the read descriptor meets the execution conditions of direct memory access, performing the data transfer operation based on the read descriptor; when the read descriptor does not meet the execution conditions of direct memory access, splitting the descriptor into sub-descriptors that meet the execution conditions of direct memory access, and performing the data transfer operation based on the sub-descriptors.
[0100] In an exemplary embodiment, the execution condition of the direct memory access is determined based on the maximum payload size and the 4k address boundary.
[0101] In an exemplary embodiment, the readable channel includes a second readable channel; the data transmission system also includes: a splitting module, which is used to determine, for each channel, whether the descriptor stored in the channel meets the execution conditions of direct memory access, and if so, write the descriptor into the sub-channel corresponding to the channel; if not, split the descriptor into sub-descriptors that meet the execution conditions of direct memory access, and write the sub-descriptors into the sub-channel corresponding to the channel; the sub-channel is set in a second storage medium; and a second processing module is used to determine whether a second readable channel exists in multiple channels when any sub-channel is not empty.
[0102] In an exemplary embodiment, descriptors stored in a readable channel are read according to the polling priority and polling weight corresponding to at least one readable channel, including: when there is one second readable channel, performing a read operation on the second readable channel; when there are multiple second readable channels, performing read operations on multiple second readable channels in descending order of polling priority; wherein the read operation includes reading the descriptors stored in the second readable channel according to the polling weight corresponding to the second readable channel.
[0103] In an exemplary embodiment, the polling weights corresponding to the second readable channels are the same.
[0104] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned data transmission method embodiments.
[0105] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned data transmission method embodiments when running.
[0106] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0107] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned data transmission method embodiments are implemented.
[0108] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned data transmission method embodiments are implemented.
[0109] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0110] The above is a detailed introduction to a data transmission method, system, product, equipment, medium and device provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A data transmission method, characterized in that: include: When there is at least one readable channel among the multiple channels, determining the polling priority and polling weight of the readable channel under the current application; The channel occupies a corresponding address space in the first storage medium to store the descriptor sent by the host computer; Reading the descriptors stored in the readable channels according to the polling priority and polling weight corresponding to at least one of the readable channels; The polling weight represents a first number of descriptors read from the readable channel each time; The data transfer operation is performed according to the read descriptor that meets the execution conditions of direct memory access.
2. The data transmission method according to claim 1, wherein: The readable channel includes a first readable channel; The data transmission method further includes: When writing a descriptor to a corresponding channel, updating a second number of descriptors written in the channel; For each of the channels, when the second number is equal to the number of write completions corresponding to the channel, it is determined that the first readable channel exists among the plurality of channels.
3. The data transmission method according to claim 2, wherein: When writing a descriptor to a corresponding channel, updating a second number of descriptors written in the channel includes: When writing a descriptor to a corresponding channel, controlling the value of a write counter corresponding to the channel to increment, so as to update a second number of descriptors written in the channel; The data transmission method further includes: When the value of the write counter is equal to the number of write completions corresponding to the channel, the read flag of the channel is set to a first preset value, so as to determine whether there is at least one first readable channel among the multiple channels based on the read flag.
4. The data transmission method according to claim 2, wherein: Reading the descriptor stored in the readable channel according to the polling priority and polling weight corresponding to at least one of the readable channels includes: When the number of the first readable channel is one, performing a read operation on the first readable channel; When there are multiple first readable channels, performing a read operation on the multiple first readable channels in sequence according to the order of the polling priority from high to low; The reading operation includes reading the descriptor stored in the first readable channel according to the polling weight corresponding to the first readable channel.
5. The data transmission method according to claim 4, characterized in that: Performing read operations on the plurality of first readable channels in order of the polling priorities from high to low, including: Among all first readable channels that have not performed the read operation, determine the first readable channel with the highest polling priority, perform the read operation on the first readable channel with the highest polling priority, and repeat this step until the descriptors in all first readable channels are retrieved.
6. The data transmission method according to claim 5, characterized in that: Determining the first readable channel with the highest polling priority among all first readable channels for which the read operation has not been performed, performing the read operation on the first readable channel with the highest polling priority, and repeating this step until all descriptors in the first readable channels are retrieved, including: Determine the current readable channel with the highest polling priority among all first readable channels that have not performed a read operation; Performing the read operation on the current readable channel, and determining whether there is a first target readable channel with a higher polling priority than the current readable channel among all the first readable channels; If the first target readable channel exists, use the first target readable channel as a new current readable channel, perform the read operation on the current readable channel, and determine whether there is a first target readable channel with a higher polling priority than the current readable channel among all the first readable channels; If the first target readable channel does not exist, determining whether there is a second target readable channel having the same polling priority as the current readable channel; If the second target readable channel exists, use the second target readable channel as a new current readable channel, perform the read operation on the current readable channel, and determine whether there is a first target readable channel with a higher polling priority than the current readable channel among all the first readable channels; If the second target readable channel does not exist, an operation of determining the current readable channel with the highest polling priority among all first readable channels that have not performed a read operation is performed.
7. The data transmission method according to claim 6, characterized in that: If the second target readable channel exists, using the second target readable channel as a new current readable channel includes: If the second target readable channel exists, and there are multiple second target readable channels, a new current readable channel is selected from the multiple second target readable channels in a preset order.
8. The data transmission method according to claim 6, wherein: The data transmission method further includes: After executing the read operation on the current readable channel, updating the execution count of the read operation on the current readable channel; When the execution count matches the second number, the read flag of the current readable channel is set to a second preset value, so as to determine whether there is at least one first readable channel in the plurality of channels based on the read flag.
9. The data transmission method according to claim 6, wherein: Performing the read operation on the current readable channel includes: determining a third number of descriptors stored in the current readable channel; When the third number is less than or equal to the first number corresponding to the current readable channel, read all the descriptors in the current readable channel; When the third number is greater than the first number corresponding to the current readable channel, the first number of descriptors in the current readable channel is read.
10. The data transmission method according to any one of claims 2 to 9, characterized in that: Execute data transfer operations based on the read descriptors that meet the direct memory access execution conditions, including: When the read descriptor meets the execution condition of direct memory access, the data transfer operation is performed according to the read descriptor; When the read descriptor does not meet the execution condition of the direct memory access, the descriptor is split into sub-descriptors that meet the execution condition of the direct memory access, and a data transfer operation is performed according to the sub-descriptors.
11. The data transmission method according to claim 10, wherein: The execution condition of the direct memory access is determined based on a maximum payload size and a 4k address boundary.
12. The data transmission method according to claim 1, wherein: The readable channel includes a second readable channel; The data transmission method further includes: For each of the channels, determining whether a descriptor stored in the channel satisfies an execution condition for direct memory access, and if so, writing the descriptor into a sub-channel corresponding to the channel; if not, splitting the descriptor into sub-descriptors that satisfy the execution condition for direct memory access, and writing the sub-descriptors into sub-channels corresponding to the channel; the sub-channels are located in a second storage medium; If any of the subchannels is not empty, it is determined that the second readable channel exists in the multiple channels.
13. The data transmission method according to claim 12, wherein: Reading the descriptor stored in the readable channel according to the polling priority and polling weight corresponding to at least one of the readable channels includes: When the second readable channel is one, performing a read operation on the second readable channel; When there are multiple second readable channels, performing a read operation on the multiple second readable channels in descending order of the polling priority; The reading operation includes reading the descriptor stored in the second readable channel according to the polling weight corresponding to the second readable channel.
14. The data transmission method according to claim 12, wherein: The polling weights corresponding to the second readable channels are the same.
15. A data transmission system, characterized in that: include: A first determining module is configured to determine the polling priority and polling weight of the readable channel under the current application when there is at least one readable channel among the multiple channels; The channel occupies a corresponding address space in the first storage medium to store the descriptor sent by the host computer; a reading module configured to read the descriptors stored in the readable channels according to the polling priority and polling weight corresponding to at least one of the readable channels; The polling weight represents a first number of descriptors read from the readable channel each time; The execution module is configured to execute a data transfer operation according to a read descriptor that meets the execution condition of direct memory access.
16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the data transmission method according to any one of claims 1 to 14 are implemented.
17. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the data transmission method according to any one of claims 1 to 14 when executing the computer program.
18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 14 are implemented.
19. A data transmission device, characterized in that: include: A control register configured to store the polling priority and polling weight corresponding to each channel; A first storage medium, wherein the channel occupies a corresponding address space in the first storage medium to store a descriptor sent by a host computer; The write control component is configured to write the descriptor sent by the host into the corresponding channel; a read control component configured to read the descriptors stored in the plurality of channels according to the polling priority and the polling weight; A split component configured to output a descriptor that satisfies an execution condition for direct memory access; The execution component is configured to execute a data transfer operation according to a read descriptor that meets an execution condition of direct memory access.
20. The data transmission device according to claim 19, characterized in that include: The split components include: The sub-channel corresponding to the channel is configured to store a descriptor that meets the execution condition of the direct memory access.
Citation Information
Patent Citations
Priority adjustable multiple-channel direct memory access (DMA) controller
CN103064808A
A descriptor-based PCIE bus DMA controller and a data transmission control method
CN109471816A
Data transmission method, device, equipment and medium
CN116561030A
Multi-channel descriptor management system, method, equipment and medium
CN117667793A
Load balancing method and device based on direct memory access channel and medium
CN117807002A