CN108334415A - A kind of fault-tolerance processing method, device, terminal and storage medium - Google Patents

A kind of fault-tolerance processing method, device, terminal and storage medium Download PDF

Info

Publication number
CN108334415A
CN108334415A CN201710042066.0A CN201710042066A CN108334415A CN 108334415 A CN108334415 A CN 108334415A CN 201710042066 A CN201710042066 A CN 201710042066A CN 108334415 A CN108334415 A CN 108334415A
Authority
CN
China
Prior art keywords
fault
anomalous event
tolerant
application program
processing
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
CN201710042066.0A
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.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201710042066.0A priority Critical patent/CN108334415A/en
Publication of CN108334415A publication Critical patent/CN108334415A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0718Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in an object-oriented system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a kind of fault-tolerance processing method, device, terminal and storage medium, this method includes:Operation includes the application program for presetting fault-tolerant component;In the operational process of the application program, the anomalous event of appearance is captured;Fault-tolerant component is preset to anomalous event progress fault-tolerant processing to shield anomalous event by described.This programme realizes the stable operation of application, avoids using collapse is led to the problem of in the process of running, improves system execution efficiency.

Description

A kind of fault-tolerance processing method, device, terminal and storage medium
Technical field
The present embodiments relate to MATLAB software treatment technology more particularly to a kind of fault-tolerance processing method, device, terminals And storage medium.
Background technology
Universal with internet and mobile terminal, more and more users use mobile terminal viewing video, search letter Breath, shopping and navigation etc..Mobile terminal such as smart mobile phone, tablet computer in the process of running, the sudden strain of a muscle that often will appear application moves back, The problems such as collapse.
Passed through in the prior art when system is collapsed by being implanted into collapse detection components in being applied in mobile terminal It collapses detection components and collects relevant crash info, such as code snippet information, user information and facility information, when mobile terminal is answered When with being again started up, accessing network and the crash info is sent to service platform and being analyzed for research staff, eventually by publication New version or the mode of patch solve crash issue.
The mode of above-mentioned solution application crashes has apparent hysteresis quality, i.e., takes corresponding measure to movement after application crashes Covering is repaired or replaced to terminal applies, can not avoid the collapse of application in advance.
Invention content
The present invention provides a kind of fault-tolerance processing method, device, terminal and computer readable storage mediums, realize application Stable operation, avoid using leading to the problem of collapse in the process of running, improve system execution efficiency.
In a first aspect, an embodiment of the present invention provides a kind of fault-tolerance processing methods, including:
Operation includes the application program for presetting fault-tolerant component;
In the operational process of the application program, the anomalous event of appearance is captured;
Fault-tolerant component is preset to anomalous event progress fault-tolerant processing to shield anomalous event by described.
Second aspect, the embodiment of the present invention additionally provide a kind of fault-tolerant processing device, including:
Anomalous event trapping module is used for during operation is comprising the application program for presetting fault-tolerant component, to appearance Anomalous event is captured;
Fault-tolerant processing module, for presetting fault-tolerant component to anomalous event progress fault-tolerant processing by described to shield Anomalous event;
Reporting module is used for after shielding anomalous event, to user information, the code snippet information of the application program And facility information is collected;The information being collected into is reported.
The third aspect, the embodiment of the present invention additionally provide a kind of terminal, and the terminal includes:One or more processors; Storage device, for storing one or more programs, when one or more of programs are held by one or more of processors Row so that one or more of processors realize aforementioned fault-tolerance processing method.
Fourth aspect, the embodiment of the present invention additionally provides a kind of storage medium including computer executable instructions, described When being executed by computer processor for executing a kind of fault-tolerance processing method, this method includes computer executable instructions:Fortune Row includes the application program for presetting fault-tolerant component;In the operational process of the application program, the anomalous event of appearance is carried out Capture;Fault-tolerant component is preset to anomalous event progress fault-tolerant processing to shield anomalous event by described.
Technical solution provided in an embodiment of the present invention solves the hysteresis quality in the prior art when solving application crashes, The stable operation for realizing application avoids using collapse is led to the problem of in the process of running, improves system execution efficiency.
Description of the drawings
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, of the invention other Feature, objects and advantages will become more apparent upon:
Fig. 1 is the flow chart for the fault-tolerance processing method that the embodiment of the present invention one provides;
Fig. 2 is the flow chart of fault-tolerance processing method provided by Embodiment 2 of the present invention;
Fig. 3 is the flow chart for the fault-tolerance processing method that the embodiment of the present invention three provides;
Fig. 4 is the flow chart for the fault-tolerance processing method that the embodiment of the present invention four provides;
Fig. 5 is the flow chart for the fault-tolerance processing method that the embodiment of the present invention five provides;
Fig. 6 is the structure diagram for the fault-tolerant processing device that the embodiment of the present invention six provides;
Fig. 7 is a kind of structural schematic diagram for terminal that the embodiment of the present invention seven provides.
Specific implementation mode
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is the flow chart for the fault-tolerance processing method that the embodiment of the present invention one provides, and the present embodiment is applicable to application Program carries out the case where fault-tolerant processing, and this method can be executed by computing device such as computer, smart mobile phone, as shown in Figure 1, this reality The concrete scheme for applying example offer is as follows:
S101, operation include the application program for presetting fault-tolerant component.
In the present embodiment, this, which presets fault-tolerant component, to be embedded into application program, and fault-tolerant component and former application program have Unified calling interface, it is not necessary to modify the function codes of original application program.Illustratively, during routine call, can lead to The mode for adding call relation in the header file of former application program is crossed to load to presetting fault-tolerant component.
In the present embodiment, this is preset fault-tolerant component and can individually be customized for different application, can also be to having system One class method of one programming mode carries out fault-tolerant.It presets fault-tolerant component can in advance to be edited by programming personnel, journey is applied according to causing The reason of sequence is collapsed carries out specific aim adjustment to avoid causing abnormal and/or exception to be shielded after occurring to application program.
In the present embodiment, this preset fault-tolerant component contents of program can according to different crash events carry out it is self-defined adjustment with Solve a variety of crash issues.The default fault-tolerant component itself can individualism, it is optional after user installation finishes an application program It selects and whether this is installed presets fault-tolerant component, it, also can be by this present embodiment when research staff is in research and development application program process Preset fault-tolerant component the application program in R&D process is optimized.In the present embodiment, complete to preset fault-tolerant component After load, when operation is comprising the program for presetting fault-tolerant component, which can apply By respective calls in program operation process.
S102, in the operational process of the application program, the anomalous event of appearance is captured.
In the present embodiment, which can cause application crash, and application program sudden strain of a muscle is caused to move back or calculate The event that equipment crashes.Can when the operation for finding initiation anomalous event or refer to the capture that the anomalous event of appearance carries out When enabling program, it is carried out to obtain and is used for subsequent processing.
S103, fault-tolerant component is preset to anomalous event progress fault-tolerant processing to shield anomalous event by described.
In the present embodiment, this, which presets fault-tolerant component, to carry out corresponding fault-tolerant processing according to the different type of anomalous event, Caused program, system crash when solving the problems, such as to cause due to running to abnormal event in program operation process.
In the present embodiment, which is happened at before anomalous event causes system crash, passes through the fault-tolerant group of setting Part can cause abnormal program to script, operation is handled so that anomalous event is not produced under the intervention effect of fault-tolerant component It is raw abnormal, and then program will not collapse in the process of implementation, causing abnormal event to script has carried out rational shielding. Illustratively, which includes:The easy original function for causing exception is called and is replaced by fault-tolerant function, so that fault-tolerant Function is to mask anomalous event in processing related data;The easy data type for causing data type exception is carried out forcing to turn It changes, to mask the collapse of abnormal data type initiation;When facing in the presence of crash issue caused by eavesdropping target is not removed, The registration of eavesdropping target is executed by using the mode of newly-built class and is nullified to avoid program crashing;It is abnormal when capturing forwarding When event, that is, when there is the message that message forwarding is not implemented, turning for the message is realized by the function being arranged in fault-tolerant component Hair is to shield by the abnormal caused crash issue of message forwarding.
A kind of fault-tolerance processing method is present embodiments provided, using what is disposed in advance to anomalous event before system crash Mode avoids using collapse is led to the problem of in the process of running, improves system execution efficiency.
Based on the above technical solution, after shielding anomalous event, further include:To user information, the application The code snippet information and facility information of program are collected;The information being collected into is reported.In the present solution, shielding After anomalous event, need to be collected the behavior for causing collapse that fault-tolerant component captures during fault-tolerant, illustratively, packet Include user information, the code snippet information of application program and facility information.Specifically, the information being collected into during fault-tolerant will Service platform can be reported to, service platform summarizes the information reported to optimize program, avoids potentially collapsing and ask Topic occurs.
Embodiment two
Fig. 2 is the flow chart of fault-tolerance processing method provided by Embodiment 2 of the present invention, on the basis of the above embodiment 1, Optionally, the anomalous event is anomaly parameter occur, then it is described by it is described preset fault-tolerant component to the anomalous event into Row fault-tolerant processing includes to shield anomalous event:
The calling of the original function for handling the anomalous event in the application program is replaced with to default fault-tolerant The calling of function;
If the default fault-tolerant function captures anomalous event, the anomalous event is shielded.
Hereby it is achieved that there is the appearance of system crash problem caused by anomaly parameter so that program can be with trouble-free operation.
Based on above-mentioned optimization, as shown in Fig. 2, technical solution provided in this embodiment is specific as follows:
S201, operation include the application program for presetting fault-tolerant component.
S202, in the operational process of the application program, the anomalous event of appearance is captured.
S203, the anomalous event are anomaly parameter occur, will be used to handle the anomalous event in the application program Original function calling, replace with to preset fault-tolerant function calling, if it is described preset fault-tolerant function capture abnormal thing Part then shields the anomalous event.
In the present embodiment, situations such as anomaly parameter includes empty object exception, the illegal exception of parameter, border detection is abnormal. Illustratively, original function is addObject functions, will directly cause system crash when encountering these anomaly parameters, this Scheme is in fault-tolerant processing component, using the programming side AOP (Aspect Oriented Programming, towards tangent plane programming) Fault-tolerant function tolerate_addObject is replaced original addObject functions, when operation layer code call by formula When addObject, redirects execution tolerate_addObject functions and taken nil objects during handling anomaly parameter The mode of array is excluded to shield system crash problem caused by anomaly parameter.After anomalous event shielding, program continues to Operation, to execute follow-up corresponding function.
A kind of fault-tolerance processing method is present embodiments provided, in program operation process, caused by avoiding abnormal parameters System crash problem, improves running efficiency of system, has saved system resource.
Embodiment three
Fig. 3 is that the flow chart for the fault-tolerance processing method that the embodiment of the present invention three provides on the basis of the above embodiments can Choosing, the anomalous event is data type exception occur, then described to preset fault-tolerant component to the anomalous event by described Carry out fault-tolerant processing includes to shield anomalous event:
By there are the data type of the anomalous event, unsteady state operation is preset data type in the application program, with Eliminate the anomalous event.
Hereby it is achieved that caused by data type is illegal the problem of system crash.
Based on above-mentioned optimization, as shown in figure 3, technical solution provided in this embodiment is specific as follows:
S301, operation include the application program for presetting fault-tolerant component.
S302, in the operational process of the application program, the anomalous event of appearance is captured.
S303, the anomalous event are data type exception occur, by there are the anomalous events in the application program Data type, unsteady state operation be preset data type, to eliminate the anomalous event.
In the present embodiment, it is specified that the unsteady state operation of data type, which can be by arbitrary NSObject objects unsteady state operation, Preset data type, wherein preset data type can be init data types, float data type, NSRange data class Type, CGSize data types, NSArray data types and NSDictionary data types etc..Optionally, turn in data type During changing, it is carried out at the same time the empty judgement judged with target type.Illustratively, it if former data are sky, carries out in exception It reports while jumping to operation of next code segment into line program, if not empty, then carry out the unsteady state operation of data type.
A kind of fault-tolerance processing method is present embodiments provided, in program operation process, it is illegal to avoid data type Caused system crash problem, improves running efficiency of system, has saved system resource.
Example IV
Fig. 4 is that the flow chart for the fault-tolerance processing method that the embodiment of the present invention four provides on the basis of the above embodiments can Choosing, it is described to include to shield anomalous event to anomalous event progress fault-tolerant processing by the default fault-tolerant component:
Execute key-value observer in the application program by internal extended class and/or notify the registration of monitor with It nullifies.
Hereby it is achieved that object registration and cancellation mismatch caused system crash problem.
Based on above-mentioned optimization, as shown in figure 4, technical solution provided in this embodiment is specific as follows:
S401, operation include the application program for presetting fault-tolerant component.
S402, in the operational process of the application program, the anomalous event of appearance is captured.
S403, the key-value observer in the application program is executed by internal extended class and/or notifies the note of monitor Volume and cancellation.
In the present embodiment, by dynamic creation internal extended class, pass through the initialization of extension class and the original KVO of release management (key-value object, key-value observer) and the addition and removal for notifying monitor, solution, which does not remove but to discharge, to be supervised It listens object collapse, remove the problem of unknown KVO collapses.Optionally, (just by the init-dealloc in InternalObject Beginningization function-release function) execute the addObject-removeObject functions in original NSObject array attributes, Wherein, the function of dealloc is when the reference count of object is 0, and it is interior to recycle that system can call dealloc methods automatically It deposits, when monitored object discharges, the array attribute for managing observer can be emptied, due to initialization function and release function It corresponds, so avoid the collapse for not having to remove observer when discharging the object.
Present embodiments provide a kind of fault-tolerance processing method, in program operation process, avoid key-value observer and/ Or notice monitor has registered recipient, but system crash caused by memory overflow caused by not nullifying when discharging the object Problem improves running efficiency of system, has saved system resource.
Embodiment five
Fig. 5 is that the flow chart for the fault-tolerance processing method that the embodiment of the present invention five provides on the basis of the above embodiments can Choosing, the anomalous event is that message forwarding is not implemented in operation object, then described to preset fault-tolerant component to described different by described Ordinary affair part carries out fault-tolerant processing:
Message by the way that message forwarding is not implemented described in default forwarding function pair is forwarded.
Hereby it is achieved that the shielding to not forwarding system crash caused by message.
Based on above-mentioned optimization, as shown in figure 5, technical solution provided in this embodiment is specific as follows:
S501, operation include the application program for presetting fault-tolerant component.
S502, in the operational process of the application program, the anomalous event of appearance is captured.
S503, the anomalous event are that message forwarding is not implemented in operation object, then are forwarded described in function pair not by default Realize that the message of message forwarding is forwarded.
In the present embodiment, programs and extend using AOP when realization message is forwarded, optionally, if certain object is Realize that message forwards using more agencies or pseudo- agency etc. by way of extending and either inheriting, then priority herein is low. In the present embodiment, having rewritten the function of message forwarding, (original function forwardingTargetForSelector disappears encountering Breath, which does not forward, will return to sky when exception, self is returned after rewriting, and (type for representing return value is the example of current class, similar Instancetype in Objective-C);MethodSignatureForSelector is written as returning to extension by return bare weight Function handleNilSelector;ForwardInvocation calls handleNilSelector to carry out abnormal report)), tool Body, the processing of unknown message first determines forwarding object forwardingTargetForSelector, if do not collapsed, Function signature methodSignatureForSelector is obtained, forwardInvocation is executed again if do not collapsed, During fault-tolerant, nonrecognition message is handled automatically, executing exception using the handleNilSelector of extension reports behaviour Make.
A kind of fault-tolerance processing method is present embodiments provided, it is abnormal to message forwarding is not implemented in program operation process System crash caused by event has carried out reasonable shielding, improves running efficiency of system, has saved system resource.
On the basis of the various embodiments described above, fault-tolerant component is preset to anomalous event progress fault-tolerant processing by described After shielding anomalous event, further include:Fault-tolerant processing is recorded;If the historical record of fault-tolerant processing reaches setting item Part receives server and restarts instruction according to what fault-tolerant processing historical record issued, then by the application recovery to initial State.This programme is applicable to the solution that homepage starts crash issue, specifically, using two layers of remedial measure, including reviews one's lessons by oneself The configuration of multiple and server is repaired.Illustratively, the historical record of the fault-tolerant processing reach setting condition (frequency of abnormity be 3 times, 5 times or 8 inferior) then by application recovery to original state, the concrete measure to restPose can be the number that empties the cache According to, empty user status file, automatic repair damage file etc..Wherein, server end class records in being recorded according to fault-tolerant processing Fault-tolerant processing number restart instruction to issue, application program, which according to this restarts instruction and carries out automatic repair, restarts.
Embodiment six
Fig. 6 is the structure diagram for the fault-tolerant processing device that the embodiment of the present invention six provides, and described device is above-mentioned for executing The fault-tolerance processing method that embodiment provides, has the corresponding function module of execution method and advantageous effect.As shown in fig. 6, described Device includes anomalous event trapping module 1, fault-tolerant processing module 2 and reporting module 3.
Wherein, anomalous event trapping module 1 is used for during operation is comprising the application program for presetting fault-tolerant component, to going out Existing anomalous event is captured;
Fault-tolerant processing module 2 is used to preset fault-tolerant component to anomalous event progress fault-tolerant processing by described to shield Anomalous event;
Reporting module 3 is used for after shielding anomalous event, to user information, the code snippet information of the application program And facility information is collected;The information being collected into is reported.
Fault-tolerant processing device provided in this embodiment, realizes the stable operation of application, avoids and apply in operational process It is middle to lead to the problem of collapse, improve system execution efficiency.
Based on the above technical solution, the anomalous event is anomaly parameter occur, then fault-tolerant processing module 2 is specific For:The calling of the original function for handling the anomalous event in the application program is replaced with to presetting fault-tolerant letter Several calling shields the anomalous event if the default fault-tolerant function captures anomalous event;
The anomalous event is data type exception occur, then fault-tolerant processing module 2 is specifically used for:By the application program Middle there are the data types of the anomalous event, and unsteady state operation is preset data type, to eliminate the anomalous event;
The anomalous event is that message forwarding is not implemented in operation object, then fault-tolerant processing module 2 is specifically used for:By default The message that message forwarding is not implemented described in forwarding function pair is forwarded;
The fault-tolerant processing module 2 is additionally operable to:The key-value observer in the application program is executed by internal extended class And/or the registration and cancellation of notice monitor;Fault-tolerant processing is recorded, if the historical record of fault-tolerant processing reaches setting Condition receives server and restarts instruction according to what fault-tolerant processing historical record issued, then by the application recovery to first Beginning state.
Embodiment seven
Fig. 7 is a kind of structural schematic diagram for terminal that the embodiment of the present invention seven provides.Fig. 7 is shown suitable for being used for realizing this The block diagram of the exemplary terminal 12 of invention embodiment.The terminal 12 that Fig. 7 is shown is only an example, should not be to of the invention real The function and use scope for applying example bring any restrictions.
As shown in fig. 7, terminal 12 is showed in the form of universal computing device.The component of terminal 12 may include but unlimited In:One or more processor or processing unit 16, system storage 28, connection different system component (including system is deposited Reservoir 28 and processing unit 16) bus 18.
Bus 18 indicates one or more in a few class bus structures, including memory bus or Memory Controller, Peripheral bus, graphics acceleration port, processor or the local bus using the arbitrary bus structures in a variety of bus structures.It lifts For example, these architectures include but not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC) Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Terminal 12 typically comprises a variety of computer system readable media.These media can be it is any can be by terminal 12 The usable medium of access, including volatile and non-volatile media, moveable and immovable medium.
System storage 28 may include the computer system readable media of form of volatile memory, such as arbitrary access Memory (RAM) 30 and/or cache memory 32.Terminal 12 may further include it is other it is removable/nonremovable, Volatile/non-volatile computer system storage medium.Only as an example, storage system 34 can be used for reading and writing irremovable , non-volatile magnetic media (Fig. 7 do not show, commonly referred to as " hard disk drive ").Although being not shown in Fig. 7, use can be provided In the disc driver to moving non-volatile magnetic disk (such as " floppy disk ") read-write, and to moving anonvolatile optical disk The CD drive of (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driver can To be connected with bus 18 by one or more data media interfaces.Memory 28 may include at least one program product, There is the program product one group of (for example, at least one) program module, these program modules to be configured to perform each implementation of the invention The function of example.
Program/utility 40 with one group of (at least one) program module 42 can be stored in such as memory 28 In, such program module 42 include but not limited to operating system, one or more application program, other program modules and Program data may include the realization of network environment in each or certain combination in these examples.Program module 42 is usual Execute the function and/or method in embodiment described in the invention.
Terminal 12 can also be communicated with one or more external equipments 14 (such as keyboard, sensing equipment, display 24 etc.), Can also be enabled a user to one or more equipment interacted with the terminal 12 communication, and/or with enable the terminal 12 with Any equipment (such as network interface card, modem etc.) communication that one or more of the other computing device is communicated.It is this logical Letter can be carried out by input/output (I/O) interface 22.Also, terminal 12 can also by network adapter 20 and one or The multiple networks of person (such as LAN (LAN), wide area network (WAN) and/or public network, such as internet) communication.As shown, Network adapter 20 is communicated by bus 18 with other modules of terminal 12.It should be understood that although not shown in the drawings, can combine Terminal 12 uses other hardware and/or software module, including but not limited to:Microcode, device driver, redundant processing unit, External disk drive array, RAID system, tape drive and data backup storage system etc..
Processing unit 16 is stored in program in system storage 28 by operation, to perform various functions application and Data processing, such as realize the fault-tolerance processing method that the embodiment of the present invention is provided.
Embodiment eight
The embodiment of the present invention eight additionally provides a kind of storage medium including computer executable instructions, and the computer can It executes instruction when being executed by computer processor for executing a kind of fault-tolerance processing method, which is characterized in that this method includes:
Operation includes the application program for presetting fault-tolerant component;
In the operational process of the application program, the anomalous event of appearance is captured;
Fault-tolerant component is preset to anomalous event progress fault-tolerant processing to shield anomalous event by described.
The arbitrary of one or more computer-readable media may be used in the computer storage media of the embodiment of the present invention Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or Device, or the arbitrary above combination.The more specific example (non exhaustive list) of computer readable storage medium includes:Tool There are one or the electrical connection of multiple conducting wires, portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD- ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer-readable storage Medium, which can be any, includes or the tangible medium of storage program, which can be commanded execution system, device or device Using or it is in connection.
Computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated, Wherein carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By instruction execution system, device either device use or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited In wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
It can be write with one or more programming languages or combinations thereof for executing the computer that operates of the present invention Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++, Further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion Divide and partly executes or executed on a remote computer or server completely on the remote computer on the user computer. Be related in the situation of remote computer, remote computer can pass through the network of any kind --- including LAN (LAN) or Wide area network (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as carried using Internet service It is connected by internet for quotient).
Note that above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The present invention is not limited to specific embodiments described here, can carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out to the present invention by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also May include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.

Claims (11)

1. a kind of fault-tolerance processing method, which is characterized in that including:
Operation includes the application program for presetting fault-tolerant component;
In the operational process of the application program, the anomalous event of appearance is captured;
Fault-tolerant component is preset to anomalous event progress fault-tolerant processing to shield anomalous event by described.
2. according to the method described in claim 1, it is characterized in that, after shielding anomalous event, further include:
User information, the code snippet information of the application program and facility information are collected;
The information being collected into is reported.
3. according to the method described in claim 1, it is characterized in that, the anomalous event is anomaly parameter occur, then described logical Cross the default fault-tolerant component includes to shield anomalous event to anomalous event progress fault-tolerant processing:
The calling of the original function for handling the anomalous event in the application program is replaced with to presetting fault-tolerant function Calling;
If the default fault-tolerant function captures anomalous event, the anomalous event is shielded.
4. according to the method described in claim 1, it is characterized in that, the anomalous event is data type exception, then institute occur It states and includes to shield anomalous event to anomalous event progress fault-tolerant processing by the default fault-tolerant component:
By, there are the data type of the anomalous event, unsteady state operation is preset data type, with elimination in the application program The anomalous event.
5. according to the method described in claim 1, it is characterized in that, described preset fault-tolerant component to the abnormal thing by described Part carries out fault-tolerant processing:
The key-value observer in the application program is executed by internal extended class and/or notifies the registration and cancellation of monitor.
6. according to the method described in claim 1, it is characterized in that, the anomalous event, which is operation object, is not implemented message turn Hair, then it is described to include to shield anomalous event to anomalous event progress fault-tolerant processing by the default fault-tolerant component:
Message by the way that message forwarding is not implemented described in default forwarding function pair is forwarded.
7. according to the method described in any one of claim 1-6, which is characterized in that preset fault-tolerant component to described by described After anomalous event carries out fault-tolerant processing to shield anomalous event, further include:
Fault-tolerant processing is recorded;
It is issued according to fault-tolerant processing historical record if the historical record of fault-tolerant processing reaches setting condition or receives server Restart instruction, then by the application recovery to original state.
8. a kind of fault-tolerant processing device, which is characterized in that including:
Anomalous event trapping module is used for during operation is comprising the application program for presetting fault-tolerant component, to the exception of appearance Event is captured;
Fault-tolerant processing module, for presetting fault-tolerant component to anomalous event progress fault-tolerant processing by described to shield exception Event;
Reporting module, for after shielding anomalous event, to user information, the code snippet information of the application program and Facility information is collected;The information being collected into is reported.
9. device according to claim 8, which is characterized in that the anomalous event is anomaly parameter occur, then fault-tolerant place Reason module is specifically used for:By the calling of the original function in the application program for handling the anomalous event, replace with pair The calling of fault-tolerant function is preset, if the default fault-tolerant function captures anomalous event, shields the anomalous event;
The anomalous event is data type exception occur, then fault-tolerant processing module is specifically used for:It will be deposited in the application program In the data type of the anomalous event, unsteady state operation is preset data type, to eliminate the anomalous event;
The anomalous event is that message forwarding is not implemented in operation object, then fault-tolerant processing module is specifically used for:Pass through default forwarding The message that message forwarding is not implemented described in function pair is forwarded;
The fault-tolerant processing module is additionally operable to:By internal extended class execute key-value observer in the application program and/or Notify the registration and cancellation of monitor;Fault-tolerant processing is recorded, if the historical record of fault-tolerant processing reaches setting condition Or receive server and restart instruction according to what fault-tolerant processing historical record issued, then by the application recovery to initial shape State.
10. a kind of terminal, which is characterized in that the terminal includes:One or more processors;Storage device, for storing one A or multiple programs, when one or more of programs are executed by one or more of processors so that one or more A processor realizes the fault-tolerance processing method as described in any in claim 1-7.
11. a kind of storage medium including computer executable instructions, the computer executable instructions are by computer disposal For executing a kind of fault-tolerance processing method when device executes, which is characterized in that this method includes:
Operation includes the application program for presetting fault-tolerant component;
In the operational process of the application program, the anomalous event of appearance is captured;
Fault-tolerant component is preset to anomalous event progress fault-tolerant processing to shield anomalous event by described.
CN201710042066.0A 2017-01-20 2017-01-20 A kind of fault-tolerance processing method, device, terminal and storage medium Pending CN108334415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710042066.0A CN108334415A (en) 2017-01-20 2017-01-20 A kind of fault-tolerance processing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710042066.0A CN108334415A (en) 2017-01-20 2017-01-20 A kind of fault-tolerance processing method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN108334415A true CN108334415A (en) 2018-07-27

Family

ID=62922141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710042066.0A Pending CN108334415A (en) 2017-01-20 2017-01-20 A kind of fault-tolerance processing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN108334415A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284217A (en) * 2018-09-28 2019-01-29 平安科技(深圳)有限公司 Application exception processing method, device, electronic equipment and storage medium
CN109408261A (en) * 2018-09-26 2019-03-01 中国平安财产保险股份有限公司 Application crash processing method, device, computer equipment and storage medium
CN109766205A (en) * 2018-12-19 2019-05-17 益萃网络科技(中国)有限公司 Abnormality eliminating method, device, computer equipment and storage medium
CN111026462A (en) * 2019-12-10 2020-04-17 百度在线网络技术(北京)有限公司 Applet control method, apparatus, device and medium
CN112835762A (en) * 2021-01-29 2021-05-25 北京奇艺世纪科技有限公司 Data processing method and device, storage medium and electronic equipment
CN112925667A (en) * 2021-03-29 2021-06-08 北京奇艺世纪科技有限公司 Method, device and equipment for preventing SDK (software development kit) from being crashed and readable storage medium
CN113626245A (en) * 2021-08-27 2021-11-09 四川虹美智能科技有限公司 Method for preventing ios application program from crashing
CN113900851A (en) * 2021-10-29 2022-01-07 广州品唯软件有限公司 Android application software control method and device
CN114090136A (en) * 2021-11-29 2022-02-25 北京金堤科技有限公司 Method and device with error correction function and supporting cross-platform calling component
WO2022206253A1 (en) * 2021-03-29 2022-10-06 北京字节跳动网络技术有限公司 Exception handling method and apparatus, device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070244937A1 (en) * 2006-04-12 2007-10-18 Flynn John T Jr System and method for application fault tolerance and recovery using topologically remotely located computing devices
CN101201770A (en) * 2006-12-15 2008-06-18 大唐移动通信设备有限公司 Method and system for storing important information before system collapse
CN102306119A (en) * 2011-06-30 2012-01-04 北京新媒传信科技有限公司 System for capturing global exception and method
CN103309668A (en) * 2013-06-17 2013-09-18 深圳Tcl新技术有限公司 Method and device for processing uncaught exception of application programs
CN105005508A (en) * 2015-07-02 2015-10-28 国云科技股份有限公司 Excellent exception processing method
CN105512015A (en) * 2015-12-15 2016-04-20 北京奇虎科技有限公司 Android target application crash calculation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070244937A1 (en) * 2006-04-12 2007-10-18 Flynn John T Jr System and method for application fault tolerance and recovery using topologically remotely located computing devices
CN101201770A (en) * 2006-12-15 2008-06-18 大唐移动通信设备有限公司 Method and system for storing important information before system collapse
CN102306119A (en) * 2011-06-30 2012-01-04 北京新媒传信科技有限公司 System for capturing global exception and method
CN103309668A (en) * 2013-06-17 2013-09-18 深圳Tcl新技术有限公司 Method and device for processing uncaught exception of application programs
CN105005508A (en) * 2015-07-02 2015-10-28 国云科技股份有限公司 Excellent exception processing method
CN105512015A (en) * 2015-12-15 2016-04-20 北京奇虎科技有限公司 Android target application crash calculation method and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109408261A (en) * 2018-09-26 2019-03-01 中国平安财产保险股份有限公司 Application crash processing method, device, computer equipment and storage medium
CN109284217A (en) * 2018-09-28 2019-01-29 平安科技(深圳)有限公司 Application exception processing method, device, electronic equipment and storage medium
CN109284217B (en) * 2018-09-28 2023-01-10 平安科技(深圳)有限公司 Application program exception handling method and device, electronic equipment and storage medium
CN109766205A (en) * 2018-12-19 2019-05-17 益萃网络科技(中国)有限公司 Abnormality eliminating method, device, computer equipment and storage medium
CN111026462A (en) * 2019-12-10 2020-04-17 百度在线网络技术(北京)有限公司 Applet control method, apparatus, device and medium
CN111026462B (en) * 2019-12-10 2023-08-29 百度在线网络技术(北京)有限公司 Applet control method, device, apparatus and medium
CN112835762A (en) * 2021-01-29 2021-05-25 北京奇艺世纪科技有限公司 Data processing method and device, storage medium and electronic equipment
CN112835762B (en) * 2021-01-29 2023-09-01 北京奇艺世纪科技有限公司 Data processing method and device, storage medium and electronic equipment
WO2022206253A1 (en) * 2021-03-29 2022-10-06 北京字节跳动网络技术有限公司 Exception handling method and apparatus, device, and storage medium
CN112925667A (en) * 2021-03-29 2021-06-08 北京奇艺世纪科技有限公司 Method, device and equipment for preventing SDK (software development kit) from being crashed and readable storage medium
CN112925667B (en) * 2021-03-29 2024-03-08 北京奇艺世纪科技有限公司 Method, device and equipment for preventing SDK from crashing and readable storage medium
CN113626245B (en) * 2021-08-27 2023-04-07 四川虹美智能科技有限公司 Method for preventing ios application program from crashing
CN113626245A (en) * 2021-08-27 2021-11-09 四川虹美智能科技有限公司 Method for preventing ios application program from crashing
CN113900851A (en) * 2021-10-29 2022-01-07 广州品唯软件有限公司 Android application software control method and device
CN114090136A (en) * 2021-11-29 2022-02-25 北京金堤科技有限公司 Method and device with error correction function and supporting cross-platform calling component

Similar Documents

Publication Publication Date Title
CN108334415A (en) A kind of fault-tolerance processing method, device, terminal and storage medium
CN109284217B (en) Application program exception handling method and device, electronic equipment and storage medium
US9104480B2 (en) Monitoring and managing memory thresholds for application request threads
US9652271B2 (en) Autonomously managed virtual machine anti-affinity rules in cloud computing environments
CN109344153B (en) Service data processing method and terminal equipment
CN111258921B (en) Garbage memory recycling method and device, electronic equipment and storage medium
CN105144074B (en) It is stored using the block of hybrid memory device
CN109542645A (en) A kind of method, apparatus, electronic equipment and storage medium calling service
US10176327B2 (en) Method and device for preventing application in an operating system from being uninstalled
CN106201468B (en) A kind of processing method of screenshotss, device and electronic equipment
CN109656885B (en) Storage space monitoring method and device, electronic terminal and storage medium
CN109308252A (en) A kind of fault location processing method and processing device
CN110377341B (en) Method, device, medium and electronic equipment for monitoring no-response exception
CN110502345A (en) A kind of overload protection method, device, computer equipment and storage medium
US9658903B2 (en) Event processing method and apparatus
CN109831581A (en) Information filtering method, device, terminal and storage medium
CN107329812B (en) A kind of method and apparatus for running association's journey
CN104461741B (en) Graphics device interface based computing device optimizing method and device
CN108958980A (en) Prevent method, electronic device and the computer readable storage medium of Activity life cycle exception
CN115952491B (en) Method, device, electronic equipment and medium for hook objective function
CN106201464A (en) A kind of application icon processing method freezing application and mobile terminal
CN110928940A (en) Data writing method and device based on kafka cluster, electronic equipment and storage medium
CN114091702A (en) Event monitoring method and device, electronic equipment and storage medium
CN108345486A (en) A kind of interface covering method, equipment and readable medium
CN106326094B (en) Check the method and system of pointer exception

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180727

RJ01 Rejection of invention patent application after publication