Data transmission method and device, electronic equipment and medium
By classifying and merging data transmission tasks, multiple DMA engines are scheduled for parallel transmission, which solves the problem of reduced data transmission rate and uneven resource allocation caused by frequent descriptor access by DMA engines in NVMe solid-state drives, and improves system performance and stability.
Patent Information
- Application Number
- CN202410756305.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-10-01
AI Technical Summary
The frequent operations of the DMA engine in NVMe solid-state drives to access local memory to obtain descriptor contents through the bus reduce the data transfer rate, and the arbitration mechanism of multiple DMA engines can easily lead to uneven resource allocation, data congestion and overload, affecting system stability and performance.
By obtaining the classification information of the data transfer task, determine whether the merge triggering conditions are met, merge multiple data transfer tasks into a total task, configure a second descriptor for the total task, identify the corresponding direct memory access engine number, and schedule multiple direct memory Access engines perform data transfers in parallel.
It reduces the number of accesses to descriptors by the DMA engine, improves data transmission efficiency, evenly distributes resources, reduces system instability, and improves overall performance and stability.
Smart Images

Figure CN118733502A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data transmission, and in particular to a data transmission method, device, electronic device and medium. Background Art
[0002] As an efficient storage protocol, NVMe (Non-Volatile Memory express) is widely used in high-performance storage systems. In NVMe solid-state drives, a DMA (Direct Memory Access) engine is usually introduced to increase the data transmission rate.
[0003] However, each time a command is transmitted, the DMA engine needs to access the local memory through the bus to obtain the descriptor content, which greatly reduces the data transfer rate. At the same time, the arbitration mechanism of multiple DMA engines is usually RR (Round Robin) or WRR (eighted Round Robin), which is prone to uneven resource allocation, resulting in data congestion and overload, affecting system stability and performance. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a data transmission method, device, electronic device and medium. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a data transmission method is provided, including:
[0006] Get classification information of data transmission tasks;
[0007] Determine whether the data transmission tasks of the same category meet the merging trigger condition;
[0008] When the merging trigger condition is met, selecting a plurality of the data transmission tasks and merging them into one or more general tasks; configuring a second descriptor for the merged general tasks;
[0009] Identify the second descriptor and determine the direct memory access engine number corresponding to the overall task;
[0010] Based on the second description, multiple direct memory access engines are scheduled to perform data transmission in parallel.
[0011] Optionally, it also includes:
[0012] Acquire the data transmission task; configure a first descriptor for the data transmission task; the first descriptor includes a source address, a target address and a data transmission direction;
[0013] In a case where the data transmission tasks are not merged, allocating a direct memory access engine for the data transmission tasks according to the first descriptor;
[0014] The direct memory access engine is controlled to perform data transfer according to the first descriptor.
[0015] Optionally, the obtaining classification information of the data transmission task includes:
[0016] Get address classification threshold;
[0017] Comparing the source addresses of the data transmission tasks;
[0018] When the difference of the source addresses is less than or equal to the address classification threshold, classifying the data transmission tasks into the same primary address classification;
[0019] For the data transmission tasks in the same first-level address classification, the same address classification number is configured; for the data transmission commands corresponding to the same first-level classification address, according to the command priority of the data transmission command, the data transmission commands with the same command priority are classified into the same second-level priority classification;
[0020] The same priority category number is configured for the data transmission tasks in the same secondary priority category.
[0021] Optionally, the data transmission task carries a memory access granularity, and the determining whether the data transmission tasks of the same category meet a merging trigger condition includes:
[0022] Obtaining a maximum transmission unit of a direct memory access engine and a memory access granularity of the data transmission task;
[0023] Determine, according to the maximum transmission unit and the memory access granularity, a value interval of a total data transmission amount threshold and a value interval of a command number threshold;
[0024] Determining the command number threshold and the data transmission total amount threshold according to the data transmission situation;
[0025] When the sum of the memory access granularities corresponding to the various data transfer tasks is greater than or equal to the total data transfer threshold, and / or when the number of the various data transfer tasks is greater than or equal to the command number threshold, the merge trigger condition is met.
[0026] Optionally, determining the command number threshold and the data transmission total amount threshold according to the data transmission situation includes:
[0027] Monitoring the transmission information of the data transmission; the transmission information includes: the merging success rate of the total task, the data transmission rate and the number of configuration times of the descriptor;
[0028] The merging threshold is adjusted according to the transmission information.
[0029] Optionally, the second descriptor includes an address classification number and a priority classification number, and the scheduling of multiple direct memory access engines to perform data transmission in parallel includes:
[0030] Determining the corresponding direct memory access engine number according to the address classification number;
[0031] According to the direct memory access engine number, selecting a direct memory access channel for managing the direct memory access engine from the channel pool;
[0032] For the same direct memory access engine, according to the priority classification number, the direct memory access engine executes the total task in order from high to low priority;
[0033] Before selecting the direct memory access channel for managing the direct memory access engine from the channel pool, the method includes:
[0034] Establish multiple direct memory access channels according to hardware configuration and performance requirements to form a channel pool; the direct memory access channels are independent of each other;
[0035] One of the direct memory access channels manages one of the direct memory access engines; a leaky bucket algorithm is configured for each of the direct memory access channels; the leaky bucket algorithm includes a leaky bucket capacity and a leak rate;
[0036] Controlling the data transmission rate according to the leaky bucket capacity and the water leakage rate;
[0037] In case that the direct memory access engine managed by the direct memory access channel performs data transmission, the direct memory access channel is marked as occupied.
[0038] Optionally, controlling the data transmission rate according to the leaky bucket capacity and the water leakage rate comprises: when the direct memory access engine executes the data transmission task corresponding to the total task, detecting the load of the direct memory access engine and the flow of the direct memory access channel;
[0039] When the load of the direct memory access engine is higher than a first load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be lower than a first data transmission rate;
[0040] When the load of the direct memory access engine is lower than a second load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be higher than a second data transmission rate;
[0041] The first load threshold is greater than the second load threshold; the first data transmission rate is less than the second data transmission rate.
[0042] Optionally, after scheduling multiple direct memory access engines to perform data transmission in parallel, the method further includes: when the direct memory access engine completes the overall task, reclaiming the direct memory access channel and marking the direct memory access channel as unoccupied;
[0043] In the process of reclaiming the direct memory access channel, resetting the leaky bucket algorithm;
[0044] The configuration information of the second descriptor is modified, and the execution of the overall task corresponding to the second descriptor is marked as completed.
[0045] According to a second aspect of an embodiment of the present disclosure, there is provided a data transmission device, including:
[0046] A classification acquisition module is used to obtain classification information of data transmission tasks;
[0047] A merging judgment module, used to judge whether the data transmission tasks of the same category meet the merging trigger condition; a task merging module, used to select a plurality of the data transmission tasks and merge them into one or more general tasks when the merging trigger condition is met; and configure a second descriptor for the merged general task;
[0048] An engine determination module, used for identifying the second descriptor and determining a direct memory access engine number corresponding to the overall task;
[0049] A data transmission module is used to schedule multiple direct memory access engines to perform data transmission in parallel based on the second description.
[0050] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the data transmission method described in the first aspect are implemented.
[0051] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data transmission method described in the first aspect are implemented.
[0052] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the data transmission method described in the first aspect are implemented.
[0053] By acquiring classification information of data transmission tasks and merging data transmission tasks of the same classification, the number of times the DMA engine accesses the descriptor each time a task is executed can be reduced, thereby reducing the need to access the bus and memory and improving transmission efficiency; by identifying the second descriptor and allocating the corresponding DMA engine to the total task, the DMA engine can be reasonably scheduled, resources can be allocated more evenly, the speed and efficiency of the overall data transmission can be improved through parallel processing, and the load of a single DMA engine can be reduced, which can reduce system instability caused by improper task arbitration and overload, thereby improving the performance and stability of the entire system. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0055] Figure 1 is a schematic diagram of a traditional DMA engine data transfer shown in an embodiment of the present disclosure;
[0056] Figure 2 is a schematic diagram of the steps of a data transmission method shown in an embodiment of the present disclosure;
[0057] Figure 3 is a schematic diagram of a data transmission system based on NVMe shown in an embodiment of the present disclosure;
[0058] Figure 4 It is a schematic diagram of a data transmission process based on NVMe shown in an embodiment of the present disclosure;
[0059] Figure 5 is a block diagram of a data transmission device shown in an embodiment of the present disclosure;
[0060] Figure 6 is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0062] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0063] With the rapid development of technologies such as big data, cloud computing, and artificial intelligence, higher requirements are placed on the speed and efficiency of data storage and transmission. As an efficient storage protocol, NVMe protocol is widely used in high-performance storage systems. In NVMe solid-state drives, a DMA engine is usually introduced to increase the data transfer rate.
[0064] Figure 1 FIG. 1 is a schematic diagram of a traditional DMA engine data transfer shown in an embodiment of the present disclosure. Figure 1As shown in the figure, the host sends an SQ (Submission Queue) command to the NVMe SSD (Solid State Disk) through the AXI (Advanced eXtensible Interface) bus. After the command is processed by the internal module of the controller, it is transmitted to the local memory through the AXI (Advanced eXtensible Interface) bus. The CPU obtains the command from the local memory and programs a descriptor for it to describe the command transmission information and store it in the local memory. After the descriptor configuration is completed, the CPU sends the information that can be used for data transmission to the DMA engine through the bus. The DMA engine reads the descriptor content from the local memory, and moves data between the host memory and the local memory according to the descriptor content. At the same time, the descriptor and the DMA engine status register are updated in the local memory to indicate the transmission status. After the data transmission is completed, the DMA engine writes the completion interrupt information back to the local memory and notifies the CPU. In addition, in the NVMe SSD, the priority information of the DMA engine is configured by the CPU and stored in the DMA control register. The arbitration mode is generally RR arbitration or WRR arbitration.
[0065] Therefore, in traditional technology, each time data is transferred, the CPU needs to access the register through the bus to trigger the DMA engine, and the DMA engine also needs to read the descriptor content from the local memory through the bus. In the NVMe system, the number of I / O (Input / Output) SQs can reach up to 64k-1 (65535), and the depth of I / O SQ can reach 64k. If each I / O SQ command is transmitted in the above manner, it will take a lot of time, increase the bus occupancy rate, and greatly reduce the data transfer rate. On the other hand, the execution order of different DMA engines in NVMe SSD is generally RR arbitration or WRR arbitration. When some high-priority tasks are not processed in time and there is an uneven allocation of resources, data congestion and overload are likely to occur, affecting system stability and performance.
[0066] In order to solve the above technical problems, the present disclosure proposes a data transmission method and device, which can merge multiple data transmission tasks into one or more general tasks and assign a corresponding DMA engine to each general task. Multiple DMA engines can transmit data in parallel.
[0067] Figure 2 FIG. 1 is a schematic diagram of a data transmission method according to an embodiment of the present disclosure. Figure 2 As shown, the data transmission method may specifically include the following steps:
[0068] Step S11: Acquire classification information of the data transmission task.
[0069] Collect basic information of data transmission requests entering the system, including data source address, target address, data size, task priority, etc., classify data transmission tasks according to the basic information of the data transmission requests, and store the classification results. The classification may include multiple rounds of classification, for example, two rounds of classification are performed, a second round of classification is performed based on the first round of classification, and the second round of classification is used as the final result. The data transmission tasks classified in the second round belong to the same category in both rounds of classification.
[0070] Among them, in an optional embodiment, the acquisition of classification information of the data transmission task includes: obtaining an address classification threshold; comparing the source addresses of each of the data transmission tasks; classifying the data transmission tasks into the same first-level address classification when the difference of the source addresses is less than or equal to the address classification threshold; configuring the same address classification number for the data transmission tasks in the same first-level address classification; for the data transmission commands corresponding to the same first-level classification address, classifying the data transmission commands with the same command priority into the same second-level priority classification according to the command priority of the data transmission commands; configuring the same priority classification number for the data transmission tasks in the same second-level priority classification.
[0071] The address classification threshold is used to compare the proximity between the source addresses of different data transmission tasks. The setting of the threshold can be based on the network topology, geographical location or data center configuration. By comparing the source address of each received data transmission task, the logical or physical distance between the addresses can be calculated.
[0072] The difference in source addresses is determined based on the address classification threshold. If the difference in source addresses of two or more tasks is less than or equal to the threshold, these tasks are classified into the same first-level address classification. A unified address classification number is assigned to all data transmission tasks belonging to the same first-level address classification. This helps to identify these tasks in subsequent data processing and task scheduling.
[0073] Within the same first-level address classification, data transmission commands are further classified according to their priorities. Data transmission tasks with the same priority are classified into the same second-level priority classification. This classification takes into account the urgency and importance of the task. A unique priority classification number is assigned to each second-level priority classification task. This number helps to schedule and optimize data transmission according to priority.
[0074] Update the classification results and their numbers to the system's data management module. Ensure that all relevant system components can access this classification information to facilitate more efficient data scheduling and resource optimization.
[0075] According to the actual data transmission efficiency and system performance, the address classification threshold and priority classification method are optimized and adjusted. This can include adjusting the threshold size or redefining the priority rules to better match the actual operation requirements.
[0076] By adopting the embodiments of the present disclosure, tasks that are close in geographical location or network topology can be classified together by classifying according to source address differences, which helps to improve the overall data transmission efficiency. Detailed priority management and task classification allow for the implementation of more complex quality of service assurance strategies, ensuring that data transmission resources are allocated according to the importance and urgency of the tasks. Configuring unified address classification numbers and priority numbers for transmission tasks of the same category enables the data transmission management system to control resource allocation more accurately. Classifying and scheduling data transmission tasks according to address and priority helps to reasonably disperse device load. Through refined task classification, administrators can handle emergencies and adjust strategies more flexibly.
[0077] Step S12: Determine whether the data transmission tasks of the same category meet the merging trigger condition.
[0078] Identify and confirm the classification of each data transfer task. The merge trigger condition is a set of rules that determine when multiple tasks can be merged into a total task. The conditions in the rule set may include: if the data volume of a single task is less than a certain threshold, multiple small tasks can be merged to reduce the number of processing times and resource consumption; if the target addresses of multiple tasks are the same, merging these tasks can reduce the receiving pressure of the target system; data sent from the same source address can be merged to optimize read operations and reduce input / output operations; tasks with the same or similar priorities can be merged to maintain fairness and efficiency in processing; and before considering merging tasks, the available resources in the system, such as the availability of the DMA engine, must be evaluated. Merging tasks is only feasible when there are sufficient resources.
[0079] The system can use historical data and performance indicators to dynamically adjust the merge trigger conditions. For example, if merge tasks often lead to system congestion or performance bottlenecks in the past, the system may adjust the trigger conditions to prevent this from happening again. The system can monitor the current task and resource status in real time and make quick decisions based on the set trigger conditions.
[0080] Among them, in an optional embodiment, the data transmission task carries a memory access granularity, and the determination of whether the data transmission tasks of the same category meet the merge trigger condition includes: obtaining the maximum transmission unit of the direct memory access engine and the memory access granularity of the data transmission task; determining the value interval of the total data transmission threshold and the value interval of the command number threshold based on the maximum transmission unit and the memory access granularity; determining the command number threshold and the total data transmission threshold based on the data transmission situation; when the sum of the memory access granularities corresponding to each of the data transmission tasks is greater than or equal to the total data transmission threshold, and / or when the number of each of the data transmission tasks is greater than or equal to the command number threshold, the merge trigger condition is met.
[0081] The system needs to obtain the maximum transfer unit of the current DMA engine; the maximum transfer unit is the maximum amount of data that the DMA engine can process in one operation, and is a key parameter that affects data transfer efficiency. For each data transfer task, the system needs to obtain its memory access granularity. The memory access granularity refers to the size of the data block when the task accesses the memory, which can be determined by the nature of the task and the data type.
[0082] Based on the maximum transfer unit of the DMA engine and the memory access granularity of each task, the system calculates an appropriate range of values for the total data transfer threshold. For example, when merging data transfer tasks into one total task, at least two data transfer tasks are merged, and the maximum transfer unit can be used as the maximum value of the total data transfer threshold, and twice the memory access granularity can be used as the minimum value of the total data transfer threshold. Based on the maximum transfer unit of the DMA engine and the memory access granularity of each task, the system calculates an appropriate range of values for the command number threshold. For example, the quotient of the maximum transfer unit and the memory access granularity can be determined as the maximum value of the command number threshold, and the minimum value of the command number threshold is not less than 2.
[0083] The system can monitor the current data transmission tasks of the same category in real time, including the data volume and number of tasks of each task. According to the current transmission situation, the system determines whether the command number threshold and data transmission total amount threshold calculated above are reached. If the sum of the memory access granularity corresponding to each task is greater than or equal to the set data transmission total amount threshold, and / or the number of tasks is greater than or equal to the command number threshold, then the system determines that the merge trigger condition is met.
[0084] Once it is confirmed that the merge trigger condition is met, the system will perform a merge operation to merge multiple small tasks into a larger total task to improve the efficiency of data transmission and reduce the number of calls to the DMA engine.
[0085] Among them, in an optional embodiment, determining the command number threshold and the total data transmission threshold according to the data transmission situation includes: monitoring the transmission information of the data transmission; the transmission information includes: the merging success rate of the total task, the data transmission rate and the number of configuration times of the descriptor; and adjusting the merging threshold according to the transmission information.
[0086] Monitor and collect key performance indicators about data transfer tasks, including the merge success rate of total tasks, data transfer rate, and the number of descriptor configurations. Analyze the collected transfer information to evaluate the current data transfer performance and efficiency, which may include calculating the average data transfer rate, the ratio of successfully merged tasks, and the average number of descriptor configurations per task; the analysis may also include identifying performance bottlenecks or inefficient patterns, such as frequent descriptor reconfiguration or low merge success rate. Based on the analysis results of the transfer information, determine whether it is necessary to adjust the existing command number threshold and data transfer total amount threshold. If the existing thresholds result in poor performance or insufficient resource utilization, it may be necessary to adjust the thresholds. Apply the calculated new thresholds to the system's data transfer management policy. Use threshold adjustment and performance monitoring as a continuous feedback loop to achieve continuous performance optimization. Continuously adjust the thresholds based on the latest monitoring data and system requirements.
[0087] By adopting the embodiments of the present disclosure, by adjusting the command number threshold and the total data transmission threshold according to real-time monitoring data, the system can optimize the data transmission task according to the current network conditions and data processing capabilities. By monitoring key indicators such as the merger success rate and adjusting the data transmission strategy accordingly, the completion rate and reliability of the data transmission task can be effectively improved. The system's automatic monitoring and threshold adjustment mechanism reduces the need for manual intervention and achieves a higher level of operational automation. Dynamic adjustment of thresholds can allocate system resources more reasonably and increase the system's adaptability and flexibility to uncertain environmental factors. In addition, the mechanism of dynamically adjusting thresholds allows the system to be expanded more flexibly.
[0088] By adopting the embodiments of the present disclosure, by merging multiple data transmission tasks, the total number of times a single task is triggered can be reduced, thereby reducing processing overhead and system resource consumption. Merging tasks can optimize the access mode and order of memory and reduce access latency. By adjusting and optimizing the total data transmission amount threshold and command number threshold of the merging condition, the merging strategy can be dynamically adjusted according to the current data transmission task and the maximum transmission unit of the direct memory access engine. By merging multiple tasks into a single task, the data management and scheduling mechanism can be simplified, thereby reducing system complexity. Simplified system management can also help reduce the probability of errors and improve the stability and reliability of the system.
[0089] Step S13: when the merging trigger condition is met, select a plurality of the data transmission tasks and merge them into one or more general tasks; and configure a second descriptor for the merged general tasks.
[0090] Evaluate whether a predefined merge trigger condition is met. For example, if the sum of the memory access granularities corresponding to the data transfer tasks is greater than or equal to the total data transfer threshold, and / or if the number of the data transfer tasks is greater than or equal to the command number threshold, the merge trigger condition is met.
[0091] Select multiple data transfer tasks that meet the merging conditions from the same category. All data transfer tasks can be merged together when the merging conditions are met, or the data transfer tasks can be divided into multiple subsets, each of which meets the minimum requirements for merging tasks, so that the data transfer tasks of the same category can be merged into one or more total tasks.
[0092] A second descriptor is configured for the combined total task. The second descriptor includes necessary information to guide data transmission, such as memory address, data length, transmission direction, etc. It may also include classification information and may also include special instructions or flags on how to handle the combined task, such as using a specific DMA engine, specifying a priority, or defining an interrupt management strategy. For example, when classifying data transmission tasks according to the transmission address, the DMA engine close to the data transmission task classified by this address can be determined according to the distance, which can effectively improve the data transmission efficiency.
[0093] The configuration information of the first descriptor of the data transfer task involved in the merger can be incorporated into the second descriptor. Each first descriptor includes: submission queue ID, command ID, source address, target address, DMA transfer direction, transfer data size, SQ priority, descriptor valid bit and DMA transfer completion flag. If there are t data transfer tasks to be merged, then when configuring the second descriptor for the merged total task, the submission queue ID, command ID, source address, target address and DMA transfer direction of the first descriptor corresponding to each data transfer task can be incorporated into the second descriptor. Each type of configuration information of the first descriptor is uniformly configured in the second descriptor. For example, after the submission queue ID of each first descriptor is configured in the second descriptor, the command ID of each first descriptor will be configured.
[0094] Since the total task is merged based on the classified data transfer tasks, the classification information can be considered when configuring the second descriptor for the total task. For example, when classifying data transfer tasks, they can be classified according to the source address and priority of the data transfer, and the first-level address classification can be performed according to the source address. The same address classification number can be configured for the data transfer tasks in the same first-level address classification; for the data transfer commands corresponding to the same first-level classification address, the data transfer commands with the same command priority can be classified into the same second-level priority classification according to the command priority of the data transfer command; and the same priority classification number can be configured for the data transfer tasks in the same second-level priority classification. Among them, the address classification number can correspond to a DMA engine number, and when the data transfer tasks are classified according to the address, it can be synchronously determined which DMA engine the data transfer tasks of this category are assigned to. Therefore, the address classification number and the priority classification number can be configured in the second descriptor of the total task.
[0095] Bind the second descriptor to the combined overall task and ensure that these descriptors are correctly recognized and processed by the direct memory access engine in the system. The descriptors need to be passed to the appropriate hardware or software components, which are responsible for scheduling and executing the data transfer tasks.
[0096] Bind the second descriptor to the combined overall task and ensure that these descriptors are correctly recognized and processed by the direct memory access engine in the system. The descriptors need to be passed to the appropriate hardware or software components, which are responsible for scheduling and executing the data transfer tasks.
[0097] When a data transmission task is received, a first descriptor is configured for each data transmission task.
[0098] Table 1 is a data structure of a first descriptor shown in an embodiment of the present disclosure. As shown in Table 1, each data word corresponds to configuration information of a first descriptor. Among them, DW (Data Word) is often used to define the contents of each part of a data packet, message or other data structure in detail; SQID (Submission Queue Identifier) is used to identify and manage the queue of DMA requests, which helps the system distinguish different DMA task flows; CID (Command Identifier) combined with SQID is used to ensure that each DMA task is uniquely identifiable when executed, and is used for task tracking and management; SADDRESS (Source Address) is used to specify where the DMA operation reads data from, which is a key parameter for DMA read operations; DADDRESS (Destination Address) is used to specify where the DMA operation writes data to, which is a key parameter for DMA write operations; DMA operation (DMA transfer direction) is used to control the direction of data transfer and is a basic element for configuring DMA operations; Transfer size (transfer data size) is used to define the number of data bytes involved in DMA transfer; SQ priority (SQ priority) is used to determine the execution priority of DMA tasks, and high-priority tasks can be executed before other tasks; DMA valid (descriptor validity bit) is used to confirm the status of the descriptor to ensure that only valid descriptors are executed to avoid executing invalid or outdated DMA tasks; DMA done (DMA transfer completion flag) is used to monitor the completion status of DMA tasks, which helps the software understand when it can further process data or release resources.
[0099] DW Description 0 SQID 1 CID 2 SADDRESS 3 DADDRESS 4 DMA operation 5 Transfer size 6 SQ priority 7 DMA valid 8 DMA done
[0100] Table 1
[0101] The second descriptor of the combined overall task may be determined according to the first descriptors of the respective data transmission tasks.
[0102] Table 2 is a data structure of a second descriptor shown in an embodiment of the present disclosure. As shown in Table 2, if there are t data transmission tasks to be merged, DW0-DWt-1: SQID0, SQID1, ... SQIDt-1, submission queue ID of each data transmission task involved in the merger; DWt-DW2t-1: CID0, CID1, ... CIDt-1, command ID of each data transmission task involved in the merger; DW2t-DW3t-1: SADDRESS0, SADDRESS1, ... SADDRESSt-1, source address of each data transmission task involved in the merger; DW3t-DW4t-1: WADDRESS0, WADDRESS1, ... WADDRESSt-1, target address of each data transmission task involved in the merger; DW4t-DW5t-1: DMA operation0, DMA operation1, ... DMA operationt-1, DMA transmission direction of each data transmission task involved in the merger; DW5t: Transfer size, the total amount of transmission data of each data transmission task involved in the merger; DW5t+1: DMA number, the first-level address classification number of the total task, corresponding to the DMA engine number; DW5t+2: Task priority, the second-level priority classification number of the total task; DW5t+3: DMAvalid, descriptor valid bit; DW5t+4: DMA done, DMA transfer completion flag.
[0103]
[0104]
[0105] Table 2
[0106] Step S14: Identify the second descriptor and determine the direct memory access engine number corresponding to the total task. When the second descriptor is ready, the scheduler or controller in the system can identify this descriptor, and according to the information in the second descriptor, such as data size, target address and priority, the scheduler selects the most suitable DMA engine to execute the task. In a multi-engine system, the selection of a suitable DMA engine may also be based on the current load and availability of each engine to balance the system load and optimize performance. Once the appropriate DMA engine number is determined, the corresponding DMA engine needs to be configured to perform a specific data transfer task. Among them, when configuring the second descriptor for the total task, the classification information can be configured to the second descriptor together, for example, the address classification number, and the address classification number can correspond to a DMA engine number.
[0107] Step S15: Based on the second description, multiple direct memory access engines are scheduled to perform data transfer in parallel. The second descriptor of the merged total task is parsed in detail. The second descriptor contains all necessary information, such as specific parameters of the task. According to the information in the second descriptor, the system needs to evaluate the status and load of each engine in the existing DMA engine pool; consider the performance characteristics of each engine, the current workload and the urgency of the task to select the engine that best suits the current task requirements. After determining the DMA engines to be used, the system needs to configure these engines to perform data transfer in parallel.
[0108] If a bottleneck or substandard performance occurs during data transmission, the system may need to dynamically adjust the configuration of the DMA engine, such as changing the priority of the transmission, reallocating some tasks to other DMA engines with less load, or adjusting the data path. After the data transmission is completed, the system needs to clean up the resources used, including releasing the configured buffers and registers, and can generate a transmission report, including the total transmission time, the transmission success rate, and possible error records, for subsequent performance analysis and system optimization. Using the embodiments of the present disclosure, by merging similar data transmission tasks that meet specific trigger conditions, the overhead of individual task processing, such as initialization time and system resource allocation time, can be reduced. Merging tasks and configuring unified descriptors can make resource management more centralized and efficient. Selecting a suitable direct memory access (DMA) engine for task processing helps to optimize the workload of the DMA engine and improve resource utilization. By scheduling multiple DMA engines in parallel for data transmission, the waiting time can be effectively reduced, the data transmission speed can be increased, and the overall delay of the system can be reduced. Merging tasks and accurate engine matching can reduce errors and conflicts that may occur during data transmission, thereby increasing the reliability and stability of the transmission process.
[0109] Among them, in an optional embodiment, it also includes: obtaining the data transmission task; configuring a first descriptor for the data transmission task; the first descriptor includes a source address, a target address and a data transmission direction; when the data transmission task is not merged, allocating a direct memory access engine to the data transmission task according to the first descriptor; controlling the direct memory access engine to perform data transmission according to the first descriptor.
[0110] A data transmission task request is received from the application layer or the system scheduling layer. A first descriptor is generated or specified for each data transmission task; the first descriptor defines the key attributes of the task in detail.
[0111] Detect whether the data transmission task is merged. If the data transmission task is not merged, allocate a DMA engine according to the configuration information in the first descriptor corresponding to the data transmission task, and control the DMA engine to transfer data directly from the source address to the target address based on the first descriptor.
[0112] During data transmission, monitor the status and performance of the transmission and make adjustments if necessary to ensure the continuity and efficiency of the transmission.
[0113] If the data transfer task is completed, the DMA transfer completion flag in the corresponding first descriptor is set to 1, indicating that the task has been completed; the descriptor valid position is 1, indicating that the descriptor is unavailable, avoiding repeated execution of the same data transfer task.
[0114] By adopting the embodiment of the present disclosure, the first descriptor is configured for the received data transfer task to ensure that the system has clear task objectives and requirements. The descriptor includes key information such as the source address, the destination address, and the data transmission direction; by accurately configuring these parameters, it can be ensured that the data is accurately moved from one location to another, reducing the possibility of human configuration errors. Processing each task independently can reduce complex dependencies and possible conflicts; using a separate DMA engine to execute each task also means that multiple tasks can be processed in parallel, improving the overall efficiency and response speed of the system. Directly controlling the DMA engine to perform tasks according to detailed descriptors can maximize the accuracy and efficiency of operations and reduce the burden on the CPU.
[0115] Wherein, in an optional embodiment, the second descriptor includes an address classification number and a priority classification number, and the scheduling of multiple direct memory access engines to perform data transmission in parallel includes: determining the corresponding direct memory access engine number according to the address classification number; selecting a direct memory access channel that manages the direct memory access engine from the channel pool according to the direct memory access engine number; for the same direct memory access engine, according to the priority classification number, the direct memory access engine executes the total task in order from high to low priority; before selecting the direct memory access channel that manages the direct memory access engine from the channel pool, it includes: establishing multiple direct memory access channels according to hardware configuration and performance requirements to form a channel pool; the direct memory access channels are independent of each other; one direct memory access channel manages one direct memory access engine; configuring a leaky bucket algorithm for each direct memory access channel; the leaky bucket algorithm includes a leaky bucket capacity and a leak rate; controlling the data transmission rate according to the leaky bucket capacity and the leak rate; when the direct memory access engine managed by the direct memory access channel performs data transmission, marking the direct memory access channel as occupied.
[0116] Analyze the system's hardware configuration and performance requirements to determine how many DMA channels and engines are needed; based on the evaluation results, build a sufficient number of DMA channels, which are stored in a "channel pool" for dynamic allocation and management. Configure a leaky bucket algorithm for each DMA channel, which is used to control the rate of data transmission. The leaky bucket algorithm includes setting the leaky bucket capacity and the leak rate, which determine the smoothness and speed of data transmission. Set different leaky bucket capacities and leak rates for each channel based on the performance requirements of different channels.
[0117] According to the address classification number in the second descriptor of the task, determine the DMA engine number to be used; according to the parsed DMA engine number, select the corresponding DMA channel from the channel pool to manage these engines. Each channel independently manages a DMA engine. Analyze the priority classification number in the second descriptor of the task; on the same DMA engine, sort the tasks from high to low according to the priority number to ensure that the high-priority task is executed first.
[0118] On the selected DMA channel, data transfer is started according to the settings of the leaky bucket algorithm, and the data transfer rate is controlled to prevent overload; the performance during the transfer is monitored, and if necessary, the leaky bucket parameters are adjusted to optimize the transfer efficiency. While the data transfer is in progress, the DMA channel is marked as "occupied" to avoid resource conflicts on the same channel; after the transfer is completed, the channel status is updated and necessary cleanup is performed so that the channel can be used for new tasks.
[0119] By adopting the embodiments of the present disclosure, by using the address classification number to determine the specific DMA engine, it can be ensured that the data transmission task is directly assigned to the appropriate engine, thereby reducing processing delays and improving transmission efficiency. Independent channel management ensures that each DMA engine is controlled by a dedicated channel. Independent channel management and engine specialization reduce mutual interference between system components. By controlling the data transmission rate through the leaky bucket algorithm, the data flow can be balanced and adjusted to prevent data congestion and system overload. The introduction of priority classification numbers allows the system to sort the execution of tasks according to the urgency and importance of the tasks, ensuring that key tasks are executed first, thereby improving the response time and processing efficiency of the overall system. The establishment and management method of the channel pool provides good scalability for the system, which can support more DMA engines and greater data transmission requirements, and is also convenient for system upgrades based on future technological developments.
[0120] Among them, in an optional embodiment, the controlling the data transmission rate according to the leaky bucket capacity and the leakage rate includes: when the direct memory access engine executes the data transmission task corresponding to the total task, detecting the load of the direct memory access engine and the flow of the direct memory access channel; when the load of the direct memory access engine is higher than a first load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be lower than the first data transmission rate; when the load of the direct memory access engine is lower than a second load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be higher than the second data transmission rate; the first load threshold is greater than the second load threshold; the first data transmission rate is less than the second data transmission rate.
[0121] When a DMA task arrives at a DMA channel, the system can monitor the running load of the DMA engine and the data flow of the used channel in real time through a dynamic window. If the detected DMA engine load exceeds the preset first load threshold, the system will consider the current data transmission load to be too heavy and can take measures to reduce the data transmission rate to prevent the system from overloading; if the DMA engine load is lower than the second load threshold, the system will consider the current data transmission load to be light and capable of handling a higher data transmission rate. Combined with the leaky bucket algorithm, the leaky bucket parameters are dynamically adjusted according to the system status and traffic requirements. For example, when the system load is high, the data transmission rate is reduced to reduce the window traffic; when the load is low, the data transmission rate is increased to increase the window throughput. For example, the dynamic window can be used to monitor the system's performance indicators such as latency, throughput, and error rate in real time, and the leaky bucket parameters can be adaptively adjusted to achieve fine traffic control.
[0122] The system can continuously and dynamically adjust the data transmission rate according to the real-time load and traffic conditions, so the system has the ability to quickly respond and process algorithm adjustments.
[0123] Using the embodiments of the present disclosure, when the load of the DMA engine exceeds the first load threshold, the system reduces the load by reducing the data transmission rate, which can effectively prevent system crashes or performance degradation caused by excessive data loads and ensure stable operation of the system. When the load is lower than the second load threshold, the system increases the data transmission rate, which can make full use of available resources and improve the overall efficiency and data processing capabilities of the system. By adjusting the data transmission rate to match the processing power of the DMA engine, the leaky bucket algorithm helps smooth the data flow and reduce the impact of sudden large amounts of data. This smoothing operation helps avoid bottlenecks and delays during data transmission. The system can respond quickly based on the load and traffic conditions monitored in real time, making the adjustment of the data transmission rate more timely and accurate. Setting different load thresholds and data transmission rates allows the system to better adapt to different operating environments and requirements.
[0124] Among them, in an optional embodiment, after scheduling multiple direct memory access engines to perform data transmission in parallel, it also includes: when the direct memory access engine completes the total task, reclaiming the direct memory access channel and marking the direct memory access channel as unoccupied; in the process of reclaiming the direct memory access channel, resetting the leaky bucket algorithm; modifying the configuration information of the second descriptor, and marking the completion of the total task corresponding to the second descriptor.
[0125] The system can monitor whether the DMA engine has completed the total task assigned to it; this can be achieved by monitoring the status register of the DMA engine or by receiving an interrupt signal from the DMA engine. When it is confirmed that the DMA engine has completed the task, the system will start the recovery process to release the direct memory access channel occupied by the DMA engine; the control register or status flag can be modified to mark the channel as unoccupied, for example, the channel identification position is set to 0. After a data transfer task is completed, the parameters in the leaky bucket algorithm, such as capacity, outflow rate, etc., can be readjusted according to the current state or strategy of the system. The configuration information of the second descriptor is updated to mark that the corresponding total task has been completed, for example, the DMA done position in the second descriptor is set to 1.
[0126] In addition, to facilitate system maintenance and troubleshooting, each step of completing tasks and recycling resources may be accompanied by log records. During the process of recycling channels or resetting the leaky bucket algorithm, the system should continuously monitor possible errors and perform appropriate error handling.
[0127] By adopting the embodiments of the present disclosure, by immediately reclaiming the direct memory access channel and marking it as unoccupied after the DMA engine completes the task, these resources can be quickly reallocated to other waiting tasks. Scheduling multiple DMA engines for data transmission in parallel can significantly improve data processing speed and system throughput, especially in data-intensive applications. Resetting the leaky bucket algorithm can prevent performance degradation or instability due to the accumulation of algorithm states during continuous task execution. By modifying the configuration information of the second descriptor and marking the task as completed, the status of each task can be accurately controlled and monitored, improving the accuracy and response speed of task management. By effectively updating the descriptor information, the system can ensure that all related components have the latest status information, thereby optimizing the task scheduling and execution process.
[0128] Among them, in an optional embodiment, after the total task corresponding to the merged data transmission task completes the data transmission, the completion interrupt information can be written back to the local memory according to the second descriptor of the total task, and the CPU can be notified. Alternatively, the completion interrupt information can be written back to the local memory and the CPU can be notified according to the first descriptors corresponding to each data transmission task included in the total task.
[0129] Figure 3 FIG. 1 is a schematic diagram of a data transmission system based on NVMe shown in an embodiment of the present disclosure. Figure 3 As shown, the NVMe SSD includes a command buffer, a command processing module, a command acquisition module, a DMA controller module, and a DMA scheduler module; wherein the DMA controller module includes a task management module, a task classification module, a task merging module, a shared memory module, and a monitor module; the DMA scheduler module includes a channel pool management module, a DMA engine module, and a dynamic window module.
[0130] When data is transferred between the host memory and the local memory, the data transfer task from the host memory to the NVMe SSD passes through the command buffer, command processing module, and command acquisition module of the NVMe SSD in turn, and then reaches the DMA controller module. The task management module in the DMA controller module is used to obtain each I / O SQ command information and configure the first descriptor for each I / O SQ command information; the task classification module is used to classify multiple DMA transfer tasks according to the command priority and target address information; the task merging module is used to combine the classification information, merge multiple DMA transfer tasks into a total task, and configure the second descriptor for each total task; the first descriptor and the second descriptor information are stored in a shared memory; the monitor module can monitor the task merging success rate, data transfer rate, DMA configuration times and other information in real time to evaluate the effectiveness of the merging strategy, and adjust and optimize it as needed; the DMA scheduler module allocates the corresponding DMA engine to each total task in the channel pool management module, and monitors the data transfer situation in a dynamic window and adjusts the data transfer rate.
[0131] Figure 4 FIG. 1 is a schematic diagram of a data transmission process based on NVMe shown in an embodiment of the present disclosure. Figure 4As shown, the DMA controller task management module obtains DMA tasks, programs a first descriptor for each DMA task, and stores the descriptor information in a shared memory; the task classification module obtains the first descriptor from the shared memory, extracts the SQ priority and source address information, and sets the classification method according to user needs; the task merging module sets the merging trigger condition in combination with the maximum transfer unit and memory access granularity of the DMA engine; determines whether the merging trigger condition is met; if the merging trigger condition is met, the task merging module selects t DMA tasks in the secondary priority classification to merge, forms a second descriptor, and stores it in the shared memory; the channel pool manager in the DMA scheduling module establishes multiple DMA channels, and associates a leaky bucket algorithm instance for each DMA channel; in the absence of When the merge trigger conditions are met, go directly to step: the channel pool manager in the DMA scheduling module establishes multiple DMA channels and associates a leaky bucket algorithm instance with each DMA channel; the channel pool manager obtains the first / second descriptor and allocates DMA channels based on priority; the dynamic window monitors the DMA channel traffic and DMA load, adjusts the leaky bucket parameters, and finely controls the DMA channel traffic; determines that all DMA tasks have been transferred; when all DMA tasks have been transferred, the DMA engine completes the data transfer between the local memory and the host memory; when all DMA tasks have not been transferred, jump to step: the channel pool manager in the DMA scheduling module establishes multiple DMA channels and associates a leaky bucket algorithm instance with each DMA channel.
[0132] Figure 5 is a block diagram of a data transmission device shown in an embodiment of the present disclosure. Figure 5 As shown, the data transmission device includes:
[0133] A classification acquisition module is used to obtain classification information of data transmission tasks;
[0134] A merging judgment module, used to judge whether the data transmission tasks of the same category meet the merging trigger condition; a task merging module, used to select a plurality of the data transmission tasks and merge them into one or more general tasks when the merging trigger condition is met; and configure a second descriptor for the merged general task;
[0135] An engine determination module, used for identifying the second descriptor and determining a direct memory access engine number corresponding to the overall task;
[0136] A data transmission module is used to schedule multiple direct memory access engines to perform data transmission in parallel based on the second description.
[0137] Optionally, the data transmission device further includes:
[0138] A first descriptor configuration module is used to obtain the data transmission task; configure a first descriptor for the data transmission task; the first descriptor includes a source address, a target address and a data transmission direction;
[0139] The engine determination module is further configured to allocate a direct memory access engine to the data transmission task according to the first descriptor when the data transmission task has not been merged;
[0140] The data transmission module is also used to control the direct memory access engine to perform data transmission according to the first descriptor.
[0141] Optionally, the classification acquisition module is specifically used to execute:
[0142] Get address classification threshold;
[0143] Comparing the source addresses of the data transmission tasks;
[0144] When the difference of the source addresses is less than or equal to the address classification threshold, classifying the data transmission tasks into the same primary address classification;
[0145] For the data transmission tasks in the same first-level address classification, the same address classification number is configured; for the data transmission commands corresponding to the same first-level classification address, according to the command priority of the data transmission command, the data transmission commands with the same command priority are classified into the same second-level priority classification;
[0146] The same priority category number is configured for the data transmission tasks in the same secondary priority category.
[0147] Optionally, the data transmission task carries a memory access granularity, and the merging judgment module is specifically used to execute:
[0148] Obtaining a maximum transmission unit of a direct memory access engine and a memory access granularity of the data transmission task;
[0149] Determine, according to the maximum transmission unit and the memory access granularity, a value interval of a total data transmission amount threshold and a value interval of a command number threshold;
[0150] Determining the command number threshold and the data transmission total amount threshold according to the data transmission situation;
[0151] When the sum of the memory access granularities corresponding to the various data transfer tasks is greater than or equal to the total data transfer threshold, and / or when the number of the various data transfer tasks is greater than or equal to the command number threshold, the merge trigger condition is met.
[0152] Optionally, the merging judgment module is specifically used to execute:
[0153] Monitoring the transmission information of the data transmission; the transmission information includes: the merging success rate of the total task, the data transmission rate and the number of configuration times of the descriptor;
[0154] The merging threshold is adjusted according to the transmission information.
[0155] Optionally, the second descriptor includes an address classification number and a priority classification number, and the data transmission module is specifically used to execute:
[0156] Determining the corresponding direct memory access engine number according to the address classification number;
[0157] According to the direct memory access engine number, selecting a direct memory access channel for managing the direct memory access engine from the channel pool;
[0158] For the same direct memory access engine, according to the priority classification number, the direct memory access engine executes the total task in order from high to low priority;
[0159] Before selecting the direct memory access channel for managing the direct memory access engine from the channel pool, the method includes:
[0160] Establish multiple direct memory access channels according to hardware configuration and performance requirements to form a channel pool; the direct memory access channels are independent of each other;
[0161] One of the direct memory access channels manages one of the direct memory access engines; a leaky bucket algorithm is configured for each of the direct memory access channels; the leaky bucket algorithm includes a leaky bucket capacity and a leak rate;
[0162] Controlling the data transmission rate according to the leaky bucket capacity and the water leakage rate;
[0163] In case that the direct memory access engine managed by the direct memory access channel performs data transmission, the direct memory access channel is marked as occupied.
[0164] Optionally, the data transmission module is specifically used to execute:
[0165] In a case where the direct memory access engine executes the data transmission task corresponding to the general task, detecting the load of the direct memory access engine and the flow of the direct memory access channel;
[0166] When the load of the direct memory access engine is higher than a first load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be lower than a first data transmission rate;
[0167] When the load of the direct memory access engine is lower than a second load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be higher than a second data transmission rate;
[0168] The first load threshold is greater than the second load threshold; the first data transmission rate is less than the second data transmission rate.
[0169] Optionally, after scheduling multiple direct memory access engines to perform data transmission in parallel, the data transmission device further includes:
[0170] A channel recycling module, used for recycling the direct memory access channel and marking the direct memory access channel as unoccupied when the direct memory access engine completes the overall task;
[0171] An algorithm reset module is used to reset the leaky bucket algorithm during the process of reclaiming the direct memory access channel; a modification module is used to modify the configuration information of the second descriptor and mark the completion of the execution of the total task corresponding to the second descriptor.
[0172] It should be noted that the system embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
[0173] The present disclosure also provides an electronic device, referring to Figure 6 , Figure 6 Schematic diagram of an electronic device shown in an embodiment of the present disclosure. Figure 5 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement the steps in the data transmission method of the embodiment of the present disclosure.
[0174] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the data transmission method disclosed in the embodiment of the present disclosure are implemented.
[0175] The embodiment of the present disclosure further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps in the data transmission method disclosed in the embodiment of the present disclosure are implemented.
[0176] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0177] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, devices or computer program products. Therefore, the embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0178] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0179] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps of the functions specified in a box or multiple boxes. Although some embodiments of the embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present disclosure. The above is a detailed introduction to a data transmission method, device, electronic device and storage medium provided by the present disclosure. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea; at the same time, for those of ordinary skill in the art, according to the ideas of the present disclosure, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A data transmission method, characterized in that: include: Get classification information of data transmission tasks; Determine whether the data transmission tasks of the same category meet the merging trigger condition; When the merging trigger condition is met, selecting a plurality of the data transmission tasks and merging them into one or more total tasks; configuring a second descriptor for the combined total task; Identify the second descriptor and determine the direct memory access engine number corresponding to the overall task; Based on the second description, multiple direct memory access engines are scheduled to perform data transmission in parallel.
2. The method according to claim 1, characterized in that Also includes: Acquire the data transmission task; Configuring a first descriptor for the data transmission task; the first descriptor includes a source address, a target address and a data transmission direction; In a case where the data transmission tasks are not merged, allocating a direct memory access engine for the data transmission tasks according to the first descriptor; The direct memory access engine is controlled to perform data transfer according to the first descriptor.
3. The method according to claim 1, characterized in that The obtaining of classification information of the data transmission task includes: Get address classification threshold; Comparing the source addresses of the data transmission tasks; When the difference of the source addresses is less than or equal to the address classification threshold, classifying the data transmission tasks into the same primary address classification; For the data transmission tasks in the same first-level address classification, configuring the same address classification number; For the data transmission commands corresponding to the same first-level classification address, according to the command priorities of the data transmission commands, the data transmission commands with the same command priorities are classified into the same second-level priority classification; The same priority category number is configured for the data transmission tasks in the same secondary priority category.
4. The method according to claim 1, characterized in that: The data transmission task carries the memory access granularity, and the determining whether the data transmission tasks of the same category meet the merging trigger condition includes: Obtaining a maximum transmission unit of a direct memory access engine and a memory access granularity of the data transmission task; Determine, according to the maximum transmission unit and the memory access granularity, a value interval of a total data transmission amount threshold and a value interval of a command number threshold; Determining the command number threshold and the data transmission total amount threshold according to the data transmission situation; When the sum of the memory access granularities corresponding to the various data transfer tasks is greater than or equal to the total data transfer threshold, and / or when the number of the various data transfer tasks is greater than or equal to the command number threshold, the merge trigger condition is met.
5. The method according to claim 4, characterized in that The determining, according to the data transmission situation, the command number threshold and the data transmission total amount threshold comprises: Monitoring the transmission information of the data transmission; the transmission information includes: the merging success rate of the total task, the data transmission rate and the number of configuration times of the descriptor; The merging threshold is adjusted according to the transmission information.
6. The method according to claim 1, characterized in that The second descriptor includes an address classification number and a priority classification number, and the scheduling of multiple direct memory access engines to perform data transmission in parallel includes: Determining the corresponding direct memory access engine number according to the address classification number; According to the direct memory access engine number, selecting a direct memory access channel for managing the direct memory access engine from the channel pool; For the same direct memory access engine, according to the priority classification number, the direct memory access engine executes the total task in order from high to low priority; Before selecting the direct memory access channel for managing the direct memory access engine from the channel pool, the method includes: Establish multiple direct memory access channels according to hardware configuration and performance requirements to form a channel pool; the direct memory access channels are independent of each other; One of the direct memory access channels manages one of the direct memory access engines; a leaky bucket algorithm is configured for each of the direct memory access channels; the leaky bucket algorithm includes a leaky bucket capacity and a leak rate; Controlling the data transmission rate according to the leaky bucket capacity and the water leakage rate; In case that the direct memory access engine managed by the direct memory access channel performs data transmission, the direct memory access channel is marked as occupied.
7. The method according to claim 6, characterized in that The controlling of the data transmission rate according to the leaky bucket capacity and the water leakage rate comprises: In a case where the direct memory access engine executes the data transmission task corresponding to the general task, detecting the load of the direct memory access engine and the flow of the direct memory access channel; When the load of the direct memory access engine is higher than a first load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be lower than a first data transmission rate; When the load of the direct memory access engine is lower than a second load threshold, controlling the leaky bucket algorithm to adjust the data transmission rate to be higher than a second data transmission rate; The first load threshold is greater than the second load threshold; the first data transmission rate is less than the second data transmission rate.
8. The method according to claim 7, characterized in that After scheduling multiple direct memory access engines to perform data transmission in parallel, the method further includes: When the direct memory access engine completes the overall task, reclaiming the direct memory access channel and marking the direct memory access channel as unoccupied; In the process of reclaiming the direct memory access channel, resetting the leaky bucket algorithm; The configuration information of the second descriptor is modified, and the execution of the overall task corresponding to the second descriptor is marked as completed.
9. A data transmission device, characterized in that: include: A classification acquisition module is used to obtain classification information of data transmission tasks; A merging judgment module, used to judge whether the data transmission tasks of the same category meet the merging triggering condition; A task merging module, used to select a plurality of the data transmission tasks and merge them into one or more total tasks when the merging trigger condition is met; configuring a second descriptor for the combined total task; An engine determination module, used for identifying the second descriptor and determining a direct memory access engine number corresponding to the overall task; A data transmission module is used to schedule multiple direct memory access engines to perform data transmission in parallel based on the second description.
10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the data transmission method according to any one of claims 1 to 8 are implemented.
11. 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 8 are implemented.
Citation Information
Cited By
Method, medium, device and product for data transmission
CN120256350A
Method, medium, device and product for data transmission
CN120256350B
Data transmission system and method, electronic equipment and storage medium
CN120561050A
Data transmission method, system, product, equipment, medium and device
CN120567801A
Data transmission completion state notification method, system, device, medium and product
CN121233437A
