CN110032502A - A kind of method, apparatus and electronic equipment of abnormality processing - Google Patents
A kind of method, apparatus and electronic equipment of abnormality processing Download PDFInfo
- Publication number
- CN110032502A CN110032502A CN201810028031.6A CN201810028031A CN110032502A CN 110032502 A CN110032502 A CN 110032502A CN 201810028031 A CN201810028031 A CN 201810028031A CN 110032502 A CN110032502 A CN 110032502A
- Authority
- CN
- China
- Prior art keywords
- destination application
- function
- dump file
- file
- dump
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
- G06F11/3624—Software debugging by performing operations on the source code, e.g. via a compiler
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
- G06F11/3636—Software debugging by tracing the execution of the program
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention discloses a kind of method, apparatus of abnormality processing and electronic equipments.The method comprise the steps that defining global variable, in destination application to store the running environment information of destination application;The power function for generating dump file is write in destination application;The abnormality processing function to catch the exception is write in the EXE module of destination application;Registration abnormity handles function in the EXE module of destination application;When abnormality processing function captures it is abnormal when, the power function by generating dump file generates dump file, and sends server for dump file.Due to defining global variable in destination application in the embodiment of the present invention, so that including the data of global variable in the dump file generated when being abnormal, developer is allowed to assist analysis collapse Producing reason from the additional global variable information of dump file acquisition, developer's orientation problem greatly has been helped, has improved the abnormal efficiency of analysis.
Description
Technical field
The present invention relates to electronic technology field, in particular to the method, apparatus and electronic equipment of a kind of abnormality processing.
Background technique
Currently, no one can guarantee the software of oneself in various circumstances not knowns for window client software development
It under operation, can not have any problems, therefore, for Windows system, system provides corresponding application programming interface
(Application Programming Interface, API) captures the exception occurred in program, catchs the exception
Then dump file can be generated with the api function of calling system afterwards, letter when wherein dump file then includes current program exception
This dump file is then reported to server by number allocating stack, client software.Developer is then mainly provided by Windows
Windbg tool check the abnormal cause of dump file, wherein main, function call storehouse is to look at, to know
The position of the source code of program error, so as to solve the problems, such as collapse.
However for some abnormal conditions, just looks at function call storehouse and be difficult the reason of navigating to program error, lead to
It often may be the parameter that is passed to as the function there are caused by abnormal conditions, while when being also required to know current function operation
Environmental information.The reason of can preferably helping developer to position application crash therefore, it is necessary to a kind of method.
Summary of the invention
The embodiment of the invention provides a kind of method, apparatus of abnormality processing and electronic equipments, to solve to apply journey at present
When sequence occurs abnormal, the problem of application crash reason can not be accurately positioned.
In a first aspect, this application provides a kind of methods of abnormality processing, this method comprises:
Global variable is defined, in destination application to store the running environment information of the destination application;
The power function for generating dump file is write in the destination application;
The abnormality processing function to catch the exception is write in the EXE module of the destination application;
The abnormality processing function is registered in the EXE module of the destination application;
When the abnormality processing function captures abnormal, dump is generated by the power function for generating dump file
File, and server is sent by the dump file, wherein it include the data of the global variable in the dump file.
Further, the abnormality processing function to catch the exception is write in the EXE module of the destination application, is wrapped
It includes:
An abnormality processing function is defined in the destination application, defines processing in the abnormality processing function
Exception Type information, and call when catching the exception the power function for generating dump file.
Further, when the abnormality processing function captures abnormal, pass through the function letter for generating dump file
Number generates dump file, comprising:
When the abnormality processing function captures abnormal, calling system offer is write in the destination application
The module of power function CreateFile, to create a dump file;
The module of calling system function MiniDumpWriteDump is write in the destination application, will be generated
Dump information be written to dump file;
The data of the global variable are written in the dump tail of file.
It further, further include the error log generated in the destination application operational process in the dump file
Information;
When the abnormality processing function captures abnormal, dump is generated by the power function for generating dump file
File, further includes:
The error log file generated in the destination application operational process merging is written to the dump file
In.
Further, the data that the global variable is written in the dump tail of file, comprising:
Calling system file is written function WriteFile and the data of the global variable is written to the dump file
In.
Second aspect, the application provide a kind of device of abnormality processing, which includes:
Definition module, for defining global variable in destination application, to store the fortune of the destination application
Row environmental information;
First writes module, for writing the power function for generating dump file in the destination application;
Second writes module, for writing the abnormality processing to catch the exception in the EXE module of the destination application
Function;
Registration module, for registering the abnormality processing function in the EXE module of the destination application;
Exception processing module, for passing through the generation dump file when the abnormality processing function captures abnormal
Power function generate dump file, and send server for the dump file, wherein include institute in the dump file
State the data of global variable.
Further, it described second writes module and is specifically used for:
An abnormality processing function is defined in the destination application, defines processing in the abnormality processing function
Exception Type information, and call when catching the exception the power function for generating dump file.
Further, the exception processing module is specifically used for:
When the abnormality processing function captures abnormal, calling system offer is write in the destination application
The module of power function CreateFile, to create a dump file;
The module of calling system function MiniDumpWriteDump is write in the destination application, will be generated
Dump information be written to dump file;
The data of the global variable are written in the dump tail of file.
It further, further include the error log generated in the destination application operational process in the dump file
Information;
The exception processing module is specifically also used to:
The error log file generated in the destination application operational process merging is written to the dump file
In.
Further, the exception processing module is specifically used for:
Calling system file is written function WriteFile and the data of the global variable is written to the dump file
In.
The third aspect, the present invention also provides a kind of electronic equipment, comprising: memory and is stored in the storage at processor
On device and the computer program that can run on the processor, wherein the processor can when executing the computer program
To realize any method in first aspect.
Fourth aspect, the present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, the journey
Any method in first aspect is realized when sequence is executed by processor.
The embodiment of the present invention in destination application by defining global variable, to store the operation of destination application
Environmental information;The power function for generating dump file is write in destination application;In the EXE module of destination application
Write the abnormality processing function to catch the exception;Registration abnormity handles function in the EXE module of destination application;Work as exception
When reason function captures abnormal, the power function by generating dump file generates dump file, and sends dump file to
Server.Due to defining global variable in destination application in the embodiment of the present invention, so that the generation when being abnormal
Dump file in include global variable data, allow developer from dump file acquisition it is additional global variable letter
Breath assists analysis collapse Producing reason, has greatly helped developer's orientation problem, improves the abnormal efficiency of analysis.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, institute in being described below to the embodiment of the present invention
Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention
Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings
Obtain other attached drawings.
Fig. 1 is one embodiment schematic diagram of the method for abnormality processing in the embodiment of the present invention;
Fig. 2 is one embodiment schematic diagram of step S105 in embodiment illustrated in fig. 1;
Fig. 3 is another embodiment schematic diagram of step S105 in embodiment illustrated in fig. 1;
Fig. 4 is one embodiment schematic diagram of the device of abnormality processing in the embodiment of the present invention;
Fig. 5 is one embodiment schematic diagram of electronic equipment in the embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
Description and claims of this specification and the (if present)s such as term " first " in above-mentioned attached drawing, " second "
It is to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that the number used in this way
According to being interchangeable under appropriate circumstances, so as to the embodiments described herein can in addition to the content for illustrating or describing herein with
Outer sequence is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover non-exclusive packet
Contain, for example, what the process, method, system, product or equipment for containing a series of steps or units were not necessarily limited to be clearly listed
Those step or units, but may include be not clearly listed or it is intrinsic for these process, methods, product or equipment
Other step or units.
The method of abnormality processing is applied to the device of abnormality processing in the embodiment of the present invention, which is located at electronic equipment
In, the electronic apparatus system is Windows system in the present embodiment, which can be mobile phone, tablet computer or a
The Windows system electronics such as people's computer are also possible to the electronic equipment etc. of the following emerging Windows system.
Abnormal (Exception) is the mistake that will lead to program and run abort that application program is likely to occur at runtime.
Since one of the requirement of programming is exactly the robustness of program, it is desirable to which program can not go out at runtime or go wrong less.
But in the actual motion of program, always having some factors causes program to be not normally functioning.In algorithm for design, often
It is designed that comparison is accurate to the normal logic process flow of algorithm, design is not easy comprehensively to the processing of abnormal conditions instead, is led
Program is caused to collapse when an abnormal situation occurs, if software such case occurs and can bring extremely disagreeableness experience to user.Mesh
The Limited information of dump file, the problem of application crash reason can not be accurately positioned are generated after preceding exception is captured.Therefore,
The embodiment of the invention provides a kind of method, apparatus of abnormality processing and electronic equipments, to solve the problems, such as this.
Referring to Fig. 1, one embodiment of the method for abnormality processing includes: in the embodiment of the present invention
S101, global variable is defined in destination application, to store the running environment information of destination application;
Destination application is window application in the embodiment of the present invention.It should be noted that the embodiment of the present invention
Middle application program can be in application program (APP) or terminal (such as PC) on mobile terminal (such as mobile phone, flat lamp)
Computer program, it can be on mobile terminal Windows Phone application or computer on Windows application journey
Sequence.
In the present embodiment, the data for being stored in global variable are the running environment information of destination application, such as
Be broadcast live client software for, then may include it is current whether have using camera, current live streaming whether be play film, or
The current live streaming of person is game live streaming, the game name of live streaming, the duration of current live streaming, the letter such as time of client software starting
Breath.Further, timer can be arranged in Haier in destination application in the embodiment of the present invention, at regular intervals actively
The running environment information for going more new target application, to ensure that the information of current global variable storage is newest.
S102, the power function for generating dump file is write in destination application;
In the present embodiment, the function of a generation dump file is write in destination application, thus in abnormal generation
When can generate a dump file.
S103, the abnormality processing function to catch the exception is write in the EXE module of destination application;
Window application is developed, multiple modules can be split into complete, such as EXE module and DLL module,
One module is then a file, for example, an EXE module is an EXE file, a DLL module is a dll file,
Code sharing and the division of labor are not only improved in this way, and function can be split as far as possible, and the code degree of coupling is reduced.Therefore, one
The composition of window application is then made of an EXE file and multiple dll files.
In the present embodiment, in order to allow destination application it is subsequent can normal use, then need to capture the exception first, therefore
It then needs to write the abnormality processing function to catch the exception in the present embodiment, to abnormal place when generating abnormal for handling
Reason, continues to execute application program.
S104, registration abnormity handles function in the EXE module of destination application;
Specifically, since the application program in Windows system is required to ability normal use, this implementation after registering
In example, it is also necessary to register the above-mentioned abnormality processing function write, when generating abnormal, the correspondence for the abnormality processing function write is patrolled
Collecting can just be performed.
S105, when abnormality processing function captures abnormal, pass through generate dump file power function generate dump text
Part, and server is sent by dump file.
It wherein, include the data of global variable described in step S101 in the dump file.Dump text in the present embodiment
Part is sent to server, analyzes so that Developmental Engineer downloads acquisition dump file in server.
The embodiment of the present invention in destination application by defining global variable, to store the operation of destination application
Environmental information;The power function for generating dump file is write in destination application;In the EXE module of destination application
Write the abnormality processing function to catch the exception;Registration abnormity handles function in the EXE module of destination application;Work as exception
When reason function captures abnormal, the power function by generating dump file generates dump file, and sends dump file to
Server.Due to defining global variable in destination application in the embodiment of the present invention, so that the generation when being abnormal
Dump file in include global variable data, allow developer from dump file acquisition it is additional global variable letter
Breath assists analysis collapse Producing reason, has greatly helped developer's orientation problem, improves the abnormal efficiency of analysis.
In some embodiment of the invention, above-mentioned steps S103 can further include:
An abnormality processing function is defined in destination application, and the exception of processing is defined in the abnormality processing function
Type information, and the power function for generating dump file is called when catching the exception.
It is implemented as follows:
LONG__stdcall MyUnhandledExceptionFilter(PEXCEPTION_POINTERS
pExceptionInfo){
{
CreateMiniDump(pExceptionInfo,"core.dmp");
return EXCEPTION_CONTINUE_EXECUTION;
}
Wherein, an abnormality processing function is defined, function name is MyUnhandledExceptionFilter, parameter
PExceptionInfo can then transmit the relevant information of some exceptions, including be what exception at this time, such as except 0 abnormal, invalid sentence
Handle is abnormal, internal storage access is abnormal etc..In addition, CreateMiniDump is the function for the generation dump file write in above-mentioned steps
Function;Parameter pExceptionInfo is the environmental information when generation of system is abnormal;Parameter " core.dmp " is then to need to give birth to
At dump file title, wherein .dmp be dump file format.
It is achieved that in the EXE module of destination application by the step and writes the exception to catch the exception
Manage function.
Carry out registration abnormity processing function due to providing corresponding api function in Windows system, it can be according to this
The api function of offer carrys out registration abnormity processing function, registers in the EXE module of destination application in above-mentioned steps S104 different
Often processing function specific implementation can be such that
SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
Wherein, API calls SetUnhandledExceptionFilter is then for registering an abnormality processing letter
Number;Parameter MyUnhandledExceptionFilter is then the abnormality processing function write in above-mentioned steps.Therefore only exist
Registration abnormity handles function in system, when application program executes, produces exception, then system can go to execute the exception registered
Manage function MyUnhandledExceptionFilter.It can then be handled abnormal in this function.Just by the step
It realizes at this registration abnormity in the EXE module of destination application and handles function.
As shown in Fig. 2, in some embodiment of the invention, when the abnormality processing function captures in above-mentioned steps S105
When abnormal, the power function by generating dump file generates dump file, can further include:
S1051, when abnormality processing function captures abnormal, write in destination application calling system offer function
The module of energy function CreateFile, to create a dump file;
The specific implementation is as follows:
An interface is write in destination application first to be used to generate dump file, specific as follows:
void CreateMiniDump(PEXCEPTION_POINTERS pep,LPCTSTR strFileName)
Since dump is a file, so also needing to create a dump file in the present embodiment, so that write-in generates
Dump information.Power function CreateFile that specific then calling system provides creates a file, is implemented as follows:
HANDLE hFile=CreateFile (strFileName, GENERIC_READ | GENERIC_WRITE, FILE_
SHARE_WRITE,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
Wherein, parameter strFileName then indicates the title of the file of creation.
S1052, the module that calling system function MiniDumpWriteDump is write in destination application will give birth to
At dump information be written to dump file;
In the present embodiment, it will be generated in destination application by calling system function MiniDumpWriteDump
Dump information be written in dump file, specific implementation is as follows:
MiniDumpWriteDump(GetCurrentProcess(),GetCurrentProcessId(),hFile,
MiniDumpNormal,NULL,NULL,NULL);
Wherein, current dump information then can be generated in system function MiniDumpWriteDump;Parameter 1 is then current
The handle of process is obtained by calling system function GetCurrentProcess;Parameter 2 is then the ID of current process, then
It is to be obtained by calling system function GetCurrentProcessId;Parameter 3hFile is then the handle for needing to be written file,
The file handle being pre-created before being then;Parameter 4 be then it is incoming that need to generate is MiniDumpNormal, rather than full dose
dump。
It finally turns off file handle CloseHandle (hFile), calling system function CloseHandle, thus dump
File generates.
S1053, the data that global variable is written in dump tail of file.
After dump file generated, the data for the global variable that meeting is defined in the write-in of dump tail of file in the present embodiment,
When to be sent to server with dump file, these global variable informations are in carrying to help developer's positioning to ask
Topic.
It is specific then be written by calling system file function WriteFile the data of global variable are written to it is described
In dump file, specific implementation is as follows:
WriteFile (hFile, global variable, global variable size, the size of data being actually written into, NULL);
The data of global variable are had been written into dump file to realize.
In order to which more information further is written in dump file again in the embodiment of the present invention, so that developer divides
The log content of the error level of journal file can also be written to dump tail of file when program generates collapse by analysis, from
And there is error log then can greatly help developer's orientation problem.Therefore, in target application in the embodiment of the present invention
When abnormality processing function in program captures abnormal, in the dump file that the power function by generating dump file generates also
Including the error-logging information generated in the destination application operational process;At this point, as shown in figure 3, above-mentioned steps S105
In when the abnormality processing function captures abnormal, by it is described generate dump file power function generate dump file,
Can also include:
S1054, the error log file generated in destination application operational process merging is written in dump file.
Specifically, being then that global variable is written in dump file by calling file that function is written.It is then first
The file content that read error log is read by file, is then written into dump tail of file, specific implementation is such as
Under:
WriteFile (hFile, log file contents, log file size, the size of data being actually written into, NULL);
Error log is had been written into dump file to realize.
Finally turn off file handle CloseHandle (hFile);Calling system function CloseHandle.To dump
File then generates.
The embodiment of the device of abnormality processing in the embodiment of the present invention is described below.
Referring to Fig. 4, one embodiment of the device for the abnormality processing provided in the embodiment of the present invention, the device packet
It includes:
Definition module 401, for defining global variable in destination application, to store the destination application
Running environment information;
First writes module 402, for writing the power function for generating dump file in the destination application;
Second writes module 403, for writing the exception to catch the exception in the EXE module of the destination application
Manage function;
Registration module 404, for registering the abnormality processing function in the EXE module of the destination application;
Exception processing module 405, for passing through the generation dump text when the abnormality processing function captures abnormal
The power function of part generates dump file, and sends server for the dump file, wherein includes in the dump file
The data of the global variable.
Further, it described second writes module 403 and is specifically used for:
An abnormality processing function is defined in the destination application, defines processing in the abnormality processing function
Exception Type information, and call when catching the exception the power function for generating dump file.
Further, the exception processing module 405 is specifically used for:
When the abnormality processing function captures abnormal, calling system offer is write in the destination application
The module of power function CreateFile, to create a dump file;
The module of calling system function MiniDumpWriteDump is write in the destination application, will be generated
Dump information be written to dump file;
The data of the global variable are written in the dump tail of file.
It further, further include the error log generated in the destination application operational process in the dump file
Information;
The exception processing module 405 is specifically also used to:
The error log file generated in the destination application operational process merging is written to the dump file
In.
Further, the exception processing module 405 is specifically used for:
Calling system file is written function WriteFile and the data of the global variable is written to the dump file
In.
A kind of electronic equipment is also provided in the embodiment of the present invention, refers to Fig. 5, the electronic equipment includes:
Memory 501, processor 502 and is stored in the computer that can be run on the memory and on the processor
Program 503, wherein the method that above-mentioned abnormality processing may be implemented when executing the computer program 503 in the processor 502.
It include destination application described in above-described embodiment in the computer program 503.
For ease of description, only parts related to embodiments of the present invention are shown, disclosed by specific technical details, asks
Referring to present invention method part.Memory 501 can be used for storing computer program 503, and above-mentioned computer program includes
Software program, module and data, processor 502 execute the computer program 503 for being stored in memory 501 by running, thus
Execute the various function application and data processing of electronic equipment.
In the specific implementation process, memory 501 can be used for storing software program and module, and processor 502 passes through
Operation is stored in the software program and module of memory 501, thereby executing the various function application and data of electronic equipment
Processing.Memory 501 can mainly include storing program area and storage data area, wherein storing program area can storage program area,
Application program needed at least one function (such as game class application program, chat class application program) etc.;It storage data area can
Storage uses created data (game configuration data, audio data) etc. according to electronic equipment.In addition, memory 501 can
It can also include nonvolatile memory to include high-speed random access memory, a for example, at least disk memory is dodged
Memory device or other volatile solid-state parts.Processor 502 is the control centre of electronic equipment, using various interfaces and
The various pieces of the entire electronic equipment of connection, by run or execute the software program being stored in memory 501 and/or
Module, and the data being stored in memory 501 are called, the various functions and processing data of electronic equipment are executed, thus right
Electronic equipment carries out integral monitoring.Optionally, processor 502 may include one or more processing units;Preferably, processor
502 can integrate application processor, wherein the main processing operation system of application processor, user interface and application program etc..
The embodiment of the present invention also provides a kind of computer readable storage medium, wherein the computer readable storage medium can
It is stored with program, which includes some or all of method of abnormality processing recorded in above method embodiment step when executing
Suddenly.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention
Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.
Claims (10)
1. a kind of method of abnormality processing, which is characterized in that the described method includes:
Global variable is defined, in destination application to store the running environment information of the destination application;
The power function for generating dump file is write in the destination application;
The abnormality processing function to catch the exception is write in the EXE module of the destination application;
The abnormality processing function is registered in the EXE module of the destination application;
When the abnormality processing function captures abnormal, dump text is generated by the power function for generating dump file
Part, and server is sent by the dump file, wherein it include the data of the global variable in the dump file.
2. being caught the method according to claim 1, wherein being write in the EXE module of the destination application
Obtain abnormal abnormality processing function, comprising:
An abnormality processing function is defined in the destination application, defines the different of processing in the abnormality processing function
Normal type information, and the power function for generating dump file is called when catching the exception.
3. the method according to claim 1, wherein passing through when the abnormality processing function captures abnormal
The power function for generating dump file generates dump file, comprising:
When the abnormality processing function captures abnormal, the function of calling system offer is write in the destination application
The module of function CreateFile, to create a dump file;
The module of calling system function MiniDumpWriteDump is write in the destination application, will be generated
Dump information is written to dump file;
The data of the global variable are written in the dump tail of file.
4. according to the method described in claim 3, it is characterized in that, further including the destination application in the dump file
The error-logging information generated in operational process;
When the abnormality processing function captures abnormal, dump text is generated by the power function for generating dump file
Part, further includes:
The error log file generated in the destination application operational process merging is written in the dump file.
5. the method according to claim 3 or 4, which is characterized in that described described complete in dump tail of file write-in
The data of office's variable, comprising:
The data of the global variable are written in the dump file by calling system file write-in function WriteFile.
6. a kind of device of abnormality processing, which is characterized in that described device includes:
Definition module, for defining global variable in destination application, to store the operation ring of the destination application
Border information;
First writes module, for writing the power function for generating dump file in the destination application;
Second writes module, for writing the abnormality processing function to catch the exception in the EXE module of the destination application;
Registration module, for registering the abnormality processing function in the EXE module of the destination application;
Exception processing module, for passing through the function for generating dump file when the abnormality processing function captures abnormal
Energy function generates dump file, and sends server for the dump file, wherein includes described complete in the dump file
The data of office's variable.
7. device according to claim 6, which is characterized in that described second, which writes module, is specifically used for:
An abnormality processing function is defined in the destination application, defines the different of processing in the abnormality processing function
Normal type information, and the power function for generating dump file is called when catching the exception.
8. device according to claim 6, which is characterized in that the exception processing module is specifically used for:
When the abnormality processing function captures abnormal, the function of calling system offer is write in the destination application
The module of function CreateFile, to create a dump file;
The module of calling system function MiniDumpWriteDump is write in the destination application, will be generated
Dump information is written to dump file;
The data of the global variable are written in the dump tail of file.
9. device according to claim 6, which is characterized in that further include the destination application in the dump file
The error-logging information generated in operational process;
The exception processing module is specifically also used to:
The error log file generated in the destination application operational process merging is written in the dump file.
10. a kind of electronic equipment characterized by comprising memory and is stored on the memory and can be in institute processor
State the computer program run on processor, wherein the processor may be implemented right when executing the computer program and want
Seek 1 to 5 any method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810028031.6A CN110032502B (en) | 2018-01-11 | 2018-01-11 | Abnormality processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810028031.6A CN110032502B (en) | 2018-01-11 | 2018-01-11 | Abnormality processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110032502A true CN110032502A (en) | 2019-07-19 |
CN110032502B CN110032502B (en) | 2023-05-26 |
Family
ID=67234335
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810028031.6A Active CN110032502B (en) | 2018-01-11 | 2018-01-11 | Abnormality processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110032502B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414270A (en) * | 2020-03-24 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Exception handling method and device |
CN113010440A (en) * | 2021-04-29 | 2021-06-22 | 福建天晴在线互动科技有限公司 | Method and system for realizing windows program exception feedback |
CN113220495A (en) * | 2021-05-24 | 2021-08-06 | 浙江大华技术股份有限公司 | Process abnormal event processing method and device, electronic equipment and storage medium |
CN113742122A (en) * | 2021-08-19 | 2021-12-03 | 深圳Tcl新技术有限公司 | Exception handling method and device, storage medium and electronic equipment |
CN117149667A (en) * | 2023-10-31 | 2023-12-01 | 宁德时代新能源科技股份有限公司 | Abnormal data acquisition method, device, equipment and computer readable storage medium |
Citations (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1704908A (en) * | 2004-05-26 | 2005-12-07 | 华为技术有限公司 | Method for locating program abnormity |
US7028056B1 (en) * | 2000-04-14 | 2006-04-11 | Microsoft Corporation | Method and arrangements for generating debugging information following software failures |
US7069271B1 (en) * | 2000-11-03 | 2006-06-27 | Oracle International Corp. | Methods and apparatus for implementing internet storefronts to provide integrated functions |
EP1927943A2 (en) * | 2006-11-30 | 2008-06-04 | Hitachi, Ltd. | Environmental information aggregating apparatus and method |
US20090006883A1 (en) * | 2007-06-27 | 2009-01-01 | Microsoft Corporation | Software error report analysis |
JP2009223754A (en) * | 2008-03-18 | 2009-10-01 | Nippon Telegr & Teleph Corp <Ntt> | User environment restoration system and user environment restoration method |
CN101593147A (en) * | 2009-04-15 | 2009-12-02 | 卡斯柯信号有限公司 | Abnormal information dump method based on symbol file |
US20120144374A1 (en) * | 2010-05-12 | 2012-06-07 | Salesforce.Com, Inc. | Capturing Replayable Information at Software Defect Locations in a Multi-Tenant Environment |
CN102768639A (en) * | 2012-06-11 | 2012-11-07 | 北京奇虎科技有限公司 | Operating system kernel-level error positioning method and device |
CN102819466A (en) * | 2012-06-29 | 2012-12-12 | 华为技术有限公司 | Method and device for processing operating system exceptions |
CN103116715A (en) * | 2013-03-01 | 2013-05-22 | 中标软件有限公司 | API (application programming interface) delay import protection method for executable files of Windows platform |
CN103530199A (en) * | 2012-07-02 | 2014-01-22 | 腾讯科技(深圳)有限公司 | Software running error repairing method, device and system |
CN104361076A (en) * | 2014-11-12 | 2015-02-18 | 腾讯科技(成都)有限公司 | Method and device for processing abnormality of browser |
CN104572327A (en) * | 2014-12-24 | 2015-04-29 | 北京奇虎科技有限公司 | Method, device and system for processing browser crash |
CN105930224A (en) * | 2016-06-28 | 2016-09-07 | 广东欧珀移动通信有限公司 | Dump operation control method, device and terminal |
US20160321130A1 (en) * | 2015-05-01 | 2016-11-03 | Fujitsu Limited | Apparatus and method for managing dump data for cause analysis of a memory leak |
CN106484617A (en) * | 2016-10-09 | 2017-03-08 | 武汉斗鱼网络科技有限公司 | Statistical method and system are automatically analyzed for the dump file of Windows software product |
CN106649089A (en) * | 2016-10-09 | 2017-05-10 | 武汉斗鱼网络科技有限公司 | Application crash analysis method and system |
CN107301056A (en) * | 2017-07-27 | 2017-10-27 | 上海斐讯数据通信技术有限公司 | A kind of AP online upgradings processing method and processing device |
-
2018
- 2018-01-11 CN CN201810028031.6A patent/CN110032502B/en active Active
Patent Citations (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7028056B1 (en) * | 2000-04-14 | 2006-04-11 | Microsoft Corporation | Method and arrangements for generating debugging information following software failures |
US7069271B1 (en) * | 2000-11-03 | 2006-06-27 | Oracle International Corp. | Methods and apparatus for implementing internet storefronts to provide integrated functions |
CN1704908A (en) * | 2004-05-26 | 2005-12-07 | 华为技术有限公司 | Method for locating program abnormity |
EP1927943A2 (en) * | 2006-11-30 | 2008-06-04 | Hitachi, Ltd. | Environmental information aggregating apparatus and method |
US20090006883A1 (en) * | 2007-06-27 | 2009-01-01 | Microsoft Corporation | Software error report analysis |
JP2009223754A (en) * | 2008-03-18 | 2009-10-01 | Nippon Telegr & Teleph Corp <Ntt> | User environment restoration system and user environment restoration method |
CN101593147A (en) * | 2009-04-15 | 2009-12-02 | 卡斯柯信号有限公司 | Abnormal information dump method based on symbol file |
US20120144374A1 (en) * | 2010-05-12 | 2012-06-07 | Salesforce.Com, Inc. | Capturing Replayable Information at Software Defect Locations in a Multi-Tenant Environment |
CN102768639A (en) * | 2012-06-11 | 2012-11-07 | 北京奇虎科技有限公司 | Operating system kernel-level error positioning method and device |
CN102819466A (en) * | 2012-06-29 | 2012-12-12 | 华为技术有限公司 | Method and device for processing operating system exceptions |
CN103530199A (en) * | 2012-07-02 | 2014-01-22 | 腾讯科技(深圳)有限公司 | Software running error repairing method, device and system |
CN103116715A (en) * | 2013-03-01 | 2013-05-22 | 中标软件有限公司 | API (application programming interface) delay import protection method for executable files of Windows platform |
CN104361076A (en) * | 2014-11-12 | 2015-02-18 | 腾讯科技(成都)有限公司 | Method and device for processing abnormality of browser |
CN104572327A (en) * | 2014-12-24 | 2015-04-29 | 北京奇虎科技有限公司 | Method, device and system for processing browser crash |
US20160321130A1 (en) * | 2015-05-01 | 2016-11-03 | Fujitsu Limited | Apparatus and method for managing dump data for cause analysis of a memory leak |
CN105930224A (en) * | 2016-06-28 | 2016-09-07 | 广东欧珀移动通信有限公司 | Dump operation control method, device and terminal |
CN106484617A (en) * | 2016-10-09 | 2017-03-08 | 武汉斗鱼网络科技有限公司 | Statistical method and system are automatically analyzed for the dump file of Windows software product |
CN106649089A (en) * | 2016-10-09 | 2017-05-10 | 武汉斗鱼网络科技有限公司 | Application crash analysis method and system |
CN107301056A (en) * | 2017-07-27 | 2017-10-27 | 上海斐讯数据通信技术有限公司 | A kind of AP online upgradings processing method and processing device |
Non-Patent Citations (8)
Title |
---|
DREAMLINS: "obj,lib,dll,exe的关系", 《HTTPS://BLOG.CSDN.NET/DREAMLINS/ARTICLE/DETAILS/6298013》 * |
PHP中文网: "php vardump", 《HTTPS://WWW.PHP.CN/PHP-NOTEBOOK-185085.HTML》 * |
PICLIST: "Exception Pointers", 《HTTP://WWW.PICLIST.COM/TECHREF/OS/WIN/API/WIN32/STRUC/SRC/STR07_11.HTM》 * |
PRAKER: "C++中.h和.cpp的关系", 《HTTPS://BLOG.CSDN.NET/PRAKER/ARTICLE/DETAILS/38231757》 * |
QWLONG007: "minidump", 《HTTPS://BLOG.CSDN.NET/QWLONG007/ARTICLE/DETAILS/7301737》 * |
VOIDCC: "aws pg_dump不包括全局变量", 《HTTP://CN.VOIDCC.COM/QUESTION/P-DVKUNIYV-BA.HTML》 * |
WANXIU.: "异常结构体EXCEPTION_RECORD structure", 《HTTPS://BLOG.CSDN.NET/LVWX369/ARTICLE/DETAILS/41866673》 * |
言止予思: "window下使用SetUnhandledExceptionFilter捕获让程序的崩溃", 《HTTPS://WWW.CNBLOGS.COM/LISUYUN/P/5245609.HTML》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414270A (en) * | 2020-03-24 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Exception handling method and device |
CN111414270B (en) * | 2020-03-24 | 2023-05-09 | 北京字节跳动网络技术有限公司 | Exception handling method and device |
CN113010440A (en) * | 2021-04-29 | 2021-06-22 | 福建天晴在线互动科技有限公司 | Method and system for realizing windows program exception feedback |
CN113220495A (en) * | 2021-05-24 | 2021-08-06 | 浙江大华技术股份有限公司 | Process abnormal event processing method and device, electronic equipment and storage medium |
CN113220495B (en) * | 2021-05-24 | 2024-04-16 | 浙江大华技术股份有限公司 | Method and device for processing process abnormal event, electronic equipment and storage medium |
CN113742122A (en) * | 2021-08-19 | 2021-12-03 | 深圳Tcl新技术有限公司 | Exception handling method and device, storage medium and electronic equipment |
CN117149667A (en) * | 2023-10-31 | 2023-12-01 | 宁德时代新能源科技股份有限公司 | Abnormal data acquisition method, device, equipment and computer readable storage medium |
CN117149667B (en) * | 2023-10-31 | 2024-04-05 | 宁德时代新能源科技股份有限公司 | Abnormal data acquisition method, device, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110032502B (en) | 2023-05-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110032502A (en) | A kind of method, apparatus and electronic equipment of abnormality processing | |
JP6832867B2 (en) | Methods and devices for verifying images based on image verification codes | |
CN110249307A (en) | System and method for executing primary contract on block chain | |
US11272012B2 (en) | Action processing associated with a cloud device | |
CN111901294A (en) | Method for constructing online machine learning project and machine learning system | |
CN106201811B (en) | The fault recovery method and terminal of application program | |
CN108763060A (en) | Native layers of collapse source tracing method, device, storage medium and terminal in android system | |
CN108255719A (en) | A kind of application program dump file acquisition methods, device and electronic equipment | |
US10372466B2 (en) | Rule-based monitoring engine with tracing capabilities for multi-threaded logging | |
CN106855861A (en) | File merging method and device and electronic equipment | |
Del Rincón et al. | Common-sense reasoning for human action recognition | |
US20170344462A1 (en) | Preservation of Modifications After Overlay Removal from a Container | |
CN104246693B (en) | Information processing unit for protecting the data in call stack and method | |
US9380001B2 (en) | Deploying and modifying a service-oriented architecture deployment environment model | |
CN108829753A (en) | A kind of information processing method and device | |
CN108920379B (en) | Method and device for capturing lua code exception | |
US10944587B2 (en) | Event processing associated with a smart device | |
CN116071590A (en) | Model training method, system, computer device and storage medium | |
CN105610639A (en) | Total log grabbing method and device | |
CN106131237B (en) | Communication control method and device between container | |
CN114356520A (en) | Running method, device, equipment, storage medium and program product of micro application | |
CN108133149A (en) | A kind of data guard method, device and electronic equipment | |
CN108845953B (en) | Interface testing method and device | |
CN105446718B (en) | Method of managing software and system based on red cap software package manager | |
CN104092557A (en) | Data collecting method, server, terminal and system |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20230511 Address after: Unit 02, Room 2202, Building 11, No. 51 Xingang East Road, Haizhu District, Guangzhou City, Guangdong Province, 510000 (for office only) Applicant after: Guangzhou Kangjin Information Technology Co.,Ltd. Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building Applicant before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |