CN112799797B - Task management method and device - Google Patents

Task management method and device Download PDF

Info

Publication number
CN112799797B
CN112799797B CN201911115455.7A CN201911115455A CN112799797B CN 112799797 B CN112799797 B CN 112799797B CN 201911115455 A CN201911115455 A CN 201911115455A CN 112799797 B CN112799797 B CN 112799797B
Authority
CN
China
Prior art keywords
node
task
nodes
dag
dag workflow
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
CN201911115455.7A
Other languages
Chinese (zh)
Other versions
CN112799797A (en
Inventor
岳宝
范翔
徐文胜
王浩
刘洋
邓丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Wodong Tianjun Information Technology Co Ltd
Priority to CN201911115455.7A priority Critical patent/CN112799797B/en
Publication of CN112799797A publication Critical patent/CN112799797A/en
Application granted granted Critical
Publication of CN112799797B publication Critical patent/CN112799797B/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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow

Landscapes

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

Abstract

The invention discloses a method and a device for task management, and relates to the technical field of computers. One embodiment of the method comprises the following steps: receiving a task execution request and analyzing the task type of the task; determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation; the tasks are performed based on the DAG workflow. The embodiment can decouple the service framework from the service scene, reduce the complexity of codes and improve the universality of the service framework.

Description

Task management method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for task management.
Background
Business processes typically have a pair of phases, each phase often involving multiple business processing modules in the business system, most of which contain scenarios for synchronous or asynchronous invocation of external services. If the business framework is designed according to the programming thought facing the process, the code logic can sink into a long asynchronous callback trap, which makes the code very difficult to understand and modify. Therefore, in the practical application process, a corresponding service framework is generally designed for a specific scene.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
the service framework is coupled with the service scene too tightly, the code complexity is high, and the service framework cannot be suitable for other service scenes and has poor universality.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for task management, which can decouple a service framework from a service scenario, reduce code complexity, and improve versatility of the service framework.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a method for task management, including:
receiving a task execution request and analyzing the task type of the task;
determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation;
the tasks are performed based on the DAG workflow.
Optionally, after determining the DAG workflow corresponding to the task type, further includes: and carrying out validity check on the DAG workflow and confirming that the check passes.
Optionally, at least one of the nodes in the DAG workflow is marked as a start node and at least another one is marked as a final node;
processing the task to be processed based on the directed acyclic graph, including: judging whether any node before the final node including the starting node is successfully executed or not, and if so, jumping to the next node of any node; otherwise, jumping to the final node.
Optionally, at least one of the nodes in the directed acyclic graph is located after the final node.
Optionally, each node includes at least one of: serial nodes, parallel nodes, slice nodes, conditional nodes.
According to a second aspect of an embodiment of the present invention, there is provided an apparatus for task management, including:
the analysis unit is used for receiving a task execution request and analyzing the task type of the task;
the distribution unit is used for determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation;
and the execution unit is used for executing the task based on the DAG workflow.
Optionally, the distribution unit is further configured to: after determining the DAG workflow corresponding to the task type, carrying out validity check on the DAG workflow and confirming that the check passes.
Optionally, at least one of the nodes in the DAG workflow is marked as a start node and at least another one is marked as a final node;
the execution unit processes the task to be processed based on the directed acyclic graph, including: judging whether any node before the final node including the starting node is successfully executed or not, and if so, jumping to the next node of any node; otherwise, jumping to the final node.
According to a third aspect of an embodiment of the present invention, there is provided an electronic device for task management, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements the method provided by the first aspect of embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: by adopting the technical means of determining the DAG workflow corresponding to the task type and executing the task based on the DAG workflow according to the task type and the preset matching relation, the service framework can be completely isolated from the service scene, the service party only needs to create the DAG workflow, the scheduling problem among all nodes in the DAG workflow does not need to be concerned, the code complexity is reduced, and the universality of the service framework is improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a method of task management according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a DAG workflow in an alternative embodiment of the present invention;
FIG. 3 is a schematic diagram of an online advertising system;
FIG. 4 is a schematic diagram of a business framework of an online advertising system employing the method of the present invention;
FIG. 5 is a schematic diagram of a business process of an online advertising system employing the method of the present invention;
FIG. 6 is a schematic diagram of the major modules of an apparatus for task management according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 8 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
According to one aspect of an embodiment of the present invention, a method of task management is provided.
Fig. 1 is a schematic diagram of main flow of a task management method according to an embodiment of the present invention, and as shown in fig. 1, the task management method includes: step S101, step S102, and step S103.
Step S101, receiving a task execution request and analyzing the task type of the task.
The nodes required to be called for executing the tasks with different task types are not necessarily the same, the tasks with the same task types and the nodes required to be called for executing the process are the same. In this example, the tasks are divided into different task types in advance according to the node conditions to be called when the tasks are executed.
The step is used for judging which DAG workflow needs to be executed in the current task, for example, advertisements are of two types, namely, searching and recommending, the DAG workflow of searching advertisements is executed when the user needs to search advertisements when the user searches for goods, and the DAG workflow of recommending advertisements is executed when the user needs to search for recommended advertisements when the user browses goods.
Step S102, according to the task type and a preset matching relation, determining the DAG workflow corresponding to the task type.
The DAG workflow (directed acycline praph), directed acyclic graph, contains the nodes that need to be invoked to perform the corresponding task and the topological relationships between the nodes. The DAG workflow is used to describe the individual operations that different tasks need to perform, and the nodes in the DAG workflow are used to describe the different stages of the operational process. The node is an operation with high cohesion, and has the characteristics of reusability, service modularization, testability and the like. The preset matching relationship refers to a corresponding relationship between the task type and the corresponding DAG workflow. A task may be split into several subtasks, each subtask being performed by a node.
Optionally, at least one of the nodes in the DAG workflow is marked as a start node and at least another is marked as a final node. Processing the task to be processed based on the directed acyclic graph, including: judging whether any node before the final node including the starting node is successfully executed or not, and if so, jumping to the next node of any node; otherwise, jumping to the final node.
The start node refers to a node without a pre-dependency among the nodes for executing the task, and the number of the start nodes may be one or a plurality of, for example, a plurality of nodes serving as the start nodes are executed in parallel or executed in a slice. If one node fails to execute, if the node with the output of the node as the input continues to execute, the node still fails to execute, so as to improve task execution efficiency, the plurality of nodes with the dependency relationship with the node can be skipped. The final node refers to the node which needs to jump to when the node fails to execute, and the final node is marked, so that the task execution efficiency can be improved. Other nodes (hereinafter referred to as intermediate nodes) may be omitted from the start node and the end node, or intermediate nodes may be omitted.
Optionally, at least one of the nodes in the directed acyclic graph is located after the final node. Nodes after the final node are executed, and no judgment is made as to whether the execution is successful. By placing the node that needs to continue execution at the final node, for some abnormal nodes (i.e., nodes that fail execution), the execution may jump directly to the final node to continue execution of subsequent flows.
In this example, each node includes at least one of: serial nodes, parallel nodes, slice nodes, conditional nodes. Serial nodes refer to nodes that execute in sequence with other nodes in the DAG workflow. Parallel nodes (subnodes) refer to nodes that execute in parallel with some or all of the nodes in the DAG workflow. The partition node (PartitionNode) refers to a node which performs the same task in parallel with some or all nodes in the DAG workflow and performs the same task but accesses downstream and is different from the partition, multiple nodes which perform the same task in parallel, or multiple partition nodes which perform the same task in parallel, and a Merge (Merge) node is generally required to be set downstream to Merge the execution results of the nodes. The conditional node (conditional node) refers to a node that needs to determine the execution result of the current node, and determines which node downstream is executed according to the result.
FIG. 2 is a schematic diagram of a DAG workflow in an alternative embodiment of the present invention, in the alternative embodiment shown in FIG. 2, the various nodes in the DAG workflow include: serial Node (Node), parallel Node (SubNode), sliced Node (PartitionNode), conditional Node (ConditionNode). In fig. 2, a Node following a plurality of parallel nodes (subnodes) may be regarded as a Node for merging execution results of the plurality of parallel nodes (subnodes), and a Node following a plurality of fragmented nodes (partitionnodes) may be regarded as a Node for merging execution results of the plurality of fragmented nodes (partitionnodes). The Response node in fig. 2 can be regarded as the final node.
The nodes such as serial nodes, parallel nodes, slicing nodes, conditional nodes and the like are adopted, so that various DAG workflows can be expressed based on several general logics such as serial, parallel, slicing, conditional and the like, and the universality of the task management method is improved.
Optionally, after determining the DAG workflow corresponding to the task type, further includes: and carrying out validity check on the DAG workflow and confirming that the check passes. The validity check includes: it is checked whether the DAG workflow is loop-free, and whether the creation of the individual nodes of the DAG workflow is successful. If no ring exists and the node is successfully created, the verification is passed, otherwise, the verification is not passed.
Step S103, executing the task based on the DAG workflow.
The invention adopts the technical means of determining the DAG workflow corresponding to the task type according to the task type and the preset matching relation and executing the task based on the DAG workflow, can completely isolate the service framework from the service scene, and the service side only needs to create the DAG workflow without paying attention to the scheduling problem among all nodes in the DAG workflow, thereby reducing the complexity of codes and improving the universality of the service framework.
Taking an internet online advertisement system as an example, internet online advertisement is a complex system with very long service flow, and comprises a plurality of stages of information extraction, filtering, advertisement sequencing and the like, wherein each stage comprises a plurality of service processing modules, and most of the modules contain scenes for synchronously or asynchronously calling external services. FIG. 3 is a schematic diagram of an online advertising system. Such as an advertisement search engine and a Retrieval engine in the figure, and the like, the common characteristics of the systems are that the service flow is longer and the modules are more. Taking an example of an Adserver, the general steps include accessing user information, accessing merchandise information, accessing a model system, accessing a retrieval system, ranking a score, and the like. If codes are accumulated step by step according to the programming thought facing the process, various service modules are added, and the operation is performed according to the function calling process in sequence, so that the code expansion is very fast, and the module division is not easy to perform. Based on the task type and the preset matching relation, the DAG workflow corresponding to the task type is determined, and the task is executed based on the DAG workflow.
Fig. 4 is a business framework diagram of a method of task management according to an embodiment of the present invention. In fig. 4, the traffic distributor is used for distributing traffic, and the main functions are registration of DAG workflow and analysis of traffic types. The preset matching relationship may be registered in the traffic distributor. When in use, the registration method is only required to be called, the flow type analysis function is inherited and analyzed, and the flow type analysis is carried out according to the self service, and a plurality of DAG workflows are specifically required to be flexibly controlled by the service party, so that the system has expandability. And presetting DAG workflows of various task types in the execution framework. The OP a, OP B1, OP C of the basic Operator portion represent each node, each node performs one service operation (Operator), and the node is one operation with high cohesion, and has the characteristics of reusability, service modularization, testability, and the like.
After the online advertising system is managed by adopting the task management method of the invention, the operation process of the online advertising system is as follows:
1. after a gateway (gateway) sends a request to an advertisement, firstly, a traffic distributor judges traffic types, and then creates corresponding DAG workflows according to the traffic types (in the figure, excumulationgraph 1, excumulationgraph 2 and Excumulationgraph 3 respectively represent one DAG workflow);
2. initializing the DAG workflow according to the dependency relation of the execution nodes, and when the DAG workflow has a ring or the node uses the resource to initialize failure, exiting the process and outputting response error information. The purpose of this is to discover problems in the creation of DAG workflows as early as possible;
3. when the DAG workflow is initialized successfully, the DAG workflow is started to run from the starting node. In the running process, when a certain node fails to execute, the operation is skipped to a final node, and the operations such as log reporting, resource recovery and the like are performed.
4. When the system provides asynchronous service, a callback function needs to be executed, and a calling party is informed of the end of the service request. To this end, a complete DAG workflow is run.
In this example, a Context type request_context object and a frame_context object are created for each request during initialization, and are used for storing data information during task execution. The Context class is a data storage object defined by a service framework, the request_context is service Context data, and the frame_context is an interactive carrier between the service and the framework.
During initialization, an Operator needs to realize an initialization method and a DoWork method (a function) for inheritance and realization of a service party, and a framework executes the Work method for controlling functions of executing flow, counting time consumption, reporting failure alarms and the like. The service class inherits the CommonOpera (normal operation procedure, i.e. serially executed operation), implements the Init/Dowork function, and REGISTERs with register_COMMON_OPERATOR_GENERATOR (normal operation procedure registrar). The slicing operation Operator inherits the PartitionOperator (slicing operation procedure, i.e., an operation performed by a plurality of slices in parallel), implements the Init/DoWork function, and performs registration with register_parameter_operation_geneator (REGISTER of the slicing operation procedure). The DAG workflow is initialized to create a business Operator object according to the Operator name through a reflection mechanism so as to store the execution data of the node.
FIG. 5 is a schematic diagram of a business flow of an online advertising system employing the method of the present invention. As shown in fig. 5, the flow of the Adserver system includes:
the ParseRequestOpera node parses the request;
the ValidateReqParamOper node performs parameter validity verification;
the FetchUserInfoOpera node obtains user information;
the FetchQueryCateAndTransop node obtains the classification and branding of the request;
the FetchNaturalSkuoperator node obtains a natural result;
the FetchTriggerInfoOper node acquires trigger information;
the FillRecrequalReqoperator node fills the retrieval request according to the trigger information;
the Access retriever node requests the retrieval service according to the retrieval request;
coarse ordering is carried out on the retrieval results by the RoughSortOperator node;
the FetchSkuInfoOper node obtains the sku (Stock Keeping Unit, stock unit) information after coarse ordering;
filtering the sku by the filterAdSkuOPer node according to a preset rule;
the FineSortOperator node performs fine ordering on the filtered retrieval results;
packing results by JsonPackeroperator nodes;
the WriteBusinessLogoperator node writes a log;
the FinalOperator node operates finally.
Among them, parseRequestOperator, validateReqParamOperator, fetchUserInfoOperator, fillRetrievalReqOperator, roughSortOperator and the subsequent nodes are serial nodes, and are executed sequentially with the nodes before and after each. FetchQueryCateAndBrandOperator, fetchNaturalSkuOperator, fetchTriggerInfoOperator are parallel nodes and execute in parallel. The accessraietrievaloperator is a sharded node. The final node in the execution flow is a FinalOperator. The division principle of the operators is module cohesiveness, high reusability, definite retrieval stage and the like.
The invention splits the workflow with larger difference, different task types correspond to different DAG workflows, the workflows are clearly expressed according to the DAG mode, and nodes in the workflows can express several general logics such as serial and parallel slicing conditions. The invention can completely isolate the business framework from the business scene, and the business side only needs to create the DAG, does not need to pay attention to the scheduling problem, and has good universality.
According to a second aspect of an embodiment of the present invention, there is provided an apparatus for implementing the above method.
Fig. 6 is a schematic diagram of main modules of an apparatus for task management according to an embodiment of the present invention. As shown in fig. 6, the task management apparatus 600 includes:
the analysis unit 601 receives the task execution request and analyzes the task type of the task;
the distribution unit 602 determines a DAG workflow corresponding to the task type according to the task type and a preset matching relationship;
an execution unit 603 executes the task based on the DAG workflow.
Optionally, the distribution unit is further configured to: after determining the DAG workflow corresponding to the task type, carrying out validity check on the DAG workflow and confirming that the check passes.
Optionally, at least one of the nodes in the DAG workflow is marked as a start node and at least another one is marked as a final node;
the execution unit processes the task to be processed based on the directed acyclic graph, including: judging whether any node before the final node including the starting node is successfully executed or not, and if so, jumping to the next node of any node; otherwise, jumping to the final node.
Optionally, at least one of the nodes in the directed acyclic graph is located after the final node.
Optionally, each node includes at least one of: serial nodes, parallel nodes, slice nodes, conditional nodes.
The task management device adopts the technical means of determining the DAG workflow corresponding to the task type according to the task type and the preset matching relation and executing the task based on the DAG workflow, can completely isolate the service framework from the service scene, and the service side only needs to create the DAG workflow without paying attention to the scheduling problem among all nodes in the DAG workflow, thereby reducing the complexity of codes and improving the universality of the service framework.
According to a third aspect of an embodiment of the present invention, there is provided an electronic device for task management, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements the method provided by the first aspect of embodiments of the present invention.
Fig. 7 illustrates an exemplary system architecture 700 of a task management method or task management device to which embodiments of the present invention may be applied.
As shown in fig. 7, a system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 705 via the network 704 using the terminal devices 701, 702, 703 to receive or send messages or the like. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 701, 702, 703. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the method for task management provided in the embodiment of the present invention is generally executed by the server 705, and accordingly, the device for task management is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, there is illustrated a schematic diagram of a computer system 800 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU) 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 801.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor comprising: the analysis unit is used for receiving a task execution request and analyzing the task type of the task; the distribution unit is used for determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation; and the execution unit is used for executing the task based on the DAG workflow. Wherein the names of these units do not constitute a limitation of the unit itself in some cases, e.g. a distribution unit may also be described as "a unit performing the task based on the DAG workflow".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: receiving a task execution request and analyzing the task type of the task; determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation; the tasks are performed based on the DAG workflow.
According to the technical scheme of the embodiment of the invention, the DAG workflow corresponding to the task type is determined according to the task type and the preset matching relation, and the task is executed based on the DAG workflow, so that the service framework can be completely isolated from the service scene, the service side only needs to create the DAG workflow, the scheduling problem among all nodes in the DAG workflow does not need to be concerned, the code complexity is reduced, and the universality of the service framework is improved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (7)

