Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Delay task processing method and device, and equipment

A task processing and task technology, applied in the field of task processing, can solve problems such as large memory consumption, and achieve the effects of reducing consumption, facilitating distributed deployment, and facilitating horizontal expansion.

Active Publication Date: 2021-01-08
深圳市房多多网络科技有限公司
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In view of the above problems, the embodiments of the present invention provide a delayed task processing method, device, device and computer-readable storage medium, which are used to solve the problem of high memory consumption in the prior art

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
  • Delay task processing method and device, and equipment
  • Delay task processing method and device, and equipment
  • Delay task processing method and device, and equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0050] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the invention may be embodied in various forms and should not be limited to the embodiments set forth herein.

[0051] figure 1 A flow chart of a method for processing a delayed task provided by an embodiment of the present invention is shown, and the method is executed by a device that needs to process a delayed task, such as a server, a computer, a mobile phone, a tablet computer and other electronic devices. Such as figure 1 As shown, the method includes the following steps:

[0052] Step 110: setting task loading thread and task execution thread;

[0053]In this step, two processes are respectively set up for the loading and execution of the delayed task: the task loading thread and the task execution thread, so that the loa...

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 embodiment of the invention relates to the technical field of task processing, and discloses a delay task processing method and device, and equipment. The method comprises the steps of setting a task loading thread and a task execution thread; inserting the delay task into a database, wherein the database stores the task content and the execution time of the delay task; in the task loading thread, loading N delay tasks needing to be executed within the future time t1 into a memory ordered queue, and updating the next execution time of the delay tasks loaded into the memory ordered queue tobe second execution time, wherein the second execution time is equal to the sum of the execution time and t2, and t2 is larger than t1; and in the task execution thread, sequentially obtaining delaytasks according to the arrangement sequence of the delay tasks in the memory ordered queue, executing the delay tasks according to the execution time of the delay tasks, and deleting the delay tasks in the database after the delay tasks are successfully executed. By means of the mode, the memory consumption is reduced, and transverse expansion is facilitated.

Description

technical field [0001] The embodiments of the present invention relate to the technical field of task processing, and in particular to a delayed task processing method, device and equipment. Background technique [0002] At present, electronic devices such as computers or mobile terminals need to process a large number of tasks, including real-time tasks and delayed tasks. Delayed tasks mean that in business logic processing, some logic needs to be delayed, such as closing the live broadcast room over time, automatically canceling orders over time, sending SMS over time, etc. The tasks set for the above logic are delay tasks. [0003] In the prior art, most implementation schemes for delayed tasks are generally realized by using Redis sorted set or local time wheel algorithm. However, these methods consume a lot of memory when there are many tasks. Contents of the invention [0004] In view of the above problems, embodiments of the present invention provide a delayed tas...

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
IPC IPC(8): G06F9/50G06F9/48G06F9/54
CPCG06F9/485G06F9/4881G06F9/5016G06F9/5038G06F9/546G06F2209/548
Inventor 曾熙刘强
Owner 深圳市房多多网络科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products