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

Task scheduling method and device based on buffer queue and hash ring

A task scheduling and buffer queue technology, applied in the field of information systems, can solve the problem of difficult to achieve efficient scheduling of large-scale tasks, and achieve the effect of avoiding execution time accumulation, data skew, and load balancing.

Pending Publication Date: 2021-01-15
武汉物易云通网络科技有限公司
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

For task scheduling of this magnitude, if the current conventional methods are used to store a large number of tasks in the database, and then scan the database frequently to pull tasks that have reached the execution time, it will undoubtedly cause extreme damage to the database. High reading and writing pressure makes it difficult to efficiently schedule large batches of tasks

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
  • Task scheduling method and device based on buffer queue and hash ring
  • Task scheduling method and device based on buffer queue and hash ring
  • Task scheduling method and device based on buffer queue and hash ring

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0046] In order to solve the problem of scheduling large batches of tasks in the traditional solution, it is necessary to store all tasks in the database and then scan the database frequently to pull tasks that have reached the execution time, resulting in high read and write pressure on the database, and it is difficult to achieve high efficiency for large batches of tasks. To solve the technical problem of scheduling, the present invention provides a task scheduling method and device based on a buffer queue and a hash ring. Wherein, in order to facilitate the understanding of the task scheduling method, the embodiment of the present invention first introduces the task scheduling device.

[0047] Such as figure 1 As shown, the task scheduling device provided by the embodiment of the present invention mainly includes a task receiver and a task scheduler, and the task receiver is used to receive and store task information sent by the client, including task execution frequency, ...

Embodiment 2

[0069]On the basis of the above-mentioned embodiment 1, the embodiment of the present invention provides a task scheduling method based on buffer queues and hash rings, which can be completed by using the task scheduling device in embodiment 1, such as figure 2 As shown, it mainly includes the following steps:

[0070] Step 101 , after receiving the task scheduling information, the task receiver writes the task number and task end time into the local cache, and writes the task execution frequency and execution logic into the local buffer queue.

[0071] combine figure 1 , the specific implementation process is as follows: as the initiator of task scheduling and the provider of task information, the client will figure 1 The process shown in No. 1 in the figure continuously sends task scheduling information to the task receiver, mainly including execution frequency and execution logic, so as to initiate a task scheduling request. Among them, the execution frequency of the tas...

Embodiment 3

[0093] In combination with Embodiment 1 and Embodiment 2, the embodiment of the present invention takes the task receiver using the database as an external cache and setting a precision hash ring timer in the task scheduler as an example, and further provides a buffer queue and hash-based The specific implementation of the task scheduling method of the ring, such as Figure 5 As shown, it specifically includes the following steps:

[0094] Step 201, the task receiver receives the execution frequency and execution logic of the task to be scheduled from the client, such as figure 1 Shown in the process number 1.

[0095] Step 202, the task receiver writes the task number and task end time into the local cache A. Wherein, the task number is a unique number generated by the task receiver for the received task, and is set as key; the task end time is obtained when the client sends a request to stop the task to the task receiver, and is set as value; If the received task does not...

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 provides a task scheduling method and device based on a buffer queue and a hash ring, and the method comprises the steps that a task receiver writes a task number and task end time intoa local cache after receiving a task, and writes the execution frequency and execution logic of the task into the buffer queue; the task is pulled from the buffer queue at a fixed frequency by the timed pulling thread, and the task is put into a corresponding slot of a hash ring memory by a hash ring timer based on the execution frequency; the hash ring timer rotates an execution pointer of the hash ring memory at a fixed frequency, and takes out a task of which the execution time is up on a slot position pointed by the execution pointer; and the hash ring timer inquires the task receiver whether the extracted task is stopped or not, and if not, the execution logic of the task is distributed to the asynchronous executor to be executed. According to the scheme, a large number of tasks can be uniformly distributed in the hash ring memory, accumulation of execution time of the large number of tasks is avoided, load balancing is achieved, and the large number of tasks are efficiently scheduled through a machine CPU.

Description

【Technical field】 [0001] The present invention relates to the technical field of information systems, and more specifically, to a task scheduling method and device based on a buffer queue and a hash ring. 【Background technique】 [0002] At present, in many application scenarios, it is necessary to schedule a large number of tasks multiple times. For example, in the medium and long-distance transportation business, the geographic information system (Geographic Information System or Geo-Information system, GIS for short) platform needs to pull quasi-field data from the national vehicle Global Positioning System (Global Positioning System, GPS for short) big data platform Truck trajectories for monitoring and behavioral analysis of truck trajectories during loading and unloading. Usually, the GIS platform needs to monitor hundreds of thousands of vehicles, and the monitoring frequency varies according to the length of the vehicle's transportation distance. On average, the traj...

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): G06F9/48G06F9/50G06F16/22G06F16/2455
CPCG06F9/4806G06F9/505G06F9/5083G06F16/2255G06F16/24552Y02D10/00
Inventor 顾海
Owner 武汉物易云通网络科技有限公司