CN112783451A - Time-consuming abnormity analysis method and system based on interceptor and storage medium - Google Patents

Time-consuming abnormity analysis method and system based on interceptor and storage medium Download PDF

Info

Publication number
CN112783451A
CN112783451A CN202110090500.9A CN202110090500A CN112783451A CN 112783451 A CN112783451 A CN 112783451A CN 202110090500 A CN202110090500 A CN 202110090500A CN 112783451 A CN112783451 A CN 112783451A
Authority
CN
China
Prior art keywords
time
interceptor
consuming
path
log
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110090500.9A
Other languages
Chinese (zh)
Inventor
李辉
李林
张晖
元宇
查自强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202110090500.9A priority Critical patent/CN112783451A/en
Publication of CN112783451A publication Critical patent/CN112783451A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/121Facilitating exception or error detection and recovery, e.g. fault, media or consumables depleted
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1229Printer resources management or printer maintenance, e.g. device status, power levels
    • G06F3/1234Errors handling and recovery, e.g. reprinting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1273Print job history, e.g. logging, accounting, tracking

Abstract

The invention discloses a time-consuming abnormity analysis method and system based on an interceptor and a storage medium. The method comprises the steps that by receiving a front-end request message, a controller layer interceptor acquires a url list to determine whether to intercept; if the interception is needed, adding the url address of the front-end request message into the thread, marking the url address, then forwarding the Service layer interceptor, and printing a time-consuming log; the Service layer interceptor judges that if the local exists, the time-consuming log is printed, and an external calling interceptor is forwarded; the external calling interceptor judges that if the local exists, the time-consuming log is printed, and the DAO interceptor is forwarded; the DAO interceptor judges that the thread is printed with a time-consuming log if the thread has a mark; and determining the method serial number with the abnormality according to the path serial number and the time consumption value. And then the problems that the printing log quantity is large and the abnormal time-consuming point analysis cannot be accurately positioned in the related technology are solved, and the technical effects of improving the effective printing efficiency and accurately positioning the abnormal points are achieved.

Description

