技术领域Technical Field
本申请涉及崩溃监测技术领域,尤其涉及一种崩溃事件监测方法、系统、车辆及存储介质。The present application relates to the technical field of crash monitoring, and in particular to a crash event monitoring method, system, vehicle and storage medium.
背景技术Background technique
在车辆系统运行的过程中,因其复杂性和各应用代码质量,系统及其各种服务或应用可能会遭遇某些错误或异常发生崩溃,例如Java Crash(Java崩溃)、Native Crash(原生崩溃)、ANR(Application Not Responding,应用无响应)。基于程序崩溃存在多场景和偶发的特点,不容易人为复现,因此,在系统崩溃时,不仅难定位到系统出错的具体位置,还会出现测试人员或开发人员未及时知晓的情况,从而给系统的稳定性造成隐患,进而导致整车的安全性能降低。During the operation of the vehicle system, due to its complexity and the quality of each application code, the system and its various services or applications may encounter certain errors or exceptions and crash, such as Java Crash, Native Crash, and ANR (Application Not Responding). Program crashes exist in multiple scenarios and are sporadic, which are not easy to reproduce manually. Therefore, when the system crashes, it is not only difficult to locate the specific location of the system error, but also the testers or developers may not be aware of it in time, which will cause hidden dangers to the stability of the system and reduce the safety performance of the entire vehicle.
在相关技术中,系统在探测到崩溃行为时,通常将崩溃时的信息写入日志,这些信息分散到Log Files(Log日志)、墓碑日志、Dropbox(多宝箱)、ANR日志中,基于这些日志进行崩溃修复,但因为后台应用、服务崩溃时无法直观感知,开发和测试人员仍不能及时感知到崩溃事件的发生,而且也很难从海量日志文件中获取到关键崩溃信息,使得崩溃问题的修复不及时。In related technologies, when a system detects a crash, it usually writes the crash information into a log. This information is scattered in Log Files, tombstone logs, Dropbox, and ANR logs, and crash repair is performed based on these logs. However, since the crash of background applications and services cannot be perceived intuitively, developers and testers still cannot perceive the occurrence of crash events in a timely manner, and it is also difficult to obtain key crash information from massive log files, which makes it difficult to repair crash problems in a timely manner.
发明内容Summary of the invention
为了对披露的实施例的一些方面有基本的理解,下面给出了简单的概括。所述概括不是泛泛评述,也不是要确定关键/重要组成元素或描绘这些实施例的保护范围,而是作为后面的详细说明的序言。In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key/critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
鉴于以上所述现有技术的缺点,本申请公开了一种崩溃事件监测方法、系统、车辆及存储介质,用于解决现有技术中对于系统的崩溃事件无法及时知晓以及无法及时修复的技术问题。In view of the above-mentioned shortcomings of the prior art, the present application discloses a crash event monitoring method, system, vehicle and storage medium, which are used to solve the technical problem in the prior art that system crash events cannot be known and repaired in time.
第一方面,本申请提供了一种崩溃事件监测方法,所述方法包括:获取目标系统中显示界面的截屏图片;判断所述截屏图片是否包含预设的界面样式,其中,所述界面样式的类型为颜色样式、图案样式和文字样式中任意之一,且基于所述目标系统的崩溃类型设置不同的子样式;若所述截屏图片包含所述界面样式,则确定所述截屏图片为崩溃显示界面,并确定所述目标系统发生崩溃事件,其中,所述崩溃显示界面显示有崩溃信息。In a first aspect, the present application provides a crash event monitoring method, the method comprising: obtaining a screenshot of a display interface in a target system; determining whether the screenshot contains a preset interface style, wherein the type of the interface style is any one of a color style, a pattern style, and a text style, and different sub-styles are set based on the crash type of the target system; if the screenshot contains the interface style, determining that the screenshot is a crash display interface, and determining that a crash event has occurred in the target system, wherein the crash display interface displays crash information.
于本申请一实施例中,所述判断所述截屏图片是否包含预设的界面样式,包括:将所述截屏图片分别与预设颜色样式、预设图案样式与预设文字样式对应进行颜色匹配、图案匹配与文字匹配,获得匹配结果;若所述匹配结果为所述截屏图片与所述预设颜色样式、所述预设图案样式、所述预设文字样式均不匹配,则判断所述截屏图片未包含所述界面样式;若所述匹配结果为所述截屏图片与所述预设颜色样式、所述预设图案样式、所述预设文字样式中任意之一匹配,则判断所述截屏图片包含所述界面样式。In one embodiment of the present application, determining whether the screenshot image includes a preset interface style includes: performing color matching, pattern matching, and text matching on the screenshot image with a preset color style, a preset pattern style, and a preset text style, respectively, to obtain a matching result; if the matching result is that the screenshot image does not match the preset color style, the preset pattern style, and the preset text style, then determining that the screenshot image does not include the interface style; if the matching result is that the screenshot image matches any one of the preset color style, the preset pattern style, and the preset text style, then determining that the screenshot image includes the interface style.
于本申请一实施例中,所述颜色样式的匹配,包括:根据预设的像素点位置,标定所述截屏图片中的第一目标像素点,所述第一目标像素点为至少一个;获取所述第一目标像素点的第一像素值,并将所述第一像素值与预设的像素范围进行一次比较;若所述第一像素值处于所述像素范围内,则所述截屏图片与所述预设颜色样式匹配;若所述第一像素值未在所述像素范围内,则所述截屏图片与所述预设颜色样式不匹配。In one embodiment of the present application, the matching of the color style includes: calibrating a first target pixel point in the screenshot image according to a preset pixel point position, wherein the first target pixel point is at least one; obtaining a first pixel value of the first target pixel point, and comparing the first pixel value with a preset pixel range; if the first pixel value is within the pixel range, the screenshot image matches the preset color style; if the first pixel value is not within the pixel range, the screenshot image does not match the preset color style.
于本申请一实施例中,在所述若所述第一像素值处于所述像素范围内之后,还包括:标定所述第一目标像素点的邻域像素点,获得多个第二目标像素点;获取每一所述第二目标像素点的第二像素值,并将每一所述第二像素值与所述像素范围进行二次比较;若每一所述第二像素值均处于所述像素范围内,则所述截屏图片与所述预设颜色样式匹配;若存在任一所述第二像素值未在所述像素范围内,则所述截屏图片与所述预设颜色样式不匹配。In one embodiment of the present application, after the first pixel value is within the pixel range, it also includes: calibrating the neighborhood pixel points of the first target pixel point to obtain multiple second target pixel points; obtaining the second pixel value of each of the second target pixel points, and performing a secondary comparison between each of the second pixel value and the pixel range; if each of the second pixel values is within the pixel range, the screenshot image matches the preset color style; if any of the second pixel values is not within the pixel range, the screenshot image does not match the preset color style.
于本申请一实施例中,在所述获取目标系统中显示界面的截屏图片之前,还包括:配置所述崩溃显示界面的显示功能,所述显示功能包括所述界面样式与所述崩溃信息;若接收到用于所述显示功能开启的操作指令,使得所述显示功能处于开启状态,以监听所述目标系统的运行状态。In one embodiment of the present application, before obtaining a screenshot of the display interface in the target system, it also includes: configuring a display function of the crash display interface, wherein the display function includes the interface style and the crash information; if an operation instruction for turning on the display function is received, the display function is turned on to monitor the operating status of the target system.
于本申请一实施例中,在所述获取目标系统中显示界面的截屏图片之前,还包括:监测所述目标系统的运行信息,并根据所述运行信息判断系统运行状态与程序运行状态;若所述系统运行状态为崩溃状态,则确定所述崩溃类型为系统崩溃;若所述程序运行状态为崩溃状态,则确定所述崩溃类型为程序崩溃;根据所述系统运行信息或所述程序运行信息生成所述崩溃信息;根据所述崩溃类型与所述崩溃信息,生成所述界面样式的显示指令;将工作线程切换为主线程,并响应于所述显示指令,控制所述显示界面弹出所述崩溃显示界面。In one embodiment of the present application, before obtaining a screenshot of the display interface in the target system, it also includes: monitoring the operating information of the target system, and judging the system operating status and the program operating status according to the operating information; if the system operating status is a crash state, determining the crash type as a system crash; if the program operating status is a crash state, determining the crash type as a program crash; generating the crash information according to the system operating information or the program operating information; generating a display instruction of the interface style according to the crash type and the crash information; switching the working thread to the main thread, and in response to the display instruction, controlling the display interface to pop up the crash display interface.
于本申请一实施例中,所述显示指令中携带有显示时长,所述截屏图片基于预设的时间间隔进行截取,其中,所述显示时长大于所述时间间隔。In one embodiment of the present application, the display instruction carries a display duration, and the screenshot image is captured based on a preset time interval, wherein the display duration is greater than the time interval.
于本申请一实施例中,所述界面样式的设置,包括:若所述界面样式为颜色样式,则当所述崩溃类型为系统崩溃时,将所述界面样式设置为第一颜色子样式,当所述崩溃类型为程序崩溃时,将所述界面样式设置为第二颜色子样式;若所述界面样式为图案样式,则当所述崩溃类型为系统崩溃时,将所述界面样式设置为第一图案子样式,当所述崩溃类型为程序崩溃时,将所述界面样式设置为第二图案子样式;若所述界面样式为文字样式,则当所述崩溃类型为系统崩溃时,将所述界面样式设置为第一文字子样式,当所述崩溃类型为程序崩溃时,将所述界面样式设置为第二文字子样式。In one embodiment of the present application, the setting of the interface style includes: if the interface style is a color style, then when the crash type is a system crash, the interface style is set to a first color sub-style, and when the crash type is a program crash, the interface style is set to a second color sub-style; if the interface style is a pattern style, then when the crash type is a system crash, the interface style is set to a first pattern sub-style, and when the crash type is a program crash, the interface style is set to a second pattern sub-style; if the interface style is a text style, then when the crash type is a system crash, the interface style is set to a first text sub-style, and when the crash type is a program crash, the interface style is set to a second text sub-style.
于本申请一实施例中,在所述确定所述目标系统发生崩溃事件之后,包括:根据所述界面样式,确定目标崩溃类型;当所述目标崩溃类型为系统崩溃时,按照系统崩溃修复程序,分析所述崩溃信息,生成第一崩溃修复方案,其中,所述崩溃信息至少包括系统内存状态、运行进程信息与驱动程序信息;当所述目标崩溃类型为程序崩溃时,按照程序崩溃修复程序,分析所述崩溃信息,生成第二崩溃修复方案,其中,所述崩溃信息至少包括崩溃程序的包名、进程名、运行时间与出错调用栈。In one embodiment of the present application, after determining that a crash event has occurred in the target system, the method includes: determining a target crash type according to the interface style; when the target crash type is a system crash, analyzing the crash information according to a system crash repair program, and generating a first crash repair plan, wherein the crash information includes at least system memory status, running process information, and driver program information; when the target crash type is a program crash, analyzing the crash information according to a program crash repair program, and generating a second crash repair plan, wherein the crash information includes at least the package name, process name, running time, and error call stack of the crashed program.
第二方面,本申请提供了一种崩溃事件监测系统,所述系统包括:获取模块,用于获取目标系统中显示界面的截屏图片;判断模块,用于判断所述截屏图片是否包含预设的界面样式,其中,所述界面样式的类型为颜色样式、图案样式和文字样式中任意之一,且基于所述目标系统的崩溃类型设置不同的子样式;确定模块,用于若所述截屏图片包含所述界面样式,则确定所述截屏图片为崩溃显示界面,并确定所述目标系统发生崩溃事件,其中,所述崩溃显示界面显示有崩溃信息。In a second aspect, the present application provides a crash event monitoring system, the system comprising: an acquisition module, used to acquire a screenshot of a display interface in a target system; a judgment module, used to judge whether the screenshot contains a preset interface style, wherein the type of the interface style is any one of a color style, a pattern style and a text style, and different sub-styles are set based on the crash type of the target system; a determination module, used to determine that the screenshot is a crash display interface if the screenshot contains the interface style, and determine that a crash event has occurred in the target system, wherein the crash display interface displays crash information.
第三方面,本申请提供了一种车辆,其特征在于,使用如第一方面所述的崩溃事件监测方法,或,包括如第二方面所述的崩溃事件监测系统。In a third aspect, the present application provides a vehicle, characterized in that it uses the crash event monitoring method as described in the first aspect, or includes the crash event monitoring system as described in the second aspect.
第四方面,本申请提供了一种计算机可读存储介质,其上存储有计算机程序,当计算机程序被计算机的处理器执行时,使计算机执行第一方面描述的崩溃事件监测方法。In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, enables the computer to execute the crash event monitoring method described in the first aspect.
如上所述,本申请实施例提供的一种崩溃事件监测方法、系统、车辆及存储介质,具有以下有益效果:As described above, the crash event monitoring method, system, vehicle and storage medium provided by the embodiments of the present application have the following beneficial effects:
首先获取目标系统中显示界面的截屏图片,然后判断截屏图片是否包含预设的界面样式,其中,界面样式的类型为颜色样式、图案样式和文字样式中任意之一,且基于目标系统的崩溃类型设置不同的子样式,最后若截屏图片包含界面样式,则确定截屏图片为崩溃显示界面,并确定目标系统发生崩溃事件,其中,崩溃显示界面显示有崩溃信息。这样,在目标系统发生崩溃事件时,第一,根据截屏图片中包含的界面样式,实现了崩溃事件自动化监测,以及目标系统发生崩溃事件的高效判断,使得工作人员能够及时且直观地知晓崩溃事件的发生;第二,基于截屏图片中不同的子样式,实现了目标系统的崩溃类型的高效定位;第三,基于崩溃显示界面,提供了可靠的崩溃类型和该崩溃类型对应的崩溃信息,能进一步促进崩溃事件的高效、准确修复。First, a screenshot of the display interface in the target system is obtained, and then it is determined whether the screenshot contains a preset interface style, wherein the type of the interface style is any one of a color style, a pattern style, and a text style, and different sub-styles are set based on the crash type of the target system. Finally, if the screenshot contains an interface style, it is determined that the screenshot is a crash display interface, and it is determined that a crash event has occurred in the target system, wherein the crash display interface displays crash information. In this way, when a crash event occurs in the target system, firstly, based on the interface style contained in the screenshot, automatic monitoring of crash events and efficient judgment of crash events in the target system are realized, so that the staff can know the occurrence of the crash event in a timely and intuitive manner; secondly, based on the different sub-styles in the screenshot, efficient positioning of the crash type of the target system is realized; thirdly, based on the crash display interface, a reliable crash type and the crash information corresponding to the crash type are provided, which can further promote efficient and accurate repair of crash events.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术者来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
图1是本申请的一示例性实施例示出的崩溃事件监测系统的实施环境示意图;FIG1 is a schematic diagram of an implementation environment of a crash event monitoring system shown in an exemplary embodiment of the present application;
图2是本申请的一示例性实施例示出的崩溃事件监测方法的流程图;FIG2 is a flow chart of a crash event monitoring method shown in an exemplary embodiment of the present application;
图3是本申请的一示例性实施例示出的显示功能开闭界面的示意图;FIG3 is a schematic diagram of a display function on/off interface shown in an exemplary embodiment of the present application;
图4是本申请的一示例性实施例示出的崩溃显示界面的示意图;FIG4 is a schematic diagram of a crash display interface shown in an exemplary embodiment of the present application;
图5是本申请的一示例性实施例示出的标定目标像素点的示意图;FIG5 is a schematic diagram of calibrating target pixels shown in an exemplary embodiment of the present application;
图6是本申请的一示例性实施例示出的领域像素点的示意图;FIG6 is a schematic diagram of field pixels shown in an exemplary embodiment of the present application;
图7是本申请的一示例性实施例示出的另一种崩溃事件监测方法的流程图;FIG7 is a flow chart of another crash event monitoring method shown in an exemplary embodiment of the present application;
图8是本申请的一示例性实施例示出的崩溃事件监测系统的框图。FIG. 8 is a block diagram of a crash event monitoring system shown in an exemplary embodiment of the present application.
具体实施方式Detailed ways
以下将参照附图和优选实施例来说明本申请的实施方式,本领域技术人员可由本说明书中所揭露的内容轻易地了解本申请的其他优点与功效。本申请还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本申请的精神下进行各种修饰或改变。应当理解,优选实施例仅为了说明本申请,而不是为了限制本申请的保护范围。The following will refer to the accompanying drawings and preferred embodiments to illustrate the implementation of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementations, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.
需要说明的是,以下实施例中所提供的图示仅以示意方式说明本申请的基本构想,遂图式中仅显示与本申请中有关的组件而非按照实际实施时的组件数目、形状及尺寸绘制,其实际实施时各组件的型态、数量及比例可为一种随意的改变,且其组件布局型态也可能更为复杂。It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
在下文描述中,探讨了大量细节,以提供对本申请实施例的更透彻的解释,然而,对本领域技术人员来说,可以在没有这些具体细节的情况下实施本申请的实施例是显而易见的,在其他实施例中,以方框图的形式而不是以细节的形式来示出公知的结构和设备,以避免使本申请的实施例难以理解。In the following description, a lot of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
在目标系统发生崩溃事件时,通常是将崩溃时的相关信息写入日志,这些信息分散到Log日志、墓碑日志、Dropbox、ANR日志中,基于这些日志进行崩溃修复。但经本申请发明人研究发现,这样,后台应用、服务崩溃时无法直观感知,开发和测试人员仍不能及时感知到崩溃事件的发生,而且也很难从海量日志文件中获取到关键崩溃信息,使得崩溃问题的修复不及时。When a crash occurs in the target system, the relevant information of the crash is usually written into the log, which is then scattered into the log, tombstone log, Dropbox, and ANR log, and the crash repair is performed based on these logs. However, the inventor of the present application has found that in this way, the crash of the background application and service cannot be intuitively perceived, and the development and testing personnel still cannot perceive the occurrence of the crash event in time, and it is also difficult to obtain key crash information from the massive log files, so that the crash problem cannot be repaired in time.
请参见图1,图1是本申请的一示例性实施例示出的崩溃事件监测系统的实施环境示意图。如图1所示,该实施环境包括车辆110和崩溃事件监测系统120,其中,崩溃事件监测系统120可以嵌于车辆110内,用于实现车辆110中车机系统崩溃事件的监测,该崩溃事件监测系统120包括但不限于车载计算机,以实现车机系统发生崩溃事件时的高效判断,以及车机系统的崩溃类型的高效定位,使得工作人员能够及时且直观地知晓崩溃事件的发生,从而进一步促进崩溃事件的高效、准确修复。Please refer to FIG1 , which is a schematic diagram of an implementation environment of a crash event monitoring system shown in an exemplary embodiment of the present application. As shown in FIG1 , the implementation environment includes a vehicle 110 and a crash event monitoring system 120, wherein the crash event monitoring system 120 can be embedded in the vehicle 110 to monitor crash events of the vehicle system in the vehicle 110, and the crash event monitoring system 120 includes but is not limited to an on-board computer to achieve efficient judgment when a crash event occurs in the vehicle system, and efficient positioning of the crash type of the vehicle system, so that the staff can know the occurrence of the crash event in a timely and intuitive manner, thereby further promoting efficient and accurate repair of the crash event.
请参见图2,图2是本申请的一示例性实施例示出的崩溃事件监测方法的流程图。该方法可以应用于图1所示的实施环境,应理解的是,该方法也可以适用于其他的示例性实施环境,本实施例不对该方法所适用的实施环境进行限制。Please refer to Figure 2, which is a flow chart of a crash event monitoring method shown in an exemplary embodiment of the present application. The method can be applied to the implementation environment shown in Figure 1. It should be understood that the method can also be applied to other exemplary implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.
如图2所示,在一示例性的实施例中,崩溃事件监测方法至少包括步骤S210至步骤S240,详细介绍如下:As shown in FIG. 2 , in an exemplary embodiment, the crash event monitoring method includes at least steps S210 to S240, which are described in detail as follows:
步骤S210,获取目标系统中显示界面的截屏图片。Step S210, obtaining a screenshot of the display interface in the target system.
目标系统可以是车机系统以及其他包括有显示界面的运行系统;截屏图片是在目标系统运行过程中,通过对其显示界面进行截屏获得的。The target system may be a vehicle computer system or other operating system including a display interface; the screenshot is obtained by taking a screenshot of the display interface of the target system during its operation.
在一实施例中,在获取目标系统中显示界面的截屏图片之前,还包括:配置崩溃显示界面的显示功能,显示功能包括界面样式与崩溃信息;若接收到用于显示功能开启的操作指令,使得显示功能处于开启状态,以监听目标系统的运行状态。In one embodiment, before obtaining a screenshot of the display interface in the target system, it also includes: configuring the display function of the crash display interface, the display function includes the interface style and crash information; if an operation instruction for turning on the display function is received, the display function is turned on to monitor the operating status of the target system.
在该实施例中,崩溃显示界面是指目标系统发生崩溃事件时,该目标系统的显示界面所呈现的界面。为了实现崩溃显示界面的显示,需要预先配置崩溃显示界面的显示功能,然后在目标系统运行之前,将该显示功能开启,这样,在监听到目标系统的运行状态为崩溃状态时,则能够触发显示崩溃显示界面,实现了崩溃事件的自动化监测。In this embodiment, the crash display interface refers to the interface presented by the display interface of the target system when a crash event occurs in the target system. In order to realize the display of the crash display interface, it is necessary to pre-configure the display function of the crash display interface, and then turn on the display function before the target system runs. In this way, when the running state of the target system is monitored to be a crash state, the crash display interface can be triggered to display, thereby realizing the automatic monitoring of the crash event.
请参见图3,图3是本申请的一示例性实施例示出的显示功能开闭界面的示意图。如图3所示,在目标系统中配置有崩溃显示界面的显示功能,如图中的“Crash提示”,当打开该功能,则开启崩溃监测,当车机系统及其内任何程序崩溃后,则显示我们崩溃显示界面。Please refer to Figure 3, which is a schematic diagram of a display function on/off interface shown in an exemplary embodiment of the present application. As shown in Figure 3, a display function of a crash display interface is configured in the target system, such as the "Crash prompt" in the figure. When this function is turned on, crash monitoring is turned on. When the vehicle system and any program in it crash, our crash display interface is displayed.
需要说明的是,配置崩溃显示界面的显示功能需要在工程模式应用中配置,其中,工程模式是工程师用于调试车机中各项配置的工具软件,通过暗码的方式进入,完成该功能的配置。It should be noted that the display function of the crash display interface needs to be configured in the engineering mode application. The engineering mode is a tool software used by engineers to debug various configurations in the vehicle computer. It is entered through a secret code to complete the configuration of this function.
在一可能的实施例中,在工程模式应用中,目标系统中添加崩溃监测系统属性,并将该值设为true或false,若该目标系统使用的是Android(安卓)系统,在AMS(ActivityManager Service,活动管理服务)中注册监听该崩溃监测系统属性变化的监听器,根据监测到的属性标志为true/false来打开/关闭崩溃界面显示功能。In a possible embodiment, in an engineering mode application, a crash monitoring system property is added to the target system, and the value is set to true or false. If the target system uses the Android system, a listener for monitoring changes in the crash monitoring system property is registered in AMS (ActivityManager Service), and the crash interface display function is turned on/off according to the monitored property flag being true/false.
在一实施例中,在获取目标系统中显示界面的截屏图片之前,还包括:监测目标系统的运行信息,并根据运行信息判断系统运行状态与程序运行状态;若系统运行状态为崩溃状态,则确定崩溃类型为系统崩溃;若程序运行状态为崩溃状态,则确定崩溃类型为程序崩溃;根据系统运行信息或程序运行信息生成崩溃信息;根据崩溃类型与崩溃信息,生成界面样式的显示指令;将工作线程切换为主线程,并响应于显示指令,控制显示界面弹出崩溃显示界面。In one embodiment, before obtaining a screenshot of the display interface in the target system, it also includes: monitoring the operating information of the target system, and judging the system operating status and the program operating status based on the operating information; if the system operating status is a crash state, determining the crash type as a system crash; if the program operating status is a crash state, determining the crash type as a program crash; generating crash information based on the system operating information or the program operating information; generating a display instruction of an interface style based on the crash type and the crash information; switching the working thread to the main thread, and in response to the display instruction, controlling the display interface to pop up a crash display interface.
在该实施例中,目标系统运行时,能够实时监测目标系统的运行信息,其中,运行信息包括目标系统的系统运行信息以及目标系统中程序的程序运行信息,根据目标系统与程序的各自对应的运行信息可以判断目标系统的系统运行状态和程序运行状态,其中运行状态包括正常状态和崩溃状态,及目标系统的崩溃类型包括系统崩溃与程序崩溃,为系统崩溃时,则根据系统运行信息生成崩溃信息,为程序崩溃时,则根据程序运行信息生成崩溃信息,这样,能够保证获得崩溃事件对应的崩溃信息,保证了崩溃信息的可靠性。In this embodiment, when the target system is running, the running information of the target system can be monitored in real time, wherein the running information includes the system running information of the target system and the program running information of the program in the target system. The system running state and the program running state of the target system can be judged according to the running information corresponding to each other of the target system and the program, wherein the running state includes a normal state and a crash state, and the crash type of the target system includes a system crash and a program crash. When the system crashes, the crash information is generated according to the system running information, and when the program crashes, the crash information is generated according to the program running information. In this way, it is possible to ensure that the crash information corresponding to the crash event is obtained, thereby ensuring the reliability of the crash information.
在获得崩溃类型和崩溃信息后,则根据崩溃类型和崩溃信息生成显示指令,即显示指令中携带有崩溃类型字段和崩溃信息字段,目标系统快速响应显示指令,解析出崩溃类型和崩溃信息,弹出崩溃显示界面,此时,崩溃显示界面的界面样式为该崩溃类型对应的界面样式,并且崩溃显示界面上还显示有崩溃信息,这样,在目标系统发生崩溃事件时,目标系统的显示界面弹出崩溃显示界面,既能够及时知晓目标系统发生了崩溃事件,又能够基于崩溃显示界面的具体界面样式快速知晓崩溃类型,还能够基于崩溃信息实现崩溃事件的快速修复。After obtaining the crash type and crash information, a display instruction is generated according to the crash type and crash information, that is, the display instruction carries the crash type field and the crash information field. The target system quickly responds to the display instruction, parses the crash type and crash information, and pops up a crash display interface. At this time, the interface style of the crash display interface is the interface style corresponding to the crash type, and the crash information is also displayed on the crash display interface. In this way, when a crash event occurs in the target system, the crash display interface pops up the crash display interface on the display interface of the target system, which can not only promptly know that a crash event has occurred in the target system, but also quickly know the crash type based on the specific interface style of the crash display interface, and can also quickly repair the crash event based on the crash information.
还需要说明的是,考虑到目标系统的线程为主线程时,显示界面才能弹出崩溃显示界面,因此,在弹出崩溃显示界面之前,需要将工作线程切换为主线程,这样,能够保证崩溃显示界面的正常弹出。It should also be noted that, considering that the thread of the target system is the main thread, the crash display interface can pop up the display interface. Therefore, before the crash display interface pops up, the working thread needs to be switched to the main thread, so that the crash display interface can be guaranteed to pop up normally.
在一可能的实施例中,利用PC(Personal Computer)电脑通过ADB(安卓调试桥)启动目标系统内的Monkey(猴子测试工具),随机模拟用户操作目标系统,以触发目标系统内发生崩溃事件。In a possible embodiment, a PC (Personal Computer) is used to start the Monkey (monkey testing tool) in the target system through ADB (Android Debug Bridge), and randomly simulates the user's operation on the target system to trigger a crash event in the target system.
在该实施例中,使得目标系统在产线上,则可以实现目标系统使用前的测试,可以预先对目标系统的性能进行测试以及崩溃修复,这样,能够避免在使用过程中频繁发生崩溃事件,能够提升用户体验,例如,对于车机系统而言,有效提升了行车安全。In this embodiment, the target system is on the production line, so that the target system can be tested before use, and the performance of the target system can be tested and crashes repaired in advance. This can avoid frequent crashes during use and improve user experience. For example, for the car system, driving safety is effectively improved.
在一实施例中,显示指令中携带有显示时长,截屏图片基于预设的时间间隔进行截取,其中,显示时长大于时间间隔。In one embodiment, the display instruction carries a display duration, and the screenshot is captured based on a preset time interval, wherein the display duration is greater than the time interval.
在该实施例中,崩溃显示界面弹出后,达到显示时长后消失,这样,在某程序发生崩溃事件后,即使没能够及时恢复,也不会影响目标系统关于其他程序的应用,另外,该显示时长大于截屏的时间间隔,例如显示时长为15S,时间间隔为10S,这样,在弹出崩溃显示界面后,定能截取到该崩溃显示界面,使得崩溃事件能够及时知晓。In this embodiment, after the crash display interface pops up, it disappears after the display time is reached. In this way, after a program crashes, even if it cannot be restored in time, it will not affect the application of other programs in the target system. In addition, the display time is greater than the time interval of screenshots, for example, the display time is 15S and the time interval is 10S. In this way, after the crash display interface pops up, the crash display interface can be captured so that the crash event can be known in time.
步骤S220,判断截屏图片是否包含预设的界面样式。Step S220, determining whether the screenshot image contains a preset interface style.
其中,界面样式的类型为颜色样式、图案样式和文字样式中任意之一,且基于目标系统的崩溃类型设置不同的子样式。The type of the interface style is any one of a color style, a pattern style and a text style, and different sub-styles are set based on the crash type of the target system.
在本申请实施例中,颜色样式是指截屏图片为某种颜色,该颜色显示在整个界面的上层,且为半透明色,例如颜色为红色时,则显示效果为红色半透明效果,这样,不会影响显示界面进行其他内容的显示,例如其他程序的运行;图案样式是指截屏图片中有某种图案,可以显示在界面的预设区域或整个界面的上层,为整个界面的上层时,其显示效果也需为某颜色的半透明色;文字样式是指截屏图片中有某文字或句子,可以显示在界面的预设区域或整个界面的上层,整个界面的上层时,其显示效果也需为某颜色的半透明色。In an embodiment of the present application, the color style refers to a screenshot image of a certain color, which is displayed in the upper layer of the entire interface and is translucent. For example, when the color is red, the display effect is a red translucent effect. In this way, it will not affect the display of other content on the display interface, such as the running of other programs; the pattern style refers to a screenshot image with a certain pattern, which can be displayed in the preset area of the interface or in the upper layer of the entire interface. When it is the upper layer of the entire interface, its display effect must also be a translucent color of a certain color; the text style refers to a screenshot image with certain text or sentences, which can be displayed in the preset area of the interface or in the upper layer of the entire interface. When it is the upper layer of the entire interface, its display effect must also be a translucent color of a certain color.
另外,目标系统不同的崩溃类型对应不同的子样式,这样,能够基于截屏图片中具体的子样式直观地知晓是系统崩溃还是程序崩溃,通常地,系统崩溃的紧急程度高于程序崩溃的紧急程度,因此,不同子样式的呈现,能够对开发或工作人员起到不同的警示作用。In addition, different crash types of the target system correspond to different sub-styles. In this way, it is possible to intuitively know whether it is a system crash or a program crash based on the specific sub-style in the screenshot. Generally, the urgency of a system crash is higher than that of a program crash. Therefore, the presentation of different sub-styles can play different warning roles for developers or staff.
具体地,界面样式的设置,包括:若界面样式为颜色样式,则当崩溃类型为系统崩溃时,将界面样式设置为第一颜色子样式,当崩溃类型为程序崩溃时,将界面样式设置为第二样色子样式;若界面样式为图案样式,则当崩溃类型为系统崩溃时,将界面样式设置为第一图案子样式,当崩溃类型为程序崩溃时,将界面样式设置为第二图案子样式;若界面样式为文字样式,则当崩溃类型为系统崩溃时,将界面样式设置为第一文字子样式,当崩溃类型为程序崩溃时,将界面样式设置为第二文字子样式。Specifically, the setting of the interface style includes: if the interface style is a color style, then when the crash type is a system crash, the interface style is set to the first color sub-style, and when the crash type is a program crash, the interface style is set to the second color sub-style; if the interface style is a pattern style, then when the crash type is a system crash, the interface style is set to the first pattern sub-style, and when the crash type is a program crash, the interface style is set to the second pattern sub-style; if the interface style is a text style, then when the crash type is a system crash, the interface style is set to the first text sub-style, and when the crash type is a program crash, the interface style is set to the second text sub-style.
其中,第一颜色子样式如半透明红色,第二颜色子样式如半透明蓝色;第一图案子样式如三角形图案,第二图案子样式如圆形图案;第一子文字样式如系统崩溃,第二子文字样式程序崩溃。Among them, the first color sub-style is such as translucent red, and the second color sub-style is such as translucent blue; the first pattern sub-style is such as a triangle pattern, and the second pattern sub-style is such as a circle pattern; the first sub-text style is such as a system crash, and the second sub-text style is such as a program crash.
以颜色样式为例,请参见图4,图4是本申请的一示例性实施例示出的崩溃显示界面的示意图,如图4所示,整个界面为半透明红色。Taking the color style as an example, please refer to FIG. 4 , which is a schematic diagram of a crash display interface shown in an exemplary embodiment of the present application. As shown in FIG. 4 , the entire interface is translucent red.
在一实施例中,判断截屏图片是否包含预设的界面样式,包括:将截屏图片分别与预设颜色样式、预设图案样式与预设文字样式对应进行颜色匹配、图案匹配与文字匹配,获得匹配结果;若匹配结果为截屏图片与预设颜色样式、预设图案样式、预设文字样式均不匹配,则判断截屏图片未包含界面样式;若匹配结果为截屏图片与预设颜色样式、预设图案样式、预设文字样式中任意之一匹配,则判断截屏图片包含界面样式。In one embodiment, determining whether a screenshot image contains a preset interface style includes: performing color matching, pattern matching, and text matching on the screenshot image with a preset color style, a preset pattern style, and a preset text style, respectively, to obtain a matching result; if the matching result is that the screenshot image does not match the preset color style, the preset pattern style, and the preset text style, then determining that the screenshot image does not contain the interface style; if the matching result is that the screenshot image matches any one of the preset color style, the preset pattern style, and the preset text style, then determining that the screenshot image contains the interface style.
在该实施例中,颜色匹配则颜色需要相同,图案匹配则图案需要相同,文字匹配则需要文字相同。In this embodiment, color matching requires the colors to be the same, pattern matching requires the patterns to be the same, and text matching requires the text to be the same.
具体地,颜色样式的匹配,包括:根据预设的像素点位置,标定截屏图片中的第一目标像素点,第一目标像素点为至少一个;获取第一目标像素点的第一像素值,并将第一像素值与预设的像素范围进行一次比较;若第一像素值处于像素范围内,则截屏图片与预设颜色样式匹配;若第一像素值未在像素范围内,则截屏图片与预设颜色样式不匹配。Specifically, the matching of color styles includes: calibrating a first target pixel point in the screenshot image according to a preset pixel point position, where the first target pixel point is at least one; obtaining a first pixel value of the first target pixel point, and comparing the first pixel value with a preset pixel range; if the first pixel value is within the pixel range, the screenshot image matches the preset color style; if the first pixel value is not within the pixel range, the screenshot image does not match the preset color style.
作为一种可能的实施例,颜色样式匹配的方式为像素值匹配,当截屏图片的像素值符合像素范围要求时,从而判断出该截屏图片包括预设的颜色样式,这样,保证了颜色匹配的可靠性。As a possible embodiment, the color style matching method is pixel value matching. When the pixel value of the screenshot meets the pixel range requirement, it is determined that the screenshot includes a preset color style, thus ensuring the reliability of color matching.
另外,考虑到截屏图片中颜色样式下层的界面颜色会对第一目标像素点的像素值产生影响,因此,对于预设颜色样式的标准像素为一个像素范围,只要第一目标像素点的像素值在该范围内即可,这样,能够有效避免崩溃显示界面的误判。In addition, considering that the interface color of the lower layer of the color style in the screenshot will affect the pixel value of the first target pixel, the standard pixel of the preset color style is a pixel range. As long as the pixel value of the first target pixel is within the range, this can effectively avoid the misjudgment of the crash display interface.
以红色、RGB(Red、Green、Blue,红色、绿色、蓝色)色彩空间为例,半透明红色的像素为GRB(246,167,167),若设误差为±5,则像素范围为GRB(246±5,167±5,167±5)。Taking the red, RGB (Red, Green, Blue) color space as an example, the pixel of semi-transparent red is GRB (246, 167, 167). If the error is set to ±5, the pixel range is GRB (246±5, 167±5, 167±5).
还需要说明是,考虑到判断结果的可靠性,预设的像素点位置为受下层界面颜色影响较小的点,考虑到判断效率,预设的像素点位置为具有代表性的几个点。It should also be noted that, considering the reliability of the judgment result, the preset pixel point positions are points that are less affected by the color of the underlying interface, and considering the judgment efficiency, the preset pixel point positions are several representative points.
请参见图5,图5是本申请的一示例性实施例示出的标定目标像素点的示意图。如图5所示,以半透明红色为例,优选地,预设的像素点位置为截屏界面上边缘和右边缘上的像素点,考虑到像素点位置的数量,选择四个位置,即上边缘正中位置,右上边缘位置处、右边缘正中位置处、右下边缘位置处,分别对应图5中的目标像素点1、2、3、4和5,这四个位置不易和其他界面信息重叠,对判断结果的准确性以及判断速率均有保障。Please refer to Figure 5, which is a schematic diagram of calibrating target pixel points shown in an exemplary embodiment of the present application. As shown in Figure 5, taking the translucent red color as an example, preferably, the preset pixel point positions are the pixel points on the upper edge and the right edge of the screenshot interface. Considering the number of pixel point positions, four positions are selected, namely, the middle position of the upper edge, the upper right edge position, the middle position of the right edge, and the lower right edge position, which correspond to the target pixel points 1, 2, 3, 4 and 5 in Figure 5 respectively. These four positions are not easy to overlap with other interface information, and the accuracy and speed of the judgment results are guaranteed.
在一可能的实施例中,可以设置匹配时间,例如,一张截屏图片的匹配时间为50毫秒。这样,能够进一步保证判断效率。In a possible embodiment, a matching time may be set, for example, the matching time of a screenshot image is 50 milliseconds, so that the judgment efficiency can be further guaranteed.
在一可能的实施例中,在对截屏图片进行颜色匹配之前,先对其进行预处理,其中,预处理包括但不限于噪声去除和色彩空间转换,使用滤波器(如均值滤波、高斯滤波等)去除截屏图片中的噪点,提升颜色匹配的可靠性,将截屏图片从RGB色彩空间转化为HSV(Hue、Saturation、Value,色调、饱和度、亮度)色彩空间或Lab(Lab color space,颜色-对立空间),便于颜色匹配。In a possible embodiment, before color matching is performed on the screenshot, it is preprocessed, wherein the preprocessing includes but is not limited to noise removal and color space conversion, and a filter (such as mean filtering, Gaussian filtering, etc.) is used to remove noise in the screenshot to improve the reliability of color matching, and the screenshot is converted from the RGB color space to the HSV (Hue, Saturation, Value) color space or Lab (Lab color space) to facilitate color matching.
进一步地,在若第一像素值处于像素范围内之后,还包括:标定第一目标像素点的邻域像素点,获得多个第二目标像素点;获取每一第二目标像素点的第二像素值,并将每一第二像素值与像素范围进行二次比较;若每一第二像素值均处于像素范围内,则截屏图片与预设颜色样式匹配;若存在任一第二像素值未在像素范围内,则截屏图片与预设颜色样式不匹配。Furthermore, after the first pixel value is within the pixel range, it also includes: calibrating the neighborhood pixel points of the first target pixel point to obtain multiple second target pixel points; obtaining the second pixel value of each second target pixel point, and performing a second comparison between each second pixel value and the pixel range; if each second pixel value is within the pixel range, the screenshot image matches the preset color style; if any second pixel value is not within the pixel range, the screenshot image does not match the preset color style.
在该实施例中,在第一目标像素点都符合预设的像素范围后,再将各第一目标像素点的领域像素点作为第二目标像素点,以第二目标像素点的像素值符合像素范围要求时,判断截屏图片与预设颜色样式匹配,这样,增强了判断结果的可靠性。In this embodiment, after the first target pixel points all meet the preset pixel range, the area pixel points of each first target pixel point are used as the second target pixel point. When the pixel value of the second target pixel point meets the pixel range requirement, it is determined that the screenshot image matches the preset color style. In this way, the reliability of the judgment result is enhanced.
需要说明的是,邻域像素点包括4领域、D领域和8领域,在该实施例中,领域像素点为4领域、D领域与8领域中的一种。It should be noted that the neighborhood pixel points include 4-domain, D-domain and 8-domain. In this embodiment, the neighborhood pixel point is one of the 4-domain, D-domain and 8-domain.
请参见图6,图6是本申请的一示例性实施例示出的领域像素点的示意图。如图6所示,以8领域为例,则以第一目标像素点为中心,周围的8个像素点为第二目标像素点,该8个像素点的像素值就要符合像素范围,即对每一个像素点的RGB值进行比较,满足|G-246|≤5&|G-167|≤5&|B-167|≤167。Please refer to Figure 6, which is a schematic diagram of field pixel points shown in an exemplary embodiment of the present application. As shown in Figure 6, taking 8 fields as an example, the first target pixel point is taken as the center, and the surrounding 8 pixel points are the second target pixel points. The pixel values of the 8 pixel points must conform to the pixel range, that is, the RGB value of each pixel point is compared to satisfy |G-246|≤5&|G-167|≤5&|B-167|≤167.
步骤S230,若截屏图片包含界面样式,则确定截屏图片为崩溃显示界面,并确定目标系统发生崩溃事件。Step S230: If the screenshot image contains an interface style, it is determined that the screenshot image is a crash display interface, and it is determined that a crash event occurs in the target system.
其中,崩溃显示界面显示有崩溃信息。Among them, the crash display interface displays crash information.
崩溃信息的显示如图3所示,其中,优选地,崩溃信息显示在整个界面的左边部分,这样,避免对第一目标像素点和第二目标像素点的像素值造成影响,另外,崩溃信息的显示颜色与颜色样式中的颜色具有明显差异,例如,绿色与半透明红色。The display of the crash information is shown in Figure 3, wherein, preferably, the crash information is displayed on the left part of the entire interface, so as to avoid affecting the pixel values of the first target pixel and the second target pixel. In addition, the display color of the crash information is significantly different from the color in the color style, for example, green and translucent red.
在本申请实施例中,若截屏图片包含界面样式,则可以快速判断该截屏图片为崩溃显示界面,从而快速确定目标系统发生崩溃事件。另外,若截屏图片为崩溃显示界面,则将截屏图片保留,以根据该截屏图片上的崩溃信息进行崩溃修复,若截屏图片不为崩溃显示界面,则将截屏图片丢弃,不进行保存。In the embodiment of the present application, if the screenshot image contains an interface style, it can be quickly determined that the screenshot image is a crash display interface, thereby quickly determining that a crash event has occurred in the target system. In addition, if the screenshot image is a crash display interface, the screenshot image is retained to perform crash repair based on the crash information on the screenshot image. If the screenshot image is not a crash display interface, the screenshot image is discarded and not saved.
在一实施例中,确定目标系统发生崩溃事件之后,包括:根据界面样式,确定目标崩溃类型;当目标崩溃类型为系统崩溃时,按照系统崩溃修复程序,分析崩溃信息,生成第一崩溃修复方案,其中,崩溃信息至少包括系统内存状态、运行进程信息与驱动程序信息;当目标崩溃类型为程序崩溃时,按照程序崩溃修复程序,分析崩溃信息,生成第二崩溃修复方案,其中,崩溃信息至少包括崩溃程序的包名、进程名、运行时间与出错调用栈。In one embodiment, after determining that a crash event has occurred in the target system, the method includes: determining a target crash type according to an interface style; when the target crash type is a system crash, analyzing crash information according to a system crash repair program, and generating a first crash repair plan, wherein the crash information includes at least system memory status, running process information, and driver information; when the target crash type is a program crash, analyzing crash information according to a program crash repair program, and generating a second crash repair plan, wherein the crash information includes at least the package name, process name, running time, and error call stack of the crashed program.
其中,系统崩溃修复程序是指系统崩溃修复的多种方法的集合;程序崩溃修复程序是指程序崩溃修复的多种方法的集合。在发生系统崩溃或者程序崩溃时,根据对应的崩溃信息分析崩溃原因,从各自的方法集合中确定至少之一为目标方法,从而生成崩溃修复方案。Among them, the system crash repair program refers to a collection of multiple methods for system crash repair; the program crash repair program refers to a collection of multiple methods for program crash repair. When a system crash or program crash occurs, the crash cause is analyzed according to the corresponding crash information, and at least one of the methods in the respective method sets is determined as the target method, thereby generating a crash repair solution.
在该实施例中,基于截屏图片的界面样式与崩溃信息进行崩溃修复,这样,提升了崩溃修复的效率。In this embodiment, crash repair is performed based on the interface style of the screenshot image and the crash information, thus improving the efficiency of crash repair.
请参见图7,图7是本申请的一示例性实施例示出的另一种崩溃事件监测方法的流程图。如图7所示,PC电脑执行脚本控制崩溃事件监控系统,启动目标系统内的Monkey工具模拟操作目标系统,触发目标系统内发生崩溃事件,而在启动Monkey工具之前,便启动目标系统的崩溃显示界面的显示功能,在监听到显示功能打开以及发生崩溃事件时,获取崩溃信息,并将目标系统线程从工作线程切换为主线程,然后控制目标系统弹出带有崩溃信息的崩溃显示界面,当达到显示时长后目标系统退出崩溃显示界面,在目标系统运行过程中,根据时间间隔截取目标系统的显示界面获得界面样式,然后判断截屏图片是否包括有预设的界面样式,若没有,则确定没有发生崩溃事件,将该截屏图片丢弃,若有,则确定发生崩溃事件,对该截屏图片进行保留,并根据该截屏图片确定崩溃修复方案。Please refer to Figure 7, which is a flowchart of another crash event monitoring method shown in an exemplary embodiment of the present application. As shown in Figure 7, the PC executes a script to control the crash event monitoring system, starts the Monkey tool in the target system to simulate the operation of the target system, and triggers a crash event in the target system. Before starting the Monkey tool, the display function of the crash display interface of the target system is started. When the display function is turned on and a crash event occurs, the crash information is obtained, and the target system thread is switched from the working thread to the main thread, and then the target system is controlled to pop up a crash display interface with crash information. When the display time is reached, the target system exits the crash display interface. During the operation of the target system, the display interface of the target system is intercepted according to the time interval to obtain the interface style, and then it is determined whether the screenshot image includes a preset interface style. If not, it is determined that no crash event has occurred, and the screenshot image is discarded. If yes, it is determined that a crash event has occurred, the screenshot image is retained, and a crash repair plan is determined based on the screenshot image.
上述的崩溃事件监测方法,首先获取目标系统中显示界面的截屏图片,然后判断截屏图片是否包含预设的界面样式,其中,界面样式的类型为颜色样式、图案样式和文字样式中任意之一,且基于目标系统的崩溃类型设置不同的子样式,最后若截屏图片包含界面样式,则确定截屏图片为崩溃显示界面,并确定目标系统发生崩溃事件,其中,崩溃显示界面显示有崩溃信息。这样,在目标系统发生崩溃事件时,第一,根据截屏图片中包含的界面样式,实现了崩溃事件自动化监测,以及目标系统发生崩溃事件的高效判断,使得工作人员能够及时且直观地知晓崩溃事件的发生;第二,基于截屏图片中不同的子样式,实现了目标系统的崩溃类型的高效定位;第三,基于崩溃显示界面,提供了可靠的崩溃类型和该崩溃类型对应的崩溃信息,能进一步促进崩溃事件的高效、准确修复。The above-mentioned crash event monitoring method first obtains a screenshot of the display interface in the target system, and then determines whether the screenshot contains a preset interface style, wherein the type of the interface style is any one of a color style, a pattern style, and a text style, and different sub-styles are set based on the crash type of the target system, and finally, if the screenshot contains an interface style, it is determined that the screenshot is a crash display interface, and it is determined that a crash event has occurred in the target system, wherein the crash display interface displays crash information. In this way, when a crash event occurs in the target system, firstly, based on the interface style contained in the screenshot, automatic monitoring of crash events and efficient judgment of crash events in the target system are realized, so that the staff can know the occurrence of the crash event in a timely and intuitive manner; secondly, based on the different sub-styles in the screenshot, efficient positioning of the crash type of the target system is realized; thirdly, based on the crash display interface, a reliable crash type and crash information corresponding to the crash type are provided, which can further promote efficient and accurate repair of crash events.
请参见图8,图8是本申请的一示例性实施例示出的崩溃事件监测系统的框图。该系统可以应用于图1所示的实施环境,应当理解的是,该系统也可以适用于其它的示例性实施环境,本申请并不对该系统的实施环境进行限制。如图8所示,在一示例性的实施例中,崩溃事件监测系统800至少包括获取模块810、判断模块820与确定模块830,详细介绍如下:Please refer to FIG8 , which is a block diagram of a crash event monitoring system shown in an exemplary embodiment of the present application. The system can be applied to the implementation environment shown in FIG1 . It should be understood that the system can also be applied to other exemplary implementation environments, and the present application does not limit the implementation environment of the system. As shown in FIG8 , in an exemplary embodiment, the crash event monitoring system 800 includes at least an acquisition module 810, a judgment module 820, and a determination module 830, which are described in detail as follows:
获取模块810,用于获取目标系统中显示界面的截屏图片;An acquisition module 810 is used to acquire a screenshot of a display interface in a target system;
判断模块820,用于判断截屏图片是否包含预设的界面样式,其中,界面样式的类型为颜色样式、图案样式和文字样式中任意之一,且基于目标系统的崩溃类型设置不同的子样式;A determination module 820 is used to determine whether the screenshot image contains a preset interface style, wherein the type of the interface style is any one of a color style, a pattern style, and a text style, and different sub-styles are set based on the crash type of the target system;
确定模块830,用于若截屏图片包含界面样式,则确定截屏图片为崩溃显示界面,并确定目标系统发生崩溃事件,其中,崩溃显示界面显示有崩溃信息。The determination module 830 is used to determine that the screenshot image is a crash display interface if the screenshot image contains an interface style, and determine that a crash event occurs in the target system, wherein the crash display interface displays crash information.
需要说明的是,上述实施例所提供的崩溃事件监测系统与上述实施例所提供的崩溃事件监测方法属于同一构思,其中各个模块执行操作的内容已经在方法实施例中进行了详细描述,此处不再赘述。It should be noted that the crash event monitoring system provided in the above embodiment and the crash event monitoring method provided in the above embodiment belong to the same concept, wherein the contents of the operations performed by each module have been described in detail in the method embodiment and will not be repeated here.
本申请还提供了一种车辆,其使用上述的崩溃事件监测方法,或,包括上述的崩溃事件监测系统。The present application also provides a vehicle, which uses the above-mentioned crash event monitoring method, or includes the above-mentioned crash event monitoring system.
需要说明的是,崩溃事件监测方法、崩溃事件监测系统已经在上述方法实施例中进行了详细描述,此处不再赘述。It should be noted that the crash event monitoring method and the crash event monitoring system have been described in detail in the above method embodiments and will not be described again here.
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被计算机的处理器执行时,使计算机执行如上述的崩溃事件监测方法。该计算机可读存储介质可以是上述实施例中描述的车辆中所包含的,也可以是单独存在,而未装配入该车辆中。The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the crash event monitoring method as described above. The computer-readable storage medium may be included in the vehicle described in the above embodiment, or may exist independently without being assembled into the vehicle.
需要说明的是,本申请实施例所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的计算机程序。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的计算机程序可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。其中,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not constitute limitations on the units themselves in some cases.
上述实施例仅示例性说明本申请的原理及其功效,而非用于限制本申请。任何熟悉此技术的人士皆可在不违背本申请的精神及范畴下,对上述实施例进行修饰或改变。因此,但凡所属技术领域中具有通常知识者在未脱离本申请所揭示的精神与技术思想下所完成的一切等效修饰或改变,仍应由本申请的权利要求所涵盖。The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410379688.2ACN118193321B (en) | 2024-03-29 | 2024-03-29 | Crash event monitoring method, system, vehicle and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410379688.2ACN118193321B (en) | 2024-03-29 | 2024-03-29 | Crash event monitoring method, system, vehicle and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN118193321Atrue CN118193321A (en) | 2024-06-14 |
| CN118193321B CN118193321B (en) | 2024-10-11 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410379688.2AActiveCN118193321B (en) | 2024-03-29 | 2024-03-29 | Crash event monitoring method, system, vehicle and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN118193321B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060183506A1 (en)* | 2005-02-15 | 2006-08-17 | Park Sun H | Apparatus and method for forming event picture in mobile communication terminal |
| CN107247637A (en)* | 2017-07-27 | 2017-10-13 | 广州云测信息技术有限公司 | A kind of APP fault determination methods and device |
| CN107480026A (en)* | 2017-06-22 | 2017-12-15 | 深圳天珑无线科技有限公司 | Endpoint crashes processing method, terminal and the device with store function |
| CN109117358A (en)* | 2017-06-23 | 2019-01-01 | 百度在线网络技术(北京)有限公司 | test method and test device for electronic equipment |
| CN115016973A (en)* | 2022-06-29 | 2022-09-06 | 广州文远知行科技有限公司 | A program crash event reproduction method, apparatus, device and medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060183506A1 (en)* | 2005-02-15 | 2006-08-17 | Park Sun H | Apparatus and method for forming event picture in mobile communication terminal |
| CN107480026A (en)* | 2017-06-22 | 2017-12-15 | 深圳天珑无线科技有限公司 | Endpoint crashes processing method, terminal and the device with store function |
| CN109117358A (en)* | 2017-06-23 | 2019-01-01 | 百度在线网络技术(北京)有限公司 | test method and test device for electronic equipment |
| CN107247637A (en)* | 2017-07-27 | 2017-10-13 | 广州云测信息技术有限公司 | A kind of APP fault determination methods and device |
| CN115016973A (en)* | 2022-06-29 | 2022-09-06 | 广州文远知行科技有限公司 | A program crash event reproduction method, apparatus, device and medium |
| Publication number | Publication date |
|---|---|
| CN118193321B (en) | 2024-10-11 |
| Publication | Publication Date | Title |
|---|---|---|
| CN108984418B (en) | Software test management method and device, electronic equipment and storage medium | |
| KR101019210B1 (en) | Embedded software test device using emulation and method | |
| CN112654933B (en) | Computer-implemented simulation method and device for testing control equipment | |
| CN105787364B (en) | Automatic testing method, device and system for tasks | |
| CN109960642A (en) | Automatic test method and device | |
| JP2008015940A (en) | Software development apparatus and software development method | |
| CN113133041B (en) | Method and device for testing vehicle-to-vehicle communication function in dynamic interval train control vehicle | |
| CN118193321A (en) | Crash event monitoring method, system, vehicle and storage medium | |
| CN108595332B (en) | Software testing method and device | |
| CN112948276A (en) | Fuzzy test method and device and electronic equipment | |
| CN112765018A (en) | Instrument and meter debugging system and method | |
| CN112560041B (en) | Method, apparatus and computer storage medium for automated quality verification detection | |
| JP2005276040A (en) | Degradation confirmation inspection method, degradation confirmation inspection system, and program therefor | |
| CN115599645A (en) | Method and device for testing stability of linux drive module | |
| CN118484326A (en) | Crash handling method, system, vehicle and storage medium | |
| CN115562995A (en) | Automatic test method, terminal device and storage medium | |
| CN112632702A (en) | Vehicle protocol diagnostic tool detection method and device | |
| JP2008299502A (en) | Test case validity automatic verification program and test case validity automatic verification result display method | |
| CN115934560B (en) | User interface UI automated testing method, device, equipment and medium | |
| EP4567606A1 (en) | Program step visualization implementation method and system in a vehicle simulation test process | |
| CN119988227A (en) | An automated testing method, system and vehicle computer based on Android vehicle computer | |
| JP2019040280A (en) | Output program, output method and information processing device | |
| CN116610557A (en) | Action binding information debugging method and device, storage medium and electronic equipment | |
| CN119829452A (en) | Software function test method and system based on augmented reality | |
| CN117707872A (en) | Stress testing methods, devices, terminal equipment and storage media |
| 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 |