CN114371949A - Application program exception processing method, device, device and storage medium - Google Patents

Application program exception processing method, device, device and storage medium Download PDF

Info

Publication number
CN114371949A
CN114371949A CN202011101982.5A CN202011101982A CN114371949A CN 114371949 A CN114371949 A CN 114371949A CN 202011101982 A CN202011101982 A CN 202011101982A CN 114371949 A CN114371949 A CN 114371949A
Authority
CN
China
Prior art keywords
exception
target
application program
thread
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011101982.5A
Other languages
Chinese (zh)
Other versions
CN114371949B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011101982.5A priority Critical patent/CN114371949B/en
Publication of CN114371949A publication Critical patent/CN114371949A/en
Application granted granted Critical
Publication of CN114371949B publication Critical patent/CN114371949B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for processing application program exception, wherein the method comprises the following steps: monitoring the running state of the application program; when the application program runs abnormally, determining a system architecture layer corresponding to the abnormality; when the exception is located in an application layer, determining a category to which the exception belongs; determining an exception handling strategy according to the category of the exception; when the exception is positioned in the local framework layer, monitoring a signal in the exception through a signal processing function; when the exception includes a target signal, acquiring a current value of a target register; and adjusting the current value of the target register to a safe value so that the application program operates normally. By adopting the technical scheme, the method and the device adopt the graded recovery measures for the abnormity of the application program, reduce the flash back condition of the application program, and improve the running stability of the application program, thereby reducing the perception of the user to the abnormity and reducing the user loss of the application program.

Description

应用程序异常的处理方法、装置、设备及存储介质Application program exception processing method, device, device and storage medium

技术领域technical field

本申请涉及移动通信技术领域,尤其涉及一种应用程序异常的处理方法、装置、设备及存储介质。The present application relates to the field of mobile communication technologies, and in particular, to a method, apparatus, device, and storage medium for processing application program exceptions.

背景技术Background technique

现有技术对应用程序的线上异常进行处理时,需要制作补丁包(patch),该方法中,应用程序(APP)需要提前监控用户侧是否发生异常,并将异常信息收集上报,但用户可能会拒绝APP收集这些异常信息上报。且制作下发patch流程一般较长,需要卷入的人员较多。从用户端发生闪退(Crash)到监控到大量用户端Crash触发警报需要一定时间;发patch需要找到对应线上版本的源码,定位修复问题后,需要重新构建apk,与现网的apk进行差分处理(diff);制作好patch包后,还需要测试人员在测试环境中进行回归测试,各种机型、ROM版本都需要回归一遍,通过后才能发布到现网;且发布到现网还需要灰度放量,观察修复效果,一整套流程下来,耗时一般为2-3小时。此外,由于发送patch需要一定的时间,在用户侧可能表现为不断Crash,影响用户正常使用APP,甚至会造成用户流失。In the prior art, a patch package (patch) needs to be created when processing an online exception of an application program. In this method, the application program (APP) needs to monitor whether an exception occurs on the user side in advance, and collect and report the exception information, but the user may The APP will be refused to collect and report these abnormal information. In addition, the patch production and distribution process is generally long, and more people need to be involved. It takes a certain amount of time from the occurrence of a crash on the client side to the monitoring of a large number of client-side crashes that trigger an alarm; to send a patch, you need to find the source code of the corresponding online version, and after locating and fixing the problem, you need to rebuild the apk and make a difference with the apk of the existing network Processing (diff); after the patch package is made, testers need to perform regression testing in the test environment. Various models and ROM versions need to be regressed once before they can be released to the live network; and they need to be released to the live network. The grayscale volume is increased, and the repair effect is observed, and the whole process is completed, which generally takes 2-3 hours. In addition, since it takes a certain amount of time to send a patch, it may appear as a continuous crash on the user side, which affects the user's normal use of the APP, and even causes user loss.

因此,有必要提供一种应用程序异常的处理方法、装置、设备及存储介质,对应用程序的异常采取分级恢复措施,从而减少应用程序的闪退情况,提高应用程序的运行稳定性。Therefore, it is necessary to provide a method, device, device, and storage medium for processing application program exceptions, and adopting hierarchical recovery measures for application program exceptions, thereby reducing application program flashbacks and improving application program operation stability.

发明内容SUMMARY OF THE INVENTION

本申请提供了一种应用程序异常的处理方法、装置、设备及存储介质,可以减少应用程序的闪退情况,提高应用程序的运行稳定性,从而减少用户对异常的感知,减少应用程序的用户流失。The present application provides a method, device, device and storage medium for handling application program exceptions, which can reduce the flashback situation of application programs and improve the running stability of application programs, thereby reducing users' perception of exceptions and reducing the number of users of application programs. churn.

一方面,本申请提供了一种应用程序异常的处理方法,所述方法包括:On the one hand, the present application provides a method for processing application exceptions, the method comprising:

监测应用程序的运行状态;Monitor the running status of the application;

当所述应用程序运行异常时,确定所述异常对应的系统架构层;When the application program runs abnormally, determine the system architecture layer corresponding to the abnormality;

当所述异常位于应用层时,确定所述异常所属的类别;When the exception is located at the application layer, determine the category to which the exception belongs;

根据所述异常所属的类别,确定所述异常的处理策略;Determine a processing strategy for the exception according to the category to which the exception belongs;

当所述异常位于本地框架层时,通过信号处理函数监听所述异常中的信号;When the exception is located at the local framework layer, the signal in the exception is monitored through a signal processing function;

当所述异常中包括目标信号时,获取目标寄存器的当前值;When the exception includes the target signal, obtain the current value of the target register;

将所述目标寄存器的当前值调整为安全值,以使所述应用程序正常运行。The current value of the target register is adjusted to a safe value for the application to function properly.

另一方面提供了一种应用程序异常的处理装置,所述装置包括:Another aspect provides an apparatus for processing application exceptions, the apparatus comprising:

状态监测模块,用于监测应用程序的运行状态;Status monitoring module for monitoring the running status of the application;

系统架构层确定模块,用于当所述应用程序运行异常时,确定所述异常对应的系统架构层;a system architecture layer determination module, configured to determine the system architecture layer corresponding to the exception when the application program runs abnormally;

类别确定模块,用于当所述异常位于应用层时,确定所述异常所属的类别;a category determination module, configured to determine the category to which the exception belongs when the exception is located at the application layer;

处理策略确定模块,用于根据所述异常所属的类别,确定所述异常的处理策略;a processing strategy determination module, configured to determine a processing strategy for the exception according to the category to which the exception belongs;

信号监听模块,用于当所述异常位于本地框架层时,通过信号处理函数监听所述异常中的信号;a signal monitoring module, used for monitoring the signal in the exception through a signal processing function when the exception is located at the local framework layer;

当前值获取模块,用于当所述异常中包括目标信号时,获取目标寄存器的当前值;A current value acquisition module, configured to acquire the current value of the target register when the exception includes the target signal;

当前值调整模块,用于将所述目标寄存器的当前值调整为安全值,以使所述应用程序正常运行。The current value adjustment module is configured to adjust the current value of the target register to a safe value, so that the application program can run normally.

另一方面提供了一种应用程序异常的处理设备,所述设备包括处理器和存储器,所述存储器中存储有至少一条指令或至少一段程序,所述至少一条指令或所述至少一段程序由所述处理器加载并执行以实现如上所述的应用程序异常的处理方法。Another aspect provides an application program exception processing device, the device includes a processor and a memory, the memory stores at least one instruction or at least a piece of program, the at least one instruction or the at least one piece of program is stored by the The processor is loaded and executed to implement the above-mentioned application program exception processing method.

另一方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有至少一条指令或至少一段程序,所述至少一条指令或至少一段程序由处理器加载并执行以实现如上所述的应用程序异常的处理方法。Another aspect provides a computer-readable storage medium storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by a processor to implement the above The application exception handling method.

本申请提供的应用程序异常的处理方法、装置、设备及存储介质,具有如下技术效果:The application program exception processing method, device, device and storage medium provided by this application have the following technical effects:

本申请中当应用程序运行异常时,确定异常对应的系统架构层,并对位于不同层的异常采取不同的处理策略;对于应用层异常,根据异常类别采取对应处理策略;对于本地框架层异常,通过修改寄存器的当前值使应用程序恢复正常。采用本申请的技术方案,对应用程序的异常采取分级恢复措施,减少了应用程序的闪退情况,提高了应用程序的运行稳定性,从而减少了用户对异常的感知,减少了应用程序的用户流失。In this application, when the application program runs abnormally, the system architecture layer corresponding to the exception is determined, and different processing strategies are adopted for exceptions located at different layers; for application layer exceptions, corresponding processing strategies are adopted according to the exception category; for local framework layer exceptions, Bring the application back to normal by modifying the current value of the register. By adopting the technical solution of the present application, graded recovery measures are taken for the abnormality of the application program, the flashback of the application program is reduced, the running stability of the application program is improved, the user's perception of the abnormality is reduced, and the number of users of the application program is reduced. churn.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案和优点,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它附图。In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or in the prior art, the following briefly introduces the accompanying drawings used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description The drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1是本申请实施例提供的一种应用程序异常的处理系统的示意图;FIG. 1 is a schematic diagram of a processing system for abnormal application programs provided by an embodiment of the present application;

