CN113742122A - Exception handling method and device, storage medium and electronic equipment - Google Patents

Exception handling method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113742122A
CN113742122A CN202110956670.0A CN202110956670A CN113742122A CN 113742122 A CN113742122 A CN 113742122A CN 202110956670 A CN202110956670 A CN 202110956670A CN 113742122 A CN113742122 A CN 113742122A
Authority
CN
China
Prior art keywords
exception
abnormity
function
program
smooth
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
CN202110956670.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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202110956670.0A priority Critical patent/CN113742122A/en
Publication of CN113742122A publication Critical patent/CN113742122A/en
Pending legal-status Critical Current

Links

Images

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/0793Remedial or corrective actions
    • 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/0751Error or fault detection not based on redundancy

Abstract

The application discloses an exception handling method, an exception handling device, a storage medium and electronic equipment, which relate to the technical field of computers, the method is applied to an application program developed based on a hybrid mobile application development framework, an exception smooth processing function is injected into the hybrid mobile application development framework to replace a default exception handling function, and the method comprises the following steps: monitoring the application program for abnormity through the hybrid application development framework; and when the abnormity is monitored, triggering the abnormity smooth processing function to carry out smooth processing on the abnormity so as to replace the default abnormity processing function to carry out interruption processing on the abnormity. The application effectively improves the reliability of exception handling in the application program and effectively improves the user experience.

Description

Exception handling method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to an exception handling method and apparatus, a storage medium, and an electronic device.
Background
At present, many application programs are developed based on a hybrid mobile application development framework (React Native), and the application programs inevitably have abnormalities due to various subjective or objective reasons. When an exception occurs in the existing application program, the hybrid mobile application development framework performs self-processing, and the exception processing mode of the hybrid mobile application development framework is represented as application program breakdown and flash back, so that the user experience is influenced.
Therefore, in the prior art, the problem of poor reliability exists when exception processing is carried out in the application program.
Disclosure of Invention
The embodiment of the application provides a scheme, which can effectively improve the reliability of exception handling in the application program and effectively improve user experience.
In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:
according to an embodiment of the application, an exception handling method is applied to an application program developed based on a hybrid mobile application development framework, wherein an exception smoothing processing function is injected into the hybrid mobile application development framework to replace a default exception handling function, and the method comprises the following steps: monitoring the application program for abnormity through the hybrid application development framework; and when the abnormity is monitored, triggering the abnormity smooth processing function to carry out smooth processing on the abnormity so as to replace the default abnormity processing function to carry out interruption processing on the abnormity.
In some embodiments of the present application, the hybrid application development framework includes an error boundary component, the exception smoothing function is injected into the error boundary component, and the error boundary component rewrites an exception capture method corresponding to the exception smoothing function; the monitoring of the application program for the abnormality through the hybrid application development framework includes: and performing exception capture on the application program through the exception capture method.
In some embodiments of the present application, the exception smoothing function comprises a unique exception smoothing function; when the anomaly is monitored, triggering the anomaly smoothing function to smooth the anomaly, wherein the step comprises the following steps: and when the abnormity is monitored, triggering the unique abnormity smoothing function to smooth the abnormity.
In some embodiments of the present application, the exception smoothing function includes at least one, and each of the exception smoothing functions corresponds to an exception type; when the anomaly is monitored, triggering the anomaly smoothing function to smooth the anomaly, wherein the step comprises the following steps: determining an anomaly type of the anomaly captured by the anomaly capture method; and triggering an exception smoothing function corresponding to the exception type to carry out smoothing processing on the exception.
In some embodiments of the present application, the exception type comprises an interface rendering exception; the triggering of the exception smoothing function corresponding to the exception type to smooth the exception includes: and triggering an abnormal smooth processing function corresponding to the interface rendering abnormity so as to navigate the program page of the application program to a first transition interface.
In some embodiments of the present application, the exception type includes a program exception, the program exception including exceptions other than an interface rendering exception; the triggering of the exception smoothing function corresponding to the exception type to smooth the exception includes: and triggering an exception smooth processing function corresponding to the program exception so as to navigate the program page of the application program to a second transition interface.
In some embodiments of the present application, the method further comprises: and uploading the abnormal information corresponding to the abnormality to a target log system.
In some embodiments of the present application, the application includes an application in a target internet of things device.
According to an embodiment of the present application, an exception handling apparatus applied to an application program developed based on a hybrid mobile application development framework, the hybrid mobile application development framework injecting an exception smoothing function instead of a default exception handling function, the apparatus includes: the monitoring module is used for monitoring the abnormity of the application program through the hybrid application development framework; and the processing module is used for triggering the abnormal smooth processing function to carry out smooth processing on the abnormality when the abnormality is monitored so as to replace the default abnormal processing function to carry out interrupt processing on the abnormality.
According to another embodiment of the present application, a storage medium has stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the method of an embodiment of the present application.
According to another embodiment of the present application, an electronic device may include: a memory storing a computer program; and the processor reads the computer program stored in the memory to execute the method in the embodiment of the application.
In the embodiment of the present application, the exception handling method is applied to an application program developed based on a hybrid mobile application development framework, an exception smooth processing function is injected into the hybrid mobile application development framework to replace a default exception handling function, and the exception handling method includes: monitoring the abnormality of the applied program through a hybrid application development framework; when the abnormity is monitored, triggering an abnormity smoothing function to smooth the abnormity so as to replace the default abnormity processing function to interrupt the abnormity.
In this way, an abnormal smooth processing function is injected into the hybrid mobile application development framework to replace a default abnormal processing function, the abnormal smooth processing function is triggered to carry out smooth processing on the abnormality when the abnormality is monitored, the interruption processing on the abnormality is replaced by the default abnormal processing function, and then the application program can not have interruption processes such as rushing to quit, the reliability of the abnormal processing in the application program is effectively improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 shows a schematic diagram of a system to which embodiments of the present application may be applied.
FIG. 2 shows a flow diagram of an exception handling method according to one embodiment of the present application.
FIG. 3 shows a block diagram of an exception handling apparatus according to one embodiment of the present application.
FIG. 4 shows a block diagram of an electronic device according to an embodiment of the application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, the principles of the present application are described in the foregoing text and are not meant to be limiting, as those of ordinary skill in the art will appreciate that various steps and operations described below may be implemented in hardware.
FIG. 1 shows a schematic diagram of a system 100 to which embodiments of the present application may be applied. As shown in fig. 1, the system 100 may include a server 101, a terminal 102. The terminal 102 may be any device, such as a computer, a mobile phone, a smart watch, a home appliance, and the like. The server 101 may be a server cluster or a cloud server, etc. The server 101 and the terminal 102 may be connected by a wired or wireless connection.
In an embodiment of this example, the exception handling method may be applied to an application program developed on the terminal 102 based on a hybrid mobile application development framework, an exception smoothing function is injected into the hybrid mobile application development framework to replace a default exception handling function, and the terminal 102 may execute the exception handling method, where the exception handling method includes: monitoring the abnormality of the applied program through a hybrid application development framework; when the abnormity is monitored, triggering an abnormity smoothing function to smooth the abnormity so as to replace the default abnormity processing function to interrupt the abnormity.
Among them, the terminal 102 can receive and install the application program released in the server 101. Or the terminal 102 may receive the exception smoothing function issued by the server 101, and inject the exception smoothing function into the hybrid mobile application development framework instead of the default exception smoothing function.
FIG. 2 schematically shows a flow diagram of an exception handling method according to one embodiment of the present application. The execution subject of the exception handling method may be any device, such as the terminal 102 shown in fig. 1.
As shown in fig. 2, the exception handling method may include steps S210 to S220.
The exception handling method is applied to an application program developed based on a hybrid mobile application development framework, and an exception smooth processing function is injected into the hybrid mobile application development framework to replace a default exception processing function.
Step S210, carrying out abnormity monitoring on the applied program through a mixed application development framework;
step S220, when an exception is detected, an exception smoothing function is triggered to smooth the exception, so as to replace the default exception handling function to interrupt the exception.
The hybrid mobile application development framework, namely the real Native framework, can also be called a cross-platform mobile application development framework. Applications developed based on the hybrid mobile application development framework typically perform exception handling based on the hybrid mobile application development framework.
The hybrid mobile application development framework generally performs exception handling based on a default exception handling function, and the exception handling generally represents an interrupt handling process such as a burst and quit, which affects the use and experience of a user.
By injecting an exception smoothing function into the hybrid mobile application development framework, when an exception is monitored in an application program through the hybrid application development framework, the exception smoothing function is triggered to smooth the exception, and the exception is interrupted by replacing a default exception handling function.
By cutting into the source code of the hybrid mobile application development framework, the default exception or error processing logic is blocked, and the injected exception smooth processing function is used for exception processing, the processing logic of the exception smooth processing function can be customized, and the interrupt phenomena such as breakdown flash back and the like caused by application exception in an application program can be completely and individually avoided.
Furthermore, an abnormal smooth processing function is injected into the hybrid mobile application development framework to replace a default abnormal processing function, the abnormal smooth processing function is triggered to carry out smooth processing on the abnormality when the abnormality is monitored, the interruption processing on the abnormality by the default abnormal processing function is replaced, and then the application program can not have interruption processes such as rushing and backing, so that the reliability of the abnormal processing in the application program is effectively improved, and the user experience is improved.
The following describes a specific procedure of each step performed when exception handling is performed.
The exception handling method is applied to an application program developed based on a hybrid mobile application development framework, and an exception smooth processing function is injected into the hybrid mobile application development framework to replace a default exception processing function.
In step S210, the applied program is monitored for exceptions by the hybrid application development framework.
In the embodiment of the present example, a hybrid mobile application development framework, i.e., a real Native framework, may also be referred to as a cross-platform mobile application development framework. Applications developed based on the hybrid mobile application development framework typically perform exception handling based on the hybrid mobile application development framework.
In one embodiment, the hybrid application development framework comprises an error boundary component, an exception smoothing function is injected into the error boundary component, and an exception capture method corresponding to the exception smoothing function is rewritten in the error boundary component; step S210, performing anomaly monitoring on the application program through the hybrid application development framework, including: and carrying out exception capture on the application program by an exception capture method.
The error boundary component is a component for monitoring the exception in the application program, an exception smooth processing function can be injected into the error boundary component through a global. Meanwhile, an exception capture method corresponding to the exception smooth processing function is rewritten in the error boundary component, for example, an Unhandled rejected progress processing method (exception capture method) in a hybrid application development framework is rewritten.
Furthermore, the application program can automatically call an exception capture method to capture exceptions when the error boundary component is used based on the transformation of the error boundary component, and after the exceptions are captured, a corresponding exception smoothing function can be triggered to perform exception smoothing.
In step S220, when an exception is detected, an exception smoothing function is triggered to smooth the exception, so as to replace the default exception handling function to interrupt the exception.
In the embodiment of the example, by injecting the exception smoothing function into the hybrid mobile application development framework, when an exception is detected in the application program through the hybrid application development framework, the exception smoothing function is triggered to smooth the exception, and the default exception handling function is replaced to interrupt the exception.
By cutting into the source code of the hybrid mobile application development framework, the default exception or error processing logic is blocked, and the injected exception smooth processing function is used for exception processing, the processing logic of the exception smooth processing function can be customized, and the interrupt phenomena such as breakdown flash back and the like caused by application exception in an application program can be completely and individually avoided.
In one embodiment, the exception smoothing function comprises a unique exception smoothing function; step S220, when an anomaly is detected, triggering an anomaly smoothing function to smooth the anomaly, including: and when the abnormity is monitored, triggering a unique abnormity smoothing function to smooth the abnormity.
In this manner, regardless of what exceptions are detected, a call is made to trigger a unique exception smoothing function to smooth the exceptions, e.g., to navigate a program page of an application to a unique transition interface.
In one embodiment, the exception smoothing function includes at least one, each exception smoothing function corresponding to an exception type; step S220, when an anomaly is detected, triggering an anomaly smoothing function to smooth the anomaly, including: determining an abnormality type of the abnormality captured by the abnormality capturing method; and triggering an exception smoothing function corresponding to the exception type to smooth the exception.
Each abnormal smooth processing function corresponds to one abnormal type, namely each abnormal type is provided with one corresponding abnormal processing function, when the abnormality is captured by an abnormality capturing method, the abnormal type corresponding to the abnormality is determined firstly, then the abnormal smooth processing function corresponding to the abnormal type is triggered to carry out smooth processing on the abnormality, and the reliability of the abnormal processing is further improved.
In one embodiment, the exception type includes an interface rendering exception; triggering an exception smoothing function corresponding to the exception type to smooth the exception, wherein the exception smoothing function comprises the following steps: and triggering an abnormal smooth processing function corresponding to the interface rendering abnormity so as to navigate the program page of the application program to the first transition interface.
The method comprises the steps that an interface rendering abnormity, namely an abnormity in the interface rendering process, when the interface rendering abnormity occurs, an abnormity smooth processing function corresponding to the interface rendering abnormity is triggered, and a program page of the application program is navigated to a first transition interface, wherein the first transition interface can be a transition operation interface when the interface rendering abnormity occurs, so that the application program can continue to execute interface operation while the interruption process does not occur, the abnormity processing reliability is further improved, and the user experience is improved.
In one embodiment, the exception type includes a program exception, the program exception including exceptions other than an interface rendering exception; triggering an exception smoothing function corresponding to the exception type to smooth the exception, wherein the exception smoothing function comprises the following steps: and triggering an abnormal smooth processing function corresponding to the program exception so as to navigate the program page of the application program to the second transition interface.
The program exception comprises other exceptions except for interface rendering exception, when the interface rendering exception occurs, an exception smooth processing function corresponding to the program exception is triggered, and a program page of the application program is navigated to a second transition interface, wherein the second transition interface can be a transition operation interface when the program exception occurs, so that the application program can continue to execute interface operation while the interrupt process does not occur, the exception handling reliability is further improved, and the user experience is improved.
In one embodiment, the method further comprises: and uploading the abnormal information corresponding to the abnormality to a target log system. When the smoothing processing is carried out based on the smoothing processing function, the abnormal information corresponding to the abnormality can be uploaded to a target log system for recording.
In one embodiment, the application program comprises an application program in the target internet of things device.
The target internet of things equipment can be home appliances and other internet of things equipment, such as an air conditioner, a washing machine, a TV, a refrigerator and the like, application programs in the internet of things equipment are developed through a hybrid mobile application development framework, and exception handling is carried out based on the exception handling method, so that the use performance of the internet of things equipment is effectively improved, and the user experience is improved.
In this way, based on steps S210 to S220, an exception smoothing function is injected into the hybrid mobile application development framework to replace the default exception handling function, when an exception is detected, the exception smoothing function is triggered to smooth the exception, and the default exception handling function is replaced to interrupt the exception, so that the application program does not have interrupt processes such as bursting and backing, the reliability of exception handling in the application program is effectively improved, and the user experience is improved.
In order to better implement the exception handling method provided in the embodiments of the present application, an exception handling apparatus based on the exception handling method is also provided in the embodiments of the present application. The meaning of the noun is the same as that in the above exception handling method, and the details of the implementation can refer to the description in the method embodiment. FIG. 3 shows a block diagram of an exception handling apparatus according to one embodiment of the present application.
As shown in fig. 3, the exception handling apparatus 300 is applied to an application program developed based on a hybrid mobile application development framework, in which an exception smoothing function is injected instead of a default exception handling function, and may include a monitoring module 310 and a processing module 320.
The monitoring module 310 may be configured to monitor the application for exceptions through the hybrid application development framework; the processing module 320 may be configured to, when an exception is monitored, trigger the exception smoothing function to smooth the exception, instead of the default exception handling function performing interrupt processing on the exception.
In some embodiments of the present application, the hybrid application development framework includes an error boundary component, the exception smoothing function is injected into the error boundary component, and the error boundary component rewrites an exception capture method corresponding to the exception smoothing function; the monitoring module 310 includes: and the exception capture unit is used for capturing the exception of the application program by the exception capture method.
In some embodiments of the present application, the exception smoothing function comprises a unique exception smoothing function; the processing module 320 includes: and the first processing unit is used for triggering the unique abnormal smooth processing function to carry out smooth processing on the abnormality when the abnormality is monitored.
In some embodiments of the present application, the exception smoothing function includes at least one, and each of the exception smoothing functions corresponds to an exception type; the processing module 320 includes: a type determination unit to: determining an anomaly type of the anomaly captured by the anomaly capture method; a second processing unit to: and triggering an exception smoothing function corresponding to the exception type to carry out smoothing processing on the exception.
In some embodiments of the present application, the exception type comprises an interface rendering exception; the second processing unit includes: and the rendering exception handling subunit is used for triggering an exception smooth handling function corresponding to the interface rendering exception so as to navigate the program page of the application program to the first transition interface.
In some embodiments of the present application, the exception type includes a program exception, the program exception including exceptions other than an interface rendering exception; the second processing unit includes: a program exception handling subunit to: and triggering an exception smooth processing function corresponding to the program exception so as to navigate the program page of the application program to a second transition interface.
In some embodiments of the present application, the apparatus further comprises: and the exception reporting unit is used for uploading the exception information corresponding to the exception to a target log system.
In some embodiments of the present application, the application includes an application in a target internet of things device.
In this way, based on the exception handling apparatus 300, an exception smooth processing function is injected into the hybrid mobile application development framework to replace the default exception handling function, when an exception is monitored, the exception smooth processing function is triggered to perform smooth processing on the exception, the default exception handling function is replaced to perform interrupt processing on the exception, and then the application program does not have interrupt processes such as rushing to quit, so that the reliability of exception processing in the application program is effectively improved, and the user experience is improved.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, an embodiment of the present application further provides an electronic device, where the electronic device may be a terminal or a server, as shown in fig. 4, which shows a schematic structural diagram of the electronic device according to the embodiment of the present application, and specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user pages, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions, for example, the processor 401 may execute the following steps:
monitoring the application program for abnormity through a hybrid application development framework; when an exception is monitored, triggering an exception smooth processing function to carry out smooth processing on the exception so as to replace the default exception processing function to carry out interrupt processing on the exception; the application program comprises an application program developed based on a hybrid mobile application development framework, and an exception smooth processing function is injected into the hybrid mobile application development framework to replace a default exception processing function.
In some embodiments of the present application, the hybrid application development framework includes an error boundary component, the exception smoothing function is injected into the error boundary component, and the error boundary component rewrites an exception capture method corresponding to the exception smoothing function; when the application program is monitored for the exception through the hybrid application development framework, the processor 401 may perform: and performing exception capture on the application program through the exception capture method.
In some embodiments of the present application, the exception smoothing function comprises a unique exception smoothing function; when an exception is monitored and the exception smoothing function is triggered to smooth the exception, the processor 401 may perform: and when the abnormity is monitored, triggering the unique abnormity smoothing function to smooth the abnormity.
In some embodiments of the present application, the exception smoothing function includes at least one, and each of the exception smoothing functions corresponds to an exception type; when an exception is monitored and the exception smoothing function is triggered to smooth the exception, the processor 401 may perform: determining an anomaly type of the anomaly captured by the anomaly capture method; and triggering an exception smoothing function corresponding to the exception type to carry out smoothing processing on the exception.
In some embodiments of the present application, the exception type comprises an interface rendering exception; when the exception smoothing function corresponding to the exception type is triggered to smooth the exception, the processor 401 may execute: and triggering an abnormal smooth processing function corresponding to the interface rendering abnormity so as to navigate the program page of the application program to a first transition interface.
In some embodiments of the present application, the exception type includes a program exception, the program exception including exceptions other than an interface rendering exception; when the exception smoothing function corresponding to the exception type is triggered to smooth the exception, the processor 401 may execute: and triggering an exception smooth processing function corresponding to the program exception so as to navigate the program page of the application program to a second transition interface.
In some embodiments of the present application, the processor 401 may perform: and uploading the abnormal information corresponding to the abnormality to a target log system.
In some embodiments of the present application, the application includes an application in a target internet of things device.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by a computer program, which may be stored in a computer-readable storage medium and loaded and executed by a processor, or by related hardware controlled by the computer program.
To this end, the present application further provides a storage medium, in which a computer program is stored, where the computer program can be loaded by a processor to execute the steps in any one of the methods provided in the present application.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by the methods provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the embodiments that have been described above and shown in the drawings, but that various modifications and changes can be made without departing from the scope thereof.

Claims (10)

1. An exception handling method applied to an application program developed based on a hybrid mobile application development framework, wherein an exception smoothing function is injected into the hybrid mobile application development framework to replace a default exception handling function, the method comprising:
monitoring the application program for abnormity through the hybrid application development framework;
and when the abnormity is monitored, triggering the abnormity smooth processing function to carry out smooth processing on the abnormity so as to replace the default abnormity processing function to carry out interruption processing on the abnormity.
2. The method according to claim 1, wherein the hybrid application development framework comprises an error boundary component, the exception smoothing function is injected into the error boundary component, and an exception capture method corresponding to the exception smoothing function is rewritten in the error boundary component;
the monitoring of the application program for the abnormality through the hybrid application development framework includes:
and performing exception capture on the application program through the exception capture method.
3. The method of claim 1, wherein the exception smoothing function comprises a unique exception smoothing function;
when the anomaly is monitored, triggering the anomaly smoothing function to smooth the anomaly, wherein the step comprises the following steps:
and when the abnormity is monitored, triggering the unique abnormity smoothing function to smooth the abnormity.
4. The method of claim 2, wherein said exception smoothing function comprises at least one, each said exception smoothing function corresponding to an exception type;
when the anomaly is monitored, triggering the anomaly smoothing function to smooth the anomaly, wherein the step comprises the following steps:
determining an anomaly type of the anomaly captured by the anomaly capture method;
and triggering an exception smoothing function corresponding to the exception type to carry out smoothing processing on the exception.
5. The method of claim 4, wherein the exception type comprises an interface rendering exception;
the triggering of the exception smoothing function corresponding to the exception type to smooth the exception includes:
and triggering an abnormal smooth processing function corresponding to the interface rendering abnormity so as to navigate the program page of the application program to a first transition interface.
6. The method of claim 4, wherein the exception type comprises a program exception, the program exception comprising an exception other than an interface rendering exception;
the triggering of the exception smoothing function corresponding to the exception type to smooth the exception includes:
and triggering an exception smooth processing function corresponding to the program exception so as to navigate the program page of the application program to a second transition interface.
7. The method according to any one of claims 3 to 5, further comprising:
and uploading the abnormal information corresponding to the abnormality to a target log system.
8. An exception handling apparatus applied to an application program developed based on a hybrid mobile application development framework in which an exception smoothing function is injected in place of a default exception handling function, the apparatus comprising:
the monitoring module is used for monitoring the abnormity of the application program through the hybrid application development framework;
and the processing module is used for triggering the abnormal smooth processing function to carry out smooth processing on the abnormality when the abnormality is monitored so as to replace the default abnormal processing function to carry out interrupt processing on the abnormality.
9. A storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to carry out the method of any one of claims 1 to 7.
10. An electronic device, comprising: a memory storing a computer program; a processor reading a computer program stored in the memory to perform the method of any of claims 1 to 7.
CN202110956670.0A 2021-08-19 2021-08-19 Exception handling method and device, storage medium and electronic equipment Pending CN113742122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110956670.0A CN113742122A (en) 2021-08-19 2021-08-19 Exception handling method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110956670.0A CN113742122A (en) 2021-08-19 2021-08-19 Exception handling method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113742122A true CN113742122A (en) 2021-12-03

