Data processing method, device, storage medium and product based on execution engine

By using cascading commands and dynamic scheduling algorithms based on the execution engine, the problem of inflexible scheduling in DMA systems during complex data transfers is solved, achieving efficient and flexible data transfer and task processing, and improving the overall performance and stability of the system.

CN120448074BActive Publication Date: 2025-12-12SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510874693.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-12-12
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

Traditional DMA systems are not flexible enough in command scheduling when dealing with complex, multi-tasking or high-speed data transfer needs, which can easily lead to scheduling conflicts, resource contention and delays, affecting system efficiency.

Method used

A data processing method based on an execution engine is adopted, which realizes automatic loading and parallel processing of commands through cascading commands and dynamic scheduling algorithms, reduces software intervention, and ensures the order and integrity of data transmission.

Benefits of technology

It improves data transmission efficiency, reduces the controller load, enhances task scheduling flexibility, avoids unnecessary waiting and conflicts, and improves the overall processing capacity and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448074B_ABST
    Figure CN120448074B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device based on an execution engine, a storage medium and a product, relates to the technical field of computers, and comprises the following steps: acquiring a first command from the execution engine and executing the first command; if there is a second command cascaded with the first command, acquiring the second command and executing the second command. According to the application, the execution engine can efficiently process a complex data transmission task by cascading commands, the burden of a controller is reduced, the flexibility of task scheduling is increased, the sequence and integrity of data transmission are ensured, meanwhile, the data transmission efficiency is improved, unnecessary waiting and conflicts are avoided, the increase of delay is effectively avoided by adopting the cascading command mode, and software intervention is not needed frequently.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a data processing method and device based on an execution engine, a storage medium and a product. BACKGROUND

[0002] DMA (Direct Memory Access) is a technology that allows peripherals to exchange data directly with memory, which can reduce the burden of CPU (Central Processing Unit) and improve data transmission efficiency.

[0003] The traditional DMA system usually relies on fixed transmission mode and preset command scheduling mechanism, which makes it have certain limitations when dealing with complex, multi-task or high-speed data transmission requirements. Especially in the case of multiple DMA requests concurrency, the command scheduling tends to be inflexible, which is easy to cause scheduling conflicts, resource competition and delay, and thus affects the overall efficiency of the system. SUMMARY

[0004] The present application provides a data processing method and device based on an execution engine, a storage medium and a product to at least solve the problem that DMA is not flexible in command scheduling in the related art.

[0005] The present application provides a data processing method based on an execution engine, comprising:

[0006] obtaining a first command from the execution engine and executing the first command;

[0007] if there is a second command cascaded with the first command, obtaining the second command and executing the second command.

[0008] The present application can efficiently process complex data transmission tasks through cascaded commands, reduce the burden of the controller, increase the flexibility of task scheduling, ensure the order and integrity of data transmission, and improve the data transmission efficiency, avoid unnecessary waiting and conflicts. Moreover, the cascaded command mode does not need frequent software intervention, effectively avoiding the increase of delay.

[0009] In an optional implementation, before obtaining the second command, the method further comprises:

[0010] obtaining a cascaded valid flag of the first command;

[0011] determining whether there is a second command cascaded with the first command based on the cascaded valid flag of the first command.

[0012] In the embodiment, the command cascade is realized by the cascade effective flag, the software processing can be maximally reduced, the program flow is simplified, the multi-command automatic loading is realized, and the execution efficiency is improved.

[0013] In an alternative embodiment, the execution engine is multiple; the first command is obtained from the execution engine, comprising:

[0014] According to the preset engine polling sequence, the first execution engine in the current polling is determined;

[0015] The first command is obtained from the first execution engine.

[0016] In the embodiment, the execution engine and the command in the execution engine are selected in the polling mode, the long-time idle state of the execution engine can be effectively avoided, and the uneven distribution of the execution engine command can be avoided. In the embodiment, the multiple execution engines can work in parallel, the task is scheduled according to the polling sequence, the overall efficiency of the system can be effectively improved, and the overall processing capacity of the system can be improved.

[0017] In an alternative embodiment, the first command is obtained from the execution engine, and after the first command is executed, further comprising:

[0018] If there is no second command cascaded with the first command, or there is a second command cascaded with the first command and after the second command is executed, if the target number corresponding to the first execution engine is greater than 1, the command is continuously obtained from the first execution engine as the first command, and the first command is executed, until the number of the command taken out from the first execution engine reaches the target number;

[0019] The target number is the number of the command obtained and executed from the first execution engine in the current polling, and the target number is determined based on the number of the command currently stored in the first execution engine.