1. A method of task management, comprising:
receiving a task execution request and analyzing the task type of the task;
determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation;
performing the task based on the DAG workflow;
at least one of the nodes in the DAG workflow is marked as a start node, and at least one other node is marked as a final node; processing the task based on the directed acyclic graph, comprising: judging whether any node before the final node including the starting node is successfully executed or not, and if so, jumping to the next node of any node; otherwise, jumping to the final node;
at least one of the nodes in the DAG workflow is located after the final node; the nodes after the final node are all executed without judging whether the execution is successful.
2. The method of claim 1, wherein after determining the DAG workflow corresponding to the task type, further comprising: and carrying out validity check on the DAG workflow and confirming that the check passes.
3. The method of any of claims 1-2, wherein each node comprises at least one of: serial nodes, parallel nodes, slice nodes, conditional nodes.
4. An apparatus for task management, comprising:
the analysis unit is used for receiving a task execution request and analyzing the task type of the task;
the distribution unit is used for determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation;
an execution unit that executes the task based on the DAG workflow;
at least one of the nodes in the DAG workflow is marked as a start node, and at least one other node is marked as a final node; the execution unit processes the task based on the directed acyclic graph, including: judging whether any node before the final node including the starting node is successfully executed or not, and if so, jumping to the next node of any node; otherwise, jumping to the final node;
at least one of the nodes in the DAG workflow is located after the final node; the nodes after the final node are all executed without judging whether the execution is successful.
5. The apparatus of claim 4, wherein the distribution unit is further to: after determining the DAG workflow corresponding to the task type, carrying out validity check on the DAG workflow and confirming that the check passes.
6. An electronic device for task management, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-3.
7. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-3.
CN201911115455.7A 2019-11-14 2019-11-14 Task management method and device Active CN112799797B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911115455.7A CN112799797B (en) 2019-11-14 2019-11-14 Task management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911115455.7A CN112799797B (en) 2019-11-14 2019-11-14 Task management method and device

