CN109800078B - Task processing method, task distribution terminal and task execution terminal - Google Patents

Task processing method, task distribution terminal and task execution terminal Download PDF

Info

Publication number
CN109800078B
CN109800078B CN201811519989.1A CN201811519989A CN109800078B CN 109800078 B CN109800078 B CN 109800078B CN 201811519989 A CN201811519989 A CN 201811519989A CN 109800078 B CN109800078 B CN 109800078B
Authority
CN
China
Prior art keywords
executed
subtask
task
result
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811519989.1A
Other languages
Chinese (zh)
Other versions
CN109800078A (en
Inventor
彭亚
郝宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201811519989.1A priority Critical patent/CN109800078B/en
Publication of CN109800078A publication Critical patent/CN109800078A/en
Application granted granted Critical
Publication of CN109800078B publication Critical patent/CN109800078B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a task processing method, a task distribution terminal and a task execution terminal. The method comprises the following steps: selecting a first subtask to be executed from the plurality of subtasks to be executed, and sending the first subtask to be executed to the plurality of task execution terminals; receiving a plurality of task processing results corresponding to the first to-be-executed subtasks returned by the plurality of task execution terminals; determining a selection result corresponding to each task processing result according to the score value corresponding to each task processing result; and selecting a second subtask to be executed from the plurality of subtasks to be executed, sending the second subtask to be executed to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal. The invention can improve the processing speed of the task and improve the use experience of the user.

Description

Task processing method, task distribution terminal and task execution terminal
Technical Field
The present invention relates to. . The technical field particularly relates to a task processing method, a task distribution terminal and a task execution terminal.
Background
With the continuous development of the big data era, large-scale data plays a key role in scientific calculation and scientific statistics. At present, in order to improve the accuracy of task operation results, a task distribution robot generally divides a certain task into a plurality of subtasks, sends each subtask to a plurality of execution robots one by one for processing, receives processing results returned by the plurality of execution robots, and selects an optimal processing result from the processing results.
In the above solution, after the task distribution robot distributes one subtask to the multiple execution robots for processing, the task distribution robot receives processing results returned by the multiple execution robots, selects an optimal processing result from the processing results, and sends the selection result to the corresponding multiple task execution robots, where the execution robots that are not selected need to return the internal state to the state before the execution of the subtask, and then the task distribution robot issues the next subtask.
According to the above contents, each time the sub-task is processed, the task distribution robot and the execution robot need to perform two interactions, and under the condition that the interaction times of the task distribution robot and the execution robot are more, the processing speed of the task is reduced, and the use experience of the user is further reduced.
Disclosure of Invention
In view of the above problems, the present invention has been made to provide a task processing method, a task distribution terminal, and a task execution terminal that overcome or at least partially solve the above problems.
According to an aspect of the present invention, there is provided a task processing method including: selecting a first subtask to be executed from the plurality of subtasks to be executed, and sending the first subtask to be executed to the plurality of task execution terminals; receiving a plurality of task processing results corresponding to the first to-be-executed subtasks returned by the plurality of task execution terminals; determining a selection result corresponding to each task processing result according to the score value corresponding to each task processing result; and selecting a second subtask to be executed from the plurality of subtasks to be executed, sending the second subtask to be executed to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
Preferably, before the step of sending the first to-be-executed subtask to the plurality of task execution terminals, the method further includes: dividing a task to be executed into a plurality of subtasks to be executed; and respectively distributing corresponding identification information for each subtask to be executed.
Preferably, the identification information includes first identification information and second identification information, and the step of sending the first to-be-executed subtask to the plurality of task execution terminals includes: sending the first subtask to be executed and first identification information corresponding to the first subtask to be executed to the plurality of task execution terminals; the step of sending the second to-be-executed subtasks to the plurality of task execution terminals and sending each selection result to the corresponding task execution terminal includes: and sending the second to-be-executed subtasks and second identification information corresponding to the second to-be-executed subtasks to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
Preferably, the step of determining the selection result corresponding to each task processing result according to the score value corresponding to each task processing result includes: and according to the size of each score value, taking the task processing result with the largest score value as a selected result, and taking other task processing results as unselected results.
According to another aspect of the present invention, there is provided a task processing method including: receiving and processing a first to-be-executed subtask sent by a task distribution terminal; returning a task processing result to the task distribution terminal; receiving a second to-be-executed subtask sent by the task distribution terminal and a selection result of a task processing result corresponding to the first to-be-executed subtask; and executing the second to-be-executed subtask according to the selection result and a preset rule.
Preferably, the step of receiving and processing the first to-be-executed subtask sent by the task distribution terminal includes: receiving a first subtask to be executed and first identification information corresponding to the first subtask to be executed, which are sent by the task distribution terminal; processing the first subtask to be executed; after the step of processing the first to-be-executed subtask, the method further includes: and establishing and storing an association relation between a task processing result corresponding to the first to-be-executed subtask and the first identification information.
Preferably, the step of executing the second to-be-executed subtask according to the selection result and a preset rule includes: when the selection result is the selected result, executing the second to-be-executed subtask in the current state; or when the selection result is the unselected result, the state of the task execution terminal is restored to the state before the first to-be-executed subtask is executed according to the first identification information; and executing the second to-be-executed subtask.
According to another aspect of the present invention, there is provided a task distribution terminal including: the first subtask sending module is used for selecting a first subtask to be executed from the plurality of subtasks to be executed and sending the first subtask to be executed to the plurality of task execution terminals; a processing result receiving module, configured to receive multiple task processing results corresponding to the first to-be-executed subtask, where the multiple task processing results are returned by the multiple task execution terminals; the selection result determining module is used for determining the selection result of each task processing result according to the score value corresponding to each task processing result; and the second subtask sending module is used for selecting a second subtask to be executed from the plurality of subtasks to be executed, sending the second subtask to be executed to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
Preferably, the method further comprises the following steps: the task dividing module is used for dividing the task to be executed into a plurality of subtasks to be executed; and the identification information distribution module is used for respectively distributing corresponding identification information for each subtask to be executed.
Preferably, the identification information includes first identification information and second identification information, and the first subtask sending module includes: the first subtask sending submodule is used for sending the first subtask to be executed and first identification information corresponding to the first subtask to be executed to the plurality of task execution terminals; the second subtask sending module includes: and the second subtask sending submodule is used for sending the second subtask to be executed and second identification information corresponding to the second subtask to be executed to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
Preferably, the selection result determining module includes: and the selection result determining submodule is used for taking the task processing result with the largest score value as a selected result and taking other task processing results as unselected results according to the size of each score value.
According to another aspect of the present invention, there is provided a task execution terminal including: the first subtask receiving and processing module is used for receiving and processing a first subtask to be executed sent by the task distribution terminal; the processing result returning module is used for returning the task processing result to the task distribution terminal; a second subtask receiving module, configured to receive a second subtask to be executed and a selection result of a task processing result corresponding to the first subtask to be executed, where the selection result is sent by the task distributing terminal; and the second subtask processing module is used for executing the second subtask to be executed according to the selection result and a preset rule.
Preferably, the first subtask reception processing module includes: the first subtask and identifier receiving submodule is used for receiving a first subtask to be executed and first identifier information corresponding to the first subtask to be executed, which are sent by the task distributing terminal; the first subtask processing submodule is used for processing the first subtask to be executed; the task execution terminal further includes: and the association relationship establishing and storing module is used for establishing and storing the association relationship between the task processing result corresponding to the first to-be-executed subtask and the first identification information.
Preferably, the second subtask processing module includes: the current state execution sub-module is used for executing the second to-be-executed subtask in the current state when the selection result is the selected result; or the state reduction submodule is used for reducing the state of the task execution terminal to the state before the first to-be-executed subtask is executed according to the first identification information when the selection result is the unselected result; and the second subtask execution submodule is used for executing the second subtask to be executed.
According to the technical scheme of the invention, the task distribution terminal selects a first to-be-executed subtask from a plurality of to-be-executed subtasks, sends the first to-be-executed subtask to the plurality of task execution terminals, receives a plurality of task processing results corresponding to the first to-be-executed subtask returned by the plurality of task execution terminals, determines selection results corresponding to the task processing results respectively according to score values corresponding to the task processing results, selects a second to-be-executed subtask from the plurality of to-be-executed subtasks, sends the second to-be-executed subtask to the plurality of task execution terminals, and sends the selection results to the corresponding task execution terminals. In the technical scheme, only one interaction is needed between the task distributing terminal and the task executing terminal for each subtask, so that the interaction times between the task distributing terminal and the task executing terminal are reduced, the task processing speed is increased, and the use experience of a user is improved.
Drawings
FIG. 1 is a flowchart illustrating steps of a task processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a task processing method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a task distribution terminal according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a task execution terminal according to a fourth embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of a task processing method according to an embodiment of the present invention is shown, where the task processing method may be used for a task distribution terminal, and specifically may include the following steps:
step 101: and selecting a first subtask to be executed from the plurality of subtasks to be executed, and sending the first subtask to be executed to the plurality of task execution terminals.
In the embodiment of the present invention, the task distribution terminal may be a task distribution robot, and the task distribution robot may be associated with a plurality of task execution robots, and is configured to divide the task into a plurality of subtasks and sequentially distribute the plurality of subtasks to the plurality of task execution robots for processing.
Of course, the task distribution terminal may also be other terminal devices, for example, a main server in a server cluster, and the like, which is not limited in this embodiment of the present invention.
The first to-be-executed subtask refers to dividing the to-be-executed task into one of a plurality of to-be-executed subtasks, and when the to-be-executed task is processed, the to-be-executed subtask needs to be divided, and specifically, the following preferred embodiment is described in detail.
In a preferred embodiment of the present invention, before the step 101, the method may further include:
step S1: and dividing the task to be executed into a plurality of subtasks to be executed.
In the embodiment of the present invention, before processing the task to be executed, the task to be executed needs to be divided to obtain a plurality of sub tasks to be executed, for example, before processing the task to be executed a, the task to be executed a is divided into a sub task 1, a sub task 2, and a sub task 3, or the task to be executed a is divided into a sub task a and a sub task b, and so on.
It should be understood that the above examples are only examples for better understanding of the technical solutions of the embodiments of the present invention, and are not to be construed as the only limitations of the present invention.
The number of divided sub-tasks may be 2, 4, 8, etc., and the present invention is not limited thereto.
Certainly, the technology of dividing the task to be executed into a plurality of sub tasks to be executed is already a mature technology in the field, any scheme that can divide the task to be executed into a plurality of sub tasks to be executed in the prior art can be used in the present invention, and the embodiments of the present invention are not described herein again.
After dividing the task to be executed into a plurality of subtasks to be executed, step S2 is performed.
Step S2: and respectively distributing corresponding identification information for each subtask to be executed.
After obtaining the divided multiple to-be-executed subtasks, corresponding identification information may be allocated to each to-be-executed subtask, and the identification information of each to-be-executed subtask is unique, for example, the divided to-be-executed subtasks include a subtask a, a subtask B, and a subtask C, and identification information 1 may be allocated to the subtask a, identification information 2 may be allocated to the subtask B, identification information 3 may be allocated to the subtask C, and the like.
Different identification information is respectively allocated to the plurality of subtasks, so that the corresponding subtasks can be determined directly through the identification information, and in the subsequent processing process, the task processing result can be directly associated with the identification information, so that the subtasks and the like corresponding to the task processing result can be determined.
After allocating the identification information to each subtask, step 101 may include:
substep S1: and sending the first subtask to be executed and the first identification information corresponding to the first subtask to be executed to the plurality of task execution terminals.
In this embodiment of the present invention, the first identification information refers to identification information allocated by the task distribution terminal for the first to-be-executed subtask, and the first identification information may be a digital identification symbol, such as 1, 3, or 4, or may be other identification symbols, such as capital letters, lowercase letters, or the like, which is not limited in this embodiment of the present invention.
When the task distribution terminal sends the first to-be-executed subtask to the plurality of task execution terminals, the first identification information corresponding to the first to-be-executed subtask may also be sent to the plurality of task execution terminals, and then each task execution terminal may associate the task processing result of the first to-be-executed subtask with the first identification information.
Of course, after dividing the to-be-executed subtasks into a plurality of to-be-executed subtasks, in the process of processing each to-be-executed subtask, the plurality of to-be-executed subtasks obtained through division may be sorted in advance, that is, arranged in the execution queue according to the execution sequence, and then the first to-be-executed subtask may be any other to-be-executed subtask except the last to-be-executed subtask in the arrangement sequence, which is not limited in this embodiment of the present invention.
The number of the task execution terminals may be 2, 5, 10, and the like, which is not limited in the embodiment of the present invention.
After selecting the first to-be-executed subtask from the plurality of to-be-executed subtasks, the task distribution terminal may send the first to-be-executed subtask to the plurality of task execution terminals, and perform step 102.
Step 102: and receiving a plurality of task processing results which are returned by the plurality of task execution terminals and correspond to the first subtasks to be executed.
After the first to-be-executed subtask is distributed to the plurality of task execution terminals, each task execution terminal may process the first to-be-executed subtask to obtain a corresponding task processing result, which will be described in detail in the following embodiment two and will not be described herein again.
The task distribution terminal can receive the task processing result returned by each task execution terminal. Of course, the returned task processing result may be added with the terminal identifier of each task execution terminal, and the task execution terminal corresponding to each task processing result may be determined according to each terminal identifier.
After receiving a plurality of task processing results corresponding to the first to-be-executed subtasks returned by the plurality of task execution terminals, step 103 is executed.
Step 103: and determining the selection result of each task processing result according to the score value corresponding to each task processing result.
In the embodiment of the invention, the score value corresponding to each task processing result can be obtained by the task distribution terminal according to a preset algorithm
And after receiving the task processing results returned by each task execution terminal, the task distribution terminal may determine the score value corresponding to each task processing result according to a preset algorithm to calculate the correlation of each processing result, and determine the score value corresponding to the task processing result of the first to-be-executed subtask returned by each task execution terminal according to the preset corresponding relationship between the correlation and the score value.
The preset task processing result may also be preset, after the task processing result of the first to-be-executed subtask returned by each task execution terminal is obtained, the task processing result may be compared with the preset processing result, so as to determine the similarity between the task processing result and the preset task processing result, and the score value and the like corresponding to the task processing result of the first to-be-executed subtask returned by each task execution terminal are determined according to the correspondence between the similarity and the score value.
Of course, after each task execution terminal processes the received first to-be-executed subtask, the relevance of the task processing result may be calculated by determining the score value corresponding to the task processing result according to the preset algorithm for the task processing result, and the score value corresponding to the task processing result is determined according to the preset corresponding relationship between the relevance and the score value, and the score value is returned to the task distribution terminal.
In a specific implementation, a person skilled in the art may perform an acquisition mode of selecting a score value corresponding to a task processing result, where the acquisition mode may be acquired by a task distribution terminal or a task execution terminal, and the embodiment of the present invention is not limited thereto.
When receiving each task processing result corresponding to the first to-be-executed subtask returned by each task execution terminal, the task distribution terminal may select one task processing result from the plurality of task processing results as the optimal task processing result of the first to-be-executed subtask according to the score value corresponding to each task processing result.
In a preferred embodiment of the present invention, the step 103 may include:
sub-step M1: and according to the size of each score value, taking the task processing result with the largest score value as a selected result, and taking other task processing results as unselected results.
In the embodiment of the present invention, the task processing result with the largest score value may be used as the optimal processing result selected by the task distribution terminal, and other task processing results are unselected results. For example, if the task processing result corresponding to the first to-be-executed subtask returned by the task execution terminal 1, 2, or 3 is the task processing result A, B, C, the score value of the task processing result a is 35, the score value of the task processing result B is 20, and the score value of the task processing result C is 60, the task processing result C is taken as the selected result, and the task processing result C is the optimal processing result of the first to-be-executed subtask.
It should be understood that the above examples are only examples for better understanding of the technical solutions of the embodiments of the present invention, and are not to be construed as the only limitations of the present invention.
After determining the selection result from among the task processing results, step 104 is executed.
Step 104: and selecting a second subtask to be executed from the plurality of subtasks to be executed, sending the second subtask to be executed to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
The second to-be-executed subtask refers to any unprocessed subtask among the to-be-executed subtasks.
After the selection result corresponding to the first to-be-executed subtask is determined from each task processing result, a second to-be-executed subtask is selected from the plurality of to-be-executed subtasks, the second to-be-executed subtask is sent to the plurality of task execution terminals, and each selection result is sent to the corresponding task execution terminal. For example, the second to-be-executed subtask selected by the task distribution terminal is subtask 1, and subtask 1 needs to be sent to the task execution terminal A, B, C, whereas, as for the processing result of the first to-be-executed subtask, the processing result of the task execution terminal a is a selected result, and the processing results of the task execution terminals B and C are unselected results, and the task distribution terminal needs to send subtask 1 to the task execution terminals A, B and C, respectively, and send the selected result to the task execution terminal a, and the unselected result is sent to the task execution terminals B and C.
It should be understood that the above examples are only examples for better understanding of the technical solutions of the embodiments of the present invention, and are not to be taken as the only limitation of the embodiments of the present invention.
Of course, in the present invention, second identification information is also pre-allocated to the second to-be-executed subtask, and then the step 104 may include:
substep N1: and sending the second to-be-executed subtasks and the second to-be-executed subtasks to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
In this embodiment of the present invention, the second identification information refers to identification information allocated by the task distribution terminal for the second to-be-executed subtask, and the second identification information may be a digital identification symbol, such as 1, 3, or 4, and may also be other identification symbols, such as capital letters, lowercase letters, and the like, which is not limited in this embodiment of the present invention.
When the task distribution terminal sends the second to-be-executed subtask to the plurality of task execution terminals and the selection result corresponding to each task execution terminal is sent to the corresponding task execution terminal, the second identification information corresponding to the second to-be-executed subtask may also be sent to the plurality of task execution terminals, and then each task execution terminal may associate the processing result of the second to-be-executed subtask with the second identification information.
In the process, the task distribution terminal does not need to send the selection result to the plurality of task execution terminals after determining the selection result of the processing result corresponding to the first to-be-executed subtask, but sends the selection result and the second to-be-executed subtask to the plurality of task execution terminals together, so that the number of times of interaction between the task distribution terminal and the plurality of task execution terminals can be reduced.
In the task processing method provided by the embodiment of the present invention, the task distribution terminal selects the first to-be-executed subtask from the plurality of to-be-executed subtasks, sends the first to-be-executed subtask to the plurality of task execution terminals, receives the plurality of task processing results corresponding to the first to-be-executed subtask returned by the plurality of task execution terminals, determines the selection result of each task processing result according to the score value corresponding to each task processing result, selects the second to-be-executed subtask from the to-be-executed subtasks, sends the second to-be-executed subtask to the plurality of task execution terminals, and sends each selection result to the corresponding task execution terminal. In the technical scheme, only one interaction is needed between the task distributing terminal and the task executing terminal for each subtask, so that the interaction times between the task distributing terminal and the task executing terminal are reduced, the task processing speed is increased, and the use experience of a user is improved.
Example two
Referring to fig. 2, a flowchart illustrating steps of a task processing method according to an embodiment of the present invention is shown, where the task processing method may be used for a task execution terminal, and specifically may include the following steps:
step 201: and receiving and processing the first to-be-executed subtask sent by the task distribution terminal.
In the embodiment of the present invention, the task execution terminal may be a task execution robot, the task distribution terminal may be a task distribution robot, and the task execution robot may receive and process a plurality of to-be-executed subtasks distributed by the task distribution robot, so as to return a processing result to the task distribution robot.
Of course, the task execution terminal may also be other terminal devices, for example, a slave server in a server cluster, and the like, which is not limited in this embodiment of the present invention.
The task execution terminal can receive the first to-be-executed subtask distributed by the task distribution terminal, process the first to-be-executed subtask, and further obtain a processing result for processing the first to-be-executed subtask.
Certainly, the task distribution terminal also allocates first identification information to the first to-be-executed subtask in advance, and sends the first identification information to the task execution terminal together with the first to-be-executed subtask, and further, step 101 may include:
sub-step P1: receiving a first subtask to be executed and first identification information corresponding to the first subtask to be executed, which are sent by the task distribution terminal;
sub-step P2: and processing the first subtask to be executed.
In the embodiment of the present invention, the task execution terminal may receive the first identification information of the first to-be-executed subtask distributed by the task distribution terminal while receiving the first to-be-executed subtask sent by the task distribution terminal, and then, the task execution terminal processes the received first to-be-executed subtask, and after obtaining the processing result, may establish an association relationship between the first to-be-executed subtask and the first identification information, and further may determine the to-be-executed subtask corresponding to the processing result according to the identification information associated with the processing result.
After the association relationship between the first to-be-executed subtask and the first identification information is established, the task execution terminal may further store the association relationship, specifically, store the association relationship by establishing a corresponding database, or establish an association relationship list at the task execution terminal side for storing, which is not limited in this embodiment of the present invention.
After receiving and processing the first to-be-executed subtask sent by the task distribution terminal, step 202 is executed.
Step 202: and returning the task processing result to the task distribution terminal.
After determining the task processing result of the first to-be-executed subtask, the task processing result may be returned to the task distribution terminal.
And when the task processing result is returned, a terminal identifier of the task execution terminal can be added, so that the task distribution terminal can determine the task execution terminal corresponding to the task processing result of the first to-be-executed subtask according to the terminal identifier.
After the task processing result is returned to the task distribution terminal, step 203 is executed.
Step 203: and receiving a second to-be-executed subtask sent by the task distribution terminal and a selection result of a task processing result corresponding to the first to-be-executed subtask.
After receiving the task processing result corresponding to the first to-be-executed subtask, the task distribution terminal may obtain a corresponding score value according to the task processing result, and further determine a selection result (i.e., a selected result and an unselected result) of the task processing result, and further select, by the task distribution terminal, a second to-be-executed subtask from the plurality of to-be-executed subtasks, and send the second to-be-executed subtask and the selection result corresponding to the first to-be-executed subtask to the task execution terminal.
Of course, in a specific implementation, the score value corresponding to the task processing result may also be obtained by the task execution terminal, and the score value corresponding to the task processing result is also included while the task processing result is returned to the task distribution terminal, and for the obtaining manner of the score value, reference may be made to the description manner in the above embodiment one, which is not described herein again in the embodiments of the present invention.
After receiving the second to-be-executed subtask and the selection result corresponding to the first to-be-executed subtask, the task execution terminal performs step 204.
Step 204: and executing the second to-be-executed subtask according to the selection result and a preset rule.
In the embodiment of the present invention, the selection result may include a selected result and an unselected result, where the selected result refers to a task processing result of the task execution terminal processing a certain sub-task to be executed, which is selected by the task distribution terminal as an optimal processing result for performing a subsequent processing procedure.
The unselected result means that the task processing result of the task execution terminal processing a certain subtask to be executed is not selected as the optimal processing result by the task distribution terminal, that is, the task distribution terminal regards the task processing result as an invalid task processing result.
And when the selection result corresponding to the task processing result of the task execution terminal executing the first to-be-executed subtask is the selected result, after the task execution terminal receives the second to-be-executed subtask, directly executing the second to-be-executed subtask in the current state of the task execution terminal.
And when the selection result corresponding to the task processing result of the task execution terminal executing the first to-be-executed subtask is the unselected result, after the task execution terminal receives the second to-be-executed subtask, the state of the task execution terminal is restored to the state before the first to-be-executed subtask is executed according to the first identification information, and then the second to-be-executed subtask is executed.
In the embodiment of the invention, the task execution terminal does not directly receive the selection result of the task processing result corresponding to the first to-be-executed subtask sent by the task distribution terminal after processing the first to-be-executed subtask, but receives the selection results of the task processing result of the second to-be-executed subtask and the first to-be-executed subtask sent by the task distribution terminal, and then the task execution terminal can execute the second to-be-executed subtask according to the selection result and the preset rule, so that the step of independently receiving the selection result corresponding to the task processing result is reduced, and the number of interactions between the task execution terminal and the task distribution terminal is reduced.
The task processing method provided by the embodiment of the invention receives and processes the first to-be-executed subtask sent by the task distribution terminal, returns the task processing result to the task distribution terminal, receives the second to-be-executed subtask sent by the task distribution terminal and the selection result of the task processing result corresponding to the first to-be-executed subtask, and further executes the second to-be-executed subtask according to the selection result and the preset rule. By the embodiment of the invention, the process that the task execution terminal independently receives the selection result sent by the task distribution terminal can be reduced, the interaction times between the task execution terminal and the task distribution terminal are reduced, the task processing speed is improved, and the use experience of a user is improved.
EXAMPLE III
Referring to fig. 3, a schematic structural diagram of a task distribution terminal provided in an embodiment of the present invention is shown, which may specifically include:
a first subtask sending module 310, configured to select a first subtask to be executed from the plurality of subtasks to be executed, and send the first subtask to be executed to the plurality of task execution terminals; a processing result receiving module 320, configured to receive a plurality of task processing results corresponding to the first to-be-executed subtasks returned by the plurality of task execution terminals; a selection result determining module 330, configured to determine a selection result of each task processing result according to a score value corresponding to each task processing result; the second subtask sending module 340 is configured to select a second subtask to be executed from the plurality of subtasks to be executed, send the second subtask to be executed to the plurality of task execution terminals, and send each selection result to the corresponding task execution terminal.
Preferably, the method further comprises the following steps: the task dividing module is used for dividing the task to be executed into a plurality of subtasks to be executed; and the identification information distribution module is used for respectively distributing corresponding identification information for each subtask to be executed.
Preferably, the identification information includes first identification information and second identification information, and the first subtask sending module 310 includes: the first subtask sending submodule is used for sending the first subtask to be executed and first identification information corresponding to the first subtask to be executed to the plurality of task execution terminals; the second subtask sending module 340 includes: and the second subtask sending submodule is used for sending the second subtask to be executed and second identification information corresponding to the second subtask to be executed to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
Preferably, the selection result determining module 330 includes: and the selection result determining submodule is used for taking the task processing result with the largest score value as a selected result and taking other task processing results as unselected results according to the size of each score value.
In the task distribution terminal provided in the embodiment of the present invention, the task distribution terminal selects a first to-be-executed subtask from a plurality of to-be-executed subtasks, sends the first to-be-executed subtask to the plurality of task execution terminals, receives a plurality of task processing results corresponding to the first to-be-executed subtask returned by the plurality of task execution terminals, determines a selection result of each task processing result according to a score value corresponding to each task processing result, selects a second to-be-executed subtask from the to-be-executed subtasks, sends the second to-be-executed subtask to the plurality of task execution terminals, and sends each selection result to the corresponding task execution terminal. In the technical scheme, only one interaction is needed between the task distributing terminal and the task executing terminal for each subtask, so that the interaction times between the task distributing terminal and the task executing terminal are reduced, the task processing speed is increased, and the use experience of a user is improved.
Example four
Referring to fig. 4, a schematic structural diagram of a task execution terminal provided in an embodiment of the present invention is shown, which may specifically include:
a first subtask receiving and processing module 410, configured to receive and process a first subtask to be executed sent by the task distribution terminal; a processing result returning module 420, configured to return a task processing result to the task distribution terminal; a second subtask receiving module 430, configured to receive a second to-be-executed subtask sent by the task distribution terminal and a selection result of a task processing result corresponding to the first to-be-executed subtask; and a second subtask processing module 440, configured to execute the second subtask to be executed according to the selection result and according to a preset rule.
Preferably, the first subtask reception processing module 410 includes: the first subtask and identifier receiving submodule is used for receiving a first subtask to be executed and first identifier information corresponding to the first subtask to be executed, which are sent by the task distributing terminal; the first subtask processing submodule is used for processing the first subtask to be executed; the task execution terminal further includes: and the association relationship establishing and storing module is used for establishing and storing the association relationship between the task processing result corresponding to the first to-be-executed subtask and the first identification information.
Preferably, the second subtask processing module 440 includes: the current state execution sub-module is used for executing the second to-be-executed subtask in the current state when the selection result is the selected result; or the state reduction submodule is used for reducing the state of the task execution terminal to the state before the first to-be-executed subtask is executed according to the first identification information when the selection result is the unselected result; and the second subtask execution submodule is used for executing the second subtask to be executed.
The task execution terminal provided in the embodiment of the present invention returns the task processing result to the task distribution terminal by receiving and processing the first to-be-executed subtask sent by the task distribution terminal, receives the second to-be-executed subtask sent by the task distribution terminal and the selection result of the task processing result corresponding to the first to-be-executed subtask, and further executes the second to-be-executed subtask according to the selection result and the preset rule. By the embodiment of the invention, the process that the task execution terminal independently receives the selection result sent by the task distribution terminal can be reduced, the interaction times between the task execution terminal and the task distribution terminal are reduced, the task processing speed is improved, and the use experience of a user is improved.
It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that microprocessors or Digital Signal Processors (DSPs) may be used in practice to implement some or all of the functions of some or all of the components of the word recognition apparatus, electronic device and computer readable storage medium according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (12)

1. A task processing method is applied to a task distribution terminal and is characterized by comprising the following steps:
selecting a first subtask to be executed from the plurality of subtasks to be executed, and sending the first subtask to be executed to the plurality of task execution terminals;
receiving a plurality of task processing results corresponding to the first to-be-executed subtasks returned by the plurality of task execution terminals;
determining a selection result corresponding to each task processing result according to the score value corresponding to each task processing result;
and selecting a second subtask to be executed from the plurality of subtasks to be executed, and sending each selection result together with the second subtask to be executed to the plurality of task execution terminals.
2. The method according to claim 1, wherein before the step of sending the first to-be-executed subtask to the plurality of task execution terminals, the method further comprises:
dividing a task to be executed into a plurality of subtasks to be executed;
and respectively distributing corresponding identification information for each subtask to be executed.
3. The method according to claim 2, wherein the identification information includes first identification information and second identification information, and the step of sending the first to-be-executed subtask to the plurality of task execution terminals includes:
sending the first subtask to be executed and first identification information corresponding to the first subtask to be executed to the plurality of task execution terminals;
the step of sending the second to-be-executed subtasks to the plurality of task execution terminals and sending each selection result to the corresponding task execution terminal includes:
and sending the second to-be-executed subtasks and second identification information corresponding to the second to-be-executed subtasks to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
4. The method according to claim 1, wherein the step of determining the selection result corresponding to each task processing result according to the score value corresponding to each task processing result comprises:
and according to the size of each score value, taking the task processing result with the largest score value as a selected result, and taking other task processing results as unselected results.
5. A task processing method is applied to a task execution terminal and is characterized by comprising the following steps:
receiving and processing a first to-be-executed subtask sent by a task distribution terminal;
returning a task processing result to the task distribution terminal;
receiving a second to-be-executed subtask sent by the task distribution terminal and a selection result of a task processing result corresponding to the first to-be-executed subtask, wherein the selection result and the second to-be-executed subtask are sent to the task execution terminal by the task distribution terminal;
executing the second to-be-executed subtask according to the selection result and a preset rule;
the step of executing the second to-be-executed subtask according to the selection result and a preset rule includes:
when the selection result is the selected result, executing the second to-be-executed subtask in the current state; or
When the selection result is the unselected result, restoring the state of the task execution terminal to the state before the first to-be-executed subtask is executed according to first identification information;
and executing the second to-be-executed subtask.
6. The method according to claim 5, wherein the step of receiving and processing the first to-be-executed subtask sent by the task distribution terminal comprises:
receiving a first subtask to be executed and first identification information corresponding to the first subtask to be executed, which are sent by the task distribution terminal;
processing the first subtask to be executed;
after the step of processing the first to-be-executed subtask, the method further includes:
and establishing and storing an association relation between a task processing result corresponding to the first to-be-executed subtask and the first identification information.
7. A task distribution terminal, characterized by comprising:
the first subtask sending module is used for selecting a first subtask to be executed from the plurality of subtasks to be executed and sending the first subtask to be executed to the plurality of task execution terminals;
a processing result receiving module, configured to receive multiple task processing results corresponding to the first to-be-executed subtask, where the multiple task processing results are returned by the multiple task execution terminals;
the selection result determining module is used for determining the selection result of each task processing result according to the score value corresponding to each task processing result;
and the second subtask sending module is used for selecting a second subtask to be executed from the plurality of subtasks to be executed and sending each selection result together with the second subtask to be executed to the plurality of task execution terminals.
8. The task distribution terminal according to claim 7, further comprising:
the task dividing module is used for dividing the task to be executed into a plurality of subtasks to be executed;
and the identification information distribution module is used for respectively distributing corresponding identification information for each subtask to be executed.
9. The task distribution terminal according to claim 8, wherein the identification information includes first identification information and second identification information, and the first subtask sending module includes:
the first subtask sending submodule is used for sending the first subtask to be executed and first identification information corresponding to the first subtask to be executed to the plurality of task execution terminals;
the second subtask sending module includes:
and the second subtask sending submodule is used for sending the second subtask to be executed and second identification information corresponding to the second subtask to be executed to the plurality of task execution terminals, and sending each selection result to the corresponding task execution terminal.
10. The task distribution terminal according to claim 7, wherein the selection result determination module includes:
and the selection result determining submodule is used for taking the task processing result with the largest score value as a selected result and taking other task processing results as unselected results according to the size of each score value.
11. A task execution terminal, comprising:
the first subtask receiving and processing module is used for receiving and processing a first subtask to be executed sent by the task distribution terminal;
the processing result returning module is used for returning the task processing result to the task distribution terminal;
a second subtask receiving module, configured to receive a second subtask to be executed and a selection result of a task processing result corresponding to the first subtask to be executed, where the selection result and the second subtask to be executed are sent to the task executing terminal by the task distributing terminal;
the second subtask processing module is used for executing the second subtask to be executed according to the selection result and a preset rule;
the second subtask processing module includes:
the current state execution sub-module is used for executing the second to-be-executed subtask in the current state when the selection result is the selected result; or
The state reduction submodule is used for reducing the state of the task execution terminal to the state before the first to-be-executed subtask is executed according to first identification information when the selection result is the unselected result;
and the second subtask execution submodule is used for executing the second subtask to be executed.
12. The task execution terminal according to claim 11, wherein the first subtask reception processing module includes:
the first subtask and identifier receiving submodule is used for receiving a first subtask to be executed and first identifier information corresponding to the first subtask to be executed, which are sent by the task distributing terminal;
the first subtask processing submodule is used for processing the first subtask to be executed;
the task execution terminal further includes:
and the association relationship establishing and storing module is used for establishing and storing the association relationship between the task processing result corresponding to the first to-be-executed subtask and the first identification information.
CN201811519989.1A 2018-12-12 2018-12-12 Task processing method, task distribution terminal and task execution terminal Active CN109800078B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811519989.1A CN109800078B (en) 2018-12-12 2018-12-12 Task processing method, task distribution terminal and task execution terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811519989.1A CN109800078B (en) 2018-12-12 2018-12-12 Task processing method, task distribution terminal and task execution terminal

Publications (2)

Publication Number Publication Date
CN109800078A CN109800078A (en) 2019-05-24
CN109800078B true CN109800078B (en) 2020-04-28

Family

ID=66556596

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811519989.1A Active CN109800078B (en) 2018-12-12 2018-12-12 Task processing method, task distribution terminal and task execution terminal

Country Status (1)

Country Link
CN (1) CN109800078B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933132A (en) * 2019-10-25 2020-03-27 中国环境监测总站 Data processing server and data processing system
CN111429088B (en) * 2020-03-10 2023-09-19 岭东核电有限公司 Method, device, computer equipment and storage medium for transmitting process test results
CN112862451A (en) * 2021-03-02 2021-05-28 岭东核电有限公司 Work order processing method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105511956A (en) * 2014-09-24 2016-04-20 中国电信股份有限公司 Method and system for task scheduling based on share scheduling information
CN105729491A (en) * 2016-04-01 2016-07-06 纳恩博(北京)科技有限公司 Executing method, device and system for robot task
CN107451266A (en) * 2017-07-31 2017-12-08 北京京东尚科信息技术有限公司 For processing data method and its equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7908313B2 (en) * 2004-07-21 2011-03-15 The Mathworks, Inc. Instrument-based distributed computing systems
CN102999385B (en) * 2012-11-06 2016-05-25 国网山东省电力公司枣庄供电公司 Multiprocessor cooperative processing method in computing equipment
CN106940662A (en) * 2017-03-17 2017-07-11 上海传英信息技术有限公司 A kind of multi-task planning method of mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105511956A (en) * 2014-09-24 2016-04-20 中国电信股份有限公司 Method and system for task scheduling based on share scheduling information
CN105729491A (en) * 2016-04-01 2016-07-06 纳恩博(北京)科技有限公司 Executing method, device and system for robot task
CN107451266A (en) * 2017-07-31 2017-12-08 北京京东尚科信息技术有限公司 For processing data method and its equipment

Also Published As

Publication number Publication date
CN109800078A (en) 2019-05-24

Similar Documents

Publication Publication Date Title
US9846589B2 (en) Virtual machine placement optimization with generalized organizational scenarios
CN109684065B (en) Resource scheduling method, device and system
EP3267310B1 (en) Data processing method and device
CN109800078B (en) Task processing method, task distribution terminal and task execution terminal
CN112286917B (en) Data processing method and device, electronic equipment and storage medium
CN105488134A (en) Big data processing method and big data processing device
Yousif et al. Clustering cloud workload traces to improve the performance of cloud data centers
CN109359060B (en) Data extraction method, device, computing equipment and computer storage medium
CN107977275B (en) Task processing method based on message queue and related equipment
CN106168963A (en) Real-time streaming data processing method and device and server
CN111782404A (en) Data processing method and related equipment
CN108897858B (en) Distributed cluster index fragmentation evaluation method and device and electronic equipment
CN106874080B (en) Data calculation method and system based on distributed server cluster
CN108712486B (en) Workload proving method and device
CN112199407B (en) Data packet ordering method, device, equipment and storage medium
CN112306452A (en) Method, device and system for processing service data by merging and sorting algorithm
CN110505276B (en) Object matching method, device and system, electronic equipment and storage medium
CN108228355A (en) Task processing method and device, method for scheduling task and device
CN113766047B (en) Task grouping method and device, computer equipment and storage medium
CN110442619B (en) Search result ordering method and device, electronic equipment and storage medium
CN109783717B (en) Query task processing method, system, server cluster, device and computer readable storage medium
CN110297693B (en) Distributed software task allocation method and system
CN113537392A (en) Similar image identification method and device, computing equipment and computer storage medium
CN112395081A (en) Resource online automatic recovery method, system, server and storage medium
CN110825477A (en) Method, device and equipment for loading graphical interface and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant