CN114691241B - Task execution method, device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114691241B
CN114691241B CN202210409629.6A CN202210409629A CN114691241B CN 114691241 B CN114691241 B CN 114691241B CN 202210409629 A CN202210409629 A CN 202210409629A CN 114691241 B CN114691241 B CN 114691241B
Authority
CN
China
Prior art keywords
task
executed
execution
event
management node
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
CN202210409629.6A
Other languages
Chinese (zh)
Other versions
CN114691241A (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.)
Aerial Photogrammetry and Remote Sensing Co Ltd
Original Assignee
Aerial Photogrammetry and Remote Sensing 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 Aerial Photogrammetry and Remote Sensing Co Ltd filed Critical Aerial Photogrammetry and Remote Sensing Co Ltd
Priority to CN202210409629.6A priority Critical patent/CN114691241B/en
Publication of CN114691241A publication Critical patent/CN114691241A/en
Application granted granted Critical
Publication of CN114691241B publication Critical patent/CN114691241B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44589Program code verification, e.g. Java bytecode verification, proof-carrying code

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a task execution method, a task execution device, electronic equipment and a storage medium, wherein the task execution method comprises the following steps: the management node receives a task to be executed; the management node executes the initial event group, initializes the task to be executed and verifies the task to be executed to obtain a first execution result, so that the third party equipment obtains the first execution result through the calling interfaces corresponding to all the events in the initial event group; if the task to be executed passes the verification, the management node sends the task to be executed to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, and the second execution result is returned to the management node. The corresponding events are executed through the management node, and the calling interfaces of the events are provided through the management node, so that the third party equipment can acquire the execution results of the events through the calling interfaces of the events, corresponding service functions are performed, and linkage capacity and expansion capacity are further improved.

Description

Task execution method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a task execution method, a task execution device, an electronic device, and a storage medium.
Background
Event-driven refers to a strategy for making decisions in the process of continuous transaction management, namely, following events occurring at the current time point, mobilizing available resources and executing related tasks, so that the problem of continuous occurrence is solved, and transaction accumulation is prevented. The method has application in the fields of computer programming, public relations, economic activities and the like.
The existing computing task execution method focuses more on single-node calling, and multi-party resources and systems are not easy to mobilize. The system designed based on the method is bloated, low in robustness, low in usability and low in expandability. Disadvantageously meeting the sudden increase in the amount of computation and the increasing complexity.
Disclosure of Invention
The present application aims to provide a task execution method, a task execution device, an electronic device and a storage medium, which aim to overcome the defects in the prior art, and improve the usability and scalability of a system.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a task execution method, which is applied to a management node, where the management node provides a plurality of events and call interfaces corresponding to the events, and the method includes:
The management node receives a task to be executed;
the management node executes an initial event group to initialize the task to be executed and verifies the task to be executed to obtain a first execution result, so that a third party device obtains the first execution result through a calling interface corresponding to each event in the initial event group, wherein the initial event group comprises: initializing an event, a pre-execution event, a start-execution event and a post-execution event;
if the task to be executed passes verification, the management node sends the task to be executed to a computing node, so that the computing node executes the task to be executed to obtain a second execution result, the second execution result is returned to the management node, and the second execution result is used for indicating whether the task to be executed is executed successfully or not;
and if the second execution result indicates that the task to be executed is successfully executed, the management node executes a task success event to obtain a third execution result, so that third party equipment obtains the third execution result through a calling interface corresponding to the task success event.
Optionally, the managing node performs an initial event group to initialize the task to be executed and verify the task to be executed to obtain a first execution result, including:
The management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
and the management node obtains the first execution result according to the initialization result and the verification result.
Optionally, the management node sends the task to be executed to a computing node, so that the computing node executes the task to be executed to obtain a second execution result, including:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and the management node executes an event in task execution to acquire the execution state of the task to be executed so that a third party device acquires the execution state of the task to be executed through a calling interface corresponding to the event in task execution.
Optionally, the event in task execution is executed by the management node to obtain an execution state of the task to be executed, including:
And the management node executes the event in task execution to acquire the execution state of the task to be executed, and if the execution state of the task to be executed is changed, the management node executes the task change event to enable third party equipment to acquire the task change information of the task to be executed through a calling interface corresponding to the task change event.
Optionally, the management node sends the task to be executed to a computing node, so that the computing node executes the task to be executed to obtain a second execution result, including:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and if the management node receives a task stop instruction, the management node sends the task stop instruction to the computing node so that the computing node stops executing the task to be executed and obtains a second execution result indicating that the task to be executed is stopped.
Optionally, the task to be performed includes: the initial event group further comprises: searching a root node task and executing the root node task;
The management node executing the initial event group initializes the task to be executed and verifies the task to be executed to obtain a first execution result, including:
and the management node executes an initial event group according to the dependency relationship of the task nodes, initializes each task node in the tasks to be executed, verifies the tasks to be executed and obtains the first execution result.
Optionally, the managing node performs an initial event group according to the dependency relationship of the plurality of task nodes to initialize each task node in the tasks to be performed and verify the tasks to be performed, including:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
the management node searches for a dependent task and checks a dependent execution result;
and the management node obtains the first execution result according to the initialization result, the verification result and the dependent execution result.
In a second aspect, an embodiment of the present application further provides a task execution device, where the device includes:
the receiving module is used for receiving the task to be executed by the management node;
the verification module is configured to initialize the task to be executed by the management node executing an initial event group and verify the task to be executed to obtain a first execution result, so that a third party device obtains the first execution result through a call interface corresponding to each event in the initial event group, where the initial event group includes: initializing an event, a pre-execution event, a start-execution event and a post-execution event;
the execution module is used for sending the task to be executed to the computing node by the management node if the verification of the task to be executed is passed, so that the computing node executes the task to be executed to obtain a second execution result, and the second execution result is returned to the management node, wherein the second execution result is used for indicating whether the task to be executed is successfully executed or not;
and the execution module is used for executing a task success event by the management node if the second execution result indicates that the task to be executed is successfully executed, so as to obtain a third execution result, and enabling third party equipment to obtain the third execution result through a calling interface corresponding to the task success event.
Optionally, the verification module is specifically configured to:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
and the management node obtains the first execution result according to the initialization result and the verification result.
Optionally, the execution module is specifically configured to:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and the management node executes an event in task execution to acquire the execution state of the task to be executed so that a third party device acquires the execution state of the task to be executed through a calling interface corresponding to the event in task execution.
Optionally, the execution module is specifically configured to:
and the management node executes the event in task execution to acquire the execution state of the task to be executed, and if the execution state of the task to be executed is changed, the management node executes the task change event to enable third party equipment to acquire the task change information of the task to be executed through a calling interface corresponding to the task change event.
Optionally, the execution module is specifically configured to:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and if the management node receives a task stop instruction, the management node sends the task stop instruction to the computing node so that the computing node stops executing the task to be executed and obtains a second execution result indicating that the task to be executed is stopped.
Optionally, the verification module is specifically configured to:
and the management node executes an initial event group according to the dependency relationship of the task nodes, initializes each task node in the tasks to be executed, verifies the tasks to be executed and obtains the first execution result.
Optionally, the verification module is specifically configured to:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
The management node searches for a dependent task and checks a dependent execution result;
and the management node obtains the first execution result according to the initialization result, the verification result and the dependent execution result.
In a third aspect, an embodiment of the present application further provides an electronic device, including: the system comprises a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, when an application program runs, the processor and the storage medium are communicated through the bus, and the processor executes the program instructions to execute the steps of the task execution method in the first aspect.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium, where a computer program is stored, where the computer program is read and executed to perform the steps of the task execution method described in the first aspect.
The beneficial effects of this application are:
the task execution method, the device, the electronic equipment and the storage medium provided by the application receive the task to be executed through the management node; the management node executes the initial event group, initializes the task to be executed and verifies the task to be executed to obtain a first execution result, so that the third party equipment obtains the first execution result through the calling interfaces corresponding to all the events in the initial event group; if the verification of the task to be executed is passed, the management node sends the task to be executed to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, and the second execution result is returned to the management node; if the second execution result indicates that the task to be executed is successfully executed, the management node executes a task success event to obtain a third execution result, so that the third party equipment obtains the third execution result through a calling interface corresponding to the task success event. The corresponding events are executed through the management node, and the calling interfaces of the events are provided through the management node, so that the third party equipment can acquire the execution results of the events through the calling interfaces of the events, corresponding service functions are performed, and linkage capacity and expansion capacity are further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an exemplary scenario provided in an embodiment of the present application;
fig. 2 is a flow chart of a task execution method according to an embodiment of the present application;
FIG. 3 is a complete flow chart of task execution provided in this embodiment;
FIG. 4 is a flowchart of another task execution method according to the present embodiment;
FIG. 5 is a flowchart showing another task execution process according to the present embodiment;
fig. 6 is a schematic device diagram of a task execution method according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the accompanying drawings in the present application are only for the purpose of illustration and description, and are not intended to limit the protection scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this application, illustrates operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to the flow diagrams and one or more operations may be removed from the flow diagrams as directed by those skilled in the art.
In addition, the described embodiments are only some, but not all, of the embodiments of the present application. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the presence of the features stated hereinafter, but not to exclude the addition of other features.
Fig. 1 is a schematic view of an exemplary scenario provided in an embodiment of the present application, where as shown in fig. 1, the method is applied to a management node in a task management system, where the task management system may have a management node pool including one or more management nodes, each management node in the management node pool may previously establish a communication connection with one or more computing node pools, and each management node may send a computing task to one or more computing node pools that establish a communication connection with each management node pool, and each computing node pool may include multiple computing nodes.
Alternatively, one computing node pool may establish communication connections with multiple management nodes at the same time, but one computing node cannot belong to multiple computing node pools at the same time.
Optionally, the whole scheduling process of the computing task based on the above scenario specifically includes: after receiving the calculation task, the management node obtains the resource loss and the environment requirement of the calculation task according to the calculation task, and sends the resource loss of the task to a target calculation node pool matched with the environment requirement of the calculation task, the target calculation node pool system selects a most matched target calculation node according to the resource loss of the task, the management node sends the calculation task to the target calculation node, the target calculation node executes the calculation task after receiving the calculation task, and sends an execution result to the management node, and the management node can send the received execution result to third-party equipment.
Optionally, the resource consumption of the computing task may include a CPU demand, a GPU demand, and a resource demand function of the computing task, where the resource demand function may specifically include a memory demand function, a graphics card demand function, and a storage demand function, and the resource demand function of the computing task may calculate the resource demand according to an entry list of the computing task.
Alternatively, the environmental requirements of the computing task may include execution language, language version, compiler version, build parameters, execution parameters, and the like.
Optionally, in the process of scheduling the computing task, the management node performs execution of a plurality of events of the computing task according to a scheduling flow, where the management node provides the plurality of events and call interfaces corresponding to the events, and the third party device may call corresponding event results through the call interfaces corresponding to the events, so as to perform corresponding service functions, and achieve function expansion of the events by providing the call interfaces.
Fig. 2 is a flow chart of a task execution method provided in an embodiment of the present application, where an execution body of the method is a management node as described above, as shown in fig. 2, and the method includes:
s101, the management node receives a task to be executed.
The tasks to be executed may include a basic computing task, a non-judging task, a weight judging task, a circulating task, etc., where the basic computing task may be, for example, a signal index to be calculated; the non-judgment task may be, for example, inputting the calculated signal index to the non-judgment task node, performing signal activation judgment, and outputting whether or not to activate the signal.
The management node receives a task to be executed, wherein the task to be executed can comprise an identification of the task to be executed, and the identification can be information such as a name, an ID and the like.
S102, the management node executes the initial event group, initializes the task to be executed and verifies the task to be executed to obtain a first execution result, so that the third party equipment obtains the first execution result through the calling interfaces corresponding to all events in the initial event group.
Optionally, the initial event group may include an initialization event, a pre-execution start event, an execution start event, and a post-execution start event, and the execution initial event group includes an execution task initialization event, an execution task pre-execution start event, an execution task start execution event, and an execution task post-execution start event.
Optionally, the first execution result includes an event result of each event in the initial event group executed by the management node, for example, the event is normal or abnormal, the third party device may obtain the event result of each event through a call interface corresponding to each event, and may perform a functional module corresponding to the service logic according to the event result of each event. Specifically, for example, the third party may be an alarm platform, and if the event result is abnormal, the third party alarm platform may generate alarm information according to the abnormal result to prompt that the event is abnormal.
And S103, if the verification of the task to be executed is passed, the management node sends the task to be executed to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, and the second execution result is returned to the management node.
Optionally, the verification of the task to be performed may refer to that all events in the initial event group are successfully performed by the management node, and then the management node sends the task to be performed to the computing node, specifically, the management node selects a target computing node from the target computing node pool, sends the task to be performed to the target computing node, and specific steps may refer to the foregoing computing task scheduling process, which is not described herein.
Optionally, after receiving the task to be executed, the computing node executes the task to be executed to obtain a second execution result, where the second execution result may be used to indicate whether the task to be executed is executed successfully, for example, the task is successful and the task is failed, and returns the second execution result to the management node.
And S104, if the second execution result indicates that the task to be executed is successfully executed, the management node executes a task success event to obtain a third execution result, so that the third party equipment obtains the third execution result through a calling interface corresponding to the task success event.
Optionally, if the second execution result indicates that the task to be executed fails to execute, the management node executes the task failure event to obtain a third execution result, so that the third party device obtains the third execution result through a call interface corresponding to the task failure event.
Wherein the third execution result may include success or failure.
In summary, in this embodiment, the task to be executed is received by the management node; the management node executes the initial event group, initializes the task to be executed and verifies the task to be executed to obtain a first execution result, so that the third party equipment obtains the first execution result through the calling interfaces corresponding to all the events in the initial event group; if the verification of the task to be executed is passed, the management node sends the task to be executed to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, and the second execution result is returned to the management node; if the second execution result indicates that the task to be executed is successfully executed, the management node executes a task success event to obtain a third execution result, so that the third party equipment obtains the third execution result through a calling interface corresponding to the task success event. The corresponding events are executed through the management node, and the calling interfaces of the events are provided through the management node, so that the third party equipment can acquire the execution results of the events through the calling interfaces of the events, corresponding service functions are performed, and linkage capacity and expansion capacity are further improved.
Optionally, the initializing the task to be executed and verifying the task to be executed in the step S102 to obtain the first execution result may include:
optionally, the management node performs a task initialization event, initializes the task to be executed to obtain an initialization result, specifically, the management node initializes the task may include acquiring configuration information corresponding to the task to be executed according to the received task to be executed, and loading the configuration information into the task to be executed in a loading manner, where the configuration information may include resource loss and environmental requirements of the task to be executed, and detects the configuration information of the task to be executed, and may detect whether the configuration information of the task to be executed is complete, if the configuration information of the task to be executed is missing, the initialization fails, and the management node may perform a task error processing event; if the configuration information of the task to be executed is complete, the initialization is successful, and the management node executes a task initialization event.
Optionally, the management node may indicate that the task to be executed has been initialized successfully when executing the task initialization event, and may be ready to be placed in the task queue; if the execution of the task initialization event is normal, the management node continues to execute other task events; if the execution of the execution task initialization event is abnormal, the execution of the event task fails, and the management node executes the task error processing event.
Optionally, the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution to verify the task to be executed, so as to obtain a verification result.
Wherein, the event before starting execution may indicate that the task to be executed has been initialized successfully and has been put into the task queue; the start execution event may indicate that the task to be executed is queued, i.e., is to be sent to the target computing node for execution; the post-execution event may indicate that the task to be executed is ready to be placed in the target computing node.
Optionally, after the management node executes the event before the task starts to execute and executes the event normally, the management node executes the event after the task starts to execute, and continues to execute the event after the task starts to execute after the event normally, if the event after the task starts to execute executes normally, the task to be executed verifies that the event is normal, the management node sends the task to be executed to the target computing node, if any event among the event before the management node executes the task starts to execute, the event after the event starts to execute is abnormal, the task to be executed verifies that the event task to be executed fails, and the management node can execute the task error processing event.
Optionally, the management node obtains a first execution result according to the initialization result and the verification result, and if the initialization result and the verification result are both normal, the first execution result is normal, and if any one of the initialization result and the verification result is abnormal, the first execution result is abnormal.
Optionally, the step S103 of sending, by the management node, the task to be executed to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, may include:
optionally, the management node sends the task to be executed to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, and the management node executes an event in execution of the task, if the event in execution of the task is normal, the management node may acquire an execution state of the task to be executed, specifically, if the computing node does not return a signal of abnormal task execution or ending of task execution to the management node in execution of the task to be executed, the management node may always execute the event in execution of the task, may return a result that the task to be executed is always executed to the third party device through the event in execution of the task, and the third party device acquires the execution state of the task to be executed through a call interface corresponding to the event in execution of the task, so as to acquire that the task to be executed is in execution.
Optionally, if the event execution is abnormal during the execution of the task by the management node, the execution of the event task fails, the management node may execute the task error processing event, and the third party may perform a corresponding service operation according to the task error processing event.
Optionally, the event in task execution performed by the management node is configured to obtain an execution state of the task to be performed, including:
optionally, if the event is normal during execution of the task, the management node may acquire the execution state of the task to be executed in real time or acquire the execution state of the task to be executed at intervals of a preset duration, where the execution state of the task to be executed may include executing, stopping, failing, and error, if the execution state of the task to be executed is acquired and the execution state of the task to be executed is changed, the management node executes the task change event, if the task change event is normal, the management node may continue to acquire the execution state of the task to be executed, and the third party device acquires the task change information of the task to be executed through a call interface corresponding to the task change event; if the execution task change event is abnormal, the event task fails to execute, and the management node can execute the task error processing event.
Optionally, the step S103 of sending, by the management node, the task to be executed to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, may include:
optionally, the management node sends the task to be executed to the target computing node, so that the target computing node executes the task to be executed to obtain a second execution result, the management node receives a task stop instruction, then the management node sends the task stop instruction to the target computing node, so that the target computing node stops executing the task to be executed and obtains a second execution result indicating that the task to be executed is stopped, the management node executes a task stop event according to the result of stopping task execution, if the task stop event execution is abnormal, the task execution fails, the management node executes a task error processing event, and a third party can perform corresponding business operation according to the task error processing event.
Fig. 3 is a complete flow chart of task execution provided in this embodiment, and the implementation process of each step in the figure is explained in detail in the foregoing embodiments, and reference may be made to the foregoing embodiments, which are not repeated herein.
Alternatively, the task to be executed may refer to a single task or may refer to multiple tasks. When referring to a single task, the steps of the foregoing embodiments may be used to directly perform processing on the single task. When multitasking is referred to, the tasks to be performed include: a root node task and a plurality of task nodes. The corresponding initial event group further comprises: and searching for the root node task and executing the root node task. Step S102, the management node executing the initial event group, initializing the task to be executed and verifying the task to be executed, to obtain a first execution result, including:
Optionally, the management node executes the initial event group according to the dependency relationship of the task nodes, initializes each task node in the tasks to be executed, verifies the tasks to be executed, and obtains a first execution result.
The plurality of task nodes may indicate that the task to be executed includes a plurality of computing tasks, the plurality of computing tasks form the task to be executed, for example, a basic computing task, a non-judging task and a circulating task may form a task to be executed, the root node task may include a start node and an end node, the plurality of task nodes are attached to the root node, and each task node having a task logical relationship from the start node to the end node is a task node in the task to be executed.
The dependency relationship of each task node may refer to a logical connection relationship between each task node and an upper task node or a lower task node.
Optionally, the management node may perform an initialization operation on each task node in the task to be executed, and detect a dependency relationship between each task node according to a dependency relationship between each task node and other task nodes.
Fig. 4 is a flowchart of another task execution method provided in this embodiment, as shown in fig. 4, where the managing node performs an initial event group according to a dependency relationship of the plurality of task nodes to initialize each task node in the tasks to be executed and verify the tasks to be executed, and includes:
s201, the management node executes an initial event group, and initializes the task to be executed to obtain an initialization result.
Optionally, the initializing, by the management node, each task node in the task to be executed may include obtaining configuration information corresponding to each task node according to the received task to be executed, and loading the configuration information of each task node into each task node in a loading manner, where the configuration information may include resource consumption and environmental requirements of the task to be executed, detecting each task node after the loading is completed, specifically, detecting whether each task is legal and whether each task configuration is complete, and detecting dependency relationships between each task node, and detecting whether dependency relationships between each task are correct.
Optionally, if the management node detects that the configuration of each task node is complete and the dependency relationship between each task node is correct, the management node successfully initializes the task to be executed, and the management node executes a task initialization event.
S202, sequentially executing the event before starting execution, the event after starting execution and the event after starting execution to verify the task to be executed, thereby obtaining a verification result.
Optionally, after the management node executes the task initialization event, searching a root node task of the task to be executed, if the root node task is found, executing the task before starting execution event, if the task before starting execution event is normal, executing the task after starting execution event, if the task after starting execution event is normal, executing the root node task normally, continuing to execute the task after starting execution event, if the task after starting execution event is normal, verifying the task to be executed normally, and sending the task to be executed to the target computing node by the management node; if any of the execution events is abnormal, the execution of the event task fails, the management node executes the task error processing event, and a third party can perform corresponding business operation according to the task error processing event.
S203, the management node searches for the dependent task and executes the dependent task to obtain a dependent execution result.
Optionally, the management node may find whether a subordinate dependent task exists under the root node task, if so, send the existing subordinate dependent task to the target computing node, and the target computing node executes the dependent task; if the subordinate dependent task does not exist, the fact that each task node in the task to be executed is completed is indicated, the management node checks the execution result of the task to be executed, the execution result comprises the success of the task or the failure of the task, and if the task is successful, the management node executes a task success event; if the task fails, the management node executes a task failure event.
S204, the management node obtains a first execution result according to the initialization result, the verification result and the dependent execution result.
The initialization result and the verification result may include normal results and abnormal results of each execution event, the dependent execution result may include successful tasks or failed tasks, the management node may execute the corresponding result event according to the results of each event, and the third party may obtain the execution result of each event according to the call interface of the corresponding event, so as to perform the corresponding service extension function.
According to the embodiment, the corresponding event is executed through the management node, and the calling interface of each event is provided through the management node, so that the third party equipment can acquire the execution result of each event through the calling interface of each event, and accordingly corresponding service functions are performed, and linkage capacity and expansion capacity are improved.
Optionally, the management node may detect whether a stop signal is received, and if the stop signal is not received, the management node may always find whether there is an operation of the subordinate dependent task; if the stop signal is received, the stop signal is sent to a target computing node, the target computing node stops the task node which is being executed, and the stop signal is sent to the subordinate dependent task, and then the management node executes a task stop event to be executed; if the task to be executed stops the event from executing abnormally, the event task fails to execute, the management node executes the task error processing event, and a third party can perform corresponding business operation according to the task error processing event.
According to the embodiment, whether the subordinate dependent task exists or not is searched by the management node, if yes, the dependent task is executed by the calculation node, so that calculation confusion when the suddenly increased calculation task occurs can be avoided, the management node can enable the calculation node to execute the calculation task according to the dependent relation of the task, meanwhile, if the calculation task is abnormal, the calculation task can be stopped, and the suddenly increased calculation amount and the complexity when the calculation is abnormal can be met.
Optionally, if the management node does not receive a signal that the task execution is abnormal or the task execution is finished, the management node may always execute the task execution event, and when the computing node executes the subordinate dependent task, the result that the task to be executed is always executed may be returned to the third party device through the task execution event, and the third party device may acquire the execution state of the task to be executed through the call interface corresponding to the task execution event, so as to acquire that the task to be executed is in execution.
Optionally, if the event execution is abnormal during the execution of the task by the management node, the execution of the event task fails, the management node may execute the task error processing event, and the third party may perform a corresponding service operation according to the task error processing event.
Optionally, if the event is normal during execution of the task, the management node may acquire the execution state of the task to be executed in real time or acquire the execution state of the task to be executed at intervals of a preset duration, where the execution state of the task to be executed may include executing, stopping, failing, and error, if the execution state of the task to be executed is acquired and the execution state of the task to be executed is changed, the management node executes the task change event, if the task change event is normal, the management node may continue to acquire the execution state of the task to be executed, and the third party device acquires the task change information of the task to be executed through a call interface corresponding to the task change event; if the execution task change event is abnormal, the event task fails to execute, and the management node can execute the task error processing event.
Fig. 5 is a complete flowchart of another task execution provided in this embodiment, and the implementation process of each step in the figure is explained in detail in the foregoing embodiments, and reference may be made to the foregoing embodiments, which are not repeated herein.
Fig. 6 is a schematic device diagram of a task execution method according to an embodiment of the present application, where, as shown in fig. 6, the device includes:
the receiving module 301 is configured to receive a task to be executed by the management node.
The verification module 302 is configured to initialize the task to be executed by the management node executing an initial event group and verify the task to be executed to obtain a first execution result, so that a third party device obtains the first execution result through a call interface corresponding to each event in the initial event group, where the initial event group includes: an initialization event, a pre-execution start event, an execution start event, and a post-execution start event.
And the execution module 303 is configured to send, if the verification of the task to be executed passes, the management node to the computing node, so that the computing node executes the task to be executed to obtain a second execution result, and returns the second execution result to the management node, where the second execution result is used to indicate whether the task to be executed is executed successfully.
And the execution module 303 is configured to, if the second execution result indicates that the task to be executed is executed successfully, execute a task success event by the management node, and obtain a third execution result, so that a third party device obtains the third execution result through a call interface corresponding to the task success event.
The verification module 302 is specifically configured to:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
and the management node obtains the first execution result according to the initialization result and the verification result.
The execution module 303 is specifically configured to:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and the management node executes an event in task execution to acquire the execution state of the task to be executed so that a third party device acquires the execution state of the task to be executed through a calling interface corresponding to the event in task execution.
The execution module 303 is specifically configured to:
and the management node executes the event in task execution to acquire the execution state of the task to be executed, and if the execution state of the task to be executed is changed, the management node executes the task change event to enable third party equipment to acquire the task change information of the task to be executed through a calling interface corresponding to the task change event.
The execution module 303 is specifically configured to:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and if the management node receives a task stop instruction, the management node sends the task stop instruction to the computing node so that the computing node stops executing the task to be executed and obtains a second execution result indicating that the task to be executed is stopped.
The verification module 302 is specifically configured to:
and the management node executes an initial event group according to the dependency relationship of the task nodes, initializes each task node in the tasks to be executed, verifies the tasks to be executed and obtains the first execution result.
The verification module 302 is specifically configured to:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
the management node searches for a dependent task and checks a dependent execution result;
And the management node obtains the first execution result according to the initialization result, the verification result and the dependent execution result.
Fig. 7 is a block diagram of an electronic device 400 according to an embodiment of the present application. As shown in fig. 7, the electronic device may include: a processor 401, and a memory 402.
Optionally, a bus 403 may be further included, where the memory 402 is configured to store machine readable instructions executable by the processor 401 (e.g., execution instructions corresponding to the receiving module, the verifying module, the executing module in the apparatus in fig. 6, etc.), where when the electronic device 400 is running, communications between the processor 401 and the memory 402 are performed by the processor 401 through the bus 403, where the machine readable instructions are executed by the processor 401 to perform the method steps in the foregoing method embodiments.
The present application also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor performs the method steps in the task execution method embodiments described above.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the method embodiments, which are not described in detail in this application. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, and for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other form.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are covered in the protection scope of the present application.