Publications (2)

Publication Number Publication Date
CN112799797A CN112799797A (en) 2021-05-14
CN112799797B true CN112799797B (en) 2024-04-16

Family

ID=75803955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911115455.7A Active CN112799797B (en) 2019-11-14 2019-11-14 Task management method and device

Country Status (1)

Country Link
CN (1) CN112799797B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805976B (en) * 2021-09-16 2024-09-13 上海商汤科技开发有限公司 Data processing method and device, electronic equipment and computer readable storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2042986A1 (en) * 2007-09-21 2009-04-01 Nokia Siemens Networks Oy Method and system for execution of a service-related process
CN103593236A (en) * 2013-11-14 2014-02-19 华为技术有限公司 Computer equipment, method and device for scheduling service process
KR20140102478A (en) * 2013-02-14 2014-08-22 한국전자통신연구원 Workflow job scheduling apparatus and method
CN106980530A (en) * 2016-01-18 2017-07-25 中兴通讯股份有限公司 A kind of distributed system workflow processing method and workflow engine system
CN107179940A (en) * 2016-03-10 2017-09-19 阿里巴巴集团控股有限公司 A kind of method and device of tasks carrying
CN109491777A (en) * 2018-11-12 2019-03-19 北京字节跳动网络技术有限公司 Task executing method, device, equipment and storage medium
CN109597882A (en) * 2018-12-19 2019-04-09 网易(杭州)网络有限公司 A kind of scene session service treating method and apparatus
CN109725989A (en) * 2017-10-31 2019-05-07 阿里巴巴集团控股有限公司 A kind of method and device of task execution
CN109814986A (en) * 2017-11-20 2019-05-28 上海寒武纪信息科技有限公司 Task method for parallel processing, storage medium, computer equipment, device and system
CN110297632A (en) * 2019-06-12 2019-10-01 百度在线网络技术(北京)有限公司 Code generating method and device
CN110362315A (en) * 2019-07-17 2019-10-22 中国工商银行股份有限公司 Software systems dispatching method and device based on DAG

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8510751B2 (en) * 2010-03-18 2013-08-13 International Business Machines Corporation Optimizing workflow engines

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2042986A1 (en) * 2007-09-21 2009-04-01 Nokia Siemens Networks Oy Method and system for execution of a service-related process
KR20140102478A (en) * 2013-02-14 2014-08-22 한국전자통신연구원 Workflow job scheduling apparatus and method
CN103593236A (en) * 2013-11-14 2014-02-19 华为技术有限公司 Computer equipment, method and device for scheduling service process
CN106980530A (en) * 2016-01-18 2017-07-25 中兴通讯股份有限公司 A kind of distributed system workflow processing method and workflow engine system
WO2017125015A1 (en) * 2016-01-18 2017-07-27 中兴通讯股份有限公司 Method for processing workflow of distributed system and workflow engine system
CN107179940A (en) * 2016-03-10 2017-09-19 阿里巴巴集团控股有限公司 A kind of method and device of tasks carrying
CN109725989A (en) * 2017-10-31 2019-05-07 阿里巴巴集团控股有限公司 A kind of method and device of task execution
CN109814986A (en) * 2017-11-20 2019-05-28 上海寒武纪信息科技有限公司 Task method for parallel processing, storage medium, computer equipment, device and system
CN109491777A (en) * 2018-11-12 2019-03-19 北京字节跳动网络技术有限公司 Task executing method, device, equipment and storage medium
CN109597882A (en) * 2018-12-19 2019-04-09 网易(杭州)网络有限公司 A kind of scene session service treating method and apparatus
CN110297632A (en) * 2019-06-12 2019-10-01 百度在线网络技术(北京)有限公司 Code generating method and device
CN110362315A (en) * 2019-07-17 2019-10-22 中国工商银行股份有限公司 Software systems dispatching method and device based on DAG

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
工作流管理平台的设计及其在自助服务中的应用;唐华云 等;计算机系统应用;20160731;第25卷(第7期);全文 *

