CN112799797A - Task management method and device - Google Patents

Task management method and device Download PDF

Info

Publication number
CN112799797A
CN112799797A CN201911115455.7A CN201911115455A CN112799797A CN 112799797 A CN112799797 A CN 112799797A CN 201911115455 A CN201911115455 A CN 201911115455A CN 112799797 A CN112799797 A CN 112799797A
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.)
Granted
Application number
CN201911115455.7A
Other languages
Chinese (zh)
Other versions
CN112799797B (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

Images

Classifications

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

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: 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. The implementation method can decouple the service framework from the service scene, reduce the code complexity and improve the universality of the service framework.

Description

Task management method and device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for task management.
Background
The business process generally has a pair of stages, each stage often involves a plurality of business processing modules in the business system, and most of the modules contain scenes for synchronously or asynchronously calling external services. If the business framework is designed according to the process-oriented programming idea, the code logic can be trapped in a long asynchronous callback trap, so that the code is very difficult to understand and modify. Therefore, in the actual application process, a corresponding service framework is generally designed for a specific scene.
In the process of implementing the 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, the method cannot be applied to other service scenes, and the universality is poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for task management, which can decouple a service framework from a service scene, reduce code complexity, and improve the universality of the service framework.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a task management method 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;
performing the task based on the DAG workflow.
Optionally, after determining the DAG workflow corresponding to the task type, the method further includes: and carrying out validity check on the DAG workflow and confirming that the check is passed.
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: for any node before the final node including the starting node, judging whether the execution of the any node is successful, and if the execution of the any node is successful, jumping to the next node of the 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, the respective nodes include at least one of: serial nodes, parallel nodes, fragment nodes and conditional nodes.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for task management, including:
the analysis unit is used for receiving the 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 to execute the task based on the DAG workflow.
Optionally, the distribution unit is further configured to: and after the DAG workflow corresponding to the task type is determined, carrying out validity check on the DAG workflow and confirming that the check is passed.
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 executing unit processes the task to be processed based on the directed acyclic graph, and the processing method comprises the following steps: for any node before the final node including the starting node, judging whether the execution of the any node is successful, and if the execution of the any node is successful, jumping to the next node of the any node; otherwise, jumping to the final node.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device for task management, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused 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, on which a computer program is stored, 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 according to the task type and the preset matching relationship and executing the task based on the DAG workflow, the service framework can be completely isolated from the service scene, the service party only needs to create the DAG workflow and does not need to pay attention to the scheduling problem among all nodes in the DAG workflow, the code complexity is reduced, and the universality of the service framework is improved.
Further effects of the above-mentioned non-conventional alternatives will be 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 illustration of a main flow of a method of task management according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a DAG workflow in an alternative embodiment of the 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 to which the method of the present invention is applied;
FIG. 5 is a schematic business flow diagram of an online advertising system to which the method of the present invention is applied;
FIG. 6 is a schematic diagram of the main modules of a device 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 employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as 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 a 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.
And 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 of different task types are not necessarily the same, the nodes required to be called for executing the tasks of the same task type are the same. In this example, the tasks are divided into different task types according to the condition of the nodes to be called when the tasks are executed.
The method is used for judging which DAG workflow needs to be executed by the current task, for example, the advertisement has two types of searching and recommending, when a user needs to take out the search advertisement when searching the commodity, the DAG workflow for searching the advertisement is executed, and when the user needs to take out the recommended advertisement when browsing the commodity, the DAG workflow for recommending the advertisement is executed.
And S102, determining a DAG workflow corresponding to the task type according to the task type and a preset matching relation.
The DAG workflow (directed acyclic graph) includes nodes that need to be called to execute corresponding tasks and a topological relationship between the nodes. The DAG workflow is used for describing each operation which needs to be executed by different tasks, and nodes in the DAG workflow are used for describing different stage operation processes. The node is a high-cohesion operation 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 of which is executed by a node.
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: for any node before the final node including the starting node, judging whether the execution of the any node is successful, and if the execution of the any node is successful, jumping to the next node of the any node; otherwise, jumping to the final node.
The start node is a node without pre-dependency among nodes for executing a task, and the number of the start nodes may be one or multiple, for example, multiple nodes as start nodes are executed in parallel or in a fragmented manner. When one of the nodes fails to execute, if the node with the output of the node as the input is continuously executed, the execution still fails, and in order to improve the task execution efficiency, the nodes with the dependency relationship with the node can be skipped. The final node is a node to which a jump is needed when the execution of the node fails, and the final node is marked, so that the task execution efficiency can be improved. Other nodes (hereinafter referred to as intermediate nodes) may not be included between the start node and the final node, or intermediate nodes may not be included.
Optionally, at least one of the nodes in the directed acyclic graph is located after the final node. And executing the nodes behind the final node without judging whether the execution is successful. By placing the nodes needing to be executed continuously after the final node, for some abnormal nodes (namely the nodes with failed execution), the execution can directly jump to the final node after the execution is finished, and the subsequent processes are executed continuously.
In this example, each node includes at least one of: serial nodes, parallel nodes, fragment nodes and conditional nodes. A serial node refers to a node that executes 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. A fragmentation node (PartitionNode) refers to a node that has the same task as, and executes in parallel with, but accesses a different downstream fragment from, a part or all of nodes in a DAG workflow, a plurality of nodes that execute in parallel, or a plurality of fragmentation nodes that execute the same task and execute in parallel, and a downstream node generally needs to be provided with a Merge (Merge) node to Merge execution results of the nodes. The conditional node (conditioning node) is a node that needs to determine the execution result of the current node and determine which node is downstream to be executed according to the result.
Fig. 2 is a schematic diagram of a DAG workflow in an alternative embodiment of the present invention, where in the alternative embodiment shown in fig. 2, each node in the DAG workflow includes: serial Node (Node), parallel Node (SubNode), sharded Node (PartitionNode), and conditional Node (ConditionNode). In fig. 2, a Node behind a plurality of parallel nodes (subnodes) may be regarded as a Node that merges execution results of the plurality of parallel nodes (subnodes), and a Node behind a plurality of sharded nodes (partitionnodes) may be regarded as a Node that merges execution results of the plurality of sharded nodes (partitionnodes). The Response node in fig. 2 can be considered as the final node.
By adopting the nodes such as serial nodes, parallel nodes, fragmentation nodes, condition nodes and the like, various DAG workflows can be expressed based on several types of general logics such as serial, parallel, fragmentation, condition and the like, and the universality of the task management method is improved.
Optionally, after determining the DAG workflow corresponding to the task type, the method further includes: and carrying out validity check on the DAG workflow and confirming that the check is passed. The validity check includes: checking whether the DAG workflow is acyclic, and checking whether each node of the DAG workflow is successfully created. If no ring exists and the node is successfully established, the check is passed, otherwise, the check is not passed.
And 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, so that the service framework can be completely isolated from the service scene, the service party only needs to create the DAG workflow and does not need to pay attention to the scheduling problem among all nodes in the DAG workflow, the code complexity is reduced, and the universality of the service framework is improved.
Taking an internet online advertisement system as an example, the internet online advertisement is a complex system with a very long business process, and comprises multiple stages of information extraction, filtering, advertisement sequencing and the like, wherein each stage comprises multiple business processing modules, and most of the modules comprise scenes for synchronously or asynchronously calling external services. FIG. 3 is a schematic diagram of an online advertising system. Such as an advertisement Retrieval engine and a Retrieval engine in the figures, the systems have the common characteristics of longer business process and more modules. Taking an Adserver as an example, the general steps include accessing user information, accessing commodity information, accessing a model system, accessing a retrieval system, ranking and the like. If according to the programming thought facing the process, the codes are generally gradually accumulated according to the business process, various business modules are added, and the operation is sequentially carried out according to the function calling process, the code amount is expanded very fast, and the module division is not easy to carry out. Based on the task type and the preset matching relationship, 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 to distribute traffic, and the main functions are to register a DAG workflow and parse a traffic type. The preset matching relationship may be registered in the flow distributor. When the method is used, only a registration method is needed to be called, a function for analyzing the flow type is inherited, and the flow type is analyzed according to the self service, specifically, a plurality of DAG workflows are flexibly controlled by a service party, and the expandability is realized. DAG workflows of various task types are preset in the execution framework. The OP A, OP B1 and OP C of the basic Operator part represent each node, each node executes a service operation (Operator), and the node is a high-cohesion operation 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, the operation process of the online advertising system is as follows:
1. after a gateway (gateway) sends a request to an Adserver, firstly a traffic distributor judges a traffic type, and then corresponding DAG workflows are created according to the traffic type (in the figure, an Excutiongraph1, an Excutiongraph2 and an Excutiongraph3 respectively represent one DAG workflow);
2. and initializing the DAG workflow according to the dependency relationship of the execution nodes, and when the DAG workflow has a loop or the nodes fail to initialize by using the resources, exiting the process and outputting response error information. The purpose of this is to be able to discover problems in the creation of the DAG workflow as early as possible;
3. and when the DAG workflow is initialized successfully, starting to run the DAG workflow from the starting node. In the operation process, after a certain node fails to execute, the node jumps to the final node to carry out the work of log reporting, resource recovery and the like.
4. When the asynchronous service is provided by the system, a callback function needs to be executed to inform a caller that the service request is finished. To this end, a complete DAG workflow run ends.
In this example, a request _ Context object and a frame _ Context object of a Context type are created for each request during initialization, and are used for storing data information during the task execution process. The Context class is a data storage object defined by the service framework, the request _ Context is service Context data, and the frame _ Context is an interaction carrier between the service and the framework.
During initialization, the Operator needs to implement initialization and a Work method (a function) for the service side to inherit and implement, and the framework executes the Work method for controlling the execution flow and counting time consumption and reporting failure alarm and other functions. The service class inherits the COMMON OPERATOR (a normal operation procedure, i.e., an operation performed serially), implements the Init/dowalk function, and is registered with the REGISTER _ COMMON _ OPERATOR _ GENERATOR (a registrar of the normal operation procedure). The fragmentation operation Operator inherits the partitionationoperator (fragmentation operation process, i.e. operation of executing multiple fragments in parallel), implements the Init/dowalk function, and REGISTERs with REGISTER _ PARTITION _ Operator _ GENERATOR (registrar of the fragmentation operation process). When the DAG workflow is initialized, a service Operator object is created according to the Operator name through a reflection mechanism so as to store the execution data of the node.
FIG. 5 is a schematic business flow diagram of an online advertising system to which the method of the present invention is applied. As shown in fig. 5, the flow of the Adserver system includes:
a ParseRequestOperator node analyzes the request;
carrying out parameter validity check on the ValidateReqParamaOperator node;
the method comprises the steps that a FetchUserInfoOperator node acquires user information;
the FetchQueryCateAndBandOpera node acquires the classification and the brand of the request;
a FetchNaturalskuOperator node acquires a natural result;
a FetchTriggerInfoOperator node acquires trigger information;
the FillRetrievelReqoperator node fills a retrieval request according to the triggering information;
the AccessRetrievalOperator node requests retrieval service according to the retrieval request;
rough SortOperator node carries out coarse sorting on the retrieval result;
the FetchSkuInfoOperator node acquires sku (Stock locating Unit) information after coarse sorting;
filtering sku by the FilterAdSkuOperator node according to a preset rule;
the FineSortOperator node carries out fine sorting on the filtered retrieval results;
packing the result of the JSonPacker operator node;
writing a log by a WriteBusinessLoggerator node;
the FinalOperator node finally operates.
The system comprises a ParserRequestOperator, a ValidateReqParamaOperator, a FetchUserInfoOperator, a FillRetrievelReqOperator, a RoughSortOperator, subsequent nodes and the like, wherein the ParserRequestOperator, the ValidateReqParamaOperator, the FetchUserInfoOperator, the FillRetoReqOperator, the subsequent nodes and the like are serial nodes and are sequentially executed with. The FetchQueryCateAndBrandOperator, the FetchNaturalSkuOperator and the FetchTriggerinInfoOperator are parallel nodes and execute in parallel. The AccessRAetrievaloperator is a fragment node. The final node of the execution flow is FinaOperator. The division principle of Operator is module cohesiveness, reusability, clear search stage, etc.
The invention splits the workflow with larger difference, different task types correspond to different DAG workflows, the workflows are clearly expressed in a DAG mode, and nodes in the workflows can express several types of general logics such as serial and parallel slicing conditions. The invention can completely isolate the service framework from the service scene, and the service party only needs to create the DAG without paying attention to the scheduling problem, thereby having good universality.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for implementing the above method.
Fig. 6 is a schematic diagram of main modules of a task management apparatus 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 that executes the task based on the DAG workflow.
Optionally, the distribution unit is further configured to: and after the DAG workflow corresponding to the task type is determined, carrying out validity check on the DAG workflow and confirming that the check is passed.
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 executing unit processes the task to be processed based on the directed acyclic graph, and the processing method comprises the following steps: for any node before the final node including the starting node, judging whether the execution of the any node is successful, and if the execution of the any node is successful, jumping to the next node of the 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, the respective nodes include at least one of: serial nodes, parallel nodes, fragment nodes and 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, so that the service framework can be completely isolated from the service scene, a service party only needs to create the DAG workflow without paying attention to the scheduling problem among all nodes in the DAG workflow, the code complexity is reduced, and the universality of the service framework is improved.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device for task management, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused 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, on which a computer program is stored, 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 apparatus or method to which embodiments of the invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for task management provided by 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, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, a computer system 800 includes a central execution unit (CPU)801 that can perform various appropriate actions and processes in accordance with 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 necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and 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. A drive 810 is also connected to the I/O interface 805 as necessary. 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 necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the 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 illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the central execution unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 present invention, 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, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 flowchart 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 described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprising: the analysis unit is used for receiving the 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 to execute the task based on the DAG workflow. Where the names of these elements do not in some cases constitute a limitation on the elements themselves, for example, a distribution element may also be described as an "element that performs 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 separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: 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.
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, a 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.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A 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.
2. The method as recited in 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 is passed.
3. The method as in claim 1, wherein 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: for any node before the final node including the starting node, judging whether the execution of the any node is successful, and if the execution of the any node is successful, jumping to the next node of the any node; otherwise, jumping to the final node.
4. The method of claim 3, wherein at least one of the nodes in the directed acyclic graph is located after the final node.
5. The method of any of claims 1-4, wherein the respective nodes comprise at least one of: serial nodes, parallel nodes, fragment nodes and conditional nodes.
6. An apparatus for task management, comprising:
the analysis unit is used for receiving the 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 to execute the task based on the DAG workflow.
7. The apparatus of claim 6, wherein the distribution unit is further to: and after the DAG workflow corresponding to the task type is determined, carrying out validity check on the DAG workflow and confirming that the check is passed.
8. The apparatus of claim 6, wherein 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 executing unit processes the task to be processed based on the directed acyclic graph, and the processing method comprises the following steps: for any node before the final node including the starting node, judging whether the execution of the any node is successful, and if the execution of the any node is successful, jumping to the next node of the any node; otherwise, jumping to the final node.
9. An electronic device for task management, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
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 true CN112799797A (en) 2021-05-14
CN112799797B 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)

