Multi-task parallel transmitting method and device of many-core system, equipment and medium
By establishing a task registration table for each data channel in the many-core system, parallel transmission of multiple tasks sharing a data channel is realized, which solves the problem of a single task monopolizing the data channel and improves the efficiency of parallel transmission of tasks.
Patent Information
- Application Number
- CN202410601182.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-08-27
AI Technical Summary
When tasks are launched in parallel in existing many-core systems, since tasks are bound to data channels one by one, a single task needs to occupy a data channel exclusively during the sending and processing return process, which limits the efficiency of parallel launch of tasks and cannot effectively support more tasks. Parallel launch of multiple tasks.
By establishing a task registration table for each data channel in the many-core system, the host side exclusively uses channel resources to send tasks when it detects a task to be executed, and releases the resources immediately after obtaining the returned data in the data channel, allowing the next task or Data is transmitted to achieve parallel transmission of multiple tasks sharing a data channel.
While ensuring the integrity of task information, it improves the efficiency of parallel sending of tasks in many-core systems, solves the problem of a single task exclusive data channel, provides the opportunity to use the same data channel, and enhances the ability of parallel sending of tasks.
Smart Images

Figure CN118550694A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a multi-task parallel transmission method, device, equipment and medium for a many-core system. Background Art
[0002] In the field of heterogeneous computing chips, in order to avoid using the full capabilities of the chip to process a single task, which would lead to a waste of computing power, the chip needs to be able to process multiple tasks simultaneously. Therefore, the scheduling system needs to have the ability to launch multiple tasks onto the chip for execution.
[0003] The existing scheduling system can transmit the tasks to be executed to the chip through the data transmission hardware channel. After the scheduling system transmits the task, it needs to wait for the task to be executed. After obtaining the execution result of the task, the data transmission hardware channel can be used to send the next task. Therefore, in order to transmit multiple tasks to the chip, the existing solution is to increase the data transmission hardware channels to independently transmit more tasks to the chip, such as increasing to 64 groups of independent data transmission hardware channels. However, 64 groups of independent data transmission hardware channels can only support the parallel transmission of 64 tasks at most at the same time, and cannot support the parallel transmission of more tasks. If more groups of data transmission hardware channels are to be added, the hardware area will increase. Summary of the invention
[0004] The present invention provides a method, device, equipment and medium for parallel transmission of multiple tasks in a many-core system, which can solve the problem of one-to-one binding of tasks and data channels, and realize that multiple tasks share one data channel, so that the number of tasks transmitted in parallel exceeds the number of data channels in the many-core system.
[0005] According to one aspect of the present invention, a multi-task parallel transmission method of a many-core system is provided, which is executed by a host end in the many-core system, comprising:
[0006] When a first task to be executed is detected, a first channel is selected from each data channel, and after the first task information is updated in a first task registration table, the first channel resources are exclusively used to send the first task;
[0007] Among them, the device end in the many-core system is used to obtain tasks from the data channel and resend the return data obtained by executing the task to the original data channel; different data channels correspond to different task registration tables, and the channel resources are directly released after the exclusive use is completed;
[0008] When detecting that there is second return data in the second channel, exclusively using the second channel resources to obtain the second return data; when determining the second task to which the second return data belongs, exclusively using the second channel resources to update the second task status in the second task registration table; and storing the second return data of the second task in the target storage area;
[0009] The target storage area is scanned in real time, and when it is determined that the third return data of the third task exists, the third return data is fed back to the sender of the third task.
[0010] According to another aspect of the present invention, a multi-task parallel transmission method of a many-core system is provided, which is executed by a device end in the many-core system, and includes:
[0011] When it is detected that the fourth task is received in the fourth channel, exclusively using the fourth channel resources to obtain the fourth task;
[0012] The host in the multi-core system is used to send tasks to the data channel and obtain the return data from the device in the data channel; the channel resources are directly released after the exclusive use is completed;
[0013] Determine a target task processing thread for executing the fourth task in a pre-established thread pool, and generate return data of the fourth task after the target task processing thread completes processing the fourth task;
[0014] The fourth channel is used exclusively, and the return data of the fourth task is sent to the fourth channel.
[0015] According to another aspect of the present invention, a multi-task parallel launch device of a many-core system is provided, which is executed by a host end in the many-core system, and includes:
[0016] A task sending module, for selecting a first channel from various data channels when a first task to be executed is detected, and after updating the first task information in a first task registration table, exclusively using the first channel resources to send the first task;
[0017] Among them, the device end in the many-core system is used to obtain tasks from the data channel and resend the return data obtained by executing the task to the original data channel; different data channels correspond to different task registration tables, and the channel resources are directly released after the exclusive use is completed;
[0018] a return data monitoring module, configured to, when detecting that there is second return data in the second channel, exclusively use the second channel resources to obtain the second return data; when determining the second task to which the second return data belongs, exclusively use the second channel resources to update the second task status in the second task registration table; and store the second return data of the second task in the target storage area;
[0019] The return data feedback module is used to scan the target storage area in real time, and when it is determined that the third return data of the third task exists, feed back the third return data to the sender of the third task.
[0020] According to another aspect of the present invention, a multi-task parallel launch device of a many-core system is provided, which is executed by a device end in the many-core system, and includes:
[0021] A task acquisition module, configured to, upon detecting that a fourth task is received in the fourth channel, exclusively use the fourth channel resources to acquire the fourth task;
[0022] The host in the multi-core system is used to send tasks to the data channel and obtain the return data from the device in the data channel; the channel resources are directly released after the exclusive use is completed;
[0023] A task processing module, used to determine a target task processing thread for executing the fourth task in a pre-established thread pool, and generate return data of the fourth task after the target task processing thread completes processing the fourth task;
[0024] The data return module is used to exclusively use the fourth channel and send the return data of the fourth task to the fourth channel.
[0025] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0026] at least one processor; and
[0027] a memory communicatively connected to the at least one processor; wherein,
[0028] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-task parallel transmission method of the many-core system described in Embodiment 1 and Embodiment 2 of the present invention, as well as another multi-task parallel transmission method of the many-core system described in Embodiment 3 of the present invention.
[0029] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-task parallel transmission method of a many-core system described in Embodiment 1 and Embodiment 2 of the present invention, as well as another multi-task parallel transmission method of a many-core system described in Embodiment 3 of the present invention when executed.
[0030] The technical solution of the embodiment of the present invention is that when the host side in the many-core system detects the first task to be executed, it exclusively uses the first channel resources to update the first task information in the first task registration table and sends the first task; when it detects that there is second return data in the second channel, it exclusively uses the second channel resources to obtain the second return data; when it is determined that the second task to which the second return data belongs, it exclusively uses the second channel resources to update the second task status in the second task registration table; and, when it is determined that there is third return data of the third task in the target storage area, the third return data is fed back to the sender of the third task. This can solve the problem in the prior art that a single task needs to exclusively occupy a data channel in the entire sending and processing return process, and can immediately release the occupation of the data channel after the data sending is completed, so that the next task or data can be transmitted. While ensuring the integrity of the task information, it provides multiple unfinished tasks with the opportunity to use the same data channel, which can effectively improve the efficiency of parallel sending of tasks in the many-core system.
[0031] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 This is a flowchart of a multi-task parallel transmission method of a many-core system provided according to Embodiment 1 of the present invention;
[0034] Figure 2 is a flowchart of another multi-task parallel transmission method of a many-core system provided according to Embodiment 2 of the present invention;
[0035] Figure 3 is a flowchart of a multi-task parallel transmission method of a many-core system provided according to Embodiment 3 of the present invention;
[0036] Figure 4 2 is a schematic diagram of the structure of a multi-task parallel launch device of a many-core system provided according to a fourth embodiment of the present invention;
[0037] Figure 5 2 is a schematic diagram of the structure of a multi-task parallel launch device of a many-core system provided in accordance with Embodiment 5 of the present invention;
[0038] Figure 6 It is a structural schematic diagram of an electronic device for implementing the multi-task parallel transmission method of a many-core system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] Embodiment 1
[0042] Figure 1 The flowchart of a multi-task parallel transmission method of a many-core system provided in the first embodiment of the present invention is applicable to the case where each data channel in the many-core system is used to transmit multiple tasks. The method can be executed by a multi-task parallel transmission device of the many-core system. The multi-task parallel transmission device of the many-core system can be implemented in the form of hardware and / or software, and can generally be configured in the host end of the many-core system, wherein the host end has a data processing function. Figure 1 As shown, the method includes:
[0043] S110 . When a first task to be executed is detected, a first channel is selected from each data channel, and after the first task information is updated in a first task registration table, the first channel resources are exclusively used to send the first task.
[0044] Among them, the device end in the many-core system is used to obtain tasks from the data channel and resend the return data obtained by executing the task to the original data channel; different data channels correspond to different task registration tables, and the channel resources are directly released after the exclusive use is completed.
[0045] Optionally, the many-core system may include a host side and a device side. The host side can be regarded as the central processing unit (CPU) of the computer, and the device side can be regarded as a many-core chip connected to the computer, such as a graphics processing unit (GPU). The process of issuing and executing a task can be: a task sender in the host side, such as an application, creates a task and sends it to the device side through the host side via a data transmission hardware channel. After the device side completes the task, the task-related data is returned to the host side via the data transmission hardware channel, and the host side sends the returned data to the task sender to realize a complete task sending and execution process.
[0046] Optionally, the data channel can be a data transmission hardware channel. The data channel is established between the host side and the device side to realize data interaction between the host side and the device side. In the many-core system, the number of data channels can be multiple. The data channel is limited by the hardware structure and is generally limited. In traditional technology, after a task is sent to the device side via a data channel, it is necessary to wait until the task is completed and the information is returned before the next task can be sent, which limits the number of concurrent tasks in the many-core system.
[0047] Optionally, a matching task registration table can be created in advance for each data channel on the host side. The task registration table corresponds to the data channel one by one and is used to record the task information in the corresponding data channel. The task information recorded in the task registration table may include but is not limited to the task identifier, task status and return data.
[0048] Optionally, a lock mechanism can be set up. When the host side or the device side performs data transmission in the data channel, or the host side modifies the task registration table matching the data channel, the lock resources are acquired according to the rules of the lock mechanism to lock the data channel to monopolize the data channel. After the data transmission is completed or the task registration table is modified, the lock resources are released to release the occupation of the data channel.
[0049] The advantage of this setting is that by establishing a task registration table that corresponds one to one with the data channel, and when data is transmitted or the task registration table is modified through the data channel, the lock resource is obtained to exclusively occupy the data channel. This allows the tasks sent through the data channel to be recorded, and the data channel to be released immediately after the data is sent, so that the next task or data can be transmitted. While ensuring the integrity of the task information, it provides multiple unfinished tasks with the opportunity to use the same data channel, thereby solving the problem of a single task monopolizing a data channel throughout the entire process of sending and returning.
[0050] Optionally, an API (application programming interface) may be provided in the host side, and the technical solution proposed in this step may be implemented through the API. The first task may refer to the task currently to be executed by the host side. The API may obtain the first task sent by the application, and determine the first channel that can be used to send the first task from multiple data channels in the many-core system. The first channel may be determined based on the occupancy of the data channel, or based on other factors such as hardware performance, which are not limited here.
[0051] Optionally, after the API determines the first channel in the many-core system, it obtains the lock resource of the first channel. If the lock resource of the first channel can be successfully obtained, it means that the first channel is not currently occupied, and relevant operations can be performed on the first channel. If the lock resource of the first channel cannot be successfully obtained, wait for the lock resource of the first channel to be released before obtaining it again, until the lock resource is successfully obtained.
[0052] Optionally, after the API successfully acquires the lock resources of the first channel, the API modifies the first task registration table corresponding to the first channel according to the first task, and after completing the modification of the first task registration table, sends the first task to the first channel so that the device side can acquire the first task in the first channel, and releases the lock resources of the first channel after the task sending is completed.
[0053] Optionally, if the first task is to be sent, the identifier of the first task can be recorded in the first registration table, the task status of the first task can be set, for example, to the sent or unreturned status, and the return value data of the first task can be cleared for filling in the return value data when obtaining the return data.
[0054] S120. When it is detected that there is second return data in the second channel, exclusively use the second channel resources to obtain the second return data; when it is determined that the second task to which the second return data belongs is to be determined, exclusively use the second channel resources to update the second task status in the second task registration table; and store the second return data of the second task in the target storage area.
[0055] Optionally, a matching task receiving thread may be created in advance for each data channel on the host side, and the technical solution proposed in this step may be implemented through the task receiving thread.
[0056] Optionally, the second channel may refer to any data channel in the many-core system that currently has return data, the second return data may refer to the current return data in the second channel, the second return data is returned by the device end to the second channel, the second task to which the second return data belongs is sent via the second channel, and its return data is received via the second channel.
[0057] Optionally, the task receiving thread corresponding to each data channel can be used to query in real time whether there is return data in each data channel.
[0058] Optionally, the device side can also be pre-configured. When the device side sends return data to the data channel, it also sends an interrupt signal. When the interrupt processor on the host side receives the interrupt signal in the data channel, it can determine that there is return data in the data channel and wake up the task receiving thread corresponding to the data channel.
[0059] Optionally, the task receiving thread corresponding to the second channel can be represented by a second task receiving thread. When the second task receiving thread detects that there is second return data in the second channel, it detects whether the lock resources of the second channel are occupied, and when it is determined that they are not occupied, it acquires the lock resources of the second channel, that is, it exclusively uses the second channel resources, reads and copies the second return data from the second channel, and releases the lock resources of the second channel after the second return data is read and copied.
[0060] Furthermore, the read second return data is parsed by the second task receiving thread to obtain the task identifier of the second task corresponding to the second return data, and determine whether the task identifier of the second task is recorded in the second task registration table. If so, the copied second return data is stored in the target storage area; if not, it is determined that the second return data does not belong to the second channel, the cause of the error is analyzed, and a task error reminder is generated.
[0061] Optionally, the target storage area may refer to a storage area for storing returned data. The target storage area may be one or more pre-established cache areas, or the table cache area for recording return value data in the task registration table may be used as the target storage area, which is not limited here.
[0062] Preferably, in order to facilitate the management of the data channel and the task data, the second return data may be recorded in a second task registration table corresponding to the second channel.
[0063] Optionally, if the target storage area is a table cache area in the second task registration table, the task receiving thread can obtain the lock resources of the second channel again after determining that the identification information of the second task is recorded in the second task registration table, and after successfully obtaining the lock resources of the second channel, modify the task status of the second task, for example, it can be modified to a status such as execution completed or data returned, and store the copied second return data in the second task registration table, and store it correspondingly with the second task. After the storage is completed, release the lock resources of the second channel.
[0064] Optionally, after the task receiving thread completes storing the second task, the task receiving thread enters a waiting state, and waits for the next detection of return data in the second channel, and then processes the next return data.
[0065] S130: Scan the target storage area in real time, and when it is determined that the third return data of the third task exists, feed back the third return data to the sender of the third task.
[0066] Optionally, the technical solution proposed in this step can be implemented through an API.
[0067] Optionally, when the task return information is set to be stored in the task registration table, the API can poll the task registration table to check the task status of each task in the task registration table, and when it is determined that the task status is the specified task status, it is determined that the return information of the task has been stored in the task registration table.
[0068] Optionally, when the task return information is set to be stored in a pre-allocated cache area, the cache area corresponding to the sent task is polled, and it is determined whether to store the return data according to the data change in the cache area.
[0069] Optionally, when it is determined that there is third return data of the third task in the third task registration table corresponding to the third channel, the lock resources of the third channel are acquired, and after successfully acquiring the lock resources of the third channel, the third return data are copied in the third task registration table, and the records related to the third task in the third registration table are deleted to reduce the amount of stored data in the third registration table. After the deletion is completed, the lock resources of the third channel are released.
[0070] Further, the copied third return data is returned to the sender of the third task, that is, the application program that sends the third task.
[0071] The technical solution of the embodiment of the present invention is that when the host side in the many-core system detects the first task to be executed, it exclusively uses the first channel resources to update the first task information in the first task registration table and sends the first task; when it detects that there is second return data in the second channel, it exclusively uses the second channel resources to obtain the second return data; when it is determined that the second task to which the second return data belongs, it exclusively uses the second channel resources to update the second task status in the second task registration table; and, when it is determined that there is third return data of the third task in the target storage area, the third return data is fed back to the sender of the third task. This can solve the problem in the prior art that a single task needs to exclusively occupy a data channel in the entire sending and processing return process, and can immediately release the occupation of the data channel after the data sending is completed, so that the next task or data can be transmitted. While ensuring the integrity of the task information, it provides multiple unfinished tasks with the opportunity to use the same data channel, which can effectively improve the efficiency of parallel sending of tasks in the many-core system.
[0072] Embodiment 2
[0073] Figure 2 This is a flowchart of another multi-task parallel transmission method of a multi-core system provided by the second embodiment of the present invention. Based on the above embodiment, this embodiment specifically describes the multi-task parallel transmission method of a multi-core system executed by the host side. Figure 2 As shown, the method includes:
[0074] S210 . When it is determined that the application program launches a first task, determine a first channel for launching the first task from among a plurality of data channels in the many-core system.
[0075] S220: Detect resource occupancy of the first channel according to the lock resource state of the first channel, and when it is determined that the first channel resource is not occupied, acquire the lock resource of the first channel to exclusively use the first channel resource.
[0076] S230: Update task information of the first task in a first task registration table corresponding to the first channel, send the first task to the first channel, and release the lock resource of the first channel after the first task is sent.
[0077] S240: When it is detected that there is second return data in the second channel and the second channel resources are not occupied, use the task receiving thread matching the second channel to acquire the lock resources of the second channel, read and copy the second return data in the second channel, and release the lock resources of the second channel.
[0078] S250, using the task receiving thread matching the second channel to parse the read second return data, obtain the second task identifier, and determine whether there is a second task corresponding to the second task identifier in the second task registration table; if so, execute step S260; if not, execute step S270.
[0079] It can be understood that if the second task identifier is recorded in the second task registration table, it means that the corresponding second task is sent by the second channel, and the return data is returned through the correct data channel and can match the second task. If it does not exist, it means that the return data is returned through the wrong data channel.
[0080] S260, exclusively using the second channel resources, updating the task status of the second task in the second task registration table, and storing the second return data and the second task in the second task registration table in correspondence; executing step S280.
[0081] S270: Generate a task error reminder associated with the second channel or the second task.
[0082] S280: When it is determined that the third task status in the third task registration table is updated to the specified completion status, it is determined that the third return data of the third task has been saved in the third task registration table, and a third channel for sending the third task is determined.
[0083] S290: Exclusively use the third channel resources, copy the third return data in the third task registration table, delete the information related to the third task in the third task registration table, and release the third channel resources.
[0084] S2100: Feedback the third return data to the sender of the third task.
[0085] The technical solution of the embodiment of the present invention is that when the host side in the many-core system detects the first task to be executed, it exclusively uses the first channel resources to update the first task information in the first task registration table and sends the first task; when it detects that there is second return data in the second channel, it exclusively uses the second channel resources to obtain the second return data; when it is determined that the second task to which the second return data belongs, it exclusively uses the second channel resources to update the second task status in the second task registration table; and, when it is determined that there is third return data of the third task in the target storage area, the third return data is fed back to the sender of the third task. This can solve the problem in the prior art that a single task needs to exclusively occupy a data channel in the entire sending and processing return process, and can immediately release the occupation of the data channel after the data sending is completed, so that the next task or data can be transmitted. While ensuring the integrity of the task information, it provides multiple unfinished tasks with the opportunity to use the same data channel, which can effectively improve the efficiency of parallel sending of tasks in the many-core system.
[0086] Embodiment 3
[0087] Figure 3 The flowchart of a multi-task parallel transmission method of a many-core system provided in the third embodiment of the present invention is applicable to the case where each data channel in the many-core system is used to receive and execute multiple tasks. The method can be executed by a multi-task parallel transmission device of the many-core system. The multi-task parallel transmission device of the many-core system can be implemented in the form of hardware and / or software, and can generally be configured in the device end of the many-core system, wherein the device end has a data processing function. Figure 3 As shown, the method includes:
[0088] S310: When it is detected that the fourth task is received in the fourth channel, exclusively use the fourth channel resources to obtain the fourth task.
[0089] The host side in the multi-core system is used to send tasks to the data channel and obtain return data from the device side in the data channel; the channel resources are directly released after being exclusively used.
[0090] Optionally, the fourth channel can be any data channel of a currently existing task in the many-core system, and the fourth task can refer to the task currently received in the fourth channel. When the device detects that the fourth task is received in the fourth channel, it obtains the lock resources of the fourth channel, and after successfully obtaining the lock resources of the fourth channel, it copies the fourth task in the fourth channel and releases the lock resources of the fourth channel.
[0091] It can be seen that the host side and the device side share a lock mechanism to occupy data channel resources only when performing operations related to the data channel, and open the use rights of the data channel at other times, thereby ensuring data integrity and normal task execution while increasing the task transmission volume in the data channel.
[0092] S320: Determine a target task processing thread for executing the fourth task in a pre-established thread pool, and generate return data of the fourth task after the target task processing thread completes processing the fourth task.
[0093] Optionally, a thread pool is pre-established in the device end, and the thread pool includes multiple threads that can be used to process tasks. When the device end receives a task, a task processing thread is selected in the thread pool, and the copied task is sent to the task processing thread. After the task processing is completed and the return data is sent, the task processing thread returns to the thread pool and waits for the next call.
[0094] Optionally, the received fourth task may be processed by the target task processing thread, and after the processing is completed, return data of the fourth task is generated, and the return data may include return information and task information.
[0095] S330 , exclusively using the fourth channel, and sending the return data of the fourth task to the fourth channel.
[0096] Optionally, through the target task processing thread, after generating the return data of the fourth task, the lock resources of the fourth channel are obtained, and after successfully obtaining the lock resources of the fourth channel, the return data of the fourth task is sent to the fourth channel, and after the return data is sent, the lock resources of the fourth channel are released.
[0097] The technical solution of the embodiment of the present invention, through the device end in the many-core system, when detecting that the fourth task is received in the fourth channel, exclusively uses the fourth channel resources to obtain the fourth task, determines the target task processing thread, and after the target task processing thread completes the fourth task, generates the return data of the fourth task, exclusively uses the fourth channel, and sends the return data of the fourth task to the fourth channel. This method can cooperate with the host end in the many-core system to realize the immediate release of the data channel after the task is received or the return data is sent, so that the next task or data can be transmitted, providing multiple unfinished tasks with the opportunity to use the same data channel, and solving the problem in the prior art that a single task needs to exclusively occupy a data channel in the entire sending and processing return process.
[0098] Embodiment 4
[0099] Figure 4This is a schematic diagram of the structure of a multi-task parallel launch device for a multi-core system provided by the fourth embodiment of the present invention. Figure 4 As shown, the device includes: a task sending module 410 , a return data monitoring module 420 and a return data feedback module 430 .
[0100] The task sending module 410 is used to select a first channel from various data channels when a first task to be executed is detected, and after updating the first task information in the first task registration table, exclusively use the first channel resources to send the first task.
[0101] Among them, the device end in the many-core system is used to obtain tasks from the data channel and resend the return data obtained by executing the task to the original data channel; different data channels correspond to different task registration tables, and the channel resources are directly released after the exclusive use is completed.
[0102] The return data monitoring module 420 is used to exclusively use the second channel resources to obtain the second return data when detecting the presence of second return data in the second channel; when determining the second task to which the second return data belongs, exclusively use the second channel resources to update the second task status in the second task registration table; and store the second return data of the second task in the target storage area.
[0103] The return data feedback module 430 is used to scan the target storage area in real time, and when it is determined that the third return data of the third task exists, feed back the third return data to the sender of the third task.
[0104] The technical solution of the embodiment of the present invention is that when the host side in the many-core system detects the first task to be executed, it exclusively uses the first channel resources to update the first task information in the first task registration table and sends the first task; when it detects that there is second return data in the second channel, it exclusively uses the second channel resources to obtain the second return data; when it is determined that the second task to which the second return data belongs, it exclusively uses the second channel resources to update the second task status in the second task registration table; and, when it is determined that there is third return data of the third task in the target storage area, the third return data is fed back to the sender of the third task. This can solve the problem in the prior art that a single task needs to exclusively occupy a data channel in the entire sending and processing return process, and can immediately release the occupation of the data channel after the data sending is completed, so that the next task or data can be transmitted. While ensuring the integrity of the task information, it provides multiple unfinished tasks with the opportunity to use the same data channel, which can effectively improve the efficiency of parallel sending of tasks in the many-core system.
[0105] Based on the above embodiments, the task sending module 410 can be specifically used for:
[0106] When determining that the application program launches a first task, determining a first channel for launching the first task from a plurality of data channels in the many-core system;
[0107] Detecting resource occupancy of the first channel according to the lock resource state of the first channel, and when it is determined that the first channel resource is not occupied, acquiring the lock resource of the first channel to exclusively use the first channel resource;
[0108] The task information of the first task is updated in the first task registration table corresponding to the first channel, and the first task is sent to the first channel. After the first task is sent, the lock resource of the first channel is released.
[0109] Based on the above embodiments, the return data monitoring module 420 may include a return data acquisition unit and a return data registration unit;
[0110] Returns the data acquisition unit, which can be used specifically for:
[0111] When it is detected that there is second return data in the second channel and the second channel resources are not occupied, the lock resources of the second channel are acquired by using the task receiving thread matching the second channel, the second return data in the second channel is read and copied, and the lock resources of the second channel are released.
[0112] Based on the above embodiments, the return data registration unit can be specifically used for:
[0113] Parsing the read second return data using the task receiving thread matching the second channel, obtaining the second task identifier, and determining whether there is a second task corresponding to the second task identifier in the second task registration table;
[0114] If it exists, the second channel resource is used exclusively, the task status of the second task is updated in the second task registration table, and the second return data is stored in the second task registration table in correspondence with the second task;
[0115] If not present, a task error reminder associated with the second channel or the second task is generated.
[0116] Based on the above embodiments, the return data feedback module 430 can be specifically used for:
[0117] When it is determined that the third task status in the third task registration table is updated to the specified completion status, determining that the third return data of the third task has been saved in the third task registration table, and determining a third channel for sending the third task;
[0118] Exclusively use the third channel resources, copy the third return data in the third task registration table, delete the information related to the third task in the third task registration table, and release the third channel resources;
[0119] The third return data is fed back to the sender of the third task.
[0120] The multi-task parallel launch device of the many-core system provided in the embodiment of the present invention can execute the multi-task parallel launch method of the many-core system provided in the first and second embodiments of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0121] Embodiment 5
[0122] Figure 5 This is a schematic diagram of the structure of a multi-task parallel launch device for a multi-core system provided by Embodiment 5 of the present invention. Figure 5 As shown, the device includes: a task acquisition module 510, a task processing module 520 and a data return module 530.
[0123] The task acquisition module 510 is configured to, when detecting that a fourth task is received in the fourth channel, exclusively use the fourth channel resources to acquire the fourth task.
[0124] The host side in the multi-core system is used to send tasks to the data channel and obtain return data from the device side in the data channel; the channel resources are directly released after being exclusively used.
[0125] The task processing module 520 is used to determine a target task processing thread for executing the fourth task in a pre-established thread pool, and generate return data of the fourth task after the target task processing thread completes processing the fourth task.
[0126] The data return module 530 is used to exclusively use the fourth channel and send the return data of the fourth task to the fourth channel.
[0127] The technical solution of the embodiment of the present invention, through the device end in the many-core system, when detecting that the fourth task is received in the fourth channel, exclusively uses the fourth channel resources to obtain the fourth task, determines the target task processing thread, and after the target task processing thread completes the fourth task, generates the return data of the fourth task, exclusively uses the fourth channel, and sends the return data of the fourth task to the fourth channel. This method can cooperate with the host end in the many-core system to realize the immediate release of the data channel after the task is received or the return data is sent, so that the next task or data can be transmitted, providing multiple unfinished tasks with the opportunity to use the same data channel, and solving the problem in the prior art that a single task needs to exclusively occupy a data channel in the entire sending and processing return process.
[0128] The multi-task parallel launch device for a many-core system provided in the embodiment of the present invention can execute the multi-task parallel launch method for a many-core system provided in the third embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0129] Embodiment 6
[0130] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0131] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0132] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0133] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the multi-task parallel transmission method of the many-core system executed by the host end and the multi-task parallel transmission method of the many-core system executed by the device end as described in an embodiment of the present invention.
[0134] In some embodiments, the multi-task parallel transmission method of the many-core system executed by the host end and the multi-task parallel transmission method of the many-core system executed by the device end can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the multi-task parallel transmission method of the many-core system executed by the host end and the multi-task parallel transmission method of the many-core system executed by the device end described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the multi-task parallel transmission method of the many-core system executed by the host end and the multi-task parallel transmission method of the many-core system executed by the device end in any other appropriate manner (for example, by means of firmware).
[0135] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0136] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0137] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0138] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0139] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0140] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0141] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0142] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-task parallel launch method for a many-core system, It is characterized in that Executed by the host in the many-core system, including: When a first task to be executed is detected, a first channel is selected from each data channel, and after the first task information is updated in a first task registration table, the first channel resources are exclusively used to send the first task; Among them, the device end in the many-core system is used to obtain tasks from the data channel and resend the return data obtained by executing the task to the original data channel; different data channels correspond to different task registration tables, and the channel resources are directly released after the exclusive use is completed; When detecting that there is second return data in the second channel, exclusively using the second channel resources to obtain the second return data; when determining the second task to which the second return data belongs, exclusively using the second channel resources to update the second task status in the second task registration table; and storing the second return data of the second task in the target storage area; The target storage area is scanned in real time, and when it is determined that the third return data of the third task exists, the third return data is fed back to the sender of the third task.
2. The method according to claim 1, It is characterized in that When a first task to be executed is detected, a first channel is selected from each data channel, and after the first task information is updated in a first task registration table, the first channel resources are exclusively used to send the first task, including: When determining that the application program launches a first task, determining a first channel for launching the first task from a plurality of data channels in the many-core system; Detecting resource occupancy of the first channel according to the lock resource state of the first channel, and when it is determined that the first channel resource is not occupied, acquiring the lock resource of the first channel to exclusively use the first channel resource; The task information of the first task is updated in the first task registration table corresponding to the first channel, and the first task is sent to the first channel. After the first task is sent, the lock resource of the first channel is released.
3. The method according to claim 2, It is characterized in that When it is detected that the second return data exists in the second channel, exclusively using the second channel resources to obtain the second return data includes: When it is detected that there is second return data in the second channel and the second channel resources are not occupied, the lock resources of the second channel are acquired by using the task receiving thread matching the second channel, the second return data in the second channel is read and copied, and the lock resources of the second channel are released.
4. The method according to claim 3, It is characterized in that When determining the second task to which the second returned data belongs, exclusively using the second channel resource to update the second task state in the second task registration table; And, storing the second returned data of the second task in the target storage area includes: Parsing the read second return data using the task receiving thread matching the second channel, obtaining the second task identifier, and determining whether there is a second task corresponding to the second task identifier in the second task registration table; If it exists, the second channel resource is used exclusively, the task status of the second task is updated in the second task registration table, and the second return data is stored in the second task registration table in correspondence with the second task; If not present, a task error reminder associated with the second channel or the second task is generated.
5. The method according to claim 4, It is characterized in that Scanning the target storage area in real time, and when determining that the third return data of the third task exists, feeding back the third return data to the sender of the third task, includes: When it is determined that the third task status in the third task registration table is updated to the specified completion status, determining that the third return data of the third task has been saved in the third task registration table, and determining a third channel for sending the third task; Exclusively use the third channel resources, copy the third return data in the third task registration table, delete the information related to the third task in the third task registration table, and release the third channel resources; The third return data is fed back to the sender of the third task.
6. A multi-task parallel launch method for a many-core system, It is characterized in that Executed by the device side in the many-core system, including: When it is detected that the fourth task is received in the fourth channel, exclusively using the fourth channel resources to obtain the fourth task; The host in the multi-core system is used to send tasks to the data channel and obtain the return data from the device in the data channel; the channel resources are directly released after the exclusive use is completed; Determine a target task processing thread for executing the fourth task in a pre-established thread pool, and generate return data of the fourth task after the target task processing thread completes processing the fourth task; The fourth channel is used exclusively, and the return data of the fourth task is sent to the fourth channel.
7. A multi-task parallel launch device for a many-core system, It is characterized in that Executed by the host in the many-core system, including: A task sending module, for selecting a first channel from various data channels when a first task to be executed is detected, and after updating the first task information in a first task registration table, exclusively using the first channel resources to send the first task; Among them, the device end in the many-core system is used to obtain tasks from the data channel and resend the return data obtained by executing the task to the original data channel; different data channels correspond to different task registration tables, and the channel resources are directly released after the exclusive use is completed; a return data monitoring module, configured to, when detecting that there is second return data in the second channel, exclusively use the second channel resources to obtain the second return data; when determining the second task to which the second return data belongs, exclusively use the second channel resources to update the second task status in the second task registration table; and store the second return data of the second task in the target storage area; The return data feedback module is used to scan the target storage area in real time, and when it is determined that the third return data of the third task exists, feed back the third return data to the sender of the third task.
8. A multi-task parallel launch device for a many-core system, It is characterized in that Executed by the device side in the many-core system, including: A task acquisition module, configured to, upon detecting that a fourth task is received in the fourth channel, exclusively use the fourth channel resources to acquire the fourth task; The host in the multi-core system is used to send tasks to the data channel and obtain the return data from the device in the data channel; the channel resources are directly released after the exclusive use is completed; A task processing module, used to determine a target task processing thread for executing the fourth task in a pre-established thread pool, and generate return data of the fourth task after the target task processing thread completes processing the fourth task; The data return module is used to exclusively use the fourth channel and send the return data of the fourth task to the fourth channel.
9. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-task parallel transmission method of a many-core system described in any one of claims 1 to 5 of the present invention and another multi-task parallel transmission method of a many-core system described in claim 6.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the multi-task parallel transmission method for a many-core system described in any one of claims 1 to 5 and another multi-task parallel transmission method for a many-core system described in claim 6 when executed.