[0020] In the embodiment, the dynamic command scheduling algorithm is adopted, the number of the command in the execution engine can be effectively balanced, the command can be quickly processed, and the efficient scheduling of the command is realized.

[0021] In an alternative embodiment, the target number is determined by the following steps:

[0022] When the first execution engine is polled, the current command number in the first execution engine and the current command number in the other execution engines are read;

[0023] The command number difference between the current command number in the first execution engine and the minimum current command number in the other execution engines is judged;

[0024] In a case where the command quantity difference is greater than or equal to a preset command quantity, the target quantity is determined based on the command quantity difference.

[0025] In the embodiment, the dynamic command scheduling algorithm is adopted, so that the command quantity in the execution engine can be effectively balanced, and the commands can be quickly processed, thereby realizing efficient scheduling of the commands.

[0026] In an optional embodiment, the first command is acquired from the first execution engine, including:

[0027] The command priorities of the commands in the first execution engine are read;

[0028] The first command is selected in a descending order of the command priorities.

[0029] In the embodiment, the command to be executed is selected according to the command priorities, so that the task change and emergency demand can be effectively coped with, and the flexibility of command execution is improved.

[0030] In an optional embodiment, after the command priorities of the commands in the first execution engine are read, the method further includes:

[0031] In a case where the command priorities of the multiple commands in the first execution engine are equal, the multiple commands with the equal command priorities are polled and arbitrated, and the first command is selected.

[0032] In the embodiment, the priorities of the commands can be dynamically adjusted according to the types and emergency levels of the commands, so that the high-priority commands are executed preferentially, and efficient scheduling of the commands is realized.

[0033] In an optional embodiment, before the command priorities of the commands in the first execution engine are read, the method further includes:

[0034] The command execution waiting times of the commands in the first execution engine are read;

[0035] In a case where the command execution waiting time exceeds a preset threshold, the command priority of the corresponding command is improved.

[0036] In the embodiment, the dynamic priority adjustment mechanism is adopted, so that the task delay can be effectively avoided, important commands can be processed in time, unexpected situations can be better coped with, and the overall execution efficiency is improved.

[0037] In an optional embodiment, in a case where the execution engine includes multiple command queues, the method further includes:

[0038] The command execution state bits in the execution engine are read, and the command execution state bits include parallel execution state bits and serial execution state bits.

[0039] According to the command execution state bit, the execution manner of the command queue in the execution engine is determined.

[0040] In the embodiment, the user can select the parallel or serial execution manner of the commands in a single engine according to the actual needs, thereby improving the flexibility and adaptability of the system.

[0041] In an optional embodiment, after the execution of the command is completed, the method further comprises:

[0042] The execution result of the command and the execution state are stored.

[0043] In the embodiment, the execution result of the command and the execution state are stored, which can provide detailed information and basis for subsequent troubleshooting, and is beneficial to further optimization and adjustment of the execution process.

[0044] In an optional embodiment, before the first command is obtained from the command queue in the execution engine, the method further comprises:

[0045] The number of receivable commands of the execution engine is read;

[0046] Based on the number of receivable commands, the issued command is received and stored to the command queue.

[0047] In the embodiment, the number of receivable commands of the execution engine is read before the first command is obtained, which can ensure that the system reasonably allocates tasks according to the processing capacity of the engine, avoids resource waste or task backlog, and is helpful to improve the processing efficiency of the command.

[0048] In an optional embodiment, after the first command is obtained from the execution engine, the method comprises:

[0049] The bus usage request is sent;

[0050] After a response message to the bus usage request is obtained, the first command is executed.

[0051] In the embodiment, the first command is obtained from the execution engine and the bus usage request is sent, which can avoid resource conflicts and effectively improve the coordination and execution efficiency of the system.

[0052] The application also provides an electronic device, comprising a memory for storing a computer program and a processor for executing the computer program to implement the steps of any of the above data processing methods based on the execution engine.

[0053] The application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the above data processing methods based on the execution engine.

[0054] The application further provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the above-mentioned data processing methods based on an execution engine. BRIEF DESCRIPTION OF DRAWINGS

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

[0056] Figure 1 A schematic diagram of the architecture of a DMA system provided by an embodiment of the present application;

[0057] Figure 2 A schematic diagram of the flow of a data processing method based on an execution engine provided by an embodiment of the present application;

[0058] Figure 3 A cascade diagram provided by an embodiment of the present application;

[0059] Figure 4 A command format diagram provided by an embodiment of the present application;

[0060] Figure 5 A schematic diagram of the architecture of a DMA system provided by an embodiment of the present application;

[0061] Figure 6 A schematic diagram of the hardware structure of an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

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

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

[0064] For those skilled in the art to better understand the present application, the present application will be further described in detail below in combination with the drawings and specific embodiments.

[0065] In combination with the specific application environment architecture or the specific hardware architecture on which the execution of the data processing method based on the execution engine depends, the specific application environment architecture or the specific hardware architecture is described herein.

[0066] The present application is based on a DMA system, which generally has one or more DMA engines. Some simple DMA systems generally only need one DMA engine, which can support a single data transmission channel. The present application is preferably directed to a multi-channel DMA engine, each of which is responsible for an independent data transmission channel, so that parallel transmission can be realized and the overall performance can be improved. The DMA system on which the present application depends can refer to Figure 1 As shown in the figure, the DMA system includes 16 DMA engines (engine0-engine15), and each DMA engine can have up to 16 command queues (msg0-msg15).

[0067] For the convenience of understanding, first, some definitions involved in the embodiments of the present application are explained and described.

[0068] DMA (Direct memory access): memory direct access;

[0069] AXI (Advanced eXtensible Interface): a bus protocol;

[0070] NIC (Network Interconnect): central interconnection;

[0071] FIFO (First in, First out): first-in first-out queue;

[0072] OPC (Operation Code): operation code;

[0073] The embodiments of the present application provide a data processing method based on an execution engine, and the method is described in detail in combination with the execution flow of the data processing method based on the execution engine.

[0074] In the present embodiment, a data processing method based on an execution engine is provided, which can be executed by a server, a terminal, a mobile terminal, etc. Figure 2 The flowchart of the data processing method based on the execution engine according to the embodiments of the present application is shown in FIG. 2, which includes the following steps: Figure 2

[0075] ​Step S101: Obtain the first command from the execution engine and execute the first command.

[0076] Step S102: If there is a second command that is concatenated with the first command, then obtain the second command and execute the second command.

[0077] The execution engine in this embodiment is the DMA engine. A DMA engine typically maintains a command queue containing DMA operation commands to be executed. Each command usually specifies the source address, destination address, number of bytes to be transferred, and transfer mode. In this embodiment, the first command is any command in the command queue. Regarding the DMA engine, for example, when reading data from an external device, such as an MCU (Micro Control Unit) or hard drive, into memory, and then writing the data from memory back to the external device, the DMA engine will begin data transfer according to the parameters in the command (such as source address, destination address, etc.). At this time, the CPU can continue processing other tasks because the DMA engine directly handles the data transfer.

[0078] In related technologies, DMA systems typically use a single-command execution approach for data transfer, with the DMA engine executing each command independently. After each command is completed, the CPU is responsible for initiating the next command. This approach is relatively simple, but when multiple tasks need to be executed sequentially, the CPU may need to intervene frequently, increasing management complexity and system overhead, and reducing task scheduling flexibility and efficiency.

[0079] In this embodiment, scheduling is performed using command cascading, as described above. Figure 3 As shown, if the first command cmd0 in the command queue executes successfully, and a second command cmd1 exists that is concatenated with it, the DMA engine will directly retrieve the concatenated second command from the command queue and execute it. At this point, the second command becomes the first command, and the engine continues to check if a second command exists that is concatenated with it, repeating this process until no concatenated command exists.

[0080] In this embodiment, by using cascading commands, the execution engine can efficiently handle complex data transmission tasks, reduce the burden on the controller, increase the flexibility of task scheduling, and ensure the order and integrity of data transmission. Simultaneously, it improves data transmission efficiency and avoids unnecessary waiting and conflicts. Furthermore, the cascading command approach eliminates the need for frequent software intervention, effectively preventing increased latency.

[0081] In some alternative implementations, prior to obtaining the second command, the following steps are also included:

[0082] Get the cascading valid flag of the first command.

[0083] Based on the cascade valid flag of the first command, it is determined whether there is a second command cascaded with the first command.

[0084] Specifically, the format of the command refers to Figure 4 As shown in the figure, the command cascade can be implemented in the execution engine by configuring the "chain_valid", i.e. the cascade valid flag. When a command is configured with "chain_valid" = 1 and chain_id is non-zero, the execution engine will automatically find and execute the subsequent command associated with the cascade ID after completing the current command. This cascade operation can link two related commands together to form a continuous processing flow, and the final execution result and completion status will not be returned until the cascade command is executed.