图2是本申请实施例提供的一种应用程序异常的处理方法的流程示意图;2 is a schematic flowchart of a method for processing an application program exception provided by an embodiment of the present application;

图3是本申请实施例提供的一种通过Thread.uncaught Exception Handler(简称Uncaught Handler)监听异常的方法的流程示意图;3 is a schematic flowchart of a method for monitoring exceptions through Thread.uncaught Exception Handler (referred to as Uncaught Handler) provided by an embodiment of the present application;

图4是本申请实施例提供的一种根据异常所属的类别,确定异常的处理策略的方法的流程示意图;FIG. 4 is a schematic flowchart of a method for determining an exception handling strategy according to the category to which the exception belongs, provided by an embodiment of the present application;

图5是本申请实施例提供的当异常位于应用层且无法确定异常所属的类别时的异常处理方法的流程示意图;5 is a schematic flowchart of an exception handling method provided by an embodiment of the present application when the exception is located at the application layer and the category to which the exception belongs cannot be determined;

图6是本申请实施例提供的目标线程中不包括消息处理类时的异常处理方法的流程示意图;6 is a schematic flowchart of an exception processing method when a target thread provided by an embodiment of the present application does not include a message processing class;

图7是本申请实施例提供的一种获取目标寄存器的当前值的方法的流程示意图;7 is a schematic flowchart of a method for obtaining a current value of a target register provided by an embodiment of the present application;

图8是本申请实施例提供的一种区块链系统的结构示意图;8 is a schematic structural diagram of a blockchain system provided by an embodiment of the present application;

图9是本申请实施例提供的区块结构示意图;9 is a schematic diagram of a block structure provided by an embodiment of the present application;

图10是本申请实施例提供的一种应用程序异常的处理装置的结构示意图;FIG. 10 is a schematic structural diagram of an apparatus for processing application program exceptions provided by an embodiment of the present application;

图11是本申请实施例提供的一种服务器的结构示意图。FIG. 11 is a schematic structural diagram of a server provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。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. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present application.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或服务器不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or server comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

请参阅图1,图1是本申请实施例提供的一种应用程序异常的处理系统的示意图,如图1所示,该应用程序异常的处理系统可以至少包括服务器01和客户端02。Please refer to FIG. 1 . FIG. 1 is a schematic diagram of a system for processing application program exceptions provided by an embodiment of the present application. As shown in FIG. 1 , the system for processing application program exceptions may at least include a server 01 and a client 02 .

具体的,本说明书实施例中,所述服务器01可以包括一个独立运行的服务器,或者分布式服务器,或者由多个服务器组成的服务器集群,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(ContentDelivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。服务器01可以包括有网络通信单元、处理器和存储器等等。具体的,所述服务器01可以用于存储应用程序的异常信息以及异常处理策略。Specifically, in the embodiment of this specification, the server 01 may include an independently running server, or a distributed server, or a server cluster composed of multiple servers, and may also provide cloud services, cloud databases, cloud computing, cloud Cloud servers for basic cloud computing services such as functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server 01 may include a network communication unit, a processor, a memory, and the like. Specifically, the server 01 may be used to store the exception information of the application and the exception handling strategy.

具体的,本说明书实施例中,所述客户端02可以包括智能手机、台式电脑、平板电脑、笔记本电脑、数字助理、智能可穿戴设备、车载终端等类型的实体设备,也可以包括运行于实体设备中的软体,例如一些服务商提供给用户的网页页面,也可以为该些服务商提供给用户的应用。具体的,所述客户端02可以用于确定应用程序的异常类别,并进行应用程序异常的处理。Specifically, in the embodiment of this specification, the client 02 may include a smart phone, a desktop computer, a tablet computer, a notebook computer, a digital assistant, a smart wearable device, a vehicle-mounted terminal, and other types of physical devices, and may also include physical devices running on an entity Software in the device, such as web pages provided by some service providers to users, may also be applications provided by these service providers to users. Specifically, the client 02 can be used to determine the exception type of the application and process the exception of the application.

以下介绍本申请的一种应用程序异常的处理方法,图2是本申请实施例提供的一种应用程序异常的处理方法的流程示意图,本说明书提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的劳动可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的系统或服务器产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境)。具体的如图2所示,所述方法可以包括:The following describes a method for processing application program exceptions of the present application. FIG. 2 is a schematic flowchart of a method for processing application program exceptions provided by an embodiment of the present application. This specification provides method operations as described in the embodiments or flowcharts. steps, but may include more or fewer operational steps based on routine or non-creative work. The sequence of steps enumerated in the embodiments is only one of the execution sequences of many steps, and does not represent the only execution sequence. When an actual system or server product is executed, it can be executed sequentially or in parallel (for example, a parallel processor or a multi-threaded processing environment) according to the embodiments or the methods shown in the accompanying drawings. Specifically, as shown in Figure 2, the method may include:

S201:监测应用程序的运行状态。S201: Monitor the running state of the application program.

在本说明书实施例中,应用程序可以为终端中应用程序,例如,应用程序可以为游戏应用程序、新闻应用程序、多媒体信息应用程序等;通过终端监测应用程序的运行状态,运行状态可以包括正常运行状态和异常运行状态。In the embodiment of this specification, the application program may be an application program in a terminal, for example, the application program may be a game application program, a news application program, a multimedia information application program, etc.; the running status of the application program is monitored by the terminal, and the running status may include normal Operating status and abnormal operating status.

S203:当应用程序运行异常时,确定异常对应的系统架构层。S203: When the application program runs abnormally, determine the system architecture layer corresponding to the abnormality.

在本说明书实施例中,异常对应的系统架构层可以包括应用层和本地框架层。在安卓系统中,应用层可以为JVM(Java Virtual Machine)层,该层是指采用Java/Kotlin编写的安卓(Android)应用层,一般为dex文件,dex文件是Android系统的可执行文件,包含应用程序的全部操作指令以及运行时数据;本地框架层可以为Native层;Native层是指采用c/c++编写的Android动态链接库,一般为so文件;so文件是Linux下的程序函数库,即编译好的可以供其他程序使用的代码和数据。在应用程序运行过程中,可能会由于内存不足、链接错误等因素引起一些列的异常情况,如果不对异常进行处理,则会导致应用程序无法继续正常运行,甚至出现应用程序频繁闪退(Crash)的情况。闪退是指在打开或使用应用程序时出现的突然退出中断的情况,表现为应用程序画面一闪而过,随即退回到桌面。此时,可以根据异常情况对应的系统构架层,确定相应的异常处理策略。本申请的技术方案不仅适应于安卓系统,还可以扩展到iOS系统、和windows系统。In the embodiments of this specification, the system architecture layer corresponding to the exception may include an application layer and a local framework layer. In the Android system, the application layer can be the JVM (Java Virtual Machine) layer, which refers to the Android (Android) application layer written in Java/Kotlin, generally a dex file, which is an executable file of the Android system, including All operation instructions and runtime data of the application; the local framework layer can be the native layer; the native layer refers to the Android dynamic link library written in c/c++, which is generally a so file; the so file is the program function library under Linux, that is Compiled code and data that can be used by other programs. During the running of the application, some series of abnormal conditions may be caused by factors such as insufficient memory and link errors. If the exception is not handled, the application will not be able to continue to run normally, and even the application may crash frequently. Case. Flashback refers to the sudden exit interruption when opening or using an application, which is manifested as a flash of the application screen and then back to the desktop. At this time, the corresponding exception handling strategy can be determined according to the system architecture layer corresponding to the abnormal situation. The technical solution of the present application is not only suitable for the Android system, but also can be extended to the iOS system and the windows system.

在本说明书实施例中,应用程序在正式投入应用之前,测试人员都会对其进行测试分析,通过测试可以发现一些异常,例如边缘路径异常、后台配置异常、接口数据异常、个别只读存储器(Read-Only Memory,ROM)兼容性异常等,对于这些异常,可以设置对应的处理策略,从而避免弹窗告知用户,不会影响用户正常使用应用程序。但是仍然会存在测试人员没有发现的异常,即未捕获异常,本说明书实施例中的异常即是指未捕获的异常。In the embodiments of this specification, testers will test and analyze the application program before it is officially put into application, and some anomalies can be found through testing, such as edge path anomaly, background configuration anomaly, interface data anomaly, individual read-only memory (Read Only Memory) anomalies. -Only Memory, ROM) compatibility exceptions, etc. For these exceptions, you can set the corresponding processing strategy, so as to avoid the pop-up window to inform the user, and it will not affect the user's normal use of the application. However, there are still exceptions that are not found by the tester, that is, uncaught exceptions, and the exceptions in the embodiments of this specification refer to uncaught exceptions.

S205:当异常位于应用层时,确定异常所属的类别。S205: When the exception is located in the application layer, determine the category to which the exception belongs.

在本说明书实施例中,在安卓系统中,应用层可以为JVM(Java Virtual Machine)层;异常所属的类别可以包括内存不足异常、链接错误异常或其他载入黑名单中的严重异常。在安卓系统中,可以通过注册Thread.uncaught Exception Handler监听异常,并恰当的处理异常信息,从而绕过系统杀死异常进程,避免应用程序闪退。In the embodiment of this specification, in the Android system, the application layer may be a JVM (Java Virtual Machine) layer; the category to which the exception belongs may include an insufficient memory exception, a link error exception, or other serious exceptions loaded into the blacklist. In the Android system, you can monitor exceptions by registering Thread.uncaught Exception Handler, and handle the exception information appropriately, so as to bypass the system to kill the abnormal process and prevent the application from crashing.

在一个具体的实施例中,如图3所示,图3为通过Thread.uncaught ExceptionHandler(简称Uncaught Handler)监听异常的方法流程图,首先在应用程序中创建进程,然后调用Uncaught Handler应用程序接口,通过运行Uncaught Handler对进程进行监控,判断应用程序中进程是否发生异常,若是,则查找是否存在异常进程对应的捕捉块(catchblock),从而确定未捕获异常并销毁异常线程,销毁异常线程之后继续返回调用UncaughtHandler的步骤;若不存在异常进程对应的捕捉块,则返回运行Uncaught Handler的步骤。调用Uncaught Handler应用程序接口可以在应用程序中杀死异常进程,还可以向服务器发送弹窗消息,告知测试人员具体的闪退崩溃信息。测试人员可以为应用程序的开发人员;弹窗消息可以以Toast提示框的形式发出,Toast提示框是一种非模态弹窗,它弹出一个小信息,作为提醒或消息反馈来用,一般用来显示操作结果,或者应用状态的改变。例如当用户发出了一条短信时,App弹出一个Toast提示用户消息已发出。In a specific embodiment, as shown in Figure 3, Figure 3 is a flowchart of a method for monitoring exceptions through Thread.uncaught ExceptionHandler (referred to as Uncaught Handler). First, a process is created in the application program, and then the Uncaught Handler application program interface is called, Monitor the process by running the Uncaught Handler to determine whether the process in the application is abnormal. If so, find out whether there is a catch block corresponding to the abnormal process, so as to determine the uncaught exception and destroy the abnormal thread, and continue to return after destroying the abnormal thread. The step of calling UncaughtHandler; if there is no catch block corresponding to the abnormal process, return to the step of running the Uncaught Handler. Calling the Uncaught Handler API can kill the abnormal process in the application, and can also send a pop-up message to the server to inform the tester of the specific flashback crash information. The tester can be the developer of the application; the pop-up message can be sent in the form of a toast prompt box. The toast prompt box is a non-modal pop-up window that pops up a small message as a reminder or message feedback. to display the result of an operation, or a change in application state. For example, when the user sends a text message, the App pops up a Toast to remind the user that the message has been sent.

S207:根据异常所属的类别,确定异常的处理策略。S207: Determine an exception handling strategy according to the category to which the exception belongs.

在本说明书实施例中,可以根据异常所属的类别,调用不同的函数确定处理策略对异常进行处理,从而避免应用程序闪退。In the embodiment of the present specification, different functions may be called to determine a processing strategy to process the exception according to the category to which the exception belongs, so as to prevent the application from crashing.

具体的,在本说明书实施例中,如图4所示,根据异常所属的类别,确定异常的处理策略可以包括:Specifically, in the embodiment of the present specification, as shown in FIG. 4 , according to the category to which the exception belongs, the processing strategy for determining the exception may include:

S2071:当异常为内存不足时,进行内存缓存清理并忽略异常。S2071: When the exception is insufficient memory, perform memory cache cleaning and ignore the exception.

在本说明书实施例中,内存不足(out of memory,OMO)是指应用程序的内部存储空间不足,此时,需要进行内存清理,释放内存空间;当进行内存缓存清理时可以进行图片库内存缓存清理;忽略异常是指应用程序不会进行闪退,仍然显示当前页面,当内存缓存清理完成后,应用程序继续正常运行。在安卓系统中,可以通过调用Finalize time outException的应用程序接口(Application Programming Interface,API)忽略异常。In the embodiment of this specification, out of memory (OMO) refers to insufficient internal storage space of the application program. At this time, memory cleaning needs to be performed to release the memory space; when the memory cache cleaning is performed, the image library memory cache can be performed. Cleanup; ignoring exceptions means that the application will not flash back, and the current page will still be displayed. After the memory cache is cleaned up, the application will continue to run normally. In the Android system, the exception can be ignored by calling the Application Programming Interface (API) of Finalize time outException.

S2073:当异常为链接错误时,关闭异常插件。S2073: When the exception is a link error, close the exception plug-in.

在本说明书实施例中,链接错误可以为Linkage Error,对于微信应用程序,Linkage Error可以为微信的朋友圈链接错误。此时,可以通过关闭朋友圈对应插件,避免微信应用程序出现闪退。In the embodiment of this specification, the link error may be Linkage Error, and for the WeChat application, the Linkage Error may be the link error of WeChat Moments. At this time, you can close the corresponding plug-in in the circle of friends to avoid the flashback of the WeChat application.

具体的,在本说明书实施例中,当异常为链接错误时,关闭异常插件可以包括:Specifically, in the embodiment of this specification, when the exception is a link error, closing the exception plug-in may include:

S20731:当异常为链接错误时,确定异常对应的异常栈信息;S20731: When the exception is a link error, determine the exception stack information corresponding to the exception;

在本说明书实施例中,可以通过Linkage Error应用程序接口,确定异常对应的异常栈信息。In the embodiment of this specification, the information of the exception stack corresponding to the exception can be determined through the Linkage Error application program interface.

S20733:根据异常栈信息,确定异常插件;S20733: Determine the exception plug-in according to the exception stack information;

在本说明书实施例中,可以通过异常栈的相关属性信息,确定异常对应的异常插件。In the embodiment of the present specification, the exception plug-in corresponding to the exception may be determined through the relevant attribute information of the exception stack.

S20735:关闭异常插件。S20735: Close the abnormal plug-in.

在本说明书实施例中,可以通过关闭异常插件,消除应用程序中异常,避免应用程序闪退,该操作也是指对应用程序中异常进行忽略。In the embodiment of this specification, the exception in the application program can be eliminated by closing the exception plug-in, so as to avoid the application program from flashing back. This operation also refers to ignoring the exception in the application program.

S2075:当异常为黑名单中异常时,重启应用程序并跳转至目标页面,目标页面为应用程序重启之前的页面。S2075: When the exception is an exception in the blacklist, restart the application and jump to the target page, where the target page is the page before the application restarts.

在本说明书实施例中,黑名单中异常可以为测试人员自定义的异常;该类异常通常是指系统无法处理的严重异常,例如黑名单中异常可以包括类找不到的异常、SD卡不可用异常或其他系统无法处理的异常。目标页面为应用程序重启之前的页面,即应用程序重启之前,用户最后停留的页面。对于该异常,需要重启应用程序,且重启后页面为重启之前用户最后停留的页面,从而便于应用程序对应用户继续浏览之前停留的页面,不需要再从应用程序的首页开始浏览,提高了用户的浏览效率。本说明书实施例中用户是指正在使用应用程序的用户。In the embodiment of this specification, the exceptions in the blacklist can be customized exceptions by testers; such exceptions usually refer to serious exceptions that cannot be handled by the system. Use exceptions or exceptions that cannot be handled by other systems. The target page is the page before the application restarts, that is, the last page the user stays before the application restarts. For this exception, the application needs to be restarted, and the page after the restart is the last page the user stayed before the restart, so that the application corresponds to the user to continue to browse the page that was left before, and there is no need to start browsing from the home page of the application, which improves the user's experience. Browsing efficiency. In the embodiment of this specification, a user refers to a user who is using an application program.

在本说明书实施例中,如图5所示,当异常位于应用层且无法确定异常所属的类别时,该方法还可以包括:In the embodiment of this specification, as shown in FIG. 5 , when the exception is located at the application layer and the category to which the exception belongs cannot be determined, the method may further include:

S2061:调用系统应用程序接口确定异常对应的目标线程;S2061: Call the system application program interface to determine the target thread corresponding to the exception;

在本说明书实施例中,系统应用程序接口可以为Thread.uncaught ExceptionHandler,通过该API可以获取应用程序当前发生的异常对应的目标线程,目标线程即为异常对应的线程,线程是任务调度和执行的基本单位。Handler主要用于异步消息的处理:当发出一个消息之后,首先进入一个消息队列,发送消息的函数即刻返回,而另外一个部分在消息队列中逐一将消息取出,然后对消息进行处理,也就是发送消息和接收消息不是同步的处理。这种机制通常用来处理相对耗时比较长的操作。In the embodiment of this specification, the system application program interface can be Thread.uncaught ExceptionHandler, through which the target thread corresponding to the exception currently occurring in the application program can be obtained. The target thread is the thread corresponding to the exception, and the thread is the task scheduling and execution. basic unit. Handler is mainly used for asynchronous message processing: when a message is sent, it first enters a message queue, the function that sends the message returns immediately, and the other part takes out the messages one by one in the message queue, and then processes the message, that is, sends Messages and receiving messages are not synchronous processes. This mechanism is usually used to handle relatively time-consuming operations.

S2063:判断目标线程中是否包括消息处理类;S2063: Determine whether the target thread includes a message processing class;

在本说明书实施例中,消息处理类可以为Looper类;Handler里面有一个重要的成员变量Looper,Looper里面维护了一个消息队列(Message Queue),当我们使用handler.post或者send Message相关的方法都是将消息Message放入到消息队列中。每一个线程都将拥有一个自己的Looper。In the embodiment of this specification, the message processing class can be the Looper class; Handler has an important member variable Looper, which maintains a message queue (Message Queue), when we use handler.post or send Message related methods are all Is to put the message Message into the message queue. Each thread will have its own Looper.

Android中的Looper类,是用来封装消息循环和消息队列的一个类,用于在android线程中进行消息处理。handler其实可以看做是一个工具类,用来向消息队列中插入消息的。The Looper class in Android is a class used to encapsulate message loops and message queues for message processing in android threads. Handler can actually be seen as a tool class used to insert messages into the message queue.

(1)Looper类用来为一个线程开启一个消息循环。(1) The Looper class is used to open a message loop for a thread.

默认情况下android中新诞生的线程是没有开启消息循环的。(主线程除外,主线程系统会自动为其创建Looper对象,开启消息循环。)By default, the newly born thread in android does not open the message loop. (Except the main thread, the main thread system will automatically create a Looper object for it and open the message loop.)

Looper对象通过Message Queue来存放消息和事件。一个线程只能有一个Looper,对应一个Message Queue。Looper objects store messages and events through Message Queue. A thread can only have one Looper, corresponding to one Message Queue.

(2)通常是通过Handler对象来与Looper进行交互的。Handler可看做是Looper的一个接口,用来向指定的Looper发送消息及定义处理方法。(2) It usually interacts with Looper through the Handler object. Handler can be regarded as an interface of Looper, which is used to send messages and define processing methods to the specified Looper.

默认情况下Handler会与其被定义时所在线程的Looper绑定,比如,Handler在主线程中定义,那么它是与主线程的Looper绑定。By default, Handler is bound to the Looper of the thread where it is defined. For example, if Handler is defined in the main thread, it is bound to the Looper of the main thread.

S2065:若目标线程中包括消息处理类,判断目标线程是否为主线程;S2065: If the target thread includes a message processing class, determine whether the target thread is the main thread;

具体的,在本说明书实施例中,当目标线程中包括消息处理类Looper类时,进一步判断目标线程是否为主线程。主线程是当一个程序启动时,就有一个进程被操作系统(OS)创建,与此同时一个线程也立刻运行。因为它是程序开始时就执行的,如果需要再创建线程,那么创建的线程就是这个主线程的子线程。每个进程至少都有一个主线程,在Winform中,应该就是创建GUI的线程。主线程的重要性体现在两方面:1.是产生其他子线程的线程;2.通常它必须最后完成执行比如执行各种关闭动作。每个线程都有一个唯一标示符,来区分线程中的主次关系的说法。Specifically, in the embodiment of this specification, when the target thread includes a message processing class Looper, it is further judged whether the target thread is the main thread. The main thread is when a program starts, a process is created by the operating system (OS), and a thread runs immediately at the same time. Because it is executed at the beginning of the program, if you need to create a thread, the created thread is a child thread of the main thread. Each process has at least one main thread. In Winform, it should be the thread that creates the GUI. The importance of the main thread is reflected in two aspects: 1. It is the thread that spawns other sub-threads; 2. Usually it must complete the execution at the end, such as performing various shutdown actions. Each thread has a unique identifier to distinguish the primary and secondary relationship in the thread.

线程唯一标示符:Thread.CurrentThread.ManagedThreadID;例如UI界面和Main函数均为主线程。被Thread包含的“方法体”或者“委托”均为子线程。委托可以包含多个方法体,利用this.Invoke去执行。也可以定义多种方法体,放在Thread里面去执行。则此方法体均为子线程。Thread unique identifier: Thread.CurrentThread.ManagedThreadID; for example, both the UI interface and the Main function are the main thread. The "method body" or "delegate" contained by Thread are all child threads. A delegate can contain multiple method bodies, which are executed using this.Invoke. You can also define multiple method bodies and put them in Thread to execute. Then this method body is a child thread.

在本说明书实施例中,可以通过第一函数判断目标线程是否为主线程;第一函数可以为Looper.loop()。In the embodiment of this specification, whether the target thread is the main thread can be determined through the first function; the first function can be Looper.loop().

S2067:若目标线程为主线程,关闭目标线程对应的当前页面;S2067: If the target thread is the main thread, close the current page corresponding to the target thread;

在本说明书实施例中,当目标线程为主线程时,需要关闭目标线程对应的当前页面,从而避免应用程序发生闪退。In the embodiment of the present specification, when the target thread is the main thread, the current page corresponding to the target thread needs to be closed, so as to prevent the application program from crashing.

S2069:若目标线程为非主线程,继续运行目标线程。S2069: If the target thread is a non-main thread, continue to run the target thread.

在本说明书实施例中,目标线程为非主线程时,目标线程可以为子线程,当目标线程为子线程时,则可以忽略异常,继续运行目标线程。In the embodiment of this specification, when the target thread is a non-main thread, the target thread can be a sub-thread, and when the target thread is a sub-thread, the exception can be ignored and the target thread can continue to run.

具体的,在本说明书实施例中,如图6所示,若目标线程中不包括消息处理类,该方法还可以包括:Specifically, in the embodiment of this specification, as shown in FIG. 6 , if the target thread does not include a message processing class, the method may further include:

S20661:判断目标线程是否为异常线程;S20661: Determine whether the target thread is an abnormal thread;

在本说明书实施例中,可以通过第二函数判断目标线程是否为异常线程;第二函数可以为Thread.run()。In the embodiment of the present specification, whether the target thread is an abnormal thread can be determined through a second function; the second function can be Thread.run().

S20663:若目标线程为异常线程,关闭异常线程;S20663: If the target thread is an abnormal thread, close the abnormal thread;

在本说明书实施例中,通过查找并关闭异常线程,可以避免应用程序闪退。In the embodiment of the present specification, by finding and closing the abnormal thread, the application program can be prevented from crashing.

S20665:若目标线程为非异常线程,继续运行目标线程。S20665: If the target thread is a non-abnormal thread, continue to run the target thread.

S209:当异常位于本地框架层时,通过信号处理函数监听异常中的信号。S209: When the exception is located at the local framework layer, the signal in the exception is monitored through the signal processing function.

在本说明书实施例中,在安卓系统中,本地框架层可以为Native层,其中,信号处理函数可以为signal函数,通过注册signal函数可以监听异常中信号。In the embodiments of this specification, in the Android system, the local framework layer may be the Native layer, wherein the signal processing function may be the signal function, and the signal in the exception may be monitored by registering the signal function.

S2011:当异常中包括目标信号时,获取目标寄存器的当前值。S2011: When the exception includes the target signal, obtain the current value of the target register.

在本说明书实施例中,目标信号可以包括sigsegv、sigabrt等信号,当监听到目标信号时,即获取目标寄存器的当前值。In the embodiment of this specification, the target signal may include signals such as sigsegv, sigabrt, etc. When the target signal is monitored, the current value of the target register is acquired.

在本说明书实施例中,如图7所示,当异常中包括目标信号时,获取目标寄存器的当前值包括:In the embodiment of this specification, as shown in FIG. 7 , when the exception includes the target signal, acquiring the current value of the target register includes:

S20111:当异常中包括目标信号时,获取异常的上下文信息;S20111: When the exception includes the target signal, obtain the context information of the exception;

在本说明书实施例中,异常的上下文信息(context)中可以包括各个寄存器的值和状态信息。In the embodiment of the present specification, the context information (context) of the exception may include the value and status information of each register.

S20113:根据异常的上下文信息,获取目标寄存器的当前值。S20113: Acquire the current value of the target register according to the abnormal context information.

在本说明书实施例中,可以通过context确定目标寄存器的当前值。目标寄存器可以包括PC寄存器和SP寄存器;PC寄存器负责储存内存地址,该地址指向下一条即将执行的指令,每解释执行完一条指令,pc寄存器的值就会自动被更新为下一条指令的地址;PC是16位程序计数器(Program Counter),它不属于特殊功能寄存器范畴,程序员不以像访问特殊功能寄存器那样来访问PC。SP(Stack Pointer)寄存器指的是堆栈指针寄存器,指示堆栈的栈顶地址。In this embodiment of the present specification, the current value of the target register may be determined through context. The target register can include the PC register and the SP register; the PC register is responsible for storing the memory address, which points to the next instruction to be executed. After each instruction is interpreted and executed, the value of the pc register will be automatically updated to the address of the next instruction; PC is a 16-bit program counter (Program Counter), which does not belong to the category of special function registers. Programmers do not access the PC like accessing special function registers. The SP (Stack Pointer) register refers to the stack pointer register, which indicates the top address of the stack.

S2013:将目标寄存器的当前值调整为安全值,以使应用程序正常运行。S2013: Adjust the current value of the target register to a safe value to make the application run normally.

在本说明书实施例中,当异常发生时,目标寄存器的当前值即为异常值,可以将目标寄存器的值修改到安全值,可以绕过异常的方法,采用另一种方法继续执行应用程序的当前流程,从而保证应用程序正常运行。In the embodiments of this specification, when an exception occurs, the current value of the target register is the abnormal value, the value of the target register can be modified to a safe value, the exception method can be bypassed, and another method can be used to continue executing the application program. current process, thus guaranteeing the normal operation of the application.

具体的,在本说明书实施例中,将目标寄存器的当前值调整为安全值,以使应用程序正常运行的步骤之前,该方法还可以包括:Specifically, in the embodiment of this specification, before the step of adjusting the current value of the target register to a safe value so that the application program runs normally, the method may further include:

通过异常的上下文信息,回溯异常的调用栈。Through the context information of the exception, backtrack the call stack of the exception.

具体的,在本说明书实施例中,异常的上下文信息,即信号处理函数的栈帧会记录当前栈的地址、寄存器的值、函数的返回值(ret)的地址,通过这些信息可以回溯出调用栈,这就是back trace的原理。Specifically, in the embodiment of this specification, the context information of the exception, that is, the stack frame of the signal processing function, will record the address of the current stack, the value of the register, and the address of the return value (ret) of the function. Through these information, the call can be traced back. Stack, this is the principle of back trace.

在本说明书实施例中,调用栈(Call stack,),简称为“栈”(the stack),别称有:执行栈(execution stack)、控制栈(control stack)、运行时栈(run-time stack)与机器栈(machine stack),是计算机科学中存储有关正在运行的子程序的消息的栈。有时仅称“栈”,但栈中不一定仅存储子程序消息。几乎所有计算机程序都依赖于调用栈,然而高级语言一般将调用栈的细节隐藏至后台。In the embodiments of this specification, a call stack (Call stack), referred to as "the stack" for short, is also referred to as an execution stack (execution stack), a control stack (control stack), and a run-time stack (run-time stack). ) and the machine stack, a stack in computer science that stores messages about running subroutines. Sometimes just called "stack", but the stack does not necessarily store only subroutine messages. Almost all computer programs rely on call stacks, however high-level languages generally hide the details of the call stack into the background.

调用栈最经常被用于存放子程序的返回地址。在调用任何子程序时,主程序都必须暂存子程序运行完毕后应该返回到的地址。因此,如果被调用的子程序还要调用其他的子程序,其自身的返回地址就必须存入调用栈,在其自身运行完毕后再行取回。在递归程序中,每一层次递归都必须在调用栈上增加一条地址,因此如果程序出现无限递归(或仅仅是过多的递归层次),调用栈就会产生栈溢出。The call stack is most often used to store the return address of a subroutine. When calling any subroutine, the main program must temporarily store the address to which the subroutine should return after running. Therefore, if the called subroutine also calls other subroutines, its own return address must be stored in the call stack, and then retrieved after its own execution. In a recursive program, each level of recursion must add an address to the call stack, so if the program has infinite recursion (or just too many levels of recursion), the call stack will overflow.

调用栈的主要功能是存放返回地址。除此之外,调用栈还用于存放:The main function of the call stack is to store the return address. In addition, the call stack is also used to store:

·本地变量:子程序的变量可以存入调用栈,这样可以达到不同子程序间变量分离开的作用。· Local variables: The variables of subroutines can be stored in the call stack, which can achieve the effect of separating variables between different subroutines.

·参数传递:如果寄存器不足以容纳子程序的参数,可以在调用栈上存入参数。· Parameter passing: If the register is not enough to hold the parameters of the subroutine, the parameters can be stored on the call stack.

·环境传递:有些语言(如Pascal与Ada)支持“多层子程序”,即子程序中可以利用主程序的本地变量。这些变量可以通过调用栈传入子程序。·Environment transfer: Some languages (such as Pascal and Ada) support "multi-layer subprograms", that is, the local variables of the main program can be used in the subprograms. These variables can be passed into subroutines via the call stack.

在本说明书实施例中,将目标寄存器的当前值调整为安全值,以使应用程序正常运行包括:In the embodiment of this specification, adjusting the current value of the target register to a safe value so that the application program runs normally includes:

通过调用栈将目标寄存器的值调整为安全值,以使应用程序正常运行。Adjust the value of the target register to a safe value through the call stack for the application to function properly.

在本说明书实施例中,可以通过调用栈修改目标寄存器的值,例如可以通过调用栈分别将PC寄存器和SP寄存器的值修改到每个寄存器的安全范围之内,从而避免应用程序闪退。In the embodiments of the present specification, the value of the target register can be modified through the call stack, for example, the values of the PC register and the SP register can be modified respectively within the safe range of each register through the call stack, so as to avoid application program flashback.

在本说明书实施例中,在发生异常时,针对非严重的异常,采取自动重试、忽略等方式,减少用户感知;针对严重的异常,会自动重启用户最后停留的页面,避免弹窗打扰用户;由于采取了分级的恢复措施,大大减少了用户对异常的感知,保障了主路径的使用体验,为发送补丁包(patch)争取了更多的时间,提高了应用程序的稳定性,减少了用户的投诉。In the embodiments of this specification, when an exception occurs, for non-serious exceptions, methods such as automatic retry and ignoring are adopted to reduce user perception; for serious exceptions, the last page the user stayed on will be automatically restarted to avoid pop-up windows disturbing the user ; Due to the adoption of graded recovery measures, the user's perception of abnormality is greatly reduced, the experience of using the main path is guaranteed, more time is gained for sending patch packages (patch), the stability of the application is improved, and the User complaints.

在本说明书实施例中,当应用程序运行异常并恢复正常运行时,该方法还包括:In the embodiment of this specification, when the application program runs abnormally and resumes normal operation, the method further includes:

向服务器发送提示消息,提示消息包括应用程序的异常信息以及异常处理策略。Send a prompt message to the server, and the prompt message includes the exception information of the application and the exception handling strategy.

在本说明书实施例中,当应用程序的异常处理完成之后,可以向应用程序对应的后台服务器发送提示消息,以使服务器存储应用程序的异常信息以及异常处理策略。In the embodiment of this specification, after the exception processing of the application program is completed, a prompt message may be sent to the background server corresponding to the application program, so that the server stores the exception information of the application program and the exception handling strategy.

具体的,在本说明书实施例中,该方法还可以包括:Specifically, in the embodiment of this specification, the method may further include:

服务器基于区块链系统存储应用程序的异常信息以及异常处理策略,区块链系统包括多个节点,多个节点之间形成点对点网络。The server stores the exception information of the application and the exception handling strategy based on the blockchain system. The blockchain system includes multiple nodes, and a peer-to-peer network is formed between the multiple nodes.

在一些实施例中,区块链系统可以为图8所示的结构,多个节点之间形成组成的点对点(P2P,Peer To Peer)网络,P2P协议是一个运行在传输控制协议(TCP,TransmissionControl Protocol)协议之上的应用层协议。在区块链系统中,任何机器如服务器、终端都可以加入而成为节点,节点包括硬件层、中间层、操作系统层和应用层。In some embodiments, the blockchain system may be the structure shown in FIG. 8 , a peer-to-peer (P2P, Peer To Peer) network is formed between multiple nodes, and the P2P protocol is a transmission control protocol (TCP, Transmission Control Protocol) application layer protocol above the protocol. In the blockchain system, any machine such as server and terminal can join to become a node, and the node includes hardware layer, middle layer, operating system layer and application layer.

图8示出的区块链系统中各节点的功能,涉及的功能包括:The functions of each node in the blockchain system shown in Figure 8 include:

1)路由,节点具有的基本功能,用于支持节点之间的通信。1) Routing, a basic function that a node has to support communication between nodes.

节点除具有路由功能外,还可以具有以下功能:In addition to the routing function, a node can also have the following functions:

2)应用,用于部署在区块链中,根据实际业务需求而实现特定业务,记录实现功能相关的数据形成记录数据,在记录数据中携带数字签名以表示任务数据的来源,将记录数据发送到区块链系统中的其他节点,供其他节点在验证记录数据来源以及完整性成功时,将记录数据添加到临时区块中。2) Application, used to deploy in the blockchain, implement specific business according to actual business needs, record data related to the realization of functions to form record data, carry a digital signature in the record data to indicate the source of the task data, and send the record data To other nodes in the blockchain system, for other nodes to add the record data to the temporary block when verifying the source and integrity of the record data successfully.

3)区块链,包括一系列按照产生的先后时间顺序相互接续的区块(Block),新区块一旦加入到区块链中就不会再被移除,区块中记录了区块链系统中节点提交的记录数据。3) Blockchain, including a series of blocks (Blocks) that follow each other in chronological order. Once a new block is added to the blockchain, it will not be removed. The block records the blockchain system. The record data submitted by the middle node.

