CN111881156A - Abnormal log processing method, device, medium and terminal equipment - Google Patents

Abnormal log processing method, device, medium and terminal equipment Download PDF

Info

Publication number
CN111881156A
CN111881156A CN202010724409.3A CN202010724409A CN111881156A CN 111881156 A CN111881156 A CN 111881156A CN 202010724409 A CN202010724409 A CN 202010724409A CN 111881156 A CN111881156 A CN 111881156A
Authority
CN
China
Prior art keywords
abnormal
action
exception
log
file
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
CN202010724409.3A
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.)
Guangdong Information & Engineering Co ltd
Original Assignee
Guangdong Information & Engineering Co 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 Guangdong Information & Engineering Co ltd filed Critical Guangdong Information & Engineering Co ltd
Priority to CN202010724409.3A priority Critical patent/CN111881156A/en
Publication of CN111881156A publication Critical patent/CN111881156A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Abstract

The invention discloses an abnormal log processing method, which comprises the following steps: monitoring the action executed by the system in real time, and judging the abnormal action of the action executed by the system according to a preset abnormal action rule; the abnormal action rule comprises an abnormal type used for judging that the current action is an abnormal action; when the currently executed action of the system is determined to be an abnormal action, acquiring an abnormal log generated by the system corresponding to the abnormal action; generating marking information according to the abnormal type of the abnormal action and the stack address of the abnormal log; packaging the marking information and the abnormal log to generate an abnormal storage file, and storing the abnormal storage file into an abnormal file database; according to the technical scheme, the abnormal logs are quickly and accurately positioned, the abnormal logs can be quickly searched and processed, and the working efficiency is improved.

Description