[0085] Among them, the cascade ID is a unique identifier assigned to each command that needs to be cascaded. When a command is sent, if "chain_valid" = 1 is set, the cascade ID of the command will be recorded in the register, and the subsequent command with the same cascade ID will be stored in the chain_buffer corresponding to the ID. When the execution engine completes the current first command, it will check whether there is a valid cascade ID. If there is, the corresponding subsequent command will be found in the register according to the ID and loaded into the execution queue. It should be noted that the priority of cascade lookup is the highest, that is, even if there is a high-priority command in the command queue, the cascade command needs to be completed.

[0086] In this embodiment, the command cascade is implemented through the cascade valid flag, which can maximize the reduction of software processing, simplify the program flow, realize the automatic loading of multiple commands, and improve the execution efficiency.

[0087] In some optional embodiments, the method further comprises:

[0088] Detecting the hardware error flag of each execution engine and the data in the storage state cache area;

[0089] Based on the hardware error flag and / or the data in the storage state cache area, it is determined whether the corresponding execution engine has a fault;

[0090] In the case of a fault, the fault type is determined;

[0091] Based on the fault type, the command queue in the execution engine is adjusted.

[0092] Specifically, a hardware error flag bit can be set in each execution engine, and whether the execution engine has a problem can be detected by checking the hardware error flag. For example, if the command transmission is not completed within a predetermined time, it can indicate that the corresponding execution engine has a fault, and a timeout error flag is generated at this time; if the data of the command transmission has a check error, it can indicate that the execution engine has a problem in the transmission process, and a check error flag is generated at this time.

[0093] In addition, after the command execution is completed, the execution state and the execution result are stored in the storage state buffer area, and by regularly reading these state registers, the running status of the execution engine can be detected. For example, when the command is completed, a flag bit can be set, and monitoring the flag bit can determine whether the command is successfully executed.

[0094] When a fault occurs in a certain execution engine, whether command migration is needed can be determined according to the fault type, and if needed, the command of the execution engine can be automatically migrated to other healthy execution engines for execution, which can effectively ensure the stable operation of the system and improve the overall performance and reliability of the system.

[0095] In some optional embodiments, the execution engine has a plurality of execution engines, and the first command is obtained from the execution engine, comprising:

[0096] According to a preset engine polling order, a first execution engine currently polled is determined.

[0097] The first command is obtained from the first execution engine.

[0098] Specifically, a polling pointer can be set to indicate the engine currently being checked. The polling pointer starts from the start position of the polling queue and points to each execution engine in the polling queue in turn until the end of the polling queue. When the polling pointer reaches the end of the queue, it returns to the start position of the polling queue, forming a loop. Through polling, the command state of the command queue in each execution engine is checked in turn to ensure that the commands of each engine can be processed in time.

[0099] In this embodiment, the execution engine and the command in the execution engine are selected by polling, which can effectively avoid that a certain execution engine is in an idle state for a long time, causing the phenomenon of uneven distribution of execution engine commands. In this embodiment, the plurality of execution engines can work in parallel, and the tasks are scheduled according to the polling order, which can effectively improve the overall efficiency of the system and improve the overall processing capacity of the system.

[0100] In some optional embodiments, after the first command is obtained from the execution engine and the first command is executed, the method further comprises:

[0101] If there is no second command concatenated with the first command, or if there is a second command concatenated with the first command and after the second command is executed, if the target number corresponding to the first execution engine is greater than 1, then continue to obtain a command from the first execution engine as the first command and execute the first command until the number of commands taken from the first execution engine reaches the target number. The target number is the number of commands obtained and executed from the first execution engine in the current polling, and the target number is determined based on the number of commands currently stored in the first execution engine.

[0102] In the embodiment, the priority of the concatenated search is the highest, that is, even if there is a high-priority command in the command queue, the concatenated command needs to be completed. After there is no second command concatenated with the first command or the concatenated command is completed, continue to take a command from the execution engine according to the general rule (for example, in the order of first-in first-out or in the order of priority) for execution.

[0103] In the case where there is a second command concatenated with the first command, after the first command is executed, the second command concatenated with the first command is executed first, and when there is still a command concatenated with the second command, the command concatenated with the second command is also executed preferentially, until there is no concatenated command.

[0104] In the polling process, the embodiment also dynamically adjusts the number of commands taken from the command queue, that is, the target number, according to the number of commands of each execution engine. However, under the initial condition, the target number corresponding to each execution engine is a pre-stored value, that is, after polling the first execution engine, the target number is determined according to the number of commands stored on the first execution engine. In the first polling, the target number will not change due to the decrease in the number of commands caused by the execution of the commands, until the next polling, and the target number corresponding to each execution engine is determined again. For example, when the number of commands of a certain execution engine is large, the target number can be increased, and when polling the execution engine, more commands can be taken out to make the commands of the execution engine be processed faster.

[0105] The following is an example. The initial target number can be set to 1, that is, one command is read each time. After multiple polling, there are 2 commands to be executed in execution engine A and 8 commands to be executed in execution engine B. When polling execution engine A, one command can be normally read, and when polling execution engine B, the target number is increased, for example, the target number is adjusted to 2, and at this time, 2 commands to be executed are read from execution engine B.

[0106] The traditional DMA engine has the problem of low efficiency in command scheduling. In actual application, the number of commands of some DMA engines can be large, while the number of commands of other DMA engines can be small. In this case, the simple polling algorithm can cause unbalanced command execution, affecting the overall performance of the system. In the embodiment, the dynamic command scheduling algorithm is adopted, which can effectively ensure the balance of the number of commands in the execution engine and ensure that the commands can be processed quickly, thereby realizing efficient scheduling of the commands.

[0107] In some optional embodiments, the target number is determined by the following steps:

[0108] When polling the first execution engine, the current number of commands in the first execution engine and the current number of commands in other execution engines are read.

[0109] The command number difference between the current number of commands in the first execution engine and the minimum current number of commands in other execution engines is determined.

[0110] In the case where the command number difference is greater than or equal to the preset command number, the target number is determined based on the command number difference.

[0111] Specifically, for example, the initial target number is 1, and the preset command number is 5. After multiple polling, there are 2 pending commands in execution engine A, 8 pending commands in execution engine B, and 6 pending commands in execution engine C. If the first execution engine is execution engine B, the command number difference is 6. Further, the target number is determined according to the command number difference, for example, 50% of the command number difference is taken as the target number. If the first execution engine is execution engine C, the command number difference is 4, which is less than the preset command number, so the initial target number is maintained.

[0112] In the embodiment, the dynamic command scheduling algorithm is adopted, which can effectively ensure the balance of the number of commands in the execution engine and ensure that the commands can be processed quickly, thereby realizing efficient scheduling of the commands.

[0113] In some optional embodiments, the first command is obtained from the first execution engine, including:

[0114] The command priority of each command in the first execution engine is read.

[0115] The first command is selected in the order from high to low of the command priority.

[0116] Specifically, a priority register can be configured for each execution engine in advance, which is used to store the priority of the current command of the engine, for example: 0-15, the priority of the command will exist in the execution engine and be issued together with the command.

[0117] In the polling process, when it is checked that one execution engine has a command to be executed, the execution engine reads the priority register of the engine to determine the priority of the command. After the currently executing command is completed, the command with the highest priority is issued in priority.

[0118] In this embodiment, the command to be executed is selected according to the command priority, which can effectively cope with task changes and urgent needs, and improve the flexibility of command execution.

[0119] In some optional embodiments, after reading the command priority of each command in the first execution engine, the method further comprises:

[0120] In the case where the command priorities of multiple commands in the first execution engine are equal, polling arbitration is performed on the multiple commands with equal command priorities to select the first command.

[0121] That is, if there are commands with the same priority in the command queue, polling arbitration is performed to ensure uniform execution of the commands of each command queue.

[0122] In this embodiment, the priority of the command can be dynamically adjusted according to the type and urgency of the command, ensuring that the command with high priority is executed first, and realizing efficient scheduling of the command.

[0123] In some optional embodiments, before reading the command priority of each command in the first execution engine, the method further comprises:

[0124] Reading the command execution waiting time of each command in the first execution engine.

[0125] In the case where the command execution waiting time exceeds a preset threshold, the command priority of the corresponding command is raised.

[0126] In the command execution process, the execution engine can dynamically update the priority of the command according to the actual situation. When the command execution waiting time exceeds the preset threshold, the priority of the command can be raised by one level to ensure that it can be completed in time.

[0127] In this embodiment, the dynamic priority adjustment mechanism can effectively avoid task delay, ensure that important commands are processed in time, better cope with unexpected situations, and improve the overall execution efficiency.

[0128] In some optional embodiments, in the case where one of the execution engines comprises multiple command queues, the method further comprises:

[0129] Reading the command execution state bit in the execution engine, the command execution state bit comprising a parallel execution state bit and a serial execution state bit.

[0130] According to the command execution state bit, the execution manner of the command queue in the execution engine is determined.

