Queue timeout processing method in request task processing and storage medium

A technology of task processing and processing methods, applied in the field of request task processing, which can solve problems such as timeout, application system unavailability, resource waste, etc.

Pending Publication Date: 2020-10-30
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF0 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In this scenario, it will lead to a waste of resources. In a more serious scenario, the tasks in the cache queue are all expired tasks, and the idle thread will always pr

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
  • Queue timeout processing method in request task processing and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0063] This embodiment provides an optimized processing method for queue timeout when requesting task processing, which may include the following steps:

[0064] S1: Set the timeout period corresponding to each type of interface.

[0065] For all interfaces in the system, it is necessary to set the interface timeout time. In order to improve the setting efficiency, the classification types are set uniformly. Specifically, it is assumed that there are three types of interfaces in the system: A, B, and C; among them, type A is a key guarantee interface, and the corresponding timeout period is set to a second; type B is a general interface, and the corresponding timeout period is set to b seconds; for other interfaces of class C, set the corresponding timeout period to c seconds, where a>b>c, such as 20, 15 and 10 seconds respectively.

[0066] In an example, the timeout period of each interface is stored in the redis cache to complete the setting. The storage method is the da...

Embodiment corresponding Embodiment 1

[0081] This embodiment corresponds to Embodiment 1, and provides a specific application scenario:

[0082] 1. In a certain business system, there are 3 interfaces to provide external services, namely the interface for obtaining user information (interface A), the interface for obtaining avatar information (interface B) and the interface for obtaining session information (interface C). According to the importance, it can be understood that interface A is the most important, and its timeout period is set to 20 seconds; the importance of interface B is average, and the timeout period is set to 15 seconds; interface C is a non-key interface, and the timeout period is 10 seconds.

[0083] Suppose the relative path address of interface A is / v1.1 / getUserInfo; the relative path address of interface B is / v1.1 / getIconInfo; the relative path address of interface C is / v1.1 / getSessionInfo.

[0084] 2. When the project starts, it will automatically set the timeout time of each interface ...

Embodiment 3

[0096] This embodiment corresponds to Embodiment 1 and Embodiment 2, and provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it can implement the above-mentioned embodiment 1 or embodiment 2. The steps included in the queue timeout processing method in the request task processing. The specific steps will not be repeated here, please refer to the description of Embodiment 1 and Embodiment 2 for details.

[0097] In summary, the processing method and storage medium for queue timeout in request task processing provided by the present invention can clear expired and invalid tasks in time, save valuable resources, and improve interface response efficiency; the storage mode in the cache helps to improve query efficiency , and more conducive to management; in addition, it also has the characteristics of simple implementation, low cost and remarkable effect.

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 queue timeout processing method in request task processing and a storage medium. The method comprises the steps of setting timeout time corresponding to various types of interfaces; obtaining a response time threshold of the system interface; acquiring consumed time according to a time point when a request task enters and exits the queue; if the time consumption time is greater than the response time threshold and the time consumption time is greater than the timeout time of the interface corresponding to the request task, giving up the request task. According to the method, expired invalid tasks can be cleared in time, precious resources are saved, and the interface response efficiency is improved; the storage mode in the cache is favorable for improving the queryefficiency and is more favorable for management; in addition, the method has the characteristics of simple and feasible implementation, low cost, remarkable effect and the like.

Description

technical field [0001] The invention relates to the field of request task processing, in particular to a processing method and a storage medium for queue timeout in request task processing. Background technique [0002] Today, with the vigorous development of the mobile Internet, a variety of system applications have been developed, and there are various data interactions between systems. There are various ways of data interaction, such as data access through the interface, interactive access directly through the database, message communication through MQ, or other methods. Nowadays, the http protocol or RPC is often used to call the interface for data interaction, which is the most common way in the Internet scene. Using this method can quickly perform multi-system data interaction and improve efficiency. However, due to various factors such as complex network conditions or the instability of the other party's system, there is a problem of timeout when using this interfac...

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/54G06F9/48
CPCG06F9/546G06F9/485Y02D10/00
Inventor 刘德建林伟郭玉湖陈宏
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products