Abnormal log processing method, device, medium and terminal equipment
Technical Field
The invention relates to the technical field of computers, in particular to an abnormal log processing method, an abnormal log processing device, an abnormal log processing medium and terminal equipment.
Background
The system can generate log information in the running process, and the output of the log can be on a server deployed by the system; when the application is deployed on a plurality of servers, the logs are correspondingly output to different servers. In daily application, a worker needs to analyze logs of system operation, but the logs are distributed to different machines, and the log files of all servers need to be analyzed when the logs are analyzed; the log output place is a production server, and the log can be exported to a developer for analysis only by operation and maintenance personnel with authority; however, the content of log file records is various, the abnormal log is only a part of the information of the log, and when the abnormal log needs to be searched, the abnormal information needs to be searched in a large amount of texts.
Therefore, an exception log processing strategy is urgently needed in the market at present, and the exception log can be quickly and accurately positioned so as to be quickly searched and processed, and the working efficiency is improved.
Disclosure of Invention
The invention provides an abnormal log processing method, device, medium and terminal equipment, which can be used for quickly and accurately positioning an abnormal log so as to quickly search and process the abnormal log and improve the working efficiency.
In order to solve the above technical problem, an embodiment of the present invention provides an exception log processing method, including:
monitoring the action executed by the system in real time, and judging the abnormal action of the action executed by the system according to a preset abnormal action rule; the abnormal action rule comprises an abnormal type used for judging that the current action is an abnormal action;
when the currently executed action of the system is determined to be an abnormal action, acquiring an abnormal log generated by the system corresponding to the abnormal action;
generating marking information according to the abnormal type of the abnormal action and the stack address of the abnormal log;
and packaging the marking information and the abnormal log to generate an abnormal storage file, and storing the abnormal storage file into an abnormal file database.
Preferably, after the storing the exception storage file into the exception file database, the method further includes:
receiving an abnormal query instruction sent by a user side, wherein the abnormal query instruction comprises an abnormal type which needs to be queried by the user side;
according to the abnormal type to be inquired, identifying and matching the abnormal type of the marking information in the abnormal storage file in the abnormal file database, and extracting the abnormal storage file with the matched abnormal type;
and sending all the extracted abnormal storage files to the user side.
Preferably, after the storing the exception storage file into the exception file database, the method further includes: and sending an abnormal log notification mail to a corresponding user side according to a preset mail format.
Preferably, the exception types include null pointer exception, array out-of-range exception and string conversion exception.
Another embodiment of the present invention correspondingly provides an exception log processing apparatus, including:
the abnormal judgment module is used for monitoring the action executed by the system in real time and judging the abnormal action of the action executed by the system according to a preset abnormal action rule; the abnormal action rule comprises an abnormal type used for judging that the current action is an abnormal action;
the abnormal log module is used for acquiring an abnormal log generated by the system corresponding to the abnormal action when the current action executed by the system is determined to be the abnormal action;
the marking information module is used for generating marking information according to the abnormal type of the abnormal action and the stack address of the abnormal log;
and the file storage module is used for packaging the marking information and the abnormal log to generate an abnormal storage file and storing the abnormal storage file into an abnormal file database.
Preferably, the exception log processing apparatus further includes:
the query instruction module is used for receiving an abnormal query instruction sent by a user side, wherein the abnormal query instruction comprises an abnormal type which needs to be queried by the user side;
the matching extraction module is used for identifying and matching the abnormal type of the marking information in the abnormal storage file in the abnormal file database according to the abnormal type to be inquired and extracting the abnormal storage file with the matched abnormal type;
and the log sending module is used for sending all the extracted abnormal storage files to the user side.
Preferably, the exception log processing apparatus further includes: and the mail notification module is used for sending an abnormal log notification mail to the corresponding user side according to the preset mail format.
Preferably, the exception types include null pointer exception, array out-of-range exception and string conversion exception.
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program; wherein the computer program, when running, controls the device on which the computer-readable storage medium is located to perform the method of processing an exception log as described in any one of the above.
An embodiment of the present invention further provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the exception log processing method according to any one of the above items when executing the computer program.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
1. according to the technical scheme, the corresponding abnormal logs are extracted in advance by identifying abnormal actions in the system operation, so that the abnormal logs are prevented from being covered by massive normal logs and being not beneficial to searching; and the stack address in the marking information can also enable a worker to quickly know the specific position of the system for executing the abnormal action, so that the abnormal log can be quickly and accurately positioned, the abnormal log can be quickly searched and processed, and the working efficiency is improved.
2. According to the technical scheme, the abnormal logs can be quickly inquired, the abnormal file database is identified and matched through the abnormal inquiry command sent by the user, workers can quickly acquire the abnormal logs of corresponding types, and the working efficiency is improved.
3. According to the technical scheme, after the abnormal log is stored, the corresponding mail can be sent to the designated personnel to remind the corresponding staff.
Drawings
FIG. 1: the method for processing the abnormal log is a step flow chart of the method for processing the abnormal log provided by the embodiment of the invention;
FIG. 2: a schematic structural diagram of an exception log processing apparatus according to another embodiment of the present invention is provided.
Detailed Description
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.
Example one
Referring to fig. 1, a flowchart of steps of an exception log processing method according to an embodiment of the present invention includes steps 101 to 104, where the steps are as follows:
step 101: monitoring the action executed by the system in real time, and judging the abnormal action of the action executed by the system according to a preset abnormal action rule; the abnormal action rule comprises an abnormal type used for judging that the current action is an abnormal action. In this embodiment, the exception types include null pointer exception, array out-of-range exception, and string conversion exception.
Specifically, in the java language, the types of exceptions are mainly classified into two types, a runtime exception and an inspection exception. The technical scheme can be used for processing the runtime exception, wherein the runtime exception refers to the exception caused by a logic error in the running process of a program. Common exceptions include "null pointer exception", "array out-of-range exception", "string cannot be converted into number", and the like. The method comprises the steps of configuring a section, specifying a class and a method which need to start exception log processing in a configuration file, and starting exception processing for the A-class A1 method in a range.
Step 102: when the action currently executed by the system is determined to be an abnormal action, an abnormal log generated by the system corresponding to the abnormal action is acquired.
Specifically, when an exception occurs in the system, the Java exception mechanism throws the exception up layer by layer, for example, when the system attempts to convert the string "qw 12" into a number, the exception is thrown to the a1 method of class a.
Step 103: and generating marking information according to the exception type of the exception action and the stack address of the exception log.
Specifically, when the class and method of the thrown exception are within the scope of the first step configuration, i.e., class A1 method. Through the connection point of the section, the class name (A), the method name (A1), the parameters and the information of the exception handling program block when the exception occurs can be obtained; from the exception handler block, we can obtain the exception type (i.e., string is not convertible to number), exception stack and exception information (i.e., qw12 is not convertible to number).
Step 104: and packaging the marking information and the abnormal log to generate an abnormal storage file, and storing the abnormal storage file into an abnormal file database.
Specifically, the obtained class name, method name and parameters of the abnormal occurrence, and abnormal type, abnormal stack and abnormal information are sent to a message queue; and consuming the messages in the message queue, and storing the information (including the class name, the method name and the parameters of the exception occurrence, the exception type, the exception stack and the exception information) sent to the message queue into an exception log database during the storage time.
According to the technical scheme, the corresponding abnormal logs are extracted in advance by identifying abnormal actions in the system operation, so that the abnormal logs are prevented from being covered by massive normal logs and being not beneficial to searching; and the stack address in the marking information can also enable a worker to quickly know the specific position of the system for executing the abnormal action, so that the abnormal log can be quickly and accurately positioned, the abnormal log can be quickly searched and processed, and the working efficiency is improved.
In another embodiment, after the storing the exception storage file in the exception file database, the method further includes:
step 105: receiving an abnormal query instruction sent by a user side, wherein the abnormal query instruction comprises an abnormal type which needs to be queried by the user side. Step 106: and identifying and matching the abnormal type of the marking information in the abnormal storage file in the abnormal file database according to the abnormal type to be inquired, and extracting the abnormal storage file with the matched abnormal type. Step 107: and sending all the extracted abnormal storage files to the user side.
Specifically, a user initiates a query request for an exception; for example: initiating a query with an exception type of 'string is not convertible into number'; acquiring an abnormal log set meeting conditions from an abnormal log database; writing the abnormal logs meeting the conditions into a cache server; and returning the data to the user interface, and displaying the information meeting the conditions by the user interface in a form mode. (including the class name, method name and parameters of the exception, exception type, exception stack and exception information and time of warehousing).
According to the technical scheme, the abnormal logs can be quickly inquired, the abnormal file database is identified and matched through the abnormal inquiry command sent by the user, so that the worker can quickly acquire the corresponding types of abnormal logs, and the working efficiency is improved.
In another embodiment, after the storing the exception storage file in the exception file database, the method further includes: step 108: and sending an abnormal log notification mail to a corresponding user side according to a preset mail format.
According to the technical scheme, after the abnormal log is stored, the corresponding mail can be sent to the designated personnel to remind the corresponding staff.
Example two
Referring to fig. 2, a schematic structural diagram of an exception log processing apparatus according to another embodiment of the present invention includes:
the abnormal judgment module is used for monitoring the action executed by the system in real time and judging the abnormal action of the action executed by the system according to a preset abnormal action rule; the abnormal action rule comprises an abnormal type used for judging that the current action is an abnormal action. In this embodiment, the exception types include null pointer exception, array out-of-range exception, and string conversion exception.
And the abnormal log module is used for acquiring an abnormal log generated by the system corresponding to the abnormal action when the action currently executed by the system is determined to be the abnormal action.
And the marking information module is used for generating marking information according to the exception type of the exception action and the stack address of the exception log.
And the file storage module is used for packaging the marking information and the abnormal log to generate an abnormal storage file and storing the abnormal storage file into an abnormal file database.
In another embodiment, the exception log processing apparatus further comprises:
the query instruction module is used for receiving an abnormal query instruction sent by the user side, wherein the abnormal query instruction comprises an abnormal type which needs to be queried by the user side.
And the matching extraction module is used for identifying and matching the abnormal type of the marking information in the abnormal storage file in the abnormal file database according to the abnormal type to be inquired and extracting the abnormal storage file with the matched abnormal type.
And the log sending module is used for sending all the extracted abnormal storage files to the user side.
In another embodiment, the exception log processing apparatus further comprises: and the mail notification module is used for sending an abnormal log notification mail to the corresponding user side according to the preset mail format.
EXAMPLE III
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program; when running, the computer program controls the device where the computer-readable storage medium is located to execute the method for processing an exception log according to any of the above embodiments.
Example four
The embodiment of the present invention further provides a terminal device, where the terminal device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the method for processing an exception log according to any one of the above embodiments when executing the computer program.
Preferably, the computer program may be divided into one or more modules/units (e.g., computer program 1, computer program 2) that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program in the terminal device.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc., the general purpose Processor may be a microprocessor, or the Processor may be any conventional Processor, the Processor is a control center of the terminal device, and various interfaces and lines are used to connect various parts of the terminal device.
The memory mainly includes a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like, and the data storage area may store related data and the like. In addition, the memory may be a high speed random access memory, may also be a non-volatile memory, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, or may also be other volatile solid state memory devices.
It should be noted that the terminal device may include, but is not limited to, a processor and a memory, and those skilled in the art will understand that the terminal device is not limited to the terminal device, and may include more or less components than the terminal device, or some components in combination, or different components.
The above-mentioned embodiments are provided to further explain the objects, technical solutions and advantages of the present invention in detail, and it should be understood that the above-mentioned embodiments are only examples of the present invention and are not intended to limit the scope of the present invention. It should be understood that any modifications, equivalents, improvements and the like, which come within the spirit and principle of the invention, may occur to those skilled in the art and are intended to be included within the scope of the invention.

