[go: up one dir, main page]

CN107193678B - Method, device and storage medium for determining cause of freeze - Google Patents

Method, device and storage medium for determining cause of freeze Download PDF

Info

Publication number
CN107193678B
CN107193678B CN201710295316.1A CN201710295316A CN107193678B CN 107193678 B CN107193678 B CN 107193678B CN 201710295316 A CN201710295316 A CN 201710295316A CN 107193678 B CN107193678 B CN 107193678B
Authority
CN
China
Prior art keywords
usage
system resource
usage record
resource
records
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.)
Active
Application number
CN201710295316.1A
Other languages
Chinese (zh)
Other versions
CN107193678A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710295316.1A priority Critical patent/CN107193678B/en
Publication of CN107193678A publication Critical patent/CN107193678A/en
Application granted granted Critical
Publication of CN107193678B publication Critical patent/CN107193678B/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/079Root cause analysis, i.e. error or fault diagnosis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a method, a device and a storage medium for determining a cause of jamming, and belongs to the technical field of terminals. The method comprises the following steps: detecting whether a display picture of the terminal is blocked or not; when the display picture is jammed, extracting the use records of m system resources from n buffers preset in the terminal, wherein each buffer is used for storing the use record of at least one system resource, n is more than or equal to 1, and m is more than or equal to 1; and determining the cause of the jamming of the display picture according to the use records of the m system resources. The method and the device solve the problem that the flexibility of determining the cause of the seizure is low in the related art. The method and the device are used for the terminal to determine the cause of the jamming.

Description

卡顿原因确定方法、装置及存储介质Method, device and storage medium for determining cause of freeze

技术领域technical field

本公开涉及终端技术领域,特别涉及一种卡顿原因确定方法、装置及存储介质。The present disclosure relates to the technical field of terminals, and in particular, to a method, a device and a storage medium for determining a cause of jamming.

背景技术Background technique

随着电子技术的发展,人机交互的方式已经由最初的按键交互方式演变为如今的触屏交互方式,例如,用户通过简单的滑屏操作就可以使终端进行相应的画面显示。然而,终端在显示画面的过程中,由于系统资源(包括中央处理器(英文:Central ProcessingUnit;简称:CPU)资源、内存资源和输入/输出(英文:Input/Output;简称:I/O)带宽资源等)不足等问题,画面往往会出现卡顿,导致画面的流畅性差,因此确定终端上的画面卡顿的原因是很有必要的。With the development of electronic technology, the mode of human-computer interaction has evolved from the original button interaction mode to today's touch screen interaction mode. For example, a user can display a corresponding screen on the terminal through a simple sliding screen operation. However, in the process of displaying the screen on the terminal, due to system resources (including central processing unit (English: Central Processing Unit; referred to as: CPU) resources, memory resources and input/output (English: Input/Output; referred to as: I/O) bandwidth Due to problems such as insufficient resources, etc., the screen tends to freeze, resulting in poor screen fluency. Therefore, it is necessary to determine the cause of the screen freeze on the terminal.

相关技术中,一般将终端与电脑连接,通过电脑上的调试工具打开终端中的系统资源使用记录,在预设时间段内(一般为5至20秒)获取终端中的部分系统资源使用记录并将该部分系统资源使用记录保存在电脑中,然后通过电脑将该部分系统资源使用记录解析成图表的形式,再对图表进行分析以确定终端上的画面卡顿的原因。In the related art, the terminal is generally connected to the computer, the system resource usage record in the terminal is opened through the debugging tool on the computer, and some system resource usage records in the terminal are obtained within a preset time period (usually 5 to 20 seconds) and recorded. Save this part of the system resource usage record in the computer, and then use the computer to parse the part of the system resource usage record into the form of a graph, and then analyze the graph to determine the reason why the screen on the terminal is stuck.

但是,相关技术中确定终端上的画面卡顿的原因时必须要借助电脑,确定卡顿原因的灵活性较低。However, in the related art, the computer must be used to determine the cause of the screen freeze on the terminal, and the flexibility to determine the cause of the freeze is low.

发明内容SUMMARY OF THE INVENTION

为了解决相关技术中确定卡顿原因的灵活性较低的问题,本公开实施例提供了一种卡顿原因确定方法、装置及存储介质。所述技术方案如下:In order to solve the problem of low flexibility in determining the cause of the jam in the related art, the embodiments of the present disclosure provide a method, a device, and a storage medium for determining the cause of the jam. The technical solution is as follows:

根据本公开实施例的第一方面,提供一种卡顿原因确定方法,所述方法包括:According to a first aspect of the embodiments of the present disclosure, there is provided a method for determining a cause of a freeze, the method comprising:

检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck;

当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1;

根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因。According to the usage records of the m types of system resources, the cause of the freezing of the display screen is determined.

可选的,所述方法还包括:Optionally, the method further includes:

在所述终端的系统中划分出所述n个缓存器,每个缓存器占用的存储空间固定;The n buffers are divided in the system of the terminal, and the storage space occupied by each buffer is fixed;

根据所述m种系统资源的最新使用记录,更新所述n个缓存器中的内容。According to the latest usage records of the m types of system resources, the contents in the n buffers are updated.

可选的,所述根据所述m种系统资源的最新使用记录,更新所述n个缓存器中的内容,包括:Optionally, updating the content in the n buffers according to the latest usage records of the m types of system resources, including:

获取第一系统资源的最新使用记录,所述第一系统资源为所述m种系统资源中任一种系统资源;acquiring the latest usage record of a first system resource, where the first system resource is any one of the m types of system resources;

在用于存储所述第一系统资源的使用记录的第一缓存器中,删除所述第一系统资源最早的使用记录;In the first buffer for storing the usage record of the first system resource, delete the earliest usage record of the first system resource;

在所述第一缓存器中存储所述第一系统资源的最新使用记录。The latest usage record of the first system resource is stored in the first buffer.

可选的,所述第一缓存器中采用第一资源链表存储所述第一系统资源的使用记录,所述第一资源链表中的所述第一系统资源的使用记录按照时间先后顺序依次排列;Optionally, a first resource linked list is used in the first buffer to store the usage records of the first system resources, and the usage records of the first system resources in the first resource linked list are arranged in chronological order. ;

所述在用于存储所述第一系统资源的使用记录的第一缓存器中,删除所述第一系统资源最早的使用记录,包括:Deleting the earliest usage record of the first system resource in the first buffer for storing the usage record of the first system resource includes:

判断所述第一资源链表中的表项是否全部被占用,当所述第一资源链表中的表项全部被占用时,删除所述第一资源链表的首个表项;Determine whether all the entries in the first resource linked list are occupied, and when all the entries in the first resource linked list are occupied, delete the first entry of the first resource linked list;

所述在所述第一缓存器存储所述第一系统资源的最新使用记录,包括:The storing the latest usage record of the first system resource in the first buffer includes:

在所述第一资源链表的末位增加表项,在增加的表项中记录所述第一系统资源的最新使用记录。An entry is added at the last position of the first resource linked list, and the latest usage record of the first system resource is recorded in the added entry.

可选的,所述获取第一系统资源的最新使用记录,包括:Optionally, the acquiring the latest usage record of the first system resource includes:

当监测到所述第一系统资源正在被使用时,判断所述第一系统资源是否为前台正在运行的目标应用所对应的系统资源;When monitoring that the first system resource is being used, determine whether the first system resource is the system resource corresponding to the target application running in the foreground;

当所述第一系统资源为所述目标应用所对应的系统资源时,获取所述第一系统资源的最新使用记录。When the first system resource is the system resource corresponding to the target application, acquire the latest usage record of the first system resource.

可选的,所述目标应用为任一前台正在运行的应用,或者,所述目标应用为前台正在运行的指定应用。Optionally, the target application is any application running in the foreground, or the target application is a specified application running in the foreground.

可选的,所述使用记录包括使用时间段,Optionally, the usage record includes a usage time period,

所述根据所述m种系统资源使用记录,确定所述显示画面的卡顿原因,包括:Determining, according to the m types of system resource usage records, the cause of the freezing of the displayed screen, including:

获取卡顿信息,所述卡顿信息包括所述显示画面产生卡顿的卡顿时间段;Acquiring freeze information, where the freeze information includes the freeze time period during which the display screen freezes;

在所述m种系统资源使用记录中确定至少一个目标使用记录,所述目标使用记录的使用时间段与所述卡顿时间段存在交集;Determine at least one target usage record from the m types of system resource usage records, and the usage time period of the target usage record and the stuck time period have an intersection;

检测所述至少一个目标使用记录是否存在异常使用记录;Detecting whether there is an abnormal usage record in the at least one target usage record;

当所述至少一个目标使用记录存在异常使用记录时,确定所述显示画面的卡顿原因为所述异常使用记录所对应的系统资源存在异常。When there is an abnormal usage record in the at least one target usage record, it is determined that the cause of the freezing of the display screen is that the system resource corresponding to the abnormal usage record is abnormal.

可选的,所述方法还包括:Optionally, the method further includes:

在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录之前,锁定所述n个缓存器,以使所述n个缓存器中的系统资源使用记录停止更新;Before extracting the usage records of m types of system resources from the n buffers preset in the terminal, locking the n buffers, so that the system resource usage records in the n buffers stop updating;

在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录之后,After extracting the usage records of m types of system resources from the n buffers preset in the terminal,

对所述n个缓存器进行解锁,以使所述n个缓存器中的系统资源使用记录继续更新。The n buffers are unlocked, so that the system resource usage records in the n buffers are continuously updated.

可选的,每个缓存器用于存储一种系统资源的使用记录。Optionally, each buffer is used to store a usage record of a system resource.

可选的,所述m种系统资源包括内存资源、中央处理器CPU资源和输入输出带宽资源中的至少一种。Optionally, the m types of system resources include at least one of memory resources, central processing unit CPU resources, and input and output bandwidth resources.

根据本公开实施例的第二方面,提供一种卡顿原因确定装置,所述装置包括:According to a second aspect of the embodiments of the present disclosure, there is provided a device for determining a cause of a jam, the device comprising:

检测模块,被配置为检测终端的显示画面是否发生卡顿;a detection module, configured to detect whether the display screen of the terminal is stuck;

提取模块,被配置为当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;The extraction module is configured to extract the usage records of m types of system resources from n buffers preset in the terminal when the display screen freezes, wherein each buffer is used to store at least one system resource usage records, n≥1, m≥1;

确定模块,被配置为根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因。The determining module is configured to determine the cause of the freezing of the display screen according to the usage records of the m types of system resources.

可选的,所述装置还包括:Optionally, the device further includes:

划分模块,被配置为在所述终端的系统中划分出所述n个缓存器,每个缓存器占用的存储空间固定;a dividing module, configured to divide the n buffers in the system of the terminal, and the storage space occupied by each buffer is fixed;

更新模块,被配置为根据所述m种系统资源的最新使用记录,更新所述n个缓存器中的内容。The updating module is configured to update the contents in the n buffers according to the latest usage records of the m types of system resources.

可选的,所述更新模块,包括:Optionally, the update module includes:

第一获取子模块,被配置为获取第一系统资源的最新使用记录,所述第一系统资源为所述m种系统资源中任一种系统资源;a first acquisition submodule, configured to acquire the latest usage record of a first system resource, where the first system resource is any one of the m types of system resources;

删除子模块,被配置为在用于存储所述第一系统资源的使用记录的第一缓存器中,删除所述第一系统资源最早的使用记录;a deletion submodule, configured to delete the earliest usage record of the first system resource in the first buffer for storing the usage record of the first system resource;

存储子模块,被配置为在所述第一缓存器中存储所述第一系统资源的最新使用记录。The storage submodule is configured to store the latest usage record of the first system resource in the first buffer.

可选的,所述第一缓存器中采用第一资源链表存储所述第一系统资源的使用记录,所述第一资源链表中的所述第一系统资源的使用记录按照时间先后顺序依次排列;Optionally, a first resource linked list is used in the first buffer to store the usage records of the first system resources, and the usage records of the first system resources in the first resource linked list are arranged in chronological order. ;

所述删除子模块,被配置为:The delete submodule is configured as:

判断所述第一资源链表中的表项是否全部被占用,当所述第一资源链表中的表项全部被占用时,删除所述第一资源链表的首个表项;Determine whether all the entries in the first resource linked list are occupied, and when all the entries in the first resource linked list are occupied, delete the first entry of the first resource linked list;

所述存储子模块,被配置为:The storage submodule is configured as:

在所述第一资源链表的末位增加表项,在增加的表项中记录所述第一系统资源的最新使用记录。An entry is added at the last position of the first resource linked list, and the latest usage record of the first system resource is recorded in the added entry.

可选的,所述第一获取子模块,被配置为:Optionally, the first acquisition sub-module is configured as:

当监测到所述第一系统资源正在被使用时,判断所述第一系统资源是否为前台正在运行的目标应用所对应的系统资源;When monitoring that the first system resource is being used, determine whether the first system resource is the system resource corresponding to the target application running in the foreground;

当所述第一系统资源为所述目标应用所对应的系统资源时,获取所述第一系统资源的最新使用记录。When the first system resource is the system resource corresponding to the target application, acquire the latest usage record of the first system resource.

可选的,所述目标应用为任一前台正在运行的应用,或者,所述目标应用为前台正在运行的指定应用。Optionally, the target application is any application running in the foreground, or the target application is a specified application running in the foreground.

可选的,所述使用记录包括使用时间段,Optionally, the usage record includes a usage time period,

所述确定模块,包括:The determining module includes:

第二获取子模块,被配置为获取卡顿信息,所述卡顿信息包括所述显示画面产生卡顿的卡顿时间段;a second acquisition sub-module, configured to acquire stall information, where the stall information includes the stall time period during which the display screen stalls;

第一确定子模块,被配置为在所述m种系统资源使用记录中确定至少一个目标使用记录,所述目标使用记录的使用时间段与所述卡顿时间段存在交集;a first determination submodule, configured to determine at least one target usage record in the m types of system resource usage records, where the usage time period of the target usage record and the stuck time period have an intersection;

检测子模块,被配置为检测所述至少一个目标使用记录是否存在异常使用记录;a detection submodule, configured to detect whether there is an abnormal usage record in the at least one target usage record;

第二确定子模块,被配置为当所述至少一个目标使用记录存在异常使用记录时,确定所述显示画面的卡顿原因为所述异常使用记录所对应的系统资源存在异常。The second determining submodule is configured to, when there is an abnormal usage record in the at least one target usage record, determine that the cause of the freezing of the display screen is that the system resource corresponding to the abnormal usage record is abnormal.

可选的,所述装置还包括:Optionally, the device further includes:

锁定模块,被配置为锁定所述n个缓存器,以使所述n个缓存器中的系统资源使用记录停止更新;a locking module, configured to lock the n buffers, so that the system resource usage records in the n buffers stop updating;

解锁模块,被配置为对所述n个缓存器进行解锁,以使所述n个缓存器中的系统资源使用记录继续更新。The unlocking module is configured to unlock the n buffers, so that the system resource usage records in the n buffers continue to be updated.

可选的,每个缓存器用于存储一种系统资源的使用记录。Optionally, each buffer is used to store a usage record of a system resource.

可选的,所述m种系统资源包括内存资源、中央处理器CPU资源和输入输出带宽资源中的至少一种。Optionally, the m types of system resources include at least one of memory resources, central processing unit CPU resources, and input and output bandwidth resources.

根据本公开实施例的第三方面,提供一种卡顿原因确定装置,包括:According to a third aspect of the embodiments of the present disclosure, there is provided a device for determining a cause of a jam, including:

处理器;processor;

用于存储所述处理器的可执行指令的存储器;memory for storing executable instructions for the processor;

其中,所述处理器被配置为:wherein the processor is configured to:

检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck;

当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1;

根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因。According to the usage records of the m types of system resources, the cause of the freezing of the display screen is determined.

根据本公开实施例的第四方面,提供一种存储介质,当所述存储介质中的指令由终端的处理器执行时,使得所述终端能够执行一种卡顿原因确定方法,所述方法包括:According to a fourth aspect of the embodiments of the present disclosure, a storage medium is provided. When an instruction in the storage medium is executed by a processor of a terminal, the terminal can execute a method for determining a cause of a freeze, the method comprising: :

检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck;

当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1;

根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因。According to the usage records of the m types of system resources, the cause of the freezing of the display screen is determined.

本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

本公开实施例提供的卡顿原因确定方法、装置及存储介质,可以在终端中预先设置n个缓存器,并将m种系统资源的使用记录存储在该n个缓存器中,当检测到终端的显示画面发生卡顿时,可以根据终端的缓存器中的该m种系统资源的使用记录,确定显示画面的卡顿原因,无需借助电脑确定显示画面的卡顿原因,提高了确定卡顿原因的灵活性。In the method, device, and storage medium for determining the cause of jamming provided by the embodiments of the present disclosure, n buffers can be preset in the terminal, and the usage records of m types of system resources are stored in the n buffers. When the terminal is detected When the display screen freezes, the cause of the screen freeze can be determined according to the usage records of the m types of system resources in the buffer of the terminal, without the need to use a computer to determine the cause of the screen freeze, which improves the ability to determine the cause of the freeze. flexibility.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary only and do not limit the present disclosure.

附图说明Description of drawings

为了更清楚地说明本公开的实施例,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present disclosure more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, which are of great significance to the art. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.

图1是本公开一示意性实施例提供的一种卡顿原因确定方法的流程图。FIG. 1 is a flowchart of a method for determining a cause of a freeze provided by an exemplary embodiment of the present disclosure.

图2-1是本公开一示意性实施例提供的另一种卡顿原因确定方法的流程图。FIG. 2-1 is a flowchart of another method for determining a cause of a freeze provided by an exemplary embodiment of the present disclosure.

图2-2是本公开一示意性实施例提供的一种更新缓存器内容的方法流程图。2-2 is a flowchart of a method for updating cache content provided by an exemplary embodiment of the present disclosure.

图2-3a是本公开一示意性实施例提供的一种缓存器的数据结构示意图。2-3a is a schematic diagram of a data structure of a buffer provided by an exemplary embodiment of the present disclosure.

图2-3b是本公开一示意性实施例提供的另一种缓存器的数据结构示意图。2-3b are schematic diagrams of a data structure of another buffer provided by an exemplary embodiment of the present disclosure.

图2-3c是本公开一示意性实施例提供的又一种缓存器的数据结构示意图。2-3c are schematic diagrams of a data structure of another buffer provided by an exemplary embodiment of the present disclosure.

图2-4是本公开一示意性实施例提供的一种确定显示画面的卡顿原因的方法流程图。2-4 are flowcharts of a method for determining the cause of a freeze of a display screen provided by an exemplary embodiment of the present disclosure.

图3-1是根据一示例性实施例示出的一种卡顿原因确定装置的框图。FIG. 3-1 is a block diagram of an apparatus for determining a cause of a freeze according to an exemplary embodiment.

图3-2是根据一示例性实施例示出的另一种卡顿原因确定装置的框图。FIG. 3-2 is a block diagram of another device for determining a cause of a freeze according to an exemplary embodiment.

图3-3是根据一示例性实施例示出的一种更新模块的框图。3-3 is a block diagram of an update module according to an exemplary embodiment.

图3-4是根据一示例性实施例示出的一种确定模块的框图。3-4 are block diagrams of a determination module according to an exemplary embodiment.

图3-5是根据一示例性实施例示出的又一种卡顿原因确定装置的框图。3-5 are block diagrams of yet another device for determining a cause of jamming according to an exemplary embodiment.

图4是根据一示例性实施例示出的一种用于卡顿原因确定装置的框图。Fig. 4 is a block diagram of an apparatus for determining a cause of a jam according to an exemplary embodiment.

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.

具体实施方式Detailed ways

为了使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开作进一步地详细描述,显然,所描述的实施例仅仅是本公开一部份实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. . Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.

图1是本公开一示意性实施例提供的一种卡顿原因确定方法的流程图,该方法可以应用于终端,如图1所示,该方法包括:FIG. 1 is a flowchart of a method for determining a cause of a freeze provided by an exemplary embodiment of the present disclosure. The method can be applied to a terminal. As shown in FIG. 1 , the method includes:

步骤101、检测终端的显示画面是否发生卡顿。Step 101: Detect whether the display screen of the terminal is stuck.

步骤102、当显示画面发生卡顿时,在终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1。Step 102: When the display screen freezes, extract the usage records of m types of system resources from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥1 , m≥1.

步骤103、根据m种系统资源的使用记录,确定显示画面的卡顿原因。Step 103: Determine the cause of the freezing of the display screen according to the usage records of the m types of system resources.

综上所述,本公开实施例提供的卡顿原因确定方法,可以在终端中预先设置n个缓存器,并将m种系统资源的使用记录存储在该n个缓存器中,当检测到终端的显示画面发生卡顿时,可以根据终端的缓存器中的该m种系统资源的使用记录,确定显示画面的卡顿原因,无需借助电脑确定显示画面的卡顿原因,提高了确定卡顿原因的灵活性。To sum up, in the method for determining the cause of the jam provided by the embodiments of the present disclosure, n buffers can be preset in the terminal, and the usage records of m types of system resources are stored in the n buffers. When the terminal is detected When the display screen freezes, the cause of the screen freeze can be determined according to the usage records of the m types of system resources in the buffer of the terminal, without the need to use a computer to determine the cause of the screen freeze, which improves the ability to determine the cause of the freeze. flexibility.

本公开实施例提供的卡顿原因确定方法可以应用于安装有安卓系统的终端,图2-1是本公开一示意性实施例提供的一种卡顿原因确定方法的流程图,如图2-1所示,该方法包括:The method for determining a cause of a freeze provided by an embodiment of the present disclosure can be applied to a terminal installed with an Android system. FIG. 2-1 is a flowchart of a method for determining a cause of a freeze provided by an exemplary embodiment of the present disclosure, as shown in FIG. 2- 1, the method includes:

步骤201、在终端的系统中划分出n个缓存器,该n个缓存器用于存储m种系统资源的使用记录,n≥1,m≥1。Step 201: Divide n buffers in the system of the terminal, where the n buffers are used to store the usage records of m types of system resources, where n≥1 and m≥1.

实际应用中,可以在安卓系统的linux内核中划分出n个缓存器,该n个缓存器可以存储m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录。In practical applications, n buffers can be divided in the linux kernel of the Android system, and the n buffers can store the usage records of m kinds of system resources, wherein each buffer is used to store the usage records of at least one system resource. .

可选的,每个缓存器可以用于存储一种系统资源的使用记录,一种系统资源的使用记录存储在单独的缓存器中,便于系统资源的使用记录的分类,为后期从缓存器中提取相应种类的系统资源的使用记录提供了便利。Optionally, each buffer can be used to store a usage record of a system resource, and a usage record of a system resource is stored in a separate buffer, which is convenient for the classification of the usage record of the system resource, and is used for later retrieval from the buffer. It is convenient to extract usage records of corresponding kinds of system resources.

可选的,m种系统资源可以包括内存资源、CPU资源和I/O带宽资源中的至少一种。Optionally, the m types of system resources may include at least one of memory resources, CPU resources, and I/O bandwidth resources.

需要说明的是,每个缓存器占用的存储空间固定,可选的,每个缓存器占用的存储空间可以为8千字节(英文:Kilobyte;简称:KB)。It should be noted that the storage space occupied by each buffer is fixed, and optionally, the storage space occupied by each buffer may be 8 kilobytes (English: Kilobyte; KB for short).

步骤202、根据m种系统资源的最新使用记录,更新n个缓存器中的内容。Step 202: Update the contents in the n buffers according to the latest usage records of the m types of system resources.

可选的,根据m种系统资源的最新使用记录,更新n个缓存器中的内容的方法,如图2-2所示,可以包括:Optionally, according to the latest usage records of m types of system resources, the method for updating the content in the n buffers, as shown in Figure 2-2, may include:

步骤2021、获取第一系统资源的最新使用记录,该第一系统资源为m种系统资源中任一种系统资源。Step 2021: Acquire the latest usage record of the first system resource, where the first system resource is any one of the m types of system resources.

可选的,获取第一系统资源的最新使用记录的方法,可以包括:Optionally, the method for obtaining the latest usage record of the first system resource may include:

S11、当监测到第一系统资源正在被使用时,判断第一系统资源是否为前台正在运行的目标应用所对应的系统资源。S11. When monitoring that the first system resource is being used, determine whether the first system resource is a system resource corresponding to the target application running in the foreground.

在本公开实施例中,目标应用是预先设定的需要存储器记录系统资源的使用记录的应用。可选的,该目标应用可以为任一前台正在运行的应用,例如,假设用户当前在终端的显示画面上使用米聊,则米聊为一目标应用,需要判断第一系统资源是否为米聊所对应的系统资源,也即是判断第一系统资源是否为米聊所占用的系统资源;或者,目标应用可以为前台正在运行的指定应用,例如指定应用包括米聊、小米桌面和小米视频,当前台正在运行米聊时,则米聊为一目标应用,需要判断第一系统资源是否为米聊所占用的系统资源。In the embodiment of the present disclosure, the target application is a preset application that needs the memory to record the usage record of the system resource. Optionally, the target application can be any application running in the foreground. For example, if the user is currently using Michat on the display screen of the terminal, then Michat is a target application, and it is necessary to determine whether the first system resource is Michat. The corresponding system resources, that is, the system resources used to determine whether the first system resource is occupied by Mi Chat; or, the target application can be a specified application running in the foreground, for example, the specified application includes Mi Chat, Xiaomi Desktop and Xiaomi Video, When Mi Chat is running in the foreground, then Mi Chat is a target application, and it is necessary to determine whether the first system resource is the system resource occupied by Mi Chat.

S12、当第一系统资源为目标应用所对应的系统资源时,获取第一系统资源的最新使用记录。S12. When the first system resource is the system resource corresponding to the target application, acquire the latest usage record of the first system resource.

步骤2022、在用于存储第一系统资源的使用记录的第一缓存器中,删除第一系统资源最早的使用记录。Step 2022: Delete the earliest usage record of the first system resource in the first buffer for storing the usage record of the first system resource.

可选的,第一缓存器中可以采用第一资源链表存储第一系统资源的使用记录,该第一资源链表中的第一系统资源的使用记录按照时间先后顺序依次排列。Optionally, a first resource linked list may be used in the first buffer to store usage records of the first system resources, and the usage records of the first system resources in the first resource linked list are arranged in chronological order.

可选的,假设每个缓存器中存储一种系统资源的使用记录,定义存储内存资源的使用记录的缓存器为buffer1,存储CPU资源的使用记录的缓存器为buffer2,存储I/O带宽资源的使用记录的缓存器为buffer3。buffer1的数据结构可以如图2-3a所示,buffer1中记录了开始请求内存分配的第一时间戳t1,目标应用对应的进程标识pid以及从开始请求内存分配到分配到内存过程的时长d1;buffer2的数据结构可以如图2-3b所示,buffer2中记录了CPU开始调度的第二时间戳t2,目标应用对应的进程标识pid以及CPU调度的持续时长d2;buffer3的数据结构可以如图2-3c所示,buffer3中记录了开始I/O的第三时间戳t3,目标应用对应的进程标识pid以及I/O的持续时长d3。Optionally, it is assumed that each buffer stores a usage record of a system resource, the buffer for storing the usage record of memory resources is defined as buffer1, the buffer for storing the usage record of CPU resources is buffer2, and the buffer for storing I/O bandwidth resources is defined. The buffer used for the record is buffer3. The data structure of buffer1 can be shown in Figure 2-3a. Buffer1 records the first timestamp t1 when memory allocation is requested, the process identifier pid corresponding to the target application, and the duration d1 from the start of requesting memory allocation to the process of allocation to memory; The data structure of buffer2 can be shown in Figure 2-3b. The second timestamp t2 when the CPU starts scheduling is recorded in buffer2, the process identifier pid corresponding to the target application and the duration d2 of CPU scheduling; the data structure of buffer3 can be shown in Figure 2 As shown in -3c, buffer3 records the third timestamp t3 at which I/O starts, the process identifier pid corresponding to the target application, and the I/O duration d3.

示例的,假设第一系统资源为CPU资源,则如图2-3b所示,第一资源链表buffer2中第一系统资源的使用记录从上至下按照时间先后顺序依次排列,假设第一资源链表buffer2中一共可以存储q条使用记录,表项data1存储第一系统资源的使用记录中最早的使用记录,表项dataq存储第一系统资源的使用记录中最新的使用记录。假设第一资源链表buffer2中一共可以存储3条使用记录,3条使用记录的时间戳分别为9:00、9:05和9:10,则表项data1存储9:00对应的使用记录,表项dataq存储9:10对应的使用记录。As an example, assuming that the first system resource is a CPU resource, as shown in Figure 2-3b, the usage records of the first system resource in the first resource linked list buffer2 are arranged in chronological order from top to bottom, assuming that the first resource linked list A total of q usage records can be stored in buffer2, the table entry data1 stores the earliest usage record among the usage records of the first system resource, and the table entry dataq stores the latest usage record among the usage records of the first system resource. Assuming that a total of 3 usage records can be stored in the first resource linked list buffer2, and the timestamps of the 3 usage records are 9:00, 9:05 and 9:10 respectively, the table entry data1 stores the usage records corresponding to 9:00. Item dataq stores usage records corresponding to 9:10.

可选的,在用于存储第一系统资源的第一缓存器中,删除第一系统资源最早的使用记录的方法,可以包括:Optionally, in the first buffer for storing the first system resource, the method for deleting the earliest usage record of the first system resource may include:

判断第一资源链表中的表项是否全部被占用,当第一资源链表中的表项全部被占用时,删除第一资源链表的首个表项。It is judged whether all the entries in the first resource linked list are occupied, and when all the entries in the first resource linked list are occupied, the first entry of the first resource linked list is deleted.

示例的,如图2-3b所示,当第一资源链表buffer2中的q个表项全部被占用时,删除第一资源链表的首个表项也即是删除表项data1,则原先表项data2成为新的表项data1,原先的表项dataq成为表项dataq-1。For example, as shown in Figure 2-3b, when all q entries in the first resource linked list buffer2 are occupied, deleting the first entry in the first resource linked list is also deleting entry data1, then the original entry data2 becomes the new entry data1, and the original entry dataq becomes the entry dataq-1.

需要说明的是,由于缓存器中只存储目标应用所对应的系统资源的使用记录,缓存器中可以存储过去几秒内目标应用所对应的系统资源的使用记录,便于后期提取目标应用所对应的系统资源的使用记录。It should be noted that, since only the usage records of the system resources corresponding to the target application are stored in the buffer, the buffer can store the usage records of the system resources corresponding to the target application in the past few seconds, which is convenient for later extraction of the system resources corresponding to the target application. System resource usage records.

步骤2023、在第一缓存器中存储第一系统资源的最新使用记录。Step 2023: Store the latest usage record of the first system resource in the first buffer.

可选的,在第一缓存器中存储第一系统资源的最新使用记录的方法,可以包括:Optionally, the method for storing the latest usage record of the first system resource in the first buffer may include:

在第一资源链表的末位增加表项,在增加的表项中记录第一系统资源的最新使用记录。An entry is added at the end of the first resource linked list, and the latest usage record of the first system resource is recorded in the added entry.

示例的,如图2-3b所示,在第一资源链表buffer2的表项dataq-1的后面增加表项dataq,在表项dataq中记录第一系统资源的最新使用记录。For example, as shown in FIG. 2-3b, an entry dataq is added after the entry dataq-1 of the first resource linked list buffer2, and the latest usage record of the first system resource is recorded in the entry dataq.

步骤203、检测终端的显示画面是否发生卡顿。Step 203: Detect whether the display screen of the terminal is stuck.

可选的,可以在终端中预先设置在终端的显示界面上的一次滑屏操作对应的终端所需绘制的图像帧的帧数,假设在终端的显示界面上进行一次滑屏操作,终端需要绘制30个图像帧,则可以检测预设时间内用户对显示界面的滑屏操作的次数与终端绘制的图像帧的帧数是否满足公式:图像帧的帧数=滑屏操作的次数×30,当不满足该公式时,确定终端的显示画面发生卡顿。Optionally, the number of frames of image frames to be drawn by the terminal corresponding to one screen sliding operation on the display interface of the terminal can be preset in the terminal. Assuming that a screen sliding operation is performed on the display interface of the terminal, the terminal needs to draw the frame number. If there are 30 image frames, it can be detected whether the number of user's sliding operations on the display interface within the preset time and the number of image frames drawn by the terminal satisfy the formula: the number of image frames = the number of sliding operations × 30, when When the formula is not satisfied, it is determined that the display screen of the terminal freezes.

步骤204、当显示画面发生卡顿时,锁定n个缓存器,以使n个缓存器中的系统资源使用记录停止更新。Step 204 , when the display screen freezes, lock the n registers to stop updating the system resource usage records in the n registers.

需要说明的是,当显示画面发生卡顿时,锁定该n个缓存器,可以防止该n个缓存器中的系统资源使用记录继续更新,导致显示画面发生卡顿时的系统资源使用记录被删除。It should be noted that when the display screen freezes, locking the n buffers can prevent the system resource usage records in the n buffers from continuing to be updated, resulting in deletion of the system resource usage records when the display screen freezes.

步骤205、提取m种系统资源的使用记录。Step 205: Extract the usage records of m types of system resources.

可选的,可以从锁定的n个缓存器中提取目标应用对应的m种系统资源的使用记录。Optionally, the usage records of m types of system resources corresponding to the target application may be extracted from the locked n buffers.

步骤206、对n个缓存器进行解锁,以使n个缓存器中的系统资源使用记录继续更新。Step 206: Unlock the n buffers, so that the system resource usage records in the n buffers continue to be updated.

需要说明的是,在提取m种系统资源的使用记录之后,对n个缓存器进行解锁,使得该n个缓存器中的系统资源使用记录得以更新。It should be noted that, after extracting the usage records of m types of system resources, the n buffers are unlocked, so that the system resource usage records in the n buffers can be updated.

步骤207、根据m种系统资源的使用记录,确定显示画面的卡顿原因。Step 207: Determine the cause of the freezing of the display screen according to the usage records of the m types of system resources.

可选的,该使用记录可以包括系统资源的使用时间段,实际应用中,如图2-3a至2-3c所示,该使用记录可以包括开始时间戳和使用持续时长,根据开始时间戳和使用持续时长可以获取系统资源的使用时间段。Optionally, the usage record may include the usage time period of the system resource. In practical applications, as shown in Figures 2-3a to 2-3c, the usage record may include the start timestamp and the usage duration, according to the start timestamp and the usage duration. Use Duration to get the usage time period of system resources.

可选的,根据m种系统资源使用记录,确定显示画面的卡顿原因的方法,如图2-4所示,可以包括:Optionally, according to the m types of system resource usage records, the method for determining the cause of the screen freeze, as shown in Figure 2-4, may include:

步骤2071、获取卡顿信息,该卡顿信息包括显示画面产生卡顿的卡顿时间段。Step 2071: Acquire the freeze information, where the freeze information includes the freeze time period during which the display screen freezes.

需要说明的是,可以在检测终端的显示画面是否发生卡顿的过程中,当确定终端的显示画面发生卡顿时,获取卡顿信息。It should be noted that, in the process of detecting whether the display screen of the terminal is stuck, when it is determined that the display screen of the terminal is stuck, the stuck information can be obtained.

可选的,当终端的显示画面发生卡顿时,也即是终端所绘制的图像帧中存在“掉帧”时,可以获取掉帧的时间段,也即是显示画面产生卡顿的卡顿时间段。Optionally, when the display screen of the terminal is stuck, that is, when there is a "drop frame" in the image frame drawn by the terminal, the time period during which the frame is dropped can be obtained, that is, the freeze time when the display screen freezes. part.

步骤2072、在m种系统资源使用记录中确定至少一个目标使用记录,该目标使用记录的使用时间段与卡顿时间段存在交集。Step 2072: Determine at least one target usage record from the m types of system resource usage records, where the usage time period of the target usage record and the stuck time period overlap.

示例的,假设卡顿时间段为10秒至11秒,卡顿持续时长为1秒,以CPU资源为例进行说明,由于一次CPU调度的持续时长一般在10毫秒以内,因此在卡顿时间段内,缓存器buffer2中可以记录有多个时间段的目标使用记录。As an example, assume that the freezing time period is 10 seconds to 11 seconds, and the freezing duration is 1 second. Taking CPU resources as an example, since the duration of a CPU scheduling is generally within 10 milliseconds, the freezing time period In the buffer2, target usage records of multiple time periods can be recorded.

步骤2073、检测至少一个目标使用记录是否存在异常使用记录。Step 2073: Detect whether there is an abnormal usage record in at least one target usage record.

示例的,以卡顿时长为1秒为例进行说明,以卡顿时长的四分之一的时长也即是0.25秒为阈值。当目标使用记录为内存资源的使用记录时,检测1秒内目标应用从开始请求内存分配到分配到内存的过程的时长的总和total1是否超过0.25秒,当total1超过0.25秒时,确定内存资源的使用记录存在异常使用记录;当目标使用记录为CPU资源的使用记录时,检测1秒内CPU调度的持续时长的时长的总和total2是否少于0.75秒,当total2少于0.75秒时,确定CPU资源的使用记录存在异常使用记录;当目标使用记录为I/O带宽资源的使用记录时,1秒内I/O的持续时长的总和total3是否超过0.25秒,当total3超过0.25秒时,确定I/O带宽资源的使用记录存在异常使用记录。或者,当total1、total2和total3都不满足上述条件时,确定(0.25-total1)、(total2-0.75)和(0.25-total3)中数值的最小的对应的系统资源存在异常。By way of example, the freeze duration is 1 second as an example, and the threshold is 0.25 seconds, which is a quarter of the freeze duration. When the target usage record is the memory resource usage record, check whether the total duration of the target application from the start of requesting memory allocation to the process of allocating to memory within 1 second exceeds 0.25 seconds. When total1 exceeds 0.25 seconds, determine whether the memory resource There is an abnormal usage record in the usage record; when the target usage record is the usage record of CPU resources, check whether the sum total2 of the duration of CPU scheduling within 1 second is less than 0.75 seconds, and when total2 is less than 0.75 seconds, determine the CPU resource There is an abnormal usage record in the usage record; when the target usage record is the usage record of I/O bandwidth resources, whether the total duration of I/O in 1 second total3 exceeds 0.25 seconds, when total3 exceeds 0.25 seconds, determine the I/O O The usage record of bandwidth resources has abnormal usage records. Or, when total1, total2 and total3 do not satisfy the above conditions, it is determined that the system resource corresponding to the smallest value among (0.25-total1), (total2-0.75) and (0.25-total3) is abnormal.

步骤2074、当至少一个目标使用记录存在异常使用记录时,确定显示画面的卡顿原因为该异常使用记录所对应的系统资源存在异常。Step 2074 , when there is an abnormal usage record in at least one target usage record, determine that the cause of the freezing of the display screen is that the system resource corresponding to the abnormal usage record is abnormal.

可选的,当内存资源的使用记录存在异常使用记录时,确定内存资源存在异常;当CPU资源的使用记录存在异常使用记录,确定CPU资源存在异常;当I/O带宽资源的使用记录存在异常使用记录时,确定I/O带宽资源存在异常。Optionally, when there is an abnormal usage record in the memory resource usage record, it is determined that the memory resource is abnormal; when there is an abnormal usage record in the CPU resource usage record, it is determined that the CPU resource is abnormal; when the I/O bandwidth resource usage record is abnormal When using the record, it is determined that there is an abnormality in the I/O bandwidth resource.

实际应用中,在确定显示画面的卡顿原因后,卡顿处理模块可以根据该卡顿原因进行相关处理,例如,卡顿原因为CPU资源存在异常,则卡顿处理模块可以在终端的显示画面上进行提示,提示用户关闭后台占用CPU资源的应用等。In practical applications, after determining the cause of the freeze on the display screen, the freeze processing module can perform related processing according to the cause of the freeze. For example, if the cause of the freeze is abnormal CPU resources, the freeze processing module can display the screen on the terminal. Prompt the user to close applications that consume CPU resources in the background.

需要说明的是,本公开实施例提供的卡顿原因确定方法步骤的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减,例如步骤202与步骤203的位置可以交换,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本公开的保护范围之内,因此不再赘述。It should be noted that, the sequence of steps of the method for determining the cause of the jam provided by the embodiment of the present disclosure can be appropriately adjusted, and the steps can also be increased or decreased according to the situation. For example, the positions of step 202 and step 203 can be exchanged. Those skilled in the art can easily conceive of various methods within the technical scope disclosed in the present disclosure, and they should all be covered within the protection scope of the present disclosure, and thus will not be repeated here.

综上所述,本公开实施例提供的卡顿原因确定方法,可以在终端中预先设置n个缓存器,并将m种系统资源的使用记录存储在该n个缓存器中,当检测到终端的显示画面发生卡顿时,可以根据终端的缓存器中的该m种系统资源的使用记录,确定显示画面的卡顿原因,无需借助电脑确定显示画面的卡顿原因,提高了确定卡顿原因的灵活性。To sum up, in the method for determining the cause of the jam provided by the embodiments of the present disclosure, n buffers can be preset in the terminal, and the usage records of m types of system resources are stored in the n buffers. When the terminal is detected When the display screen freezes, the cause of the screen freeze can be determined according to the usage records of the m types of system resources in the buffer of the terminal, without the need to use a computer to determine the cause of the screen freeze, which improves the ability to determine the cause of the freeze. flexibility.

图3-1是根据一示例性实施例示出的一种卡顿原因确定装置30的框图,如图3-1所示,该装置30可以包括:Fig. 3-1 is a block diagram of an apparatus 30 for determining a cause of a freeze according to an exemplary embodiment. As shown in Fig. 3-1, the apparatus 30 may include:

检测模块301,被配置为检测终端的显示画面是否发生卡顿。The detection module 301 is configured to detect whether the display screen of the terminal is stuck.

提取模块302,被配置为当显示画面发生卡顿时,在终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1。The extraction module 302 is configured to extract the usage records of m kinds of system resources from n buffers preset in the terminal when the display screen freezes, wherein each buffer is used to store the usage records of at least one system resource , n≥1, m≥1.

确定模块303,被配置为根据m种系统资源的使用记录,确定显示画面的卡顿原因。The determining module 303 is configured to determine the cause of the freezing of the display screen according to the usage records of the m types of system resources.

综上所述,本公开实施例提供的卡顿原因确定装置,可以在终端中预先设置n个缓存器,并将m种系统资源的使用记录存储在该n个缓存器中,当通过检测模块检测到终端的显示画面发生卡顿时,可以通过提取模块获取终端的缓存器中的该m种系统资源的使用记录,再通过确定模块确定显示画面的卡顿原因,无需借助电脑确定显示画面的卡顿原因,提高了确定卡顿原因的灵活性。To sum up, the device for determining the cause of the jam provided by the embodiment of the present disclosure can preset n buffers in the terminal, and store the usage records of m types of system resources in the n buffers. When it is detected that the display screen of the terminal is stuck, the use record of the m kinds of system resources in the buffer of the terminal can be obtained through the extraction module, and then the cause of the freeze of the display screen can be determined by the determination module, without the need to use a computer to determine the card of the display screen. The cause of the freeze is improved, and the flexibility to determine the cause of the freeze is improved.

可选的,如图3-2所示,该装置30还可以包括:Optionally, as shown in FIG. 3-2, the device 30 may further include:

划分模块304,被配置为在终端的系统中划分出n个缓存器,每个缓存器占用的存储空间固定。The dividing module 304 is configured to divide n buffers in the system of the terminal, and the storage space occupied by each buffer is fixed.

更新模块305,被配置为根据m种系统资源的最新使用记录,更新n个缓存器中的内容。The updating module 305 is configured to update the contents in the n buffers according to the latest usage records of the m types of system resources.

可选的,如图3-3所示,更新模块305,可以包括:Optionally, as shown in FIG. 3-3, the update module 305 may include:

第一获取子模块3051,被配置为获取第一系统资源的最新使用记录,该第一系统资源为m种系统资源中任一种系统资源。The first obtaining sub-module 3051 is configured to obtain the latest usage record of the first system resource, where the first system resource is any one of the m types of system resources.

删除子模块3052,被配置为在用于存储第一系统资源的使用记录的第一缓存器中,删除第一系统资源最早的使用记录。The deletion sub-module 3052 is configured to delete the earliest usage record of the first system resource in the first buffer for storing the usage record of the first system resource.

存储子模块3053,被配置为在第一缓存器中存储第一系统资源的最新使用记录。The storage sub-module 3053 is configured to store the latest usage record of the first system resource in the first buffer.

实际应用中,第一缓存器中可以采用第一资源链表存储第一系统资源的使用记录,该第一资源链表中的第一系统资源的使用记录按照时间先后顺序依次排列。In practical applications, a first resource linked list may be used in the first buffer to store usage records of the first system resources, and the usage records of the first system resources in the first resource linked list are arranged in chronological order.

相应的,删除子模块3052,被配置为:判断第一资源链表中的表项是否全部被占用,当第一资源链表中的表项全部被占用时,删除第一资源链表的首个表项;存储子模块3053,被配置为:在第一资源链表的末位增加表项,在增加的表项中记录第一系统资源的最新使用记录。Correspondingly, the deletion sub-module 3052 is configured to: determine whether all the entries in the first resource linked list are occupied, and when all the entries in the first resource linked list are occupied, delete the first entry of the first resource linked list ; The storage sub-module 3053 is configured to: add an entry at the last position of the first resource linked list, and record the latest usage record of the first system resource in the added entry.

可选的,第一获取子模块3051,可以被配置为:Optionally, the first acquisition sub-module 3051 can be configured as:

当监测到第一系统资源正在被使用时,判断第一系统资源是否为前台正在运行的目标应用所对应的系统资源;当第一系统资源为目标应用所对应的系统资源时,获取第一系统资源的最新使用记录。When monitoring that the first system resource is being used, determine whether the first system resource is the system resource corresponding to the target application running in the foreground; when the first system resource is the system resource corresponding to the target application, obtain the first system resource The latest usage history of the resource.

可选的,目标应用可以为任一前台正在运行的应用,或者,目标应用可以为前台正在运行的指定应用。Optionally, the target application may be any application running in the foreground, or the target application may be a specified application running in the foreground.

可选的,使用记录可以包括使用时间段,如图3-4所示,确定模块303,可以包括:Optionally, the usage record may include a usage time period, as shown in FIG. 3-4 , the determining module 303 may include:

第二获取子模块3031,被配置为获取卡顿信息,该卡顿信息包括显示画面产生卡顿的卡顿时间段。The second obtaining sub-module 3031 is configured to obtain the freeze information, where the freeze information includes the freeze time period during which the display screen freezes.

第一确定子模块3032,被配置为在m种系统资源使用记录中确定至少一个目标使用记录,该目标使用记录的使用时间段与卡顿时间段存在交集。The first determination sub-module 3032 is configured to determine at least one target usage record from the m types of system resource usage records, where the usage time period of the target usage record and the stuck time period overlap.

检测子模块3033,被配置为检测至少一个目标使用记录是否存在异常使用记录。The detection sub-module 3033 is configured to detect whether there is an abnormal usage record in at least one target usage record.

第二确定子模块3034,被配置为当至少一个目标使用记录存在异常使用记录时,确定显示画面的卡顿原因为该异常使用记录所对应的系统资源存在异常。The second determining sub-module 3034 is configured to, when at least one target usage record has an abnormal usage record, determine that the cause of the freezing of the display screen is that the system resource corresponding to the abnormal usage record is abnormal.

进一步的,如图3-5所示,装置30还可以包括:Further, as shown in Figures 3-5, the apparatus 30 may further include:

锁定模块306,被配置为锁定n个缓存器,以使该n个缓存器中的系统资源使用记录停止更新。The locking module 306 is configured to lock the n buffers, so as to stop updating the system resource usage records in the n buffers.

解锁模块307,被配置为对n个缓存器进行解锁,以使该n个缓存器中的系统资源使用记录继续更新。The unlocking module 307 is configured to unlock the n buffers, so that the system resource usage records in the n buffers continue to be updated.

可选的,每个缓存器可以用于存储一种系统资源的使用记录。Optionally, each buffer may be used to store a usage record of a system resource.

可选的,m种系统资源包括内存资源、CPU资源和I/O带宽资源中的至少一种。Optionally, the m types of system resources include at least one of memory resources, CPU resources, and I/O bandwidth resources.

综上所述,本公开实施例提供的卡顿原因确定装置,可以在终端中预先设置n个缓存器,并将m种系统资源的使用记录存储在该n个缓存器中,当通过检测模块检测到终端的显示画面发生卡顿时,可以通过提取模块获取终端的缓存器中的该m种系统资源的使用记录,再通过确定模块确定显示画面的卡顿原因,无需借助电脑确定显示画面的卡顿原因,提高了确定卡顿原因的灵活性。To sum up, the device for determining the cause of the jam provided by the embodiment of the present disclosure can preset n buffers in the terminal, and store the usage records of m types of system resources in the n buffers. When it is detected that the display screen of the terminal is stuck, the use record of the m kinds of system resources in the buffer of the terminal can be obtained through the extraction module, and then the cause of the freeze of the display screen can be determined by the determination module, without the need to use a computer to determine the card of the display screen. The cause of the freeze is improved, and the flexibility to determine the cause of the freeze is improved.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.

本公开实施例提供一种卡顿原因确定装置,包括:An embodiment of the present disclosure provides a device for determining a cause of a jam, including:

处理器;processor;

用于存储所述处理器的可执行指令的存储器;memory for storing executable instructions for the processor;

其中,所述处理器被配置为:wherein the processor is configured to:

检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck;

当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1;

根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因。According to the usage records of the m types of system resources, the cause of the freezing of the display screen is determined.

图4是根据一示例性实施例示出的一种用于卡顿原因确定装置400的框图。例如,装置400可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 4 is a block diagram of an apparatus 400 for determining a cause of a freeze according to an exemplary embodiment. For example, apparatus 400 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.

参照图4,装置400可以包括以下一个或多个组件:处理组件402,存储器404,电源组件406,多媒体组件408,音频组件410,输入/输出(I/O)的接口412,传感器组件414,以及通信组件416。4, the apparatus 400 may include one or more of the following components: a processing component 402, a memory 404, a power supply component 406, a multimedia component 408, an audio component 410, an input/output (I/O) interface 412, a sensor component 414, and communication component 416 .

处理组件402通常控制装置400的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件402可以包括一个或多个处理器420来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件402可以包括一个或多个模块,便于处理组件402和其他组件之间的交互。例如,处理组件402可以包括多媒体模块,以方便多媒体组件408和处理组件402之间的交互。The processing component 402 generally controls the overall operation of the device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or some of the steps of the methods described above. Additionally, processing component 402 may include one or more modules that facilitate interaction between processing component 402 and other components. For example, processing component 402 may include a multimedia module to facilitate interaction between multimedia component 408 and processing component 402.

存储器404被配置为存储各种类型的数据以支持在装置400的操作。这些数据的示例包括用于在装置400上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器404可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Memory 404 is configured to store various types of data to support operations at device 400 . Examples of such data include instructions for any application or method operating on device 400, contact data, phonebook data, messages, pictures, videos, and the like. Memory 404 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.

电源组件406为装置400的各种组件提供电力。电源组件406可以包括电源管理系统,一个或多个电源,及其他与为装置400生成、管理和分配电力相关联的组件。Power supply assembly 406 provides power to various components of device 400 . Power supply components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 400 .

多媒体组件408包括在所述装置400和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件408包括一个前置摄像头和/或后置摄像头。当装置400处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。Multimedia component 408 includes screens that provide an output interface between the device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, multimedia component 408 includes a front-facing camera and/or a rear-facing camera. When the apparatus 400 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.

音频组件410被配置为输出和/或输入音频信号。例如,音频组件410包括一个麦克风(MIC),当装置400处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器404或经由通信组件416发送。在一些实施例中,音频组件410还包括一个扬声器,用于输出音频信号。Audio component 410 is configured to output and/or input audio signals. For example, audio component 410 includes a microphone (MIC) that is configured to receive external audio signals when device 400 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 404 or transmitted via communication component 416 . In some embodiments, audio component 410 also includes a speaker for outputting audio signals.

I/O接口412为处理组件402和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 412 provides an interface between the processing component 402 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.

传感器组件414包括一个或多个传感器,用于为装置400提供各个方面的状态评估。例如,传感器组件414可以检测到装置400的打开/关闭状态,组件的相对定位,例如所述组件为装置400的显示器和小键盘,传感器组件414还可以检测装置400或装置400一个组件的位置改变,用户与装置400接触的存在或不存在,装置400方位或加速/减速和装置400的温度变化。传感器组件414可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件414还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件414还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor assembly 414 includes one or more sensors for providing status assessment of various aspects of device 400 . For example, the sensor assembly 414 can detect the open/closed state of the device 400, the relative positioning of components, such as the display and keypad of the device 400, and the sensor assembly 414 can also detect a change in the position of the device 400 or a component of the device 400 , the presence or absence of user contact with the device 400 , the orientation or acceleration/deceleration of the device 400 and the temperature change of the device 400 . Sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

通信组件416被配置为便于装置400和其他设备之间有线或无线方式的通信。装置400可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件416经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件416还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。Communication component 416 is configured to facilitate wired or wireless communication between apparatus 400 and other devices. Device 400 may access wireless networks based on communication standards, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

在示例性实施例中,装置400可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 400 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.

在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器404,上述指令可由装置400的处理器420执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory 404 including instructions, executable by the processor 420 of the apparatus 400 to perform the method described above. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

一种非临时性计算机可读存储介质,当所述存储介质中的指令由装置400的处理器执行时,使得装置400能够执行一种卡顿原因确定方法,所述方法包括:A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the apparatus 400, the apparatus 400 can execute a method for determining the cause of a freeze, the method comprising:

检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck;

当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1;

根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因。According to the usage records of the m types of system resources, the cause of the freezing of the display screen is determined.

其中,该装置400可以为终端。Wherein, the apparatus 400 may be a terminal.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or techniques in the technical field not disclosed by the present disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1.一种卡顿原因确定方法,其特征在于,所述方法包括:1. a method for determining the cause of a stuck, it is characterised in that the method comprises: 检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck; 当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1; 根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因,其中,所述使用记录包括使用时间段,所述根据所述m种系统资源使用记录,确定所述显示画面的卡顿原因,包括:获取卡顿信息,所述卡顿信息包括所述显示画面产生卡顿的卡顿时间段;在所述m种系统资源使用记录中确定至少一个目标使用记录,所述目标使用记录的使用时间段与所述卡顿时间段存在交集;检测所述至少一个目标使用记录是否存在异常使用记录;当所述至少一个目标使用记录存在异常使用记录时,确定所述显示画面的卡顿原因为所述异常使用记录所对应的系统资源存在异常。According to the usage records of the m types of system resources, the cause of the freeze of the display screen is determined, wherein the use records include a usage time period, and the use records of the m types of system resources are used to determine the cause of the display screen. The cause of the freeze includes: acquiring the freeze information, where the freeze information includes the freeze time period during which the display screen freezes; determining at least one target usage record in the m types of system resource usage records, the target There is an intersection between the usage time period of the usage record and the freeze time period; detect whether there is an abnormal usage record in the at least one target usage record; when there is an abnormal usage record in the at least one target usage record, determine whether the display screen has an abnormal usage record. The reason for the freeze is that the system resource corresponding to the abnormal usage record is abnormal. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, wherein the method further comprises: 在所述终端的系统中划分出所述n个缓存器,每个缓存器占用的存储空间固定;The n buffers are divided in the system of the terminal, and the storage space occupied by each buffer is fixed; 根据所述m种系统资源的最新使用记录,更新所述n个缓存器中的内容。According to the latest usage records of the m types of system resources, the contents in the n buffers are updated. 3.根据权利要求2所述的方法,其特征在于,所述根据所述m种系统资源的最新使用记录,更新所述n个缓存器中的内容,包括:3. The method according to claim 2, wherein the updating the content in the n buffers according to the latest usage records of the m kinds of system resources, comprises: 获取第一系统资源的最新使用记录,所述第一系统资源为所述m种系统资源中任一种系统资源;acquiring the latest usage record of a first system resource, where the first system resource is any one of the m types of system resources; 在用于存储所述第一系统资源的使用记录的第一缓存器中,删除所述第一系统资源最早的使用记录;In the first buffer for storing the usage record of the first system resource, delete the earliest usage record of the first system resource; 在所述第一缓存器中存储所述第一系统资源的最新使用记录。The latest usage record of the first system resource is stored in the first buffer. 4.根据权利要求3所述的方法,其特征在于,所述第一缓存器中采用第一资源链表存储所述第一系统资源的使用记录,所述第一资源链表中的所述第一系统资源的使用记录按照时间先后顺序依次排列;4. The method according to claim 3, wherein a first resource linked list is used in the first buffer to store usage records of the first system resources, and the first resource linked list in the first resource The usage records of system resources are arranged in chronological order; 所述在用于存储所述第一系统资源的使用记录的第一缓存器中,删除所述第一系统资源最早的使用记录,包括:Deleting the earliest usage record of the first system resource in the first buffer for storing the usage record of the first system resource includes: 判断所述第一资源链表中的表项是否全部被占用,当所述第一资源链表中的表项全部被占用时,删除所述第一资源链表的首个表项;Determine whether all the entries in the first resource linked list are occupied, and when all the entries in the first resource linked list are occupied, delete the first entry of the first resource linked list; 所述在所述第一缓存器存储所述第一系统资源的最新使用记录,包括:The storing the latest usage record of the first system resource in the first buffer includes: 在所述第一资源链表的末位增加表项,在增加的表项中记录所述第一系统资源的最新使用记录。An entry is added at the last position of the first resource linked list, and the latest usage record of the first system resource is recorded in the added entry. 5.根据权利要求3所述的方法,其特征在于,5. The method of claim 3, wherein 所述获取第一系统资源的最新使用记录,包括:The acquiring the latest usage record of the first system resource includes: 当监测到所述第一系统资源正在被使用时,判断所述第一系统资源是否为前台正在运行的目标应用所对应的系统资源,其中,所述目标应用为任一前台正在运行的应用,或者,所述目标应用为前台正在运行的指定应用;When monitoring that the first system resource is being used, it is determined whether the first system resource is the system resource corresponding to the target application running in the foreground, wherein the target application is any application running in the foreground, Or, the target application is a specified application running in the foreground; 当所述第一系统资源为所述目标应用所对应的系统资源时,获取所述第一系统资源的最新使用记录。When the first system resource is the system resource corresponding to the target application, acquire the latest usage record of the first system resource. 6.根据权利要求1所述的方法,其特征在于,所述方法还包括:6. The method of claim 1, wherein the method further comprises: 在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录之前,锁定所述n个缓存器,以使所述n个缓存器中的系统资源使用记录停止更新;Before extracting the usage records of m types of system resources from the n buffers preset in the terminal, locking the n buffers, so that the system resource usage records in the n buffers stop updating; 在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录之后,After extracting the usage records of m types of system resources from the n buffers preset in the terminal, 对所述n个缓存器进行解锁,以使所述n个缓存器中的系统资源使用记录继续更新。The n buffers are unlocked, so that the system resource usage records in the n buffers are continuously updated. 7.一种卡顿原因确定装置,其特征在于,所述装置包括:7. A device for determining the cause of a jam, wherein the device comprises: 检测模块,被配置为检测终端的显示画面是否发生卡顿;a detection module, configured to detect whether the display screen of the terminal is stuck; 提取模块,被配置为当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;The extraction module is configured to extract the usage records of m types of system resources from n buffers preset in the terminal when the display screen freezes, wherein each buffer is used to store at least one system resource usage records, n≥1, m≥1; 确定模块,被配置为根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因,其中,所述使用记录包括使用时间段,所述根据所述m种系统资源使用记录,确定所述显示画面的卡顿原因,包括:获取卡顿信息,所述卡顿信息包括所述显示画面产生卡顿的卡顿时间段;在所述m种系统资源使用记录中确定至少一个目标使用记录,所述目标使用记录的使用时间段与所述卡顿时间段存在交集;检测所述至少一个目标使用记录是否存在异常使用记录;当所述至少一个目标使用记录存在异常使用记录时,确定所述显示画面的卡顿原因为所述异常使用记录所对应的系统资源存在异常。A determination module, configured to determine the cause of the stuck display according to the usage records of the m types of system resources, wherein the usage records include a usage time period, and the usage records of the m types of system resources are: Determining the cause of the freeze on the display screen includes: acquiring the freeze information, where the freeze information includes the freeze time period during which the display screen freezes; determining at least one target in the m types of system resource usage records A usage record, the usage time period of the target usage record and the stuck time period have an intersection; detect whether there is an abnormal usage record in the at least one target usage record; when there is an abnormal usage record in the at least one target usage record, It is determined that the cause of the freezing of the display screen is that the system resource corresponding to the abnormal usage record is abnormal. 8.根据权利要求7所述的装置,其特征在于,所述装置还包括:8. The apparatus according to claim 7, wherein the apparatus further comprises: 划分模块,被配置为在所述终端的系统中划分出所述n个缓存器,每个缓存器占用的存储空间固定;a dividing module, configured to divide the n buffers in the system of the terminal, and the storage space occupied by each buffer is fixed; 更新模块,被配置为根据所述m种系统资源的最新使用记录,更新所述n个缓存器中的内容。The updating module is configured to update the contents in the n buffers according to the latest usage records of the m types of system resources. 9.根据权利要求8所述的装置,其特征在于,所述更新模块,包括:9. The device according to claim 8, wherein the update module comprises: 第一获取子模块,被配置为获取第一系统资源的最新使用记录,所述第一系统资源为所述m种系统资源中任一种系统资源;a first acquisition submodule, configured to acquire the latest usage record of a first system resource, where the first system resource is any one of the m types of system resources; 删除子模块,被配置为在用于存储所述第一系统资源的使用记录的第一缓存器中,删除所述第一系统资源最早的使用记录;a deletion submodule, configured to delete the earliest usage record of the first system resource in the first buffer for storing the usage record of the first system resource; 存储子模块,被配置为在所述第一缓存器中存储所述第一系统资源的最新使用记录。The storage submodule is configured to store the latest usage record of the first system resource in the first buffer. 10.根据权利要求9所述的装置,其特征在于,所述第一缓存器中采用第一资源链表存储所述第一系统资源的使用记录,所述第一资源链表中的所述第一系统资源的使用记录按照时间先后顺序依次排列;10 . The apparatus according to claim 9 , wherein a first resource linked list is used in the first buffer to store usage records of the first system resources, and the first resource linked list in the first resource The usage records of system resources are arranged in chronological order; 所述删除子模块,被配置为:The delete submodule is configured as: 判断所述第一资源链表中的表项是否全部被占用,当所述第一资源链表中的表项全部被占用时,删除所述第一资源链表的首个表项;Determine whether all the entries in the first resource linked list are occupied, and when all the entries in the first resource linked list are occupied, delete the first entry of the first resource linked list; 所述存储子模块,被配置为:The storage submodule is configured as: 在所述第一资源链表的末位增加表项,在增加的表项中记录所述第一系统资源的最新使用记录。An entry is added at the last position of the first resource linked list, and the latest usage record of the first system resource is recorded in the added entry. 11.根据权利要求9所述的装置,其特征在于,11. The apparatus of claim 9, wherein: 所述第一获取子模块,被配置为:The first acquisition sub-module is configured as: 当监测到所述第一系统资源正在被使用时,判断所述第一系统资源是否为前台正在运行的目标应用所对应的系统资源,其中,所述目标应用为任一前台正在运行的应用,或者,所述目标应用为前台正在运行的指定应用;When monitoring that the first system resource is being used, it is determined whether the first system resource is the system resource corresponding to the target application running in the foreground, wherein the target application is any application running in the foreground, Or, the target application is a specified application running in the foreground; 当所述第一系统资源为所述目标应用所对应的系统资源时,获取所述第一系统资源的最新使用记录。When the first system resource is the system resource corresponding to the target application, acquire the latest usage record of the first system resource. 12.根据权利要求7所述的装置,其特征在于,所述装置还包括:12. The apparatus of claim 7, wherein the apparatus further comprises: 锁定模块,被配置为锁定所述n个缓存器,以使所述n个缓存器中的系统资源使用记录停止更新;a locking module, configured to lock the n buffers, so that the system resource usage records in the n buffers stop updating; 解锁模块,被配置为对所述n个缓存器进行解锁,以使所述n个缓存器中的系统资源使用记录继续更新。The unlocking module is configured to unlock the n buffers, so that the system resource usage records in the n buffers continue to be updated. 13.一种卡顿原因确定装置,其特征在于,包括:13. A device for determining the cause of stuttering, characterized in that it comprises: 处理器;processor; 用于存储所述处理器的可执行指令的存储器;memory for storing executable instructions for the processor; 其中,所述处理器被配置为:wherein the processor is configured to: 检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck; 当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1; 根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因,其中,所述使用记录包括使用时间段,所述根据所述m种系统资源使用记录,确定所述显示画面的卡顿原因,包括:获取卡顿信息,所述卡顿信息包括所述显示画面产生卡顿的卡顿时间段;在所述m种系统资源使用记录中确定至少一个目标使用记录,所述目标使用记录的使用时间段与所述卡顿时间段存在交集;检测所述至少一个目标使用记录是否存在异常使用记录;当所述至少一个目标使用记录存在异常使用记录时,确定所述显示画面的卡顿原因为所述异常使用记录所对应的系统资源存在异常。According to the usage records of the m types of system resources, the cause of the freeze of the display screen is determined, wherein the use records include a usage time period, and the use records of the m types of system resources are used to determine the cause of the display screen. The cause of the freeze includes: acquiring the freeze information, where the freeze information includes the freeze time period during which the display screen freezes; determining at least one target usage record in the m types of system resource usage records, the target There is an intersection between the usage time period of the usage record and the freeze time period; detect whether there is an abnormal usage record in the at least one target usage record; when there is an abnormal usage record in the at least one target usage record, determine whether the display screen has an abnormal usage record. The reason for the freeze is that the system resource corresponding to the abnormal usage record is abnormal. 14.一种存储介质,其特征在于,当所述存储介质中的指令由终端的处理器执行时,使得所述终端能够执行一种卡顿原因确定方法,所述方法包括:14. A storage medium, characterized in that, when an instruction in the storage medium is executed by a processor of a terminal, the terminal is enabled to execute a method for determining the cause of a jam, the method comprising: 检测终端的显示画面是否发生卡顿;Detect whether the display screen of the terminal is stuck; 当所述显示画面发生卡顿时,在所述终端中预先设置的n个缓存器中提取m种系统资源的使用记录,其中,每个缓存器用于存储至少一种系统资源的使用记录,n≥1,m≥1;When the display screen freezes, the usage records of m types of system resources are extracted from n buffers preset in the terminal, wherein each buffer is used to store the usage records of at least one system resource, and n≥ 1, m≥1; 根据所述m种系统资源的使用记录,确定所述显示画面的卡顿原因,其中,所述使用记录包括使用时间段,所述根据所述m种系统资源使用记录,确定所述显示画面的卡顿原因,包括:获取卡顿信息,所述卡顿信息包括所述显示画面产生卡顿的卡顿时间段;在所述m种系统资源使用记录中确定至少一个目标使用记录,所述目标使用记录的使用时间段与所述卡顿时间段存在交集;检测所述至少一个目标使用记录是否存在异常使用记录;当所述至少一个目标使用记录存在异常使用记录时,确定所述显示画面的卡顿原因为所述异常使用记录所对应的系统资源存在异常。According to the usage records of the m types of system resources, the cause of the freeze of the display screen is determined, wherein the use records include a usage time period, and the use records of the m types of system resources are used to determine the cause of the display screen. The cause of the freeze includes: acquiring the freeze information, where the freeze information includes the freeze time period during which the display screen freezes; determining at least one target usage record in the m types of system resource usage records, the target There is an intersection between the usage time period of the usage record and the freeze time period; detect whether there is an abnormal usage record in the at least one target usage record; when there is an abnormal usage record in the at least one target usage record, determine whether the display screen has an abnormal usage record. The reason for the freeze is that the system resource corresponding to the abnormal usage record is abnormal.
CN201710295316.1A 2017-04-28 2017-04-28 Method, device and storage medium for determining cause of freeze Active CN107193678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710295316.1A CN107193678B (en) 2017-04-28 2017-04-28 Method, device and storage medium for determining cause of freeze

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710295316.1A CN107193678B (en) 2017-04-28 2017-04-28 Method, device and storage medium for determining cause of freeze

