Unlock instant, AI-driven research and patent intelligence for your innovation.

Redis-based timed task method and redis-based timed task system

A technology for timed tasks and tasks, applied in the direction of program startup/switching, program control design, instruments, etc., can solve the problems of low flexibility and insufficient time control flexibility, and achieve the utilization of system resources, simplification of task setting, and time Highly controllable effect

Inactive Publication Date: 2020-01-14
GUANGDONG EFLYCLOUD COMPUTING CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

To realize the timing task function, the traditional way is generally to use Crontab to set one or more timing tasks in the LINUX system. Large dimension or system-level setting tasks; 2. Insufficient flexibility of time control; 3. Need to configure in the LINUX system, so specific knowledge of the LINUX system is required

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Redis-based timed task method and redis-based timed task system
  • Redis-based timed task method and redis-based timed task system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0025] The present invention combines redis and mysql to design a timing task trigger method with high flexibility. Such as figure 1 As shown, the present invention provides a redis-based timing task method, and the timing task method is mainly divided into two situations, including a single task and a cyclic task; in the case of a single task, its specific timing task method steps are:

[0026] S11. Input script task path and script task parameters;

[0027] S12. Input the task type, and if the task type at this time is a single task, then input the execution time;

[0028] S13. Generate a globally unique task ID;

[0029] S14. Redis sets the task ID as the KEY value and the expiration time of the KEY;

[0030] S15. Mysql records the task ID, records the script task path and task parameters, and records the execution time; if the task type is a cyclic task, Mysql also needs to record the task execution time interval;

[0031] S16, after the expiry time of KEY expires, Red...

Embodiment 2

[0045] This embodiment provides a redis-based timing task system on the basis of a redis-based timing task method in Embodiment 1, which is characterized in that it includes an input module, a Redis setting module, a Mysql data module, a client, and a loop module ;

[0046] The input module is used to input script task path, script task parameters and task type; the task type includes single task and cyclic task; in the case of cyclic task, the input module is also used to input execution time; In the case of secondary tasks, the input module is also used to input the first execution time and task execution time interval;

[0047] The input module is also used to generate a globally unique task ID;

[0048] The Redis setting module is used to set the task ID as the expiration time of KEY value and KEY; after the expiration time of KEY expires, the Redis setting module is used to notify the client;

[0049] Described Mysql data module is used for recording task ID, script tas...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a redis-based timed task method and a redis-based timed task system. The timed task method comprises the following steps of: inputting a script task path and script task parameters; inputting a task type, and if the task type is a single task, inputting execution time; if the task type is a cyclic task, inputting first execution time and a task execution time interval; generating a globally unique task ID; enabling the Redis to set the task ID as a KEY value and the expiration time of the KEY; enabling Mysql to record a task ID, a script task path, a task parameter anda task execution time interval under the condition that the execution time has circulated the task; after the expiration time of the KEY is expired, informing the client by the Redis, and enabling theclient to obtain the task ID; and using the task ID to obtain a corresponding record in the Mysql so as to obtain a script task path and script task parameters, and executing the task. According to the method and the system, the flexibility and operability of the timed task are greatly improved, and one-time single-time execution tasks or cycle execution tasks are set for different scenes.

Description

technical field [0001] The invention relates to the technical field of script tasks in application systems, in particular to a redis-based timing task method and system thereof. Background technique [0002] In many application systems, it is often necessary to execute some script tasks regularly, such as regular message notification, commodity flash sales and other functional tasks. To realize the timing task function, the traditional way is generally to use Crontab to set one or more timing tasks in the LINUX system. Large dimension or system level setting task; 2. Insufficient flexibility of time control; 3. It needs to be configured in the LINUX system, so specific knowledge of the LINUX system is required. [0003] Based on the above situation, the present invention combines redis and mysql to design a timing task trigger method with high flexibility. Contents of the invention [0004] The technical problem to be solved by the present invention is to provide a redis...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06Q10/10G06F9/48
CPCG06F9/4837G06Q10/109
Inventor 招剑江史伟闵宇
Owner GUANGDONG EFLYCLOUD COMPUTING CO LTD