CN115509714A - Task processing method and device, electronic equipment and storage medium - Google Patents

Task processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115509714A
CN115509714A CN202211240153.4A CN202211240153A CN115509714A CN 115509714 A CN115509714 A CN 115509714A CN 202211240153 A CN202211240153 A CN 202211240153A CN 115509714 A CN115509714 A CN 115509714A
Authority
CN
China
Prior art keywords
task
executed
processed
execution
platform
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.)
Pending
Application number
CN202211240153.4A
Other languages
Chinese (zh)
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211240153.4A priority Critical patent/CN115509714A/en
Publication of CN115509714A publication Critical patent/CN115509714A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a task processing method, a task processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring at least one task to be processed in a task list, and generating a corresponding task to be executed according to task association information corresponding to each task to be processed; sending each task to be executed to a target execution platform so as to execute each task to be executed based on the target execution platform and feeding back a task execution state of the corresponding task to be executed; and when the task execution state is detected to be the successful execution state, modifying the task execution state of the corresponding task to be executed according to each task execution state so as to determine the processing progress of the corresponding task to be executed based on each task execution state. The problems of inflexible task scheduling and inconvenient task management are solved, and the effects of flexibly scheduling the tasks according to the task plan in the task list on the same day and facilitating the task management are achieved.

Description

Task processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a task processing method and apparatus, an electronic device, and a storage medium.
Background
In order to process each task to be executed in time when a large number of tasks to be executed exist in the internet application, each task to be processed is generally brought into a uniform management platform for task scheduling and processing.
At present, a commonly adopted method is to obtain tasks to be executed that need to be executed currently, obtain corresponding task parameters, and dispatch each task to be processed and corresponding task parameters to a corresponding execution platform so as to perform processing based on each execution platform. However, such a task scheduling method cannot flexibly schedule tasks according to the current tasks to be executed, and needs to correspondingly adjust the task parameters of each task to be executed, which is very inconvenient.
In order to solve the above problems, an improvement in a task scheduling method is required.
Disclosure of Invention
The invention provides a task processing method, a task processing device, electronic equipment and a storage medium, and aims to solve the problems of inflexible task scheduling and inconvenient task management.
In a first aspect, an embodiment of the present invention provides a task processing method, including:
acquiring at least one task to be processed in a task list, and generating a corresponding task to be executed according to task association information corresponding to each task to be processed;
sending each task to be executed to a target execution platform, so as to execute each task to be executed based on the target execution platform, and feeding back a task execution state of the corresponding task to be executed;
and when the task execution state is detected to be the successful execution state, modifying the task execution state of the corresponding task to be executed according to each task execution state so as to determine the processing progress of the corresponding task to be executed based on each task execution state.
In a second aspect, an embodiment of the present invention further provides a task processing apparatus, including:
the to-be-executed task generating module is used for acquiring at least one to-be-processed task in the task list and generating a corresponding to-be-executed task according to task association information corresponding to each to-be-processed task;
the to-be-executed task execution module is used for sending each to-be-executed task to a target execution platform, executing each to-be-executed task based on the target execution platform and feeding back a task execution state of the corresponding to-be-executed task;
and the task state modification module is used for modifying the task execution state of the corresponding task to be executed according to each task execution state when the task execution state is detected to be the successful execution state, so as to determine the processing progress of the corresponding task to be executed based on each task execution state.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform a method of task processing according to any of the embodiments of the present invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to enable a processor to implement the task processing method according to any embodiment of the present invention when executed.
According to the technical scheme of the embodiment, at least one to-be-processed task in a task list is obtained, a corresponding to-be-executed task is generated according to task association information corresponding to each to-be-processed task, a corresponding task list is generated according to a daily task plan, the to-be-processed task needing to be processed currently is obtained from the task list, each to-be-processed task is sent to a target execution platform, corresponding task association information is obtained based on the target execution platform, and feedback is given, so that a scheduling platform generates the to-be-executed task corresponding to each to-be-processed task based on the received task association information. In the technical scheme, the scheduling platform needs to package the tasks to be processed to obtain the tasks to be executed, and then sends the tasks to be executed to the target execution platform to execute the tasks to be executed based on the target execution platform and feed back the task execution states of the tasks to be executed to the scheduling platform. When the task execution state is detected to be the execution success state, modifying the task execution state of the corresponding task to be executed according to the task execution state to determine the processing progress of the corresponding task to be executed based on the task execution state, and determining the processing progress of the corresponding task to be executed according to whether the task execution state of the task to be executed is the execution success state, wherein if the execution success state indicates that the task to be executed is executed completely, otherwise, the execution failure state indicates that the corresponding task to be executed fails to be executed, namely, the task processing progress of the corresponding task to be executed can be determined according to the task execution state, so that the task to be executed can be managed and supervised conveniently. The problems of inflexible task scheduling and inconvenient task management are solved, and the effect of flexibly scheduling the tasks according to the task plan in the task list on the current day is achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a task processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a task processing method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a task processing method according to a third embodiment of the present invention;
fig. 4 is a schematic diagram of generating a task to be executed according to a second embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a task processing device according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device implementing a task processing method according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein.
Before the technical scheme is elaborated in detail, an application scenario of the technical scheme is briefly introduced to facilitate a clearer understanding of the technical scheme. Whether it is an internet application or an enterprise application, is flooded with a large number of batch tasks for which it is often necessary to incorporate decentralized and poorly reliable batch tasks into a unified platform, the so-called batch scheduling system, for task scheduling. The batch scheduling platform is used as a core batch processing system, and can efficiently integrate and manage batch tasks in the system, so that the ordered and efficient operation of the batch tasks is guaranteed. Currently, when performing task scheduling processing based on a scheduling platform, it is generally necessary to adjust corresponding task parameters according to tasks that need to be executed each day, and then issue the scheduling tasks of the day to a corresponding execution platform, such as an agent service platform. However, such task scheduling methods are complicated, and since the tasks and task parameters that need to be scheduled daily are not fixed, automatic task scheduling cannot be implemented. In order to perform task scheduling adaptively according to the task to be processed on the current day, the task processing method of the technical scheme may be adopted to perform task scheduling.
Example one
Fig. 1 is a flowchart of a task processing method, which is applicable to a situation where a scheduling platform automatically and flexibly performs task scheduling, and is implemented by a task processing device, where the task processing device may be implemented in hardware and/or software, and the task processing device may be configured in a computing device that can execute the task processing method.
As shown in fig. 1, the method includes:
s110, at least one task to be processed in the task list is obtained, and corresponding tasks to be executed are generated according to task association information corresponding to the tasks to be processed.
The task scheduling processing is usually that the scheduling platform dispatches a task to be processed on the current day to the execution platform, and before dispatching the task to be processed, the scheduling platform needs to determine the task to be processed on the current day. The task list may be understood as a list for recording tasks to be processed that need to be processed on the current day, and for example, if the task list includes task 1, task 2, and task 3, the tasks to be processed are task 1, task 2, and task 3. The task related information may be understood as task information associated with the task to be processed, such as a series of task information associated with the task to be processed, such as task parameters, task execution platform, and task execution criteria. The tasks to be executed may be understood as tasks to be executed that are generated based on task association information associated with each task to be executed.
It should be noted that, in the present technical solution, a program for acquiring each task to be processed in the task list may be preset, or the program may be regarded as a task to be processed in the task list, but the function of the program is only to acquire a task to be processed that is actually required to be executed in the task list, that is, the task list includes a program (i.e., one of the tasks to be processed) for invoking a task to be executed that is required to be executed on the current day, and the task list also includes a task to be processed that is required to be executed on the current day.
Specifically, the scheduling platform includes a program for acquiring the to-be-processed task, and the program may exist in the form of a plug-in or a program function, that is, as long as the to-be-processed task that needs to be executed on the day can be acquired. Further, the program may acquire the to-be-processed tasks that need to be executed on the current day from the task list on the current day, and further acquire task association information associated with the to-be-processed tasks, so as to generate the to-be-executed tasks based on each to-be-processed task and the corresponding task association information.
Further, after each to-be-executed task is obtained, the scheduling platform deletes the to-be-processed task in the task list and sends the to-be-executed task to the corresponding execution platform, so that the to-be-executed task is executed based on the corresponding execution platform. That is to say, after the scheduling platform generates the corresponding to-be-executed tasks according to the to-be-processed tasks and the associated task association information, the corresponding to-be-executed tasks in the task list need to be deleted, and the corresponding to-be-executed tasks are recorded in the task list, so that the to-be-executed tasks are sent to the execution platform, and the to-be-executed tasks are executed based on the execution platform.
The method has the advantages that only the tasks to be processed in the daily task list need to be acquired and sent to the execution platform, and then the scheduling platform can generate corresponding tasks to be executed according to the task association information fed back by the execution platform, and the tasks to be executed do not need to be manually and correspondingly issued daily. In other words, if the task list includes m to-be-processed tasks and each to-be-processed task needs n task parameters, when task scheduling is performed manually, m × n to-be-executed tasks need to be generated based on the scheduling platform and the m × n to-be-processed tasks need to be sent to the execution platform for execution. The task processing method based on the technical scheme only needs to make a daily task list, if the number of the tasks to be processed is m, a task detection program for acquiring each task to be processed is also regarded as one task to be processed, which is equivalent to that only m +1 tasks to be processed are needed to be set in the task list, so that the task associated information associated with each task to be processed can be automatically acquired, and the corresponding task to be executed is automatically generated.
Optionally, the obtaining at least one to-be-processed task in the task list includes: and detecting task information in a pre-generated task list based on a task detection program to obtain at least one task to be processed.
The task detection program may be understood as a program for detecting a task to be processed in the task list, or may also be a plug-in tool, and the task detection program may be understood as a program for acquiring the task to be processed on the current day in the above process, that is, one of the tasks to be processed. It should be noted that the task detection program may be set in the task list, or may not be set in the task list, that is, the task detection program may exist independently as long as the task to be processed that is actually required to be executed on the current day in the task list can be obtained.
In the present technical solution, the task list is generated in advance, and the to-be-processed tasks that need to be executed on the current day may be input into the task list by a worker every day, or the to-be-processed tasks that need to be executed on the current day may be automatically acquired by a computer and recorded in the task list.
Specifically, a task detection program may be preset in the scheduling platform, so as to detect task information of the to-be-processed task in the pre-generated task list based on the task detection program, so as to obtain at least one to-be-processed task that needs to be executed on the current day.
And S120, sending each task to be executed to a target execution platform, executing each task to be executed based on the target execution platform, and feeding back a task execution state of the corresponding task to be executed.
The target execution platform may be understood as a platform for executing the tasks to be executed, and it may be understood that the number of the target execution platforms may be one or multiple, and when the number of the target execution platforms is multiple, the platform identifier corresponding to the target execution platform corresponding to each task to be executed is carried in the task association information of the tasks to be executed, so as to determine the target execution platform corresponding to each task to be executed based on the platform identifier. The task execution state may be used to characterize whether the task to be executed is successfully executed, and may include an execution success state or an execution failure state.
In practical application, the scheduling platform is used for dispatching the to-be-executed tasks recorded in the daily task list to each target execution platform, so as to process the to-be-executed tasks based on the target execution platforms, and according to the execution condition of the to-be-executed tasks, feeding back the corresponding task execution state, such as a task a, where the execution state is an execution success state and a task B is an execution failure state. Further, the task execution state may be represented by a word, and for convenience of computer recognition, the corresponding task execution state corresponding to different identification information may also be used, for example, if the execution success state is 1, and the execution failure state is 0, then it may be represented as, task a:1, task B:0.
optionally, the sending each task to be executed to a target execution platform, so as to execute each task to be executed based on the target execution platform, and feed back a task execution state of a corresponding task to be executed, includes: packaging each task to be executed to generate a file to be sent corresponding to a preset data format; and sending each file to be sent to the target execution platform, so as to execute the corresponding task to be executed according to each file to be sent based on the target execution platform, and feeding back the task execution state of the corresponding task to be executed.
In practical application, a task to be executed is obtained based on a task to be processed and corresponding task association information, in order to enable a target execution platform to execute the task to be executed, format conversion is also required to be performed on the task to be executed, a file to be sent in a preset data format is obtained, the file to be sent is sent to the corresponding target execution platform, the target execution platform analyzes the file to be sent, the task to be executed which needs to be processed is obtained, and after each task to be executed is executed, a task execution state of each task to be executed is fed back to a scheduling platform.
It should be noted that, in the present technical solution, when executing each task to be executed, the target execution platform may execute the tasks sequentially or may execute the tasks concurrently. When the task execution states of the tasks to be executed are fed back, all the task execution states can be fed back to the scheduling platform together after all the tasks to be executed are executed, or the corresponding task execution states can be fed back to the scheduling platform after one task to be executed is completed.
S130, when the task execution state is detected to be the successful execution state, modifying the task execution state of the corresponding task to be executed according to the task execution state, so as to determine the processing progress of the corresponding task to be executed based on the task execution state.
In practical application, the scheduling platform needs to record the task execution state of each task to be executed, so as to facilitate checking of the task processing progress of the current day, and after receiving the task execution state fed back by the target execution platform, the scheduling platform modifies the task execution state to be executed in the task list, for example, when the task to be executed is successfully executed, the scheduling platform modifies the task execution state to be a successful execution state. It can be understood that the task execution progress of the current day can be determined according to the task execution states of the tasks to be executed in the task list, and when the task execution states of all the tasks to be executed are the execution success states, it indicates that the tasks to be executed of the current day are all completed.
Optionally, the method further includes: and recording the actual execution time length corresponding to each task to be executed, and if the actual execution time length is greater than the corresponding preset execution time length, generating a corresponding early warning prompt and sending the early warning prompt.
The actual execution time length may be understood as a time length used by the target execution platform to execute each task to be executed. The preset execution time duration may be understood as a preset expected time duration corresponding to each task to be executed, and it may be understood that the preset execution time duration may be a uniform execution time duration set for all tasks to be executed, that is, the preset execution time duration of each task to be executed may be set to be the same. In addition, because the task parameters of each task to be executed are different or the task execution difficulty is different, the preset execution duration of each task to be executed can also be set to be different, which is not specifically limited herein and can be set according to the actual situation. It should be noted that the preset execution time of each task to be executed may be recorded in the task information of the corresponding task to be executed, so that after the target execution platform receives each task to be executed, the preset execution time corresponding to each task to be executed may be determined.
Specifically, when the target execution platform executes each to-be-executed task, it may be determined whether each actual execution time is longer than a corresponding preset execution time according to a preset execution time carried by each to-be-executed task and the corresponding actual execution time of the to-be-executed task. If so, indicating that the execution time of the corresponding task to be executed exceeds the expected time, and possibly having a task execution abnormal condition, at this time, the target execution platform should generate an early warning prompt corresponding to the task to be executed, and may record the task execution state of the task to be executed as an execution failure state, and feed back the execution failure state to the scheduling platform. Meanwhile, the early warning prompt can be sent to the target client side, so that relevant workers can check and process the early warning prompt in time.
According to the technical scheme of the embodiment, at least one to-be-processed task in a task list is obtained, a corresponding to-be-executed task is generated according to task association information corresponding to each to-be-processed task, a corresponding task list is generated according to a daily task plan, the to-be-processed task needing to be processed currently is obtained from the task list, each to-be-processed task is sent to a target execution platform, corresponding task association information is obtained based on the target execution platform, and feedback is given, so that a scheduling platform generates the to-be-executed task corresponding to each to-be-processed task based on the received task association information. In the technical scheme, the scheduling platform needs to package the tasks to be processed to obtain the tasks to be executed, and then sends the tasks to be executed to the target execution platform to execute the tasks to be executed based on the target execution platform and feed back the task execution states of the tasks to be executed to the scheduling platform. When the task execution state is detected to be the successful execution state, modifying the task execution state of the corresponding task to be executed according to the task execution state so as to determine the processing progress of the corresponding task to be executed based on the task execution state, and according to whether the task execution state of the task to be executed is the successful execution state or not, the processing progress of the corresponding to-be-executed task can be determined, if the execution success state indicates that the to-be-executed task is completely executed, otherwise, the execution failure state indicates that the corresponding to-be-executed task fails to be executed, that is, the task processing progress of the corresponding to-be-executed task can be determined according to the task execution state, so that the to-be-executed task can be managed and supervised conveniently. The problems of inflexible task scheduling and inconvenient task management are solved, and the effect of flexibly scheduling the tasks according to the task plan in the task list on the current day is achieved.
Example two
Fig. 2 is a flowchart of a task processing method according to the second embodiment of the present invention, and optionally, the corresponding to-be-executed tasks generated according to the task association information corresponding to each to-be-processed task are refined.
As shown in fig. 2, the method includes:
s210, at least one task to be processed in the task list is obtained.
S220, sending each task to be processed to a target execution platform, so as to obtain task associated information corresponding to each task to be processed based on the target execution platform, and feeding back the task associated information.
The task associated information comprises a series of information associated with the tasks to be processed, such as task names, task parameters, task parameter acquisition paths, task execution platforms and the like corresponding to the tasks to be processed.
In this technical solution, the to-be-processed task generated based on the scheduling platform may be regarded as a task node, that is, although the scheduling platform may obtain the task that needs to be executed on the current day from the task list, the scheduling platform cannot obtain task information associated with the to-be-processed task from the task list, and the task information associated with the to-be-processed task is stored in the target execution platform. Therefore, after the scheduling platform acquires the tasks to be processed, the tasks to be processed are sent to the target execution platform, the task association information associated with the tasks to be processed can be acquired based on the target execution platform, and the task association information associated with each task to be processed is fed back to the scheduling platform.
Optionally, the sending each to-be-processed task to a target execution platform to obtain and feed back task association information corresponding to each to-be-processed task based on the target execution platform includes: and generating messages to be sent corresponding to the tasks to be processed, and sending the messages to be sent to the target execution platform, so that after the messages to be sent pass the verification, corresponding task related information is fed back based on the target execution platform and fed back.
It should be noted that the target execution platform cannot directly identify the to-be-processed task acquired from the task list by the scheduling platform, and therefore, the to-be-processed task needs to be converted to obtain a to-be-sent message that can be identified by the target execution platform, and the to-be-sent message is sent to the target execution platform. It can be understood that the to-be-sent message includes task association information corresponding to the corresponding to-be-processed task.
Specifically, the scheduling platform processes the tasks to be processed, obtains the messages to be sent corresponding to the tasks to be processed, and sends the messages to be sent to the target execution platform. After receiving each message to be sent, the target execution platform analyzes each message to be sent first, and checks the analyzed message to be sent, such as message format, message length, message content and the like. And if the message to be sent passes the verification, the target execution platform acquires the tasks to be processed carried in the message to be sent, acquires task associated information corresponding to the tasks to be processed from a preset database, and feeds the task associated information back to the scheduling platform.
And S230, when the task associated information is received, generating a corresponding task to be executed based on the task associated information.
Specifically, after receiving the task association information, the scheduling platform may generate corresponding to-be-executed tasks according to the task association information corresponding to the to-be-executed tasks, so as to send the to-be-executed tasks to the target execution platform, and the target execution platform processes the to-be-executed tasks.
Optionally, the generating a corresponding task to be executed based on each piece of task association information includes: acquiring information identification of each task associated information; determining tasks to be processed associated with the information identifications based on a target mapping table; and aiming at each task to be processed, generating a current task to be executed corresponding to the current task to be processed according to current task associated information associated with the current task to be processed.
The target mapping table comprises task identifiers corresponding to the tasks to be processed, information identifiers of the task associated information and corresponding relations between the task identifiers and the corresponding information identifiers;
in practical application, when the target execution platform feeds back the relevant information of each task, the relevant information of each task carries a corresponding information identifier, so that the to-be-processed task associated with the relevant information of each task can be determined according to the information identifier. Specifically, a target mapping table may be generated in advance, and a corresponding relationship between each piece of task association information and a corresponding to-be-processed task is recorded in the target mapping table, so as to determine task association information associated with each to-be-processed task based on the target mapping table.
Taking one of the tasks to be processed as the current task to be processed as an example, based on the target mapping table, obtaining current task associated information associated with the current task to be processed from each task associated information, and performing encapsulation processing on the current task associated information, so as to obtain the current task to be executed corresponding to the current task to be processed.
And S240, sending each task to be executed to a target execution platform, so as to execute each task to be executed based on the target execution platform, and feeding back a task execution state of the corresponding task to be executed.
And S250, when the task execution state is detected to be the successful execution state, modifying the task execution state of the corresponding task to be executed according to each task execution state, so as to determine the processing progress of the corresponding task to be executed based on each task execution state.
According to the technical scheme of the embodiment, each task to be processed is sent to a target execution platform, so that task related information corresponding to each task to be processed is obtained based on the target execution platform and fed back, and because the target execution platform cannot directly identify the task to be processed, the task to be processed is converted into a message to be sent based on a scheduling platform, the message to be sent is sent to the target execution platform, after the message to be sent is checked based on the target execution platform, the task to be processed corresponding to the message to be sent passing the check is determined, corresponding task related information is obtained, and the task related information is fed back to the scheduling platform. When receiving the task associated information, generating corresponding tasks to be executed based on the task associated information, after receiving the task associated information, the scheduling platform packages the task associated information corresponding to the tasks to be executed to obtain the corresponding tasks to be executed, and sends the tasks to be executed to the target execution platform so as to execute the tasks to be executed based on the target execution platform and feed back corresponding task execution states. The problem that the task associated information of the tasks to be processed cannot be automatically acquired and corresponding tasks to be executed are generated according to the task associated information is solved, and the effects of automatically acquiring the task associated information and generating the tasks to be executed are achieved.
EXAMPLE III
In a specific example, a batch developer needs to configure two types of nodes, one generation node a, on a batch scheduling platform, where in the present technical solution, the generation node a may be understood as a node or a program for acquiring a task to be processed from a task list; m destination nodebs (i.e., tasks to be processed). The batch task role of A is to dynamically generate sub-nodes (namely, tasks to be executed) of B, and the batch task role of B is to execute different services according to different parameter conditions. A needs to be configured as the preamble of B (a needs to be performed before B). As shown in fig. 3, the scheduling service (i.e., the scheduling platform) screens out the node a to be scheduled from the job schedule (i.e., the task list) of the current day, and then requests the proxy service to execute the batch tasks of the node a, and after receiving the scheduling message (i.e., the message to be sent), the proxy service (i.e., the target execution platform) first performs validity check, and then loads the batch tasks of the node a through Java reflection and starts executing the batch tasks. Further, after the batch task of a starts to be executed, first, some parameters of the node a are obtained, such as information of a current job plan, a node number and the like, then, a class B node (i.e., a task to be processed) that needs to dynamically generate a sub-node, information of the number of the sub-nodes to be generated and a task parameter and the like (i.e., task related information) are defined, and finally, a dynamically generated sub-node interface of an agent service (i.e., a target execution platform) is called to prepare for sending a dynamically generated sub-node request (i.e., a request corresponding to a task to be executed) to a receiving service of the batch scheduling platform.
After receiving the batch task call, the agent service (i.e., the target execution platform) dynamically generates a sub-node interface, firstly performs parameter verification, then generates sub-node numbers according to the number of sub-nodes to be generated, and performs assembly (i.e., generates a task request from task related information of a task to be processed), and then forwards the task request to the receiving service of the scheduling platform. When receiving the task request, the receiving service of the scheduling platform firstly checks the request message, then inquires the original configuration parameters of the class B node from the node table, assembles the corresponding sub-node number, the sub-node parameters and the like in the dynamically generated sub-node request to obtain the task to be executed, and sends the task to be executed to the agent service (namely, the target execution platform).
Further, after the assembly is completed, the class B nodes (i.e., tasks to be processed) already generated in the operation schedule table on the current day are deleted, sub-nodes (i.e., tasks to be executed) of the assembled class B nodes are inserted into the operation schedule table on the current day, and each task to be executed is sent to the target execution platform, so that each task to be executed is executed based on the target execution platform, and the task execution state of each task to be executed is fed back. After receiving the returned result, the interface service of the scheduling platform firstly judges the generated result of the dynamically generated sub-node, then modifies the execution state of the batch task according to the generated result, at this time, all logic execution of the batch task is finished, then the proxy service reports the result, the receiving service modifies the execution state of the node A after receiving the reported result, the scheduling process of the whole node A is finished, and in the actual task scheduling process, the scheduling service (namely, the scheduling platform) screens out the sub-node (namely, the task to be executed) of the node B to be scheduled from the operation schedule (namely, the task list) on the same day to perform task scheduling.
Illustratively, as shown in fig. 4, a generating node (i.e., a task detection program) in the scheduling platform may obtain a target node 1 and a target node 2 (i.e., a to-be-processed task) that need to be executed on the current day from a task list on the current day. And then the target node 1 and the target node 2 are sent to a target execution platform, so that the target execution platform obtains corresponding task associated information according to the target node 1 and the target node 2 and feeds the corresponding task associated information back to the scheduling platform. After receiving the task association information fed back by the target execution platform, the scheduling platform may generate corresponding tasks to be executed, such as sub-node 1, sub-node 2, sub-node 3, and sub-node 4, based on the tasks to be executed and the corresponding task association information, delete each task to be processed in the task list, that is, delete target node 1 and target node 2, and record each task to be executed in the task list, that is, record sub-node 1, sub-node 2, sub-node 3, and sub-node 4 in the task list.
And sending each task to be executed in the task list to a target execution platform, wherein the target execution platform can execute each task to be executed and feed back the task execution state of each task to be executed to the scheduling platform. After receiving the task execution states, the scheduling platform may modify the task execution states of the corresponding tasks to be executed, and when the task states of all the tasks to be executed are the execution success states, it may be determined that all the tasks in the task list on the current day have been completed.
According to the technical scheme of the embodiment, at least one task to be processed in a task list is obtained, and corresponding tasks to be executed are generated according to task association information corresponding to the tasks to be processed; sending each task to be executed to a target execution platform so as to execute each task to be executed based on the target execution platform and feeding back a task execution state of the corresponding task to be executed; and when the task execution state is detected to be the successful execution state, modifying the task execution state of the corresponding task to be executed according to each task execution state so as to determine the processing progress of the corresponding task to be executed based on each task execution state. The problems of inflexible task scheduling and inconvenient task management are solved, and the effects of flexibly scheduling the tasks according to the task plan in the task list on the same day and facilitating the task management are achieved.
Example four
Fig. 5 is a schematic structural diagram of a task processing device according to a fourth embodiment of the present invention. As shown in fig. 5, the apparatus includes: a to-be-executed task generating module 310, a to-be-executed task executing module 320, and a task removing module 330.
The to-be-executed task generating module 310 is configured to obtain at least one to-be-executed task in the task list, and generate a corresponding to-be-executed task according to task association information corresponding to each to-be-executed task;
the to-be-executed task execution module 320 is configured to send each to-be-executed task to a target execution platform, so as to execute each to-be-executed task based on the target execution platform, and feed back a task execution state of the corresponding to-be-executed task;
the task state modification module 330 is configured to, when it is detected that the task execution state is the execution success state, modify the task execution state of the corresponding to-be-executed task according to the task execution state, so as to determine the processing progress of the corresponding to-be-executed task based on each task execution state.
According to the technical scheme of the embodiment, at least one to-be-processed task in a task list is obtained, a corresponding to-be-executed task is generated according to task association information corresponding to each to-be-processed task, a corresponding task list is generated according to a daily task plan, the to-be-processed task needing to be processed currently is obtained from the task list, each to-be-processed task is sent to a target execution platform, corresponding task association information is obtained based on the target execution platform, and feedback is given, so that a scheduling platform generates the to-be-executed task corresponding to each to-be-processed task based on the received task association information. In the technical scheme, the scheduling platform needs to package the tasks to be processed to obtain the tasks to be executed, and then sends the tasks to be executed to the target execution platform to execute the tasks to be executed based on the target execution platform and feed back the task execution states of the tasks to be executed to the scheduling platform. When the task execution state is detected to be the execution success state, modifying the task execution state of the corresponding task to be executed according to the task execution state, so as to determine the processing progress of the corresponding task to be executed based on the task execution state, and determining the processing progress of the corresponding task to be executed according to whether the task execution state of the task to be executed is the execution success state, wherein if the execution success state indicates that the task to be executed is executed completely, otherwise, the execution failure state indicates that the corresponding task to be executed is executed unsuccessfully, that is, the task processing progress of the corresponding task to be executed can be determined according to the task execution state, so that the task to be executed is convenient to manage and supervise. The problems of inflexible task scheduling and inconvenient task management are solved, and the effect of flexibly scheduling the tasks according to the task plan in the task list on the current day is achieved.
Optionally, the to-be-executed task generating module is configured to detect task information in a pre-generated task list based on a task detection program to obtain at least one to-be-processed task.
Optionally, the to-be-executed task generating module includes: the system comprises a to-be-processed task sending unit, a target execution platform and a task processing unit, wherein the to-be-processed task sending unit is used for sending each to-be-processed task to the target execution platform so as to obtain and feed back task associated information corresponding to each to-be-processed task based on the target execution platform;
and the to-be-executed task generating unit is used for generating a corresponding to-be-executed task based on each task associated information when each task associated information is received.
Optionally, the to-be-processed task sending unit is configured to generate to-be-sent messages corresponding to each to-be-processed task, and send each to-be-sent message to the target execution platform, so that after each to-be-sent message passes verification, corresponding task association information is fed back based on the target execution platform and fed back;
and the message to be sent comprises task association information corresponding to the corresponding task to be processed.
Optionally, the to-be-executed task generating unit includes: an information identifier determining subunit, configured to obtain an information identifier of each piece of task-related information;
the to-be-processed task determining subunit is used for determining to-be-processed tasks associated with the information identifications based on the target mapping table; the target mapping table comprises task identifiers corresponding to the tasks to be processed, information identifiers of the task associated information and corresponding relations between the task identifiers and the corresponding information identifiers;
and the to-be-executed task generating subunit is used for generating a current to-be-executed task corresponding to the current to-be-processed task according to the current task associated information associated with the current to-be-processed task aiming at each to-be-processed task.
Optionally, the to-be-executed task execution module includes: a file to be sent generating unit, configured to package each task to be executed, and generate a file to be sent corresponding to a preset data format;
and the to-be-executed task execution unit is used for sending each file to be sent to the target execution platform, executing a corresponding to-be-executed task according to each file to be sent based on the target execution platform, and feeding back a task execution state of the corresponding to-be-executed task.
Optionally, the task processing device is further configured to record an actual execution duration corresponding to each to-be-executed task, and if the actual execution duration is greater than a corresponding preset execution duration, generate a corresponding early warning prompt and send the early warning prompt.
The task processing device provided by the embodiment of the invention can execute the task processing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 6 shows a schematic structural diagram of the electronic device 10 of the embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
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, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the respective methods and processes described above, such as the task processing method.
In some embodiments, the task processing method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto 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 task processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the task processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
The computer program for implementing the task processing method 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A task processing method, comprising:
acquiring at least one task to be processed in a task list, and generating a corresponding task to be executed according to task association information corresponding to each task to be processed;
sending each task to be executed to a target execution platform, executing each task to be executed based on the target execution platform, and feeding back a task execution state of the corresponding task to be executed;
and when the task execution state is detected to be the successful execution state, modifying the task execution state of the corresponding task to be executed according to each task execution state so as to determine the processing progress of the corresponding task to be executed based on each task execution state.
2. The method of claim 1, wherein obtaining at least one task to be processed in the task list comprises:
and detecting task information in a pre-generated task list based on a task detection program to obtain at least one task to be processed.
3. The method according to claim 1, wherein the generating a corresponding task to be executed according to the task association information corresponding to each task to be executed comprises:
sending each task to be processed to a target execution platform, so as to obtain task associated information corresponding to each task to be processed based on the target execution platform, and feeding back the task associated information;
and when receiving the task associated information, generating a corresponding task to be executed based on the task associated information.
4. The method according to claim 3, wherein the sending each to-be-processed task to a target execution platform so as to obtain and feed back task association information corresponding to each to-be-processed task based on the target execution platform comprises:
generating messages to be sent corresponding to the tasks to be processed, and sending the messages to be sent to the target execution platform, so that after the messages to be sent pass the verification, corresponding task related information is fed back based on the target execution platform and fed back;
and the message to be sent comprises task association information corresponding to the corresponding task to be processed.
5. The method of claim 3, wherein generating the respective task to be performed based on each of the task association information comprises:
acquiring information identification of each task associated information;
determining tasks to be processed associated with the information identifications based on a target mapping table; the target mapping table comprises task identifiers corresponding to the tasks to be processed, information identifiers of the task associated information and corresponding relations between the task identifiers and the corresponding information identifiers;
and aiming at each task to be processed, generating a current task to be executed corresponding to the current task to be processed according to current task associated information associated with the current task to be processed.
6. The method according to claim 1, wherein the sending each task to be executed to a target execution platform, so as to execute each task to be executed based on the target execution platform, and feeding back a task execution state of a corresponding task to be executed comprises:
packaging each task to be executed to generate a file to be sent corresponding to a preset data format;
and sending each file to be sent to the target execution platform, so as to execute the corresponding task to be executed according to each file to be sent based on the target execution platform, and feeding back the task execution state of the corresponding task to be executed.
7. The method of claim 1, further comprising:
and recording the actual execution time length corresponding to each task to be executed, and if the actual execution time length is greater than the corresponding preset execution time length, generating a corresponding early warning prompt and sending the early warning prompt.
8. A task processing apparatus, comprising:
the to-be-executed task generating module is used for acquiring at least one to-be-processed task in the task list and generating a corresponding to-be-executed task according to task association information corresponding to each to-be-processed task;
the to-be-executed task execution module is used for sending each to-be-executed task to a target execution platform, executing each to-be-executed task based on the target execution platform and feeding back a task execution state of the corresponding to-be-executed task;
and the task state modification module is used for modifying the task execution state of the corresponding task to be executed according to each task execution state when the task execution state is detected to be the successful execution state, so as to determine the processing progress of the corresponding task to be executed based on each task execution state.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method of task processing according to any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon computer instructions for causing a processor to execute a method for processing tasks according to any one of claims 1 to 7.
CN202211240153.4A 2022-10-11 2022-10-11 Task processing method and device, electronic equipment and storage medium Pending CN115509714A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211240153.4A CN115509714A (en) 2022-10-11 2022-10-11 Task processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211240153.4A CN115509714A (en) 2022-10-11 2022-10-11 Task processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115509714A true CN115509714A (en) 2022-12-23

Family

ID=84508441

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211240153.4A Pending CN115509714A (en) 2022-10-11 2022-10-11 Task processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115509714A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116680064A (en) * 2023-08-03 2023-09-01 中航信移动科技有限公司 Task node management method, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116680064A (en) * 2023-08-03 2023-09-01 中航信移动科技有限公司 Task node management method, electronic equipment and storage medium
CN116680064B (en) * 2023-08-03 2023-10-10 中航信移动科技有限公司 Task node management method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110825535B (en) Job scheduling method and system
EP4113299A2 (en) Task processing method and device, and electronic device
US11061669B2 (en) Software development tool integration and monitoring
US10891193B2 (en) Application health monitoring and automatic remediation
CN115509714A (en) Task processing method and device, electronic equipment and storage medium
CN114579469A (en) Full link interface test method and device, electronic equipment and storage medium
CN113658351A (en) Product production method and device, electronic equipment and storage medium
CN109408104B (en) Method and device for acquiring game integration information
CN108154343B (en) Emergency processing method and system for enterprise-level information system
CN115309558A (en) Resource scheduling management system, method, computer equipment and storage medium
CN115766697A (en) File downloading method, device, equipment and storage medium
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN113419921A (en) Task monitoring method, device, equipment and storage medium
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN117519989B (en) Distributed system hosting method and device, electronic equipment and storage medium
CN116302796A (en) Process monitoring method and device, electronic equipment and storage medium
CN115665256A (en) Task processing method and device, electronic equipment and storage medium
CN115309717A (en) Database loading method, device, equipment, medium and computer program product
CN114418429A (en) Monitoring method and device for batch operation, mobile terminal and medium
CN117608925A (en) Application restarting method and device, electronic equipment and storage medium
CN116312917A (en) Inspection report generation method and device, electronic equipment and storage medium
CN117314440A (en) Data processing method and device, electronic equipment and storage medium
CN117171270A (en) Product fault tracing method and device, electronic equipment and storage medium
CN115951921A (en) Service processing method, device and storage medium
CN117112354A (en) Early warning method, device, equipment and storage medium of application program

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