Claims (9)

1. A task execution method, applied to a management node, where the management node provides a plurality of events and call interfaces corresponding to the events, the method comprising:
the management node receives a task to be executed;
the management node executes an initial event group to initialize the task to be executed and verifies the task to be executed to obtain a first execution result, so that a third party device obtains the first execution result through a calling interface corresponding to each event in the initial event group, wherein the initial event group comprises: initializing an event, a pre-execution event, a start-execution event and a post-execution event;
if the task to be executed passes verification, the management node sends the task to be executed to a computing node, so that the computing node executes the task to be executed to obtain a second execution result, the second execution result is returned to the management node, and the second execution result is used for indicating whether the task to be executed is executed successfully or not;
if the second execution result indicates that the task to be executed is successfully executed, the management node executes a task success event to obtain a third execution result, so that third party equipment obtains the third execution result through a calling interface corresponding to the task success event;
The management node executing the initial event group initializes the task to be executed and verifies the task to be executed to obtain a first execution result, including:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
and the management node obtains the first execution result according to the initialization result and the verification result.
2. The task execution method according to claim 1, wherein the management node sends the task to be executed to a computing node, so that the computing node executes the task to be executed to obtain a second execution result, including:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and the management node executes an event in task execution to acquire the execution state of the task to be executed so that a third party device acquires the execution state of the task to be executed through a calling interface corresponding to the event in task execution.
3. The task execution method according to claim 2, wherein the managing node executing an event in task execution to obtain an execution state of the task to be executed includes:
and the management node executes the event in task execution to acquire the execution state of the task to be executed, and if the execution state of the task to be executed is changed, the management node executes the task change event to enable third party equipment to acquire the task change information of the task to be executed through a calling interface corresponding to the task change event.
4. The task execution method according to claim 1, wherein the management node sends the task to be executed to a computing node, so that the computing node executes the task to be executed to obtain a second execution result, including:
the management node sends the task to be executed to a computing node so that the computing node executes the task to be executed to obtain a second execution result, and if the management node receives a task stop instruction, the management node sends the task stop instruction to the computing node so that the computing node stops executing the task to be executed and obtains a second execution result indicating that the task to be executed is stopped.
5. The task execution method according to claim 1, wherein the task to be executed includes: the initial event group further comprises: searching a root node task and executing the root node task;
the management node executing the initial event group initializes the task to be executed and verifies the task to be executed to obtain a first execution result, including:
and the management node executes an initial event group according to the dependency relationship of the task nodes, initializes each task node in the tasks to be executed, verifies the tasks to be executed and obtains the first execution result.
6. The task execution method according to claim 5, wherein the managing node performs initialization of each task node in the tasks to be executed and verifies the tasks to be executed according to the initial event group executed by the plurality of task nodes, including:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
The management node searches for a dependent task and checks a dependent execution result;
and the management node obtains the first execution result according to the initialization result, the verification result and the dependent execution result.
7. A task execution device, characterized by comprising:
the receiving module is used for receiving the task to be executed by the management node;
the verification module is configured to initialize the task to be executed by the management node executing an initial event group and verify the task to be executed to obtain a first execution result, so that a third party device obtains the first execution result through a call interface corresponding to each event in the initial event group, where the initial event group includes: initializing an event, a pre-execution event, a start-execution event and a post-execution event;
the execution module is used for sending the task to be executed to the computing node by the management node if the verification of the task to be executed is passed, so that the computing node executes the task to be executed to obtain a second execution result, and the second execution result is returned to the management node, wherein the second execution result is used for indicating whether the task to be executed is successfully executed or not;
The execution module is used for if the second execution result indicates that the task to be executed is executed successfully, the management node executes a task success event to obtain a third execution result, so that third party equipment obtains the third execution result through a calling interface corresponding to the task success event;
the verification module is specifically configured to:
the management node executes the initialization event to initialize the task to be executed to obtain an initialization result;
the management node sequentially executes the event before starting execution, the event after starting execution and the event after starting execution so as to verify the task to be executed and obtain a verification result;
and the management node obtains the first execution result according to the initialization result and the verification result.
8. An electronic device comprising a memory and a processor, the memory storing a computer program executable by the processor, the processor implementing the steps of the task execution method of any one of the preceding claims 1-6 when the computer program is executed.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when run by a processor, performs the steps of the task execution method according to any of claims 1-6.
CN202210409629.6A 2022-04-19 2022-04-19 Task execution method, device, electronic equipment and storage medium Active CN114691241B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210409629.6A CN114691241B (en) 2022-04-19 2022-04-19 Task execution method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210409629.6A CN114691241B (en) 2022-04-19 2022-04-19 Task execution method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114691241A CN114691241A (en) 2022-07-01
CN114691241B true CN114691241B (en) 2024-01-19

Family

ID=82142900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210409629.6A Active CN114691241B (en) 2022-04-19 2022-04-19 Task execution method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114691241B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820727A (en) * 2023-07-19 2023-09-29 杭州星云智慧科技有限公司 Task processing method and device, electronic equipment and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155770A (en) * 2015-03-30 2016-11-23 联想(北京)有限公司 Method for scheduling task and electronic equipment
CN106302425A (en) * 2016-08-09 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of virtualization system communication method between nodes and virtualization system thereof
US9684544B1 (en) * 2016-02-05 2017-06-20 Sas Institute Inc. Distributed data set storage and analysis reproducibility
CN109241712A (en) * 2018-09-29 2019-01-18 郑州云海信息技术有限公司 A kind of method and apparatus for accessing file system
CN110750341A (en) * 2018-07-24 2020-02-04 深圳市优必选科技有限公司 Task scheduling method, device, system, terminal equipment and storage medium
CN111158980A (en) * 2019-12-20 2020-05-15 深圳前海微众银行股份有限公司 Task execution method and device
CN111338784A (en) * 2020-05-25 2020-06-26 南栖仙策(南京)科技有限公司 Method and system for realizing integration of code warehouse and computing service
CN111897693A (en) * 2020-07-14 2020-11-06 浙江大华技术股份有限公司 Streaming processing method and device
CN112463312A (en) * 2020-11-02 2021-03-09 北京健康之家科技有限公司 Dynamic maintenance system and method for timing task, medium and computing equipment
CN112711468A (en) * 2020-12-21 2021-04-27 北京航空航天大学 Method and system for monitoring fog computing network resources and managing tasks based on block chain
CN113379577A (en) * 2020-02-25 2021-09-10 腾讯科技(深圳)有限公司 Transaction auditing method, device and equipment
CN113595968A (en) * 2020-04-30 2021-11-02 华为技术有限公司 Login method and system based on cloud application instance and related equipment
CN114338386A (en) * 2022-03-14 2022-04-12 北京天维信通科技有限公司 Network configuration method and device, electronic equipment and storage medium
CN114327766A (en) * 2021-12-28 2022-04-12 北京易华录信息技术股份有限公司 Kubernetes cluster deployment method, device, equipment and computer readable storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155770A (en) * 2015-03-30 2016-11-23 联想(北京)有限公司 Method for scheduling task and electronic equipment
US9684544B1 (en) * 2016-02-05 2017-06-20 Sas Institute Inc. Distributed data set storage and analysis reproducibility
CN106302425A (en) * 2016-08-09 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of virtualization system communication method between nodes and virtualization system thereof
CN110750341A (en) * 2018-07-24 2020-02-04 深圳市优必选科技有限公司 Task scheduling method, device, system, terminal equipment and storage medium
CN109241712A (en) * 2018-09-29 2019-01-18 郑州云海信息技术有限公司 A kind of method and apparatus for accessing file system
CN111158980A (en) * 2019-12-20 2020-05-15 深圳前海微众银行股份有限公司 Task execution method and device
CN113379577A (en) * 2020-02-25 2021-09-10 腾讯科技(深圳)有限公司 Transaction auditing method, device and equipment
CN113595968A (en) * 2020-04-30 2021-11-02 华为技术有限公司 Login method and system based on cloud application instance and related equipment
CN111338784A (en) * 2020-05-25 2020-06-26 南栖仙策(南京)科技有限公司 Method and system for realizing integration of code warehouse and computing service
CN111897693A (en) * 2020-07-14 2020-11-06 浙江大华技术股份有限公司 Streaming processing method and device
CN112463312A (en) * 2020-11-02 2021-03-09 北京健康之家科技有限公司 Dynamic maintenance system and method for timing task, medium and computing equipment
CN112711468A (en) * 2020-12-21 2021-04-27 北京航空航天大学 Method and system for monitoring fog computing network resources and managing tasks based on block chain
CN114327766A (en) * 2021-12-28 2022-04-12 北京易华录信息技术股份有限公司 Kubernetes cluster deployment method, device, equipment and computer readable storage medium
CN114338386A (en) * 2022-03-14 2022-04-12 北京天维信通科技有限公司 Network configuration method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于Hadoop架构的电力***连锁故障分布式计算技术;刘友波;刘洋;刘俊勇;李勇;刘挺坚;刁塑;;电力***自动化(第07期);96-103 *
基于NPID的WSN节点拥塞控制方法研究;柳莹;《中国优秀硕士学位论文全文数据库信息科技辑》(第1期);I136-1136 *

Also Published As

Publication number Publication date
CN114691241A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
CN109951547B (en) Transaction request parallel processing method, device, equipment and medium
CN102087615B (en) Messages merger method and system in message queue
CN112035238B (en) Task scheduling processing method and device, cluster system and readable storage medium
CN114691241B (en) Task execution method, device, electronic equipment and storage medium
CN112783568A (en) Initialization method, device, equipment and storage medium of application program
CN106874020B (en) Method and device for starting plug-in
CN113641544A (en) Method, apparatus, device, medium and product for detecting application status
CN112835639A (en) Hook implementation method, device, equipment, medium and product
CN114327673B (en) Task starting method and device, electronic equipment and storage medium
CN116302652A (en) System alarm information processing method and device and electronic equipment
CN115454599A (en) Task processing method, system, device, storage medium and electronic equipment
CN115599610A (en) Process daemon method and electronic equipment
CN113065967A (en) Multi-mode service processing method, device and equipment
CN108667636A (en) Configuration information recovery method, apparatus, memory and computer equipment
CN111324472B (en) Method and device for judging garbage items of information to be detected
US10417041B2 (en) Moving a software application in a system cluster
Singh et al. Survey on Fault Tolerant Techniques in Scientific Applications
CN112925693B (en) System monitoring method, device, computer equipment and storage medium
CN114841298B (en) Method and device for training algorithm model, electronic equipment and storage medium
CN113704016B (en) Cloud function component diagnosis method, device, equipment and storage medium
CN116756048B (en) Code analysis method, device, computer equipment and storage medium
CN113051578A (en) Data synchronization method and electronic equipment
CN117112037A (en) Cloud platform starting method and device, electronic equipment and storage medium
CN117407460A (en) Cross-environment data synchronization method and device, storage medium and electronic equipment
CN113900672A (en) Operation control method and device of server cluster, server 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