Publications (2)

Publication Number Publication Date
CN107193678A CN107193678A (en) 2017-09-22
CN107193678B true CN107193678B (en) 2020-06-19

Family

ID=59872235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710295316.1A Active CN107193678B (en) 2017-04-28 2017-04-28 Method, device and storage medium for determining cause of freeze

Country Status (1)

Country Link
CN (1) CN107193678B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729224B (en) * 2017-10-13 2021-10-08 北京小米移动软件有限公司 Terminal performance monitoring method and device
CN108427618B (en) * 2018-03-09 2021-09-07 北京小米移动软件有限公司 Stall state determination method, device and computer-readable storage medium
CN108536367B (en) * 2018-03-28 2020-11-13 努比亚技术有限公司 Interactive page jamming processing method, terminal and readable storage medium
CN108776624A (en) * 2018-05-29 2018-11-09 北京小米移动软件有限公司 Determine the method, apparatus and storage medium of terminal interim card reason
CN108900520B (en) * 2018-07-11 2021-04-20 广州虎牙信息科技有限公司 Live broadcast card pause factor determination method and device, server and storage medium
CN109040038B (en) * 2018-07-20 2021-02-02 广州虎牙信息科技有限公司 Method, device and equipment for determining stuck factors and storage medium
CN110300327B (en) * 2019-04-18 2021-06-15 深圳市腾讯网域计算机网络有限公司 Game client performance analysis method, device, terminal and storage medium
CN110532095B (en) * 2019-08-27 2022-06-03 Oppo(重庆)智能科技有限公司 Memory optimization method and device, electronic device, storage medium
CN112494932A (en) * 2020-11-27 2021-03-16 努比亚技术有限公司 Game frame supplementing method and device, terminal and computer readable storage medium
CN113114843B (en) * 2021-03-25 2022-06-10 北京小米移动软件有限公司 Data processing method and device, terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677302A (en) * 2004-03-29 2005-10-05 富士通株式会社 Method and system for acquiring resource usage log and computer product
CN104601770A (en) * 2014-12-25 2015-05-06 惠州Tcl移动通信有限公司 Terminal and smoothness evaluation method thereof
CN105302637A (en) * 2015-10-13 2016-02-03 广东欧珀移动通信有限公司 Method, device, and mobile terminal for recovering stuck caused by system process running abnormally
CN106528385A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 System fluency monitoring method and apparatus, and terminal
CN106528389A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 Performance evaluation method and device for system smoothness and terminal
CN106547504A (en) * 2015-09-21 2017-03-29 腾讯科技(深圳)有限公司 Fluency appraisal procedure and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7757129B2 (en) * 2007-03-30 2010-07-13 International Business Machines Corporation Generalized trace and log facility for first error data collection

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677302A (en) * 2004-03-29 2005-10-05 富士通株式会社 Method and system for acquiring resource usage log and computer product
CN104601770A (en) * 2014-12-25 2015-05-06 惠州Tcl移动通信有限公司 Terminal and smoothness evaluation method thereof
CN106547504A (en) * 2015-09-21 2017-03-29 腾讯科技(深圳)有限公司 Fluency appraisal procedure and device
CN105302637A (en) * 2015-10-13 2016-02-03 广东欧珀移动通信有限公司 Method, device, and mobile terminal for recovering stuck caused by system process running abnormally
CN106528385A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 System fluency monitoring method and apparatus, and terminal
CN106528389A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 Performance evaluation method and device for system smoothness and terminal

Also Published As

Publication number Publication date
CN107193678A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
CN107193678B (en) Method, device and storage medium for determining cause of freeze
CN107193653B (en) Bandwidth resource allocation method, device and storage medium
CN105338409B (en) Network video preloading method and device
CN107066172B (en) File transmission method and device for mobile terminal
CN106484593A (en) Log processing method, device and electronic equipment
CN107122135A (en) Data processing method and device
WO2016029642A1 (en) Background application program control method, device and terminal device
WO2017113660A1 (en) Application program management method and device
CN111031177A (en) Screen recording method, device and readable storage medium
CN107483594A (en) Method and device for displaying updated items
CN108776624A (en) Determine the method, apparatus and storage medium of terminal interim card reason
CN105791325A (en) Image sending method and device
CN108427618B (en) Stall state determination method, device and computer-readable storage medium
CN106648730A (en) Processing method and device of abnormal application
CN107632835B (en) Application installation method and device
CN104360875B (en) Privacy mode starts method and apparatus
CN106326069A (en) Method, device and system for detecting power consumption as well as equipment
CN106528385A (en) System fluency monitoring method and apparatus, and terminal
CN107316207A (en) A kind of method and apparatus for obtaining bandwagon effect information
CN109634762B (en) Data recovery method and device, electronic equipment and storage medium
CN107580142B (en) A method and apparatus for performing processing
CN107247735A (en) Document transmission method and device
CN107329744A (en) The functional module of application program starts method and device
CN107016081A (en) page loading method and device
CN106550012A (en) The monitoring method and smart machine of smart machine

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