[0131] Specifically, the user can select the parallel or serial execution manner by setting the parallel_mode in the register, i.e., the command execution state bit. When parallel_mode = 1, the commands in the engine are executed in parallel; when parallel_mode = 0, the commands in the engine are executed in series.

[0132] For multiple commands in the same queue, the currently executed command can be selected according to the command priority as described in the above embodiment, or can be executed in series or in parallel.

[0133] In this embodiment, a multi-level parallel-serial hybrid architecture is proposed, which can realize engine-level parallelism and channel-level serial and parallel compatibility. Specifically, by parameterizing the configuration of the number of DMA engines, multiple independent DMA engines can be supported to work in parallel. Each engine can independently process tasks without interfering with each other, thereby realizing parallel processing of multiple tasks. More flexible number configuration can meet the needs of high performance or low power consumption in two use scenarios. Within a single engine, the number of command execution queues can be determined by configuring the register, for example, 16 queues. The order of command execution can be managed by the command queue management (FIFO). All written commands are stored in the FIFO in the order of cmd_buffer_id (id bit in the user-issued cmd), and are taken out by the state machine for execution in sequence. This ensures the ordered execution of commands within a single engine and avoids the confusion of command execution. In addition, by configuring the register, the user can determine the parallel execution of commands within a single engine. After writing the command, the corresponding execution engine is started, and all command queues in the execution engine can execute commands in parallel.

[0134] Referring to Figure 5 , which is a configuration example in this embodiment. The user configures 16 execution engines, and 16 command queues exist in the execution engine 0, which can be executed in parallel; only one command queue is configured in each of the remaining execution engines, and the written commands are executed in sequence. For the execution engine 0, after writing the command, the corresponding execution engine is started, and 16 command queues can execute commands in parallel at the same time, and the order of command execution is out of order. For other execution engines, the execution order is serial, and one command is executed after one command is stored.

[0135] The embodiment proposes a multi-level parallel-serial hybrid architecture, supports multiple independent engines to process tasks in parallel, and realizes the serialization of commands by managing the order of instructions inside each execution engine through a command queue, ensures the ordered execution of commands inside a single engine, avoids the confusion of command execution, and improves the stability and reliability of the system. At the same time, the parallel or serial execution mode of the commands in a single engine can be determined according to the user configuration register. This architecture not only fully utilizes the advantages of multi-core parallel processing, but also ensures the order of command execution inside a single engine.

[0136] In the embodiment, the user can select the parallel or serial execution mode of the commands in a single engine according to the actual needs, improving the flexibility and adaptability of the system.

[0137] In some optional embodiments, after the command execution is completed, the method further comprises:

[0138] storing the execution result and the execution state of the command.

[0139] Still taking Figure 5 as an example, for the execution engine 0, there are 16 command buffer areas and 16 storage state buffer areas (fbd_buffer0-fbd_buffer15). After writing the command, the corresponding execution engine is started, and the 16 command buffer areas can execute the command in parallel, and the completion state and result are stored in the respective storage state buffer areas. For other execution engines, there is only one command buffer area and one storage state buffer area, and the execution order of the commands in the command buffer area is serial, and the result is stored in the storage state buffer area.

[0140] The depth of the command buffer area is affected by the configuration and is the same as the number of command queues in the execution engine. The depth of each command buffer area is 16 in total, which is evenly distributed to all command queues. The depth of the storage state buffer area is not affected by the configuration and only has one space. The number of storage state buffer areas is the same as the number of command queues.

[0141] In the embodiment, the execution result and the execution state of the command are stored, which can provide detailed information and basis for subsequent troubleshooting, and is beneficial to further optimization and adjustment of the execution process.

[0142] In some optional embodiments, before obtaining the first command from the command queue in the execution engine, the method further comprises:

[0143] reading the number of receivable commands of the execution engine.

[0144] Based on the number of receivable commands, the issued command is received and stored in the command queue.

[0145] Before issuing a command to the execution engine, the user can configure the register, that is, configure "how many execution engines (number of engines)", "the number of command queues of each execution engine (cmd_queue_num)", and "the order of command execution (parallel_mode)". Then, the user issues a command. Before the user issues a command, the state register is read to obtain the number of commands that can be received by each execution engine, that is, the number of receivable commands, and then a proper number of commands are issued.

[0146] After the execution engine receives the command, the DMA starts (Q0-Q15), the DMA receives the command, parses it, obtains the priority in each command, and stores it in the corresponding register. When the DMA engine detects that the valid command in the command queue is not empty, it starts to obtain the command from the command queue. Obtaining the command needs to be based on the priority of the command, and the commands are obtained in order of high and low priority. For the same priority, the commands are obtained in the order of reception.

[0147] In this embodiment, the number of receivable commands of the execution engine is read before the first command is obtained, which can ensure that the system reasonably allocates tasks according to the processing capacity of the engine, avoids resource waste or task backlog, and helps to improve the processing efficiency of the command.

[0148] In some optional embodiments, after the first command is obtained from the execution engine, the following steps are included:

[0149] Sending a bus usage request;

[0150] After obtaining the response message of the bus usage request, the first command is executed.

[0151] The DMA parses the obtained command and starts to execute the command. Since multiple execution engines share an AXI channel (the completion of the command needs to transmit data through the AXI channel), the execution of the command needs to queue to obtain the usage right of the AXI channel. Each execution engine is independent of each other and sends a request signal for the usage of the AXI, and waits for the approval of the AXI. There is an optimized polling arbitrator here for allocating the usage right of the AXI channel. The DMA completes the task and returns the result. After the DMA obtains the usage right of the AXI, it can execute the task required by the OPC bit in the command. After the task is executed, the result is stored in the internal register and the completion status is returned. The execution among the execution engines is parallel, and the AXI read-write command sent by each engine is arbitrated through the NIC_ARB (Network Interconnect Arbite, meaning NIC arbitrator) module to try to obtain the usage right of the NIC as evenly as possible.

[0152] In this embodiment, the first command is obtained from the execution engine and the bus usage request is sent, which can avoid resource conflicts and effectively improve the coordination and execution efficiency of the system.

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

[0154] Embodiments of the present application also provide an execution engine-based data processing apparatus for implementing the above embodiments and preferred embodiments, which have been described above. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation by hardware, or a combination of software and hardware, is also possible and contemplated.

[0155] The present embodiments provide an execution engine-based data processing apparatus, which comprises:

[0156] The reading module is configured to acquire the first command from the execution engine and execute the first command.

[0157] The querying module is configured to acquire the second command and execute the second command if the second command exists in cascade with the first command.

[0158] In an optional embodiment, the apparatus further comprises:

[0159] The acquiring module is configured to acquire a cascade effective flag of the first command.

[0160] The judging module is configured to determine whether the second command exists in cascade with the first command based on the cascade effective flag of the first command.

[0161] In an optional embodiment, the execution engine is multiple; and the reading module comprises:

[0162] The polling unit is configured to determine the first execution engine for current polling according to a preset engine polling sequence, and acquire the first command from the first execution engine. The polling unit is further configured to, if the second command does not exist in cascade with the first command, or the second command exists in cascade with the first command and the second command is executed, and the target number corresponding to the first execution engine is greater than 1, continue to acquire the command from the first execution engine as the first command and execute the first command until the number of commands taken from the first execution engine reaches the target number; wherein the target number is the number of commands acquired and executed from the first execution engine in the current polling, and the target number is determined based on the number of commands currently stored in the first execution engine.

[0163] In an optional embodiment, the apparatus further comprises:

[0164] The updating module is configured to read the current number of commands in the first execution engine and the current number of commands in other execution engines when polling the first execution engine; determine a command number difference between the current number of commands in the first execution engine and the minimum current number of commands in other execution engines; and determine a target number based on the command number difference when the command number difference is greater than or equal to a preset command number.

[0165] In an optional implementation, the polling unit comprises:

[0166] The priority unit is configured to read the command priorities of the commands in the first execution engine; and select the first command in a descending order of the command priorities. The priority unit is further configured to perform polling arbitration on the multiple commands with equal command priorities in the first execution engine when the multiple commands with equal command priorities exist in the first execution engine, and select the first command. The priority unit is further configured to read the command execution waiting times of the commands in the first execution engine; and increase the command priority of a corresponding command when the command execution waiting time of the corresponding command exceeds a preset threshold.

[0167] In an optional implementation, when multiple command queues exist in an execution engine, the apparatus further comprises:

[0168] The defining module is configured to read command execution state bits in the execution engine, the command execution state bits comprising parallel execution state bits and serial execution state bits; and determine an execution mode of the command queue in the execution engine according to the command execution state bits.

[0169] The storage module is configured to store the execution result and the execution state of the command.

[0170] In an optional implementation, the apparatus further comprises:

[0171] The configuration module is configured to read a receivable command number of the execution engine; receive a command issued and stored in the command queue based on the receivable command number.

[0172] In an optional implementation, the apparatus further comprises:

[0173] The sending module is configured to send a bus usage request; and execute the first command after obtaining a response message of the bus usage request.

[0174] The features of the embodiments of the data processing apparatus based on the execution engine can be seen from the related descriptions of the embodiments of the data processing method based on the execution engine, which will not be described herein.

[0175] Embodiments of the present application also provide an electronic device, such as Figure 6As shown, the computer program product includes a memory 10 and a processor 20, the memory 10 stores a computer program, and the processor 20 is configured to execute the computer program to perform the steps in any of the above-mentioned embodiments of the data processing method based on the execution engine.

[0176] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to perform the steps in any of the above-mentioned embodiments of the data processing method based on the execution engine when executed.

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

[0178] The embodiments of the present application further provide a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned embodiments of the data processing method based on the execution engine.

[0179] The embodiments of the present application further provide another computer program product, which includes a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned embodiments of the data processing method based on the execution engine.

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

[0181] The above describes in detail the data processing method, device, storage medium and product based on an execution engine provided by the present application. The principles and implementation manners of the present application are described by using specific examples, and the above description of the embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, some improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A data processing method based on an execution engine, characterized by, The method comprises the following steps: acquiring a first command from an execution engine and executing the first command; the execution engine comprises a plurality of execution engines; wherein the method comprises the following steps: determining a first execution engine to be polled in a current polling according to a preset engine polling sequence; and acquiring the first command from the first execution engine; if there is no second command cascaded with the first command, or if there is the second command cascaded with the first command and the second command is executed, and if the target quantity corresponding to the first execution engine is greater than 1, then continuously acquiring a command from the first execution engine as the first command and executing the first command until the number of commands taken from the first execution engine reaches the target quantity; wherein the target quantity is the number of commands acquired and executed from the first execution engine in the current polling, and the target quantity is determined based on the number of commands currently stored in the first execution engine; if there is the second command cascaded with the first command, then acquiring the second command and executing the second command; the target quantity is determined by the following steps: when the first execution engine is polled, reading the number of current commands in the first execution engine and the number of current commands in other execution engines; judging the difference between the number of current commands in the first execution engine and the minimum number of current commands in other execution engines; 2. The method of claim 1, wherein, if the difference is greater than or equal to a preset command number, then determining the target quantity based on the difference. Before the step of acquiring the second command, the method further comprises the following steps: acquiring a cascade effective flag of the first command; 3. The method of claim 1, wherein, determining whether there is the second command cascaded with the first command based on the cascade effective flag of the first command. The step of acquiring the first command from the first execution engine comprises the following steps: reading the command priority of each command in the first execution engine; 4. The method of claim 3, wherein, selecting the first command in the order from high to low of the command priority. After the step of reading the command priority of each command in the first execution engine, the method further comprises the following steps:

5. The method of claim 3, wherein, if the command priority of a plurality of commands in the first execution engine is equal, then polling and arbitrating the plurality of commands with equal command priority to select the first command. Before the step of reading the command priority of each command in the first execution engine, the method further comprises the following steps: reading the command execution waiting time of each command in the first execution engine; 6. The method of claim 1, wherein, if the command execution waiting time exceeds a preset threshold, then increasing the command priority of the corresponding command. In the case that one execution engine comprises a plurality of command queues, the method further comprises the following steps: reading a command execution state bit in the execution engine, the command execution state bit comprising a parallel execution state bit and a serial execution state bit; 7. The method of claim 1, wherein, determining the execution mode of the command queue in the execution engine according to the command execution state bit. After the command execution is completed, the method further comprises the following steps:

8. The method of claim 1, wherein, storing the execution result and the execution state of the command. Before acquiring the first command from the command queue in the execution engine, the method further comprises the following steps: reading a number of receivable commands of the execution engine; based on the number of receivable commands, receiving a dispatched command and storing to a command queue.

9. The method of claim 1, wherein, after obtaining a first command from the execution engine, comprising: sending a bus usage request; after obtaining a response message of the bus usage request, executing the first command.

10. An electronic device, comprising: comprising: a memory for storing a computer program; a processor for implementing the steps of the data processing method based on an execution engine according to any one of claims 1 to 9 when executing the computer program.

11. A computer readable storage medium, characterized in that, the computer program stored in the computer readable storage medium, wherein the computer program is executed by the processor to implement the steps of the data processing method based on an execution engine according to any one of claims 1 to 9.

12. A computer program product comprising a computer program, characterized in that, the computer program is executed by the processor to implement the steps of the data processing method based on an execution engine according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Processor with instruction concatenation

    US20140089639A1