Also Published As

Publication number Publication date
CN112799797A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN110310034B (en) Service arrangement and business flow processing method and device applied to SaaS
US10735345B2 (en) Orchestrating computing resources between different computing environments
US9569288B2 (en) Application pattern discovery
CN111737270B (en) Data processing method and system, computer system and computer readable medium
US9910821B2 (en) Data processing method, distributed processing system, and program
CN113760488B (en) Method, apparatus, device and computer readable medium for scheduling tasks
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN110781180B (en) Data screening method and data screening device
CN111913738A (en) Access request processing method, device, computing equipment and medium
CN111428131A (en) Information pushing method, device and system
CN110795331A (en) Software testing method and device
CN112817562B (en) Service processing method and device
US20150142786A1 (en) Modification of cloud application service levels based upon document consumption
US20210035125A1 (en) Predictive AI Automated Cloud Service Turn-Up
CN112947919A (en) Method and device for constructing service model and processing service request
CN112799797B (en) Task management method and device
CN112825525B (en) Method and apparatus for processing transactions
CN116954754A (en) Business process arranging method, device, equipment and readable storage medium
US10613877B2 (en) Container hyperlinking
CN113010149A (en) Application loading method and device, user terminal and server
CN116521317A (en) Mirror image management method and device, electronic equipment and computer readable storage medium
CN111597200A (en) Data processing method, device and storage medium
CN115526587A (en) Method and device for generating customs message
CN113918525A (en) Data exchange scheduling method, system, electronic device, medium, and program product
CN113095060A (en) Method, device, equipment and computer readable medium for processing data

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