Cited By (1)

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

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
US20110231849A1 (en) * 2010-03-18 2011-09-22 International Business Machines Corporation Optimizing Workflow Engines
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

Patent Citations (13)

* 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
US20110231849A1 (en) * 2010-03-18 2011-09-22 International Business Machines Corporation Optimizing Workflow Engines
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
唐华云 等: "工作流管理平台的设计及其在自助服务中的应用", 计算机系统应用, vol. 25, no. 7, 31 July 2016 (2016-07-31) *

Cited By (1)

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

Also Published As

Publication number Publication date
CN112799797B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
CN110310034B (en) Service arrangement and business flow processing method and device applied to SaaS
US9569288B2 (en) Application pattern discovery
US9910821B2 (en) Data processing method, distributed processing system, and program
US10169005B2 (en) Consolidating and reusing portal information
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN111737270A (en) Data processing method and system, computer system and computer readable medium
CN109901987B (en) Method and device for generating test data
CN110597888B (en) Virtual resource acquisition method and device based on block chain, medium and equipment
CN110781180B (en) Data screening method and data screening device
CN111444077A (en) Method and device for generating flow node test data
CN112947919A (en) Method and device for constructing service model and processing service request
CN112817562A (en) Service processing method and device
CN113297287B (en) Automatic user policy deployment method and device and electronic equipment
CN109218338B (en) Information processing system, method and device
CN110795331A (en) Software testing method and device
CN110928594A (en) Service development method and platform
CN112799797B (en) Task management method and device
CN111382953A (en) Dynamic process generation method and device
CN113918525A (en) Data exchange scheduling method, system, electronic device, medium, and program product
CN110688355A (en) Method and device for changing container state
CN114049065A (en) Data processing method, device and system
CN112825525B (en) Method and apparatus for processing transactions
CN110378714B (en) Method and device for processing access data
CN113765868B (en) Service processing method and device
CN113760488B (en) Method, apparatus, device and computer readable medium for scheduling tasks

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