Claims (10)

1. An exception log handling method, comprising:
monitoring the action executed by the system in real time, and judging the abnormal action of the action executed by the system according to a preset abnormal action rule; the abnormal action rule comprises an abnormal type used for judging that the current action is an abnormal action;
when the currently executed action of the system is determined to be an abnormal action, acquiring an abnormal log generated by the system corresponding to the abnormal action;
generating marking information according to the abnormal type of the abnormal action and the stack address of the abnormal log;
and packaging the marking information and the abnormal log to generate an abnormal storage file, and storing the abnormal storage file into an abnormal file database.
2. The exception log handling method of claim 1, wherein after said storing said exception store file in an exception file database, further comprising:
receiving an abnormal query instruction sent by a user side, wherein the abnormal query instruction comprises an abnormal type which needs to be queried by the user side;
according to the abnormal type to be inquired, identifying and matching the abnormal type of the marking information in the abnormal storage file in the abnormal file database, and extracting the abnormal storage file with the matched abnormal type;
and sending all the extracted abnormal storage files to the user side.
3. The exception log handling method of claim 1, wherein after said storing said exception store file in an exception file database, further comprising: and sending an abnormal log notification mail to a corresponding user side according to a preset mail format.
4. The exception log processing method of claim 1, wherein said exception types include null pointer exceptions, array out-of-range exceptions, and string conversion exceptions.
5. An exception log handling apparatus, comprising:
the abnormal judgment module is used for monitoring the action executed by the system in real time and judging the abnormal action of the action executed by the system according to a preset abnormal action rule; the abnormal action rule comprises an abnormal type used for judging that the current action is an abnormal action;
the abnormal log module is used for acquiring an abnormal log generated by the system corresponding to the abnormal action when the current action executed by the system is determined to be the abnormal action;
the marking information module is used for generating marking information according to the abnormal type of the abnormal action and the stack address of the abnormal log;
and the file storage module is used for packaging the marking information and the abnormal log to generate an abnormal storage file and storing the abnormal storage file into an abnormal file database.
6. The exception log processing apparatus according to claim 5, further comprising:
the query instruction module is used for receiving an abnormal query instruction sent by a user side, wherein the abnormal query instruction comprises an abnormal type which needs to be queried by the user side;
the matching extraction module is used for identifying and matching the abnormal type of the marking information in the abnormal storage file in the abnormal file database according to the abnormal type to be inquired and extracting the abnormal storage file with the matched abnormal type;
and the log sending module is used for sending all the extracted abnormal storage files to the user side.
7. The exception log processing apparatus according to claim 5, further comprising: and the mail notification module is used for sending an abnormal log notification mail to the corresponding user side according to the preset mail format.
8. The exception log processing apparatus of claim 5, wherein said exception types include a null pointer exception, an array out-of-range exception and a string conversion exception.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored computer program; wherein the computer program controls the device where the computer readable storage medium is located to execute the exception log processing method according to any one of claims 1 to 4 when running.
10. A terminal device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the exception log processing method according to any one of claims 1 to 4 when executing the computer program.
CN202010724409.3A 2020-07-24 2020-07-24 Abnormal log processing method, device, medium and terminal equipment Pending CN111881156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010724409.3A CN111881156A (en) 2020-07-24 2020-07-24 Abnormal log processing method, device, medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010724409.3A CN111881156A (en) 2020-07-24 2020-07-24 Abnormal log processing method, device, medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN111881156A true CN111881156A (en) 2020-11-03

