Method and apparatus for processing computational task having multiple subflows
First Claim
1. A method for processing a computational task, performed at a computing apparatus having one or more processors and a memory for storing executable instructions to be executed by the one or more the processors, the method comprising:
- obtaining the computational task that comprises multiple subflows;
storing input data of a current subflow of the computational task in a queue;
creating multiple task processing threads for each subflow;
obtaining first input data from the queue and performing data processing according to logic corresponding to the current subflow;
wherein different pieces of the first input data are obtained from the queue and the data processing of the different pieces of the first input data are performed according to the logic corresponding to the current subflow separately in the multiple task processing threads in parallel;
determining whether to enter a next subflow according to a result of the data processing;
when determining to enter the next subflow, storing the result of the data processing in another queue as input data of the next subflow of the current subflow, and entering the next subflow; and
decreasing a difference between processing speeds of the current subflow and the next subflow such that a congested state or an idle time of at least one of the multiple task processing threads for the current subflow or the multiple task processing threads for the next subflow is reduced, by adjusting one or a combination of a number of the multiple task processing threads for the current subflow and a number of the multiple task processing threads for the next subflow.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and an apparatus for processing a computational task is described. The method may include obtaining a computational task that includes multiple subflows. The method includes storing input data of a current subflow of the computational task in a queue and obtaining first input data from the queue and performing data processing according to logic corresponding to the current subflow. The method includes determining whether to enter a next subflow according to a result of the data processing, and, if a result enters a next subflow, storing the result of the data processing in another queue as input data of a next subflow of the current subflow.
9 Citations
14 Claims
-
1. A method for processing a computational task, performed at a computing apparatus having one or more processors and a memory for storing executable instructions to be executed by the one or more the processors, the method comprising:
-
obtaining the computational task that comprises multiple subflows; storing input data of a current subflow of the computational task in a queue; creating multiple task processing threads for each subflow; obtaining first input data from the queue and performing data processing according to logic corresponding to the current subflow;
wherein different pieces of the first input data are obtained from the queue and the data processing of the different pieces of the first input data are performed according to the logic corresponding to the current subflow separately in the multiple task processing threads in parallel;determining whether to enter a next subflow according to a result of the data processing; when determining to enter the next subflow, storing the result of the data processing in another queue as input data of the next subflow of the current subflow, and entering the next subflow; and decreasing a difference between processing speeds of the current subflow and the next subflow such that a congested state or an idle time of at least one of the multiple task processing threads for the current subflow or the multiple task processing threads for the next subflow is reduced, by adjusting one or a combination of a number of the multiple task processing threads for the current subflow and a number of the multiple task processing threads for the next subflow. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. An apparatus for processing a computational task, the apparatus comprising:
-
one or more processors; a memory; and a plurality of processor-implemented instructions stored in the memory and to be executed by the one or more processors, wherein the one or more processors execute the processor-implemented instructions to; receive the computational task that comprises multiple subflows; store input data of a current subflow of the computational task in a queue; create multiple task processing threads for each subflow; obtain first input data from the queue and perform data processing according to logic corresponding to the current subflow;
wherein different pieces of the first input data are obtained from the queue and the data processing of the different pieces of the first input data are performed according to the logic corresponding to the current subflow separately in the multiple task processing threads in parallel;determine whether to enter a next subflow according to a result of the data processing; when determining to enter the next subflow, store the result of the data processing in another queue as input data of the next subflow of the current subflow, and enter the next subflow; and decrease a difference between processing speeds of the current subflow and the next subflow such that a congested state or an idle time of at least one of the multiple task processing threads for the current subflow or the multiple task processing threads for the next subflow is reduced, by adjusting one or a combination of a number of the multiple task processing threads for the current subflow and a number of the multiple task processing threads for the next subflow. - View Dependent Claims (8, 9, 10)
-
-
11. A non-transitory computer-readable storage medium comprising executable instructions which when executed by one or more processors of a computing apparatus, cause the computing apparatus to perform a method for processing a computational task, the method comprising:
-
obtaining the computational task that comprises multiple subflows; storing input data of a current subflow of the computational task in a queue; creating multiple task processing threads for each subflow; obtaining first input data from the queue and performing data processing according to logic corresponding to the current subflow;
wherein different pieces of the first input data are obtained from the queue and the data processing of the different pieces of the first input data are performed according to the logic corresponding to the current subflow separately in the multiple task processing threads in parallel;determining whether to enter a next subflow according to a result of the data processing; when determining to enter the next subflow, storing the result of the data processing in another queue as input data of the next subflow of the current subflow, and entering the next subflow; and decreasing a difference between processing speeds of the current subflow and the next subflow such that a congested state or an idle time of at least one of the multiple task processing threads for the current subflow or the multiple task processing threads for the next subflow is reduced, by adjusting one or a combination of a number of the multiple task processing threads for the current subflow and a number of the multiple task processing threads for the next subflow. - View Dependent Claims (12, 13, 14)
-
Specification