Family

ID=78731830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110956670.0A Pending CN113742122A (en) 2021-08-19 2021-08-19 Exception handling method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113742122A (en)

Citations (3)

* 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
CN109766205A (en) * 2018-12-19 2019-05-17 益萃网络科技(中国)有限公司 Abnormality eliminating method, device, computer equipment and storage medium
CN110032502A (en) * 2018-01-11 2019-07-19 武汉斗鱼网络科技有限公司 A kind of method, apparatus and electronic equipment of abnormality processing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032502A (en) * 2018-01-11 2019-07-19 武汉斗鱼网络科技有限公司 A kind of method, apparatus and electronic equipment of abnormality processing
CN109284217A (en) * 2018-09-28 2019-01-29 平安科技(深圳)有限公司 Application exception processing method, device, electronic equipment and storage medium
CN109766205A (en) * 2018-12-19 2019-05-17 益萃网络科技(中国)有限公司 Abnormality eliminating method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佚名: "《"【从源码分析】可能是全网最实用的React Native异常解决方案》", pages 1 - 15, Retrieved from the Internet <URL:https://segmentfault.com/a/1190000023150130> *

Similar Documents

Publication Publication Date Title
CN105404525B (en) Manage the method and device of the basic input output system configuration in computer system
US11662803B2 (en) Control method, apparatus, and electronic device
US20140136570A1 (en) Controller and program
US9817731B2 (en) Acquiring diagnostic data selectively
CN113672340A (en) Incremental backup method, system and device of virtual machine and readable storage medium
JP6879625B2 (en) Programmable controller, management device and control system
CN103870347A (en) System restoring method and device
CN111581005A (en) Terminal repairing method, terminal and storage medium
CN113742122A (en) Exception handling method and device, storage medium and electronic equipment
CN110990177A (en) Fault repairing method, device, system, storage medium and electronic equipment
US8726244B2 (en) Software breakpoint handling by eliminating instruction replacement and execution under certain conditions
CN114116275A (en) Terminal abnormity repairing method and device, storage medium and electronic equipment
CN114090054A (en) Intelligent equipment upgrading method and device, storage medium and electronic equipment
CN115145381A (en) Method, system, storage medium and equipment for remotely resetting BMC chip
CN114090433A (en) Buried point data reporting control method and device, storage medium and electronic equipment
CN109445877B (en) Method for detecting same virtual machine used by multiple threads of game server
CN114244681A (en) Equipment connection fault early warning method and device, storage medium and electronic equipment
CN112328423A (en) Processing method, device and storage medium for search service loophole
CN113986142B (en) Disk fault monitoring method, device, computer equipment and storage medium
CN114328094A (en) Equipment exception information processing method and device, storage medium and electronic equipment
CN113722212B (en) CPLD upgrading test method, device, equipment and medium
JP7103804B2 (en) User interface control device, user interface control method, and user interface control program
CN117033084B (en) Virtual machine backup method and device, electronic equipment and storage medium
CN114625574A (en) Service management method, device, storage medium and electronic equipment
CN117407202A (en) Desktop icon layout repairing method and device, storage medium and electronic equipment

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