CN106201672B - Timed task setting system and timed task running method thereof - Google Patents
Timed task setting system and timed task running method thereof Download PDFInfo
- Publication number
- CN106201672B CN106201672B CN201610460173.0A CN201610460173A CN106201672B CN 106201672 B CN106201672 B CN 106201672B CN 201610460173 A CN201610460173 A CN 201610460173A CN 106201672 B CN106201672 B CN 106201672B
- Authority
- CN
- China
- Prior art keywords
- task
- timing
- scheduling platform
- timed
- tasks
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 14
- 238000012544 monitoring process Methods 0.000 claims description 9
- 238000011017 operating method Methods 0.000 claims description 4
- 230000001413 cellular effect Effects 0.000 claims 1
- 238000012423 maintenance Methods 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000003203 everyday effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
Abstract
The invention belongs to the technical field of internet, and discloses a timing task setting system, which comprises a task scheduling platform, wherein the task scheduling platform is an independent system service process and does not depend on other external containers; the task scheduling platform is provided with a runtime environment, can be directly installed and run on any linux or windows operating system, and is not limited by the operating system; the task scheduling platform is used for adding or deleting the timing tasks, checking all the timing tasks on the task scheduling platform and performing related configuration on the timing tasks. The timing setting system can run independently, does not depend on other external windows and is not limited by an operating system, and can add, delete, check and configure the timing tasks in a centralized manner in the task scheduling platform, thereby solving the technical problem that the timing tasks are inconvenient to manage in the prior art. The invention also provides a timing task running method based on the timing setting system.
Description
Technical Field
The invention belongs to the technical field of internet, and particularly relates to a timed task setting system and a timed task running method thereof.
Background
Linux is a Unix-like operating system which is free to use and spread freely, and is a multi-user, multi-task, multi-thread and multi-CPU supporting operating system based on POSIX and UNIX. crontab: the crontab command is commonly found in Unix and Unix-like operating systems and is used to set instructions that are executed periodically. At present, all timing tasks are triggered and executed by using crontab under Linux, and the following defects exist in the mode of operation: the timing task programs are dispersed in each directory, so that centralized management and maintenance are inconvenient; the temporary pause timing trigger needs to log on a production environment server, which is not only cumbersome but also unsafe.
Disclosure of Invention
In view of the above drawbacks or needs for improvement in the prior art, the present invention provides a timed task setting system and a timed task operating method thereof, which aim to operate independently, add, delete, view, and configure timed tasks without relying on other external windows and without being limited by an operating system, thereby solving the technical problem of inconvenient management of timed tasks in the prior art.
To achieve the above object, according to an aspect of the present invention, there is provided a timed task setting system, including a task scheduling platform, the task scheduling platform being an independent system service process; the task scheduling platform is provided with a runtime environment; the task scheduling platform is used for adding or deleting the timing tasks, or checking all the timing tasks on the task scheduling platform, or performing related configuration on the timing tasks.
In an embodiment of the present invention, the task scheduling platform includes a WEB console, and the WEB console is configured to enable a user to access the WEB console through a browser, add or delete a timing task, or view all timing tasks on the task scheduling platform, or perform related configuration on the timing task.
In an embodiment of the present invention, the task scheduling platform includes an HTTP interface, and the HTTP interface is used for enabling a user to access the task scheduling platform through an HTTP command, add or delete a timing task, or view all timing tasks on the task scheduling platform, or perform related configuration on the timing task.
In an embodiment of the present invention, the task scheduling platform includes a log module, and the log module is configured to collect log information output by all timed tasks and collect the log information to a preset unified location; and for the user to browse, search and download the task log information through a browser or HTTP interface.
In an embodiment of the present invention, the task scheduling platform includes a monitoring module, and the monitoring module is configured to monitor runtime states of all timing tasks, and record CPU, memory, and network bandwidth resources consumed by the timing tasks.
In an embodiment of the present invention, the task scheduling platform includes an alarm module, and the alarm module is configured to obtain runtime information of the timing task from the monitoring module, and trigger an alarm when a data value of the runtime information exceeds a preset alarm threshold.
In an embodiment of the present invention, the alarm is sent to the specific task responsible person through one or more of email, short message service, WeChat, and voice service.
According to another aspect of the present invention, there is also provided a timed task operating method based on the above timed task setting system, including:
a user writes a timing task and submits the timing task to a task scheduling platform through a WEB console or an HTTP interface, wherein the timing task at least comprises a task name and task trigger time;
when the task triggering time is reached, the timing task starts to run;
if the timing task is successfully executed, ending the process; and if the timing task is not successfully executed, the timing task runs again until the execution is successful.
In one embodiment of the invention, if the timed task reaches the upper limit of the number of failed retries and is not successfully executed, an alarm is sent out.
In an embodiment of the present invention, after the timed task is submitted to the task scheduling platform, the timed task is also checked through a WEB console or an HTTP interface, or the timed task is configured in a related manner, or the timed task is deleted.
The timing task setting system provided by the embodiment of the invention can run independently, does not depend on other external windows and is not limited by an operating system, can intensively add, delete, check and configure the timing tasks in the task scheduling platform, and solves the technical problem that the timing tasks are inconvenient to manage in the prior art. Furthermore, the timing task codes are managed in a centralized mode, and maintenance is facilitated; setting a task re-execution flow when the task fails to be executed, so that the task can be automatically retried; and when the task fails for many times, the task executor receives the alarm notice and does not need to manually check whether the task normally runs or not every day.
Drawings
FIG. 1 is a schematic structural diagram of a timed task setting system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another timing task setting system according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for running a timed task according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The invention provides a timing task setting system, which comprises a task scheduling platform, wherein the task scheduling platform is an independent system service process and does not depend on other external containers (such as tomcat/jboss and the like); the task scheduling platform is provided with a runtime environment, can be directly installed and run on any linux or windows operating system, and is not limited by the operating system; the task scheduling platform is used for adding or deleting the timing tasks, checking all the timing tasks on the task scheduling platform and performing related configuration on the timing tasks.
As shown in fig. 1, for a structure of a timing task setting system in an embodiment of the present invention, the task scheduling platform 1 includes a WEB console 11, and a user can access the WEB console 11 through a browser, perform addition or deletion operations on timing tasks, view all timing tasks on the task scheduling platform, and perform relevant configuration on the timing tasks.
Or as shown in fig. 1, the task scheduling platform 1 may further include an HTTP interface 12, and a user may access the task scheduling platform through the HTTP interface 12, perform an addition or deletion operation on the timing task, view all timing tasks on the task scheduling platform, and perform related configuration on the timing task. The HTTP interface 12 can be regarded as a non-graphical interface version of the WEB console, and when the network condition is bad and a browser failure cannot enter the WEB console 11, the user can perform all operations through the HTTP interface 12. The user can also perform system integration more conveniently through the HTTP interface 12.
Further, as shown in fig. 2, the task scheduling platform 1 may further include a log module 13, where the log module 13 is configured to collect log information output by all timed tasks and collect the log information to a preset unified location; the user may also browse, search, and download task log information through a browser or HTTP interface 12. The logging module 13 facilitates log queries.
Further, as shown in fig. 2, the task scheduling platform 1 may further include a monitoring module 14, where the monitoring module 14 is configured to monitor runtime states of all timing tasks, and record CPU, memory, and network bandwidth resources consumed by the timing tasks. The consumed data such as CPU, memory and network bandwidth resources can be acquired through the HTTP interface, and a user can observe all states of the task through the browser.
Further, as shown in fig. 2, the task scheduling platform 1 may further include an alarm module 15, where the alarm module 15 is configured to obtain runtime information of the timing task from the monitoring module, and trigger an alarm when a data value of the runtime information exceeds a preset alarm threshold.
Specifically, the alarm may be sent to the specific task person in one or more ways of email, short message service, WeChat, and voice service. It should be noted that the above-mentioned alarm path may be configured arbitrarily.
And setting the alarm threshold as user input, and configuring the alarm threshold of the task through the WEB console by the user, for example, the alarm threshold may be generally set for 3 times.
The timing task setting system provided by the embodiment of the invention can run independently, does not depend on other external windows and is not limited by an operating system, can intensively add, delete, check and configure the timing tasks in the task scheduling platform, and solves the technical problem that the timing tasks are inconvenient to manage in the prior art. Furthermore, the timing task codes are managed in a centralized mode, and maintenance is facilitated; setting a task re-execution flow when the task fails to be executed, so that the task can be automatically retried; and when the task fails for many times, the task executor receives the alarm notice and does not need to manually check whether the task normally runs or not every day.
Further, as shown in fig. 3, the present invention also provides a timed task operating method based on the timed task setting system, including:
s1, a user writes a timing task and submits the timing task to a task scheduling platform through a WEB console or an HTTP interface, wherein the timing task at least comprises a task name and task trigger time; the timing task is written by a user, is not limited by a programming language, and can also be a section of script code;
in particular, the timed task system may provide a class of programming interfaces that are responsible for interfacing to specific tasks. After the specific task class is inherited to the class, the specific task class can be scanned by a timing task system;
configuring the written specific tasks into a timing task setting system, specifically, adding tasks by using a WEB console provided by the timing task setting system, wherein the following information needs to be filled:
task class name: the timing task setting system finds out the corresponding task class through the class path of the program;
task trigger period: a cron expression is required to be filled in the item, and the timing task setting system calculates a task trigger period through the expression;
number of failed retries: the number of retries to execute the task when the task fails to execute;
whether to enable: if the task is enabled, the task is triggered in the enabled state.
S2, when the task trigger time is reached, the timing task starts to run;
and when the task triggering time is reached, the timing task setting system judges whether the task is in a starting state. And starting the task if the task is in the enabled state, and directly jumping to the task ending state if the task is not in the enabled state. Specifically, the start task calls the specific task class in step S1 to start executing the task code.
S3, if the timing task is executed successfully, ending the process; and if the timing task is not successfully executed, the timing task runs again until the execution is successful. And sending an alarm if the timed task reaches the upper limit of the number of the failed retries and is not successfully executed.
When an exception occurs during task execution, the timed task framework captures the exception and enters retry logic.
In step S1, we set "number of failed retries" for the task. When a task is triggered and starts to execute, the timing task framework initializes a variable of 'retried times' to be 0, when the task enters execution failure and 'retried times' < 'failure retry times', the task starts to be executed again, and the 'retried times' +1 is carried out before the task is executed again; and when the retry times are larger than the retry time, canceling the retry, judging that the task execution fails, and entering an alarm stage. When the task enters an alarm stage, the alarm module sends out error information of the task in the modes of email, short message and the like.
Further, after the timed task is submitted to the task scheduling platform, the timed task may be checked through a WEB console or an HTTP interface, or relevant configuration may be performed on the timed task (for example, a task name, a task trigger time, a remark, and the like is modified), or the timed task is deleted.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (8)
1. A timing task setting system is characterized by comprising a task scheduling platform, wherein the task scheduling platform is an independent system service process; the task scheduling platform is provided with a runtime environment, can be directly installed and run on any linux or windows operating system, and is not limited by the operating system; the task scheduling platform is used for adding or deleting the timing tasks, or checking all the timing tasks on the task scheduling platform, or performing related configuration on the timing tasks; the timing task scheduling platform is also used for independently running the timing task on the task scheduling platform when the timing task trigger time is reached; the task scheduling platform comprises a WEB console and/or an HTTP interface, the WEB console is used for enabling a user to add or delete a timing task through a browser, or check all timing tasks on the task scheduling platform, or perform related configuration on the timing task, and the HTTP interface is used for enabling the user to access the task scheduling platform through an HTTP command, add or delete the timing task, or check all timing tasks on the task scheduling platform, or perform related configuration on the timing task.
2. The timed task setting system according to claim 1, wherein the task scheduling platform includes a log module, and the log module is configured to collect log information output by all timed tasks and collect the log information to a preset unified location; and for the user to browse, search and download the task log information through a browser or HTTP interface.
3. The timed task setting system according to claim 1, wherein the task scheduling platform includes a monitoring module, and the monitoring module is configured to monitor runtime states of all timed tasks and record CPU, memory, and network bandwidth resources consumed by the timed tasks.
4. The timed task setting system according to claim 1, wherein the task scheduling platform comprises an alarm module, and the alarm module is configured to obtain runtime information of the timed task from the monitoring module, and trigger an alarm when a data value of the runtime information exceeds a preset alarm threshold.
5. The timed task setting system according to claim 4, wherein the alarm is sent to the specific task person in charge by one or more of email, sms, wechat, and voice over cellular.
6. The timed task operation method of the timed task setting system according to any one of claims 1 to 5, comprising:
a user writes a timing task and submits the timing task to a task scheduling platform through a WEB console or an HTTP interface, wherein the timing task at least comprises a task name and task trigger time;
when the task triggering time is reached, the timing task starts to run;
if the timing task is successfully executed, ending the process; and if the timing task is not successfully executed, the timing task runs again until the execution is successful.
7. The timed task operating method according to claim 6, characterized in that if the timed task reaches the upper limit of the number of failed retries and is not successfully executed, an alarm is issued.
8. The method for running the timed task according to claim 6, wherein after the timed task is submitted to the task scheduling platform, the timed task is also checked through a WEB console or an HTTP interface, or the timed task is configured in a related manner, or the timed task is deleted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610460173.0A CN106201672B (en) | 2016-06-22 | 2016-06-22 | Timed task setting system and timed task running method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610460173.0A CN106201672B (en) | 2016-06-22 | 2016-06-22 | Timed task setting system and timed task running method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106201672A CN106201672A (en) | 2016-12-07 |
CN106201672B true CN106201672B (en) | 2020-05-12 |
Family
ID=57460765
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610460173.0A Active CN106201672B (en) | 2016-06-22 | 2016-06-22 | Timed task setting system and timed task running method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106201672B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106802825B (en) * | 2016-12-09 | 2019-11-05 | 南京邮电大学 | A kind of dynamic task scheduling method and system based on real-time system |
CN108255596A (en) * | 2016-12-28 | 2018-07-06 | 福建省天奕网络科技有限公司 | A kind of method and system for performing timed task |
CN107168723A (en) * | 2017-03-29 | 2017-09-15 | 武汉斗鱼网络科技有限公司 | The implementation method and device of plan target |
CN109218507A (en) * | 2017-07-03 | 2019-01-15 | 阿里巴巴集团控股有限公司 | The methods, devices and systems of task execution |
CN107623745A (en) * | 2017-10-12 | 2018-01-23 | 郑州市景安网络科技股份有限公司 | A kind of monitoring method, system and computer-readable recording medium |
CN108182108A (en) * | 2017-12-19 | 2018-06-19 | 山东浪潮商用系统有限公司 | A kind of timed task cluster and its execution method |
CN108345497A (en) * | 2018-01-17 | 2018-07-31 | 千寻位置网络有限公司 | GNSS positions execution method and system, the positioning device of simulation offline |
CN109597681A (en) * | 2018-10-22 | 2019-04-09 | 平安科技(深圳)有限公司 | Cloud control method, device, computer equipment and storage medium |
CN109542598B (en) * | 2018-11-08 | 2021-03-16 | 泰康保险集团股份有限公司 | Timed task management method and device |
CN110362613A (en) * | 2019-07-22 | 2019-10-22 | 中国联合网络通信集团有限公司 | Data processing method and equipment |
CN110569120B (en) * | 2019-09-11 | 2022-03-04 | 华云数据控股集团有限公司 | Processing method and device for timing task |
CN111475272A (en) * | 2020-04-07 | 2020-07-31 | 四川虹美智能科技有限公司 | Method and device for controlling Java Web application timing task and task scheduling platform |
CN112463348B (en) * | 2021-01-27 | 2021-06-15 | 北京搜狐新媒体信息技术有限公司 | Timed task processing method and device |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101604242A (en) * | 2009-07-17 | 2009-12-16 | 深圳市珍爱网信息技术有限公司 | Realize the system of timed task in the Java application system |
US9171068B2 (en) * | 2012-03-07 | 2015-10-27 | Ut-Battelle, Llc | Recommending personally interested contents by text mining, filtering, and interfaces |
US20140013196A1 (en) * | 2012-07-09 | 2014-01-09 | Mobitude, LLC, a Delaware LLC | On-screen alert during content playback |
CN104156265A (en) * | 2014-08-08 | 2014-11-19 | 乐得科技有限公司 | Timed task processing method and processing device |
CN104268015B (en) * | 2014-09-05 | 2017-08-01 | 烽火通信科技股份有限公司 | The implementation method and timer of embedded device high availability timer |
CN105138598B (en) * | 2015-08-05 | 2018-11-09 | 深圳联友科技有限公司 | The method and system of remote timing task |
CN105224401A (en) * | 2015-09-08 | 2016-01-06 | 深圳市永兴元科技有限公司 | Scheduled task control method and device |
-
2016
- 2016-06-22 CN CN201610460173.0A patent/CN106201672B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106201672A (en) | 2016-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106201672B (en) | Timed task setting system and timed task running method thereof | |
US8412984B2 (en) | Debugging in a cluster processing network | |
CN108399132B (en) | Scheduling test method, device and storage medium | |
US9485151B2 (en) | Centralized system management on endpoints of a distributed data processing system | |
US20150100829A1 (en) | Method and system for selecting and executing test scripts | |
US20150100832A1 (en) | Method and system for selecting and executing test scripts | |
CN111416821A (en) | Internet of things equipment information acquisition method, system and device | |
CN108804215B (en) | Task processing method and device and electronic equipment | |
CN107832230B (en) | Test method, equipment and system based on data tuning | |
US20150100830A1 (en) | Method and system for selecting and executing test scripts | |
US20150100831A1 (en) | Method and system for selecting and executing test scripts | |
CA2904253C (en) | Computer system using in-service software upgrade | |
CN111324522A (en) | Automatic test system and method | |
WO2022227454A1 (en) | Automated testing system and method for continuous integration, and electronic device and storage medium | |
CN113326107A (en) | Kubernetes cluster-based periodic task scheduling method and electronic equipment | |
US20230126437A1 (en) | Service processing method and apparatus, electronic device, and storage medium | |
WO2023231704A1 (en) | Algorithm running method, apparatus and device, and storage medium | |
CN113157426B (en) | Task scheduling method, system, equipment and storage medium | |
CN112379989B (en) | Timed task process and queue service process management system and method | |
CN114090198A (en) | Distributed task scheduling method and device, electronic equipment and storage medium | |
US7984335B2 (en) | Test amplification for datacenter applications via model checking | |
CN116149829A (en) | Task management method, device, equipment and storage medium | |
US10684889B2 (en) | Systems, methods, and computer program products for scheduling processing jobs to run in a computer system | |
CN115454860A (en) | Automatic testing method and device, storage medium and electronic equipment | |
CN112596750B (en) | Application testing method and device, electronic equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240115 Address after: Room 0416, Unit 1, Building 1, Yicuiyuan iDuhui, No. 11 Tangyan South Road, High tech Zone, Xi'an City, Shaanxi Province, 710000 Patentee after: Xi'an Nuochengda Information Technology Co.,Ltd. Address before: 430000 Wuhan Donghu Development Zone, Wuhan, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd. |
|
TR01 | Transfer of patent right |