Time-consuming abnormity analysis method and system based on interceptor and storage medium
Technical Field
The invention relates to the technical field of exception positioning, in particular to a time-consuming exception analysis method and system based on an interceptor and a storage medium.
Background
When a service which consumes a long time exists in the system, a specific consumption time point needs to be analyzed. In the prior art, the time consumption point is analyzed by combining system codes after the parameters and time consumption of each layer printing method are printed.
However, the prior art method has some defects, such as that all services are intercepted and logged, and the logging amount is large. In addition, the call link cannot be seen in the printed log, and the abnormal time consumption point needs to be analyzed according to the code, so that the workload is large. The problems are even more pronounced when there is no familiarity with the code logic, the code is long and complex, or there are many services that need to be analyzed.
Aiming at the problems that the printing log quantity is large and the abnormal time-consuming point analysis cannot be accurately positioned in the related technology, a better solution scheme does not exist.
Disclosure of Invention
The embodiment of the invention provides a time-consuming abnormity analysis method and system based on an interceptor and a storage medium, which are used for at least solving the technical problems that the printing log quantity is large and the analysis of calling an abnormal time-consuming point cannot be accurately positioned in the related technology.
According to an aspect of the embodiments of the present invention, there is provided a method for analyzing a time-consuming exception based on an interceptor, including:
after receiving the front-end request message, the controller layer interceptor acquires a uniform resource location url list to determine whether to intercept;
if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding the Service layer interceptor, and printing a time-consuming log;
the Service layer interceptor judges whether the readlocal has a mark, if so, the Service layer interceptor prints a time-consuming log and forwards an external calling interceptor;
the external calling interceptor judges whether the readlocal has a mark, if so, the time-consuming log is printed, and the DAO interceptor is forwarded;
the DAO interceptor judges whether the readlocal has a mark, and if the mark exists, the DAO interceptor prints a time-consuming log;
the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values;
and determining the abnormal method serial number according to the path serial number and the time consumption value.
Optionally, determining the method sequence number with the abnormality according to the path sequence number and the time-consuming value includes:
the path serial number is a multi-level serial number;
and determining the method sequence number with the abnormality according to the hierarchical relation of the path sequence numbers and the time consumption of each hierarchy.
Optionally, according to the hierarchical relationship of the path sequence numbers, confirming abnormal paths from the first level to the next level in sequence;
if no abnormity exists in the time consumption of any path, no confirmation is carried out on the next level;
if any path is abnormal in time consumption, confirming whether the path is abnormal or not to the next level;
and determining the method sequence number with the abnormality according to the determined path with the abnormality.
Optionally, if there is an exception in any path consumed time, reconfirming to the next level includes:
and if no abnormity exists in the next level, determining whether the path of the current level is abnormal according to all consumed time of all the next levels and consumed time of the current level.
Optionally, if the interceptor determines that the mark does not exist in the local, the interceptor directly passes the local without printing the time-consuming log.
Optionally, the front-end request message is forwarded to the service layer for processing after passing through all the interceptors, and then forwarded to the system front-end after completing the processing and passing through all the interceptors.
According to another aspect of the embodiments of the present invention, there is also provided an interceptor-based time-consuming anomaly analysis system, including an intercepting module, where the intercepting module includes four interceptors, and the intercepting module is configured to:
after receiving the front-end request message, the controller layer interceptor acquires a uniform resource location url list to determine whether to intercept;
if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding the Service layer interceptor, and printing a time-consuming log;
the Service layer interceptor judges whether the readlocal has a mark, if so, the Service layer interceptor prints a time-consuming log and forwards an external calling interceptor;
the external calling interceptor judges whether the readlocal has a mark, if so, the time-consuming log is printed, and the DAO interceptor is forwarded;
the DAO interceptor judges whether the readlocal has a mark, and if the mark exists, the DAO interceptor prints a time-consuming log;
the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values;
and the abnormity determining module is used for determining the method serial number with abnormity according to the path serial number and the time consumption value.
Optionally, the interception module is further configured to store the url address into a url list, and cache the url list in the memory.
Optionally, the anomaly determination module comprises:
the path serial number is a multi-level serial number;
and determining the method sequence number with the abnormality according to the hierarchical relation of the path sequence numbers and the time consumption of each hierarchy.
Optionally, the anomaly determination module further comprises:
according to the hierarchical relation of the path serial numbers, confirming abnormal paths from the first level to the next level in sequence;
if no abnormity exists in the time consumption of any path, no confirmation is carried out on the next level;
and if the time consumption of any path is abnormal, confirming whether the path is abnormal again to the next level.
Optionally, the intercepting module further comprises:
and if the interceptor judges that the mark does not exist in the local, directly releasing the local without printing a time-consuming log.
According to a further aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform any of the above methods of interceptor-based time-consuming anomaly analysis when running.
In the embodiment of the invention, after receiving a front-end request message, a controller layer interceptor acquires a uniform resource location url list to determine whether to intercept; if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding the Service layer interceptor, and printing a time-consuming log; the Service layer interceptor judges whether the readlocal has a mark, if so, the Service layer interceptor prints a time-consuming log and forwards an external calling interceptor; the external calling interceptor judges whether the readlocal has a mark, if so, the time-consuming log is printed, and the DAO interceptor is forwarded; the DAO interceptor judges whether the readlocal has a mark, and if the mark exists, the DAO interceptor prints a time-consuming log; the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values; and determining the method serial number with the abnormality according to the path serial number and the time consumption value. And then the problems that the printing log amount is large and the abnormal time-consuming point analysis cannot be accurately positioned in the related technology are solved, and the technical effects of improving the effective printing efficiency and accurately positioning the abnormal points are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow diagram of a method for interceptor-based time-consuming anomaly analysis according to an embodiment of the present invention;
FIG. 2 is a logical schematic diagram of an interceptor-based time-consuming exception analysis according to an embodiment of the present invention;
FIG. 3 is a block diagram of a system architecture for interceptor-based time-consuming anomaly analysis, according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, a method for analyzing time-consuming anomalies based on interceptors is provided, and optionally, as an optional implementation manner, the method for analyzing time-consuming anomalies based on interceptors in this embodiment may be executed by a computer program, and may be applied to a terminal or a server or a similar computing device or an electronic device. For example, the computing device or electronic device may include one or more processors (the processors may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory for storing data, and may further include a transmission device for communication functions and an input/output device. It may also include more or fewer components than previously described, or have a different configuration than that shown. The memory may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the method for time-consuming anomaly analysis in the embodiment of the present invention, and the processor executes various functional applications and data processing by running the computer programs stored in the memory, so as to implement the method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory located remotely from the processor, and these remote memories may be connected to the mobile terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Illustratively, as an alternative implementation manner, fig. 1 is a flowchart of an interceptor-based time-consuming anomaly analysis according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step S101, after receiving the front end request message, the controller layer interceptor obtains a uniform resource location url list to determine whether to intercept;
the front end of the system is interacted in an http mode, after a front end service request is received, the front end service request is intercepted by the interceptors firstly, and is transmitted to the service layer after passing through all the interceptors, and the front end of the system can be returned to the front end of the system after being processed. After receiving the front-end service request, the controller layer interceptor performs first processing;
and the controller layer interceptor calls url control service to acquire a url list to be intercepted and confirms whether the current request needs to be intercepted or not.
And if the log is not printed, the log is directly released.
Step S102, if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding the Service layer interceptor, and printing a time-consuming log;
the Service layer interceptor checks whether a mark exists in the local to determine whether the current Service needs to be analyzed, if so, prints a time-consuming log, and calls a serial number Service during logging;
wherein, the interceptor processes of the subsequent two layers are basically similar to the interceptor processes of the Service layer.
And step S103, the Service layer interceptor judges whether the readlocal has a mark, if so, the Service layer interceptor prints a time-consuming log and forwards an external calling interceptor.
And step S104, judging whether the readlocal has a mark by the external calling interceptor, printing a time-consuming log if the mark exists, and forwarding the DAO interceptor.
Step S105, the DAO interceptor judges whether the readlocal has a mark, and if the mark exists, the DAO interceptor prints a time-consuming log.
Step S106, the time-consuming logs all comprise path serial numbers, method serial numbers and time-consuming values; determining a method serial number with abnormality according to the path serial number and the time consumption value;
for example, the path numbers are 1, 1.1, 1.2, 1.2.1; method numbers method1, method 2;
wherein the time consumption value refers to the time consumed by the method code corresponding to each path;
wherein, the time consumption analysis is realized at each interceptor layer;
the log comprises a path sequence number, a method sequence number and a time consumption value, the service output log needs are similar to a document directory and used for representing a method calling link, and the time consumption point can be analyzed quickly and conveniently;
to illustrate how to locate and determine an anomaly based on the time-consuming difference k, the print logs are as follows:
number 1.1.1, method1, time 20ms, parameter 111
Number 1.1.2, assembly. method2, elapsed time 3ms, parameter 111
Number 1.1, assembly. method, time 24ms, parameter 111
Serial number 1.2.1.1, method as assistant, time 3024ms, parameter 111 ms
Serial number 1.2.1, method 3032ms, time consumption 111
Serial number 1.2, method 3033ms, time consumption 111 ms, and parameter
Serial number 1, method 5033ms, time consuming 111 ms, and parameter
It can be seen from the above log example that 4 methods of method4, method5, method6 and method7 are time-consuming, if no serial number is printed, the call relationship between these methods cannot be seen from the log, and these time-consuming methods all need to be analyzed, and after the serial number is printed, it is clear that method5 and method6 are time-consuming because of method4, so that method5 and method6 do not need to be analyzed, and it can be seen that method7 also needs to be analyzed in about 2000ms in addition to time-consuming methods 3 and 6.
Therefore, according to the concept of the scheme, firstly, determining the sequence number 1 takes more time, and then looking at the sequence numbers 1.1 and 1.2. The overall time consumption in 1.1 is less, so that the time consumption of the child node 1.1.1 and the child node 1.1.2 in 1.1 is less, and the methods 1, 2 and 3 do not need to be analyzed. On the other hand, it was found that 1.2 took 3033ms and 1.2.1 took 3032 seconds, and that 1.2 was caused by the influence of 1.2.1. While 1.2.1.1 took 3024ms, it was found that method6 was ultimately due to the fact that method4 took much time. Thus, it is possible to locate the problem to the method4 code, while the method7 takes almost 2000ms in addition to the time taken by the method3 and the method6, and thus there is also a problem.
In an exemplary embodiment, the url address is stored in a url list, and the url list is cached in a memory;
other storage methods having the same effect can be used.
In an exemplary embodiment, determining a method sequence number having an exception according to the path sequence number and the time-consuming value includes:
the path serial number is a multi-level serial number;
specifically, for example, the first level has a sequence number level of 1, the next level has sequence numbers of 1.1 and 1.2, and the next level has sequence numbers of 1.1.1 and 1.2.1;
and determining the method sequence number with the abnormality according to the hierarchical relation of the path sequence numbers and the time consumption of each hierarchy.
In an exemplary embodiment, according to the hierarchical relationship of the path sequence numbers, confirming abnormal paths from a first level to a next level in sequence;
if no abnormity exists in the time consumption of any path, no confirmation is carried out on the next level;
if any path is abnormal in time consumption, confirming whether the path is abnormal or not to the next level;
determining the method serial number with the abnormality according to the determined path with the abnormality;
specifically, whether the time consumption of the first-level path sequence number is abnormal or not is determined, if yes, whether the time consumption is abnormal or not is confirmed to the second-level path sequence number, and the like.
In an exemplary embodiment, if no exception exists in the next level, determining whether the path of the current level is an exception according to all the consumed time of all the next levels and the consumed time of the current level;
in addition, if the time consumption is high except for all the next-level paths, it is determined that the corresponding node is abnormal and needs to be analyzed.
In an exemplary embodiment, if the interceptor determines that the mark does not exist in the local, the interceptor passes directly without printing the time-consuming log.
In an exemplary embodiment, the front-end request message is forwarded to the service layer for processing after passing through all the interceptors, and then forwarded to the system front-end after passing through all the interceptors after completing the processing.
Fig. 2 is a logic diagram of time-consuming exception analysis based on interceptors according to an embodiment of the present invention, which is used to illustrate the sequence number generation logic and flow principles of the present solution, and in particular,
when url hits the analysis list, initializing a path object (the path is 1, and the serial number is 0), and storing the path object into a stack;
after passing through a Service interceptor, if a stack is judged to exist, adding 1 to the serial number of the top object of the stack, adding a new object into the stack, wherein the path is the currently corresponding path plus the serial number, and the serial number is 0;
executing service logic, popping up a stack top path object, and printing a log;
and jumping out of the controller interceptor, and printing a time-consuming log if the stack is judged to exist.
In the embodiment of the invention, after receiving a front-end request message, a controller layer interceptor acquires a uniform resource location url list to determine whether to intercept; if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding the Service layer interceptor, and printing a time-consuming log; the Service layer interceptor judges whether the readlocal has a mark, if so, the Service layer interceptor prints a time-consuming log and forwards an external calling interceptor; the external calling interceptor judges whether the readlocal has a mark, if so, the time-consuming log is printed, and the DAO interceptor is forwarded; the DAO interceptor judges whether the readlocal has a mark, and if the mark exists, the DAO interceptor prints a time-consuming log; the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values; and determining the method serial number with the abnormality according to the path serial number and the time consumption value. And then the problems that the printing log amount is large and the abnormal time-consuming point analysis cannot be accurately positioned in the related technology are solved, and the technical effects of improving the effective printing efficiency and accurately positioning the abnormal points are achieved.
The embodiment of the invention also provides a time-consuming abnormity analysis system based on the interceptor, which is used for realizing the embodiment and the preferred embodiment. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
Fig. 3 is a block diagram of a system for time-consuming anomaly analysis based on interceptors according to an embodiment of the present invention, as shown in fig. 2, the system includes:
the interception module 31 is configured to, after receiving the front-end request message, obtain a uniform resource locator url list by a controller layer interceptor to determine whether to intercept the message;
if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding the Service layer interceptor, and printing a time-consuming log;
the Service layer interceptor judges whether the readlocal has a mark, if so, the Service layer interceptor prints a time-consuming log and forwards an external calling interceptor;
the external calling interceptor judges whether the readlocal has a mark, if so, the time-consuming log is printed, and the DAO interceptor is forwarded;
the DAO interceptor judges whether the readlocal has a mark, and if the mark exists, the DAO interceptor prints a time-consuming log;
the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values;
and an exception determining module 32, configured to determine a method sequence number with an exception according to the path sequence number and the time-consuming value.
In an exemplary embodiment, the interception module is further configured to store the url address into a url list, and cache the url list in the memory.
In one exemplary embodiment, the anomaly determination module includes:
the path serial number is a multi-level serial number;
and determining the method sequence number with the abnormality according to the hierarchical relation of the path sequence numbers and the time consumption of each hierarchy.
In an exemplary embodiment, the anomaly determination module further comprises:
according to the hierarchical relation of the path serial numbers, confirming abnormal paths from the first level to the next level in sequence;
if no abnormity exists in the time consumption of any path, no confirmation is carried out on the next level;
and if the time consumption of any path is abnormal, confirming whether the path is abnormal again to the next level.
In an exemplary embodiment, the intercepting module further comprises directly passing without printing the time-consuming log if the interceptor determines that the mark does not exist in the local.
It should be further noted that other embodiments with the same effect may also be applied to the present solution, and are not described herein again.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to a further aspect of embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps in any of the method embodiments of the interceptor-based time-consuming anomaly analysis when run.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
step S1, after receiving the front end request message, the controller layer interceptor obtains the uniform resource location url list to determine whether to intercept;
step S2, if need to intercept, adding the url address of the front end request message into thread, marking, then forwarding the Service layer interceptor, and printing the time-consuming log;
step S3, the Service layer interceptor judges whether the readlocal has a mark, if yes, the time-consuming log is printed, and the external calling interceptor is forwarded;
step S4, the external calling interceptor judges whether the readlocal has a mark, if so, the time-consuming log is printed, and the DAO interceptor is forwarded;
step S5, DAO interceptor judges whether the local has mark, if yes, the time-consuming log is printed;
step S6, the time consumption logs all contain path serial numbers, method serial numbers and time consumption values; and determining the abnormal method serial number according to the path serial number and the time consumption value.
Through the steps, after receiving the front-end request message, the controller layer interceptor acquires the uniform resource location url list to determine whether to intercept; if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding the Service layer interceptor, and printing a time-consuming log; the Service layer interceptor judges whether the readlocal has a mark, if so, the Service layer interceptor prints a time-consuming log and forwards an external calling interceptor; the external calling interceptor judges whether the readlocal has a mark, if so, the time-consuming log is printed, and the DAO interceptor is forwarded; the DAO interceptor judges whether the readlocal has a mark, and if the mark exists, the DAO interceptor prints a time-consuming log; the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values; and determining the method serial number with the abnormality according to the path serial number and the time consumption value. And then the problems that the printing log amount is large and the abnormal time-consuming point analysis cannot be accurately positioned in the related technology are solved, and the technical effects of improving the effective printing efficiency and accurately positioning the abnormal points are achieved.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the above-described apparatus embodiments are merely illustrative, for example, the division of the units is only one logical function division, and in actual implementation, there may be other division manners, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art D can make several modifications and improvements without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

Claims (10)

1. A method for time-consuming anomaly analysis based on interceptors, comprising:
after receiving the front-end request message, the controller layer interceptor acquires a uniform resource location url list to determine whether to intercept;
if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding a Service layer interceptor, and printing a time-consuming log;
the Service layer interceptor judges whether the local has the mark, if so, prints a time-consuming log and forwards an external calling interceptor;
the external calling interceptor judges whether the local has the mark, if so, prints a time-consuming log and forwards a DAO interceptor;
the DAO interceptor judges whether the local has the mark, and if the local has the mark, printing a time-consuming log;
the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values;
and determining the abnormal method serial number according to the path serial number and the time consumption value.
2. The method of claim 1, wherein determining the method sequence number having the anomaly based on the path sequence number and the time-consuming value comprises:
the path serial number is a multi-level serial number;
and determining the method sequence number with the abnormality according to the hierarchical relation of the path sequence numbers and the time consumption of each hierarchy.
3. The method of claim 2, comprising:
according to the hierarchical relation of the path serial numbers, confirming abnormal paths from the first level to the next level in sequence;
if no abnormity exists in the time consumption of any path, no confirmation is carried out on the next level;
if any path is abnormal in time consumption, confirming whether the path is abnormal or not to the next level;
and determining the method sequence number with the abnormality according to the determined path with the abnormality.
4. The method of claim 3, wherein if there is an exception in any path consuming time, then reconfirming to the next level comprises:
and if no abnormity exists in the next level, determining whether the path of the current level is abnormal according to all consumed time of all the next levels and consumed time of the current level.
5. The method of claim 1, wherein if the interceptor determines that the tag is not present in the local, then the release is performed directly without printing a time-consuming log.
6. A system for time-consuming anomaly analysis based on interceptors, comprising an interception module, wherein the interception module comprises four interceptors, and the interception module is configured to:
after receiving the front-end request message, the controller layer interceptor acquires a uniform resource location url list to determine whether to intercept;
if the interception is needed, adding the url address of the front-end request message into thread, marking, then forwarding a Service layer interceptor, and printing a time-consuming log;
the Service layer interceptor judges whether the local has the mark, if so, prints a time-consuming log and forwards an external calling interceptor;
the external calling interceptor judges whether the local has the mark, if so, prints a time-consuming log and forwards a DAO interceptor;
the DAO interceptor judges whether the local has the mark, and if the local has the mark, printing a time-consuming log;
the time-consuming logs comprise path serial numbers, method serial numbers and time-consuming values;
and the abnormity determining module is used for determining the method serial number with abnormity according to the path serial number and the time consumption value.
7. The system of claim 6, wherein the anomaly determination module specifically comprises:
the path serial number is a multi-level serial number;
and determining the method sequence number with the abnormality according to the hierarchical relation of the path sequence numbers and the time consumption of each hierarchy.
8. The system of claim 7, wherein the anomaly determination module further comprises:
according to the hierarchical relation of the path serial numbers, confirming abnormal paths from the first level to the next level in sequence;
if no abnormity exists in the time consumption of any path, no confirmation is carried out on the next level;
and if the time consumption of any path is abnormal, confirming whether the path is abnormal again to the next level.
9. And determining the method sequence number with the abnormality according to the determined path with the abnormality. The system of claim 6, wherein the interception module further comprises:
and if the interceptor judges that the mark does not exist in the local, directly releasing the local without printing a time-consuming log.
10. A computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 5.
CN202110090500.9A 2021-01-22 2021-01-22 Time-consuming abnormity analysis method and system based on interceptor and storage medium Pending CN112783451A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110090500.9A CN112783451A (en) 2021-01-22 2021-01-22 Time-consuming abnormity analysis method and system based on interceptor and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110090500.9A CN112783451A (en) 2021-01-22 2021-01-22 Time-consuming abnormity analysis method and system based on interceptor and storage medium

Publications (1)

Publication Number Publication Date
CN112783451A true CN112783451A (en) 2021-05-11

Family

ID=75758690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110090500.9A Pending CN112783451A (en) 2021-01-22 2021-01-22 Time-consuming abnormity analysis method and system based on interceptor and storage medium

Country Status (1)

Country Link
CN (1) CN112783451A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230177100A1 (en) * 2021-12-07 2023-06-08 Servicenow, Inc. Efficient Downloading of Related Documents

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230177100A1 (en) * 2021-12-07 2023-06-08 Servicenow, Inc. Efficient Downloading of Related Documents
US11734381B2 (en) * 2021-12-07 2023-08-22 Servicenow, Inc. Efficient downloading of related documents

Similar Documents

Publication Publication Date Title
US10454953B1 (en) System and method for separated packet processing and static analysis
CN103150513B (en) The method of the implantation information in interception application program and device
CN111400722B (en) Method, apparatus, computer device and storage medium for scanning small program
CN108696399B (en) Business service test method and device
CN107181804B (en) The method for down loading and device of resource
US10735270B1 (en) Computer-based systems configured for network modelling and monitoring using programming object bindings and methods of use thereof
CN111866124B (en) Method, device, server and machine-readable storage medium for accessing webpage
CN108429739B (en) Method, system and terminal equipment for identifying honeypots
CN110213331B (en) Service request processing method, terminal device, electronic device and storage medium
CN111756697B (en) API safety detection method and device, storage medium and computer equipment
CN107689965A (en) Means of defence, the apparatus and system of the network equipment
CN113110864A (en) Application program updating method and device and storage medium
CN108768960A (en) Method for detecting virus, device, storage medium and computer equipment
CN110858130A (en) Log printing method and system and server
CN110602234B (en) Block chain network node management method, device, equipment and storage medium
CN112783451A (en) Time-consuming abnormity analysis method and system based on interceptor and storage medium
CN108924159B (en) Verification method and device of message feature recognition library
CN104462242A (en) Webpage reflow quantity counting method and device
CN116781434B (en) Access control method, system and related equipment based on mimicry defense
CN110166518B (en) Session information transmission method, device, storage medium and electronic device
CN106161429B (en) The automatic logging method and device at micro- end
CN111131198B (en) Updating method and device for network security policy configuration
CN113434796A (en) Page cache operation method and device, storage medium and electronic device
CN114090074A (en) Method and device for configuring operating environment, storage medium and electronic device
CN106936849A (en) Method is kidnapped in a kind of download of Android application program installation kit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination