CN107315581B - Task script generation device and method, and task scheduling system and method - Google Patents

Task script generation device and method, and task scheduling system and method Download PDF

Info

Publication number
CN107315581B
CN107315581B CN201710370260.1A CN201710370260A CN107315581B CN 107315581 B CN107315581 B CN 107315581B CN 201710370260 A CN201710370260 A CN 201710370260A CN 107315581 B CN107315581 B CN 107315581B
Authority
CN
China
Prior art keywords
task
script
result
scheduling
module
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
CN201710370260.1A
Other languages
Chinese (zh)
Other versions
CN107315581A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710370260.1A priority Critical patent/CN107315581B/en
Publication of CN107315581A publication Critical patent/CN107315581A/en
Application granted granted Critical
Publication of CN107315581B publication Critical patent/CN107315581B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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

Abstract

The invention discloses a task script generating device and method, a task scheduling system and method, wherein the device collects a drawing result of drawing a directed acyclic graph on the drawing interface by providing the drawing interface, generates a scheduling task parameter of the directed acyclic graph according to the drawing result, analyzes the scheduling task parameter, packages the scheduling task parameter to generate a packaging result, and defines the packaging result by adopting template definition software matched with a target task scheduling system to generate a task script corresponding to the directed acyclic graph; in the whole process, a user only needs to simply draw the directed acyclic graph in the drawing interface according to needs, and then the task script generating device can generate the task script corresponding to the directed acyclic graph without script compiling, so that the requirement for the user to use the scheduling system is lowered, the problem that the user is difficult to use the scheduling system due to the fact that the user needs manual compiling in the existing task script is solved, and the use experience of the user is enhanced.

Description