Family

ID=73200489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010724409.3A Pending CN111881156A (en) 2020-07-24 2020-07-24 Abnormal log processing method, device, medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN111881156A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650681A (en) * 2020-12-28 2021-04-13 广州品唯软件有限公司 Automatic testing method and device, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN105630682A (en) * 2015-12-28 2016-06-01 珠海金山网络游戏科技有限公司 System and method for automatically collecting and analyzing collapse of mobile terminal
CN106326129A (en) * 2016-09-09 2017-01-11 福建中金在线信息科技有限公司 Program abnormity information generating method and device
CN110224858A (en) * 2019-05-16 2019-09-10 平安科技(深圳)有限公司 Alarm method and relevant apparatus based on log

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN105630682A (en) * 2015-12-28 2016-06-01 珠海金山网络游戏科技有限公司 System and method for automatically collecting and analyzing collapse of mobile terminal
CN106326129A (en) * 2016-09-09 2017-01-11 福建中金在线信息科技有限公司 Program abnormity information generating method and device
CN110224858A (en) * 2019-05-16 2019-09-10 平安科技(深圳)有限公司 Alarm method and relevant apparatus based on log

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650681A (en) * 2020-12-28 2021-04-13 广州品唯软件有限公司 Automatic testing method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN106681930B (en) Distributed automatic detection method and system for abnormal operation of application
CN109902073B (en) Log processing method and device, computer equipment and computer readable storage medium
US20100095157A1 (en) Problem analysis via matching contiguous stack trace lines to symptom rules
US7913233B2 (en) Performance analyzer
CN107357731A (en) Process produces monitoring, analysis and the processing method of core dump problems
CN112084249A (en) Access record extraction method and device
CN112988873A (en) Data processing method and device
CN110543422A (en) software package code defect data processing method, system and medium for FPR
CN111881156A (en) Abnormal log processing method, device, medium and terminal equipment
CN111324375A (en) Code management method and device, computer equipment and storage medium
CN112632330A (en) Method and device for routing inspection of ATM equipment, computer equipment and storage medium
US20220083939A1 (en) Electronic device for detecting business system and detection method thereof
US20150169292A1 (en) Computer-readable recording medium storing program for managing scripts, script management device, and script management method
CN112667873A (en) Crawler system and method suitable for general data acquisition of most websites
CN111708756A (en) Method, device and equipment for automatically processing data warehouse and storage medium
CN111752838A (en) Question checking method and device, server and storage medium
CN110515792B (en) Monitoring method and device based on web version task management platform and computer equipment
CN115277677B (en) Batch file hanging method and device, computer equipment and storage medium
CN111414519A (en) Information processing method, device, computer system and readable storage medium
CN113472881B (en) Statistical method and device for online terminal equipment
CN115168509A (en) Processing method and device of wind control data, storage medium and computer equipment
US20210397498A1 (en) Information processing apparatus, control method, and program
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN111045983B (en) Nuclear power station electronic file management method, device, terminal equipment and medium
US20220292053A1 (en) Method for generating a coherent representation for at least two log files

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