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

Request processing optimization method and computer readable storage medium

An optimization method and request processing technology, applied in the Internet field, can solve the problems of microservice request congestion, time-consuming, request failure, etc., and achieve the effect of reducing the probability of task execution failure, improving the execution success rate, and improving the request success rate.

Active Publication Date: 2020-01-07
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF6 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In fact, the interfaces provided by each microservice have an upper limit on the number of requests or resources. When the microservice request reaches the upper limit, or other special circumstances, such as machine resources or network jitter, etc., there will be microservices. At this time, the method adopted by the current existing system is generally to set a timeout period for processing, and when the timeout period is reached, the message will be discarded
Once congestion occurs, other requests will continue to be congested, resulting in the unavailability of the entire microservice system
Or a more advanced system, when this happens, the queue is used to store task messages. The queue is a first-in-first-out queue, and the advanced messages are processed first. Therefore, it will take a lot of time to process the late messages, which may cause The timeout was abandoned, causing the request to fail

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
  • Request processing optimization method and computer readable storage medium
  • Request processing optimization method and computer readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0035] Please refer to figure 2 , Embodiment 1 of the present invention is: an optimization method for request processing, which can be applied to a microservice architecture, and includes the following steps:

[0036] S1: Create a first-in first-out queue and a first-in last-out queue; that is, in the system content of the server, create two queues, namely the first-in first-out queue and the first-in last-out queue. The length of the queue can be set according to conditions such as memory size, preferably, the length of the queue is 1024.

[0037] S2: According to the preset cycle, detect the CPU usage rate of the device where the server is located, or obtain the total number of task messages processed within the cycle, and calculate the message processing speed. That is, the CPU resource occupancy is detected in each cycle to obtain the CPU occupancy rate of the current cycle; or at the end of the current cycle, the total number of task messages processed by the server in...

Embodiment 2

[0052] This embodiment is a computer-readable storage medium corresponding to the above-mentioned embodiments, on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented:

[0053] Create first-in-first-out queues and first-in-last-out queues;

[0054] When the server has a request timeout or reaches the upper limit of the number of task processing, obtain the CPU usage or message processing speed of the device where the server is located;

[0055] If the CPU occupancy rate does not reach a preset first threshold or the message processing speed reaches a preset second threshold, write the received task message into the first-in-first-out queue;

[0056] If the CPU usage rate reaches a preset first threshold or the message processing speed does not reach a preset second threshold, write the received task message into the first-in-last-out queue.

[0057] Further, before acquiring the CPU usage rate or message proc...

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 request processing optimization method and a computer readable storage medium. The method comprises the following steps: creating a first-in first-out queue and a first-in second-out queue; when the server has a request timeout condition or reaches an upper limit of a task processing quantity, obtaining a CPU occupancy rate or a message processing speed of equipment wherethe server is located; if the CPU occupancy rate does not reach a preset first threshold value or the message processing speed reaches a preset second threshold value, writing the received task message into the first-in first-out queue; and if the CPU occupancy rate reaches a preset first threshold or the message processing speed does not reach a preset second threshold, writing the received taskmessage into the first-in last-out queue. The request success rate can be improved.

Description

technical field [0001] The invention relates to the technical field of the Internet, in particular to a request processing optimization method and a computer-readable storage medium. Background technique [0002] In many projects, there are two parts, the client and the server, and the server actually has many different architecture implementation methods, one of which is the microservice architecture method, which is mainly reflected in the request access between the gateway and the microservice and Aggregation interface and other operations. [0003] The implementation of the above architecture is mainly the gateway calls microservices, and the mutual calls between microservices. In fact, the interfaces provided by each microservice have an upper limit on the number of requests or resources. When the microservice request reaches the upper limit, or other special circumstances, such as machine resources or network jitter, etc., there will be microservices. At this time, t...

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/50G06F9/54
CPCG06F9/5027G06F9/546G06F2209/548Y02D10/00
Inventor 刘德建林伟郭玉湖
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
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