Task script generation device and method, and task scheduling system and method
Technical Field
The invention relates to the field of big data management, in particular to a task script generation device and method and a task scheduling system and method.
Background
User data (including user behavior data, user communication data and the like) are core assets of all large companies at present, and data analysis and mining are performed on the basis of the large data, so that the potential value of the data is mined, the revenue is increased, and the product direction of the companies is guided.
There will be many processing tasks such as query computation and the like in the big data, for example, a series of operations such as hive query, spark computation, hadoop computation and the like, each operation is a task, a series of task combinations is a DAG (direct acyclic graph), and there are two dependencies between tasks, "dependencies between tasks upstream and downstream, or dependencies between task batches"; it is obviously impractical and inefficient to handle these relationships manually, so the scheduling system comes up.
The bottom layer of the more mature DAG on the market, such as oozie, is based on hadoop, and the DAG is defined by an xml file and a configuration file. The disadvantages of this approach are: firstly, the graphical user interface is not friendly and has rough display; two, such a configuration of xml is cumbersome and inflexible. Correspondingly, the management tool Airflow is a scheduling system based on python language, the scheduling file is written by python language, the flexibility is high, and the user interface is friendly, but the task script based on python language required by the Airflow, such as function call and task included in DAG, needs to be manually compiled by a user, which is a difficult problem for the user, and causes the user to be difficult to use the scheduling system.
Disclosure of Invention
The invention mainly aims to provide a task script generation device and method, a task scheduling system and a task scheduling method, and aims to solve the problem that the existing task script needs manual compiling by a user, so that the user is difficult to use the scheduling system.
In order to achieve the above object, the present invention provides a task script generating device, including: an acquisition module, a processing module, a packaging module and an output module, wherein,
the acquisition module is used for providing a drawing interface and acquiring a drawing result of drawing the directed acyclic graph on the drawing interface;
the processing module is used for generating scheduling task parameters of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph;
the packaging module is used for analyzing the scheduling task parameters and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters;
and the output module is used for defining the packaging result by adopting template definition software matched with the target task scheduling system and generating a task script corresponding to the directed acyclic graph.
In some embodiments, the output module is further configured to invoke a script syntax checking rule of the target task scheduling system after the task script is generated, check the task script, and output a final task script when the check is passed.
In some embodiments, the system further comprises a presentation module, and the presentation module is configured to obtain an execution result of the task script fed back by the target task scheduling system, and present the execution result.
In some embodiments, the output module is further configured to invoke a blocking request operation, define the blocking request operation and the encapsulation result at the same time, and generate the task script.
The invention provides a task scheduling system, which comprises a task scheduling device, a task execution device and a task script generation device provided by the invention, wherein,
the task script generating device is used for acquiring a drawing result of the directed acyclic graph drawing performed by the user on the drawing interface and generating a corresponding task script;
the task scheduling device is used for scheduling the task script according to the scheduling parameters of the directed acyclic graph;
the task execution device is used for executing the task script and returning an execution result to the task script generation device;
the task script generating device is also used for displaying the execution result.
The invention provides a task script generating method, which comprises the following steps:
providing a drawing interface, and collecting a drawing result of drawing the directed acyclic graph on the drawing interface;
generating a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph;
analyzing the scheduling task parameters, and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters;
and defining the packaging result by adopting template definition software matched with the target task scheduling system to generate a task script corresponding to the directed acyclic graph.
In some embodiments, after generating the task script, the method further comprises: and calling a script grammar checking rule of the target task scheduling system, checking the task script, and outputting the final task script when the checking is passed.
In some embodiments, further comprising: and acquiring an execution result of the task script fed back by the target task scheduling system, and displaying the execution result.
In some embodiments, further comprising: and calling a blocking request operation, defining the blocking request operation and the packaging result simultaneously, and generating a task script.
The invention provides a task scheduling method, which comprises the following steps:
by adopting the task script generating method provided by the invention, the corresponding task script is generated according to the drawing result of the directed acyclic graph drawing performed by the user on the drawing interface;
scheduling the task script according to the scheduling parameters of the directed acyclic graph;
and executing the task script and displaying an execution result.
The device collects a drawing result of drawing a directed acyclic graph on the drawing interface by providing the drawing interface, generates a scheduling task parameter of the directed acyclic graph according to the drawing result, analyzes the scheduling task parameter, packages the scheduling task parameter to generate a packaging result, defines the packaging result by adopting template definition software matched with a target task scheduling system, and generates a task script corresponding to the directed acyclic graph; in the whole process, a user only needs to perform simple drawing on the directed acyclic graph realized according to needs in the drawing interface, the task script generating device can generate the task script corresponding to the directed acyclic graph, the user operation is simple, script compiling is not needed, the requirement for the user to use the scheduling system is reduced, the user only needs to have basic drawing capacity, the problem that the user is difficult to use the scheduling system due to the fact that the user needs to manually compile the existing task script is solved, and the use experience of the user is enhanced.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an alternative mobile terminal for implementing various embodiments of the present invention;
FIG. 2 is a diagram of a wireless communication system for the mobile terminal shown in FIG. 1;
FIG. 3 is a schematic structural diagram of a task script generating device according to the present invention;
fig. 4 is a schematic structural diagram of the terminal of the present invention;
FIG. 5 is a flowchart of a task script generation method according to a first embodiment of the present invention;
FIG. 6 is a flowchart of a task script generating method according to a second embodiment of the present invention;
FIG. 7 is a schematic interface diagram of a task script generation apparatus according to an embodiment of the present invention;
FIG. 8 is a first schematic diagram of a rendering interface according to an embodiment of the present invention;
FIG. 9 is a second schematic diagram of a rendering interface according to an embodiment of the invention;
FIG. 10 is a third schematic diagram of a rendering interface according to an embodiment of the invention;
fig. 11 is a schematic diagram of a display interface according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
A mobile terminal implementing various embodiments of the present invention will now be described with reference to the accompanying drawings. In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in themselves. Thus, "module" and "component" may be used in a mixture.
The task scheduling system comprises a task scheduling device, a task executing device and a task script generating device, wherein the task scheduling device and the task executing device are realized by a server, the task script generating device is realized by a client/portal interface and the like on a user terminal, and the task scheduling device is connected with the task script generating device based on an interface (such as airflowAPI) of the scheduling system. The user terminal related to the present invention may be a mobile terminal such as a mobile phone/tablet, and a fixed terminal such as a computer, and the following embodiments take the terminal as the mobile terminal as an example, and the implementation of the fixed terminal is similar thereto.
The mobile terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. In the following, it is assumed that the terminal is a mobile terminal. However, it will be understood by those skilled in the art that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for moving purposes.
Fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal for implementing various embodiments of the present invention.
The mobile terminal 100 may include a wireless communication unit 110, a user input unit 120, an output unit 130, a memory 140, a controller 150, and a power supply unit 160, etc. Fig. 1 illustrates a mobile terminal having various components, but it is to be understood that not all illustrated components are required to be implemented, and that more or fewer components may instead be implemented, the elements of the mobile terminal being described in detail below.
The wireless communication unit 110 typically includes one or more components that allow radio communication between the mobile terminal 100 and a wireless communication system or network to download applications and the like. For example, the wireless communication unit may include at least one of a mobile communication module 111 and a wireless internet module 112.
The mobile communication module 111 transmits and/or receives radio signals to and/or from at least one of a base station (e.g., access point, node B, etc.), an external terminal, and a server. Such radio signals may include voice call signals, video call signals, or various types of data transmitted and/or received according to text and/or multimedia messages.
The wireless internet module 112 supports wireless internet access of the mobile terminal. The module may be internally or externally coupled to the terminal. The wireless internet access technology to which the module relates may include WLAN (wireless LAN) (Wi-Fi), Wibro (wireless broadband), Wimax (worldwide interoperability for microwave access), HSDPA (high speed downlink packet access), and the like.
The user input unit 120 may generate key input data to control various operations of the mobile terminal according to a command input by a user. The user input unit 120 allows a user to input various types of information, and may include a keyboard, dome sheet, touch pad (e.g., a touch-sensitive member that detects changes in resistance, pressure, capacitance, and the like due to being touched), scroll wheel, joystick, sensor, and the like. In particular, when the touch pad is superimposed on the display module 131 in the form of a layer, a touch screen may be formed.
The output unit 130 may include a display module 131 and the like. The display module 131 may display information processed in the mobile terminal 100. For example, when the mobile terminal 100 is in a phone call mode, the display module 131 may display a User Interface (UI) or a Graphical User Interface (GUI) related to a call or other communication (e.g., text messaging, multimedia file downloading, etc.). When the mobile terminal 100 is in a video call mode or an image capturing mode, the display module 131 may display a captured image and/or a received image, a UI or GUI showing a video or an image and related functions, and the like.
Meanwhile, when the display module 131 and the touch panel are stacked on each other in the form of layers to form a touch screen, the display module 131 may function as an input device and an output device. The display module 131 may include at least one of a Liquid Crystal Display (LCD), a thin film transistor LCD (TFT-LCD), an Organic Light Emitting Diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like. Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as transparent displays, and a typical transparent display may be, for example, a TOLED (transparent organic light emitting diode) display or the like. The mobile terminal 100 may include two or more display modules (or other display devices) according to a particular desired implementation, for example, the mobile terminal may include an external display module (not shown) and an internal display module (not shown). The touch screen may be used to detect a touch input pressure as well as a touch input position and a touch input area.
The memory 140 may store software programs or the like for processing and control operations performed by the controller 150, or may temporarily store data that has been output or is to be output (for example, a correspondence relationship of a terminal state to a response sensitivity, or the like). Also, the memory 140 may store data regarding various ways of vibration and audio signals output when a touch is applied to the touch screen.
The memory 140 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and so on. Also, the mobile terminal 100 may cooperate with a network storage device that performs a storage function of the memory 140 through a network connection.
The controller 150 generally controls the overall operation of the mobile terminal. For example, the controller 150 performs control and processing related to voice calls, data networks, video calls, and the like. In addition, the controller 150 may include a multimedia module 151 for reproducing (or playing back) multimedia data, and the multimedia module 151 may be constructed within the controller 150 or may be constructed separately from the controller 150. The controller 150 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
The power supply unit 160 receives external power or internal power and provides appropriate power required to operate the respective elements and components under the control of the controller 150.
The various embodiments described herein may be implemented in a computer-readable medium using, for example, computer software, hardware, or any combination thereof. For a hardware implementation, the embodiments described herein may be implemented using at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, an electronic unit designed to perform the functions described herein, and in some cases, such embodiments may be implemented in the controller 150. For a software implementation, the implementation such as a process or a function may be implemented with a separate software module that allows performing at least one function or operation. The software codes may be implemented by software applications (or programs) written in any suitable programming language, which may be stored in memory 140 and executed by controller 150.
Up to this point, mobile terminals have been described in terms of their functionality. Hereinafter, a slide-type mobile terminal among various types of mobile terminals, such as a folder-type, bar-type, swing-type, slide-type mobile terminal, and the like, will be described as an example for the sake of brevity. Accordingly, the present invention can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
The mobile terminal 100 as shown in fig. 1 may be configured to operate with communication systems such as wired and wireless communication systems and satellite-based communication systems that transmit data via frames or packets.
A communication system in which a mobile terminal according to the present invention is operable will now be described with reference to fig. 2.
Such communication systems may use different air interfaces and/or physical layers. For example, the air interface used by the communication system includes, for example, Frequency Division Multiple Access (FDMA), Time Division Multiple Access (TDMA), Code Division Multiple Access (CDMA), and Universal Mobile Telecommunications System (UMTS) (in particular, Long Term Evolution (LTE)), global system for mobile communications (GSM), and the like. By way of non-limiting example, the following description relates to a CDMA communication system, but such teachings are equally applicable to other types of systems.
Referring to fig. 2, the CDMA wireless communication system may include a plurality of mobile terminals 100, a plurality of Base Stations (BSs) 270, Base Station Controllers (BSCs) 275, a Mobile Switching Center (MSC)280, a task scheduling device 400, and a task performing device 500. The MSC280 is configured to interface with a Public Switched Telephone Network (PSTN) 290. The MSC280 is also configured to interface with a BSC275, which may be coupled to the base station 270 via a backhaul. The backhaul may be constructed according to any of several known interfaces including, for example, E1/T1, ATM, IP, PPP, frame Relay, HDSL, ADSL, or xDSL. It will be understood that a system as shown in fig. 2 may include multiple BSCs 275.
Each BS270 may serve one or more sectors (or regions), each sector covered by a multi-directional antenna or an antenna pointing in a particular direction being radially distant from the BS 270. Alternatively, each partition may be covered by two or more antennas for diversity reception. Each BS270 may be configured to support multiple frequency allocations, with each frequency allocation having a particular frequency spectrum (e.g., 1.25MHz,5MHz, etc.).
The intersection of partitions with frequency allocations may be referred to as a CDMA channel. The BS270 may also be referred to as a Base Transceiver Subsystem (BTS) or other equivalent terminology. In such a case, the term "base station" may be used to generically refer to a single BSC275 and at least one BS 270. The base stations may also be referred to as "cells". Alternatively, each sector of a particular BS270 may be referred to as a plurality of cell sites.
As shown in fig. 2, a Broadcast Transmitter (BT)295 transmits a broadcast signal to the mobile terminal 100 operating within the system. Such as a broadcast receiving module, is provided at the mobile terminal 100 to receive a broadcast signal transmitted by the BT 295. In fig. 2, several Global Positioning System (GPS) satellites 300 are shown. The satellite 300 assists in locating at least one of the plurality of mobile terminals 100.
In fig. 2, a plurality of satellites 300 are depicted, but it is understood that useful positioning information may be obtained with any number of satellites. Such as a GPS module, is typically configured to cooperate with the satellites 300 to obtain the desired positioning information. Other techniques that can track the location of the mobile terminal may be used instead of or in addition to GPS tracking techniques. In addition, at least one GPS satellite 300 may selectively or additionally process satellite DMB transmission.
As a typical operation of the wireless communication system, the BS270 receives reverse link signals from various mobile terminals 100. The mobile terminal 100 is generally engaged in conversations, messaging, and other types of communications. Each reverse link signal received by a particular base station 270 is processed within the particular BS 270. The obtained data is forwarded to the associated BSC 275. The BSC provides call resource allocation and mobility management functions including coordination of soft handoff procedures between BSs 270. The BSCs 275 also route the received data to the MSC280, which provides additional routing services for interfacing with the PSTN 290. Similarly, the PSTN290 interfaces with the MSC280, the MSC interfaces with the BSCs 275, and the BSCs 275 accordingly control the BS270 to transmit forward link signals to the mobile terminal 100.
In fig. 2, the task scheduling device 400 is typically implemented by an entity/virtual server provided by an application provider, and receives a task script uploaded from the mobile terminal 100 through a base station/internet, etc., determines a corresponding task execution device 500, and transmits the task script to the corresponding task execution device 500 when a task scheduling condition is satisfied.
In fig. 2, the task execution device 500 is typically implemented by an entity/virtual server provided by a service provider, and receives the task script forwarded from the task scheduling device 400 through a base station, the internet, or the like, and returns an execution result or the like to the mobile terminal 100 after execution.
Based on the above mobile terminal hardware structure and communication system, the present invention provides various embodiments of the method.
As shown in fig. 3, an embodiment of the task script generating device according to the present invention is proposed based on the above-mentioned mobile terminal hardware structure and communication system, and specifically, the task script generating device according to the present invention includes: an acquisition module 31, a processing module 32, a packaging module 33 and an output module 34, wherein,
the acquisition module 31 is configured to provide a drawing interface, and acquire a drawing result obtained by drawing a directed acyclic graph on the drawing interface;
the processing module 32 is configured to generate a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph; in practical applications, the processing module 32 may be configured to describe the scheduling task parameters of the directed acyclic graph in a json data format, where json includes three types of information: DAG information, Dag information contains attributes for the entire Dag, including name, id, argument; node information, each node represents a Task, and the node information is Task information; in practical applications, each Task is an http-type operation, which is to forward the execution request to the custom query interface (i.e., the Task execution device 500); connectors connection information, each connection representing a timing sequence between tasks;
the encapsulation module 33 is used for analyzing the scheduling task parameters and encapsulating to generate an encapsulation result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters; in practical application, the encapsulation module 33 parses DAG json, and encapsulates the DAG json into an encapsulation result, which includes a corresponding module list (a module list that needs to be introduced in current python), a Task list (including http-type Task dependency and Task specific execution script), lines (timing dependency between tasks), and Dag (including Dag attributes and default parameters of all tasks, such as execution period and execution time);
the output module 34 is configured to define the encapsulation result by using template definition software matched with the target task scheduling system, and generate a task script corresponding to the directed acyclic graph; in practical application, the target task scheduling system is implemented based on Java language, the template definition software includes a Freemarker, and at this time, the output module 34 uses the Freemarker to define a python template file as a task script, and the task script includes: a module list, which contains the module introduced according to the current operation and also contains default added module; a Task list, http request operation and request self-defining query interface; the execution time of the current task is used for making a later query state; and (4) task timing relation.
In practical applications, the interface of the task script generating device may include a drawing interface and a displaying interface at the same time, or may display different interfaces under different functions, as shown in fig. 7 for a scene including the drawing interface and the displaying interface at the same time, or as shown in fig. 8 to 11 for a scene displaying different interfaces under different functions.
Specifically, as shown in fig. 7, the drawing interface may include some commonly used function options (such as save, open, create, and the like), or may include some commonly used graphics (such as a flow diagram, a judgment diagram, a selection diagram, and the like), and account options such as user login and the like, and based on such options, the user may draw the DAG graphics conveniently and quickly; the presentation interface may include some commonly used function options (e.g., export, save, etc.), and account options such as user login, etc., based on which the user may conveniently process the execution result of the DAG.
In order to ensure the validity of the task script, in practical applications, the output module 34 is further configured to call a script syntax checking rule of the target task scheduling system after the task script is generated, check the task script, and output a final task script when the check is passed.
In practical application, because the custom query interface is in an asynchronous mode, in order to ensure that the requested task is executed after the task is really executed, a blocked request operation is added, and the task execution state of the custom interface is polled all the time; namely, the output module 34 is further configured to invoke a blocking request operation, define the blocking request operation and the encapsulation result at the same time, and generate a task script; in this case, the task script includes: a module list, which contains the module introduced according to the current operation and also contains default added module; a Task list, http request operation and request self-defining query interface; the execution time of the current task is used for making a later query state; request operation is blocked, because the custom query interface is in an asynchronous mode, in order to ensure that a requested task is executed after the task is really executed, a blocked request operation is added, and the task execution state of the custom interface is polled all the time; and (4) task timing relation.
In practical application, in order for a user to know an execution result of the DAG in real time on the mobile terminal, as shown in fig. 3, the task script generating device provided by the present invention further includes a display module 35, where the display module 35 is configured to obtain the execution result of the task script fed back by the target task scheduling system, and display the execution result.
In order to make the task script generating device provided by the present invention applicable, the present invention provides a task scheduling system comprising a task scheduling device 400, a task executing device 500, and the task script generating device provided by the present invention, wherein,
the task script generating device is used for acquiring a drawing result of the directed acyclic graph drawing performed by the user on the drawing interface and generating a corresponding task script;
the task scheduling device 400 is configured to schedule a task script according to scheduling parameters of the directed acyclic graph, such as an execution period, a predicted execution time, and the like; in practical application, after the task script generating device generates the python file according to the template, the file flow is used for sending the python file to the airflowAPI interface of the task scheduling device 400, the API is responsible for performing operations such as syntax checking and testing on the python script, and when the checking is passed, the task script and the corresponding scheduling parameters are stored;
the task execution device 500 is configured to execute the task script and return an execution result to the task script generation device;
the task script generating device is also used for displaying the execution result.
The above embodiments will now be described in detail with reference to fig. 8 to 11:
as shown in fig. 8, DAG1 includes task 1, task 2, and task 3, where task 1, task 2, and task 3 are all flow steps, and do not need to perform judgment/selection, and the dependency among task 1, task 2, and task 3 is to perform in sequence: executing task 1, outputting the execution result of task 1, executing task 2 on the execution result of task 1, outputting the execution result of task 2, executing task 3 on the execution result of task 2, and outputting the execution result of task 3;
at this time, the drawing result acquired by the acquisition module 31 is as shown in fig. 8, and the json data format output by the processing module 32 includes "DAG information: name (name: DAG1), id (number: #1), argument (parameter: execute once per day 8: 00); node information: task 1, task 2, and task 3; connectors connection information: task 1, task 2, task 3 are executed in sequence ";
the encapsulation result output by the encapsulation module 33 includes a "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; lines: task 1, task 2 and task 3 are executed in sequence; dag: name: DAG1, id number: #1, alignment parameter: once per day 8:00 execution) ";
the task script output by the output module 34 is "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; execution time of the current task: 8:00 per day; blocking request operation: polling operation; the task time sequence relation is as follows: task 1, task 2, and task 3 are executed in sequence.
As shown in fig. 9, DAG2 includes task 1, task 2, and task 3, where task 1 and task 3 are both flow steps, task 2 is a determination step, and the dependency relationship among task 1, task 2, and task 3 is: executing the task 1, outputting an execution result of the task 1, executing the task 2 (judging) on the execution result of the task 1, and outputting an execution result of the task 2, if the execution result of the task 2 meets the condition, executing the task 3 on the execution result of the task 2, and outputting an execution result of the task 3, if the execution result of the task 2 does not meet the condition, executing the task 1 on the execution result of the task 2, and outputting the execution result of the task 1 until the execution result of the task 2 meets the condition;
at this time, the drawing result acquired by the acquisition module 31 is as shown in fig. 9, and the json data format output by the processing module 32 includes "DAG information: name (name: DAG2), id (number: #2), argument (parameter: execute once per day 8: 00); node information: task 1, task 2, and task 3; connectors connection information: executing the task 1, outputting an execution result of the task 1, executing the task 2 (judging) on the execution result of the task 1, and outputting an execution result of the task 2, if the execution result of the task 2 meets the condition, executing the task 3 on the execution result of the task 2, and outputting an execution result of the task 3, if the execution result of the task 2 does not meet the condition, executing the task 1 on the execution result of the task 2, and outputting the execution result of the task 1 until the execution result of the task 2 meets the condition;
the encapsulation result output by the encapsulation module 33 includes a "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; lines: executing the task 1, outputting an execution result of the task 1, executing the task 2 (judging) on the execution result of the task 1, and outputting an execution result of the task 2, if the execution result of the task 2 meets the condition, executing the task 3 on the execution result of the task 2, and outputting an execution result of the task 3, if the execution result of the task 2 does not meet the condition, executing the task 1 on the execution result of the task 2, and outputting the execution result of the task 1 until the execution result of the task 2 meets the condition; dag includes name DAG2, id number #1, attribute executed 8:00 times per day;
the task script output by the output module 34 is "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; execution time of the current task: 8:00 per day; blocking request operation: polling operation; the task time sequence relation is as follows: executing the task 1, outputting an execution result of the task 1, executing (judging) the task 2 on the execution result of the task 1, and outputting the execution result of the task 2, executing the task 3 on the execution result of the task 2 if the execution result of the task 2 satisfies the condition, and outputting the execution result of the task 3, executing the task 1 on the execution result of the task 2 if the execution result of the task 2 does not satisfy the condition, and outputting the execution result of the task 1 until the execution result of the task 2 satisfies the condition ".
As shown in fig. 10, DAG3 includes task 1, task 2, and task 3, where task 1 is a selection step, task 2 and task 3 are both flow steps, and the dependencies among task 1, task 2, and task 3 are: executing the task 1, outputting an execution result of the task 1, if the execution result of the task 1 is the execution task 2, executing the task 2 on the execution result of the task 1, and outputting an execution result of the task 2, and if the execution result of the task 1 is the execution task 3, executing the task 3 on the execution result of the task 1, and outputting an execution result of the task 3;
at this time, the drawing result acquired by the acquisition module 31 is as shown in fig. 10, and the json data format output by the processing module 32 includes "DAG information: name (name: DAG3), id (number: #3), argument (parameter: execute once per day 8: 00); node information: task 1, task 2, and task 3; connectors connection information: executing the task 1, outputting an execution result of the task 1, if the execution result of the task 1 is the execution task 2, executing the task 2 on the execution result of the task 1, and outputting an execution result of the task 2, and if the execution result of the task 1 is the execution task 3, executing the task 3 on the execution result of the task 1, and outputting an execution result of the task 3;
the encapsulation result output by the encapsulation module 33 includes a "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; lines: the task 2 and the task 3 are flow steps, and the dependency relationship among the task 1, the task 2 and the task 3 is as follows: executing the task 1, outputting an execution result of the task 1, if the execution result of the task 1 is the execution task 2, executing the task 2 on the execution result of the task 1, and outputting an execution result of the task 2, and if the execution result of the task 1 is the execution task 3, executing the task 3 on the execution result of the task 1, and outputting an execution result of the task 3; dag includes name DAG3, id number #3, attribute executed 8:00 times per day;
the task script output by the output module 34 is "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; execution time of the current task: 8:00 per day; blocking request operation: polling operation; the task time sequence relation is as follows: the task 2 and the task 3 are flow steps, and the dependency relationship among the task 1, the task 2 and the task 3 is as follows: the task 1 is executed, the execution result of the task 1 is output, if the execution result of the task 1 is the execution task 2, the execution result of the task 1 is executed, the execution result of the task 2 is output, and if the execution result of the task 1 is the execution task 3, the execution result of the task 1 is executed, the execution result of the task 3 is output.
As shown in fig. 11, the display interface includes execution results including: the result of execution of task 1, the result of execution of task 2, and the result of execution of task 3.
In summary, the task script generating device provided in the embodiment of the present invention collects a drawing result obtained by drawing a directed acyclic graph on a drawing interface by providing the drawing interface, generates a scheduling task parameter of the directed acyclic graph according to the drawing result, analyzes the scheduling task parameter, and encapsulates the scheduling task parameter to generate an encapsulation result, and defines the encapsulation result by using template definition software matched with a target task scheduling system to generate a task script corresponding to the directed acyclic graph; in the whole process, a user only needs to perform simple drawing on the directed acyclic graph realized according to needs in the drawing interface, the task script generating device can generate the task script corresponding to the directed acyclic graph, the user operation is simple, script compiling is not needed, the requirement for the user to use the scheduling system is reduced, the user only needs to have basic drawing capacity, the problem that the user is difficult to use the scheduling system due to the fact that the user needs to manually compile the existing task script is solved, and the use experience of the user is enhanced.
In one embodiment of the invention, the controller 150 may include the functionality of all of the functional blocks in the embodiment shown in FIG. 3. In this case, the above embodiment may be:
firstly, the processor 150 displays a drawing interface through a display screen;
on the basis, the processor 150 collects the drawing result of drawing the directed acyclic graph on the drawing interface; generating a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph; analyzing the scheduling task parameters, and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters; adopting template definition software matched with a target task scheduling system to define a packaging result and generate a task script corresponding to the directed acyclic graph;
secondly, the processor 150 sends the task script to the server through the communication module 45 and receives the execution result returned by the server;
finally, the processor 150 displays a display interface through the display screen 46, and displays the execution result in the display interface.
The embodiment provides a terminal, which acquires a drawing result of drawing a directed acyclic graph on a drawing interface by providing the drawing interface, generates a scheduling task parameter of the directed acyclic graph according to the drawing result, analyzes the scheduling task parameter, packages the scheduling task parameter to generate a packaging result, defines the packaging result by adopting template definition software matched with a target task scheduling system, and generates a task script corresponding to the directed acyclic graph; in the whole process, a user only needs to perform simple drawing on the directed acyclic graph realized according to needs in the drawing interface, the task script generating device can generate the task script corresponding to the directed acyclic graph, the user operation is simple, script compiling is not needed, the requirement for the user to use the scheduling system is reduced, the user only needs to have basic drawing capacity, the problem that the user is difficult to use the scheduling system due to the fact that the user needs to manually compile the existing task script is solved, and the use experience of the user is enhanced.
Fig. 4 is a schematic structural diagram of the terminal of the present invention, and as shown in fig. 4, the terminal provided in this embodiment at least includes: an input/output (IO) bus 41, a processor 42, a RAM 43, a memory 44, a communication module 45 (in the present invention, the communication module 45 includes a receiving module, a sending module, and the like), and a display screen 46 (in the present invention, the display screen 46 is used for displaying a drawing interface and a display interface). Wherein the content of the first and second substances,
the input/output (IO) bus 41 is connected to other components (the processor 42, the memory 43, the memory 44, and the communication module 45) of the terminal to which it belongs, and provides a transmission line for the other components.
The processor 42 typically controls the overall operation of the server to which it belongs. For example, processor 42 performs computations, validation, etc. The processor 42 may be a Central Processing Unit (CPU), among others. In this embodiment, the processor 42 at least needs to have the following functions: providing a drawing interface, and collecting a drawing result of drawing the directed acyclic graph on the drawing interface; generating a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph; analyzing the scheduling task parameters, and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters; and defining the packaging result by adopting template definition software matched with the target task scheduling system to generate a task script corresponding to the directed acyclic graph.
The RAM 43 stores processor-readable, processor-executable software code containing instructions for controlling the processor 42 to perform the functions described herein (i.e., software execution functions). In the present embodiment, the RAM 43 needs to store at least a program necessary for the processor 42 to execute the above-described functions, and also needs to store a correspondence relationship between the terminal state and the response sensitivity.
In the terminal provided by the present invention, software codes for implementing all the functions of the modules may be stored in the memory 43 and executed by the processor 42 or compiled and executed.
The memory 44, which is typically a semiconductor memory unit, includes Random Access Memory (RAM), Read Only Memory (ROM), and CACHE memory (CACHE), of which RAM is the most important. The memory 44 is one of the important components in the computer, and is a bridge for communicating with the CPU, and the operation of all programs in the computer is performed in the memory, and is used for temporarily storing the operation data in the CPU and the data exchanged with an external storage such as a hard disk, and the CPU transfers the data to be operated to the memory for operation as long as the computer is in operation, and the CPU transmits the result after the operation is completed, and the operation of the memory also determines the stable operation of the computer.
A communication module 45, including a radio frequency antenna and a radio frequency transceiver, for completing data transceiving;
and the display screen 46 is used for displaying a drawing interface and a display interface.
On the basis of the terminal component shown in fig. 4, the task script generating device provided in this embodiment can operate as follows:
displaying the drawing interface through the display screen 46;
collecting a drawing result of drawing a directed acyclic graph on a drawing interface; generating a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph; analyzing the scheduling task parameters, and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters; adopting template definition software matched with a target task scheduling system to define a packaging result and generate a task script corresponding to the directed acyclic graph;
sending the task script to the server through the communication module 45, and receiving an execution result returned by the server;
a presentation interface is displayed through the display screen 46, and the execution result is presented in the presentation interface.
The terminal provided by this embodiment collects a drawing result of drawing a directed acyclic graph on a drawing interface by providing the drawing interface, generates a scheduling task parameter of the directed acyclic graph according to the drawing result, analyzes the scheduling task parameter, packages the scheduling task parameter to generate a package result, defines the package result by using template definition software matched with a target task scheduling system, and generates a task script corresponding to the directed acyclic graph; in the whole process, a user only needs to perform simple drawing on the directed acyclic graph realized according to needs in the drawing interface, the task script generating device can generate the task script corresponding to the directed acyclic graph, the user operation is simple, script compiling is not needed, the requirement for the user to use the scheduling system is reduced, the user only needs to have basic drawing capacity, the problem that the user is difficult to use the scheduling system due to the fact that the user needs to manually compile the existing task script is solved, and the use experience of the user is enhanced.
As shown in fig. 5, a first embodiment of the task script generating method of the present invention is proposed, and in this embodiment, the task script generating method includes the following steps:
s501: providing a drawing interface, and collecting a drawing result of drawing the directed acyclic graph on the drawing interface;
s502: generating a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph;
in practical application, the method can be used for describing scheduling task parameters of the directed acyclic graph by adopting a json data format, wherein json comprises three types of information: DAG information, Dag information contains attributes for the entire Dag, including name, id, argument; node information, each node represents a Task, and the node information is Task information; in practical applications, each Task is an http-type operation, which is to forward the execution request to the custom query interface (i.e., the Task execution device 500); connectors connection information, each connection representing a timing sequence between tasks;
s503: analyzing the scheduling task parameters, and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters;
in practical application, the step parses DAG json, and encapsulates the DAG json into an encapsulation result, which includes a corresponding module list (a module list that needs to be introduced in current python), a Task list (including http type Task dependency and Task specific execution script), lines (timing dependency between tasks), and Dag (including Dag attributes and default parameters of all tasks, such as execution period and execution time);
s504: adopting template definition software matched with a target task scheduling system to define a packaging result and generate a task script corresponding to the directed acyclic graph;
in practical application, the target task scheduling system is realized based on Java language, the template definition software comprises Freemarker, at the moment, the Freemarker is used for defining python template files as task scripts, and the task scripts comprise: a module list, which contains the module introduced according to the current operation and also contains default added module; a Task list, http request operation and request self-defining query interface; the execution time of the current task is used for making a later query state; and (4) task timing relation.
In practical applications, the interface of the task script generating device may include a drawing interface and a displaying interface at the same time, or may display different interfaces under different functions, as shown in fig. 7 for a scene including the drawing interface and the displaying interface at the same time, or as shown in fig. 8 to 11 for a scene displaying different interfaces under different functions.
Specifically, as shown in fig. 7, the drawing interface may include some commonly used function options (such as save, open, create, and the like), or may include some commonly used graphics (such as a flow diagram, a judgment diagram, a selection diagram, and the like), and account options such as user login and the like, and based on such options, the user may draw the DAG graphics conveniently and quickly; the presentation interface may include some commonly used function options (e.g., export, save, etc.), and account options such as user login, etc., based on which the user may conveniently process the execution result of the DAG.
In order to ensure the validity of the task script, in practical applications, after the task script is generated, the method shown in fig. 5 further includes: and calling a script grammar checking rule of the target task scheduling system, checking the task script, and outputting the final task script when the checking is passed.
In practical application, because the custom query interface is in an asynchronous mode, in order to ensure that the requested task is executed after the task is really executed, a blocked request operation is added, and the task execution state of the custom interface is polled all the time; that is, the method shown in fig. 5 further includes: calling a blocking request operation, defining the blocking request operation and a packaging result simultaneously, and generating a task script; in this case, the task script includes: a module list, which contains the module introduced according to the current operation and also contains default added module; a Task list, http request operation and request self-defining query interface; the execution time of the current task is used for making a later query state; request operation is blocked, because the custom query interface is in an asynchronous mode, in order to ensure that a requested task is executed after the task is really executed, a blocked request operation is added, and the task execution state of the custom interface is polled all the time; and (4) task timing relation.
In practical application, in order for a user to know an execution result of the DAG in real time on the mobile terminal, as shown in fig. 3, the task script generating device provided by the present invention further includes a display module 35, where the display module 35 is configured to obtain the execution result of the task script fed back by the target task scheduling system, and display the execution result.
In order to apply the task script generation method provided by the invention, the invention provides a task scheduling method, which comprises the following steps:
by adopting the task script generating method provided by the invention, the corresponding task script is generated according to the drawing result of the directed acyclic graph drawing performed by the user on the drawing interface;
scheduling the task script according to the scheduling parameters of the directed acyclic graph; in practical application, after generating a python file according to a template, sending the python file to an airflowAPI interface of a task scheduling device by using a file stream, wherein the API is responsible for performing operations such as syntax verification, test and the like on the python script, and storing the task script and corresponding scheduling parameters when the verification is passed;
and executing the task script and displaying an execution result.
The above embodiments will now be described in detail with reference to fig. 8 to 11:
as shown in fig. 8, DAG1 includes task 1, task 2, and task 3, where task 1, task 2, and task 3 are all flow steps, and do not need to perform judgment/selection, and the dependency among task 1, task 2, and task 3 is to perform in sequence: executing task 1, outputting the execution result of task 1, executing task 2 on the execution result of task 1, outputting the execution result of task 2, executing task 3 on the execution result of task 2, and outputting the execution result of task 3; at this time, the process of the present invention,
the drawing result acquired in step S501 is shown in fig. 8;
the json data format output in step S502 includes "DAG information: name (name: DAG1), id (number: #1), argument (parameter: execute once per day 8: 00); node information: task 1, task 2, and task 3; connectors connection information: task 1, task 2, task 3 are executed in sequence ";
the encapsulation result output in step S503 includes a "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; lines: task 1, task 2 and task 3 are executed in sequence; dag: name: DAG1, id number: #1, alignment parameter: once per day 8:00 execution) ";
the task script output in step S504 is "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; execution time of the current task: 8:00 per day; blocking request operation: polling operation; the task time sequence relation is as follows: task 1, task 2, and task 3 are executed in sequence.
As shown in fig. 9, DAG2 includes task 1, task 2, and task 3, where task 1 and task 3 are both flow steps, task 2 is a determination step, and the dependency relationship among task 1, task 2, and task 3 is: executing the task 1, outputting an execution result of the task 1, executing the task 2 (judging) on the execution result of the task 1, and outputting an execution result of the task 2, if the execution result of the task 2 meets the condition, executing the task 3 on the execution result of the task 2, and outputting an execution result of the task 3, if the execution result of the task 2 does not meet the condition, executing the task 1 on the execution result of the task 2, and outputting the execution result of the task 1 until the execution result of the task 2 meets the condition; at this time, the process of the present invention,
the drawing result acquired in step S501 is shown in fig. 9;
the json data format output in step S502 includes "DAG information: name (name: DAG2), id (number: #2), argument (parameter: execute once per day 8: 00); node information: task 1, task 2, and task 3; connectors connection information: executing the task 1, outputting an execution result of the task 1, executing the task 2 (judging) on the execution result of the task 1, and outputting an execution result of the task 2, if the execution result of the task 2 meets the condition, executing the task 3 on the execution result of the task 2, and outputting an execution result of the task 3, if the execution result of the task 2 does not meet the condition, executing the task 1 on the execution result of the task 2, and outputting the execution result of the task 1 until the execution result of the task 2 meets the condition;
the encapsulation result output in step S503 includes a "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; lines: executing the task 1, outputting an execution result of the task 1, executing the task 2 (judging) on the execution result of the task 1, and outputting an execution result of the task 2, if the execution result of the task 2 meets the condition, executing the task 3 on the execution result of the task 2, and outputting an execution result of the task 3, if the execution result of the task 2 does not meet the condition, executing the task 1 on the execution result of the task 2, and outputting the execution result of the task 1 until the execution result of the task 2 meets the condition; dag includes name DAG2, id number #1, attribute executed 8:00 times per day;
the task script output in step S504 is "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; execution time of the current task: 8:00 per day; blocking request operation: polling operation; the task time sequence relation is as follows: executing the task 1, outputting an execution result of the task 1, executing (judging) the task 2 on the execution result of the task 1, and outputting the execution result of the task 2, executing the task 3 on the execution result of the task 2 if the execution result of the task 2 satisfies the condition, and outputting the execution result of the task 3, executing the task 1 on the execution result of the task 2 if the execution result of the task 2 does not satisfy the condition, and outputting the execution result of the task 1 until the execution result of the task 2 satisfies the condition ".
As shown in fig. 10, DAG3 includes task 1, task 2, and task 3, where task 1 is a selection step, task 2 and task 3 are both flow steps, and the dependencies among task 1, task 2, and task 3 are: executing the task 1, outputting an execution result of the task 1, if the execution result of the task 1 is the execution task 2, executing the task 2 on the execution result of the task 1, and outputting an execution result of the task 2, and if the execution result of the task 1 is the execution task 3, executing the task 3 on the execution result of the task 1, and outputting an execution result of the task 3; at this time, the process of the present invention,
the drawing result acquired in step S501 is shown in fig. 10;
the json data format output in step S502 includes "DAG information: name (name: DAG3), id (number: #3), argument (parameter: execute once per day 8: 00); node information: task 1, task 2, and task 3; connectors connection information: executing the task 1, outputting an execution result of the task 1, if the execution result of the task 1 is the execution task 2, executing the task 2 on the execution result of the task 1, and outputting an execution result of the task 2, and if the execution result of the task 1 is the execution task 3, executing the task 3 on the execution result of the task 1, and outputting an execution result of the task 3;
the encapsulation result output in step S503 includes a "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; lines: the task 2 and the task 3 are flow steps, and the dependency relationship among the task 1, the task 2 and the task 3 is as follows: executing the task 1, outputting an execution result of the task 1, if the execution result of the task 1 is the execution task 2, executing the task 2 on the execution result of the task 1, and outputting an execution result of the task 2, and if the execution result of the task 1 is the execution task 3, executing the task 3 on the execution result of the task 1, and outputting an execution result of the task 3; dag includes name DAG3, id number #3, attribute executed 8:00 times per day;
the task script output in step S504 is "module list: module 1, module 2, module 3, module 4; task List: script 1, script 2, script 3, script 4, script 5, and script 6; execution time of the current task: 8:00 per day; blocking request operation: polling operation; the task time sequence relation is as follows: the task 2 and the task 3 are flow steps, and the dependency relationship among the task 1, the task 2 and the task 3 is as follows: the task 1 is executed, the execution result of the task 1 is output, if the execution result of the task 1 is the execution task 2, the execution result of the task 1 is executed, the execution result of the task 2 is output, and if the execution result of the task 1 is the execution task 3, the execution result of the task 1 is executed, the execution result of the task 3 is output.
In summary, in the method for generating a task script provided in the embodiment of the present invention, a drawing interface is provided, a drawing result obtained by drawing a directed acyclic graph on the drawing interface is collected, a scheduling task parameter of the directed acyclic graph is generated according to the drawing result, the scheduling task parameter is analyzed, a packaging result is generated by packaging, a template definition software matched with a target task scheduling system is adopted to define the packaging result, and a task script corresponding to the directed acyclic graph is generated; in the whole process, a user only needs to perform simple drawing on the directed acyclic graph realized according to needs in the drawing interface, the task script generating device can generate the task script corresponding to the directed acyclic graph, the user operation is simple, script compiling is not needed, the requirement for the user to use the scheduling system is reduced, the user only needs to have basic drawing capacity, the problem that the user is difficult to use the scheduling system due to the fact that the user needs to manually compile the existing task script is solved, and the use experience of the user is enhanced.
As shown in fig. 6, a second embodiment of the task script generating method of the present invention is proposed, and in this embodiment, the task script generating method includes the following steps:
S601-S604: the method is the same as S501-S504 and is not described again;
s605: scheduling the task script according to the scheduling parameters of the directed acyclic graph;
in practical application, a task scheduling device triggers DAG execution on data such as big data 1 and big data 2 according to task parameters of each DAG, such as execution at 8:00 every day and the object of task processing is big data 1 and big data 2, and the like at 8:00 every day;
s606: executing the task script and displaying an execution result;
as shown in fig. 11, the display interface includes execution results including: the result of execution of task 1, the result of execution of task 2, and the result of execution of task 3.
The embodiment provides a task scheduling method, which includes the steps of providing a drawing interface, collecting a drawing result of drawing a directed acyclic graph on the drawing interface, generating scheduling task parameters of the directed acyclic graph according to the drawing result, analyzing the scheduling task parameters, packaging to generate a packaging result, defining the packaging result by adopting template definition software matched with a target task scheduling system, and generating a task script corresponding to the directed acyclic graph; in the whole process, a user only needs to perform simple drawing on the directed acyclic graph realized according to needs in the drawing interface, the task script generating device can generate the task script corresponding to the directed acyclic graph, the user operation is simple, script compiling is not needed, the requirement for the user to use the scheduling system is reduced, the user only needs to have basic drawing capacity, the problem that the user is difficult to use the scheduling system due to the fact that the user needs to manually compile the existing task script is solved, and the use experience of the user is enhanced.
The device collects a drawing result of drawing a directed acyclic graph on the drawing interface by providing the drawing interface, generates a scheduling task parameter of the directed acyclic graph according to the drawing result, analyzes the scheduling task parameter, packages the scheduling task parameter to generate a packaging result, defines the packaging result by adopting template definition software matched with a target task scheduling system, and generates a task script corresponding to the directed acyclic graph; in the whole process, a user only needs to perform simple drawing on the directed acyclic graph realized according to needs in the drawing interface, the task script generating device can generate the task script corresponding to the directed acyclic graph, the user operation is simple, script compiling is not needed, the requirement for the user to use the scheduling system is reduced, the user only needs to have basic drawing capacity, the problem that the user is difficult to use the scheduling system due to the fact that the user needs to manually compile the existing task script is solved, and the use experience of the user is enhanced.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A task script generating apparatus, comprising: an acquisition module, a processing module, a packaging module and an output module, wherein,
the acquisition module is used for providing a drawing interface and acquiring a drawing result of the directed acyclic graph drawing on the drawing interface;
the processing module is used for generating a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph;
the packaging module is used for analyzing the scheduling task parameters and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters;
and the output module is used for defining the packaging result by adopting template definition software matched with a target task scheduling system and generating a task script corresponding to the directed acyclic graph.
2. The task script generating device of claim 1, wherein the output module is further configured to invoke a script syntax checking rule of the target task scheduling system after the task script is generated, check the task script, and output a final task script when the check is passed.
3. The task script generating device according to claim 1, further comprising a presentation module, configured to obtain an execution result of the task script fed back by the target task scheduling system, and present the execution result.
4. The task script generating device according to any one of claims 1 to 3, wherein the output module is further configured to invoke a blocking request operation, define the blocking request operation simultaneously with the encapsulation result, and generate the task script.
5. A task scheduling system comprising task scheduling means, task execution means, and task script generating means according to claim 3, wherein,
the task script generating device is used for acquiring a drawing result of a user drawing a directed acyclic graph on a drawing interface and generating a corresponding task script;
the task scheduling device is used for scheduling the task script according to the scheduling parameters of the directed acyclic graph;
the task execution device is used for executing the task script and returning an execution result to the task script generation device;
the task script generating device is also used for displaying the execution result.
6. A task script generation method is characterized by comprising the following steps:
providing a drawing interface, and collecting a drawing result of drawing a directed acyclic graph on the drawing interface;
generating a scheduling task parameter of the directed acyclic graph according to the drawing result; the scheduling task parameters comprise description parameters, node parameters and node connection relations of the directed acyclic graph;
analyzing the scheduling task parameters, and packaging to generate a packaging result; the encapsulation result comprises a module list, a task list, thread parameters and directed acyclic graph parameters;
and defining the packaging result by adopting template definition software matched with a target task scheduling system to generate a task script corresponding to the directed acyclic graph.
7. The task script generation method of claim 6, further comprising, after generating the task script: and calling a script grammar checking rule of the target task scheduling system, checking the task script, and outputting a final task script when the checking is passed.
8. The task script generation method of claim 6, further comprising: and acquiring the execution result of the task script fed back by the target task scheduling system, and displaying the execution result.
9. The task script generation method of any one of claims 6 to 8, further comprising: and calling a blocking request operation, defining the blocking request operation and the packaging result simultaneously, and generating the task script.
10. A method for task scheduling, comprising:
the task script generation method according to claim 6 or 7 is adopted to generate the corresponding task script according to the drawing result of the directed acyclic graph drawing performed by the user on the drawing interface;
scheduling the task script according to the scheduling parameters of the directed acyclic graph;
and executing the task script and displaying an execution result.
CN201710370260.1A 2017-05-23 2017-05-23 Task script generation device and method, and task scheduling system and method Active CN107315581B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710370260.1A CN107315581B (en) 2017-05-23 2017-05-23 Task script generation device and method, and task scheduling system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710370260.1A CN107315581B (en) 2017-05-23 2017-05-23 Task script generation device and method, and task scheduling system and method

Publications (2)

Publication Number Publication Date
CN107315581A CN107315581A (en) 2017-11-03
CN107315581B true CN107315581B (en) 2020-09-11

Family

ID=60183515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710370260.1A Active CN107315581B (en) 2017-05-23 2017-05-23 Task script generation device and method, and task scheduling system and method

Country Status (1)

Country Link
CN (1) CN107315581B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213754B (en) * 2018-03-29 2020-02-28 北京九章云极科技有限公司 Data processing system and data processing method
CN108829502B (en) * 2018-06-21 2021-11-23 北京奇虎科技有限公司 Method and device for realizing thread operation
CN109726992B (en) * 2018-12-29 2021-05-18 北京百度网讯科技有限公司 Task completion time evaluation method and device
CN110175030A (en) * 2019-05-31 2019-08-27 福建南威软件有限公司 A kind of API service gateway processes method
CN110457064B (en) * 2019-07-16 2023-05-30 中盈优创资讯科技有限公司 Method and device for generating network cutover script
CN110471754B (en) * 2019-08-22 2022-04-05 中国工商银行股份有限公司 Data display method, device, equipment and storage medium in job scheduling
CN110764747A (en) * 2019-10-22 2020-02-07 南方电网科学研究院有限责任公司 Data calculation scheduling method based on Airflow
CN111984371A (en) * 2020-08-18 2020-11-24 济南浪潮高新科技投资发展有限公司 Flow arrangement service scheduling and publishing method
CN113468212A (en) * 2021-07-21 2021-10-01 华青融天(北京)软件股份有限公司 Event execution method and device and electronic equipment
CN117076095B (en) * 2023-10-16 2024-02-09 华芯巨数(杭州)微电子有限公司 Task scheduling method, system, electronic equipment and storage medium based on DAG

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101387958A (en) * 2008-10-20 2009-03-18 东软集团股份有限公司 Image data processing method and apparatus
US8266477B2 (en) * 2009-01-09 2012-09-11 Ca, Inc. System and method for modifying execution of scripts for a job scheduler using deontic logic
CN104361091A (en) * 2014-11-18 2015-02-18 浪潮(北京)电子信息产业有限公司 Big data system
CN104965754A (en) * 2015-03-31 2015-10-07 腾讯科技(深圳)有限公司 Task scheduling method and task scheduling apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9952899B2 (en) * 2014-10-09 2018-04-24 Google Llc Automatically generating execution sequences for workflows

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101387958A (en) * 2008-10-20 2009-03-18 东软集团股份有限公司 Image data processing method and apparatus
US8266477B2 (en) * 2009-01-09 2012-09-11 Ca, Inc. System and method for modifying execution of scripts for a job scheduler using deontic logic
CN104361091A (en) * 2014-11-18 2015-02-18 浪潮(北京)电子信息产业有限公司 Big data system
CN104965754A (en) * 2015-03-31 2015-10-07 腾讯科技(深圳)有限公司 Task scheduling method and task scheduling apparatus

Also Published As

Publication number Publication date
CN107315581A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
CN107315581B (en) Task script generation device and method, and task scheduling system and method
CN109358936B (en) Information processing method, device, storage medium, electronic device and system
US10754633B2 (en) Application installation package generation method and apparatus, and storage medium
CN105260301A (en) Visual effect comparison test device of user interfaces and realization method of visual effect comparison test device of user interfaces
CN112416613B (en) Application data processing method, device, equipment and medium
CN108549568B (en) Application entry processing method and device, storage medium and electronic equipment
CN104580499A (en) Method and device for accurately labeling positions
CN106528576B (en) Page search method, terminal, system and storage medium
CN105681561A (en) Advertisement blocking device and method
US9286054B2 (en) Deployment of mobile enterprise application platform
CN106657579B (en) Content sharing method and device and terminal
CN108763297B (en) Webpage resource processing method and device and mobile terminal
CN106547565B (en) Browser exception reporting method and system
CN108182090B (en) Flash plug-in loading method and device based on blink kernel
CN106502751B (en) Thermal deployment apparatus and method
CN106598844B (en) Mobile terminal and calculation method based on mobile terminal code defect rate
CN106776845B (en) Information flow self-adaptive management method and terminal
CN106507337B (en) FOTA upgrading device and method
CN106385494B (en) Method and device for acquiring dynamic home page of mobile terminal application
CN106055214B (en) The evaluation processing method and processing device of application software
CN109275038B (en) Game live broadcast method, terminal and computer readable storage medium
CN107170046B (en) Augmented reality device and augmented reality picture display method
CN105516467A (en) Page displaying method and mobile terminal
CN107066484B (en) Webpage link application device and method
CN114237926A (en) Multi-platform interaction method, device, equipment, storage medium and computer program product

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