Font Size: a A A

The Design And Implementation Of The Support Framework For Detecting The Anomaly Requests Asynchronously

Posted on:2022-06-28Degree:MasterType:Thesis
Country:ChinaCandidate:X LiFull Text:PDF
GTID:2518306725984249Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
In the Internet company,the iteration speed of software development is fast,and the changes of multiple features need to be completed in a short iteration period and the work need to be done between multiple departments.The urgency of the development task and the complexity of communication and coordination may lead to some hidden errors in the iterative system.These errors are often reflected in anomaly requests,such as the the null value in the response body of the request,and the returned results of the paging request are out of range.If they cannot be found and resolved in time,companies are often subject to significant reputational or economic losses.By introducing standard,strict code review,testing and deployment process into the development process,the number of anomaly requests can be reduced to a certain extent.However,anomaly request can never be eliminated.Therefore,a backtracking scheme is needed to detect anomaly requests in time,so that the problem can be found and solved in time to reduce the loss of the company.There are two kinds of anomaly request detection schemes,one is to check the request synchronously in the business project; One is to configure the alarm threshold for the number of calls,consumed time and success rate of the interface based on the data of the company's existing request monitoring platform.Both schemes have their limitations.The first one couples the detection logic with the business logic and executes the detection code synchronously with the business code.In order to not affect the performance of business projects,complex and time-consuming detection operations need to be avoided.Only single request can be detected once,which is difficult to complete the comparison with historical data and to detect the overall requests in an interval; The second scheme can only detect the established indicators of the monitoring platform,and cannot complete the detection of request content such as request header,request body and response body.This thesis designs and implements the anomaly request detection system based on Spring framework,which solves the defects of the two detection schemes above.The system is mainly divided into request recording module,detection rule management module,detection rule configuration module and detection execution module.The request recording module is responsible for obtaining the complete request data of the business project and transferring it to the detection and execution module; The detection rule management module is responsible for managing the predefined or businessdefined detection rules; The detection rule configuration module is responsible for providing the interface to configure the mapping relationship between the detection rules and the business interface; The detection execution module is responsible for obtaining and checking the request data acquired from the request recording module according to the configuration of the detection configuration module.The main work of this thesis is as follows.(1)In view of the problem that synchronous detection logic and business logic are tightly coupled and the request monitoring platform cannot detect request content in depth.The request recording module designed in this thesis needs to be introduced into business project.It can use the filter chain of web application to intercept the request header,request body and response body of requests and then combine and transfer the data into the messaging queue for asynchronous detection.(2)In view of the changing requirements of detection rules and the need for continuous updating,this thesis designs a detection rule configuration module,which provides a front end for the business party to associate the business interface with the detection rules.The detection execution module will monitor the configuration in real time and detect the requests according to the latest configuration.(3)In view of the increasing number of business interfaces,the detection capability of the detection execution module needs to be able to expand horizontally according to the number of interfaces.Therefore,this paper designed a task distribution and scheduling system based on Zookeeper to assign all interval detection tasks to multiple worker instances one by one.
Keywords/Search Tags:Request recording, Asynchronous detection, Detection of request content, Distributed task assigning system
PDF Full Text Request
Related items