在一些实施例中,区块结构(Block Structure)可以为图9所示的结构,每个区块中包括本区块存储交易记录的哈希值(本区块的哈希值)、以及前一区块的哈希值,各区块通过哈希值连接形成区块链。另外,区块中还可以包括有区块生成时的时间戳等信息。区块链(Block chain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了相关的信息,用于验证其信息的有效性(防伪)和生成下一个区块。In some embodiments, the block structure (Block Structure) may be the structure shown in FIG. 9 , and each block includes the hash value of the transaction record stored in the block (the hash value of the block), and the previous block. The hash value of a block, each block is connected by the hash value to form a blockchain. In addition, the block may also include information such as a timestamp when the block was generated. Blockchain (Block chain) is essentially a decentralized database, which is a series of data blocks associated with cryptographic methods. Each data block contains relevant information to verify the validity of its information. security (anti-counterfeiting) and generating the next block.

由以上本说明书实施例提供的技术方案可见,本说明书实施例中当应用程序运行异常时,确定异常对应的系统架构层,并对位于不同层的异常采取不同的处理策略;对于应用层异常,根据异常类别采取对应处理策略;对于本地框架层异常,通过修改寄存器的当前值使应用程序恢复正常。采用本申请的技术方案,对应用程序的异常采取分级恢复措施,减少了应用程序的闪退情况,提高了应用程序的运行稳定性,从而减少了用户对异常的感知,减少了应用程序的用户流失。It can be seen from the technical solutions provided by the above embodiments of this specification that when an application program runs abnormally in the embodiments of this specification, the system architecture layer corresponding to the exception is determined, and different processing strategies are adopted for exceptions located at different layers; for application layer exceptions, Corresponding processing strategies are adopted according to the exception category; for local framework layer exceptions, the application program can be restored to normal by modifying the current value of the register. By adopting the technical solution of the present application, graded recovery measures are taken for the abnormality of the application program, the flashback of the application program is reduced, the running stability of the application program is improved, the user's perception of the abnormality is reduced, and the number of users of the application program is reduced. churn.

本申请实施例还提供了一种应用程序异常的处理装置,如图10所示,装置包括:The embodiment of the present application also provides an apparatus for processing an application program exception. As shown in FIG. 10 , the apparatus includes:

状态监测模块1010,用于监测应用程序的运行状态;a state monitoring module 1010, used to monitor the running state of the application;

系统架构层确定模块1020,用于当应用程序运行异常时,确定异常对应的系统架构层;The system architecture layer determination module 1020 is configured to determine the system architecture layer corresponding to the exception when the application program runs abnormally;

类别确定模块1030,用于当异常位于应用层时,确定异常所属的类别;a category determination module 1030, configured to determine the category to which the exception belongs when the exception is located at the application layer;

处理策略确定模块1040,用于根据异常所属的类别,确定异常的处理策略;a processing strategy determining module 1040, configured to determine a processing strategy for the exception according to the category to which the exception belongs;

信号监听模块1050,用于当异常位于本地框架层时,通过信号处理函数监听异常中的信号;The signal monitoring module 1050 is used to monitor the abnormal signal through the signal processing function when the abnormality is located in the local framework layer;

当前值获取模块1060,用于当异常中包括目标信号时,获取目标寄存器的当前值;The current value obtaining module 1060 is configured to obtain the current value of the target register when the target signal is included in the exception;

当前值调整模块1070,用于将目标寄存器的当前值调整为安全值,以使应用程序正常运行。The current value adjustment module 1070 is configured to adjust the current value of the target register to a safe value, so that the application program can run normally.

在一些实施例中,处理策略确定模块可以包括:In some embodiments, the processing policy determination module may include:

第一处理模块,用于当所述异常为内存不足时,进行内存缓存清理并忽略所述异常;a first processing module, configured to perform memory cache cleaning and ignore the exception when the exception is insufficient memory;

第二处理模块,用于当所述异常为链接错误时,关闭异常插件;a second processing module, configured to close the exception plug-in when the exception is a link error;

第三处理模块,用于当所述异常为黑名单中异常时,重启所述应用程序并跳转至目标页面,所述目标页面为所述应用程序重启之前的页面。A third processing module, configured to restart the application and jump to a target page when the exception is an exception in the blacklist, where the target page is the page before the application is restarted.

在一些实施例中,第二处理模块可以包括:In some embodiments, the second processing module may include:

异常栈信息确定单元,用于当所述异常为链接错误时,确定所述异常对应的异常栈信息;an exception stack information determination unit, configured to determine the exception stack information corresponding to the exception when the exception is a link error;

异常插件确定单元,用于根据所述异常栈信息,确定异常插件;an exception plug-in determining unit, configured to determine the exception plug-in according to the exception stack information;

异常插件关闭单元,用于关闭所述异常插件。The abnormal plug-in closing unit is used to close the abnormal plug-in.

在一些实施例中,当所述异常位于应用层且无法确定所述异常所属的类别时,该装置还可以包括:In some embodiments, when the exception is located at the application layer and the category to which the exception belongs cannot be determined, the apparatus may further include:

目标线程确定模块,用于调用系统应用程序接口确定所述异常对应的目标线程;a target thread determination module, used to call the system application program interface to determine the target thread corresponding to the exception;

第一判断模块,用于判断所述目标线程中是否包括消息处理类;a first judgment module, used for judging whether the target thread includes a message processing class;

第二判断模块,用于若所述目标线程中包括消息处理类,判断所述目标线程是否为主线程;A second judgment module, configured to judge whether the target thread is the main thread if the target thread includes a message processing class;

当前页面关闭模块,用于若所述目标线程为主线程,关闭所述目标线程对应的当前页面;The current page closing module is used to close the current page corresponding to the target thread if the target thread is the main thread;

第一目标线程运行模块,用于若所述目标线程为非主线程,继续运行所述目标线程。The first target thread running module is configured to continue to run the target thread if the target thread is a non-main thread.

在一些实施例中,若所述目标线程中不包括消息处理类,该装置还可以包括:In some embodiments, if the target thread does not include a message processing class, the apparatus may further include:

异常线程判断模块,用于判断所述目标线程是否为异常线程;an abnormal thread judgment module, used for judging whether the target thread is an abnormal thread;

异常线程关闭模块,用于若所述目标线程为异常线程,关闭所述异常线程;an abnormal thread closing module, used to close the abnormal thread if the target thread is an abnormal thread;

第二目标线程运行模块,用于若所述目标线程为非异常线程,继续运行所述目标线程。The second target thread running module is configured to continue to run the target thread if the target thread is a non-abnormal thread.

在一些实施例中,当前值获取模块可以包括:In some embodiments, the current value obtaining module may include:

上下文信息获取单元,用于当所述异常中包括目标信号时,获取所述异常的上下文信息;a context information acquisition unit, configured to acquire context information of the exception when the exception includes a target signal;

当前值获取单元,用于根据所述异常的上下文信息,获取所述目标寄存器的当前值。The current value obtaining unit is configured to obtain the current value of the target register according to the context information of the exception.

在一些实施例中,该装置还可以包括:In some embodiments, the apparatus may also include:

调用栈回溯模块,用于通过所述异常的上下文信息,回溯所述异常的调用栈。The call stack backtracking module is used to backtrack the call stack of the exception through the context information of the exception.

在一些实施例中,当前值调整模块可以包括:In some embodiments, the current value adjustment module may include:

当前值调整单元,用于通过所述调用栈将目标寄存器的值调整为安全值,以使所述应用程序正常运行。The current value adjustment unit is configured to adjust the value of the target register to a safe value through the call stack, so that the application program can run normally.

该装置实施例中的装置与方法实施例基于同样地发明构思。The apparatus and method embodiments in this apparatus embodiment are based on the same inventive concept.

本申请实施例提供了一种应用程序异常的处理设备,该设备包括处理器和存储器,该存储器中存储有至少一条指令或至少一段程序,该至少一条指令或至少一段程序由该处理器加载并执行以实现如上述方法实施例所提供的应用程序异常的处理方法。An embodiment of the present application provides a device for processing application program exceptions, the device includes a processor and a memory, the memory stores at least one instruction or at least a piece of program, and the at least one instruction or at least a piece of program is loaded by the processor and executed. Execute to implement the application exception processing method provided by the above method embodiments.

本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质可设置于终端之中以保存用于实现方法实施例中一种应用程序异常的处理方法相关的至少一条指令或至少一段程序,该至少一条指令或至少一段程序由该处理器加载并执行以实现上述方法实施例提供的应用程序异常的处理方法。Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium can be set in a terminal to store at least one instruction related to implementing an application exception processing method in the method embodiment Or at least one piece of program, the at least one instruction or at least one piece of program is loaded and executed by the processor to implement the application program exception processing method provided by the above method embodiments.

可选地,在本说明书实施例中,存储介质可以位于计算机网络的多个网络服务器中的至少一个网络服务器。可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment of the present specification, the storage medium may be located in at least one network server among multiple network servers of a computer network. Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic Various media that can store program codes, such as discs or optical discs.

本说明书实施例存储器可用于存储软件程序以及模块,处理器通过运行存储在存储器的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、功能所需的应用程序等;存储数据区可存储根据设备的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器还可以包括存储器控制器,以提供处理器对存储器的访问。The memory in the embodiments of this specification may be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a stored program area and a stored data area, wherein the stored program area may store the operating system, application programs required for functions, etc.; the stored data area may store data created according to the use of the device, and the like. Additionally, the memory 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 may also include a memory controller to provide processor access to the memory.

本申请实施例所提供的应用程序异常的处理方法实施例可以在移动终端、计算机终端、服务器或者类似的运算装置中执行。以运行在服务器上为例,图11是本申请实施例提供的一种应用程序异常的处理方法的服务器的硬件结构框图。如图11所示,该服务器1100可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(CentralProcessing Units,CPU)1110(处理器1110可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器1130,一个或一个以上存储应用程序1123或数据1122的存储介质1120(例如一个或一个以上海量存储设备)。其中,存储器1130和存储介质1120可以是短暂存储或持久存储。存储在存储介质1120的程序可以包括一个或一个以上模块,每个模块可以包括对服务器中的一系列指令操作。更进一步地,中央处理器1110可以设置为与存储介质1120通信,在服务器1100上执行存储介质1120中的一系列指令操作。服务器1100还可以包括一个或一个以上电源1160,一个或一个以上有线或无线网络接口1150,一个或一个以上输入输出接口1140,和/或,一个或一个以上操作系统1121,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。The embodiments of the methods for processing application program exceptions provided by the embodiments of the present application may be executed in a mobile terminal, a computer terminal, a server, or a similar computing device. Taking running on a server as an example, FIG. 11 is a hardware structural block diagram of a server of a method for processing an application program exception provided by an embodiment of the present application. As shown in FIG. 11 , the server 1100 may vary greatly due to different configurations or performance, and may include one or more central processing units (Central Processing Units, CPU) 1110 (the processor 1110 may include but is not limited to a microprocessor MCU or programmable logic device FPGA, etc.), memory 1130 for storing data, one or more storage media 1120 (eg, one or more mass storage devices) for storing application programs 1123 or data 1122. Among them, the memory 1130 and the storage medium 1120 may be short-term storage or persistent storage. The program stored in the storage medium 1120 may include one or more modules, and each module may include a series of instruction operations on the server. Further, the central processing unit 1110 may be configured to communicate with the storage medium 1120 to execute a series of instruction operations in the storage medium 1120 on the server 1100 . Server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1140, and/or, one or more operating systems 1121, such as Windows Server™, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and so on.

输入输出接口1140可以用于经由一个网络接收或者发送数据。上述的网络具体实例可包括服务器1100的通信供应商提供的无线网络。在一个实例中,输入输出接口1140包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,输入输出接口1140可以为射频(RadioFrequency,RF)模块,其用于通过无线方式与互联网进行通讯。Input-output interface 1140 may be used to receive or transmit data via a network. The specific example of the above-mentioned network may include the wireless network provided by the communication provider of the server 1100 . In one example, the I/O interface 1140 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through the base station so as to communicate with the Internet. In one example, the input/output interface 1140 may be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.

本领域普通技术人员可以理解,图11所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,服务器1100还可包括比图11中所示更多或者更少的组件,或者具有与图11所示不同的配置。Those of ordinary skill in the art can understand that the structure shown in FIG. 11 is only a schematic diagram, which does not limit the structure of the above-mentioned electronic device. For example, the server 1100 may also include more or fewer components than shown in FIG. 11 , or have a different configuration than that shown in FIG. 11 .

本申请提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述各种可选实现方式中提供的方法。The present application provides a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various optional implementations described above.

由上述本申请提供的应用程序异常的处理方法、装置、设备或存储介质的实施例可见,本申请中当应用程序运行异常时,确定异常对应的系统架构层,并对位于不同层的异常采取不同的处理策略;对于应用层异常,根据异常类别采取对应处理策略;对于本地框架层异常,通过修改寄存器的当前值使应用程序恢复正常。采用本申请的技术方案,对应用程序的异常采取分级恢复措施,减少了应用程序的闪退情况,提高了应用程序的运行稳定性,从而减少了用户对异常的感知,减少了应用程序的用户流失。It can be seen from the above-mentioned embodiments of the application program exception processing method, device, device or storage medium provided in this application that when the application program runs abnormally in this application, the system architecture layer corresponding to the exception is determined, and the exceptions located at different layers are taken. Different processing strategies; for application layer exceptions, corresponding processing strategies are adopted according to the exception category; for local framework layer exceptions, the application program can be restored to normal by modifying the current value of the register. By adopting the technical solution of the present application, graded recovery measures are taken for the abnormality of the application program, the flashback of the application program is reduced, the running stability of the application program is improved, the user's perception of the abnormality is reduced, and the number of users of the application program is reduced. churn.

需要说明的是:上述本申请实施例先后顺序仅仅为了描述,不代表实施例的优劣。且上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。It should be noted that: the above-mentioned order of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、设备、存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus, equipment, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,的程序可以存储于一种计算机存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer storage medium. The above-mentioned storage The medium can be read-only memory, magnetic disk or optical disk, etc.

以上仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. Inside.

Claims (10)

1.一种应用程序异常的处理方法,其特征在于,所述方法包括:1. a processing method of application program exception, is characterized in that, described method comprises: 监测应用程序的运行状态;Monitor the running status of the application; 当所述应用程序运行异常时,确定所述异常对应的系统架构层;When the application program runs abnormally, determine the system architecture layer corresponding to the abnormality; 当所述异常位于应用层时,确定所述异常所属的类别;When the exception is located at the application layer, determine the category to which the exception belongs; 根据所述异常所属的类别,确定所述异常的处理策略;Determine a processing strategy for the exception according to the category to which the exception belongs; 当所述异常位于本地框架层时,通过信号处理函数监听所述异常中的信号;When the exception is located at the local framework layer, the signal in the exception is monitored through a signal processing function; 当所述异常中包括目标信号时,获取目标寄存器的当前值;When the exception includes the target signal, obtain the current value of the target register; 将所述目标寄存器的当前值调整为安全值,以使所述应用程序正常运行。The current value of the target register is adjusted to a safe value for the application to function properly. 2.根据权利要求1所述的方法,其特征在于,所述根据所述异常所属的类别,确定所述异常的处理策略包括:2 . The method according to claim 1 , wherein the determining of a processing strategy for the exception according to the category to which the exception belongs comprises: 2 . 当所述异常为内存不足时,进行内存缓存清理并忽略所述异常;When the exception is insufficient memory, perform memory cache cleaning and ignore the exception; 当所述异常为链接错误时,关闭异常插件;When the exception is a link error, close the exception plug-in; 当所述异常为黑名单中异常时,重启所述应用程序并跳转至目标页面,所述目标页面为所述应用程序重启之前的页面。When the exception is an exception in the blacklist, restart the application and jump to a target page, where the target page is the page before the application is restarted. 3.根据权利要求2所述的方法,其特征在于,所述当所述异常为链接错误时,关闭异常插件包括:3. The method according to claim 2, wherein when the exception is a link error, closing the exception plug-in comprises: 当所述异常为链接错误时,确定所述异常对应的异常栈信息;When the exception is a link error, determine the exception stack information corresponding to the exception; 根据所述异常栈信息,确定异常插件;According to the exception stack information, determine the exception plug-in; 关闭所述异常插件。Close the exception plugin. 4.根据权利要求1所述的方法,其特征在于,当所述异常位于应用层且无法确定所述异常所属的类别时,所述方法还包括:4. The method according to claim 1, wherein when the exception is located at the application layer and the category to which the exception belongs cannot be determined, the method further comprises: 调用系统应用程序接口确定所述异常对应的目标线程;Calling the system application program interface to determine the target thread corresponding to the exception; 判断所述目标线程中是否包括消息处理类;Determine whether the target thread includes a message processing class; 若所述目标线程中包括消息处理类,判断所述目标线程是否为主线程;If the target thread includes a message processing class, determine whether the target thread is the main thread; 若所述目标线程为主线程,关闭所述目标线程对应的当前页面;If the target thread is the main thread, close the current page corresponding to the target thread; 若所述目标线程为非主线程,继续运行所述目标线程。If the target thread is a non-main thread, continue to run the target thread. 5.根据权利要求4所述的方法,其特征在于,若所述目标线程中不包括消息处理类,所述方法还包括:5. The method according to claim 4, wherein, if the target thread does not include a message processing class, the method further comprises: 判断所述目标线程是否为异常线程;Determine whether the target thread is an abnormal thread; 若所述目标线程为异常线程,关闭所述异常线程;If the target thread is an abnormal thread, close the abnormal thread; 若所述目标线程为非异常线程,继续运行所述目标线程。If the target thread is a non-abnormal thread, continue to run the target thread. 6.根据权利要求1所述的方法,其特征在于,所述当所述异常中包括目标信号时,获取目标寄存器的当前值包括:6. The method according to claim 1, wherein when the exception includes a target signal, acquiring the current value of the target register comprises: 当所述异常中包括目标信号时,获取所述异常的上下文信息;When the exception includes a target signal, obtain context information of the exception; 根据所述异常的上下文信息,获取所述目标寄存器的当前值。Acquire the current value of the target register according to the context information of the exception. 7.根据权利要求1所述的方法,其特征在于,所述将所述目标寄存器的当前值调整为安全值,以使所述应用程序正常运行的步骤之前,所述方法还包括:7. The method according to claim 1, wherein before the step of adjusting the current value of the target register to a safe value so that the application program runs normally, the method further comprises: 通过所述异常的上下文信息,回溯所述异常的调用栈;Backtracking the call stack of the exception through the context information of the exception; 所述将所述目标寄存器的当前值调整为安全值,以使所述应用程序正常运行包括:The adjusting the current value of the target register to a safe value to make the application run normally includes: 通过所述调用栈将目标寄存器的值调整为安全值,以使所述应用程序正常运行。The value of the target register is adjusted to a safe value through the call stack, so that the application program can run normally. 8.一种应用程序异常的处理装置,其特征在于,所述装置包括:8. An apparatus for processing abnormality of an application program, wherein the apparatus comprises: 状态监测模块,用于监测应用程序的运行状态;Status monitoring module for monitoring the running status of the application; 系统架构层确定模块,用于当所述应用程序运行异常时,确定所述异常对应的系统架构层;a system architecture layer determination module, configured to determine the system architecture layer corresponding to the exception when the application program runs abnormally; 类别确定模块,用于当所述异常位于应用层时,确定所述异常所属的类别;a category determination module, configured to determine the category to which the exception belongs when the exception is located at the application layer; 处理策略确定模块,用于根据所述异常所属的类别,确定所述异常的处理策略;a processing strategy determination module, configured to determine a processing strategy for the exception according to the category to which the exception belongs; 信号监听模块,用于当所述异常位于本地框架层时,通过信号处理函数监听所述异常中的信号;a signal monitoring module, used for monitoring the signal in the exception through a signal processing function when the exception is located at the local framework layer; 当前值获取模块,用于当所述异常中包括目标信号时,获取目标寄存器的当前值;A current value acquisition module, configured to acquire the current value of the target register when the exception includes the target signal; 当前值调整模块,用于将所述目标寄存器的当前值调整为安全值,以使所述应用程序正常运行。The current value adjustment module is configured to adjust the current value of the target register to a safe value, so that the application program can run normally. 9.一种应用程序异常的处理设备,其特征在于,所述设备包括处理器和存储器,所述存储器中存储有至少一条指令或至少一段程序,所述至少一条指令或所述至少一段程序由所述处理器加载并执行以实现如权利要求1-7任一所述的应用程序异常的处理方法。9. A processing device for abnormal application programs, characterized in that the device comprises a processor and a memory, and the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program consists of The processor loads and executes to implement the application program exception processing method according to any one of claims 1-7. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条指令或至少一段程序,所述至少一条指令或所述至少一段程序由处理器加载并执行以实现如权利要求1-7任一所述的应用程序异常的处理方法。10. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to The method for handling application program exceptions according to any one of claims 1-7 is implemented.
CN202011101982.5A 2020-10-15 2020-10-15 Application program exception processing method, device, equipment and storage medium Active CN114371949B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011101982.5A CN114371949B (en) 2020-10-15 2020-10-15 Application program exception processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011101982.5A CN114371949B (en) 2020-10-15 2020-10-15 Application program exception processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114371949A true CN114371949A (en) 2022-04-19
CN114371949B CN114371949B (en) 2025-09-19

Family

ID=81138601

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011101982.5A Active CN114371949B (en) 2020-10-15 2020-10-15 Application program exception processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114371949B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114996098A (en) * 2022-06-24 2022-09-02 中电金信软件有限公司 Exception handling method and device
CN115328685A (en) * 2022-08-09 2022-11-11 平安壹钱包电子商务有限公司 Application exception processing method, device, equipment and medium
CN117234698A (en) * 2023-11-16 2023-12-15 荣耀终端有限公司 A program exception handling method, electronic device and storage medium
CN119397613A (en) * 2024-10-16 2025-02-07 前锦网络信息技术(上海)有限公司 Method, device and equipment for safely processing abnormal flash back of application program app

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6934832B1 (en) * 2000-01-18 2005-08-23 Ati International Srl Exception mechanism for a computer
CN101320335A (en) * 2007-06-07 2008-12-10 国际商业机器公司 Cooperative multi-task processing method in information processing system and information processing system
CN102902599A (en) * 2012-09-17 2013-01-30 华为技术有限公司 Virtual machine internal fault processing method, device and system
CN105700667A (en) * 2012-01-31 2016-06-22 联想(北京)有限公司 Application operation method and electronic device
CN106155877A (en) * 2015-03-23 2016-11-23 Tcl集团股份有限公司 A kind of fuzz testing method and system of Android application
EP3133493A1 (en) * 2015-08-17 2017-02-22 Arm Ltd Tracing of exception handling events
US9836342B1 (en) * 2014-09-05 2017-12-05 VCE IP Holding Company LLC Application alerting system and method for a computing infrastructure
US20200104204A1 (en) * 2018-09-28 2020-04-02 Nxp Usa, Inc. Fault detection circuit with progress register and status register
CN111708655A (en) * 2020-06-19 2020-09-25 北京达佳互联信息技术有限公司 Application crash processing method, device and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6934832B1 (en) * 2000-01-18 2005-08-23 Ati International Srl Exception mechanism for a computer
CN101320335A (en) * 2007-06-07 2008-12-10 国际商业机器公司 Cooperative multi-task processing method in information processing system and information processing system
CN105700667A (en) * 2012-01-31 2016-06-22 联想(北京)有限公司 Application operation method and electronic device
CN102902599A (en) * 2012-09-17 2013-01-30 华为技术有限公司 Virtual machine internal fault processing method, device and system
US9836342B1 (en) * 2014-09-05 2017-12-05 VCE IP Holding Company LLC Application alerting system and method for a computing infrastructure
CN106155877A (en) * 2015-03-23 2016-11-23 Tcl集团股份有限公司 A kind of fuzz testing method and system of Android application
EP3133493A1 (en) * 2015-08-17 2017-02-22 Arm Ltd Tracing of exception handling events
US20200104204A1 (en) * 2018-09-28 2020-04-02 Nxp Usa, Inc. Fault detection circuit with progress register and status register
CN111708655A (en) * 2020-06-19 2020-09-25 北京达佳互联信息技术有限公司 Application crash processing method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
丁宇新, 程虎: "Java虚拟机异常处理机制的设计与实现", 计算机研究与发展, no. 05, 15 May 2000 (2000-05-15), pages 110 - 114 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114996098A (en) * 2022-06-24 2022-09-02 中电金信软件有限公司 Exception handling method and device
CN114996098B (en) * 2022-06-24 2024-04-09 中电金信软件有限公司 Exception handling method and device
CN115328685A (en) * 2022-08-09 2022-11-11 平安壹钱包电子商务有限公司 Application exception processing method, device, equipment and medium
CN117234698A (en) * 2023-11-16 2023-12-15 荣耀终端有限公司 A program exception handling method, electronic device and storage medium
CN117234698B (en) * 2023-11-16 2024-04-26 荣耀终端有限公司 Program exception handling method, electronic equipment and storage medium
CN119397613A (en) * 2024-10-16 2025-02-07 前锦网络信息技术(上海)有限公司 Method, device and equipment for safely processing abnormal flash back of application program app

Also Published As

Publication number Publication date
CN114371949B (en) 2025-09-19

Similar Documents

Publication Publication Date Title
Zhang et al. Understanding and detecting software upgrade failures in distributed systems
Gallaba et al. Use and misuse of continuous integration features: An empirical study of projects that (mis) use Travis CI
US10795793B1 (en) Method and system for simulating system failures using domain-specific language constructs
CN114371949A (en) Application program exception processing method, device, device and storage medium
US9703677B2 (en) Code coverage plugin
US9836388B1 (en) Software testing environment that includes a duplicating proxy service
US9361211B2 (en) Automated generation of test cases for regression testing
Hanappi et al. Asserting reliable convergence for configuration management scripts
US9558106B1 (en) Testing service with control testing
US11675682B2 (en) Agent profiler to monitor activities and performance of software agents
US12360776B2 (en) Multi-tenant Java agent instrumentation system
CN109656773B (en) Processing framework based on IOS application abnormal crash
US11748245B2 (en) Object-oriented regression-candidate filter
US9075921B2 (en) Error simulation
US11055416B2 (en) Detecting vulnerabilities in applications during execution
Wu et al. Efficient exposure of partial failure bugs in distributed systems with inferred abstract states
CN114721809A (en) Application deployment method and device of kubernets cluster
CN115617668A (en) A compatibility test method, device and equipment
WO2015039793A1 (en) Derivation of generalized test cases
Gao et al. An empirical study on quality issues of deep learning platform
Laranjeiro et al. Experimental robustness evaluation of JMS middleware
US20200117482A1 (en) Dynamic loading of a java agent into a running process through direct process memory manipulation
Björnberg Cloud native chaos engineering for IoT systems
WO2022214200A1 (en) Method and network element for pre-upgrade use case validation
US11811804B1 (en) System and method for detecting process anomalies in a distributed computation system utilizing containers

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
GR01 Patent grant
GR01 Patent grant